SlideShare a Scribd company logo
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?

More Related Content

Similar to 6610-l14.pptx

Mobile comn.pptx
Mobile comn.pptxMobile comn.pptx
Mobile comn.pptx
DAMANDEEPSINGH61
 
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 Layer
Maulik 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.ppt
ManimegalaM3
 
RIPE 80: Buffers and Protocols
RIPE 80: Buffers and ProtocolsRIPE 80: Buffers and Protocols
RIPE 80: Buffers and Protocols
APNIC
 
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
soohyunc
 
Congestion control in tcp
Congestion control in tcpCongestion control in tcp
Congestion control in tcp
samarai_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 web
rinnocente
 
Computer networks unit iv
Computer networks    unit ivComputer networks    unit iv
Computer networks unit iv
JAIGANESH SEKAR
 
Transport Layer In Computer Network
Transport Layer In Computer NetworkTransport Layer In Computer Network
Transport Layer In Computer Network
Destro Destro
 
Tcp(no ip) review part1
Tcp(no ip) review part1Tcp(no ip) review part1
Tcp(no ip) review part1
Diptanshu singh
 
Tcp (1)
Tcp (1)Tcp (1)
Tcp (1)
Abdo sayed
 
TCP_Congestion_Control.ppt
TCP_Congestion_Control.pptTCP_Congestion_Control.ppt
TCP_Congestion_Control.ppt
19UCSA032ASANJAYKUMA
 
Tcp congestion avoidance
Tcp congestion avoidanceTcp congestion avoidance
Tcp congestion avoidance
Ahmed Kamel Taha
 
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 FreeBSD
Steven Kreuzer
 
Computer Networks Module 2.pdf
Computer Networks Module 2.pdfComputer Networks Module 2.pdf
Computer Networks Module 2.pdf
ShanthalaKV
 

Similar to 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
 

Recently uploaded

heat stroke and heat exhaustion in children
heat stroke and heat exhaustion in childrenheat stroke and heat exhaustion in children
heat stroke and heat exhaustion in children
SumeraAhmad5
 
Charaka Samhita Sutra sthana Chapter 15 Upakalpaniyaadhyaya
Charaka Samhita Sutra sthana Chapter 15 UpakalpaniyaadhyayaCharaka Samhita Sutra sthana Chapter 15 Upakalpaniyaadhyaya
Charaka Samhita Sutra sthana Chapter 15 Upakalpaniyaadhyaya
Dr KHALID B.M
 
Prix Galien International 2024 Forum Program
Prix Galien International 2024 Forum ProgramPrix Galien International 2024 Forum Program
Prix Galien International 2024 Forum Program
Levi Shapiro
 
Couples presenting to the infertility clinic- Do they really have infertility...
Couples presenting to the infertility clinic- Do they really have infertility...Couples presenting to the infertility clinic- Do they really have infertility...
Couples presenting to the infertility clinic- Do they really have infertility...
Sujoy Dasgupta
 
New Directions in Targeted Therapeutic Approaches for Older Adults With Mantl...
New Directions in Targeted Therapeutic Approaches for Older Adults With Mantl...New Directions in Targeted Therapeutic Approaches for Older Adults With Mantl...
New Directions in Targeted Therapeutic Approaches for Older Adults With Mantl...
i3 Health
 
Physiology of Chemical Sensation of smell.pdf
Physiology of Chemical Sensation of smell.pdfPhysiology of Chemical Sensation of smell.pdf
Physiology of Chemical Sensation of smell.pdf
MedicoseAcademics
 
How STIs Influence the Development of Pelvic Inflammatory Disease.pptx
How STIs Influence the Development of Pelvic Inflammatory Disease.pptxHow STIs Influence the Development of Pelvic Inflammatory Disease.pptx
How STIs Influence the Development of Pelvic Inflammatory Disease.pptx
FFragrant
 
ANATOMY AND PHYSIOLOGY OF URINARY SYSTEM.pptx
ANATOMY AND PHYSIOLOGY OF URINARY SYSTEM.pptxANATOMY AND PHYSIOLOGY OF URINARY SYSTEM.pptx
ANATOMY AND PHYSIOLOGY OF URINARY SYSTEM.pptx
Swetaba Besh
 
24 Upakrama.pptx class ppt useful in all
24 Upakrama.pptx class ppt useful in all24 Upakrama.pptx class ppt useful in all
24 Upakrama.pptx class ppt useful in all
DrSathishMS1
 
Alcohol_Dr. Jeenal Mistry MD Pharmacology.pdf
Alcohol_Dr. Jeenal Mistry MD Pharmacology.pdfAlcohol_Dr. Jeenal Mistry MD Pharmacology.pdf
Alcohol_Dr. Jeenal Mistry MD Pharmacology.pdf
Dr Jeenal Mistry
 
