SlideShare uma empresa Scribd logo
1 de 31
TCP
2
TCP
• Connection Establishment
• Connection Maintenance
• Reliability
• Congestion control
• Flow control
• Sequencing
• Connection Termination
3
Ports, End-points, & Connections
• Thus, an end-point is represented by (IP address,Port)
• Ports can be re-used between transport protocols
• A connection is (SRC IP address, SRC port, DST IP address,
DST port)
• Same end-point can be used in multiple connections
IP Layer
TCP UDP
http ftp email zoom
IP address
Protocol ID
A1 A2 A3
Transport
Port
4
Active and Passive Open
• How do applications initiate a connection?
• One end (server) registers with the TCP layer instructing it to
“accept” connections at a certain port
• The other end (client) initiates a “connect” request which is
“accept”-ed by the server
5
Connection Establishment & Termination
• 3-way handshake used
for connection
establishment
• Randomly chosen
sequence number is
conveyed to the other
end
• Similar FIN, FIN+ACK
exchange used for
connection termination
SYN
SYN+ACK
ACK
DATA
Server does passive open
Accept connection request
Send acceptance
Start connection
Active open
Send connection
request
6
Reliability (Loss Recovery)
• Sequence Numbers
• TCP uses cumulative
Acknowledgments (ACKs)
• Next expected in-sequence packet
sequence number
• Pros and cons?
• Piggybacking
ack
data
5
1
2
3
4
3
4
3
1
2
3
4
3
3
4
Timeout calculation
Rttavg = k*Rttavg + (1-k)*Rttsample
RTO = Rttavg + 4*Rttdeviation
7
Fundamental Mechanism
• Simple stop and go protocol
• Timeout based reliability (loss
recovery)
data
retx
ack
data
ack
data
Sliding Window Protocol: 1 2 3 4 5 6 7 8 9 10 11 12 ….
• Multiple unacknowledged packets!
8
Congestion Control
• Slow Start
• Start with W=1
• For every ACK, W=W+1
• Congestion Avoidance (linear
increase)
• For every ACK,
• W = W+1/W
• Congestion Control
(multiplicative decrease)
• ssthresh = W/2
• W = 1
Alternative: Fall to W/2 and start
congestion avoidance directly
9
Why LIMD? (fairness)
• W=1
• 100 10 diff = 90
• 1 1 diff = 0
• Problem? – inefficient
• W=W/2
• 100 10 diff = 90
• 50 5 diff = 45
• 51 6 diff = 45
• 52 7 diff = 45
• ..
• 73 28 diff = 45
• 37.5 14 diff = 23.5
• ..
• 61.75 38.25 diff = 23.5
• 30.85 19.65 diff = 11.2
• ..
Anatomy of a TCP Connection’s Lifetime
ssthresh1
ssthresh2
C
cw=1
cwL
cwL/2
Window
Time
1 slow-start
2
congestion
avoidance
3
multiplicative
decrease
4 loss recovery
11
Flow Control
• Prevent sender from overwhelming the receiver
• Receiver in every ACK advertises the available buffer space at
its end
• Window calculation
• MIN(congestion control window, flow control window)
12
Sequencing
• Byte sequence numbers
• TCP receiver buffers out of
order segments and
reassembles them later
• Starting sequence number
randomly chosen
during connection
establishment
• Why?
3
1
2
3
4
3
3
4
1 given to app
2 given to app
Loss
4 buffered (not given to app)
3 & 4 given to app
4 discarded
13
TCP Segment Format
HL
16 bit SRC Port 16 bit DST Port
32 bit sequence number
32 bit ACK number
16 bit window size
resvd flags
16 bit urgent pointer
16 bit TCP checksum
Options (if any)
Data
Flags: URG, ACK,
PSH, RST, SYN,
FIN
14
TCP Flavors
• TCP-Tahoe
• W=1 adaptation on congestion
• TCP-Reno
• W=W/2 adaptation on fast retransmit, W=1 on timeout
• TCP-newReno
• TCP-Reno + intelligent fast recovery
• TCP-Vegas, TCP-SACK
15
TCP Tahoe
• Slow-start
• Congestion control upon time-out or DUP-ACKs
• When the sender receives 3 duplicate ACKs for the
same sequence number, sender infers a loss
• Congestion window reduced to 1 and slow-start
performed again
• Simple
• Congestion control too aggressive
16
TCP Reno
• Tahoe + Fast re-transmit
• Packet loss detected both through timeouts, and
through DUP-ACKs
• Sender reduces window by half, the ssthresh is
set to half of current window, and congestion
avoidance is performed (window increases only by
1 every round-trip time)
• Fast recovery ensures that pipe does not become
empty
• Window cut-down to 1 (and subsequent slow-
start) performed only on time-out
17
TCP New-Reno
• TCP-Reno with more intelligence during fast
recovery
• In TCP-Reno, the first partial ACK will bring the
sender out of the fast recovery phase
• Results in timeouts when there are multiple losses
• In TCP New-Reno, partial ACK is taken as an
indication of another lost packet (which is
immediately retransmitted).
• Sender comes out of fast recovery only after all
outstanding packets (at the time of first loss) are
ACKed
18
TCP SACK
• TCP (Tahoe, Reno, and New-Reno) uses
cumulative acknowledgements
• When there are multiple losses, TCP Reno and
New-Reno can retransmit only one lost packet per
round-trip time
• What about TCP-Tahoe?
• SACK enables receiver to give more information to
sender about received packets allowing sender to
recover from multiple-packet losses faster
19
TCP SACK (Example)
• Assume packets 5-25 are transmitted
• Let packets 5, 12, and 18 be lost
• Receiver sends back a CACK=5, and SACK=(6-11,13-17,19-
25)
• Sender knows that packets 5, 12, and 18 are lost and
retransmits them immediately
20
Other TCP flavors
• TCP Vegas
• Uses round-trip time as an early-congestion-feedback mechanism
• Reduces losses
• TCP FACK
• Intelligently uses TCP SACK information to optimize the fast recovery
mechanism further
21
User Datagram Protocol (UDP)
• Simpler cousin of TCP
• No reliability, sequencing, congestion control, flow
control, or connection management!
• Serves solely as a labeling mechanism for
demultiplexing at the receiver end
• Use predominantly by protocols that do no require
the strict service guarantees offered by TCP (e.g.
real-time multimedia protocols)
• Additional intelligence built at the application layer
if needed
22
UDP Header
Src Port Dst Port
Checksum
Length
Length: length of header
+ data (min = 8)
RFC 3481
• Appropriate window size (window scaling)
• Increased initial window (4MSS)
• Limited transmit (extend Fast Retx/Reco)
• SACK
• Explicit congestion notification
• Timestamp option
• Disabling header compression
Appropriate Window Size
• Many stacks use a default window size of 16KB
• Too small for many wireless environments where delay is large
• Use window-scaling
• Scale factor exchanged during start-up with SYN messages
• Scale factor a power of 2
Increased Initial Window Size
• TCP, by default, starts with a window size of 1
• This is problematic in two ways:
• Slow start slows down due to delayed ACK timer
• For thin connections, efficiency is compromised
• Set the initial congestion window to 4 (instead of 1 MSS)
Limited Transmit
• Fast retransmit and recovery kick in only after 3 DUPACKs
• What if there are fewer than 3 DUPACKs
• Limited transmit allows sender to transmit new packets even for the
first two DUPACKs
SACK
• Random wireless losses are typically recovered by link layer
retransmissions
• However, if link layer ARQ does not recover packets, random packet
losses can be exposed to the TCP sender
• SACK allows for faster loss recovery under such conditions
ECN
• ECN requires explicit congestion notification from routers
• Enables connection to avoid loss regime by preemptively reacting to
congestion
• Makes connection more efficient
Timestamp option
• TCP, by default, measures RTT sample only once per congestion
window
• Too coarse for a changing RTT scenario
• Timestamps allow for RTT to be measured in a fine-grained manner
• More reliable estimate of RTT
Header Compression
• TCP header fields can be compressed due to redundancy between
packets
• However, in a wireless network where packet losses are typical,
compression can backfire as the loss of an “anchor” packet will
render all subsequent packets useless
• Header compression should hence be turned OFF
31
Puzzle
• Prison with 31 prisoners on death row
• Warden tells the prisoners:
• I will isolate all of you into independent cells tonight
• Every morning from tomorrow, I will pick one of you randomly (say X)
and walk you to a switch room
• The switch room has 2 switches, both initially in the OFF position
• The prisoner X is given the option of manipulating the switches
• The prisoner may also choose to say “all prisoners have visited the
switch room”
• If the prisoner is correct, all prisoners will be let free, otherwise all of
them will be put to death
• What is the strategy that the prisoners should employ?

