SlideShare a Scribd company logo
1 of 16
Chapter 3
Transport Layer

Computer Networking:
A Top Down Approach,

4th edition.
Jim Kurose, Keith Ross
Addison-Wesley, July
2007.
TCP: Overview RFCs: 793, 1122, 1323, 2018, 2581
 Connection Oriented

Handshake
Send segments to each other to establish
parameters of ensuing data transfer

 Runs on the end systems

 TCP connection is point to point (single sender

and receiver)

Does not support multicast (one sender many
receivers)

 TCP send buffer

TCP grab a chunk of data from this buffer
 MSS (Maximum Segment Size)


The maximum amount of data that can be
grabbed and placed in a segment

 TCP receive buffer
TCP Segment Structure
URG: urgent data

ACK?
PSH?
RST, SYN, FIN:
connection estab
(setup, teardown
commands)
Same as in UDP
To negotiate maximum
segment size etc.

source port #
dest port #
sequence number
acknowledgement number

head not
len used

UAP R S F Receive window
Urg data pointer
checksum

Options (variable length)
application
data
(variable length)

Used in
implementing
a reliable
data transfer
Used for
flow control
TCP Sequence Numbers and ACKs
Sequence Numbers:
 Sequence nos. are over the stream of transmitted
bytes and not over the series of transmitted
segments
 Sequence no. is the byte stream “number” of first
byte in segment‟s data
 Example:









Host A wants to send data to Host B
File consisting of 500,000 bytes, MSS is 1,000 bytes
First byte of stream is numbered zero
TCP constructs 500 segments out of data stream
First segment gets sequence number --- 0
Second segment gets sequence number----1000
Third segment gets sequence number------2000 and so on
TCP ACKs
Acknowledgement Numbers:


The acknowledgement no that hosts A puts in its segment is
the sequence no of the next byte host A is expecting from
host B.

 Example
 Host A receives all bytes numbered 0 through 535 from B
 Host A puts 536 in the acknowledgment number field of the
segment it sends to B
 TCP acknowledges bytes up to first missing bytes in the stream
 Cumulative Acknowledgement
 How receiver handles out-of-order segments?
 TCP RFCs do not impose any rules
Two choices
o The receiver discards out of order segments
o Keeps out of order bytes and waits for missing bytes to fill
TCP Sequence Numbers and ACKs
Example:
 Host A sends a
character to Host B,
which echoes it back to
Host A.
 Starting Sequence no
for client and server are
42 and 79.
Piggybacking:
 Acknowledgement of
client to server data is
carried by segment of
server to client data

Host A

Host B

User
types
„C‟

host ACKs
receipt
of echoed
„C‟

host ACKs
receipt of
„C‟, echoes
back „C‟
Piggybacked

time
TCP Reliable Data Transfer
 TCP creates reliable data transfer service on top of

IP‟s unreliable service
 TCP uses single retransmission timer, even if there
are multiple unacknowledged segments (RFC 2988)
 Uses cumulative acknowledgements
 Retransmissions are triggered by:



Timeout
Duplicate Acks ( will see shortly)

 Initially consider simplified TCP sender:
 Ignore Duplicate Acks
 Ignore Flow control
TCP Sender Events:
(1) Data Rcvd from
Application Layer
 Create segment with

(2) Timeout:
 Retransmit segment
 Restart timer

sequence number.
(3)Ack Received:
 Sequence number is bytestream number of first data  If acknowledges
previously unACked
byte in segment.
segments
 Start timer if not already
 Update what is known
running.
to be ACKed
 Start timer if there
are outstanding
segments
NextSeqNum = InitialSeqNum
SendBase = InitialSeqNum
loop (forever) {
switch(event)
event: data received from application above
create TCP segment with sequence number NextSeqNum
if (timer currently not running)
start timer
pass segment to IP
NextSeqNum = NextSeqNum + length(data)
event: timer timeout
retransmit not-yet-acknowledged segment with
smallest sequence number
start timer
event: ACK received, with ACK field value of y
if (y > SendBase) {
SendBase = y
if (there are currently not-yet-acknowledged segments)
start timer
}
} /* end of loop forever */