ARTIFICIAL INTELLIGENCE IN HEALTHCARE.pdf
ARTIFICIAL INTELLIGENCE IN  HEALTHCARE.pdfARTIFICIAL INTELLIGENCE IN  HEALTHCARE.pdf
ARTIFICIAL INTELLIGENCE IN HEALTHCARE.pdf
Anujkumaranit
 
BRACHYTHERAPY OVERVIEW AND APPLICATORS
BRACHYTHERAPY OVERVIEW  AND  APPLICATORSBRACHYTHERAPY OVERVIEW  AND  APPLICATORS
BRACHYTHERAPY OVERVIEW AND APPLICATORS
Krishan Murari
 
263778731218 Abortion Clinic /Pills In Harare ,
263778731218 Abortion Clinic /Pills In Harare ,263778731218 Abortion Clinic /Pills In Harare ,
263778731218 Abortion Clinic /Pills In Harare ,
sisternakatoto
 
Evaluation of antidepressant activity of clitoris ternatea in animals
Evaluation of antidepressant activity of clitoris ternatea in animalsEvaluation of antidepressant activity of clitoris ternatea in animals
Evaluation of antidepressant activity of clitoris ternatea in animals
Shweta
 
Novas diretrizes da OMS para os cuidados perinatais de mais qualidade
Novas diretrizes da OMS para os cuidados perinatais de mais qualidadeNovas diretrizes da OMS para os cuidados perinatais de mais qualidade
Novas diretrizes da OMS para os cuidados perinatais de mais qualidade
Prof. Marcus Renato de Carvalho
 
Phone Us ❤85270-49040❤ #ℂall #gIRLS In Surat By Surat @ℂall @Girls Hotel With...
Phone Us ❤85270-49040❤ #ℂall #gIRLS In Surat By Surat @ℂall @Girls Hotel With...Phone Us ❤85270-49040❤ #ℂall #gIRLS In Surat By Surat @ℂall @Girls Hotel With...
Phone Us ❤85270-49040❤ #ℂall #gIRLS In Surat By Surat @ℂall @Girls Hotel With...
Savita Shen $i11
 
ACUTE SCROTUM.....pdf. ACUTE SCROTAL CONDITIOND
ACUTE SCROTUM.....pdf. ACUTE SCROTAL CONDITIONDACUTE SCROTUM.....pdf. ACUTE SCROTAL CONDITIOND
ACUTE SCROTUM.....pdf. ACUTE SCROTAL CONDITIOND
DR SETH JOTHAM
 
Non-respiratory Functions of the Lungs.pdf
Non-respiratory Functions of the Lungs.pdfNon-respiratory Functions of the Lungs.pdf
Non-respiratory Functions of the Lungs.pdf
MedicoseAcademics
 
KDIGO 2024 guidelines for diabetologists
KDIGO 2024 guidelines for diabetologistsKDIGO 2024 guidelines for diabetologists
KDIGO 2024 guidelines for diabetologists
د.محمود نجيب
 
ARTHROLOGY PPT NCISM SYLLABUS AYURVEDA STUDENTS
ARTHROLOGY PPT NCISM SYLLABUS AYURVEDA STUDENTSARTHROLOGY PPT NCISM SYLLABUS AYURVEDA STUDENTS
ARTHROLOGY PPT NCISM SYLLABUS AYURVEDA STUDENTS
Dr. Vinay Pareek
 

Recently uploaded (20)

heat stroke and heat exhaustion in children
heat stroke and heat exhaustion in childrenheat stroke and heat exhaustion in children
heat stroke and heat exhaustion in children
 
Charaka Samhita Sutra sthana Chapter 15 Upakalpaniyaadhyaya
Charaka Samhita Sutra sthana Chapter 15 UpakalpaniyaadhyayaCharaka Samhita Sutra sthana Chapter 15 Upakalpaniyaadhyaya
Charaka Samhita Sutra sthana Chapter 15 Upakalpaniyaadhyaya
 
Prix Galien International 2024 Forum Program
Prix Galien International 2024 Forum ProgramPrix Galien International 2024 Forum Program
Prix Galien International 2024 Forum Program
 
Couples presenting to the infertility clinic- Do they really have infertility...
Couples presenting to the infertility clinic- Do they really have infertility...Couples presenting to the infertility clinic- Do they really have infertility...
Couples presenting to the infertility clinic- Do they really have infertility...
 
New Directions in Targeted Therapeutic Approaches for Older Adults With Mantl...
New Directions in Targeted Therapeutic Approaches for Older Adults With Mantl...New Directions in Targeted Therapeutic Approaches for Older Adults With Mantl...
New Directions in Targeted Therapeutic Approaches for Older Adults With Mantl...
 
