Unit 4:
Transport protocols
Transport service: Services provided to the upper layer,
connection establishment, connection release, multiplexing,
flow control and buffering, crash recovery, Comparison of
internet transport protocols (TCPand UDP)
● If a host sends too much data too fast on a newly opened connection, the actual sequence
number versus time curve may rise more steeply than the initial sequence
number versus time curve, causing the sequence number to enter the forbidden region.
● To prevent this from happening, the maximum data rate on any connection is one segment
per clock tick.
● This also means that the transport entity must wait until the clock ticks before opening a
new connection after a crash restart.
● Entering the forbidden region from underneath by sending too fast is not the only way to
get into trouble. at any data rate less than the clock rate, the curve of actual sequence
numbers used versus time will eventually run into the forbidden region from the left as the
sequence numbers wrap around.
● The greater the slope of the actual sequence numbers, the longer this event will be
delayed. Avoiding this situation limits how slowly sequence numbers can advance on a
connection
Three way handshake
● This establishment protocol involves one peer checking with the other that
the connection request is indeed current.
● Host 1 chooses a sequence number, x, and sends a CONNECTION
REQUEST segment containing it to host 2.
● Host 2 replies with an ACK segment acknowledging x and announcing its
own initial sequence number, y.
● Finally, host 1 acknowledges host 2’s choice of an initial sequence
number in the first data segment that it sends
Three way handshake
● three-way handshake works in the presence of delayed duplicate control
segments.
● In Fig. 6-11(b), the first segment is a delayed duplicate CONNECTION
REQUEST from an old connection.
● This segment arrives at host 2 without host 1’s knowledge.
● Host 2 reacts to this segment by sending host 1 an ACK segment, in
effect asking for verification that host 1 was indeed trying to set up a new
connection.
● When host 1 rejects host 2’s attempt to establish a connection, host 2
realizes that it was tricked by a delayed duplicate and abandons the
connection.
● In this way, a delayed duplicate does no damage.
Three way handshake
● The worst case is when both a delayed CONNECTION REQUEST and an
ACK are floating around in the subnet. This case is shown in Fig. 6-11(c).
● As in the previous example, host 2 gets a delayed CONNECTION
REQUEST and replies to it.
● At this point, it is crucial to realize that host 2 has proposed using y as the
initialsequence number for host 2 to host 1 traffic, knowing full well that no
segments containing sequence number y or acknowledgements to y are
still in existence.
● When the second delayed segment arrives at host 2, the fact that z has
been acknowledged rather than y tells host 2 that this, too, is an old
duplicate.
● The important thing to realize here is that there is no combination of old
segments that can cause the protocol to fail and have a connection set up
by accident when no one wants it.
Connection release
● Asymmetric release is the way the telephone system works: when one
party hangs up, the connection is broken.
● Asymmetric release is abrupt and may result in data loss.
● Symmetric release treats the connection as two separate unidirectional
● connections and requires each one to be released separately
Connection release
‘‘I am done. Are you done
too?’’ If host 2 responds:
‘‘I am done too. Goodbye,
the connection can be
safely released.’’
Two army problem
One way to kill off half-open connections is to have a rule saying that if no
segments have arrived for a certain number of seconds, the connection is
automatically disconnected. That way, if one side ever disconnects, the other side
will detect the lack of activity and also disconnect. This rule also takes care of the
case where the connection is broken (because the network can no longer deliver
packets between the hosts) without either end disconnecting first.
Multiplexing
if only one network address is available on a host, all transport connections on
that machine have to use it. When a segment comes in, some way is needed to
tell which process to give it to. This situation, called multiplexing, say suppose
there are four connections, four distinct transport connections all use the same
network connection (e.g., IP address) to the remote host.
Multiplexing
● A host has multiple network paths that it can use. If a user needs more
bandwidth or more reliability than one of the network paths can provide, a
way out is to have a connection that distributes the traffic among multiple
network paths . This modus operandi is called inverse multiplexing.
● With k network connections open, the effective bandwidth might be
increased by a factor of k. An example of inverse multiplexing is SCTP
(Stream Control Transmission Protocol), which can run a connection using
multiple network interfaces.
AC(W): The server sends an acknowledgement (A) and then crashes (C). The output process
writing (W) can happen before the crash.
AWC: The server sends an acknowledgement (A), writes to the output process (W), and then
crashes (C). This ordering is valid because the crash happens last.
C(AW): The server crashes (C) first, and after that, it cannot send an acknowledgement or write to
the output process, so A and W must occur before the crash in the sequence.
C(WA): The server crashes (C) first, and similarly to the previous case, A and W cannot follow it;
thus, they must occur before the crash.
WAC: The server writes to the output process (W) first, then sends an acknowledgement (A), and
finally crashes (C).
WC(A): The server writes to the output process (W), crashes (C), and cannot send an
acknowledgement (A) afterward. Here, A must occur before W.
Flow control
Flow control is keeping a fast transmitter from overrunning a slow receiver. The solutions that are
used at the transport layer are
1. A frame carries an error-detecting code (e.g., a CRC or checksum) that is used to check if the
information was correctly received.
2. A frame carries a sequence number to identify itself and is retransmitted by the sender until it
receives an acknowledgement of successful receipt from the receiver. This is called ARQ
(Automatic Repeat reQuest).
3. There is a maximum number of frames that the sender will allow to be outstanding at any time,
pausing if the receiver is not acknowledging frames quickly enough. If this maximum is one packet
the protocol is called stop-and-wait. Larger windows enable pipelining and improve performance on
long, fast links.
4. The sliding window protocol combines these features and is also used to support bidirectional
data transfer
● The buffers are needed at both the sender and the receiver. Certainly they are
needed at the sender to hold all transmitted but as yet unacknowledged segments.
● They are needed there because these segments may be lost and need to be
retransmitted However, since the sender is buffering, the receiver may or may not
dedicate specific buffers to specific connections
● If one is available, the segment is accepted; otherwise, it is discarded. Since the
sender is prepared to retransmit segments lost by the network, no permanent
harm is done by having the receiver drop segments, although some resources are
wasted. The sender just keeps trying until it gets an acknowledgement
● If the buffer size is chosen to be equal to the largest possible segment, space
will be wasted whenever a short segment arrives. If the buffer size is chosen
to be less than the maximum segment size, multiple buffers will be needed for
long segments, with the attendant complexity.
● Another approach to the buffer size problem is to use variable-sized buffers,
as in Fig. 6-15(b). The advantage here is better memory utilization, at the
price of more complicated buffer management.
● A third possibility is to dedicate a single large circular buffer per connection,
as in Fig. 6-15(c). This system is simple and elegant and does not depend on
segment sizes, but makes good use of memory only when the connections
are heavily loaded
Thank you