0% found this document useful (0 votes)
36 views

Transport Layer

The document provides an overview of the transport layer and TCP protocol. It discusses how the transport layer uses port numbers along with IP addresses for socket addressing. It then describes some key aspects of TCP including that it is connection-oriented, reliable, and provides congestion and flow control. The document outlines the TCP header format and describes fields like source/destination ports, sequence numbers, acknowledgement numbers, and flags. It also explains the three-way handshake process for establishing a TCP connection and how retransmissions and connection termination work.

Uploaded by

harsharewards1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views

Transport Layer

The document provides an overview of the transport layer and TCP protocol. It discusses how the transport layer uses port numbers along with IP addresses for socket addressing. It then describes some key aspects of TCP including that it is connection-oriented, reliable, and provides congestion and flow control. The document outlines the TCP header format and describes fields like source/destination ports, sequence numbers, acknowledgement numbers, and flags. It also explains the three-way handshake process for establishing a TCP connection and how retransmissions and connection termination work.

Uploaded by

harsharewards1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 33

COMPUTER NETWORKS

UNIT-IV

TRANSPORT LAYER

PREPARED
BY
P.SANTHOSH KUMAR
K.VINOD KUMAR
Introduction

 Transport layer follows process to process(i,.e port to port).


 It is mainly depending on port numbers.
 In network layer we are using IP Address(combination of n/w ID & HostID)
 In transport layer we are using socket address(combination of IP Address & port numbers) for for transmitting the data from
source to destination.
Socket address example:192.168.10.20:8080
Here 192.168.10.20 is IP Address and 8080 is port number for connecting web page.
 Functionalities
 Reliability
 Flow control(stop and wait,GBN,SR)
 Error control(Checksum,CRC,parity…..)
 Congestion control
Port number

Port number uses


20---------------------File Transfer Protocol (FTP) Data Transfer
21-------------------File Transfer Protocol (FTP) Command Control
25-----------------------Simple Mail Transfer Protocol(SMTP)
53-----------------------Domain Name System(DNS) service
67,68------------------- Dynamic Host Configuration Protocol (DHCP)
80------------------Hypertext Transfer Protocol (HTTP) used in the World Wide Web
443-----------------HTTP Secure (HTTPS) HTTP over TLS/SSL
Introduction cont……….
Transport Layer protocols

 In transport layer mainly we are using two protocols


1.TCP(Transmission Control Protocol)
2.UDP(User Datagram Protocol).

TCP is used for connection oriented purpose, UDP is used for Connection less purpose.
Transmission control protocol(TCP)

 Transmission Control Protocol-


 TCP is short for Transmission Control Protocol.
 It is a transport layer protocol.
 It has been designed to send data packets over the Internet.
 It establishes a reliable end to end connection before sending any data.
Characteristics Of TCP-

 TCP is a reliable protocol.


 TCP is a connection oriented protocol.
 TCP handles both congestion and flow control.
 TCP ensures in-order delivery.
 TCP ensures in-order delivery.
 TCP can use both selective & cumulative acknowledgements.
 TCP provides error checking & recovery mechanism.
TCP Header-

 Transmission Control Protocol is a transport layer protocol.


 It continuously receives data from the application layer.
 It divides the data into chunks where each chunk is a collection of bytes.
 It then creates TCP segments by adding a TCP header to the data chunks.
 TCP segments are encapsulated in the IP datagram.
The following diagram represents the TCP header format-
Description-1/5

1. Source Port-
 Source Port is a 16 bit field.
 It identifies the port of the sending application.
2. Destination Port-
 Destination Port is a 16 bit field.
 It identifies the port of the receiving application.
3.Sequence Number-
 Sequence number is a 32 bit field.
 TCP assigns a unique sequence number to each byte of data contained in the TCP segment.
 This field contains the sequence number of the first data byte.
Description-2/5

 4. Acknowledgement Number-
 Acknowledgment number is a 32 bit field.
 It contains sequence number of the data byte that receiver expects to receive next from the
sender.
 It is always sequence number of the last received data byte incremented by 1.
 5. Header Length-
 Header length is a 4 bit field.
 It contains the length of TCP header.
 It helps in knowing from where the actual data begins.
Description-3/5

 6. Reserved Bits-
 The 6 bits are reserved.
 These bits are not used.
 URG bit is used to treat certain data on an urgent basis.
 ACK bit indicates whether acknowledgement number field is valid or not.
 PSH bit is used to push the entire buffer immediately to the receiving application.
 RST bit is used to reset the TCP connection.
 SYN bit is used to synchronize the sequence numbers.
 FIN bit is used to terminate the TCP connection.
Description-4/5

 Window Size-
 Window size is a 16 bit field.
 It contains the size of the receiving window of the sender.
 It advertises how much data (in bytes) the sender can receive without acknowledgement.
 Checksum-
 Checksum is a 16 bit field used for error control.
 It verifies the integrity of data in the TCP payload.
 Sender adds CRC checksum to the checksum field before sending the data.
 Receiver rejects the data that fails the CRC check.
Description5/5

 Urgent Pointer-
 Urgent pointer is a 16 bit field.
 It indicates how much data in the current segment counting from the first data byte is
urgent.
 Urgent pointer added to the sequence number indicates the end of urgent data byte.
 This field is considered valid and evaluated only if the URG bit is set to 1.
 Options-
 Options field is used for several purposes.
 The size of options field vary from 0 bytes to 40 bytes.
TCP Connection

 For connecting two devices(i.e client and server) we are using three phases

1.TCP Connection establishment( 3- way handshaking)


2. Data transfer
3.TCP Connection Termination
3 Way Handshake-

 Three Way Handshake is a process used for establishing a TCP connection


 Step-01: SYN-
 For establishing a connection,
 Client sends a request segment to the server.
 Request segment consists only of TCP Header with an empty payload.
 Then, it waits for a reply segment from the server.
Step-1

 Request segment contains the following information in TCP header-


 Initial sequence number-

 SYN bit set to 1

 Maximum segment size

 Receiving window size


Step-02: SYN + ACK-

 Reply segment contains the following information in TCP header-


 Initial sequence number
 SYN bit set to 1
 Maximum segment size
 Receiving window size
 Acknowledgment number
 ACK bit set to 1
Step-03: ACK-

 After receiving the reply segment,


 Client acknowledges the response of server.
 It acknowledges the server by sending a pure acknowledgement.
TCP Retransmission-

 After establishing the connection,


 Sender starts transmitting TCP segments to the receiver.
 A TCP segment sent by the sender may get lost on the way before reaching the receiver.
 This causes the receiver to send the acknowledgement with same ACK number to the
sender.
 As a result, sender retransmits the same segment to the receiver.
 This is called as TCP retransmission.
Data transmission
TCP Retransmission-

 2. Retransmission After Receiving 3 Duplicate Acknowledgements-


 Consider sender receives three duplicate acknowledgements for a TCP segment sent by it.
 Then, sender assumes that the corresponding segment is lost.
 So, sender retransmits the same segment without waiting for its time out timer to expire.
 This is known as Early retransmission or Fast retransmission.
TCP Connection Termination-

 A TCP connection is terminated using FIN segment where FIN bit is set to 1.
 Consider-
 There is a well established TCP connection between the client and server.
 Client wants to terminate the connection.
 The following steps are followed in terminating the connection-
 Step-01:
 For terminating the connection,
 Client sends a FIN segment to the server with FIN bit set to 1.
 Client enters the FIN_WAIT_1 state.
 Client waits for an acknowledgement from the server.
TCP Connection Termination-

Step-1 Step-2
TCP Connection Termination-

Step-3 Step-4

You might also like