Computer Networks: Transport Layer
Computer Networks: Transport Layer
Module 4
Transport Layer
By
3
What is Transport Layer Protocol? Cont..
3. Flow Control
❑ Flow control makes sure that the data is transmitted at a rate that is
accept table for both sender and receiver by managing data flow.
❑ The transport layer provides a flow control service between the adjacent
layers of the TCP/IP model.
❑ Transport Layer uses the concept of sliding window protocol to provide flow
control.
4. Data integrity
❑ Transport Layer provides data integrity by:
❑ Detecting and discarding corrupted packets.
❑ Tracking of lost and discarded packets and re-transmit them.
❑ Recognizing duplicate packets and discarding them.
❑ Buffering out of order packets until the missing the packets arrive.
5. Congestion avoidance
❑ In network, if the load on network is greater than the network load capacity,
then the congestion may occur.
❑ Congestion Control refers to the mechanisms and techniques to control the
congestion and keep the load below the capacity.
❑ The transport layer recognizes overloaded nodes and reduced flow rates and
take proper steps to overcome this.
4
What is Transport Layer Protocol? Cont..
Example of Transport Layer
Let us take an example of sending email.
❑ When we send an email then the email then in OSI model each layer
communicates to the corresponding layer of the receiver.
❑ So when the mail will come at transport layer on sender side then the
email is broken down in to small segments. Then that broken segments are
sent to network layer and transport layer also specifies the source and
destination port.
❑ At the receiver side, transport layer reassembles all the segment to get the
data and use port number to identify the application to deliver data.
Working of Transport Layer
❑ The transport layer receives the services from the network layer and then
give services to the session layer.
❑ At the sender’s side: At the sender's end, transport layer collect data from
application layer i.e. message and performs segmentation to divide the
message into segments and then adds the port number of source and
destination in header and send that message to network layer.
❑ At the receiver’s side: At the receiver's end, transport layer collects data
from network layer and then reassembles the segmented data and identifies
port number by reading its header to send that message to appropriate port in
the session layer.
5
What is Transport Layer Protocol? Cont..
6
What is Transport Layer Protocol? Cont..
❑ UDP is one of the simplest transport layer protocol which provides non
sequenced data transmission functionality.
❑ UDP is consider as connection less transport layer protocol.
❑ This type of protocol is referred to be used when speed and size are more
important than reliability and security.
❑ It is an end-to-end transport level protocol that adds transport-level
addresses, checksum error control, and length information to the data
received from the upper layer.
❑ User datagram is the packet constructed by the UDP protocol
Format of User Datagram
7
What is Transport Layer Protocol? Cont..
❑ User datagram have a fixed size header of 8 bytes which is divided into
four parts -
❑ Source port address: It defines source port number and it is of 16 bits.
❑ Destination port address: It defines destination port number and it is of 16
bits.
❑ Total length: This field is used to define the total length of the user
datagram which is sum of header and data length in bytes. It is a 16-bit field.
❑ Checksum: Checksum is also 16 bit field to carry the optional error
detection data.
UDP Services
❖ Process to Process Communication
❖ Connectionless Service
❖ Fast delivery of message
❖ Checksum
Disadvantages
❑ UDP delivers basic functions required for the end-to-end transmission of data.
❑ It does not use any sequencing and does not identify the damaged packet
while reporting an error.
❑ UDP can identify that an error has happened, but UDP does not identify
which packet has been lost.
8
What is Transport Layer Protocol? Cont..
TCP (Transmission Control Protocol)
❖ Connection oriented protocol
❖ Reliable protocol
❖ Provide error and flow control
❑ TCP stands for Transmission Control Protocol.
❑ TCP is a connection-oriented transport layer protocol.
❑ TCP explicitly defines connection establishment, data transfer, and connection
tear down phases to provide connection oriented service for data
transmission.
❑ TCP is the most commonly used transport layer protocol.
Features Of TCP protocol
❖ Stream data transfer
❖ Reliability
❖ Flow Control
❖ Error Control
❖ Multiplexing
❖ Logical Connections
❖ Full Duplex 9
What is Transport Layer Protocol? Cont..
TCP Segment Format
10
What is Transport Layer Protocol? Cont..
❑ Source port address is a 16 bit field that defines port number of application
program that is sending the segment.
❑ Destination port address is a 16 bit field that defines port number of
application program that is receiving the segment.
❑ Sequence number is a field of 32 bit that will define the number assigned to
data first byte contained in segment.
❑ Acknowledgement number is a 32 bit field that describe the next byte
that receiver is looking forward to receive next from sender.
❑ Header Length (HLEN) is a field of 4 bit that specify the number of 4 byte
words in TCP header. The header length of TCP header can be between 20 to
60 bytes.
❑ Reserved is a field 6 bit that are reserved for future use.
❑ Control bits are 6 different independent control bits or flags in this field.
❑ Window Size is a 16-bit field that defines the size of the window of sending
TCP in bytes.
❑ Checksum, 16-bit field contains checksum and used for error detection.
❑ Urgent pointer is a 16 bit field .This flag is set when there is urgent data in
the data segment.
❑ Options and padding can be upto 40 bytes field for optional information in
TCP header.
11
What is Transport Layer Protocol? Cont..
There are six in control field:
❖ URG: Urgent pointer
❖ ACK: Acknowledgement number
❖ PSH: Push request
❖ RST: Reset connection
❖ SYN: Sequence number Synchronization
❖ FIN: Connection termination
SCTP (Stream Control Transmission Protocol)
⚫ SCTP stands for Stream Control Transmission Protocol.
⚫ SCTP is one of the connection oriented transport layer protocols.
⚫ It allows transmitting of data between sender and receiver in full duplex mode.
⚫ This protocol makes it simpler to build connection over wireless network and
to control multimedia data transmission.
Features of SCTP
⚫ Unicast with Multiple properties
⚫ Reliable Transmission
⚫ Message oriented
⚫ Multi-homing
12
What is Transport Layer Protocol? Cont..
DATA TRAFFIC
❑ The main focus of congestion control and quality of service is data traffic .
❑ In congestion control we try to avoid traffic congestion . In quality of service
(QoS), we try to create an appropriate environment for the traffic . So, before
talking about congestion control and quality of service, service, we discuss the
data traffic itself.
13
What is Transport Layer Protocol? Cont..
Congestion Control
❑ Congestion control refers to the techniques used to control or prevent
congestion.
❑ Congestion control techniques can be broadly classified into two
categories:
14
What is Transport Layer Protocol? Cont..
1. Retransmission Policy :
❑ It is the policy in which retransmission of the packets are taken care of. If the
sender feels that a sent packet is lost or corrupted, the packet needs to be
retransmitted.
❑ This transmission may increase the congestion in the network.
To prevent congestion, retransmission timers must be designed to prevent
congestion and also able to optimize efficiency.
2. Window Policy :
❑ The type of window at the sender’s side may also affect the congestion.
Several packets in the Go-back-n window are re-sent, although some packets
may be received successfully at the receiver side. This duplication may
increase the congestion in the network and make it worse.
Therefore, Selective repeat window should be adopted as it sends the specific
packet that may have been lost.
3. Discarding Policy :
❑ A good discarding policy adopted by the routers is that the routers may
prevent congestion and at the same time partially discard the corrupted or
less sensitive packages and also be able to maintain the quality of a message.
In case of audio file transmission , routers can discard less sensitive packets
to prevent congestion and also maintain the quality of the audio file.
15
What is Transport Layer Protocol? Cont..
4. Acknowledgment Policy :
❑ Since acknowledgements are also the part of the load in the network, the
acknowledgment policy imposed by the receiver may also affect congestion.
Several approaches can be used to prevent congestion related to
acknowledgment.
❑ The receiver should send acknowledgement for N packets rather than sending
acknowledgement for a single packet.
❑ The receiver should send an acknowledgment only if it has to send a packet or
a timer expires.
5. Admission Policy :
❑ In admission policy a mechanism should be used to prevent congestion.
❑ Switches in a flow should first check the resource requirement of a network
flow before transmitting it further.
❑ If there is a chance of a congestion or there is a congestion in the network,
Router should deny establishing a virtual network connection to prevent
further congestion.
Closed Loop Congestion Control
❑ Closed loop congestion control techniques are used to treat or alleviate
congestion after it happens.
❑ Several techniques are used by different protocols; some of them are:
16
What is Transport Layer Protocol? Cont..
1. Backpressure :
❑ Backpressure is a technique in which a congested node stops receiving packets
from upstream node.
❑ This may cause the upstream node or nodes to become congested and reject
receiving data from above nodes.
❑ Backpressure is a node-to-node congestion control technique that
propagate in the opposite direction of data flow.
❑ The backpressure technique can be applied only to virtual circuit
where each node has information of its above upstream node.
17
What is Transport Layer Protocol? Cont..
❑ In above diagram the 3rd node is congested and stops receiving packets as
a result 2nd node may be get congested due to slowing down of the output
data flow. Similarly 1st node may get congested and inform the source to
slow down.
2. Choke Packet Technique :
❑ Choke packet technique is applicable to both virtual networks as well as
datagram subnets.
❑ A choke packet is a packet sent by a node to the source to inform it of
congestion.
❑ Each router monitors its resources and the utilization at each of its output
lines.
❑ Whenever the resource utilization exceeds the threshold value
which is set by the administrator, the router directly sends a choke packet
to the source giving it a feedback to reduce the traffic.
❑ The intermediate nodes through which the packets has traveled are not
warned about congestion.
18
What is Transport Layer Protocol? Cont..
3. Implicit Signaling :
❑ In implicit signaling, there is no communication between the congested
nodes and the source.
❑ The source guesses that there is congestion in a network.
❑ For example when sender sends several packets and there is no
acknowledgment for a while, one assumption is that there is a congestion.
4. Explicit Signaling :
❑ In explicit signaling, if a node experiences congestion it can explicitly sends
a packet to the source or destination to inform about congestion.
❑ The difference between choke packet and explicit signaling is that the
signal is included in the packets that carry data rather than creating a different
packet as in case of choke packet technique.
❑ Explicit signaling can occur in either forward or backward direction.
19
What is Transport Layer Protocol? Cont..
❖ Forward Signaling : In forward signaling, a signal is sent in the direction of
the congestion.
❖ The destination is warned about congestion. The receiver in this case adopt
policies to prevent further congestion.
❖ Backward Signaling : In backward signaling, a signal is sent in the opposite
direction of the congestion. The source is warned about congestion and
it needs to slow down.
Quality of Service (QoS)
❑ Quality of service (QoS) is an internetworking issue that has been
discussed more than defined.
Flow Characteristics
❑ Traditionally, four types of characteristics are attributed to a flow: reliability,
delay, jitter, and bandwidth
20
What is Transport Layer Protocol? Cont..
Reliability:
❑ Reliability is a characteristic that a flow needs. Lack of reliability means
losing a packet or acknowledgment, which entails retransmission. However,
the sensitivity of application programs to reliability is not the same. For
example, it is more important that electronic mail, file transfer, and Internet
access have reliable transmissions than telephony or audio conferencing.
Delay:
❑ Source-to-destination delay is another flow characteristic. Again
applications can tolerate delay in different degrees. In this case, telephony,
audio conferencing, video conferencing, and remote log-in need minimum
delay, while delay in file transfer or e-mail is less important.
Jitter:
❑ Jitter is the variation in delay for packets belonging to the same flow.
For example, if four packets depart at times 0, 1, 2, 3 and arrive at 20, 21, 22, 23,
all have the same delay, 20 units of time. On the other hand, if the above four
packets arrive at 21, 23, 21, and 28, they will have different delays: 21,22, 19,
and 24.
❑ For applications such as audio and video, the first case is completely
acceptable; the second case is not. For these applications, it does not matter if
the packets arrive with a short or long delay as long as the delay is the same
21
for all packets. For this application, the second case is not acceptable.
What is Transport Layer Protocol? Cont..
❑ Jitter is defined as the variation in the packet delay. High jitter means the
difference between delays is large; low jitter means the variation is small.
Bandwidth:
❑ Different applications need different bandwidths. In video conferencing we
need to send millions of bits per second to refresh a color screen while the
total number of bits in an e-mail may not reach even a million.
Flow Classes:
❑ Based on the flow characteristics, we can classify flows into groups, with
each group having similar levels of characteristics. This categorization is not
formal or universal; some protocols such as ATM have defined classes.
Techniques to Improve QoS
❑ Some techniques that can be used to improve the quality of service. The four
common methods: scheduling, traffic shaping, admission control, and resource
reservation.
a. Scheduling :
❑ Packets from different flows arrive at a switch or router for processing. A
good scheduling technique treats the different flows in a fair and appropriate
manner.
❑ Several scheduling techniques are designed to improve the quality of
service. We discuss three of them here: FIFO queuing, priority queuing,
22
and weighted fair queuing.
What is Transport Layer Protocol? Cont..
i. FIFO Queuing
❑ In first-in, first-out (FIFO) queuing, packets wait in a buffer (queue) until the
node (router or switch) is ready to process them.
❑ If the average arrival rate is higher than the average processing rate, the queue
will fill up and new packets will be discarded.
❑ A FIFO queue is familiar to those who have had to wait for a bus at a bus
stop.
24
What is Transport Layer Protocol? Cont..
iii. Weighted Fair Queuing
❑ A better scheduling method is weighted fair queuing. In this technique, the
packets are still assigned to different classes and admitted to different queues.
❑ The queues, however, are weighted based on the priority of the queues;
higher priority means a higher weight.
❑ The system processes packets in each queue in a round-robin fashion
with the number of packets selected from each queue based on the
corresponding weight.
For example, if the weights are 3, 2, and 1, three packets are processed from the
first queue, two from the second queue, and one from the third queue. If the
system does not impose priority on the classes, all weights can be equal. In
this way, we have fair queuing with priority. Figure 4.33 shows the technique
with three classes.
25
What is Transport Layer Protocol? Cont..
b. Traffic Shaping
❑ Traffic shaping is a mechanism to control the amount and the rate of the
traffic sent to the network. Two techniques can shape traffic: leaky bucket and
token bucket.
i. Leaky Bucket
❑ If a bucket has a small hole at the bottom, the water leaks from the bucket
at a constant rate as long as there is water in the bucket.
❑ The rate at which the water leaks does not depend on the rate at which the
water is input to the bucket unless the bucket is empty.
❑ The input rate can vary, but the output rate remains constant.
❑ Similarly, in networking, a technique called leaky bucket can smooth out
bursty traffic. Bursty chunks are stored in the bucket and sent out at an
average rate.
26
What is Transport Layer Protocol? Cont..
In figure, we assume that the network has committed a bandwidth of 3 Mbps for
a host. The use of the leaky bucket shapes the input traffic to make it conform
to this commitment.
In Figure the host sends a burst of data at a rate of 12 Mbps for 2 s, for a total of
24 Mbits of data. The host is silent for 5 s and then sends data at a rate of 2
Mbps for 3 s, for a total of 6 Mbits of data. In all, the host has sent 30 Mbits of
data in lOs. The leaky bucket smooth’s the traffic by sending out data at a rate
of 3 Mbps during the same 10 s.
In Figure A FIFO queue holds the packets. If the traffic consists of fixed-size
packets (e.g., cells in ATM networks), the process removes a fixed number of
packets from the queue at each tick of the clock. If the traffic consists of
variable-length packets, the fixed output rate must be based on the number of
bytes or bits.
27
What is Transport Layer Protocol? Cont..
ii. Token Bucket
❑ The leaky bucket is very restrictive. It does not credit an idle host.
For example, if a host is not sending for a while, its bucket becomes empty. Now
if the host has bursty data, the leaky bucket allows only an average rate. The
time when the host was idle is not taken into account.
On the other hand, the token bucket algorithm allows idle hosts to accumulate
credit for the future in the form of tokens. For each tick of the clock, the
system sends n tokens to the bucket. The system removes one token for
every cell (or byte) of data sent. For example, if n is 100 and the host is idle
for 100 ticks, the bucket collects 10,000 tokens.
28
What is Transport Layer Protocol? Cont..
❑ The token bucket can easily be implemented with a counter. The token is
initialized to zero. Each time a token is added, the counter is incremented by
1. Each time a unit of data is sent, the counter is decremented by 1.
When the counter is zero, the host cannot send data.
Combining Token Bucket and Leaky Bucket
The two techniques can be combined to credit an idle host and at the
same time regulate the traffic. The leaky bucket is applied after the token
bucket; the rate of the leaky bucket needs to be higher than the rate of
tokens dropped in the bucket.
c. Resource Reservation
❑ A flow of data needs resources such as a buffer, bandwidth, CPU time, and so
on. The quality of service is improved if these resources are reserved
beforehand.
d. Admission Control
❑ Admission control refers to the mechanism used by a router, or a
switch, to accept or reject a flow based on predefined parameters called flow
specifications.
❑ Before a router accepts a flow for processing, it checks the flow specifications
to see if its capacity (in terms of bandwidth, buffer size, CPU speed, etc.) and
its previous commitments to other flows can handle the new flow.
29
Thank You
30