Let's take a look at the lower layers of the OSI stack. So far,
we've talked about things like application,
presentation, and session, but now we're going to actually change
direction a bit and look at how do we actually format the
communication to go across that physical media?
The first layer of this is the transport layer.
There are two main protocols, or you could call them
languages, that we use at the transport layer,
TCP and UDP.
And depending on whether or not it's TCP or UDP,
we may call our communications to this point,
either a packet or a stream.
So, now, the transport layer worries about making sure the
traffic gets all the way to the destination,
especially if it's TCP, for example.
So we put on a transport header to make sure that hopefully that traffic
does get there, and an acknowledgement can come back.
If we looked at how TCP sets up a communication,
let's say we have two devices, Host A and Host B.
Host A wants to send traffic to Host B, so it sends what we call a SYN, that is
to synchronize a request, basically it's like saying hello, and a random number,
in this case I chose 3200. Host B gets that traffic, that SYN request from Host
A, and being very polite, it acknowledges that and sends back traffic and
increments that random number up to 3201. But it then also sends its own SYN
packet with a random number, in this case I chose 4800. Host A responds back to
that request for a SYN from Host B by acknowledging that it received that SYN
request.
This is the same as we all do as people. We see a
friend, we say, hi how are you?
That friend replies back, oh, good, thanks, and you?
To which we reply, yeah, fine.
What did we do? We proved that we can both send and receive to each
other, and that is called, therefore, a three‑way handshake. Now
that that communication session has been set up, the data can be
sent back and forth, and we then see the same as when a person is
talking on the phone.
Mm‑hmm, yeah, okay, yeah, okay, mm‑hmm. We acknowledge continuously that
we're hearing what the other person is saying so that they know we're still
there and didn't just get disconnected or drop off. Eventually, we run out of
things to say, so either side can send a FIN packet, I'm finished, with then
the number, in this case I chose 3890. Host B gets that and acknowledges,
yeah, okay, yeah, I see you're done. But, host B will then later, when it's
processed its data correctly, will send its own FIN packet because it doesn't
want Host A to leave until it's sure it's got everything organized and
structured properly. So then it sends its own FIN packet and resends that
acknowledgment, to which Host A acknowledges, yeah, I got your FIN, and we do
what's called a graceful close, we shut down this communication. So we can
see that TCP is a very well‑mannered,
very structured type of communications. When we move down to the network
layer, this is really the heartbeat of communications.
This is where most of the work happens. At the network layer, we
have a number of protocols we use all the time,
the most common being Internet Protocol, IP, but others,
such as ICMP and IGMP for, for example,
group broadcasts. When we communicate using IP, there's two
different versions we're using today.
Internet protocol v4.
Internet Protocol v4 has a 32‑bit IP address. Well, to actually tell
somebody your address is 10101100 and so on, is kind of monotonous
and probably prone to a lot of errors.
So instead, we break it into octets, so we would call it
172.16.254.2, each of those 8‑bit pieces we say what its
number would be in a decimal notation.
The problem with IPv4 is that we've kind of run out of IPv4
addresses, and IPv4 was built for communication,
not for security. It's very easy to spoof, alter, or even
lose traffic on IPv4. A person can alter to make traffic look
like it came from somebody else.
That's because it was built for a very fast and functional process.
So, a number of years ago, the late 90s, they developed IPv6.
IPv6 was developed to address many of the shortfalls in IPv4. It
greatly expanded the size of the IP address to 128 bits,
which is a phenomenally huge number.
It means, basically, the number of IP addresses available is 2 to the
power of 128, and remember, every time you add 1 bit, you actually
double the number of possible IP addresses.
So, if I went from a 32‑bit address, such as IPv4, to a 33, that would
already be twice the size of today's IPv4 address space.
We've gone to 128, which is massive.
Whenever I'm going to send traffic,
I put on a header. We talked about headers before, and we
show you what the IPv6 header would look like. You see at the
top will be the version number, it would show 6 in there,
the traffic class, the flow label, and the load of the pay length,
the location of the next header, and the hop limit, or as we
used to call it in IPv4, the time to live, so that when a
packet gets lost on the internet,
it doesn't just sail forever looking for a home. Once it's
basically used up its book of tickets, and every time it moves
from one router to another, it has to use one of those tickets,
and by the time it's gone, say 30 spaces,
then it'll actually just be dropped, it ran out of
money to continue riding the internet.
And that has saved us from the problem of having billions of lost and
lonely IP packets continuously looking for a place to go. And then there
would be the 128‑bit address of the person sending the traffic and
the128‑bit address of the person receiving it.
One of the things that was done with IPv6 was to develop Internet
Protocol Security, or IPsec, and this was to address the weaknesses of
IPv4 of spoofing and alteration of packets. At the data link layer, we
prepare things to go over the physical media, whether that physical media
is copper or wireless, and this is where we can use a protocol such as
point‑to‑point protocol,
something we used to use when we had dial‑up modems, for example, though
there are still many tens of thousands of modems in use today, in fact.
Here, we see a number of different protocols,
the ones related to wireless communications, such as Wired Equivalent Privacy,
Wi‑Fi‑Protected Access, and then Wi‑Fi‑Protected Access 2 and 3, and
of course, Hardware types of encryption as well.
When I encrypt the data that I'm sending at the data link level, I
encrypt everything except that data link header that says, what's
the next destination across the network?
We said that the physical layer is how we actually connect devices together,
whether it's wired, wireless, or fiber, for example.