Transport Layer – Layer 4

What is Transport Layer ? 
  • Layer 4 Protocol of OSI Model.
  • It mainly uses TCP and UDP Protocol
  • Transport Layer Protocol is necessary for setting up a connection for sending data between computers.
What is UDP ?
  • User Datagram Protocol
  • UDP is a unreliable Protocol.
  • UDP is connectionless which means it will just start sending and doesn't care if it arrives yes or not.
UDP Header
16-bit source port - its a source port number field
16-bit destination port - its a destination port number field
16-bit UDP length - its the size of the UDP data
16-bit UDP Checksum - its just checks for errors.
Data - its the data field

What is TCP ?
  • Transmission Control Protocol
  • TCP is Reliable Protocol
  • TCP sets up a connection before transferring data.
  • The connection that TCP will setup is called the “3 way handshake”.
TCP Header

16-bit source port - its a source port number field
16-bit destination port - its a destination port number field
32-bit sequence number - its a number generated between source and destination for setting up 3-way Handshake.
32-bit Acknowledge bit - its a number in response to sequence bit.
Flags - there are some certain functions of flags as RESET, PUSH,.etc....
16-Bit Window size - This bit helps us to avoid overloading of packet size form source to destination
Data - its the data field

Flow Control – Window size
  • If you are having a High Speed Computer and a basic Smartphone, computer could overburden the smart-phone with traffic which is why we have flow control.
  • In each TCP segment the receiver can specify in the “receive window” field how much data in bytes it wants to receive.
Difference Between TCP and UDP


That's it about Transport Layer Protocol.

You can also Look into my Video Tutorial:

In the next session we are going to see about TCP-3 way handshake

Post a Comment