CN-Unit 4 - Notes
CN-Unit 4 - Notes
The services provided by the transport layer protocols can be divided into five
categories:
o End-to-end delivery
o Addressing
o Reliable delivery
o Flow control
o Multiplexing
End-to-end delivery:
The first duty of a transport-layer protocol is to provide process-to-process
communication. A process is an application-layer entity (running program) that uses
the services of the transport layer. Before we discuss how process-to-process
communication can be accomplished, we need to understand the difference between
host-to-host communication and process-to-process communication. The network
layer is responsible for communication at the computer level (host-to-host
communication). A network-layer protocol can deliver the message only to the
destination computer. However, this is an incomplete delivery. The message still needs
to be handed to the correct process. This is where a transport-layer protocol takes
over. A transport-layer protocol is responsible for delivery of the message to the
appropriate process.
It should be clear by now that the IP addresses and port numbers play different roles
in selecting the final destination of data. The destination IP address defines the host
among the different hosts in the world. After the host has been selected, the port
number defines one of the processes on this particular host (see Figure 23.4).
Socket Addresses:
A transport-layer protocol in the TCP suite needs both the IP address and the port
number, at each end, to make a connection. The combination of an IP address and a
port number is called a socket address. The client socket address defines the client
process uniquely just as the server socket address defines the server process uniquely.
Reliable delivery:
The transport layer provides reliability services by retransmitting the lost and damaged
packets.
Error Control
Loss Control
Loss Control is a third aspect of reliability. The transport layer ensures that all the
fragments of a transmission arrive at the destination, not some of them. On the
sending end, all the fragments of transmission are given sequence numbers by a
transport layer. These sequence numbers allow the receiver?s transport layer to
identify the missing segment.
Duplication Control
Duplication Control is the fourth aspect of reliability. The transport layer guarantees
that no duplicate data arrive at the destination. Sequence numbers are used to identify
the lost packets; similarly, it allows the receiver to identify and discard duplicate
segments.
Flow Control
Flow control is used to prevent the sender from overwhelming the receiver. If the
receiver is overloaded with too much data, then the receiver discards the packets and
asking for the retransmission of packets. This increases network congestion and thus,
reducing the system performance. The transport layer is responsible for flow control.
It uses the sliding window protocol that makes the data transmission more efficient as
well as it controls the flow of data so that the receiver does not become overwhelmed.
Sliding window protocol is byte oriented rather than frame oriented.
UDP
o UDP stands for User Datagram Protocol.
o UDP is a simple protocol and it provides nonsequenced transport functionality.
o UDP is a connectionless protocol.
o This type of protocol is used when reliability and security are less important
than speed and size.
o UDP is an end-to-end transport level protocol that adds transport-level
addresses, checksum error control, and length information to the data from the
upper layer.
o The packet produced by the UDP protocol is known as a user datagram.
o Source port address: It defines the address of the application process that has
delivered a message. The source port address is of 16 bits address.
o Destination port address: It defines the address of the application process that
will receive the message. The destination port address is of a 16-bit address.
o Total length: It defines the total length of the user datagram in bytes. It is a
16-bit field.
o Checksum: The checksum is a 16-bit field which is used in error detection.
TCP
o TCP stands for Transmission Control Protocol.
o It provides full transport layer services to applications.
o It is a connection-oriented protocol means the connection established between
both the ends of the transmission. For creating the connection, TCP generates
a virtual circuit between sender and receiver for the duration of a transmission.
o URG: The URG field indicates that the data in a segment is urgent.
o ACK: When ACK field is set, then it validates the acknowledgement number.
o PSH: The PSH field is used to inform the sender that higher throughput is
needed so if possible, data must be pushed with higher throughput.
o RST: The reset bit is used to reset the TCP connection when there is any
confusion occurs in the sequence numbers.
o SYN: The SYN field is used to synchronize the sequence numbers in three types
of segments: connection request, connection confirmation ( with the ACK bit
set ), and confirmation acknowledgement.
o FIN: The FIN field is used to inform the receiving TCP module that the sender
has finished sending data. It is used in connection termination in three types of
segments: termination request, termination confirmation, and
acknowledgement of termination confirmation.
o Window Size: The window is a 16-bit field that defines the size of the
window.
o Checksum: The checksum is a 16-bit field used in error detection.
o Urgent pointer: If URG flag is set to 1, then this 16-bit field is an offset
from the sequence number indicating that it is a last urgent data byte.
o Options and padding: It defines the optional fields that convey the
additional information to the receiver.
Definition TCP establishes a virtual circuit UDP transmits the data directly to the
before transmitting the data. destination computer without verifying
whether the receiver is ready to receive or
not.
The most important of these is the RTO (Retransmission TimeOut). When a segment is
sent, a retransmission timer is started. If the segment is acknowledged before the timer
expires, the timer is stopped. If, on the other hand, the timer goes off before the
acknowledgement comes in, the segment is retransmitted (and the timer os started
again).
Persistence Timer
A third timer that some implementations use is the keepalive timer. When a connection
has been idle for a long time, the keepalive timer may go off to cause one side to check
whether the other side is still there. If it fails to respond, the connection is terminated.
This feature is controversial because it adds overhead and may terminate an otherwise
healthy connection due to a transient network partition.
The last timer used on each TCP connection is the one used in the TIME WAIT state
while closing. It runs for twice the maximum packet lifetime to make sure that when a
connection is closed, all packets created by it have died off.
Metrics are the network variables used to determine the best route to the destination.
For some protocols use the static metrics means that their value cannot be changed
and for some other routing protocols use the dynamic metrics means that their value
can be assigned by the system administrator.
SCTP combines the best features of UDP and TCP. SCTP is a reliable message-
oriented protocol. It preserves the message boundaries, and at the same time,
detects lost data, duplicate data, and out-of-order data. It also has congestion
control and flows control mechanisms.
Features of SCTP
There are various features of SCTP, which are as follows −
Stream Identifier
In TCP, there is only one stream in each connection. In SCTP, there may be
several streams in each association. Each stream in SCTP needs to be identified
by using a stream identifier (SI). Each data chunk must carry the SI in its
header so that when it arrives at the destination, it can be properly placed in
its stream. The 51 is a 16-bit number starting from O.
Flow Control
Like TCP, SCTP implements flow control to avoid overwhelming the receiver.
Error Control
Like TCP, SCTP implements error control to provide reliability. TSN numbers
and acknowledgement numbers are used for error control.
Congestion Control
Like TCP, SCTP implements congestion control to determine how many data
chunks can be injected into the network.