The Transport Layer
The Transport Layer
Chapter 6
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Transport Service
Transport Service
• Upper Layer Services
• Transport Service Primitives
• Transport Service Primitives
• Berkeley Sockets
• Example of Socket Programming:
Internet File Server
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Services Provided to the Upper Layers
Th t k t t d li ti l
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
The network, transport, and application layers
Transport Service Primitives (1)
Th i iti f i l t t i
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
The primitives for a simple transport service
Transport Service Primitives (2)
N ti f TPDU k t d f
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Nesting of TPDUs, packets, and frames.
Berkeley Sockets (1)
A state diagram for a simple connection management scheme.
Transitions labeled in italics are caused by packet arrivals. The
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
y
solid lines show the client’s state sequence. The dashed lines
show the server’s state sequence.
Berkeley Sockets (2)
Th k t i iti f TCP
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
The socket primitives for TCP
Example of Socket Programming:
An Internet File Server (1)
An Internet File Server (1)
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
. . . Client code using sockets
Example of Socket Programming:
An Internet File Server (2)
An Internet File Server (2)
. . .
. . .
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Client code using sockets
Example of Socket Programming:
An Internet File Server (3)
An Internet File Server (3)
. . .
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Client code using sockets
Example of Socket Programming:
An Internet File Server (4)
An Internet File Server (4)
. . .
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Server code
Example of Socket Programming:
An Internet File Server (5)
An Internet File Server (5)
. . .
. . .
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Server code
Example of Socket Programming:
An Internet File Server (6)
An Internet File Server (6)
. . .
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Server code
Elements of Transport Protocols (1)
Elements of Transport Protocols (1)
• Addressing
• Connection establishment
• Connection establishment
• Connection release
• Error control and flow control
• Multiplexing
p g
• Crash recovery
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Elements of Transport Protocols (2)
(a) Environment of the data link layer.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
(b) Environment of the transport layer.
Addressing (1)
TSAP NSAP d t t ti
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
TSAPs, NSAPs, and transport connections
Addressing (2)
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
How a user process in host 1 establishes a connection
with a mail server in host 2 via a process server.
Connection Establishment (1)
Connection Establishment (1)
Techniques for restricting packet lifetime
• Restricted network design.
g
• Putting a hop counter in each packet.
• Timestamping each packet
• Timestamping each packet.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Connection Establishment (2)
(a) TPDUs may not enter the forbidden region.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
(a) TPDUs may not enter the forbidden region.
(b) The resynchronization problem.
Connection Establishment (3)
Three protocol scenarios for establishing a connection using a
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
three-way handshake. CR denotes CONNECTION REQUEST.
Normal operation.
Connection Establishment (4)
Three protocol scenarios for establishing a connection using a
three-way handshake. CR denotes CONNECTION REQUEST. Old
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
duplicate CONNECTION REQUEST appearing out of nowhere.
Connection Establishment (5)
Three protocol scenarios for establishing a connection using a
three-way handshake CR denotes CONNECTION REQUEST
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
three-way handshake. CR denotes CONNECTION REQUEST.
Duplicate CONNECTION REQUEST and duplicate ACK
Connection Release (1)
Ab t di ti ith l f d t
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Abrupt disconnection with loss of data
Connection Release (2)
Th t bl
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
The two-army problem
Connection Release (3)
F t l i f l i ti
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Four protocol scenarios for releasing a connection.
(a) Normal case of three-way handshake
Connection Release (4)
F t l i f l i ti
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Four protocol scenarios for releasing a connection.
(b) Final ACK lost.
Connection Release (5)
F t l i f l i ti
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Four protocol scenarios for releasing a connection.
(c) Response lost
Connection Release (6)
F t l i f l i ti
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Four protocol scenarios for releasing a connection.
(d) Response lost and subsequent DRs lost.
Error Control and Flow Control (1)
( ) Ch i d fi d i b ff (b) Ch i d i bl i d
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
(a) Chained fixed-size buffers. (b) Chained variable-sized
buffers. (c) One large circular buffer per connection.
Error Control and Flow Control (2)
D i b ff ll ti Th h th di ti f
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Dynamic buffer allocation. The arrows show the direction of
transmission. An ellipsis (...) indicates a lost TPDU
Multiplexing
( ) M lti l i (b) I lti l i
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
(a) Multiplexing. (b) Inverse multiplexing.
Crash Recovery
Diff t bi ti f li t d t t
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Different combinations of client and server strategy
C ti C t l
Congestion Control
• Desirable bandwidth allocation
• Regulating the sending rate
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Desirable Bandwidth Allocation (1)
( ) G d t d (b) d l f ti f ff d l d
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
(a) Goodput and (b) delay as a function of offered load
Desirable Bandwidth Allocation (2)
M i b d idth ll ti f f fl
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Max-min bandwidth allocation for four flows
Desirable Bandwidth Allocation (3)
Ch i b d idth ll ti ti
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Changing bandwidth allocation over time
Regulating the Sending Rate (1)
A f t t k f di l it i
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
A fast network feeding a low-capacity receiver
Regulating the Sending Rate (2)
A l t k f di hi h it i
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
A slow network feeding a high-capacity receiver
Regulating the Sending Rate (3)
S ti t l t l
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Some congestion control protocols
Regulating the Sending Rate (4)
ocation
User
2’s
allo
User 1’s allocation
U
Additi I M lti li ti D (AIMD) t l l
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Additive Increase Multiplicative Decrease (AIMD) control law.
The Internet Transport Protocols: UDP
The Internet Transport Protocols: UDP
• Introduction to UDP
• Remote Procedure Call
• Real-Time Transport
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Introduction to UDP (1)
Th UDP h d
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
The UDP header.
Introduction to UDP (2)
Th IP 4 d h d i l d d i th UDP h k
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
The IPv4 pseudoheader included in the UDP checksum.
Remote Procedure Call
St i ki t d ll Th t b h d d
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Steps in making a remote procedure call. The stubs are shaded.
Real-Time Transport (1)
( ) Th iti f RTP i th t l t k (b) P k t ti
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
(a) The position of RTP in the protocol stack. (b) Packet nesting.
Real-Time Transport (2)
Th RTP h d
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
The RTP header
Real-Time Transport (3)
S thi th t t t b b ff i k t
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Smoothing the output stream by buffering packets
Real-Time Transport (3)
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
High jitter
Real-Time Transport (4)
L jitt
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Low jitter
The Internet Transport Protocols: TCP (1)
The Internet Transport Protocols: TCP (1)
• Introduction to TCP
Introduction to TCP
• The TCP service model
Th TCP t l
• The TCP protocol
• The TCP segment header
• TCP connection establishment
• TCP connection release
TCP connection release
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
The Internet Transport Protocols: TCP (2)
The Internet Transport Protocols: TCP (2)
• TCP connection management modeling
TCP connection management modeling
• TCP sliding window
TCP ti t
• TCP timer management
• TCP congestion control
• TCP futures
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
The TCP Service Model (1)
S i d t
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Some assigned ports
The TCP Service Model (2)
(a) Four 512-byte segments sent as separate IP diagrams
(b) Th 2048 b f d d li d h li i i
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
(b) The 2048 bytes of data delivered to the application in a
single READ call
The TCP Segment Header
Th TCP h d
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
The TCP header.
TCP Connection Establishment
( ) TCP ti t bli h t i th l
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
(a) TCP connection establishment in the normal case.
(b) Simultaneous connection establishment on both sides.
TCP Connection Management Modeling (1)
Th t t d i th TCP ti
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
The states used in the TCP connection
management finite state machine.
TCP Connection Management Modeling (2)
TCP connection management
finite state machine.
The heavy solid line is the
normal path for a client. The
heavy dashed line is the
heavy dashed line is the
normal path for a server. The
light lines are unusual events.
Each transition is labeled by
y
the event causing it and the
action resulting from it,
separated by a slash.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
TCP Sliding Window (1)
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Window management in TCP
TCP Sliding Window (2)
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Silly window syndrome
TCP Timer Management
( ) P b bilit d it f k l d t i l ti i d t
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
(a) Probability density of acknowledgment arrival times in data
link layer. (b) … for TCP
TCP Congestion Control (1)
Sl t t f i iti l ti i d f 1 t
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Slow start from an initial congestion window of 1 segment
TCP Congestion Control (2)
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Additive increase from an initial congestion
window of 1 segment.
TCP Congestion Control (3)
Sl t t f ll d b dditi i i TCP T h
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Slow start followed by additive increase in TCP Tahoe.
TCP Congestion Control (4)
F t d th t th tt f TCP R
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Fast recovery and the sawtooth pattern of TCP Reno.
Performance Issues
Performance Issues
• Performance problems in computer networks
• Network performance measurement
Network performance measurement
• System design for better performance
F t TPDU i
• Fast TPDU processing
• Protocols for high-speed networks
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Performance Problems in Computer
Networks
Networks
The state of transmitting one megabit from San Diego to Boston.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
(a) At t = 0. (b) After 500 μ sec.
(c) After 20 msec. (d) After 40 msec.
Network Performance Measurement (1)
Network Performance Measurement (1)
Steps to performance improvement
1 Measure relevant network parameters
1. Measure relevant network parameters,
performance.
2 T t d t d h t i i
2. Try to understand what is going on.
3. Change one parameter.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Network Performance Measurement (2)
Network Performance Measurement (2)
Issues in measuring performance
• Sufficient sample size
• Representative samples
• Representative samples
• Clock accuracy
M i i l i l d
• Measuring typical representative load
• Beware of caching
• Understand what you are measuring
• Extrapolate with care
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Extrapolate with care
Network Performance Measurement (3)
R f ti f l d
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Response as a function of load.
System Design for Better Performance (1)
System Design for Better Performance (1)
Rules of thumb
Rules of thumb
1. CPU speed more important than network speed
2 Reduce packet count to reduce software overhead
2. Reduce packet count to reduce software overhead
3. Minimize data touching
4 Minimize context switches
4. Minimize context switches
5. Minimize copying
6 You can buy more bandwidth but not lower delay
6. You can buy more bandwidth but not lower delay
7. Avoiding congestion is better than recovering from it
8 Avoid timeouts
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
8. Avoid timeouts
System Design for Better Performance (2)
F t t it h t h dl k t
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Four context switches to handle one packet
with a user-space network manager.
Fast TPDU Processing (1)
Th f t th f d t i i h ith h
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
The fast path from sender to receiver is shown with a heavy
line. The processing steps on this path are shaded.
Fast TPDU Processing (2)
( ) TCP h d (b) IP h d I b th th h d d fi ld
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
(a) TCP header. (b) IP header. In both cases, the shaded fields
are taken from the prototype without change.
Protocols for High-Speed Networks (1)
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
A timing wheel
Protocols for High-Speed Networks (2)
Ti t t f d k l d
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Time to transfer and acknowledge a
1-megabit file over a 4000-km line
Delay Tolerant Networking
Delay Tolerant Networking
• DTN Architecture
• The Bundle Protocol
• The Bundle Protocol
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
DTN Architecture (1)
D l t l t t ki hit t
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Delay-tolerant networking architecture
DTN Architecture (2)
U f DTN i
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Use of a DTN in space.
The Bundle Protocol (1)
D l t l t t ki t l t k
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Delay-tolerant networking protocol stack.
The Bundle Protocol (2)
B dl t l f t
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Bundle protocol message format.
End
End
Chapter 6
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