Mais conteúdo relacionado

Semelhante a 6610-l14.pptx

TCP protocol flow control
TCP protocol flow control TCP protocol flow control
TCP protocol flow control anuragjagetiya
 
Mobile Transpot Layer
Mobile Transpot LayerMobile Transpot Layer
Mobile Transpot LayerMaulik Patel
 
Lecture 19 22. transport protocol for ad-hoc
Lecture 19 22. transport protocol for ad-hoc Lecture 19 22. transport protocol for ad-hoc
Lecture 19 22. transport protocol for ad-hoc Chandra Meena
 
sliding window protocol for datalink layer.ppt
sliding window protocol for datalink layer.pptsliding window protocol for datalink layer.ppt
sliding window protocol for datalink layer.pptManimegalaM3
 
RIPE 80: Buffers and Protocols
RIPE 80: Buffers and ProtocolsRIPE 80: Buffers and Protocols
RIPE 80: Buffers and ProtocolsAPNIC
 
Designing TCP-Friendly Window-based Congestion Control
Designing TCP-Friendly Window-based Congestion ControlDesigning TCP-Friendly Window-based Congestion Control
Designing TCP-Friendly Window-based Congestion Controlsoohyunc
 
Congestion control in tcp
Congestion control in tcpCongestion control in tcp
Congestion control in tcpsamarai_apoc
 
