Welcome back.
And in this part of the lesson series,
we're going to look at layer two have the OSI model,
which is the data link layer.
Now the data link layer is one of the most critical layers
in the entire OSI seven layer model.
Everything above this point relies on the device to device
communication which the data link layer provides.
So when you're sending or receiving data
to or from the internet,
just be aware that the data link layer
is supporting the transfer of that data,
so it's essential that you understand.
Now this is going to be one of the longer parts
of this lesson series because layer two
actually provides a significant amount of functionality.
Now before I step through the architecture of layer two,
we have to start with the fundamentals.
Layer two, which is the data link layer runs over layer one.
So layer two network requires a functional
layer one network to operate.
And that's something which is common
throughout the OSI model.
Higher layers build on lower layers,
adding features and capabilities.
A layer two network can run on different types
of layer one network so copper, fiber, WiFi,
and provide the same capabilities.
Now there are different layer two protocols and standards
for different situations.
But for now, we're going to focus on Ethernet,
which is what most local networks use,
so things in your office or things in your home.
Now layer two rather than being focused
on physical wavelengths or voltages
introduces the concept of frames and frames are a format
for sending information over a layer two network.
Layer two also introduces a unique hardware address
called a MAC address for every device on a network.
This hardware address is a hexadecimal address,
it's 48 bits long, and it looks like this so three e, colon,
two two colon fb, and so on.
The important thing to understand is that a MAC address
generally for physical networking is not software assigned,
the address is uniquely attached
to a specific piece of hardware.
A MAC address is formed of two parts, the OUI,
which is the organizationally unique identifier,
and this is assigned to companies
who manufacture network devices.
So each of these companies will have a separate OUI.
The second part of the MAC address
is the network interface controller or NIC specific,
and this means together, the MAC address on a network card
should be globally unique.
Now layer two as I've mentioned uses layer one,
this means that a layer two or Ethernet frame can be
transmitted onto the shared physical medium by layer one.
This means that it's converted into voltages RF or light,
it's sent across the medium,
and then received by other devices
also connected to that shared medium.
It's important to understand this distinction.
Layer two provides frames as well as other things
which I'll cover soon.
And layer one handles the physical transmission
and reception onto and from the physical shared medium.
So when layer one is transmitting a frame
onto the physical medium,
layer one doesn't understand the frame,
layer one is simply transmitting raw data
onto that physical medium.
Now a frame which is the thing that layer two uses
for communication is a container of sorts.
It has a few different components.
The first part is the preamble and start frame delimiter.
And the function of this is to allow devices to know
that it's the start of the frame,
so they can identify the various parts of that frame,
you need to know where the start of the frame is
to know where the various parts of that frame start.
Next comes the destination and the source MAC addresses.
So all devices on a layer two network
have a unique MAC address and a frame can be sent
to a specific device on a network
by putting its MAC address in the destination field
or you can put all F's if you want to send the frame
to every device on the local network
and this is known as a broadcast.
Now the source MAC address field
is set to the device address
of whatever is transmitting the frame,
and this allows it to receive replies.
Next is EtherType, and this is commonly used to specify
which last three protocol is putting its data
inside a frame, just like layer two uses layer one
to move raw bitstream data across the shared physical medium
while layer three users layer two frames
for device to device communication on a local network.
And so when you're receiving a frame
at the other side of the communication,
you need to know which layer three protocol
originally put data into that frame.
A common example might be IP or the Internet Protocol.
So this is what the EtherType or ET field is used for.
Now these three fields are commonly known as the MAC header,
they control the frame destination,
they indicate the source and specify its function.
After the header is the payload and this is anywhere
from 46 to 1500 bytes in size for standard frames.
It contains the data that the frame is sending,
the data is generally provided by the layer three protocol
and the protocol which is being used, as I just mentioned,
is indicated within the EtherType or ET field.
Now this process is called encapsulation,
you have something which layer three generates
often this is an IP packet, and this is put inside
an Ethernet frame, it's encapsulated in that frame.
The frame delivers that data to a different
layer two destination.
On the other side, the frame is analyzed,
and the layer three packet is extracted
and given back to layer three at the destination side.
The EtherType field is used to determine
which layer three protocol receives this at the destination.
And then finally, at the end of the frame
is the frame check sequence which is used to identify
any errors in the frame.
It's a simple CRC check, it allows the destination to check
if corruption has occurred or not.
So that's the frame and it's an important thing
to understand if you are to understand how all of the bits
of layer one, two and three fit together.
So layer two frames are generated by the layer two software
at the source side, they're passed to layer one,
that raw data is transmitted onto the physical medium,
it's taken off the physical medium at the destination side,
it's passed to its layer two software,
and that can interpret the frame and pass that on
to layer three, which can then interpret that data.
Now as a reminder, this is the problem that we have
with a purely layer one network implementation.
We have two devices running a game,
a laptop on the left and a laptop on the right,
and these are connected using a single network cable,
a shared physical medium.
Now as I mentioned earlier in this lesson series,
layer one provides no media access control.
The layer one software running on a network card will simply
transmit any data it receives onto the physical medium.
So if the game on the left send some data
it will be transmitted onto the medium,
and it will be seen by the device on the right.
The problem is that the laptop on the right
could also be sending data at the same time.
This means the electrical signals
will overlap and interfere with each other,
and this is known as a collision.
And it impacts both pieces of data, it corrupts both.
This is one of the problems of layer one,
which is solved by layer two, and layer two provides
controlled access to the physical medium.
And let's explore how.
Okay, so this is the end of part one of this lesson.
It was getting a little bit on the long side,
and so I wanted to add a break,
it's an opportunity just to take a rest or grab a coffee.
Part two we'll be continuing immediately
from the end of part one.
So go ahead complete the video
and when you're ready, join me in part two.