Module 6 Transport Layer-converted
Module 6 Transport Layer-converted
Introduction to Transport
Layer Process-to-Process
Delivery Protocols in
Transport Layer
TCP - Transmission Control
Protocol UDP - User DataGram
Protocol
Congestion Control
ASYNsegment
cannot carry data,
but it consumes
one sequence
number.
ASYN + ACKseqgment
can’t carry data, but
does consume one
sequence number.
AnACKsegment, if
carrying no data,
consumes no
sequence number.
Keep-alive timer:
Timed-Wait:
After releasing a connection, either of the hosts
waits for a Timed-Wait time to terminate the
connection completely.
This is in order to make sure that the other end has
received the acknowledgement of its connection
termination request.
Timed-out can be a maximum of 240 seconds (4
minutes).
Retransmission timer:
This timer maintains stateful session of data sent.
If the acknowledgement of sent data does not receive
within the Retransmission time, the data segment is
sent again.
Persist timer:
TCP session can be paused by either host by sending
Window Size 0. To resume the session a host needs to send
Window Size with some larger value.
If this segment never reaches the other end, both ends
may wait for each other for infinite time.
When the Persist timer expires, the host re-sends its
window size to let the other end know.
Persist Timer helps avoid deadlocks in communication.
The hosts can then send the last data segment which
was never unacknowledged and carry onwards.
oriented (Connectionless).
ConnectionLess Service:
UDP provides a connectionless service. This means that
each user datagram sent by UDP is an independent
datagram.
There is no relationship between the different user
datagrams even if they are coming from the same source
process and going to the same destination program.
The user datagrams are not numbered.
Flow Control:
UDP is a very simple protocol. There is no flow control,
and hence no window mechanism.
The receiver may overflow with incoming messages. The
lack of flow control means that the process using UDP
should provide for this service, if needed.
Check Sum:
UDP checksum calculation includes three sections: a
pseudoheader, the UDP header, and the data coming
from the application layer.
Checksum
Checksum.. Calculation
..!
Constant-bit-rate(CBR),
or a fixed-rate - Data
rate that doesn’t
change.
Variable-bit-rate(VBR) -
the rate of the data
flow changes in time,
with the changes
smooth instead of
sudden and sharp.
Bursty Data rate- the
data rate changes
suddenly in a very
short time.
Window Policy:
The type of window at the sender may also affect
congestion. The Selective Repeat window is better than
the Go-Back-N window
for congestion control.
In the Go-Back-N window, when the timer for a packet
times out, several packets may be resent, although some
may have arrived safe and sound at the receiver. This
duplication may make
the congestion worse.
The Selective Repeat window, on the other hand, tries to
send the specific packets that have been lost or
corrupted. Data Communictions and Networking61
Open-loop Congestion
Control
Acknowledgment Policy:
It imposed by the receiver, may also affect congestion.
If the receiver does not acknowledge every packet it
receives, it may slow down the sender and help prevent
congestion.
A receiver may decide to acknowledge only N packets at a
time. We need to know that the acknowledgments are also
part of the load in a network. Sending fewer
acknowledgments means imposing less load on the
network.
Discarding Policy:
A good discarding policy by the routers may prevent
congestion and at the same time may not harm the
integrity of the transmission.
For example, in audio transmission, if the policy is to
discard less sensitive packets when congestion is likely to
happen, the quality of sound is still preserved and
congestion is prevented or Data
alleviated.
Communictions and Networking62
Open-loop Congestion
Control
Admission Policy:
It is a QoS mechanism can also prevent congestion in
virtual-circuit networks.
Switches in a flow first check the resource requirement
of a flow before admitting it to the network.
A router can deny establishing a virtual-circuit
connection if there is congestion in the network or if
there is a possibility of
future congestion.
Choke Packets:
It is a packet sent by a node to the source to inform it of
congestion. When a router in the Internet is overwhelmed
with IP datagrams, it may discard some of them; but it
informs the source host, using a source quench
ICMP(Internet Control Message Protocol) message.
The warning message goes directly to the source station;
the intermediate routers, and does not take any action.
Choke
Packets:
The warning is from the router, which has encountered
congestion, to the source station directly. The inter-mediate
nodes through which the packet has traveled are not
warned.
Back Pressure:
The warning is from one node to its upstream node,
although the warning may eventually reach the source
station.
Explicit Signaling:
The node that experiences congestion can explicitly send
a signal to the source or destination.
In this method, however, is different from the choke packet
method.
In the choke packet method, a separate packet is used for
this purpose; In the explicit signaling method, the signal
is included in the packets that carry data.
It can occur in either the forward or theand
Data Communictions backward
Networking67
Closed-loop Congestion
Control
Backward Signaling:
A bit can be set in a packet moving in the direction
opposite to the congestion.
This bit can warn the source that there is congestion
and that it needs to slow down to avoid the discarding
of packets.
Forward Signaling:
A bit can be set in a packet moving in the
direction of the congestion.
This bit can warn the destination that there is
congestion.
The receiver in this case can use policies, such as slowing
down the acknowledgments, to alleviate the congestion
Slow-start phase,
The sender starts with a very slow rate of transmission, but
increases the rate rapidly to reach a threshold.
When the threshold is reached, the data rate is reduced to
avoid congestion.
Finally if congestion is detected, the sender goes back to
the slow-start or congestion avoidance phase based
on how the congestion is detected.
Data Communictions and Networking69
Slowstart - Exponential
Increase
Figure:Slow Start
Phase
Data Communictions and Networking70
Congestion Avoidance - Additive
Increase
Figure:Congestion
Avoidance
Data Communictions and Networking72
Congestion Detection - Multiplicative
Decrease
Congestion Detection: Multiplicative Decrease:
If congestion occurs, the congestion window size must
be decreased.
The only way the sender can guess that congestion has
occurred is by the need to retransmit a segment.
However, retransmission can occur in one of two cases:
When a timer times out :
When three ACKs are received.
Techniques to Improve
QoS
Scheduling
Traffic
Shaping
Resource
Data Communictions and Networking75
QoS -
Scheduling -I
Priority
queuing:
Weighted fair
queuing:
Implementation of Leaky
Bucket
2 Token
bucket :
Token Bucket
It allows bursty traffic at a regulated maximum rate.
Conclusion
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.