TCP
Sender
(Simplified)
TCP: Retransmission Scenarios
Host A

Host B

X

loss

Host B

Seq=92 timeout

timeout

Host A

Sendbase
= 100
SendBase
= 120

SendBase
= 100
time

Lost ACK Scenario

SendBase
= 120
time

Premature Timeout
TCP Retransmission Scenarios

timeout

Host A

Host B

X

loss

SendBase
= 120

time
Cumulative ACK scenario
TCP ACK Generation
Event at Receiver
Arrival of in-order segment with
expected seq #. All data up to
expected seq # already ACKed

[RFC 1122, RFC 2581]

TCP Receiver action
Delayed ACK. Wait up to 200ms
for next in order segment. If no next
segment, send ACK

Arrival of in-order segment with Immediately send single cumulative
ACK, ACKing both in-order segments
expected seq #. One other
Inorder segment has ACK pending
Arrival of out-of-order segment
higher-than-expect seq. # .
Gap detected

Immediately send duplicate ACK,
indicating seq. # of next expected byte
Fast Retransmit
 Time-out period often

relatively long:


long delay before
resending lost packet

 Detect lost segments

via duplicate ACKs.




Sender often sends
many segments back-toback
If segment is lost,
there will likely be many
duplicate ACKs.

 If sender receives 3

ACKs for the same
data, it supposes that
segment after ACKed
data was lost:


Fast Retransmit: resend
segment before timer
expires
Host A

Host B

timeout

X