Physiology of Chemical Sensation of smell.pdf
Physiology of Chemical Sensation of smell.pdfPhysiology of Chemical Sensation of smell.pdf
Physiology of Chemical Sensation of smell.pdf
 
How STIs Influence the Development of Pelvic Inflammatory Disease.pptx
How STIs Influence the Development of Pelvic Inflammatory Disease.pptxHow STIs Influence the Development of Pelvic Inflammatory Disease.pptx
How STIs Influence the Development of Pelvic Inflammatory Disease.pptx
 
ANATOMY AND PHYSIOLOGY OF URINARY SYSTEM.pptx
ANATOMY AND PHYSIOLOGY OF URINARY SYSTEM.pptxANATOMY AND PHYSIOLOGY OF URINARY SYSTEM.pptx
ANATOMY AND PHYSIOLOGY OF URINARY SYSTEM.pptx
 
24 Upakrama.pptx class ppt useful in all
24 Upakrama.pptx class ppt useful in all24 Upakrama.pptx class ppt useful in all
24 Upakrama.pptx class ppt useful in all
 
Alcohol_Dr. Jeenal Mistry MD Pharmacology.pdf
Alcohol_Dr. Jeenal Mistry MD Pharmacology.pdfAlcohol_Dr. Jeenal Mistry MD Pharmacology.pdf
Alcohol_Dr. Jeenal Mistry MD Pharmacology.pdf
 
ARTIFICIAL INTELLIGENCE IN HEALTHCARE.pdf
ARTIFICIAL INTELLIGENCE IN  HEALTHCARE.pdfARTIFICIAL INTELLIGENCE IN  HEALTHCARE.pdf
ARTIFICIAL INTELLIGENCE IN HEALTHCARE.pdf
 
BRACHYTHERAPY OVERVIEW AND APPLICATORS
BRACHYTHERAPY OVERVIEW  AND  APPLICATORSBRACHYTHERAPY OVERVIEW  AND  APPLICATORS
BRACHYTHERAPY OVERVIEW AND APPLICATORS
 
263778731218 Abortion Clinic /Pills In Harare ,
263778731218 Abortion Clinic /Pills In Harare ,263778731218 Abortion Clinic /Pills In Harare ,
263778731218 Abortion Clinic /Pills In Harare ,
 
Evaluation of antidepressant activity of clitoris ternatea in animals
Evaluation of antidepressant activity of clitoris ternatea in animalsEvaluation of antidepressant activity of clitoris ternatea in animals
Evaluation of antidepressant activity of clitoris ternatea in animals
 
Novas diretrizes da OMS para os cuidados perinatais de mais qualidade
Novas diretrizes da OMS para os cuidados perinatais de mais qualidadeNovas diretrizes da OMS para os cuidados perinatais de mais qualidade
Novas diretrizes da OMS para os cuidados perinatais de mais qualidade
 
Phone Us ❤85270-49040❤ #ℂall #gIRLS In Surat By Surat @ℂall @Girls Hotel With...
Phone Us ❤85270-49040❤ #ℂall #gIRLS In Surat By Surat @ℂall @Girls Hotel With...Phone Us ❤85270-49040❤ #ℂall #gIRLS In Surat By Surat @ℂall @Girls Hotel With...
Phone Us ❤85270-49040❤ #ℂall #gIRLS In Surat By Surat @ℂall @Girls Hotel With...
 
ACUTE SCROTUM.....pdf. ACUTE SCROTAL CONDITIOND
ACUTE SCROTUM.....pdf. ACUTE SCROTAL CONDITIONDACUTE SCROTUM.....pdf. ACUTE SCROTAL CONDITIOND
ACUTE SCROTUM.....pdf. ACUTE SCROTAL CONDITIOND
 
Non-respiratory Functions of the Lungs.pdf
Non-respiratory Functions of the Lungs.pdfNon-respiratory Functions of the Lungs.pdf
Non-respiratory Functions of the Lungs.pdf
 
KDIGO 2024 guidelines for diabetologists
KDIGO 2024 guidelines for diabetologistsKDIGO 2024 guidelines for diabetologists
KDIGO 2024 guidelines for diabetologists
 
ARTHROLOGY PPT NCISM SYLLABUS AYURVEDA STUDENTS
ARTHROLOGY PPT NCISM SYLLABUS AYURVEDA STUDENTSARTHROLOGY PPT NCISM SYLLABUS AYURVEDA STUDENTS
ARTHROLOGY PPT NCISM SYLLABUS AYURVEDA STUDENTS
 

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?