Computer Networking: �A Top Down Approach �6th edition �Jim Kurose, Keith Ross�Addison-Wesley�March 2012
Computer Communications �& Networks
CSNC-2413
Lec: 17
Chapter 3 outline
3.1 Transport-layer services
3.2 Multiplexing and � demultiplexing
3.3 Connectionless � transport: UDP
3.4 Principles of reliable data� transfer
3.5 Connection-oriented � transport: TCP
3.6 Principles of congestion� control
3.7 TCP congestion control
2
TCP reliable data transfer
3
TCP sender events
data rcvd from app:
TimeOutInterval
timeout:
Ack rcvd:
4
TCP: retransmission scenarios
Host A
Seq=92, 8 bytes data
ACK=100
loss
timeout
reTx due to lost ACK
Host B
X
Seq=92, 8 bytes data
ACK=100
time
SendBase
= 100
Host A
Seq=100, 20 bytes data
ACK=100
time
Seq 100 not reTx
Host B
Seq=92, 8 bytes data
ACK=120
Seq=92, 8 bytes data
Seq=92 timeout
ACK=120
Seq=92 timeout
SendBase
= 120
SendBase
= 120
Sendbase
= 100
5
TCP: retransmission scenarios
Host A
Seq=92, 8 bytes data
ACK=100
loss
timeout
cum ACK avoids reTx
Host B
X
Seq=100, 20 bytes data
ACK=120
time
SendBase
= 120
6
Double Timeout Interval
TCP ACK generation [RFC 1122, RFC 2581]
Event at Receiver
Arrival of in-order segment with
expected seq #; All data up to
expected seq # already ACKed
Arrival of in-order segment with
expected seq #; One other in �order segment has ACK pending
Arrival of out-of-order segment
Higher than expected seq#;
Gap detected
Arrival of segment that
partially or completely fills gap
TCP Receiver action
Delayed ACK; Wait up to 500ms
for next segment; If no next segment,
send ACK
Immediately send single Cum ACK,
ACKing both in-order segments
Immediately send Duplicate ACK,
indicating seq# of expected byte
Imm send ACK, provided segment
starts at lower end of gap
Ack the “largest in-order byte” seq #
8
TCP fast retransmit
if sender receives 3 ACKs for same data
(“triple duplicate ACKs”)
resend unACKed segment with smallest seq #
TCP fast retransmit
(Implicit NAK)
9
TCP fast retransmit
Fast retransmit �after sender receipt of �triple duplicate ACK
X
Host B
Host A
Seq=92, 8 bytes of data
ACK=100
timeout
ACK=100
ACK=100
ACK=100
Seq=100, 20 bytes of data
Seq=100, 20 bytes of data
10
Principles in practice
11
Principles in practice
12
Chapter 3 outline
3.1 Transport-layer services
3.2 Multiplexing and � demultiplexing
3.3 Connectionless � transport: UDP
3.4 Principles of reliable data� transfer
3.5 Connection-oriented � transport: TCP
3.6 Principles of congestion� control
3.7 TCP congestion control
13
TCP Flow control
sender won’t overflow
receiver’s buffer �by transmitting too much,
too fast
flow control
14
TCP Receive Window size
(assume TCP receiver discards out-of-order segments)
Spare room in buffer
= RcvWindow
= RcvBuffer - [LastByteRcvd - LastByteRead]
15
TCP Flow control
buffered data
free buffer space
rwnd
RcvBuffer
TCP segment payloads
to application process
Receiver-side buffering
16
LastByteSent-LastByteAcked ≤ rwnd