How the OSI Model Works | Network Fundamentals Part 3

Articles, Blog

How the OSI Model Works | Network Fundamentals Part 3

How the OSI Model Works | Network Fundamentals Part 3

hello this is IT have you tried turning
off and on again no I’m just having a problem with the server
I can’t even pin it yeah that sounds like a layer three problem I don’t do
those bye aside from being the worst support call in history what else is
interesting about this the support officer mentioned layers he is talking
about a layer of the OSI model but what does this mean and why is it important
to us that’s what we’re here to discuss in this video all devices on the network
have Network hardware and software they need to speak a common language that is
one host needs to communicate in a way that another host can understand these
languages are called protocols which we discussed a little in the last two
videos but there isn’t just one protocol that makes the magic happen several
protocols need to work together to get the job done but trying to track how
they all interact can get complicated and that’s why we have Network models
they help us to understand how everything fits together we’re going to
go off on a tangent for a little while and use an analogy to describe the
layered model think about sending a letter or a package there’s a lot of
parts to this process some of which you don’t even see we’re going to use this
process to explain how models work to start with you write a letter you
then take that letter and put it in an envelope you write the sender address on
the back and the receivers address on the front you put a stamp on the letter
now you take it to the local post office the staff there will work out where it
needs to go and put it on the right truck anything gets delivered to the
destination post office a postman takes the letter and delivers it to your
friend’s house what we’ve done here is we’ve built a model this describes how
each of these parts interact but the details underneath may change for
example maybe we’re not writing a letter maybe we’re sending a package the
address may be local or may be international this of course changes the
number of steps we’ll need when we’re ready to send the letter we could take
it to the post office or drop another post box maybe a private courier will
come and pick it up or perhaps a bike messenger will be involved it can then
be taken to assassination by truck plane ship or some other combination of
transport and finally it may be delivered to a house a business or to a
p.o box the important part here is that we can take a model and we can use it to
understand the overall process we don’t need to know any specific details to
start with but the model can help us to understand them in the end the OSI model
can help us to understand the network it breaks the network up into seven layers
these layers are physical Data Link Network transport session presentation
and application and if that’s a bit tricky to remember think of this
mnemonic please do not throw sausage pizza away I know it’s a bit silly but
it helps us to remember the layers and their order notice that these are all
generic layers there’s no Ethernet layer or email layer the OSI model is not
about specific technologies but rather how they fit into the network stack
imagine that we have an application on one host that needs a send data to an
application on another host let’s now see how this
data moves through the OSI model the data as the application sees it starts
at the application layer this is where Network api’s and apps that access the
network live for example this includes FTP and web browsing the data needs to
be in a format that can be easily understood that’s what the presentation
layer is for anything related to data formats lives here such as image and
video files the session layer tracks application processes this includes
remote procedure calls and service requests think of this layer as building
a session between a local application and a remote one you can probably see
that the session presentation and application layers work with very large
pieces of information but that doesn’t work well for lower layers for instance
what if the data you’re transferring is very large maybe this doesn’t seem like
a problem on the surface but what happens if you get right to the end of
the transfer and the connection is interrupted you would have to start the
whole transfer again also any other application that wants to use the
network would have to wait until his transfer is complete fortunately there’s
a way around this when the data reaches the transport layer it is broken into
manageable chunks now if there’s a problem with the data only one chunk of
data needs to be resent not the entire file also apps can take turns at sending
chunks of data rather than one app hogging the hosts resources this is
called multiplexing sometimes we need to add more information adding the
destination address is an example of this any information we add to the front
of our data is called the header any information we add to the back is called
a trailer as you can see each piece of data gets bigger and bigger as it moves
through the network stack eventually the data reaches the physical layer where it
is transmitted over cable or Wireless to a remote host the remote hosts receive
the data at the physical layer the process is then reversed the data flows
back up through the layers each layer does its job removing headers and
trailers and hurting the data until it is in a form
that the application can understand can you see here that each layer will only
communicate with the layer above and the layer below each layer has its own job
to do and doesn’t get involved with other layers are then to pass and
receive data you can probably see how this makes it easy to combine different
protocols to achieve different tasks now I’m going to pose you a scenario you’re
working in the network team and users are complaining that a new high
bandwidth application is causing the network to slow down which layer do you
think needs to be addressed well I’m gonna leave that for you to think about
I’ll put the answer on the website if you’re curious will now take a closer
look at what each layer does afterward we’ll run through an example of how this
might work developers and application specialists spend a lot of time in the
upper layers this starts with the application layer this is not strictly
the application itself but rather it’s how the application accesses the network
some examples of this include web browsing accessing emails and
transferring files it also includes management sessions like ssh telnet and
RTP the application may contain a lot of data this data may not always make sense
to the rest of the network so the presentation layer helps by converting
it if needed this conversion may also include
services like encryption and compression file formats also live here including
images and video files an application may need to talk to several other
endpoints so it is important to track where these conversations are occurring
each of these conversations is called a session it’s not surprising that this is
handled at the session layer traffic you would see here includes a requests to
remote services you may have heard of session control protocol or SCP it
leaves at this layer to the transport layer is used to transport traffic
between processors on to endpoints you’ve probably heard of TCP and UDP
these are the most common protocols used at this layer earlier we were talking
about how data large enough needs to be taken and broken into manageable blocks
that’s part of what this layer does generally we call this block of data a
segment technically if you’re using TCP each block is called a segment but if
you’re using UDP each block is called a Datagram so now we have many blocks of
data probably going to different hosts for different applications so how can we
track what goes where the answer is through port numbers each flow of data
has a port number associated with the source and destination host these values
are added as part of a header to each block of data this may be easier through
an example a web server will use port 80 to listen for web traffic a workstation
will send a request to the web server with port 80 in the header it will also
select a source port and send that along as well the web server will send a
response back to the workstation using its port as the destination but to send
information from one host to another we need some form of addressing in addition
to that we need a way to route through the network that’s what the network
layer is for one of the common protocols we see here is the Internet Protocol or
IP this layer adds yet another header in the case of IP this includes the source
and destination addresses once this is done the block of data is now called a
packet now we need to think about getting data from one device to another
this is where the data link layer comes in notice that the goal is to get data
from one device to another this layer does not try to get data to the end
device that’s the responsibility of layers 3 & 4 part of this includes
establishing a logical link between the devices on the same network segment we
need to have a logical link as devices probably aren’t directly connected
they’re usually connected with a shared medium like a switch or over Wi-Fi a
well-known protocol here is Ethernet which uses MAC addresses yet another
header is added which in the case of Ethernet includes the source and
destination Mac’s a trailer may also be added we
error correction information once the header and trailer are added this block
is now called a frame as data moves across the network it will likely pass
through one or more routers as each of these routers are a separate device the
destination layer 2 addresses will change with each hop but the destination
layer 3 address will remain the same the data link layer is special as it
contains two sub layers the logical link control sub layer is responsible for
translating between the network layer and the data link layer the media access
control sub layer is the part that’s responsible for adding headers and
trailers to the packet creating the frame it’s also responsible for error
correction and finally the physical layer this concerns itself with the
physical components of the network this includes radio frequencies and channels
pulsing light pins electrical signals and standards of copper cabling further
this means that the physical layer is responsible for encoding information in
a way that can be understood for example what electrical signals represent a 1 or
a 0 or what if Wireless is used if you want to dig deeper into this topic the
CCENT guide is quite good also I have more information on my website and I’ll
include a link to both of those in the description so is this making sense to
you tell me which layers do each of these items live in I’ll put the answers
on the website of course and mole around it pause the video and
see if you can match the layer with the description how would you like to see an example of
how this works well protocols these days do not fit the OSI model exactly
remember it’s just a reference model to help us but still let’s try looking at a
client sending a request to a web server for a web page on the client side the
web browser is the application a user opens a web browser and types in a URL
the web browser uses a protocol called HTTP to prepare the request this request
is the data that needs to be sent to the server HTTP doesn’t simply fit into one
layer if you’re sitting in exam HTTP is considered an application layer protocol
however practically it spans a few layers so we’ll say that it’s an upper
layers protocol it creates the request that we want to send and it makes sure
any special characters were sending up properly encoded HTTP doesn’t really
manage a session in the upper layers that’s managed by the transport layer at
this layer a protocol called TCP is used one of the first things that TCP will do
is break the data into segments we’re only talking about a small request here
so TCP shouldn’t really need to break up anything in our particular case it does
still need to create the session we were just talking about the first part of
this is assigning port numbers HTTP usually uses port 80 on the server side
this is the destination port the client simply generates a random port number
and uses this as the source port these port numbers are added to the data in
the form of header TCP then stores all this information in memory this is how
it keeps track of this session and knows which application is waiting for the
response now the network will add addressing information in our case we’re
using IP addressing it firstly needs to know where to send the request which you
can get from the URL this becomes the destination address it also needs the
address of the client so the web server will know who to respond to this is the
source address these addresses are add to the segment as a header they are also
stored in memory along with port numbers to track the session but you’ve probably
noticed that the client and server are not directly connected they’re on
different networks were to join by a router so the packet can’t be sent
straight to the server it needs to be sent to the router first in our data
link layer we have the Ethernet protocol this creates a logical session with the
router Ethernet we’ll create a header for the packet containing the routers
MAC address as the destination and the clients MAC address as the source notice
that we don’t need any MAC addresses for the switch a simple switch operates at
layer two it’s only their two forward frames to the correct device Ethernet
also includes a small piece of error correction information call the CRC at
the end of the packet and finally it’s time to convert the frame into bits and
put them on the wire to be transmitted our data moves through the switches
without being altered and arrives at the router the router then takes out the
source and destination MAC addresses it now puts the server’s mac as the
destination and its own MAC as the source and sends the packet on it also
generates new error checking information the service NIC receives the electrical
signals from the cable at the data link layer the server will check that there
are no errors with the frame by checking the trailer if all is good it strips off
the layer two header and trailer and inspects the IP address information at
layer 3 it will check that this packet was indeed meant for itself and it will
store the source and destination IP addresses in memory so it can reply
later it now strips the layer 3 header off and looks at the source and
destination ports it will store these ports in memory along with the IP
addresses in this way it has also established a session with the client it
sees that the destination port was port 80 and it knows that it has web server
software listening on port 80 the data is then given to the correct application
and HTTP will take it from there the server will of course want to send a
response it will go through the same process to send out
over to the client the next video of this series we’ll take a look at how IP
addressing works I hope to see you there

7 thoughts on How the OSI Model Works | Network Fundamentals Part 3

  1. way above my head in understanding the material here. I'd like to know why it takes these steps for data to get to the destination host, then I think I would understand the description better.

  2. 14:57 I don't understand this 100%
    Is it saying that we don't need any MAC address for 'This' switch?
    Because 'this' switch is just one of the steps for the frame?
    We still need client's and server's MAC address, don't we.
    Then where do we put server's Mac address, along with the next routing step's MAC address?
    Please, anybody?

  3. THIS is just a goldmind. When ppl say "yea, jus go watch youtube." they talking about watch these kinda guys,
    Dude thank you u really peaked my interest in these videos and in networking in general. Keep up the videos m8.

  4. Thanks for such great explanation of the concepts. I thought these were very difficult to understand. But you have made them real simple and easy to follow.

Leave a Reply

Your email address will not be published. Required fields are marked *