Transport Protocols: Reading: Sections 2.5, 5.1, and 5.2
Transport Protocols: Reading: Sections 2.5, 5.1, and 5.2
Transport layer
Network layer
Transport Protocols
Provide logical communication
between application processes
running on different hosts
network
data link
physical
l
ca
network
data link
physical
en
den
d
tr
network
data link
physical
t
or
sp
an
network
data link
physical
gi
lo
application
transport
network
data link
physical
network
data link
physical
application
transport
network
data link
physical
32 bits
source port #
dest port #
application
data
(message)
TCP/UDP segment format
DST port
checksum
length
DATA
No connection state
No allocation of buffers, parameters, sequence #s, etc.
making it easier to handle many active clients at once
12.3.4.15
Stream-of-bytes service
Flow control
Congestion control
10
12
Checksum
Sequence numbers
Retransmission
TCP Segments
15
Byte 80
Byte 3
Byte 2
Byte 1
Byte 0
Host B
Byte 80
Byte 3
Byte 2
Byte 1
Byte 0
16
Byte 3
Byte 2
Byte 1
Byte 0
TCP Data
Host B
Byte 80
Byte 3
Byte 2
Byte 1
Byte 0
17
TCP Segment
IP Data
TCP Data (segment)
TCP Hdr
IP Hdr
IP packet
TCP packet
IP packet with a TCP header and data inside
TCP header is typically 20 bytes long
TCP segment
18
Sequence Numbers
Host A
ISN (initial sequence number)
Sequence
number = 1st
byte
Host B
TCP Data
TCP
HDR
TCP Data
ACK sequence
number = next
expected byte
TCP
HDR
19
Practical issue
20
21
SY N
CK
A
N
Y
S
ACK
B
Each host tells
its ISN to the
other host.
Data
Data
22
TCP Header
Source port
Destination port
Sequence number
Flags: SYN
FIN
RST
PSH
URG
ACK
Acknowledgment
HdrLen 0
Flags
Advertised window
Checksum
Urgent pointer
Options (variable)
Data
23
Bs port
Acknowledgment
20
Flags
Checksum
Advertised window
Urgent pointer
Options (variable)
24
As port
As ISN plus 1
20
Flags
Checksum
Advertised window
Urgent pointer
Options (variable)
25
Bs port
Sequence number
Flags: SYN
FIN
RST
PSH
URG
ACK
Bs ISN plus 1
20
Flags
Checksum
Advertised window
Urgent pointer
Options (variable)
26
TCP Retransmissions
29
Receiver sends
acknowledgment (ACK) when
it receives packet
Sender waits for ACK and
timeouts if it does not arrive
within some time period
Timeout
Sender
Receiver
Packe
t
ACK
Time
30
ACK
Packet lost
ACK
Packe
t
ACK
ACK lost
DUPLICATE
PACKET
Timeout
Packe
t
Timeout
Packe
t
Timeout
Packe
t
Timeout
Timeout
Timeout
Early timeout
DUPLICATE
PACKETS
31
33
Jacobson/Karels algorithm
See Section 5.2 of the Peterson/Davie book for details
35
36
Numerical example
37
Sliding Window
Allow a larger amount of data in flight
Allow sender to get ahead of the receiver
though not too far ahead
Sending process
TCP
Receiving process
TCP
38
Receiver Buffering
Window size
Data ACKd
Outstanding
Un-ackd data
Data OK
to send
Data not OK
to send yet
39
Destination port
Sequence number
Flags: SYN
FIN
RST
PSH
URG
ACK
Acknowledgment
HdrLen 0
Checksum
Urgent pointer
Options (variable)
Data
40
Fast Retransmission
41
Timeout is Inefficient
Timeout-based retransmission
42
Fast Retransmission
Better solution possible under sliding window
Although packet n might have been lost
packets n+1, n+2, and so on might get through
Fast retransmission
44
45
ACK
FI N
Data
ACK
FI N
CK
FI N A
ACK
CK
SY N A
SY N
time
47
Conclusions
Transport protocols
Next lecture
Congestion control
48