features of tcp important for the web
features of tcp  important for the webfeatures of tcp  important for the web
features of tcp important for the webrinnocente
 
Computer networks unit iv
Computer networks    unit ivComputer networks    unit iv
Computer networks unit ivJAIGANESH SEKAR
 
Transport Layer In Computer Network
Transport Layer In Computer NetworkTransport Layer In Computer Network
Transport Layer In Computer NetworkDestro Destro
 
Features of tcp (part 2) .68
Features of tcp  (part 2) .68Features of tcp  (part 2) .68
Features of tcp (part 2) .68myrajendra
 
Denial of Service Mitigation Tactics in FreeBSD
Denial of Service Mitigation Tactics in FreeBSDDenial of Service Mitigation Tactics in FreeBSD
Denial of Service Mitigation Tactics in FreeBSDSteven Kreuzer
 
Computer Networks Module 2.pdf
Computer Networks Module 2.pdfComputer Networks Module 2.pdf
Computer Networks Module 2.pdfShanthalaKV
 

Semelhante a 6610-l14.pptx (20)

Mobile comn.pptx
Mobile comn.pptxMobile comn.pptx
Mobile comn.pptx
 
TCP protocol flow control
TCP protocol flow control TCP protocol flow control
TCP protocol flow control
 
Mobile Transpot Layer
Mobile Transpot LayerMobile Transpot Layer
Mobile Transpot Layer
 
Lecture 19 22. transport protocol for ad-hoc
Lecture 19 22. transport protocol for ad-hoc Lecture 19 22. transport protocol for ad-hoc
Lecture 19 22. transport protocol for ad-hoc
 
sliding window protocol for datalink layer.ppt
sliding window protocol for datalink layer.pptsliding window protocol for datalink layer.ppt
sliding window protocol for datalink layer.ppt
 
RIPE 80: Buffers and Protocols
RIPE 80: Buffers and ProtocolsRIPE 80: Buffers and Protocols
RIPE 80: Buffers and Protocols
 
Designing TCP-Friendly Window-based Congestion Control
Designing TCP-Friendly Window-based Congestion ControlDesigning TCP-Friendly Window-based Congestion Control
Designing TCP-Friendly Window-based Congestion Control
 
Congestion control in tcp
Congestion control in tcpCongestion control in tcp
Congestion control in tcp
 
features of tcp important for the web
features of tcp  important for the webfeatures of tcp  important for the web
features of tcp important for the web
 
Computer networks unit iv
Computer networks    unit ivComputer networks    unit iv
Computer networks unit iv
 
Transport Layer In Computer Network
Transport Layer In Computer NetworkTransport Layer In Computer Network
Transport Layer In Computer Network
 
Tcp(no ip) review part1
Tcp(no ip) review part1Tcp(no ip) review part1
Tcp(no ip) review part1
 
Tcp (1)
Tcp (1)Tcp (1)
Tcp (1)
 
Tcp
TcpTcp
Tcp
 
TCP_Congestion_Control.ppt
TCP_Congestion_Control.pptTCP_Congestion_Control.ppt
TCP_Congestion_Control.ppt
 
Tcp congestion avoidance
Tcp congestion avoidanceTcp congestion avoidance
Tcp congestion avoidance
 
Features of tcp (part 2) .68
Features of tcp  (part 2) .68Features of tcp  (part 2) .68
Features of tcp (part 2) .68
 
Denial of Service Mitigation Tactics in FreeBSD
Denial of Service Mitigation Tactics in FreeBSDDenial of Service Mitigation Tactics in FreeBSD
Denial of Service Mitigation Tactics in FreeBSD
 
Tcp
TcpTcp
Tcp
 
Computer Networks Module 2.pdf
Computer Networks Module 2.pdfComputer Networks Module 2.pdf
Computer Networks Module 2.pdf
 

Último

