You are on page 1of 55

1502346 - Computer Communications and

Networks
Dr. Mohamed Saad
Department of Computer Engineering
University of Sharjah

msaad@sharjah.ac.ae

Chapter 6: The Transport Layer


M. Saad

The Transport Layer

• The ultimate goal of the transport layer is to provide efficient, reliable


and cost-effective service to its users.

• Users → processes in the application layer.

• The transport layer may provide two types of services: connection-


oriented and connectionless.

• Connection-oriented and connectionless transport services are very similar


to the corresponding network layer services.

• Addressing, flow control and congestion control are also similar in the
network and transport layers.

1502346 - Computer Communications & Networks 1


M. Saad

Why Transport Layer?

• Question: Why do we have a network layer and a transport layer?

• Answer:
– The transport layer protocols run entirely on the users’ (hosts’)
machines, while network layer protocols run on the routers (core
of the network operated by the carrier).
– Users have no control over the network layer, they cannot improve
their service by using better routers or putting more error handling
in the data link layer. The only possibility is to improve the QoS
by performing end-to-end congestion control, flow control and error
control at the transport layer.

1502346 - Computer Communications & Networks 2


M. Saad

The Network, Transport and Application Layers


Host 1 Host 2

Application Application
(or session) Application/transport (or session)
layer interface layer
Transport
address

TPDU
Transport Transport
entity Transport entity
protocol

Network
address Transport/network
Network layer interface Network layer

• Transport entity: hardware and/or software within the transport layer that does the
work.
• Transport protocol data unit (TPDU): messages sent from transport entity to transport
entity.

1502346 - Computer Communications & Networks 3


M. Saad

TPDUs, packets and frames

Frame Packet TPDU


header header header

TPDU payload

Packet payload

Frame payload

1502346 - Computer Communications & Networks 4


M. Saad

Elements of Transport Protocols


• The transport service is implemented by a transport protocol used between two transport
entities.
• In some way, transport protocols resemble the data link layer protocols (we studied
earlier) → both protocols deal with error control, sequencing and flow control (among
other issues).
• Question: What is the difference between transport layer protocols and data link layer
protocols? Answer:
Router Router Subnet

Physical
communication channel Host

(a) (b)

At the data link layer, two routers communicate directly via a direct (point-to-point)
physical channel. At the transport layer, this physical channel is replaced by the entire
subnet.

1502346 - Computer Communications & Networks 5


M. Saad

Elements of Transport Protocols

• The basic elements of transport protocols can be summarized as follows:


1. Addressing
2. Connection establishment
3. Connection release
4. Flow control and buffering
5. Multiplexing
6. Crash recovery

1502346 - Computer Communications & Networks 6


M. Saad

Addressing

• When an application process wishes to set up a connection to a remote


application process, it must specify the transport address of the remote
process.

• In the Internet, end points are usually called ports, and transport address
of an end point is called port number.

• We will use the generic term Transport Service Access Point . Similarly,
end points in the network layer are called Network Service Access Points.

1502346 - Computer Communications & Networks 7


M. Saad

Addressing (contd.)
Host 1 Host 2
Server 1 Server 2
Application TSAP 1208 Application
process layer

Transport
Transport layer TSAP 1522 TSAP1836
connection

NSAP Network
layer NSAP

Data link
layer

Physical
layer

• The purpose of having a TSAP is that, in some networks, each computer has a single
NSAP, so some way is needed to distinguish between multiple transport end points that
share that NSAP.

1502346 - Computer Communications & Networks 8


M. Saad

Connection Establishment

• Establishing a connection sounds easy, but it is actually tricky.


• At a first glance, it would seem sufficient for one transport entity to send a
CONNECTION REQUEST TPDU to the destination, and wait for a CONNECTION
ESTABLISHMENT TPDU.
• Problem occurs when the network can lose, store and duplicate packets. Worst possible
nightmare →
– A user establishes a connection with a bank, sends a message asking the bank to
transfer a large amount of money to the account of another person, then releases
the connection.
– Each packet in the scenario is duplicated and stored in the subnet. after the
connection has been released, all the packets pop out and arrive at the destination
in order, asking the bank to establish a connection, transfer money (again), and
release the connection.
– The bank must assume this is a second, independent transaction, and transfers the
money again.

