The Transport Layer - Home Pages of All Faculty at KFUPM

21 downloads 66 Views 2MB Size Report
The Transport Layer. Chapter 6. Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011 ...
The Transport Layer Chapter 6

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

Transport Service • • • •

Upper Layer Services 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 network, The t k transport, t t and d application li ti llayers Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

Transport Service Primitives (1)

Th primitives The i iti ffor a simple i l ttransportt service i Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

Transport Service Primitives (2)

N ti off TPDUs, Nesting TPDU packets, k t and d fframes. Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

Berkeley Sockets (1)

A state diagram for a simple connection management scheme. Transitions labeled in italics are caused byy packet arrivals. The solid lines show the client’s state sequence. The dashed lines show the server’s state sequence. Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

Berkeley Sockets (2)

Th socket The k t primitives i iti for f TCP Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

Example of Socket Programming: An Internet File Server (1)

...

Client code using sockets

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

Example of Socket Programming: An Internet File Server (2) ...

... Client code using sockets Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

Example of Socket Programming: An Internet File Server (3) ...

Client code using sockets Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

Example of Socket Programming: An Internet File Server (4)

... Server code Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

Example of Socket Programming: An Internet File Server (5) ...

... Server code Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

Example of Socket Programming: An Internet File Server (6) ...

Server code Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

Elements of Transport Protocols (1) • • • • • •

Addressing 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. (b) Environment of the transport layer. Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

Addressing (1)

TSAP NSAPs, TSAPs, NSAP and d transport t t connections ti Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

Addressing (2)

How a user process in host 1 establishes a connection with a mail server in host 2 via a process server. Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

Connection Establishment (1) Techniques for restricting packet lifetime • Restricted network design. g • Putting a hop counter in each packet. • Timestamping each packet 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. (b) The resynchronization problem. Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

Connection Establishment (3)

Three protocol scenarios for establishing a connection using a three-way handshake. CR denotes CONNECTION REQUEST. Normal operation. Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

Connection Establishment (4)

Three protocol scenarios for establishing a connection using a three-way handshake. CR denotes CONNECTION REQUEST. Old duplicate CONNECTION REQUEST appearing out of nowhere. Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

Connection Establishment (5)

Three protocol scenarios for establishing a connection using a three-way handshake. handshake CR denotes CONNECTION REQUEST. REQUEST Duplicate CONNECTION REQUEST and duplicate ACK Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

Connection Release (1)

Ab t di Abrupt disconnection ti with ith lloss off d data t Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

Connection Release (2)

Th ttwo-army problem The bl Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

Connection Release (3)

F Four protocol t l scenarios i for f releasing l i a connection. ti (a) Normal case of three-way handshake Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

Connection Release (4)

F Four protocol t l scenarios i for f releasing l i a connection. ti (b) Final ACK lost. Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

Connection Release (5)

F Four protocol t l scenarios i for f releasing l i a connection. ti (c) Response lost Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

Connection Release (6)

Four protocol F t l scenarios i for f releasing l i a connection. ti (d) Response lost and subsequent DRs lost. Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

Error Control and Flow Control (1)

((a)) Chained Ch i d fifixed-size d i b buffers. ff (b) Chained Ch i d variable-sized i bl i d buffers. (c) One large circular buffer per connection. Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

Error Control and Flow Control (2)

Dynamic D i b buffer ff allocation. ll ti Th The arrows show h th the di direction ti off transmission. An ellipsis (...) indicates a lost TPDU Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

Multiplexing

( ) Multiplexing. (a) M lti l i (b) Inverse I multiplexing. lti l i Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

Crash Recovery

Diff Different t combinations bi ti off client li t and d server strategy t t Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

C Congestion ti C Control t l

• •

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)

( ) Goodput (a) G d t and d (b) delay d l as a ffunction ti off offered ff d load l d Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

Desirable Bandwidth Allocation (2)

M Max-min i bandwidth b d idth allocation ll ti ffor ffour flflows Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

Desirable Bandwidth Allocation (3)

Ch Changing i b bandwidth d idth allocation ll ti over titime Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

Regulating the Sending Rate (1)

A fast f t network t k feeding f di a low-capacity l it receiver i Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

Regulating the Sending Rate (2)

A slow l network t k feeding f di a hi high-capacity h it receiver i Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

Regulating the Sending Rate (3)

S Some congestion ti control t l protocols t l Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

User 2’s allo U ocation

Regulating the Sending Rate (4)

User 1’s allocation

Additi Increase Additive I Multiplicative M lti li ti D Decrease (AIMD) control t l llaw. Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

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 The header. d Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

