Anda di halaman 1dari 28

CHAPTER 6

TRANSPORT LAYER
6.1 - INTRODUCTION
Logical connection between application processes
running on different hosts (Network layer:
connection b/n hosts)
Sender: segmentation, encapsulation, multiplexing
Receiver: assembly, decapsulation, demultiplexing
Two transport-layer protocols:
TCP: connection-oriented, reliable, congestion control,
flow control
UDP: connectionless, unreliable, unordered, no
congestion control, no flow control
Port numbers identify processes
16-bit: 0-65,535
Client process is assigned port number randomly by
the transport layer software (ephemeral port
number)
Server process is assigned port number by the
application (well-known or registered)
IANA (Internet Assigned Number Authority)
has divided the port numbers into three ranges
Well-known ports (0 to 1023) are assigned and
controlled by IANA. Examples 23 (Telnet), 53
(DNS), 80 (HTTP), 110 (POP3), 443 (HTTPS), etc.
Registered ports (1,024 to 49,151) are not assigned
or controlled by IANA; they can only be registered
with IANA to prevent duplication.
Dynamic ports (49,152 to 65,535) are neither
controlled nor registered; they can be used by any
process. These are the ephemeral ports.
6.2 Multiplexing/Demultiplexing
Multiplexing gathers data from multiple
processes
Demultiplexing delivers segments to
correct processes
Host 1 Host 2 Host 3

Application P1 P2 Application P3 P4 Application

Transport Transport Transport

Network Network Network

Link Link Link

Physical Physical Physical


UDP has only four fields: source port
number, destination port number, length
and checksum
UDP socket is identified by two-tuple:
destination IP address and the destination
port number.
UDP (User Datagram Protocol) is defined
in RFC 768
often used for streaming multimedia
applications because these applications are
loss tolerant and rate sensitive. DNS and
SNMP also use UDP.
Reliable transfer over UDP is added at
application layer
UDP checksum is used to detect errors
UDP Checksum: 1s complement sum of segment
contents treated as sequence of 16-bit words is carried
out to produce the checksum and put into UDP
checksum field.
The receiver computes checksum of received segment, checks if
computed checksum equals checksum field value:
NO - error detected
YES - no error detected.
A carryout from the most significant bit needs to be
added to the result. For example: add two 16-bit
integers
TCP has the following fields (20 byte header)

Some of the fields in TCP:


TCP header length header length in 32-bit words
URG set to 1 if urgent pointer is used
ACK set to 1 to indicate acknowledgement number is valid.
PSH indicates PUSHED data.
RST used to reset a connection that has become confused due to a host crash or some other
reason
SYN used to establish connection
FIN used to release connection
TCP socket is identified by four-tuple:
source IP address, source port number,
destination IP address and destination port
number.
6.3 TCP Connection Management
Connection setup (three-way handshake) and
connection termination in TCP look as follows:
TCP Transmission
Reliable delivery in TCP is realized using acknowledgement
Stop-and-wait protocol scenarios
Stop-and-wait: every packet acknowledged before next
packet is sent
Pipelining: several packets sent before receiving 1st
acknowledgment
Suppose 1KB packet is transmitted over 1
Gbps link. Assuming the end to end
propagation delay is 15 ms, the utilization
for stop-and-wait protocol is calculated as
follows:

1KB pkt is transmitted every 30 msec,


i.e.33kB/sec throughput over 1 Gbps link;
this is an example where network protocol
limits use of physical resources!
Workout the example above when a pipeline of
three packets is used.
6.4 TCP Retransmission Scenarios
Different TCP retransmission scenarios are
shown below
Fast Retransmit

Time-out interval is often relatively long


Lost segments can be detected with duplicate
ACKs
A sender receives 3 ACKs for the same
data means the segment after the
acknowledged data was lost and will be
resent (fast retransmit).
Go-Back-N (GBN)
One of two pipelined protocols

Window of size N (sequence numbers for


transmission but not yet acknowledged
packets) slides forward over the sequence
number space. N is referred to as the
window size and the GBN protocol itself is
a sliding-window protocol.
The receiver discards out-of-order packets
and it does not buffer any out-of-order
packets.
Selective Repeat
The second pipelined protocol
avoids unnecessary retransmissions (the sender
retransmit only those packets that it suspects were
lost or corrupted). The receiver individually
acknowledge correctly received packets.
Selective Repeat (Contd)
Sender Receiver
6.5 Flow Control
Flow control is a speed-matching service
RcvWindow = RcvBuffer (LastByteRcvd
LastByteRead) - receiver
LastByteSent-LastByteAcked RcvWindow - sender
LastByteReceived

LastByteRead
Rcv Window

Data from IP Application


TCP data in
Spare room buffer process

Rcv Buffer
6.6 Congestion Control
Applications sending more data than the
network devices (e.g., routers and
switches) can accommodate causing the
buffers on such devices to fill up and
possibly overflow congestion
Typical effects of congestion: queueing
delay, packet loss or the blocking of new
connections
Congestion control: method used for
monitoring and regulating the total amount
of data entering the network so as to keep
traffic levels at an acceptable value.
Approaches to congestion Control
Network-assisted congestion control
Network-layer components (that is, routers)
provide explicit feedback to the sender
regarding the congestion state in the network.
E.g. Frame relay networks
Two mechanisms are available
BECN (backward explicit congestion notification)
bit set to inform senders to slow down.
FECN (forward explicit congestion notification) bit
set to inform the forward nodes that they should
inform the sender to slow down.
Approaches to congestion Control
(contd)
End-to-end congestion control
Network layer provides no explicit support to
the transport layer for congestion-control
purposes.
TCP takes this approach.
TCP segment loss is taken as an indication of
network congestion and TCP control the loss from
congestion by decreasing its window
TCP Congestion Control
Failure to receive an ACK indicates that
the receiving host may be overflowing or
that the network is congested
TCP congestion control algorithm has
three major components
Additive-Increase, Multiplicative Decrease
(AIMD)
No loss sender increases its CongWin by
roughly one MSS every round-trip time
Loss halves the current CongWin
TCP Congestion Control (contd)
Slow Start
When a TCP connection begins, CongWin is
initialized to one MSS, resulting in an initial
sending rate of roughly 1 MSS/RTT and
doubles every RTT until loss event
Reaction to Timeout Events
3 acknowledgements: CongWin is cut in half
and then increases linearly
timeout event: TCP sender enters a slow-start
phase, i.e. congestion window is set to 1 MSS
and then grows exponentially
TCP Congestion Control (contd)

Anda mungkin juga menyukai