And in this section we gonna look at TCP/IP transport layer or layer 4 of the OSI model.
We are specifically gonna concentrate on the TCP and UDP protocol that reside at this layer.
I’d like to start up with the comparison of UDP and TCP
and show you the differences between those 2 protocols
we need to have a discussion of port numbers and explain how ports numbers are used.
We look at the details of UDP and the details of TCP
and we look at some of the mechanisms that TCP uses including the TCP 3 way handshake.
We gonna look at windowing and we're gonna look at sequence numbers.
So there's quite a bit to cover on these 2 protocols.
Before discussing TCP and UDP I'd like to remind you
that IP or internet protocol is connectionless.
Every packet it’s treated individually and separately by routers or routers in the network.
So this PC on the left hand side send is sending traffic to this server on the right hand side.
Individual packets from the PC could take the upper path
or they could traverse the lower link.
The internet consist of many, many devices and multiple parts to destinations
and it’s important to realize that traffic from one host to another host
could take different paths even though that traffic
is part of the same conversation or same session.
So if the PC is communicating to the server across the internet
traffic from that PC could use multiple parts
depending on how the traffic is routed through the internet.
That means the traffic could arrive out of order.
So for example if the PC sends packet 1
Packet 2 could arrive before packet 1
and does the packet arrive at the server in this order
packet 2, packet 1, and packet 3
that server requires a mechanism to reorder the packets into the original sequence.
IP also does not guarantee the delivery of packets so there’s no guarantee that the packets actually arrived at the server
or they arrived in the correct order or free from errors.
Higher layer protocols need to ensure the reordering of packets
and checking that the packets actually arrived successfully.
The 2 protocols that we're gonna concentrate on this section, as mentioned are TCP and UDP.
TCP and UDP reside at layer 4 the OSI model, in other words the transport layer.
Just to recap at the physical layer we'll have Ethernet
or another type of physical presentation.
At layer 2 on Ethernet, we use MAC addresses
on WAN interfaces, we would use another type of encapsulation such as frame relay or PPP
At layer 3 were using IP and devices are represented by IP addresses
and at layer 4 we have TCP and UDP.
Here’s a quick analogy explaining the difference between
UDP or User Datagram Protocol and TCP or Transmission Control Protocol.
UDP like IP is connectionless, it does not guarantee the delivery of packets.
It requires high layer protocols for instance
at the application layer to ensure the successful delivery of packets
as an analogy UDP services are similar to using regular mail offered by the Post Office
you would write your letter and enclose it in an envelope
by the same token, you would take your data and encapsulate it in UDP
you would then post your letter and hopefully the postal service
will deliver the letter to the recipient
there’s is however no guarantee that the letter
will be collected, transported, delivered
and opened by the recipient as this is regular mail.
You as the sender do not get an acknowledgement
or proof of delivery of that letter.
The postal service once again, does not guarantee delivery and is not responsible
for letting you know that the delivery was successful or unsuccessful.
but has the inherent disadvantage of unreliability.
In a UDP environment, UDP at layer 4 does not guarantee delivery
higher layer protocols at the application layer
will need to ensure reliability and delivery acknowledgement if required.
TCP on the other hand, does provide delivery acknowledgement and reliability
but with the disadvantage of the additional overhead
as an analogy, a TCP session could be seen as the telephone call
TCP is connection orientated in the same way that a telephone call is.
The person on the left makes a call to the person on the right.
The person on the right is notified of the incoming connection
or incoming call by the phone ringing.
When the person on the right hand side answers the call
they will acknowledge that by saying like
"hello, it's David speaking"
the person on the left hand side or the caller is does notify
that the telephone call has been answered.
The caller can then say
"hello David, it's Peter speaking".
So the called party or the person on the right hand side, knows you've made the call.
So there sort of a three-way handshake that takes place here
with the person on the right hand side initiates the call
the person on the right hand side acknowledges the call.
and the person on the left hand side then indicates who's speaking
Once the three-way handshake has taking place, and please note once again
that this is just an analogy and in a telephone environment
there are many more steps that take place
but once as an analogy that has taken place, there’s communication between the 2 parties.
If the party on the left hand side, wanted to provide some information
to the party on the right hand side, let’s say for instance a telephone number.
The party on the left hand side would read out the number
and in this example I’m just keeping it simple
and imagine for the moment that this is very long and complicated number
the party on the left hand side would say the number is 555
and then the party on the right hand side would acknowledge receipt of that number
by reading back the number received which is 555.
The party on the left hand side, can check that the number received is the correct number
and then can continue with the subsequent digits like 1234.
The party on the right hand side would read those number back
to ensure correct receipt of the number.
Now in TCP environment the information is not echoed
but there is the use of sequence numbers to ensure successful delivery
or successful receive of information
Before continuing I'd like to explain what a socket is
as this term is often used in networking and I'm going to mention it in the upcoming slides
A socket is the combination of the IP Address of the host
in other words the location of a computer for example and the port number used.
Port numbers are used to identify applications
for instance port 80, identified http and the transport protocol used
in other words TCP or UDP, these 3 are then combined into a single entity
in the same way like a telephone connection is the combination of the phone number and a particular extension
We'll be discussing TCP and UDP protocols in more detail in a moment
We'll also be looking at various port numbers and how they are used to identify applications
and in the previous section we've discussed IP addressing
A socket is a combination of these 3 things
used to identify connection between hosts
TCP and UDP allow for session multiplexing
which is when a single computer or host with the single IP address is able to communicate
with multiple servers or multiple devices
and have multiple sessions occurs simultaneously.
The session is created when a source host needs to send data or information to a destination host.
Replies are often received but aren't mandatory
the session is created and controlled within the network application
which contains the functionality of OSI layers 5 through 7.
In a best effort environment the settings are very simple
sessions parameters are sent to UDP, which as we know now as a best effort protocol.
Information is just sent to a destination IP address and destination port number.
It’s important to remember that each transmission is a totally separate event
with no memory or association between various transmissions retain.
When using a reliable service like TCP, as discussed a connection must first be established
between the sender and receiver before any data can be transmitted.
TCP will open a connection and negotiate various connection parameters
which I'll discuss in more detail in a moment before actually transmitting any data.
Sharing data flow, TCP will maintain reliable delivery of the data
and will close the connection once complete.
An example of this, is that on my machine, I can’t open up multiple connections
to different servers at the same time.
So I could open a connection to Gmail, I could open up connection to yahoo
I could open up a connection to Google and so forth and so on.
On this individual machine that has 1 IP address
I’m connecting to multiple servers simultaneously, therefore using session multiplexing.