IP addresses can be configured statically or dynamically. If you go the static way you have to configure the IP address yourself on your computer, router or switch.
Dynamic means we use DHCP (Dynamic Host Configuration Protocol). DHCP is a server process that assigns IP addresses from a “pool” to network devices.
A cisco router can be used as a DHCP server but you will also see this often on Microsoft or Linux servers.
Dynamic means we use DHCP (Dynamic Host Configuration Protocol). DHCP is a server process that assigns IP addresses from a “pool” to network devices.
A cisco router can be used as a DHCP server but you will also see this often on Microsoft or Linux servers.
The Transport Layer TCP and UDP:
Let's work our way up the OSI-model, we just covered IP and now it's time to pick a “transport” protocol.
Keep in mind IP is “nothing more” but a number (ok that's very simplistic) but I want to make sure you understand we need a transport protocol for actually setting up the connection and sending data between our computers.
I want to focus on the transport protocols that are used most of the time:
- TCP (Transmission Control Protocol)
- UDP (User Datagram Protocol)
Let's work our way up the OSI-model, we just covered IP and now it's time to pick a “transport” protocol.
Keep in mind IP is “nothing more” but a number (ok that's very simplistic) but I want to make sure you understand we need a transport protocol for actually setting up the connection and sending data between our computers.
I want to focus on the transport protocols that are used most of the time:
- TCP (Transmission Control Protocol)
- UDP (User Datagram Protocol)
So why do we have 2 different transport protocols here, why do we care and when do we need one over another?
The short answer is:
- TCP is a reliable protocol.
- UDP is a unreliable or best-effort protocol.
Unreliable you might think? Why do I want data transport which is unreliable? Does that make any sense? Let me tell you a little story to explain the difference between the two protocols.
The short answer is:
- TCP is a reliable protocol.
- UDP is a unreliable or best-effort protocol.
Unreliable you might think? Why do I want data transport which is unreliable? Does that make any sense? Let me tell you a little story to explain the difference between the two protocols.
You are sitting behind your computer and downloading the latest greatest movie in 1080P HD with 7.1 surround super sound directly from Universal studio's brand new “download on demand” service (hey you never know…it might happen one day…).
This file is 20GB and after downloading 10GB there's something going wrong and a couple of IP packets don't
make it to your computer, as soon as the entire download is done you try to play the movie and you get all kind of errors. Unable to watch the movie you are frustrated and head for the local dvd rental place to watch some low-quality movie…
Ok maybe I exaggerate a bit but I think you get the idea; you want to make sure the transport of your download to your computer is reliable which is why we use TCP. In case some of the IP packets don't make it to your computer you want to make sure this data will be retransmitted to your computer!
This file is 20GB and after downloading 10GB there's something going wrong and a couple of IP packets don't
make it to your computer, as soon as the entire download is done you try to play the movie and you get all kind of errors. Unable to watch the movie you are frustrated and head for the local dvd rental place to watch some low-quality movie…
Ok maybe I exaggerate a bit but I think you get the idea; you want to make sure the transport of your download to your computer is reliable which is why we use TCP. In case some of the IP packets don't make it to your computer you want to make sure this data will be retransmitted to your computer!
In our second story you are the network engineer for a major company and you just told your boss how awesome this brand new open source Voice over IP solution is.
You decide to implement this new VoIP solution and to get rid of all the analog phones but your users are now complaining big time that their phone call quality is horrible. You contact the open source VoIP solution provider and you find out that they thought it would be a good idea to use a reliable transport protocol like TCP since well, we want phone calls to be reliable right?
Wrong thinking! TCP does error correction which means that data that didn‟t make it to your
computer will be retransmitted. How weird will your phone call sound if you are talking to
someone and you hear something that they said a few seconds ago?
It's real-time so we don't want retransmission. It's better to send VoIP packets and lose a few than
retransmitting them afterwards, your VoIP codec can also fix packet loss up to a certain degree.
In this example we'll want to use a best effort or unreliable protocol which is UDP.
You decide to implement this new VoIP solution and to get rid of all the analog phones but your users are now complaining big time that their phone call quality is horrible. You contact the open source VoIP solution provider and you find out that they thought it would be a good idea to use a reliable transport protocol like TCP since well, we want phone calls to be reliable right?
Wrong thinking! TCP does error correction which means that data that didn‟t make it to your
computer will be retransmitted. How weird will your phone call sound if you are talking to
someone and you hear something that they said a few seconds ago?
It's real-time so we don't want retransmission. It's better to send VoIP packets and lose a few than
retransmitting them afterwards, your VoIP codec can also fix packet loss up to a certain degree.
In this example we'll want to use a best effort or unreliable protocol which is UDP.
What do we have in the table above? First of all you see “connection type”. TCP is connection-oriented which means it will “setup” a connection and then start transferring data.
UDP is connectionless which means it will just start sending and doesn't care if it arrives yes or not.
The connection that TCP will setup is called the “3 way handshake”.
Sequencing means that we use a sequence number, if you download a big file you need to make sure that you can put all those packets back in the right order.
As you can see UDP does not offer this feature, there's no sequence number there.
So what about VoIP? Don't we need to put those packets back in order at the receiver side?
Well actually yes we do otherwise we get some strange conversations. UDP does not offer this “sequencing” feature though…let me tell you a little secret: for VoIP it's not just UDP that we use but we also use RTP which does offer sequencing! (And some other cool features we need for VoIP).
UDP is connectionless which means it will just start sending and doesn't care if it arrives yes or not.
The connection that TCP will setup is called the “3 way handshake”.
Sequencing means that we use a sequence number, if you download a big file you need to make sure that you can put all those packets back in the right order.
As you can see UDP does not offer this feature, there's no sequence number there.
So what about VoIP? Don't we need to put those packets back in order at the receiver side?
Well actually yes we do otherwise we get some strange conversations. UDP does not offer this “sequencing” feature though…let me tell you a little secret: for VoIP it's not just UDP that we use but we also use RTP which does offer sequencing! (And some other cool features we need for VoIP).
Let's sum up what we now know about UDP and TCP:
UDP:
- It operates on the transport layer of the OSI model.
- Is a connectionless protocol, does not setup a connection…just sends data.
- Limited error correction because we have a checksum.
- Best-effort or unreliable protocol.
- No data-recovery features.
TCP:
- It's a reliable protocol.
- Before you send data you will setup the connection by using the 3 way handshake.
- After sending X amount of bytes you will receive an acknowledgment (ACK) from the other side.
- How many bytes you send before you get an ACK is controlled by using the “window size”.
- TCP can do retransmissions.
UDP:
- It operates on the transport layer of the OSI model.
- Is a connectionless protocol, does not setup a connection…just sends data.
- Limited error correction because we have a checksum.
- Best-effort or unreliable protocol.
- No data-recovery features.
TCP:
- It's a reliable protocol.
- Before you send data you will setup the connection by using the 3 way handshake.
- After sending X amount of bytes you will receive an acknowledgment (ACK) from the other side.
- How many bytes you send before you get an ACK is controlled by using the “window size”.
- TCP can do retransmissions.
Ethernet:
Ethernet is the protocol that we are running on our LAN. So what layer(s) of the OSI model do you think Ethernet will describe? If you are thinking “Data link” layer you got it right but it also describes the physical layer.
Now here things will get a bit funky, Ethernet describes the Data link layer but it has been split up in two pieces, so it looks like this:
Ethernet is the protocol that we are running on our LAN. So what layer(s) of the OSI model do you think Ethernet will describe? If you are thinking “Data link” layer you got it right but it also describes the physical layer.
Now here things will get a bit funky, Ethernet describes the Data link layer but it has been split up in two pieces, so it looks like this:
So there are sublayers called “LLC” which stands for Logical Link Control and “MAC” which stands for “Media Access Control”. You have probably seen or heard about MAC addresses before.
The logical link control layer does a couple of things like error correction. We don‟t care about this as much nowadays because we use TCP which does error correction on the transport layer.
Keep in mind that Ethernet was invented a long time ago and we used to have a lot of other network protocols besides IP like IPX, AppleTalk, Novell etc.
The logical link control layer does a couple of things like error correction. We don‟t care about this as much nowadays because we use TCP which does error correction on the transport layer.
Keep in mind that Ethernet was invented a long time ago and we used to have a lot of other network protocols besides IP like IPX, AppleTalk, Novell etc.
The MAC sublayer is more interesting to us; let me describe its functions and why we need it.
First of all every device on our LAN has a unique identifier on the data link layer, this is our “MAC address”. Just as an IP address is a unique identifier on the network layer (layer 3) we have the MAC address as a unique identifier on the data link layer (layer 2).
One of the other things that our MAC sublayer does is taking care of channel access. This makes it possible so computers connected to the same physical medium can access and share it. What do I mean by “same physical medium”? We have to take a little history lesson here.
First of all every device on our LAN has a unique identifier on the data link layer, this is our “MAC address”. Just as an IP address is a unique identifier on the network layer (layer 3) we have the MAC address as a unique identifier on the data link layer (layer 2).
One of the other things that our MAC sublayer does is taking care of channel access. This makes it possible so computers connected to the same physical medium can access and share it. What do I mean by “same physical medium”? We have to take a little history lesson here.
Do you remember those network cables? If you don't…good for you!
All computers in the network were connected to a single long black coax cable (our physical medium) and were sharing the network.
A network like this was half-duplex which means that only 1 computer was able to send traffic and the others had to wait. Nowadays we have full-duplex which means all devices can send and receive at the same time!
This is our bus topology right here! What do you think would happen if two computers would start sending data at the exact same moment?
That's right…you get a collision! Electrical signals bouncing into each other and no data transmission at all…
All computers in the network were connected to a single long black coax cable (our physical medium) and were sharing the network.
A network like this was half-duplex which means that only 1 computer was able to send traffic and the others had to wait. Nowadays we have full-duplex which means all devices can send and receive at the same time!
This is our bus topology right here! What do you think would happen if two computers would start sending data at the exact same moment?
That's right…you get a collision! Electrical signals bouncing into each other and no data transmission at all…
Back to our MAC sublayer, if you are running a half-duplex network we need to make sure that whenever there's a collision on the network we have a solution.
There is one and this protocol is called CSMA/CD.
CS = Carrier Sense
MA = Multi Access
CD = Collision Detection
There is one and this protocol is called CSMA/CD.
CS = Carrier Sense
MA = Multi Access
CD = Collision Detection
Carrier sense means we can “listen” on the cable to hear if anything is going on, in other words if another computer is sending data at this moment.
Multi access means everyone can access our physical medium but it has to be clear…no other computer should be sending at that moment.
In case 2 computers send at the same time we have a collision, since we can detect this (its carrier sense right) CSMA/CD will solve this as following:
- 1. The two computers that had the collision will start jamming the physical medium;
this will ensure nobody else can transmit at that moment.
- 2. The two computers each start a random clock.
- 3. When the time of the random clock elapses they retransmit.
Since the clock is random, both computers will have a different timer and one of them will send its data before the other.
By jamming the physical medium we will be certain that no other computer will get a chance to send data before them.
Multi access means everyone can access our physical medium but it has to be clear…no other computer should be sending at that moment.
In case 2 computers send at the same time we have a collision, since we can detect this (its carrier sense right) CSMA/CD will solve this as following:
- 1. The two computers that had the collision will start jamming the physical medium;
this will ensure nobody else can transmit at that moment.
- 2. The two computers each start a random clock.
- 3. When the time of the random clock elapses they retransmit.
Since the clock is random, both computers will have a different timer and one of them will send its data before the other.
By jamming the physical medium we will be certain that no other computer will get a chance to send data before them.
A MAC address is 48-bits and consists of a couple of fields:
- 1. BC which stands for broadcast; If your Ethernet frame is a broadcast than you have to set this bit to 1.
- 2. Local: this bit has to be set when you change your MAC address. Normally a MAC address is unique on the planet; if you change it it's only locally unique within your network.
- 3. OUI which stands for Organization Unique Identifier; every network vendor has received 22 bits that identifies them.
- 4. The last 24 bits are Vendor Assigned; the network vendor will use these bits to give each network device a unique MAC address.
- 1. BC which stands for broadcast; If your Ethernet frame is a broadcast than you have to set this bit to 1.
- 2. Local: this bit has to be set when you change your MAC address. Normally a MAC address is unique on the planet; if you change it it's only locally unique within your network.
- 3. OUI which stands for Organization Unique Identifier; every network vendor has received 22 bits that identifies them.
- 4. The last 24 bits are Vendor Assigned; the network vendor will use these bits to give each network device a unique MAC address.
We write down MAC addresses in hexadecimal so it will look like something like this:
00:00:0C:52:31:04
00:00:0C:52:31:04
You have probably familiar seen UTP (Unshielded Twisted Pair) cabling but did you know we
have two different types of cables?
- Straight-through
- Crossover
have two different types of cables?
- Straight-through
- Crossover