Introduction to UDP (2)

Th IPv4 The IP 4 pseudoheader d h d included i l d d iin th the UDP checksum. h k Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

Remote Procedure Call

St Steps in i making ki a remote t procedure d call. ll Th The stubs t b are shaded. h d d Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

Real-Time Transport (1)

( ) The (a) Th position iti off RTP iin th the protocol t l stack. t k (b) Packet P k t nesting. ti Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

Real-Time Transport (2)

Th RTP h The header d Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

Real-Time Transport (3)

S Smoothing thi th the output t t stream t by b buffering b ff i packets k t Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

Real-Time Transport (3)

High jitter Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

Real-Time Transport (4)

L Low jitt jitter Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

The Internet Transport Protocols: TCP (1) • • • • • •

Introduction to TCP The TCP service model Th TCP protocol The t l The TCP segment header TCP connection establishment TCP connection release

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

The Internet Transport Protocols: TCP (2) • • • • •

TCP connection management modeling TCP sliding window TCP timer ti managementt 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 Some assigned i d ports t Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

The TCP Service Model (2)

(a) Four 512-byte segments sent as separate IP diagrams (b) The Th 2048 bytes b off data d delivered d li d to the h application li i iin a single READ call Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

The TCP Segment Header

Th TCP h The header. d Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

TCP Connection Establishment

((a)) TCP connection ti establishment t bli h t iin th the normall case. (b) Simultaneous connection establishment on both sides. Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

TCP Connection Management Modeling (1)

The states Th t t used d in i the th TCP connection ti management finite state machine. Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

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 normal path for a server. The light lines are unusual events. Each transition is labeled byy 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)

Window management in TCP Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

TCP Sliding Window (2)

Silly window syndrome Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

TCP Timer Management

( ) P (a) Probability b bilit d density it off acknowledgment k l d t arrival i l titimes iin d data t link layer. (b) … for TCP Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

TCP Congestion Control (1)

Sl Slow start t t from f an initial i iti l congestion ti window i d off 1 segmentt Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

TCP Congestion Control (2)

Additive increase from an initial congestion window of 1 segment. Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

TCP Congestion Control (3)

Sl Slow start t t ffollowed ll db by additive dditi iincrease iin TCP T Tahoe. h Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

TCP Congestion Control (4)

F t recovery and Fast d the th sawtooth t th pattern tt off TCP Reno. R Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

Performance Issues • • • • •

Performance problems in computer networks Network performance measurement System design for better performance F t TPDU processing Fast i 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

The state of transmitting one megabit from San Diego to Boston. (a) At t = 0. (b) After 500 μ sec. (c) After 20 msec. (d) After 40 msec. Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

Network Performance Measurement (1) Steps to performance improvement 1 Measure relevant network parameters 1. parameters, performance. 2 Try 2. T to t understand d t d what h t is i going i on. 3. Change one parameter.

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

Network Performance Measurement (2) Issues in measuring performance • Sufficient sample size • Representative samples • Clock accuracy • Measuring M i typical i l representative i lload d • 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

Network Performance Measurement (3)

R Response as a ffunction ti off load. l d Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

System Design for Better Performance (1) Rules of thumb 1. 2 2. 3. 4 4. 5. 6 6. 7. 8 8.

CPU speed more important than network speed Reduce packet count to reduce software overhead Minimize data touching Minimize context switches Minimize copying You can buy more bandwidth but not lower delay Avoiding congestion is better than recovering from it Avoid timeouts

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

System Design for Better Performance (2)

Four context F t t switches it h to t handle h dl one packet k t with a user-space network manager. Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

Fast TPDU Processing (1)

Th fast The f t path th from f sender d to t receiver i is i shown h with ith a h heavy line. The processing steps on this path are shaded. Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

Fast TPDU Processing (2)

( ) TCP h (a) header. d (b) IP header. h d IIn both b th cases, th the shaded h d d fifields ld are taken from the prototype without change. Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

Protocols for High-Speed Networks (1)

A timing wheel Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

Protocols for High-Speed Networks (2)

Time to Ti t transfer t f and d acknowledge k l d a 1-megabit file over a 4000-km line Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

Delay Tolerant Networking • •

DTN Architecture 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 Delay-tolerant t networking t ki architecture hit t Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

DTN Architecture (2)

U off a DTN iin space. Use Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

The Bundle Protocol (1)

D l t l Delay-tolerant t networking t ki protocol t l stack. t k Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

The Bundle Protocol (2)

B dl protocol Bundle t l message fformat. t Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

End Chapter 6

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011