1502346 - Computer Communications & Networks 9


M. Saad

Three-Way Handshake
Host 1 Host 2 Host 1 Host 2
Old duplicate
CR (
s eq = CR (s
x) eq = x
)

= x) = x)
CK CK
Time
A A
= y, = y,
(s eq (seq
ACK ACK

DAT
A (seq REJEC
= x, T (AC
ACK K = y)
= y)

(a) (b)

Host 1 Host 2
CR (
seq
= x)
Old duplicate
)
=x
CK
y, A
q=
K (se
AC
DAT
A (s
ACK eq = x,
= z)
Old duplicate

REJ
ECT
(ACK
= y)

(c)

1502346 - Computer Communications & Networks 10


M. Saad

Three-Way Handshake (contd.)


• Normal procedure (a): Host 1 chooses a sequence number x and sends a CONNECTION
REQUEST TPDU (containing the sequence number) to host 2. Hosts 2 replies with
an ACK TPDU acknowledging x and announcing its own initial sequence number y .
Finally, host 1 acknowledges host 2’s choice of initial sequence number in the first data
TPDU that it sends.
• Duplicate CONNECTION REQUEST (b): Host 2 receives a delayed duplicate
CONNECTION REQUEST from an old connection. Host 2 reacts by sending an
ACK TPDU, in effect asking for a verification that host 1 was indeed trying to set up
a new connection. Host 1 rejects host 2’s attempt to establish a connection. Host 2
knows that it was tricked by a delayed duplicate and abandons the connection.
• Duplicate CONNECTION REQUEST and ACK (c): Host 2 gets a delayed
CONNECTION REQUEST and replies to it. Note that host 2 has proposed using
y as the initial sequence number for host 2 to host 1 traffic, knowing that TPDU’s with
sequence number y or acknowledgements to y do not exist. When the second delayed
TPDU arrives at host 2, the fact that z is acknowledged rather than y tells host 2 that
this, too, is an old duplicate. Later host 1 will also reject host 2’s ACK.

1502346 - Computer Communications & Networks 11


M. Saad

Connection Release

• Asymmetric release: when one party hangs up, the connection is broken.
Host 1 Host 2

CR

ACK

Time DATA

DATA

DR
No data are
delivered after
a disconnect
request

• Symmetric release: treats the connection as 2 unidirectional connections


and requires each one to be released separately.

1502346 - Computer Communications & Networks 12


M. Saad

Three-Way Handshake for Connection Release


Host 1 Host 2 Host 1 Host 2
Send DR DR Send DR DR
+ start timer + start timer

Send DR Send DR
+ start timer
DR DR + start timer
Release Release
connection connection

Send ACK ACK


ACK
Release Send ACK
connection Lost (Timeout)
release
connection

(a) (b)

Host 1 Host 2 Host 1 Host 2


Send DR DR Send DR DR
+ start timer Send DR & + start timer Send DR &
DR start timer start timer
Lost Lost
( Timeout)
DR
send DR ( Timeout)
Send DR &
+ start timer send DR
start timer Lost
DR + start timer
Release
connection

Send ACK ACK


Release (N Timeouts) (Timeout)
connection release release
connection connection

(c) (d)

1502346 - Computer Communications & Networks 13


M. Saad

Three-Way Handshake (contd.)


• Normal procedure (a): One user sends a DR (DISCONNECTION
REQUEST) TPDU. When it arrives, the recipient sends back a DR
TPDU. When this DR arrives, the original sender sends an ACK TPDU
and releases the connection. When the ACK TPDU arrives, the receiver
also releases the connection. (Note that users initiate a timer after
sending a DR TPDU, just in case the DR gets lost.)

• Final ACK lost (b): Host 2 releases the connection by timeout.

• Second DR lost (c): Host 1 times out and sends DR all over again.

• Second DR lost and subsequent DR attempts also fail (d): After N


timeouts, the sender gives up and releases the connection. Meanwhile
the receiver times out and also exits.

1502346 - Computer Communications & Networks 14


M. Saad

Transmission Control Protocol (TCP)

• The Transmission Control Protocol (TCP) is a very important transport


layer protocol; it is the main workhorse of the Internet.

• TCP was specifically designed to provide a reliable end-to-end byte


stream over an unreliable internetwork.

• A TCP service is obtained as follows:


– Both the sender and receiver create end points called sockets.
– Each socket has a number (address) consisting of the IP address of the host and a
16-bit port number.
– To establish a TCP service, a connection must be explicitly established between a
socket on the sending machine and a socket on the receiving machine.

1502346 - Computer Communications & Networks 15


M. Saad

The TCP Protocol

• The sending and receiving transport entities exchange information in form segments ⇒
in the context of TCP the TPDU is called segment.
• A TCP segment consists of a fixed 20-byte header (plus an optional part), followed by
zero or more data bytes.
• Two limits restrict the segment size:
– the TCP segment must fit in the 65,515-byte IP payload; and
– it must fit in the network’s maximum transfer unit (MTU). In practice the MTU is
1500 bytes.
• In what follows we will describe:
– The TCP segment header.
– The TCP transmission policy (sliding window protocol).
– TCP congestion control (mostly next lecture).

1502346 - Computer Communications & Networks 16


M. Saad

The TCP Segment Header


32 Bits

Source port Destination port

Sequence number

Acknowledgement number

TCP U A P R S F
header R C S S Y I Window size
length G K H T N N

Checksum Urgent pointer

Options (0 or more 32-bit words)

Data (optional)

• Every segment begins with a 20-bytes header. The fixed header may be followed by
header options. After the options, if any, 65,535-20-20 data bytes may follow (why?)

1502346 - Computer Communications & Networks 17


M. Saad

The TCP Segment Header (contd.)

• The source port and the destination port identify the local end points of a connection.
– Some port numbers are well-known and are reserved for standard services. For
example:

1502346 - Computer Communications & Networks 18


M. Saad

The TCP Segment Header (contd.)

• The Sequence number specifies the the first byte in the current segment.
• The Acknowledgment number specifies the sequence number of the next byte expected.
• The TCP header length specifies how many 32-byte words are contained in the TCP
header. (Why do we need this field?)
• URG = 1 → if the Urgent pointer is in use. The Urgent pointer indicates a byte offset
from the current sequence number at which urgent data are to be found.
• ACK = 1 → indicates that the Acknowledgment number is valid. If ACK = 0, the
segment does not contain an acknowledgement.
• PSH = 1 → indicates PUSHed data. The receiver is kindly requested to deliver the
data to the application upon arrival and not buffer it until a full buffer has been received
(which it might otherwise do.....why?).
• RST = 1 → used to reset a connection that has become confused due to a host crash
or some other reason. It is also used to reject an invalid segment, or refuse an attempt
to open a connection.

1502346 - Computer Communications & Networks 19


M. Saad

The TCP Segment Header (contd.)

• SYN = 1 → is used to establish a connection. In particular, SYN = 1


and ACK = 0 indicates a CONNECTION REQUEST, and SYN = 1 and
ACK = 1 indicates a CONNECTION ACCEPTED.

• FIN = 1 → is used to release a connection. It specifies that the sender


has no more data to transmit.

• Checksum is used for error-control purposes.

• The Window size indicates the number of bytes the sender is allowed
to transmit before an ACK is received. In other words, the Window
size indicates the number of outstanding unacknowledged bytes in
transmission.

1502346 - Computer Communications & Networks 20


M. Saad

The TCP Transmission Policy

• Basic sliding window protocol:


– When a sender transmits a segment, it also starts a timer.
– When the segment arrives at the destination, the receiving TCP entity sends back
an ACK (= sequence # of the byte expected next).
– If the sender times out before ACK is received, it transmits the same segment again.

• The receiver announces also a variable window size with every ACK.
(Note that dynamically changing the window size provides some sort of
flow control).

• Window management → the choice of window size is illustrated by the


following example (assume the receiver has a 4-Kbyte buffer):

1502346 - Computer Communications & Networks 21


M. Saad

Window Management

Sender Receiver Receiver's


Application buffer
does a 2K 0 4K
write
Empty
2K S
EQ =
0

2K
ACK = 2048 WIN = 2048

Application
does a 2K
write 2K SEQ = 2048
Full

Sender is Application
IN = 0
blocked 4096 W reads 2K
ACK =
= 2048
40 96 WIN
ACK =
2K
Sender may
send up to 2K

1K
SEQ =
4096
1K 2K

1502346 - Computer Communications & Networks 22


M. Saad

Some Issues in TCP Transmission

• When the receiver window = 0, the sender may not normally send
segments. There are two exceptions:
– urgent data, e.g., disconnection request;
– the sender may send a 1-byte segment to make the receiver announce
the next byte and window size. The TCP standard explicitly provides
this option to prevent deadlock if a window announcement ever gets
lost.

1502346 - Computer Communications & Networks 23


M. Saad

Nagle’s Algorithm

• Consider an interactive application (e.g., telnet connection to an interactive editor)


that generates data byte-by-byte.
• Data will come to the sender transport layer one byte at a time. To send one byte of
data, the sender creates a 21-byte TCP segment (20 bytes header + 1 byte data). The
segment is given to IP which appends a 20-byte header, and sends a 41-byte packet .
• Inefficient use of BW ⇒ 41 bytes transmitted to send only 1 byte of data (in addition
to ACK’s and receiver window updates).
• Nagle’s algorithm →
– When data comes to the sender one byte at a time, just send the first byte and wait
buffer all the rest until the outstanding byte is acknowledged.
– Then send all the buffered characters in one TCP segment and start buffering again
until they are all acknowledged.
• Nagle’s algorithm may greatly reduce the bandwidth used (Why?)

1502346 - Computer Communications & Networks 24


M. Saad

The Silly Window Syndrome

Receiver's buffer is full

Application reads 1 byte

Room for one more byte

Header Window update segment sent

Header New byte arrives

1 Byte
Receiver's buffer is full

1502346 - Computer Communications & Networks 25


M. Saad

The Silly Window Syndrome (contd.)

• The silly window syndrome occurs when an interactive application at the


receiver side reads data 1 byte at a time.
– Initially, TCP buffer on the receiving side is full and the sender knows
this (i.e., has a receiver window size of 0).
– The receiver application reads 1 byte (character) from the TCP stream.
– This action makes the receiver TCP happy, so it sends a window
update to the sender saying it is all right to send 1 byte.
– The sender obliges and sends 1 byte.
– The receiver buffer is now full, so the receiver acknowledges the 1 byte
but sets the receiver window to 0.
– This behavior can go on forever, significantly wasting BW.

1502346 - Computer Communications & Networks 26


M. Saad

Clark’s Solution

• Clark’s Solution (1982) to the silly window syndrome:


– Prevent the receiver from sending a window update for 1 byte.
– Instead, it is forced to wait until it has a decent amount of buffer space available
before advertising the new window size.
– Specifically, the receiver should not send a new window update until it can handle
one maximum segment size, or until half of its buffer is empty, whichever is smaller.

• Nagle’s algorithm and Clark’s solution to the silly window syndrome are
complementary.
– Nagle was trying to prevent senders from sending 1 byte at a time, Clark was trying
to solve the problem resulting from the receiver reading data 1 byte at a time.

1502346 - Computer Communications & Networks 27


M. Saad

TCP Timer Managament

• TCP uses multiple timers.

• Among the most important timers used by TCP are:


– retransmission timer; and
– persistence timer.

1502346 - Computer Communications & Networks 28


M. Saad

Retransmission Timer

• When a segment is sent, a retransmission timer is started.


– If the segment is acknowledged before timeout, the timer is stopped.
– If the timer goes off before the acknowledgement comes in, the segment is
retransmitted (and the timer is started again).

• How long should the timeout interval be?


– too short → unnecessary retransmissions → unnecessary use of BW;
– too long → increased delay.

• We should have “timeoutinterval > RT T ”. Estimating round-trip time


(RT T ) is more difficult at the transport layer than at the data link layer.

1502346 - Computer Communications & Networks 29


M. Saad

Retransmission Timer (contd.)


• Round-trip time (RT T ) estimation is more difficult at the transport layer than at the
data link layer.
• (a) is the probability density function (PDF) of RT T at the data link layer; (b) is the
PDF of RT T at the transport layer.

0.3 T 0.3 T1 T2

0.2 0.2
Probability

Probability
0.1 0.1

0 0
0 10 20 30 40 50 0 10 20 30 40 50
Round-trip time (msec) Round-trip time (msec)
(a) (b)

• Solution → dynamically update the RTT estimate → Jacobson’s algorithm:

1502346 - Computer Communications & Networks 30


M. Saad

Jacobson’s Algorithm for Timeout Estimation

• For every segment sent, TCP records the (instantaneous) time needed for ACK come
in, say RT T .
• RT T (the estimated average round-trip time) is updated according to

RT T = αRT T + (1 − α)RT T,

where α is a smoothing factor that determines how much weight is given to old value.
Typically, α = 7/8.
• When the ACK comes in, the difference between the average and instantaneous RTTs,
D = |RT T − RT T |, is computed. A smoothed value of this difference, D, is
maintained by the update formula: D = αD + (1 − α)D.
Note that D is a cheap estimator of the standard deviation of RT T . Then

Timeout = RT T + 4 × D.

1502346 - Computer Communications & Networks 31


M. Saad

Comments on Jacobson’s Algorithm

• In essence, timeout is estimated as Timeout ≈ Mean(RT T ) + 4 ×


Standard Deviation(RT T ).

• Multiplying by 4 can be implemented using register shifts.

1502346 - Computer Communications & Networks 32


M. Saad

Persistence Timer

• The persistence timer is designed to prevent the following deadlock:


– The receiver sends an ACK with a window size of 0, telling the sender to wait.
– Later, the receiver updates the window, but the segment with the update is lost.
– Now, both the sender and receiver are waiting for each other to do something.
– When the persistence timer goes off, the sender transmits a probe to the receiver.
The response to the probe gives the window size.
– If the window size is still zero, the persistence timer is set again, and the cycle
repeats. If the window size is non-zero, data can now be sent.

1502346 - Computer Communications & Networks 33


M. Saad

Congestion Control
• Congestion control is to dynamically adjust the sender transmission rate as to avoid
congesting the network links.
• Flow control vs. congestion control:

Transmission
rate adjustment

Transmission
network Internal
congestion

Small-capacity Large-capacity
receiver receiver

(a) (b)

1502346 - Computer Communications & Networks 34


M. Saad

TCP Congestion Control


• We have seen that the receiver can specify a window based on its buffer size.
• If the sender sticks to this window size, problems will not occur due to buffer overflow
at the receiving end, but they may still occur due to congestion within the network.

Transmission
rate adjustment

Transmission
network Internal
congestion

Small-capacity Large-capacity
receiver receiver

(a) (b)

1502346 - Computer Communications & Networks 35


M. Saad

Congestion Window vs. Receiver Window


• The Internet solution is to realize that both problems exist–network
capacity and receiver capacity–and to deal with each of them separately.

• To do this, each sender maintains two windows:


– Receiver window (as advertised, also called flow control window)
– Congestion window

• Sender window = min {receiver window, congestion window}

• Example:
– If the receiver says “send 8 KB” but the sender knows that bursts of more than 4
KB will congest the network, it sends only 4 KB.
– If the receiver says “send 8 KB” and the sender knows that bursts of up to 32 KB
will not congest the network, it sends the full 8 KB.

1502346 - Computer Communications & Networks 36


M. Saad

The Idea of TCP Congestion Control

• When a connection is established, the sender initializes the congestion


window to the size of one maximum segment in use on the connection.

• The congestion window is increased upon lack of congestion, and


decreased upon detecting congestion.

• Congestion is detected by packet (segment) loss. This assumption is


good for today’s wired (e.g., fiber) networks. Why?

• In what follows we will cover the following techniques:


– Additive increase, multiplicative decrease (AIMD) congestion control
– Slow start
– TCP Tahoe
– TCP Vegas

1502346 - Computer Communications & Networks 37


M. Saad

Additive Increase - Multiplicative Decrease Congestion


Control

• The sender initializes the congestion window to the size of one maximum segment in
use on the connection. The sender then sends one segment.
• Additive increase:
– If this segment is acknowledged before timeout, the sender adds one segment’s
worth of bytes to the congestion window to make it 2 segments.
– If these 2 segments are acknowledged before timeout, the congestion window is
increased to 3 segments, . . . etc.
– The congestion window is increased by one maximum segment every round-trip time,
i.e., the congestion window increases linearly.
• Multiplicative decrease:
– If a segment is lost (detected by timeout or NAK), the congestion window is reduced
by half.
• AIMD leads to the TCP ”sawtooth”!

1502346 - Computer Communications & Networks 38


M. Saad

Slow Start

• The sender initializes the congestion window to the size of one maximum segment in
use on the connection.
• It then sends one maximum segment.
• If this segment is acknowledged before timeout, the sender adds one segment’s worth
of bytes to the congestion window to make it 2 segments.
• If these 2 segments are acknowledged before timeout, the congestion window is increased
to 4 segments, . . . etc.

⇒ The congestion window is increased by one maximum segment for every segment
acknowledged. In other words, the congestion window is doubled every round-trip time.

• The congestion window increases exponentially. This start is, thus, not slow at all!
• The name slow start comes from the fact that the congestion window is initialized to
only one segment.

1502346 - Computer Communications & Networks 39


M. Saad

TCP Tahoe

• In addition to the receiver window and the congestion window, TCP


Tahoe (which is used in the Internet) uses a third parameter: the
threshold. Initially, the threshold is set to 64 KB.

• Algorithm:
– When a timeout occurs, the threshold is set to half of the current congestion window,
and the congestion window is reset to one maximum segment.
– Slow start is then used to determine what the network can handle.
– The (slow start) exponential growth stops when congestion window = threshold.
From that point, the congestion window is increased (linearly) by one segment every
round-trip time.

• The following example illustrates the algorithm.

1502346 - Computer Communications & Networks 40


M. Saad

Example
44
Timeout
40

36
Threshold
32
Congestion window (kilobytes)

28

24 Threshold

20

16

12

0
0 2 4 6 8 10 12 14 16 18 20 22 24
Transmission number

1502346 - Computer Communications & Networks 41


M. Saad

Example (contd.)

• The maximum segment size is 1 KB.


• Initially, the congestion window was 64 KB, but time out occurred, so the threshold is
set to 32 KB and the congestion window to 1 KB (for transmission # 0).
• Slow start is used, so the congestion window increases from 1 KB to 2 KB to 4 KB to
8 KB to 16 KB to 32 KB.
• When the congestion window hits 32 KB (the threshold), it increases linearly from 32
to 33 to 34 to 35 to 36 to 37 to 38 to 39 to 40 KB.
• The timeout occurs (at transmission # 13), so the threshold is set to half the current
congestion window, i.e., 20 KB, and the congestion window is reset to 1 KB.
• Then slow start is used, so the congestion window grows from 1 to 2 to 4 to 8 to 16
to 20 KB.
• When the congestion window hits 16 KB (the new threshold), it grows linearly from 20
to 21 to 22 to 23 to 24 to 25 KB, . . . etc.

1502346 - Computer Communications & Networks 42


M. Saad

TCP Vegas Congestion Control Algorithm

• TCP Vegas attempts to maintain the right amount of extra data in the
networks (i.e., the node buffers).
– When there is too much data in the queues/buffers, then the delay will increase,
and congestion may happen.
– When there is no data in the queues/buffers, then there is a risk that the available
BW is not fully utilized.

1502346 - Computer Communications & Networks 43


M. Saad

TCP Vegas (contd.)

• Definitions:
– CW : current congestion window.
– BaseRT T : minimum (“congestion-free”) round-trip time. In practice, TCP Vegas
sets BaseRT T to the smallest RT T measured so far; it is commonly the RT T
of the first packet sent by the connection, before the router queues increase due to
traffic generated by this flow.
– RT T : actual (“with congestion”) round-trip time.
– ExpectedRate = CW/BaseRT T : data rate achieved when there is no
congestion, i.e., when there is no segments waiting in the intermediate queues.
– ActualRate = CW/RT T : actual data rate, with congestion.
– Dif f = ExpectedRate − ActualRate, i.e.,

Dif f = CW/BaseRT T − CW/RT T

1502346 - Computer Communications & Networks 44


M. Saad

TCP Vegas Operation


• Every RT T , do:
– if Dif f < α, then CW := CW + 1;
– Dif f > β , then CW := CW − 1

• Note that α and β are thresholds.

• Note also that if there is congestion (i.e., too many packets in the queues),
RT T becomes too large (and Dif f becomes too large accordingly).
Therefore, CW needs to decreased. This is triggered by the β-threshold.

• If there is no congestion (i.e. the queues are empty), RT T becomes


small (and Dif f becomes too small accordingly). Therefore, CW needs
to increased to avoid the risk of not fully utilizing the available BW. This
is triggered by the α-threshold.

1502346 - Computer Communications & Networks 45


M. Saad

TCP Vegas – Smooth Change in Congestion Window

• This graph is taken from L.L. Peterson and B.S. Davie. “Computer Networks: A
Systems Approach”, Morgan Kaufmann, 2003.
• Top figure: change of congestion window with time.
• Bottom figure: ExpectedRate (colored line), ActualRate (black line). The shaded
area is the region between the α and β thresholds.

1502346 - Computer Communications & Networks 46


M. Saad

Final Comment on TCP Vegas

• Recent literature indicates that TCP Vegas is optimal in the sense that it maximzies
the total “satisfaction” of all connections (under some conditions).
• Interested in learning more about this (advanced topic):
– S.H. Low, L.L. Peterson and L. Wang, “Understanding Vegas: A Duality Model”,
Journal of the ACM, vol. 49, no. 2, pp. 2072–235, March 2002.
– Or, do a masters at UOS, and take my course “0403544 – Computer Networks
Design and Performance”.

1502346 - Computer Communications & Networks 47


M. Saad

User Datagram Protocol (UDP)

• User datagram protocol (UDP) is an unreliable, connectionless protocol.

• UDP provides a way for applications to send encapsulated IP datagrams


and send them without having to establish a connection.

• UDP transmits segments consisting of an 8-byte header followed by the


payload.

⇒ UDP is basically just IP with a short header added.

1502346 - Computer Communications & Networks 48


M. Saad

UDP Header
32 Bits

Source port Destination port

UDP length UDP checksum

• The UDP header specifies the source port and destination port.
• When a UDP segment arrives, its payload is handed to the application process attached
to the destination port.
• The source port is needed if a reply must be sent back to the sender.
• In fact, the main value of having UDP over just using raw IP is the addition of the
source and destination ports. Otherwise, the receiving transport layer would not know
to which application to hand the packet.
• UDP length field specifies the length of the UDP segment (header and data).
• UDP Checksum field is optional.

1502346 - Computer Communications & Networks 49


M. Saad

What UDP Does Not Do

• Flow control

• Error control

• Retransmission upon receipt of a bad segment.

1502346 - Computer Communications & Networks 50


M. Saad

Applications of UDP

• UDP is useful in client-server situations. Often, a client sends a short


request to the server and expects a short reply back. If either the request
or reply is lost, the client (at the application layer) can just time out and
try again. Example:
– Domain Name System (DNS): A program needs to look up the IP address of some
host name, e.g., www.sharjah.ac.ae, can send a UDP segment containing the host
name to the DNS server. The server replies with a UDP segment containing the
host’s IP address.

• The Real-Time Transport Protocol (RTP)

1502346 - Computer Communications & Networks 51


M. Saad

The Real-Time Transport Protocol

• The Real-time Transport Protocol (RTP) is generic transport protocol for


Internet radio, Internet telephony, videoconferencing, video-on-demand
and other multimedia applications.

Ethernet IP UDP RTP


Multimedia application header header header header
User
space RTP
Socket interface RTP payload

UDP
OS
IP UDP payload
Kernel
Ethernet IP payload

Ethernet payload
(a) (b)

1502346 - Computer Communications & Networks 52


M. Saad

RTP (contd.)

• RTP can be considered as a transport protocol that is implemented in the application


layer. It runs (normally) over UDP.
• RTP Operation:
– Multimedia applications consist of multiple audio, video, text, and possibly other
streams.
– RTP multiplexes these streams and encodes them in RTP packets.
– The transport layer (UDP) embeds each RTP packet in a UDP segment, which is
in turn embedded in an IP packet at the network layer.
– If the computer is on an Ethernet, the IP packets are embedded in Ethernet frames
for transmission.
• RTP provides no flow control, no error control, no acknowledgements and no
retransmission strategy.
• The RTP header includes a sequence number. If a packet is lost, the best action for
the destination is to approximate the missing data by interpolation.

1502346 - Computer Communications & Networks 53


M. Saad

Thanks

1502346 - Computer Communications & Networks 54

You might also like