Chapter 5
Chapter 5
Process-to-process delivery
To allow users to access the transport service, the transport layer must
provide some operations to application programs, that is, a transport service
interface. Each transport service has its own interface.
The transport service is similar to the network service, but there are also
some important differences. The main difference is that the network service is
intended to model the service offered by real networks, warts and all. Real
networks can lose packets, so the network service is generally unreliable. The
(connection-oriented) transport service, in contrast, is reliable.
Though the transport protocols resemble the Data Link Protocols, significant
differences are present due to the major dissimilarities between the
environments in which the two protocols operate.
A physical channel exists in DLL, where as it is replaced by the entire subnet for
Transport Layer
A final difference between the data link and transport layers is one of amount
rather than of kind. Buffering and flow control are needed in both layers, but
the presence of a large and dynamically varying number of connections in the
transport layer may require a different approach than we used in the data link
layer
Addressing
• When an application process wishes to set up a connection to a remote
application process, it must specify which one to connect to. The method
normally used is to define transport addresses to which processes can
listen for connection requests. In the Internet, these end points are called
ports.
6-14, a, b
6-14, c,d
(c) Response lost. (d) Response lost and subsequent DRs lost.
Flow Control and Buffering
Multiplexing can also be useful in the transport layer for another reason.
Suppose, for example, that a subnet uses virtual circuits internally and imposes a
maximum data rate on each one. If a user needs more bandwidth than one
virtual circuit can provide, a way out is to open multiple network connections and
distribute the traffic among them on a round-robin basis, called downward
multiplexing.
• The User Datagram Protocol (UDP) is a transport layer
protocol defined for use with the IP network layer
protocol. It is defined by RFC 768 written by John Postel.
It provides a best-effort datagram service to an End
System (IP host).
• The service provided by UDP is an unreliable service
that provides no guarantees for delivery and
protection from duplication. The simplicity no
reduces the overhead from using the protocol and of UDP
the
services may be adequate in many cases.
• UDP provides a minimal, unreliable, best-effort,
message-passing transport to applications and upper-
layer protocols
Introduction to UDP
The Internet protocol suite supports a connectionless transport protocol, UDP (User
Datagram Protocol).
The UDP header.
The source port is primarily needed when a reply must be sent back to the
source. The UDP length field includes the 8-byte header and the data.
UDP Checksum (A checksum to verify that the end to end data has not been
corrupted by routers or bridges in the network or by the processing in an end
system. The algorithm to compute the checksum is the Standard Internet
Checksum algorithm. This allows the receiver to verify that it was the intended
destination of the packet, because it covers the IP addresses, port numbers and
protocol number, and it verifies that the packet is not truncated or padded,
because it covers the size field. Therefore, this protects an application against
receiving corrupted payload data in place of, or in addition to, the data that was
sent. In the cases where this check is not required, the value of 0x0000 is
placed in this field, in which case the data is not checked by the receiver.
Remote Procedure Call
The idea behind RPC is to make a remote procedure call look as much as
possible like a local one. In the simplest form, to call a remote procedure, the
client program must be bound with a small library procedure, called the client
stub, that represents the server procedure in the client's address space.
Similarly, the server is bound with a procedure called the server stub. These
procedures hide the fact that the procedure call from the client to the server is
not local.
The Real-Time Transport Protocol
The basic function of RTP is to multiplex several real-time data streams onto a
single stream of UDP packets. RTP format contains several features to help
receivers work with multimedia information.
Each RTP packet in the stream is given a number one higher than its
predecessor. This allows the destination to determine if any packets were
missing.
RTP has no acknowledgements and no mechanism to request retransmissions.
Each RTP payload may contain multiple samples, and they may be coded any
way that the application wants.
The RTP header.
version (V): 2 bits: This field identifies the version of RTP. The
version is 2 upto RFC 1889.
padding (P): 1 bit: If the padding bit is set, the packet contains one
or more additional padding octets at the end which are not part of
the payload.
Xtension (X): 1 bit: If the extension bit is set, the fixed header is
followed by exactly one header extension
• CSRC count (CC): 4 bits: The CSRC count contains the number of CSRC
identifiers that follow the fixed header.
• marker (M): 1 bit: Marker bit is used by specific applications to serve a
purpose of its own. Used to mark the start of a video frame, start of a word
in audio channel.
• payload type (PT): 7 bits: This field identifies the format (e.g. encoding) of
the RTP payload and determines its interpretation by the application.
• sequence number: 16 bits: The sequence number increments by one for
each RTP data packet sent, and may be used by the receiver to detect packet
loss and to restore packet sequence.
• timestamp: 32 bits: The Timestamp is produced by the stream’s source to
note when the first sample in the packet was made. This value can help
reduce timing variability called jitter at the receiver by decoupling the
playback from the packet arrival time.
• SSRC: 32 bits: The SSRC field identifies the synchronization source. It is the
method used to multiplex and demultiplex data streams onto a single
stream of UDP packets
• CSRC list: 0 to 15 items, 32 bits each: The CSRC list identifies the contributing
sources for the payload contained in this packet.
Real-time Transport Control Protocol
• RTP has a little sister protocol called RTCP (Realtime Transport
Control Protocol).
• It handles feedback, synchronization, and the user interface but
does not transport any data. The first function can be used to
provide feedback on delay, jitter, bandwidth, congestion, and
other network properties to the sources
• RTCP also handles interstream synchronization. The problem is
that different streams may use different clocks, with different
granularities and different drift rates. RTCP can be used to keep
them in sync.
• RTCP provides a way for naming the various sources (e.g., in
ASCII text). This information can be displayed on the receiver's
screen to indicate who is talking at the moment.
• TCP (Transmission Control Protocol) was specifically designed
to provide a reliable end-to-end byte stream over an
unreliable internetwork.
A socket may be used for multiple connections at the same time. In other
words, two or more connections may terminate at the same socket.
Connections are identified by the socket identifiers at both ends, that is,
(socket1, socket2). No virtual circuit numbers or other identifiers are used.
Port numbers below 1024 are called well-known ports and are reserved for
standard services
TCP Protocol
application application
writes data reads data
socket socket
layer layer
TCP TCP
data segment
send buffer receive buffer
ACK segment
TCP Header.
• The Source port and Destination port fields identify the local end
points of the connection. A port plus its host's IP address forms a
48-bit unique end point. The source and destination end points
together identify the connection.
• This connection identifier is called a 5 tuple because it consists
of five pieces of information: the protocol (TCP), source, IP and
source port, and destination IP and destination port.
• The Sequence number and Acknowledgement number fields
perform their usual functions. The latter specifies the next byte
expected, not the last byte correctly received. Both are 32 bits
long because every byte of data is numbered in a TCP stream.
• The TCP header length tells how many 32-bit words are
contained in the TCP header.
• Next comes a 4-bit field that is not used.
• CWR and ECE are used to signal congestion when ECN (Explicit
Congestion Notification) is used. ECE is set to signal an ECN-
Echo to a TCP sender to tell it to slow down when the TCP
receiver gets a congestion indication from the network. CWR
is set to signal Congestion Window Reduced from the TCP
sender to the TCP receiver so that it knows the sender has
slowed down and can stop sending the ECN-Echo.
TCP connection
management finite state
machine. The heavy solid
line is the normal path for a
client. The heavy dashed
line is the normal path for
a server. The light
lines are unusual events.
Each transition is labeled
by the event causing it and
the action resulting from
it, separated by a slash.
TCP Transmission Policy
Window probe is a packet sent by
the sender, who can send a 1-byte
segment to force the receiver to
reannounce the next byte expected
and the window size.
Delayed acknowledgements is an
optimization, where the idea is to
delay acknowledgements
and window updates for up to 500
msec in the hope of acquiring some
data on which to hitch a free ride.
The advantage of this scheme called indirect TCP, is that both connections are now
homogeneous. Timeouts on the first connection can slow the sender down, whereas
timeouts on the second one can speed it up
Transactional TCP (T/TCP)