You are on page 1of 32

Computer networks

Name: K.SUDHA
Designation: Lecturer
Department: Electrical and Electronics Engineering

Subject code: CS2361


Year: III
Unit: III
Title: Introduction to Transport layer
TCP Overview
End to end issues
Segment format
Connection establishment
TCP sliding window
Stream control Transmission Protocol
Simple demultiplexor
TCP Congestion Control
• Determines the network capacity
• Adjust the number of packets that can have safely in transit
• Acks to pace the transmission of packets
• TCP is self clocking
• Avoids congestion
• Maxwindow=MIN(CongestionWindow,AdvertisedWindow)
• EffectiveWindow=MaxWindow-(LastByteSent-LastByteAcked)
Caused By
• the shortage of buffer space.
• slow links.
• slow processors

• Possible solutions
– End-to-end versus link-by-link control
– Rate-Based versus Credit-Based control
– The rate-based traffic-flow technique constantly
– Integrated congestion control
• Integrated congestion control
Principles of Congestion Control

Congestion:
• informally: “too many sources sending too much data too fast
for network to handle”
• different from flow control!
• manifestations:
– lost packets (buffer overflow at routers)
– long delays (queueing in router buffers)
• a top-10 problem!
Scenario 1: Queuing Delays
Host A
in : original data out
• two senders, two
receivers
Host B unlimited shared
• one router, infinite output link buffers

buffers
• no retransmission

• large delays when


congested
• maximum
achievable
throughput
Scenario 2: Retransmits
• one router, finite buffers
• sender retransmission of lost packet

Host A in : original data out

'in : original data, plus


retransmitted data

Host B finite shared output


link buffers
Scenario 3: Congestion Near Receiver
• four senders Q: what happens as 
in
• multihop paths and increase ?
• timeout/retransmit in
Host A out
in : original data
'in : original data, plus
retransmitted data
finite shared output
link buffers

Host B
Approaches towards congestion control
Two broad approaches towards congestion control:

End-end congestion control: Network-assisted congestion


• no explicit feedback from control:
network • routers provide feedback to end
• congestion inferred from end- systems
system observed loss, delay – single bit indicating
• approach taken by TCP congestion (SNA, DECbit,
TCP/IP ECN, ATM)
– explicit rate sender should
send at
TCP Congestion Control
• end-end control (no network How does sender perceive
assistance) congestion?
• sender limits transmission:
• loss event = timeout or 3
LastByteSent-LastByteAcked
 CongWin
duplicate acks
• Roughly, • TCP sender reduces rate
(CongWin) after loss
CongWin
event
rate = Bytes/sec
RTT function of
• CongWin is dynamic, three mechanisms:
perceived network congestion – AIMD
– slow start
– conservative after timeout
events
TCP AIMD
multiplicative decrease: cut additive increase: increase
CongWin in half after CongWin by 1 MSS every
loss event RTT in the absence of loss
events: probing
c o n g e s tio n
w in d o w

2 4 K b y te s

1 6 K b y te s

8 K b y te s

tim e

Long-lived TCP connection


TCP Slow Start
• When connection begins,
 When connection begins,
increase rate exponentially
CongWin = 1 MSS
– Example: MSS = 500 bytes &
fast until first loss event
RTT = 200 msec
– initial rate = 20 kbps
• available bandwidth may be
>> MSS/RTT
– desirable to quickly ramp up
to respectable rate
TCP Slow Start (more)
• When connection begins, Host A Host B
increase rate exponentially until
first loss event: one segm
ent

RTT
– double CongWin every RTT
– done by incrementing two segm
ents
CongWin for every ACK
received
• Summary: initial rate is slow but four segm
ents
ramps up exponentially fast

time
Refinement (more)

Q: When should the


exponential increase
switch to linear?
A: When CongWin gets to
1/2 of its value before
timeout.

Implementation:
• Variable Threshold
• At loss event, Threshold is set to
1/2 of CongWin just before loss
event
TCP sender congestion control
Event State TCP Sender Action Commentary
ACK receipt Slow Start CongWin = CongWin + Resulting in a doubling
for (SS) MSS, of CongWin every RTT
previously If (CongWin > Threshold)
unacked set state to
data “Congestion
Avoidance”
ACK receipt Congestio CongWin = CongWin+MSS Additive increase,
for n * (MSS/CongWin) resulting in increase of
previously Avoidance CongWin by 1 MSS
unacked (CA) every RTT
data
Loss event SS or CA Threshold = CongWin/2, Fast recovery,
detected by CongWin = Threshold, implementing
triple Set state to “Congestion multiplicative decrease.
duplicate Avoidance” CongWin will not drop
ACK below 1 MSS.
Timeout SS or CA Threshold = CongWin/2, Enter slow start
CongWin = 1 MSS,
Set state to “Slow Start”
Duplicate SS or CA Increment duplicate ACK CongWin and Threshold
ACK count for segment being not changed
Congestion Avoidance Mechanisms
• Helps to avoid congestion
• Additional functionality into the router to assist in anticipation of
congestion
• to control congestion once it happens

• to repeatedly increase load in an effort to find the point at


which congestion occurs, and then back off
Mechanisms
• router-centric: DECbit and RED Gateways

• host-centric: TCP Vegas


DECbit


DECbit

• Add binary congestion bit to each packet header


• Router
– monitors average queue length over last busy+idle cycle

– set congestion bit if average queue length greater than 1


when packet arrives

– attempts to balance throughput against delay



DECbit

• End Hosts
• destination echos bit back to source

• source records how many packets resulted in set bit

• if less than 50% of last window's worth had bit set, then increase
CongestionWindow by 1 packet

• if 50% or more of last window's worth had bit set, then decrease
CongestionWindow by 0.875 times
UDP—User Datagram Protocol
• An unreliable, connectionless transport layer protocol
• UDP format. See picture
• Two additional functions beyond IP:
– Demultiplexing: deliver to different upper layer entities such as
DNS, RTP, SNMP based on the destination port # in the header. i.e.,
UDP can support multiple applications in the same end systems.
– (Optionally) check the integrity of entire UDP. (recall IP only checks
the integrity of IP header.)
• If source does not want to compute checksum, fill checksum with all 0s.
• If compute checksum and the checksum happens to be 0s, then fill all 1s.
• UDP checksum computation is similar to IP checksum, with two more:
– Add extra 0s to entire datagram if not multiple of 16 bits.
– Add pseudoheader to the beginning of datagram. UDP pseudoheader

29
UDP datagram

0 16 31

Source Port Destination Port

UDP Length UDP Checksum

Data

Back to UDP—User Datagram Protocol


30
Figure 8.16
Back to UDP—User Datagram Protocol

UDP pseudoheader

0 8 16 31

Source IP Address

Destination IP Address

00000000 Protocol = 17 UDP Length

1.Pseudoheader is to ensure that the datagram has indeed


reached the correct destination host and port.
2. The padding of 0s and pseudoheader is only for the
computation of checksum and not be transmitted.

31
Figure 8.17
Thank u

You might also like