time
Resending a Segment after Triple Duplicate ACK
Fast Retransmit Algorithm:
event: ACK received, with ACK field value of y
if (y > SendBase) {
SendBase = y
if (there are currently not-yet-acknowledged segments)
start timer
}
else {
increment count of duplicate ACKs received for y
if (count of duplicate ACKs received for y ==3) {
resend segment with sequence number y
}

Fast Retransmit
Go-Back N or Selective Repeat
 GBN Protocol
 TCP acknowledgements are cumulative and out of order
segments are not individually acked.
 Difference
 Buffering of correctly received packets
 GBN transmits all packets after the lost packet
TCP only the missing packet
 Selective Repeat
 Buffering of out of order packets
 TCP SACK (RFC 2018) allows to ACK out of order packets
selectively rather than cumulatively
 Difference
 Timer with every packet

Hybrid of Go-Back N and Selective Repeat

More Related Content

What's hot

Assignment cn tl
Assignment cn tlAssignment cn tl
Assignment cn tl
H K
 

What's hot (19)

Transport Layer [Autosaved]
Transport Layer [Autosaved]Transport Layer [Autosaved]
Transport Layer [Autosaved]
 
Comparative Analysis of Different TCP Variants in Mobile Ad-Hoc Network
Comparative Analysis of Different TCP Variants in Mobile Ad-Hoc Network Comparative Analysis of Different TCP Variants in Mobile Ad-Hoc Network
Comparative Analysis of Different TCP Variants in Mobile Ad-Hoc Network
 
Retransmission Tcp
Retransmission TcpRetransmission Tcp
Retransmission Tcp
 
Adaptation of tcp window
Adaptation of tcp windowAdaptation of tcp window
Adaptation of tcp window
 
Tcp3 wayhandshakeprocess
Tcp3 wayhandshakeprocessTcp3 wayhandshakeprocess
Tcp3 wayhandshakeprocess
 
Tcp congestion avoidance
Tcp congestion avoidanceTcp congestion avoidance
Tcp congestion avoidance
 
Tcp ip presentation
Tcp ip presentationTcp ip presentation
Tcp ip presentation
 
Eshcol tech solutions pvt ltd
Eshcol tech solutions pvt ltdEshcol tech solutions pvt ltd
Eshcol tech solutions pvt ltd
 
TCP Westwood
TCP WestwoodTCP Westwood
TCP Westwood
 
Analyzing network packets Using Wireshark
Analyzing network packets Using WiresharkAnalyzing network packets Using Wireshark
Analyzing network packets Using Wireshark
 
Connection Establishment & Flow and Congestion Control
Connection Establishment & Flow and Congestion ControlConnection Establishment & Flow and Congestion Control
Connection Establishment & Flow and Congestion Control
 
Pause frames an overview
Pause frames an overviewPause frames an overview
Pause frames an overview
 
Lect9
Lect9Lect9
Lect9
 
Congestion control in tcp
Congestion control in tcpCongestion control in tcp
Congestion control in tcp
 
Analysis of TCP variants
Analysis of TCP variantsAnalysis of TCP variants
Analysis of TCP variants
 
Tcp Congestion Avoidance
Tcp Congestion AvoidanceTcp Congestion Avoidance
Tcp Congestion Avoidance
 
Leaky bucket algorithm
Leaky bucket algorithmLeaky bucket algorithm
Leaky bucket algorithm
 
Assignment cn tl
Assignment cn tlAssignment cn tl
Assignment cn tl
 
Cubic
CubicCubic
Cubic
 

Similar to Week8 lec1-bscs1

Transmission control protocol ...............................
Transmission control protocol ...............................Transmission control protocol ...............................
Transmission control protocol ...............................
SwatiHans10
 
5-LEC- 5.pptxTransport Layer. Transport Layer Protocols
5-LEC- 5.pptxTransport Layer.  Transport Layer Protocols5-LEC- 5.pptxTransport Layer.  Transport Layer Protocols
5-LEC- 5.pptxTransport Layer. Transport Layer Protocols
ZahouAmel1
 

Similar to Week8 lec1-bscs1 (20)

Lecture 5
Lecture 5Lecture 5
Lecture 5
 
KandR_TCP (1).ppt notes for congestion control
KandR_TCP (1).ppt    notes for congestion controlKandR_TCP (1).ppt    notes for congestion control
KandR_TCP (1).ppt notes for congestion control
 
Transmission control protocol ...............................
Transmission control protocol ...............................Transmission control protocol ...............................
Transmission control protocol ...............................
 
Osi model
Osi modelOsi model
Osi model
 
13_TCP_Attack.pptx
13_TCP_Attack.pptx13_TCP_Attack.pptx
13_TCP_Attack.pptx
 
Mod4
Mod4Mod4
Mod4
 
Jaimin chp-6 - transport layer- 2011 batch
Jaimin   chp-6 - transport layer- 2011 batchJaimin   chp-6 - transport layer- 2011 batch
Jaimin chp-6 - transport layer- 2011 batch
 
Transport Layer
Transport LayerTransport Layer
Transport Layer
 
Part5-tcp-improvements.pptx
Part5-tcp-improvements.pptxPart5-tcp-improvements.pptx
Part5-tcp-improvements.pptx
 
Transport layer
Transport layerTransport layer
Transport layer
 
Transport layer
Transport layerTransport layer
Transport layer
 
Dcn (transmission control protocol) ppt
Dcn  (transmission control protocol) pptDcn  (transmission control protocol) ppt
Dcn (transmission control protocol) ppt
 
Mobile Transpot Layer
Mobile Transpot LayerMobile Transpot Layer
Mobile Transpot Layer
 
5-LEC- 5.pptxTransport Layer. Transport Layer Protocols
5-LEC- 5.pptxTransport Layer.  Transport Layer Protocols5-LEC- 5.pptxTransport Layer.  Transport Layer Protocols
5-LEC- 5.pptxTransport Layer. Transport Layer Protocols
 
Week4 lec1-bscs1
Week4 lec1-bscs1Week4 lec1-bscs1
Week4 lec1-bscs1
 
Tcp
TcpTcp
Tcp
 
transport protocols
transport protocolstransport protocols
transport protocols
 
12 tcp-dns
12 tcp-dns12 tcp-dns
12 tcp-dns
 
TCP/IP Basics
TCP/IP BasicsTCP/IP Basics
TCP/IP Basics
 
Transport_Layer_Protocols.pptx
Transport_Layer_Protocols.pptxTransport_Layer_Protocols.pptx
Transport_Layer_Protocols.pptx
 

More from syedhaiderraza (20)

Week16 lec1
Week16 lec1Week16 lec1
Week16 lec1
 
Week15 lec1
Week15 lec1Week15 lec1
Week15 lec1
 
Week14 lec2
Week14 lec2Week14 lec2
Week14 lec2
 
Week14 lec1
Week14 lec1Week14 lec1
Week14 lec1
 
Week13 lec2
Week13 lec2Week13 lec2
Week13 lec2
 
Week13 lec1
Week13 lec1Week13 lec1
Week13 lec1
 
Week11 lec2
Week11 lec2Week11 lec2
Week11 lec2
 
Week11 lec1
Week11 lec1Week11 lec1
Week11 lec1
 
Week10 lec1
Week10 lec1Week10 lec1
Week10 lec1
 
Week9 lec1
Week9 lec1Week9 lec1
Week9 lec1
 
Week8 lec2-bscs1
Week8 lec2-bscs1Week8 lec2-bscs1
Week8 lec2-bscs1
 
Week5 lec2-bscs1
Week5 lec2-bscs1Week5 lec2-bscs1
Week5 lec2-bscs1
 
Week5 lec1-bscs1
Week5 lec1-bscs1Week5 lec1-bscs1
Week5 lec1-bscs1
 
Week4 lec2-bscs1
Week4 lec2-bscs1Week4 lec2-bscs1
Week4 lec2-bscs1
 
Week3 lec3-bscs1
Week3 lec3-bscs1Week3 lec3-bscs1
Week3 lec3-bscs1
 
Week3 lec 2
Week3 lec 2Week3 lec 2
Week3 lec 2
 
Week3 lec 1
Week3 lec 1Week3 lec 1
Week3 lec 1
 
Week2 lec3-bscs1
Week2 lec3-bscs1Week2 lec3-bscs1
Week2 lec3-bscs1
 
Week2 lec2-bscs1
Week2 lec2-bscs1Week2 lec2-bscs1
Week2 lec2-bscs1
 
Week2 lec1-bscs1
Week2 lec1-bscs1Week2 lec1-bscs1
Week2 lec1-bscs1
 

Recently uploaded

Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
AnaAcapella
 

Recently uploaded (20)

Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 

Week8 lec1-bscs1

  • 1. Chapter 3 Transport Layer Computer Networking: A Top Down Approach, 4th edition. Jim Kurose, Keith Ross Addison-Wesley, July 2007.
  • 2. TCP: Overview RFCs: 793, 1122, 1323, 2018, 2581  Connection Oriented Handshake Send segments to each other to establish parameters of ensuing data transfer  Runs on the end systems  TCP connection is point to point (single sender and receiver) Does not support multicast (one sender many receivers)  TCP send buffer TCP grab a chunk of data from this buffer  MSS (Maximum Segment Size)  The maximum amount of data that can be grabbed and placed in a segment  TCP receive buffer
  • 3. TCP Segment Structure URG: urgent data ACK? PSH? RST, SYN, FIN: connection estab (setup, teardown commands) Same as in UDP To negotiate maximum segment size etc. source port # dest port # sequence number acknowledgement number head not len used UAP R S F Receive window Urg data pointer checksum Options (variable length) application data (variable length) Used in implementing a reliable data transfer Used for flow control
  • 4. TCP Sequence Numbers and ACKs Sequence Numbers:  Sequence nos. are over the stream of transmitted bytes and not over the series of transmitted segments  Sequence no. is the byte stream “number” of first byte in segment‟s data  Example:        Host A wants to send data to Host B File consisting of 500,000 bytes, MSS is 1,000 bytes First byte of stream is numbered zero TCP constructs 500 segments out of data stream First segment gets sequence number --- 0 Second segment gets sequence number----1000 Third segment gets sequence number------2000 and so on
  • 5. TCP ACKs Acknowledgement Numbers:  The acknowledgement no that hosts A puts in its segment is the sequence no of the next byte host A is expecting from host B.  Example  Host A receives all bytes numbered 0 through 535 from B  Host A puts 536 in the acknowledgment number field of the segment it sends to B  TCP acknowledges bytes up to first missing bytes in the stream  Cumulative Acknowledgement  How receiver handles out-of-order segments?  TCP RFCs do not impose any rules Two choices o The receiver discards out of order segments o Keeps out of order bytes and waits for missing bytes to fill
  • 6. TCP Sequence Numbers and ACKs Example:  Host A sends a character to Host B, which echoes it back to Host A.  Starting Sequence no for client and server are 42 and 79. Piggybacking:  Acknowledgement of client to server data is carried by segment of server to client data Host A Host B User types „C‟ host ACKs receipt of echoed „C‟ host ACKs receipt of „C‟, echoes back „C‟ Piggybacked time
  • 7. TCP Reliable Data Transfer  TCP creates reliable data transfer service on top of IP‟s unreliable service  TCP uses single retransmission timer, even if there are multiple unacknowledged segments (RFC 2988)  Uses cumulative acknowledgements  Retransmissions are triggered by:   Timeout Duplicate Acks ( will see shortly)  Initially consider simplified TCP sender:  Ignore Duplicate Acks  Ignore Flow control
  • 8. TCP Sender Events: (1) Data Rcvd from Application Layer  Create segment with (2) Timeout:  Retransmit segment  Restart timer sequence number. (3)Ack Received:  Sequence number is bytestream number of first data  If acknowledges previously unACked byte in segment. segments  Start timer if not already  Update what is known running. to be ACKed  Start timer if there are outstanding segments
  • 9. NextSeqNum = InitialSeqNum SendBase = InitialSeqNum loop (forever) { switch(event) event: data received from application above create TCP segment with sequence number NextSeqNum if (timer currently not running) start timer pass segment to IP NextSeqNum = NextSeqNum + length(data) event: timer timeout retransmit not-yet-acknowledged segment with smallest sequence number start timer event: ACK received, with ACK field value of y if (y > SendBase) { SendBase = y if (there are currently not-yet-acknowledged segments) start timer } } /* end of loop forever */ TCP Sender (Simplified)
  • 10. TCP: Retransmission Scenarios Host A Host B X loss Host B Seq=92 timeout timeout Host A Sendbase = 100 SendBase = 120 SendBase = 100 time Lost ACK Scenario SendBase = 120 time Premature Timeout
  • 11. TCP Retransmission Scenarios timeout Host A Host B X loss SendBase = 120 time Cumulative ACK scenario
  • 12. TCP ACK Generation Event at Receiver Arrival of in-order segment with expected seq #. All data up to expected seq # already ACKed [RFC 1122, RFC 2581] TCP Receiver action Delayed ACK. Wait up to 200ms for next in order segment. If no next segment, send ACK Arrival of in-order segment with Immediately send single cumulative ACK, ACKing both in-order segments expected seq #. One other Inorder segment has ACK pending Arrival of out-of-order segment higher-than-expect seq. # . Gap detected Immediately send duplicate ACK, indicating seq. # of next expected byte
  • 13. Fast Retransmit  Time-out period often relatively long:  long delay before resending lost packet  Detect lost segments via duplicate ACKs.   Sender often sends many segments back-toback If segment is lost, there will likely be many duplicate ACKs.  If sender receives 3 ACKs for the same data, it supposes that segment after ACKed data was lost:  Fast Retransmit: resend segment before timer expires
  • 14. Host A Host B timeout X time Resending a Segment after Triple Duplicate ACK
  • 15. Fast Retransmit Algorithm: event: ACK received, with ACK field value of y if (y > SendBase) { SendBase = y if (there are currently not-yet-acknowledged segments) start timer } else { increment count of duplicate ACKs received for y if (count of duplicate ACKs received for y ==3) { resend segment with sequence number y } Fast Retransmit
  • 16. Go-Back N or Selective Repeat  GBN Protocol  TCP acknowledgements are cumulative and out of order segments are not individually acked.  Difference  Buffering of correctly received packets  GBN transmits all packets after the lost packet TCP only the missing packet  Selective Repeat  Buffering of out of order packets  TCP SACK (RFC 2018) allows to ACK out of order packets selectively rather than cumulatively  Difference  Timer with every packet Hybrid of Go-Back N and Selective Repeat