Transport layer – TCP and UDP

Transport layer protocols

The transport layer protocols determine how to transfer the messages between hosts and be responsible for the reliability of conversation. The transport layer protocols include TCP and UDP.

TCP

The process of TCP

  • Establishes a Session
  • Ensures reliable delivery
  • Provides same-order delivery
  • Support flow control

TCP initiation – 3-way handshake

  • Client -> (SYN [sequence number]) Server
  • Server -> (SYN-ACK [Acknowledge number= Last sequence number+1] [sequence number]) Client
  • Client -> (ACK [sequence number] [Acknowledge number= Last sequence number+1])

TCP termination – 4-way handshake

  • Sender -> (FIN) Receiver
  • Receiver -> (ACK) Sender
  • Receiver ->(FIN) Sender
  • Sender -> (ACK) Receiver

The header of TCP

16 bits 16 bits 32 bits 32 bits
Source Port Destination Port Sequence Number Acknowledgement Number
4 bits 6 bits 6 bits 16 bits 16 bits 16 bits
Header Length Reserved Control Bits Window Checksum Urgent

UDP

The characteristics of UDP

  • Data is reconstructed in the order that it is received.
  • Any segments that are lost are not resent.
  • There is no session establishment.
  • The sending is not informed about resource availability.

The header of UDP

16 bits 16 bits 16 bits 16 bits
Source Port Destination Port Length Checksum

Ports Group

  • Well-Known Ports 0 – 1023
  • Registered Ports 1024 – 49151
  • Private Dynamic Ports 49,152 – 65535
Port Number Protocol Application
20 TCP FTP data
21 TCP FTP control
22 TCP SSH
23 TCP Telnet
25 TCP SMTP
53 UDP,TCP DNS
67 UDP DHCP Server
68 UDP DHCP Client
69 UDP TFTP
80 TCP HTTP
110 TCP POP3
143 TCP IMAP
161 UDP SNMP
443 TCP HTTPS

Leave a Comment

Your email address will not be published. Required fields are marked *