Call Girls Bhubaneswar Just Call 9907093804 Top Class Call Girl Service Avail...
Call Girls Bhubaneswar Just Call 9907093804 Top Class Call Girl Service Avail...Call Girls Bhubaneswar Just Call 9907093804 Top Class Call Girl Service Avail...
Call Girls Bhubaneswar Just Call 9907093804 Top Class Call Girl Service Avail...Dipal Arora
 
Premium Call Girls Cottonpet Whatsapp 7001035870 Independent Escort Service
Premium Call Girls Cottonpet Whatsapp 7001035870 Independent Escort ServicePremium Call Girls Cottonpet Whatsapp 7001035870 Independent Escort Service
Premium Call Girls Cottonpet Whatsapp 7001035870 Independent Escort Servicevidya singh
 
Call Girls Varanasi Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Varanasi Just Call 9907093804 Top Class Call Girl Service AvailableCall Girls Varanasi Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Varanasi Just Call 9907093804 Top Class Call Girl Service AvailableDipal Arora
 
Call Girls Jabalpur Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Jabalpur Just Call 9907093804 Top Class Call Girl Service AvailableCall Girls Jabalpur Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Jabalpur Just Call 9907093804 Top Class Call Girl Service AvailableDipal Arora
 
Top Rated Hyderabad Call Girls Erragadda ⟟ 6297143586 ⟟ Call Me For Genuine ...
Top Rated  Hyderabad Call Girls Erragadda ⟟ 6297143586 ⟟ Call Me For Genuine ...Top Rated  Hyderabad Call Girls Erragadda ⟟ 6297143586 ⟟ Call Me For Genuine ...
Top Rated Hyderabad Call Girls Erragadda ⟟ 6297143586 ⟟ Call Me For Genuine ...chandars293
 
VIP Call Girls Indore Kirti 💚😋 9256729539 🚀 Indore Escorts
VIP Call Girls Indore Kirti 💚😋  9256729539 🚀 Indore EscortsVIP Call Girls Indore Kirti 💚😋  9256729539 🚀 Indore Escorts
VIP Call Girls Indore Kirti 💚😋 9256729539 🚀 Indore Escortsaditipandeya
 
Call Girls Faridabad Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Faridabad Just Call 9907093804 Top Class Call Girl Service AvailableCall Girls Faridabad Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Faridabad Just Call 9907093804 Top Class Call Girl Service AvailableDipal Arora
 
Top Rated Bangalore Call Girls Richmond Circle ⟟ 9332606886 ⟟ Call Me For Ge...
Top Rated Bangalore Call Girls Richmond Circle ⟟  9332606886 ⟟ Call Me For Ge...Top Rated Bangalore Call Girls Richmond Circle ⟟  9332606886 ⟟ Call Me For Ge...
Top Rated Bangalore Call Girls Richmond Circle ⟟ 9332606886 ⟟ Call Me For Ge...narwatsonia7
 
Pondicherry Call Girls Book Now 9630942363 Top Class Pondicherry Escort Servi...
Pondicherry Call Girls Book Now 9630942363 Top Class Pondicherry Escort Servi...Pondicherry Call Girls Book Now 9630942363 Top Class Pondicherry Escort Servi...
Pondicherry Call Girls Book Now 9630942363 Top Class Pondicherry Escort Servi...Genuine Call Girls
 
Call Girls Ooty Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Ooty Just Call 9907093804 Top Class Call Girl Service AvailableCall Girls Ooty Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Ooty Just Call 9907093804 Top Class Call Girl Service AvailableDipal Arora
 
Top Rated Bangalore Call Girls Mg Road ⟟ 9332606886 ⟟ Call Me For Genuine S...
Top Rated Bangalore Call Girls Mg Road ⟟   9332606886 ⟟ Call Me For Genuine S...Top Rated Bangalore Call Girls Mg Road ⟟   9332606886 ⟟ Call Me For Genuine S...
Top Rated Bangalore Call Girls Mg Road ⟟ 9332606886 ⟟ Call Me For Genuine S...narwatsonia7
 
Call Girls Aurangabad Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Aurangabad Just Call 9907093804 Top Class Call Girl Service AvailableCall Girls Aurangabad Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Aurangabad Just Call 9907093804 Top Class Call Girl Service AvailableDipal Arora
 
Premium Bangalore Call Girls Jigani Dail 6378878445 Escort Service For Hot Ma...
Premium Bangalore Call Girls Jigani Dail 6378878445 Escort Service For Hot Ma...Premium Bangalore Call Girls Jigani Dail 6378878445 Escort Service For Hot Ma...
Premium Bangalore Call Girls Jigani Dail 6378878445 Escort Service For Hot Ma...tanya dube
 
