Unit 4-Transport Layer Protocols (5hr)

8th Semester

Transport layer offers peer-to-peer and end-to-end connection between two processes on remote hosts. Transport layer takes data from upper layer (i.e. Application layer) and then breaks it into smaller size segments, numbers each byte, and hands over to lower layer (Network Layer) for delivery.
The main transport protocols are

  1. TCP
  2. UDP.

Define UPD withs its operational characteristics & application. year 2014

 UDP (User Datagram Protocol)

It is  as Unreliable Datagram Protocol (UDP) because , there is no guarantee that data sent will reach its destination.The sender just issues a message to its destination and hopes it gets there. UDP is a connectionless protocol.
Operation of UDP
IT  take data from higher-layer protocols and place it in UDP messages, and  then passed down to the Internet Protocol for transmission.
The basic steps for transmission using UDP are:

  1. Higher-Layer Data Transfer:
  2. UDP Message Encapsulation
  3. Transfer Message To IP

Characteristics of UDP

  • Connection less protocol
  • stateless
  • unreliable
  • Fast in data transmission
  • Good protocol for data flowing in one direction
  • Doesn’t provide congestion control mechanism

Application of UDP

  • Playing a game video online
  • Streaming movies online
  • UDP is used with RTOS (Real time operating systems)
  • Video conference

UDP Header Format
udp herader formatको लागि तस्बिर परिणाम

  • Source and destination UDP port numbers are the communication endpoints for sending and receiving devices.
  • The length field in UDP represents the total size of each datagram including both header and data.
  • Checksum –  allows receivers to cross-check incoming data for any corrupted bits of the message
  • Data – it is the variable part of the UDP. It encapsulates the higher layer messages that need to be sent.

Transmission Control Protocol (TCP)

It is reliable and secure logical connection, service or circuit between the pairs of the processes. The main purpose of the TCP is flow control and error recovery .TCP is also  responsible for controlling size, flow control, the rate of data exchange, and network traffic congestion.
TCP herader formatको लागि तस्बिर परिणाम

The headers supply specific information:
  • Source and destination TCP port numbers are the communication endpoints for sending and receiving devices.
  • Message senders use sequence numbers to mark the ordering of a group of messages.
  • The data offset field stores the total size of a TCP header in multiples of four bytes.
  • Reserved data in TCP headers always has a value of zero.
  • TCP uses a set of six standard and three extended control flags(each an individual bit representing on or off) to manage data flow in specific situations.
  • TCP senders use a number called window sizeto regulate how much data they send to a receiver before requiring an acknowledgment in return. If the window size becomes too small, network data transfer will be unnecessarily slow, while if the window size becomes too large, the network link can become saturated (unusable for any other applications) or the receiver may not be able to process incoming data quickly enough (also resulting in slow performance).
  • The checksum value inside a TCP header is generated by the protocol sender as a mathematical technique to help the receiver detect messages that are corrupted or tampered with.
  • The urgent pointer field is often set to zero and ignored.
  • Usages of optional TCP data include support for special acknowledgment and window scaling algorithms.

Characteristics of TCP

  • TCP is reliable – This means it guarantees the delivery packets uncorrupted. This is all done by controlling the session with flow control, error detection, congestion control and re-transmission of lost
  • TCP is a connection orientated protocol – This means a connection or socket must first be established before data can flow. Data travels both
  • TCP is ordered – TCP uses sequence numbers to ensure that packets are re-constructed in the correct
  • TCP is slower than UDP – Because TCP does all the above there is additional overhead needed and processing time which makes TCP slower than UDP

TCP 3-Way Handshake Process

.There are three messages (Sync, Sync + Ack, Ack) transmitted by TCP to negotiate and start a TCP session between two computers.

  • Step 1 (SYN) : In the first step, client wants to establish a connection with server, so it sends a segment with SYN(Synchronize Sequence Number) which informs server that client is likely to start communication and with what sequence number it starts segments with
  • Step 2 (SYN + ACK): Server responds to the client request with SYN-ACK signal bits set. Acknowledgement(ACK) signifies the response of segment it received and SYN signifies with what sequence number it is likely to start the segments with
  • Step 3 (ACK) : In the final part client acknowledges the response of server and they both establish a reliable connection with which they will start eh actual data transfer


Host A sends a TCP SYNchronize packet to Host B
Host B receives A’s SYN
Host B sends a SYNchronize-ACKnowledgement
Host A receives B’s SYN-ACK
Host A sends ACKnowledge
Host B receives ACK.
TCP socket connection is ESTABLISHED.
tcp three-way handshake,syn,syn-ack,ack
TCP Three Way Handshake

Standard TCP / IP services

  • FTP and Anonymous FTP – FTP is a method for giving users access to files so that they don’t need to identify themselves to the server. A user must log in to the remote computer to make an ftp connection.
  • Telnet (TN) is a networking protocol and software program used to access remote computers and terminals over the Internet or a TCP/IP computer network.
  • Trivial File Transfer Protocol (TFTP) is a simple protocol used for transferring files. TFTP uses the User Datagram Protocol (UDP) to transport data from one end to another. TFTP is mostly used to read and write files/mail to or from a remote server.

Port numbers and socket address (2015)


Socket Types

  •  Stream socket 🙁 k. a. connection- oriented socket) :It provides reliable, connected networking service Error free; no out- of- order packets (uses TCP) applications: telnet/ ssh, http,..
  • Datagram socket :( k. a. connectionless socket) : It provides unreliable, best- effort networking service Packets may be lost; may arrive out of order (uses UDP) applications: streaming audio/ video (real player),

tcp vs udpको लागि तस्बिर परिणाम