OSI Model: A Practical Perspective - Part 2 - Networking Fundamentals - Lesson 2 — Transcript
Full transcript
- 0:01hello welcome to another video from the
- 0:02first module of my new course on
- 0:04networking fundamentals
- 0:05this module will teach you everything
- 0:07you need to know to understand how
- 0:09packets move through the internet
- 0:11in this video we'll continue our
- 0:12discussion of the osi model from a
- 0:14practical perspective
- 0:16in the first part of this lesson we
- 0:17unpacked how layer 1 layer 2 and layer 3
- 0:20contribute to the overall goal of
- 0:21networking
- 0:23we discussed that layer 1 the physical
- 0:24layer was responsible for transporting
- 0:26ones and zeros across the wire
- 0:29we then illustrated how if this host has
- 0:31some data needs to send to this host
- 0:33it needs to start by adding a layer 3
- 0:35header which will facilitate carrying
- 0:37the data from one end to the other
- 0:39then a new layer 2 header will be added
- 0:41to carry the data from one hop to the
- 0:43next
- 0:44this will continue across the entire
- 0:46path between these two hosts
- 0:48if you haven't watched that video go
- 0:50ahead and pause this video and watch
- 0:52that one first
- 0:53there'll be a link in the description
- 0:54otherwise we'll continue right where we
- 0:56left off by discussing layer 4 of the
- 0:58osi model
- 0:59the transport layer the overall goal of
- 1:03the transport layer of the osi model
- 1:05is what i'm going to call service to
- 1:07service delivery
- 1:08let me explain what i mean by that here
- 1:10is a computer
- 1:12this computer has an ip address and has
- 1:14a mac address
- 1:16in a pretty common scenario whoever is
- 1:18using this computer has a web browser
- 1:20open and is browsing the web
- 1:22but maybe at the same time that user is
- 1:24also running some sort of chat program
- 1:26something like slack or discord or irc
- 1:29and at the very same time that user
- 1:30might
- 1:31also be running some sort of online game
- 1:33well
- 1:34each of those programs is meant to send
- 1:36and receive data on the wire
- 1:38all that data will be destined to this
- 1:40layer 3 header to accomplish end to end
- 1:42delivery
- 1:43and this layer 2 headers to accomplish
- 1:45hop to hop delivery
- 1:47the question then is how do we make sure
- 1:50the right program
- 1:51receives the right packets well that's
- 1:53where layer 4 comes into play
- 1:55layer 4 is there to distinguish data
- 1:57streams it's going to take all the
- 1:59incoming data
- 2:00and make sure that the right program
- 2:02receives the right data
- 2:05just like layer 3 had an addressing
- 2:07scheme to do
- 2:08end-to-end delivery and layer 2 had an
- 2:10addressing scheme to do
- 2:12hopped hop delivery layer 4 is also
- 2:14going to be using its own addressing
- 2:16scheme to accomplish its goal of service
- 2:18to service delivery
- 2:20layer 4's addressing scheme involves
- 2:22ports
- 2:23now there are two sets of ports there's
- 2:25zero to sixty five thousand for tcp
- 2:28and zero to sixty five thousand for udp
- 2:31tcp and udp are two different strategies
- 2:34for distinguishing data streams
- 2:36tcp favors reliability and udp favors
- 2:39efficiency
- 2:41both tcp and udp are simply different
- 2:43strategies for accomplishing the goal of
- 2:45layer 4.
- 2:46their inner workings are both
- 2:48significant and fascinating but
- 2:49unfortunately they are outside the scope
- 2:51of this lesson
- 2:52they will both be covered in detail in a
- 2:54later lesson in this course
- 2:56but the way they work is that every
- 2:58single program that's expected to
- 2:59receive
- 3:00or send data on the wire is going to be
- 3:02associated with a particular port number
- 3:04then when data arrives on the wire it's
- 3:07going to include
- 3:07a layer 4 header in addition to the
- 3:10layer 3 and the layer 2 header that
- 3:11we've already discussed
- 3:13that layer 4 header will indicate which
- 3:14particular program should be receiving
- 3:16that data
- 3:17and that's what layer four is going to
- 3:18use to make sure the right program
- 3:20receives the right
- 3:21ones and zeros so that's a high level
- 3:24overview of how layer four distinguishes
- 3:26data streams
- 3:28but let's pick it apart in more detail
- 3:32here is a client and three servers as we
- 3:34discussed in the first lesson
- 3:36a server is nothing more than a computer
- 3:38which is running software which knows
- 3:40how to respond to specific requests
- 3:44each of these pieces of software is
- 3:46assigned a predefined
- 3:47well-known port number which correlates
- 3:49to the underlying network
- 3:51application let's say bank.com is
- 3:54listening for secure web request
- 3:56using https which is assigned tcp port
- 3:59443
- 4:00and the server for site.com is
- 4:02responding to general web requests using
- 4:04http
- 4:06which by default listens on tcp port 80.
- 4:09and this chat server is running irc
- 4:12which stands for internet relay chat
- 4:14which is an online chat application
- 4:15which runs on udp port 6667
- 4:19when the client is making a request to
- 4:21these servers it's not only making a
- 4:22request to the ip address it's also
- 4:25going to make a request to the specific
- 4:26port in question
- 4:28then for each request made by the client
- 4:30the client is going to choose a random
- 4:32port number to use as the source port
- 4:34for the connection
- 4:36so a connection from our client to
- 4:38site.com would look like this
- 4:42includes a source port of 9999 that's
- 4:45the port that the client randomly
- 4:46selected for this particular connection
- 4:48the destination of this packet is
- 4:50destined to the ip address of site.com
- 4:53going to tcp port 80 which is the http
- 4:56application
- 4:57keep in mind that the source and
- 4:59destination ip addresses are going to
- 5:01exist in the layer 3 header of the
- 5:02packet
- 5:03and the source and destination port are
- 5:05going to exist in the layer 4 header of
- 5:07the packet
- 5:09now this randomly selected source port
- 5:11is actually very important
- 5:13it is actually the port the client will
- 5:15listen to for the response to the
- 5:17original request
- 5:19meaning when this server responds to
- 5:21this web request
- 5:22that packet will look like this notice
- 5:25the destination port
- 5:27is 9999 that's the same port that was
- 5:30initially selected by the client
- 5:31randomly on the outbound initial packet
- 5:35so for all connections there is always a
- 5:37source port and a destination port that
- 5:39are involved
- 5:40the destination port is typically
- 5:42governed by the application in use
- 5:44and the source port is randomly selected
- 5:46by the client
- 5:47so our connection from the client to
- 5:49site.com has the following attributes
- 5:52it is a tcp connection from this ip
- 5:54address and port
- 5:55to this ip address and port notice that
- 5:58in the initial packet
- 6:00this was the source and this was the
- 6:02destination
- 6:03and in the response packet it's the
- 6:04exact opposite this was the source
- 6:07and this was the destination
- 6:10this process occurs for each connection
- 6:12made by the client
- 6:13in each case the client is selecting a
- 6:15new random source port
- 6:18this makes it so that when all these
- 6:19servers respond whatever comes back
- 6:21on port 8888 will be given to the web
- 6:24browser
- 6:25and whatever comes back on port 7777
- 6:28will be given to the irc client
- 6:30in this way the data streams are kept
- 6:32isolated from each other
- 6:34these ports will ensure that the right
- 6:36application gets the right data
- 6:40this process also allows the client to
- 6:42make multiple connections to the same
- 6:43server
- 6:44consider when you are browsing the
- 6:46internet i imagine you've often had
- 6:48multiple tabs open to the same website
- 6:50well the reason each of those browser
- 6:51tabs don't accidentally display the data
- 6:53from another tab
- 6:55is that each time you open a new tab
- 6:57your client meaning your web browser
- 6:59generates a new random source port
- 7:03so that is how data streams are
- 7:04distinguished from one another
- 7:06it is a function of udp or tcp which are
- 7:09both layer 4 protocols
- 7:11and again layer 4's ultimate goal is
- 7:12what i'm calling service to service
- 7:14delivery of data
- 7:18which finally brings us to the last
- 7:20three layers of the osi model
- 7:22back when they first created the osi
- 7:24model each of these layers had a
- 7:26distinct function
- 7:27independent from the rest however
- 7:29currently
- 7:30the distinction between these layers is
- 7:32somewhat vague
- 7:33every application is in fact free to
- 7:35implement the functions of layer 5 6 and
- 7:377 as they choose
- 7:38therefore often these three layers are
- 7:41simply considered as a single
- 7:43universal application layer in fact
- 7:46the other popular internet communication
- 7:48model actually does
- 7:49exactly that the tcp model combines all
- 7:52the functions of the osi layers 5
- 7:546 and 7 into a single layer
- 7:58now the goal of this module is to teach
- 8:00you how data flows
- 8:01through the internet and the most
- 8:03critical layers to understand for that
- 8:04is layers one through four
- 8:06therefore we aren't going to pick apart
- 8:08the original intended distinction
- 8:10between layers 5 6 and 7. if you're
- 8:13curious however
- 8:14go ahead and let me know in the comments
- 8:16below and i can cover it in another
- 8:17video
- 8:18as for us we're going to follow the tcp
- 8:20model's lead and simply consider
- 8:22all three of these layers as the
- 8:24application
- 8:29so now that we've talked through the
- 8:31entire osi model i want to show you
- 8:33what's actually happening when hosts are
- 8:35communicating to each other using this
- 8:36networking stack
- 8:38this host has an application that's
- 8:40going to generate data that is meant to
- 8:41be sent to the other side
- 8:43what that host is going to go through is
- 8:45what's known as the encapsulation
- 8:46process
- 8:47that data will be first sent to layer 4.
- 8:50layer 4 is going to add a header to that
- 8:52data which can facilitate the goal of
- 8:54layer 4 which is service to service
- 8:56delivery
- 8:57in this case it is a tcp header which is
- 8:59going to include
- 9:00the source port and destination port for
- 9:02this particular data
- 9:04the construct of a layer 4 header plus
- 9:06data is known as a segment
- 9:08that segment is going to be passed down
- 9:10the osi stack
- 9:12to the next layer in this case layer 3
- 9:14the network layer
- 9:15and the network layer is going to add
- 9:17another header to this data
- 9:19this header is going to facilitate the
- 9:21goal of layer 3 which is end to end
- 9:23delivery meaning in this header you'll
- 9:25have something like a source ip address
- 9:27and a destination iputrus
- 9:31the construct of a layer 3 header and
- 9:33its data is known as a packet
- 9:36now notice that inside the data of the
- 9:38packet is the layer 4 header that was
- 9:40above it
- 9:41but from layer 3's perspective it
- 9:43doesn't know or doesn't care what's
- 9:44inside that data
- 9:45it's simply a bunch of ones and zeros
- 9:47that need to be delivered to the other
- 9:49end
- 9:50either way layer 3 will then take that
- 9:52packet and hand it off to layer 2
- 9:54and layer 2 will once again add another
- 9:56header to that data
- 9:58to accomplish layer 2's goal of hop to
- 10:00hop delivery
- 10:01meaning this header will include
- 10:03something like a source mac address and
- 10:04a destination mac address
- 10:06the construct of a layer 2 header and
- 10:08its ensuing data is known as a frame
- 10:11and that frame gets converted into ones
- 10:13and zeros and finally put
- 10:15on the wire on the other side the
- 10:17receiving host is going to do the
- 10:19opposite process it's going to do d
- 10:22encapsulation
- 10:23meaning it's going to take those ones
- 10:25and zeros off the wire to convert them
- 10:26back into their frame
- 10:28layer two is going to look at the layer
- 10:29two header to make sure that it is
- 10:31indeed addressed to this
- 10:32host's nic if it is it's going to
- 10:35discard that header and pass that up the
- 10:37stack
- 10:38then layer 3 is going to look at the ip
- 10:40header to confirm it is indeed addressed
- 10:42to this host's ip address if it is it's
- 10:45going to discard that layer 3 header and
- 10:47pass it up the stack
- 10:48to the transport layer layer 4 will then
- 10:51take a look at the layer 4 header
- 10:52to identify the port that this data is
- 10:54destined to and will deliver the data to
- 10:57the appropriate application
- 10:58the application can then finally process
- 11:00the data
- 11:02that is the process of encapsulation and
- 11:04de-encapsulation
- 11:06notice each layer is going to add
- 11:07information to the data
- 11:09in order to accomplish its goal
- 11:13and this brings us to the final idea i
- 11:14want to communicate to you about the osi
- 11:16model
- 11:17throughout this lesson we've mentioned
- 11:19that networking devices
- 11:21operate at specific layers for example
- 11:23switches and routers operate at layer 2
- 11:25and layer 3 respectively what that means
- 11:28is that they only look into the datagram
- 11:30up to their respective layer for example
- 11:33switches which are layer 2 devices
- 11:35are only looking at the frame meaning
- 11:37they're only looking at the layer 2
- 11:39header to make a decision
- 11:40they're not looking inside the data
- 11:42payload into the layer 3 and layer 4
- 11:44headers which we know exists there
- 11:46they're only looking up to the layer 2
- 11:48header
- 11:49moreover we've discussed that there are
- 11:51various protocols which operate at
- 11:52specific layers
- 11:54for instance the ip protocol is a layer
- 11:563 protocol
- 11:57tcp and udp are layer 4 protocols
- 12:01that said neither of these are strict
- 12:04rules
- 12:05there are exceptions to each of these
- 12:06that exist
- 12:08for example if you take a router which
- 12:10typically operates at layer 3
- 12:12but configure access list on that router
- 12:15now that router is looking into the
- 12:16layer 4 header to make a decision
- 12:18so the router isn't purely a layer 3
- 12:20device anymore
- 12:22moreover earlier in this lesson we
- 12:24discussed the arp protocol and we
- 12:25discussed how arp
- 12:26links a layer 2 address to a layer 3
- 12:28address links an ip address to a mac
- 12:30address
- 12:31which means arp doesn't purely fit in
- 12:33layer 3 nor does it purely fit in layer
- 12:352.
- 12:36the point i'm trying to make is that the
- 12:38osi model is simply a model
- 12:40it's not rigid rules that everything in
- 12:42networking adheres to
- 12:44it's simply a way to conceptualize what
- 12:46is required for data to flow
- 12:48through the internet and that wraps up
- 12:50our lesson on the osi model
- 12:53the main takeaway for this lesson is
- 12:55understanding that each layer of the osi
- 12:57model
- 12:57has a specific function that contributes
- 12:59the overall goal
- 13:01of allowing two hosts to share data with
- 13:03one another
- 13:04each layer uses its own addressing
- 13:06scheme to accomplish their various goals
- 13:08and finally there are various devices
- 13:10and protocols which operate at specific
- 13:12layers of the osi model
- 13:14which serve in accomplishing each
- 13:16layer's goal but do keep in mind
- 13:18exceptions do exist in the next lesson
- 13:21we'll be looking at everything a host
- 13:23does to put data on the wire
- 13:24but that's it for this lesson i hope you
- 13:27enjoyed this video
- 13:28i want to thank you for watching and
- 13:30i'll see you in the next lesson when we
- 13:31discuss
- 13:32everything a host does when
- 13:33communicating on the internet
- 13:35hey youtube i hope you enjoyed that free
- 13:37lesson for my new course on networking
- 13:39fundamentals
- 13:39i'll be releasing the entire first
- 13:41module for free here on youtube
- 13:43i want this course to be the ultimate
- 13:45networking fundamentals course and since
- 13:47i'm still scoping out the outline you
- 13:48could have a say in what topics will be
- 13:49covered
- 13:50let me know in the comments below what
- 13:52subjects you want included in this
- 13:53course
- 13:54otherwise remember to like and subscribe
- 13:56and of course if you learned something
- 13:57from this video the best way to thank me
- 13:59is to share this video
- 14:00it's a small act of gratitude but one i
- 14:02appreciate greatly
- 14:04i hope you enjoyed this lesson i want to
- 14:06thank you for watching and we'll see you
- 14:07in the next one
About this transcript
This page contains the full transcript of OSI Model: A Practical Perspective - Part 2 - Networking Fundamentals - Lesson 2 by Practical Networking, generated from the public captions YouTube serves with the video. The transcript has 2,594 words across 444 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.
What you can do with it
Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to translate the transcript into 100+ languages.
Free YouTube transcript tool
YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, translation to 100+ languages, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.