(👑VVIP ISHAAN ) Russian Call Girls Service Navi Mumbai🖕9920874524🖕Independent...
(👑VVIP ISHAAN ) Russian Call Girls Service Navi Mumbai🖕9920874524🖕Independent...(👑VVIP ISHAAN ) Russian Call Girls Service Navi Mumbai🖕9920874524🖕Independent...
(👑VVIP ISHAAN ) Russian Call Girls Service Navi Mumbai🖕9920874524🖕Independent...Taniya Sharma
 
College Call Girls in Haridwar 9667172968 Short 4000 Night 10000 Best call gi...
College Call Girls in Haridwar 9667172968 Short 4000 Night 10000 Best call gi...College Call Girls in Haridwar 9667172968 Short 4000 Night 10000 Best call gi...
College Call Girls in Haridwar 9667172968 Short 4000 Night 10000 Best call gi...perfect solution
 
Manyata Tech Park ( Call Girls ) Bangalore ✔ 6297143586 ✔ Hot Model With Sexy...
Manyata Tech Park ( Call Girls ) Bangalore ✔ 6297143586 ✔ Hot Model With Sexy...Manyata Tech Park ( Call Girls ) Bangalore ✔ 6297143586 ✔ Hot Model With Sexy...
Manyata Tech Park ( Call Girls ) Bangalore ✔ 6297143586 ✔ Hot Model With Sexy...vidya singh
 
Call Girls Cuttack Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Cuttack Just Call 9907093804 Top Class Call Girl Service AvailableCall Girls Cuttack Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Cuttack Just Call 9907093804 Top Class Call Girl Service AvailableDipal Arora
 
Book Paid Powai Call Girls Mumbai 𖠋 9930245274 𖠋Low Budget Full Independent H...
Book Paid Powai Call Girls Mumbai 𖠋 9930245274 𖠋Low Budget Full Independent H...Book Paid Powai Call Girls Mumbai 𖠋 9930245274 𖠋Low Budget Full Independent H...
Book Paid Powai Call Girls Mumbai 𖠋 9930245274 𖠋Low Budget Full Independent H...Call Girls in Nagpur High Profile
 
Lucknow Call girls - 8800925952 - 24x7 service with hotel room
Lucknow Call girls - 8800925952 - 24x7 service with hotel roomLucknow Call girls - 8800925952 - 24x7 service with hotel room
Lucknow Call girls - 8800925952 - 24x7 service with hotel roomdiscovermytutordmt
 
Russian Escorts Girls Nehru Place ZINATHI 🔝9711199012 ☪ 24/7 Call Girls Delhi
Russian Escorts Girls  Nehru Place ZINATHI 🔝9711199012 ☪ 24/7 Call Girls DelhiRussian Escorts Girls  Nehru Place ZINATHI 🔝9711199012 ☪ 24/7 Call Girls Delhi
Russian Escorts Girls Nehru Place ZINATHI 🔝9711199012 ☪ 24/7 Call Girls DelhiAlinaDevecerski
 

Último (20)

Call Girls Bhubaneswar Just Call 9907093804 Top Class Call Girl Service Avail...
Call Girls Bhubaneswar Just Call 9907093804 Top Class Call Girl Service Avail...Call Girls Bhubaneswar Just Call 9907093804 Top Class Call Girl Service Avail...
Call Girls Bhubaneswar Just Call 9907093804 Top Class Call Girl Service Avail...
 
Premium Call Girls Cottonpet Whatsapp 7001035870 Independent Escort Service
Premium Call Girls Cottonpet Whatsapp 7001035870 Independent Escort ServicePremium Call Girls Cottonpet Whatsapp 7001035870 Independent Escort Service
Premium Call Girls Cottonpet Whatsapp 7001035870 Independent Escort Service
 
Call Girls Varanasi Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Varanasi Just Call 9907093804 Top Class Call Girl Service AvailableCall Girls Varanasi Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Varanasi Just Call 9907093804 Top Class Call Girl Service Available
 
Call Girls Jabalpur Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Jabalpur Just Call 9907093804 Top Class Call Girl Service AvailableCall Girls Jabalpur Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Jabalpur Just Call 9907093804 Top Class Call Girl Service Available
 
Top Rated Hyderabad Call Girls Erragadda ⟟ 6297143586 ⟟ Call Me For Genuine ...
Top Rated  Hyderabad Call Girls Erragadda ⟟ 6297143586 ⟟ Call Me For Genuine ...Top Rated  Hyderabad Call Girls Erragadda ⟟ 6297143586 ⟟ Call Me For Genuine ...
Top Rated Hyderabad Call Girls Erragadda ⟟ 6297143586 ⟟ Call Me For Genuine ...
 