Chapter6-TransportLayer Transport Service • Upper Layer Services • Transport Service Primitives • Berkeley Sockets • Example of Socket Programming: Internet File Server

  • 1.
    The Transport Layer TheTransport Layer Chapter 6 Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
  • 2.
    Transport Service Transport Service •Upper Layer Services • Transport Service Primitives • Transport Service Primitives • Berkeley Sockets • Example of Socket Programming: Internet File Server Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
  • 3.
    Services Provided tothe Upper Layers Th t k t t d li ti l Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011 The network, transport, and application layers
  • 4.
    Transport Service Primitives(1) Th i iti f i l t t i Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011 The primitives for a simple transport service
  • 5.
    Transport Service Primitives(2) N ti f TPDU k t d f Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011 Nesting of TPDUs, packets, and frames.
  • 6.
    Berkeley Sockets (1) Astate diagram for a simple connection management scheme. Transitions labeled in italics are caused by packet arrivals. The Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011 y solid lines show the client’s state sequence. The dashed lines show the server’s state sequence.
  • 7.
    Berkeley Sockets (2) Thk t i iti f TCP Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011 The socket primitives for TCP
  • 8.
    Example of SocketProgramming: An Internet File Server (1) An Internet File Server (1) Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011 . . . Client code using sockets
  • 9.
    Example of SocketProgramming: An Internet File Server (2) An Internet File Server (2) . . . . . . Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011 Client code using sockets
  • 10.
    Example of SocketProgramming: An Internet File Server (3) An Internet File Server (3) . . . Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011 Client code using sockets
  • 11.
    Example of SocketProgramming: An Internet File Server (4) An Internet File Server (4) . . . Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011 Server code
  • 12.
    Example of SocketProgramming: An Internet File Server (5) An Internet File Server (5) . . . . . . Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011 Server code
  • 13.
    Example of SocketProgramming: An Internet File Server (6) An Internet File Server (6) . . . Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011 Server code
  • 14.
    Elements of TransportProtocols (1) Elements of Transport Protocols (1) • Addressing • Connection establishment • Connection establishment • Connection release • Error control and flow control • Multiplexing p g • Crash recovery Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
  • 15.
    Elements of TransportProtocols (2) (a) Environment of the data link layer. Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011 (b) Environment of the transport layer.
  • 16.
    Addressing (1) TSAP NSAPd t t ti Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011 TSAPs, NSAPs, and transport connections
  • 17.
    Addressing (2) Computer Networks,Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011 How a user process in host 1 establishes a connection with a mail server in host 2 via a process server.
  • 18.
    Connection Establishment (1) ConnectionEstablishment (1) Techniques for restricting packet lifetime • Restricted network design. g • Putting a hop counter in each packet. • Timestamping each packet • Timestamping each packet. Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
  • 19.
    Connection Establishment (2) (a)TPDUs may not enter the forbidden region. Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011 (a) TPDUs may not enter the forbidden region. (b) The resynchronization problem.
  • 20.
    Connection Establishment (3) Threeprotocol scenarios for establishing a connection using a Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011 three-way handshake. CR denotes CONNECTION REQUEST. Normal operation.
  • 21.
    Connection Establishment (4) Threeprotocol scenarios for establishing a connection using a three-way handshake. CR denotes CONNECTION REQUEST. Old Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011 duplicate CONNECTION REQUEST appearing out of nowhere.
  • 22.
    Connection Establishment (5) Threeprotocol scenarios for establishing a connection using a three-way handshake CR denotes CONNECTION REQUEST Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011 three-way handshake. CR denotes CONNECTION REQUEST. Duplicate CONNECTION REQUEST and duplicate ACK
  • 23.
    Connection Release (1) Abt di ti ith l f d t Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011 Abrupt disconnection with loss of data
  • 24.
    Connection Release (2) Tht bl Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011 The two-army problem
  • 25.
    Connection Release (3) Ft l i f l i ti Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011 Four protocol scenarios for releasing a connection. (a) Normal case of three-way handshake
  • 26.
    Connection Release (4) Ft l i f l i ti Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011 Four protocol scenarios for releasing a connection. (b) Final ACK lost.
  • 27.
    Connection Release (5) Ft l i f l i ti Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011 Four protocol scenarios for releasing a connection. (c) Response lost
  • 28.
    Connection Release (6) Ft l i f l i ti Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011 Four protocol scenarios for releasing a connection. (d) Response lost and subsequent DRs lost.
  • 29.
    Error Control andFlow Control (1) ( ) Ch i d fi d i b ff (b) Ch i d i bl i d Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011 (a) Chained fixed-size buffers. (b) Chained variable-sized buffers. (c) One large circular buffer per connection.
  • 30.
    Error Control andFlow Control (2) D i b ff ll ti Th h th di ti f Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011 Dynamic buffer allocation. The arrows show the direction of transmission. An ellipsis (...) indicates a lost TPDU
  • 31.
    Multiplexing ( ) Mlti l i (b) I lti l i Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011 (a) Multiplexing. (b) Inverse multiplexing.
  • 32.
    Crash Recovery Diff tbi ti f li t d t t Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011 Different combinations of client and server strategy
  • 33.
    C ti Ct l Congestion Control • Desirable bandwidth allocation • Regulating the sending rate Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
  • 34.
    Desirable Bandwidth Allocation(1) ( ) G d t d (b) d l f ti f ff d l d Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011 (a) Goodput and (b) delay as a function of offered load
  • 35.
    Desirable Bandwidth Allocation(2) M i b d idth ll ti f f fl Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011 Max-min bandwidth allocation for four flows
  • 36.
    Desirable Bandwidth Allocation(3) Ch i b d idth ll ti ti Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011 Changing bandwidth allocation over time
  • 37.
    Regulating the SendingRate (1) A f t t k f di l it i Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011 A fast network feeding a low-capacity receiver
  • 38.
    Regulating the SendingRate (2) A l t k f di hi h it i Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011 A slow network feeding a high-capacity receiver
  • 39.
    Regulating the SendingRate (3) S ti t l t l Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011 Some congestion control protocols
  • 40.
    Regulating the SendingRate (4) ocation User 2’s allo User 1’s allocation U Additi I M lti li ti D (AIMD) t l l Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011 Additive Increase Multiplicative Decrease (AIMD) control law.
  • 41.
    The Internet TransportProtocols: UDP The Internet Transport Protocols: UDP • Introduction to UDP • Remote Procedure Call • Real-Time Transport Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
  • 42.
    Introduction to UDP(1) Th UDP h d Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011 The UDP header.
  • 43.
    Introduction to UDP(2) Th IP 4 d h d i l d d i th UDP h k Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011 The IPv4 pseudoheader included in the UDP checksum.
  • 44.
    Remote Procedure Call Sti ki t d ll Th t b h d d Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011 Steps in making a remote procedure call. The stubs are shaded.
  • 45.
    Real-Time Transport (1) () Th iti f RTP i th t l t k (b) P k t ti Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011 (a) The position of RTP in the protocol stack. (b) Packet nesting.
  • 46.
    Real-Time Transport (2) ThRTP h d Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011 The RTP header
  • 47.
    Real-Time Transport (3) Sthi th t t t b b ff i k t Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011 Smoothing the output stream by buffering packets
  • 48.
    Real-Time Transport (3) ComputerNetworks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011 High jitter
  • 49.
    Real-Time Transport (4) Ljitt Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011 Low jitter
  • 50.
    The Internet TransportProtocols: TCP (1) The Internet Transport Protocols: TCP (1) • Introduction to TCP Introduction to TCP • The TCP service model Th TCP t l • The TCP protocol • The TCP segment header • TCP connection establishment • TCP connection release TCP connection release Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
  • 51.
    The Internet TransportProtocols: TCP (2) The Internet Transport Protocols: TCP (2) • TCP connection management modeling TCP connection management modeling • TCP sliding window TCP ti t • TCP timer management • TCP congestion control • TCP futures Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
  • 52.
    The TCP ServiceModel (1) S i d t Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011 Some assigned ports
  • 53.
    The TCP ServiceModel (2) (a) Four 512-byte segments sent as separate IP diagrams (b) Th 2048 b f d d li d h li i i Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011 (b) The 2048 bytes of data delivered to the application in a single READ call
  • 54.
    The TCP SegmentHeader Th TCP h d Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011 The TCP header.
  • 55.
    TCP Connection Establishment () TCP ti t bli h t i th l Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011 (a) TCP connection establishment in the normal case. (b) Simultaneous connection establishment on both sides.
  • 56.
    TCP Connection ManagementModeling (1) Th t t d i th TCP ti Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011 The states used in the TCP connection management finite state machine.
  • 57.
    TCP Connection ManagementModeling (2) TCP connection management finite state machine. The heavy solid line is the normal path for a client. The heavy dashed line is the heavy dashed line is the normal path for a server. The light lines are unusual events. Each transition is labeled by y the event causing it and the action resulting from it, separated by a slash. Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
  • 58.
    TCP Sliding Window(1) Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011 Window management in TCP
  • 59.
    TCP Sliding Window(2) Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011 Silly window syndrome
  • 60.
    TCP Timer Management () P b bilit d it f k l d t i l ti i d t Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011 (a) Probability density of acknowledgment arrival times in data link layer. (b) … for TCP
  • 61.
    TCP Congestion Control(1) Sl t t f i iti l ti i d f 1 t Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011 Slow start from an initial congestion window of 1 segment
  • 62.
    TCP Congestion Control(2) Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011 Additive increase from an initial congestion window of 1 segment.
  • 63.
    TCP Congestion Control(3) Sl t t f ll d b dditi i i TCP T h Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011 Slow start followed by additive increase in TCP Tahoe.
  • 64.
    TCP Congestion Control(4) F t d th t th tt f TCP R Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011 Fast recovery and the sawtooth pattern of TCP Reno.
  • 65.
    Performance Issues Performance Issues •Performance problems in computer networks • Network performance measurement Network performance measurement • System design for better performance F t TPDU i • Fast TPDU processing • Protocols for high-speed networks Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
  • 66.
    Performance Problems inComputer Networks Networks The state of transmitting one megabit from San Diego to Boston. Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011 (a) At t = 0. (b) After 500 μ sec. (c) After 20 msec. (d) After 40 msec.
  • 67.
    Network Performance Measurement(1) Network Performance Measurement (1) Steps to performance improvement 1 Measure relevant network parameters 1. Measure relevant network parameters, performance. 2 T t d t d h t i i 2. Try to understand what is going on. 3. Change one parameter. Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
  • 68.
    Network Performance Measurement(2) Network Performance Measurement (2) Issues in measuring performance • Sufficient sample size • Representative samples • Representative samples • Clock accuracy M i i l i l d • Measuring typical representative load • Beware of caching • Understand what you are measuring • Extrapolate with care Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011 Extrapolate with care
  • 69.
    Network Performance Measurement(3) R f ti f l d Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011 Response as a function of load.
  • 70.
    System Design forBetter Performance (1) System Design for Better Performance (1) Rules of thumb Rules of thumb 1. CPU speed more important than network speed 2 Reduce packet count to reduce software overhead 2. Reduce packet count to reduce software overhead 3. Minimize data touching 4 Minimize context switches 4. Minimize context switches 5. Minimize copying 6 You can buy more bandwidth but not lower delay 6. You can buy more bandwidth but not lower delay 7. Avoiding congestion is better than recovering from it 8 Avoid timeouts Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011 8. Avoid timeouts
  • 71.
    System Design forBetter Performance (2) F t t it h t h dl k t Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011 Four context switches to handle one packet with a user-space network manager.
  • 72.
    Fast TPDU Processing(1) Th f t th f d t i i h ith h Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011 The fast path from sender to receiver is shown with a heavy line. The processing steps on this path are shaded.
  • 73.
    Fast TPDU Processing(2) ( ) TCP h d (b) IP h d I b th th h d d fi ld Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011 (a) TCP header. (b) IP header. In both cases, the shaded fields are taken from the prototype without change.
  • 74.
    Protocols for High-SpeedNetworks (1) Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011 A timing wheel
  • 75.
    Protocols for High-SpeedNetworks (2) Ti t t f d k l d Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011 Time to transfer and acknowledge a 1-megabit file over a 4000-km line
  • 76.
    Delay Tolerant Networking DelayTolerant Networking • DTN Architecture • The Bundle Protocol • The Bundle Protocol Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
  • 77.
    DTN Architecture (1) Dl t l t t ki hit t Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011 Delay-tolerant networking architecture
  • 78.
    DTN Architecture (2) Uf DTN i Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011 Use of a DTN in space.
  • 79.
    The Bundle Protocol(1) D l t l t t ki t l t k Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011 Delay-tolerant networking protocol stack.
  • 80.
    The Bundle Protocol(2) B dl t l f t Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011 Bundle protocol message format.
  • 81.
    End End Chapter 6 Computer Networks,Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011