VIP Call Girls Indore Kirti 💚😋 9256729539 🚀 Indore Escorts
VIP Call Girls Indore Kirti 💚😋  9256729539 🚀 Indore EscortsVIP Call Girls Indore Kirti 💚😋  9256729539 🚀 Indore Escorts
VIP Call Girls Indore Kirti 💚😋 9256729539 🚀 Indore Escorts
 
Call Girls Faridabad Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Faridabad Just Call 9907093804 Top Class Call Girl Service AvailableCall Girls Faridabad Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Faridabad Just Call 9907093804 Top Class Call Girl Service Available
 
Top Rated Bangalore Call Girls Richmond Circle ⟟ 9332606886 ⟟ Call Me For Ge...
Top Rated Bangalore Call Girls Richmond Circle ⟟  9332606886 ⟟ Call Me For Ge...Top Rated Bangalore Call Girls Richmond Circle ⟟  9332606886 ⟟ Call Me For Ge...
Top Rated Bangalore Call Girls Richmond Circle ⟟ 9332606886 ⟟ Call Me For Ge...
 
Pondicherry Call Girls Book Now 9630942363 Top Class Pondicherry Escort Servi...
Pondicherry Call Girls Book Now 9630942363 Top Class Pondicherry Escort Servi...Pondicherry Call Girls Book Now 9630942363 Top Class Pondicherry Escort Servi...
Pondicherry Call Girls Book Now 9630942363 Top Class Pondicherry Escort Servi...
 
Call Girls Ooty Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Ooty Just Call 9907093804 Top Class Call Girl Service AvailableCall Girls Ooty Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Ooty Just Call 9907093804 Top Class Call Girl Service Available
 
Top Rated Bangalore Call Girls Mg Road ⟟ 9332606886 ⟟ Call Me For Genuine S...
Top Rated Bangalore Call Girls Mg Road ⟟   9332606886 ⟟ Call Me For Genuine S...Top Rated Bangalore Call Girls Mg Road ⟟   9332606886 ⟟ Call Me For Genuine S...
Top Rated Bangalore Call Girls Mg Road ⟟ 9332606886 ⟟ Call Me For Genuine S...
 
Call Girls Aurangabad Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Aurangabad Just Call 9907093804 Top Class Call Girl Service AvailableCall Girls Aurangabad Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Aurangabad Just Call 9907093804 Top Class Call Girl Service Available
 
Premium Bangalore Call Girls Jigani Dail 6378878445 Escort Service For Hot Ma...
Premium Bangalore Call Girls Jigani Dail 6378878445 Escort Service For Hot Ma...Premium Bangalore Call Girls Jigani Dail 6378878445 Escort Service For Hot Ma...
Premium Bangalore Call Girls Jigani Dail 6378878445 Escort Service For Hot Ma...
 
(👑VVIP ISHAAN ) Russian Call Girls Service Navi Mumbai🖕9920874524🖕Independent...
(👑VVIP ISHAAN ) Russian Call Girls Service Navi Mumbai🖕9920874524🖕Independent...(👑VVIP ISHAAN ) Russian Call Girls Service Navi Mumbai🖕9920874524🖕Independent...
(👑VVIP ISHAAN ) Russian Call Girls Service Navi Mumbai🖕9920874524🖕Independent...
 
College Call Girls in Haridwar 9667172968 Short 4000 Night 10000 Best call gi...
College Call Girls in Haridwar 9667172968 Short 4000 Night 10000 Best call gi...College Call Girls in Haridwar 9667172968 Short 4000 Night 10000 Best call gi...
College Call Girls in Haridwar 9667172968 Short 4000 Night 10000 Best call gi...
 
Manyata Tech Park ( Call Girls ) Bangalore ✔ 6297143586 ✔ Hot Model With Sexy...
Manyata Tech Park ( Call Girls ) Bangalore ✔ 6297143586 ✔ Hot Model With Sexy...Manyata Tech Park ( Call Girls ) Bangalore ✔ 6297143586 ✔ Hot Model With Sexy...
Manyata Tech Park ( Call Girls ) Bangalore ✔ 6297143586 ✔ Hot Model With Sexy...
 
Call Girls Cuttack Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Cuttack Just Call 9907093804 Top Class Call Girl Service AvailableCall Girls Cuttack Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Cuttack Just Call 9907093804 Top Class Call Girl Service Available
 
Book Paid Powai Call Girls Mumbai 𖠋 9930245274 𖠋Low Budget Full Independent H...
Book Paid Powai Call Girls Mumbai 𖠋 9930245274 𖠋Low Budget Full Independent H...Book Paid Powai Call Girls Mumbai 𖠋 9930245274 𖠋Low Budget Full Independent H...
Book Paid Powai Call Girls Mumbai 𖠋 9930245274 𖠋Low Budget Full Independent H...
 
Lucknow Call girls - 8800925952 - 24x7 service with hotel room
Lucknow Call girls - 8800925952 - 24x7 service with hotel roomLucknow Call girls - 8800925952 - 24x7 service with hotel room
Lucknow Call girls - 8800925952 - 24x7 service with hotel room
 
Russian Escorts Girls Nehru Place ZINATHI 🔝9711199012 ☪ 24/7 Call Girls Delhi
Russian Escorts Girls  Nehru Place ZINATHI 🔝9711199012 ☪ 24/7 Call Girls DelhiRussian Escorts Girls  Nehru Place ZINATHI 🔝9711199012 ☪ 24/7 Call Girls Delhi
Russian Escorts Girls Nehru Place ZINATHI 🔝9711199012 ☪ 24/7 Call Girls Delhi
 

6610-l14.pptx

  • 1. TCP
  • 2. 2 TCP • Connection Establishment • Connection Maintenance • Reliability • Congestion control • Flow control • Sequencing • Connection Termination
  • 3. 3 Ports, End-points, & Connections • Thus, an end-point is represented by (IP address,Port) • Ports can be re-used between transport protocols • A connection is (SRC IP address, SRC port, DST IP address, DST port) • Same end-point can be used in multiple connections IP Layer TCP UDP http ftp email zoom IP address Protocol ID A1 A2 A3 Transport Port
  • 4. 4 Active and Passive Open • How do applications initiate a connection? • One end (server) registers with the TCP layer instructing it to “accept” connections at a certain port • The other end (client) initiates a “connect” request which is “accept”-ed by the server
  • 5. 5 Connection Establishment & Termination • 3-way handshake used for connection establishment • Randomly chosen sequence number is conveyed to the other end • Similar FIN, FIN+ACK exchange used for connection termination SYN SYN+ACK ACK DATA Server does passive open Accept connection request Send acceptance Start connection Active open Send connection request
  • 6. 6 Reliability (Loss Recovery) • Sequence Numbers • TCP uses cumulative Acknowledgments (ACKs) • Next expected in-sequence packet sequence number • Pros and cons? • Piggybacking ack data 5 1 2 3 4 3 4 3 1 2 3 4 3 3 4 Timeout calculation Rttavg = k*Rttavg + (1-k)*Rttsample RTO = Rttavg + 4*Rttdeviation
  • 7. 7 Fundamental Mechanism • Simple stop and go protocol • Timeout based reliability (loss recovery) data retx ack data ack data Sliding Window Protocol: 1 2 3 4 5 6 7 8 9 10 11 12 …. • Multiple unacknowledged packets!
  • 8. 8 Congestion Control • Slow Start • Start with W=1 • For every ACK, W=W+1 • Congestion Avoidance (linear increase) • For every ACK, • W = W+1/W • Congestion Control (multiplicative decrease) • ssthresh = W/2 • W = 1 Alternative: Fall to W/2 and start congestion avoidance directly
  • 9. 9 Why LIMD? (fairness) • W=1 • 100 10 diff = 90 • 1 1 diff = 0 • Problem? – inefficient • W=W/2 • 100 10 diff = 90 • 50 5 diff = 45 • 51 6 diff = 45 • 52 7 diff = 45 • .. • 73 28 diff = 45 • 37.5 14 diff = 23.5 • .. • 61.75 38.25 diff = 23.5 • 30.85 19.65 diff = 11.2 • ..
  • 10. Anatomy of a TCP Connection’s Lifetime ssthresh1 ssthresh2 C cw=1 cwL cwL/2 Window Time 1 slow-start 2 congestion avoidance 3 multiplicative decrease 4 loss recovery
  • 11. 11 Flow Control • Prevent sender from overwhelming the receiver • Receiver in every ACK advertises the available buffer space at its end • Window calculation • MIN(congestion control window, flow control window)
  • 12. 12 Sequencing • Byte sequence numbers • TCP receiver buffers out of order segments and reassembles them later • Starting sequence number randomly chosen during connection establishment • Why? 3 1 2 3 4 3 3 4 1 given to app 2 given to app Loss 4 buffered (not given to app) 3 & 4 given to app 4 discarded
  • 13. 13 TCP Segment Format HL 16 bit SRC Port 16 bit DST Port 32 bit sequence number 32 bit ACK number 16 bit window size resvd flags 16 bit urgent pointer 16 bit TCP checksum Options (if any) Data Flags: URG, ACK, PSH, RST, SYN, FIN
  • 14. 14 TCP Flavors • TCP-Tahoe • W=1 adaptation on congestion • TCP-Reno • W=W/2 adaptation on fast retransmit, W=1 on timeout • TCP-newReno • TCP-Reno + intelligent fast recovery • TCP-Vegas, TCP-SACK
  • 15. 15 TCP Tahoe • Slow-start • Congestion control upon time-out or DUP-ACKs • When the sender receives 3 duplicate ACKs for the same sequence number, sender infers a loss • Congestion window reduced to 1 and slow-start performed again • Simple • Congestion control too aggressive
  • 16. 16 TCP Reno • Tahoe + Fast re-transmit • Packet loss detected both through timeouts, and through DUP-ACKs • Sender reduces window by half, the ssthresh is set to half of current window, and congestion avoidance is performed (window increases only by 1 every round-trip time) • Fast recovery ensures that pipe does not become empty • Window cut-down to 1 (and subsequent slow- start) performed only on time-out
  • 17. 17 TCP New-Reno • TCP-Reno with more intelligence during fast recovery • In TCP-Reno, the first partial ACK will bring the sender out of the fast recovery phase • Results in timeouts when there are multiple losses • In TCP New-Reno, partial ACK is taken as an indication of another lost packet (which is immediately retransmitted). • Sender comes out of fast recovery only after all outstanding packets (at the time of first loss) are ACKed
  • 18. 18 TCP SACK • TCP (Tahoe, Reno, and New-Reno) uses cumulative acknowledgements • When there are multiple losses, TCP Reno and New-Reno can retransmit only one lost packet per round-trip time • What about TCP-Tahoe? • SACK enables receiver to give more information to sender about received packets allowing sender to recover from multiple-packet losses faster
  • 19. 19 TCP SACK (Example) • Assume packets 5-25 are transmitted • Let packets 5, 12, and 18 be lost • Receiver sends back a CACK=5, and SACK=(6-11,13-17,19- 25) • Sender knows that packets 5, 12, and 18 are lost and retransmits them immediately
  • 20. 20 Other TCP flavors • TCP Vegas • Uses round-trip time as an early-congestion-feedback mechanism • Reduces losses • TCP FACK • Intelligently uses TCP SACK information to optimize the fast recovery mechanism further
  • 21. 21 User Datagram Protocol (UDP) • Simpler cousin of TCP • No reliability, sequencing, congestion control, flow control, or connection management! • Serves solely as a labeling mechanism for demultiplexing at the receiver end • Use predominantly by protocols that do no require the strict service guarantees offered by TCP (e.g. real-time multimedia protocols) • Additional intelligence built at the application layer if needed
  • 22. 22 UDP Header Src Port Dst Port Checksum Length Length: length of header + data (min = 8)
  • 23. RFC 3481 • Appropriate window size (window scaling) • Increased initial window (4MSS) • Limited transmit (extend Fast Retx/Reco) • SACK • Explicit congestion notification • Timestamp option • Disabling header compression
  • 24. Appropriate Window Size • Many stacks use a default window size of 16KB • Too small for many wireless environments where delay is large • Use window-scaling • Scale factor exchanged during start-up with SYN messages • Scale factor a power of 2
  • 25. Increased Initial Window Size • TCP, by default, starts with a window size of 1 • This is problematic in two ways: • Slow start slows down due to delayed ACK timer • For thin connections, efficiency is compromised • Set the initial congestion window to 4 (instead of 1 MSS)
  • 26. Limited Transmit • Fast retransmit and recovery kick in only after 3 DUPACKs • What if there are fewer than 3 DUPACKs • Limited transmit allows sender to transmit new packets even for the first two DUPACKs
  • 27. SACK • Random wireless losses are typically recovered by link layer retransmissions • However, if link layer ARQ does not recover packets, random packet losses can be exposed to the TCP sender • SACK allows for faster loss recovery under such conditions
  • 28. ECN • ECN requires explicit congestion notification from routers • Enables connection to avoid loss regime by preemptively reacting to congestion • Makes connection more efficient
  • 29. Timestamp option • TCP, by default, measures RTT sample only once per congestion window • Too coarse for a changing RTT scenario • Timestamps allow for RTT to be measured in a fine-grained manner • More reliable estimate of RTT
  • 30. Header Compression • TCP header fields can be compressed due to redundancy between packets • However, in a wireless network where packet losses are typical, compression can backfire as the loss of an “anchor” packet will render all subsequent packets useless • Header compression should hence be turned OFF
  • 31. 31 Puzzle • Prison with 31 prisoners on death row • Warden tells the prisoners: • I will isolate all of you into independent cells tonight • Every morning from tomorrow, I will pick one of you randomly (say X) and walk you to a switch room • The switch room has 2 switches, both initially in the OFF position • The prisoner X is given the option of manipulating the switches • The prisoner may also choose to say “all prisoners have visited the switch room” • If the prisoner is correct, all prisoners will be let free, otherwise all of them will be put to death • What is the strategy that the prisoners should employ?