The Transport Layer Chapter 6 12/14/2015.

66
The Transport Layer Chapter 6 05/12/22 www.ishuchita.com 1

Transcript of The Transport Layer Chapter 6 12/14/2015.

Page 1: The Transport Layer Chapter 6 12/14/2015.

The Transport Layer

Chapter 6

04/21/23 www.ishuchita.com 1

Page 2: The Transport Layer Chapter 6 12/14/2015.

The Transport Service

• Services Provided to the Upper Layers

• Transport Service Primitives

• Berkeley Sockets

• An Example of Socket Programming: – An Internet File Server

04/21/23 www.ishuchita.com 2

Page 3: The Transport Layer Chapter 6 12/14/2015.

Services Provided to the Upper Layers

The network, transport, and application layers.04/21/23 www.ishuchita.com 3

Page 4: The Transport Layer Chapter 6 12/14/2015.

Transport Service Primitives

The primitives for a simple transport service.

04/21/23 www.ishuchita.com 4

Page 5: The Transport Layer Chapter 6 12/14/2015.

Transport Service Primitives (2)

The nesting of TPDUs, packets, and frames.04/21/23 www.ishuchita.com 5

Page 6: The Transport Layer Chapter 6 12/14/2015.

Transport Service Primitives (3)

A state diagram for a simple connection management scheme. Transitions labeled in italics are caused by packet arrivals. The solid lines show the client's state sequence. The dashed lines show the server's state sequence. 04/21/23 www.ishuchita.com 6

Page 7: The Transport Layer Chapter 6 12/14/2015.

Berkeley Sockets

The socket primitives for TCP.04/21/23 www.ishuchita.com 7

Page 8: The Transport Layer Chapter 6 12/14/2015.

Socket Programming

Example:Internet File

Server

Client code using sockets.

6-6-1

04/21/23 www.ishuchita.com 8

Page 9: The Transport Layer Chapter 6 12/14/2015.

Socket Programming

Example:Internet File Server (2)

Client code using sockets.

04/21/23 www.ishuchita.com 9

Page 10: The Transport Layer Chapter 6 12/14/2015.

Elements of Transport Protocols

• Addressing

• Connection Establishment

• Connection Release

• Flow Control and Buffering

• Multiplexing

• Crash Recovery

04/21/23 www.ishuchita.com 10

Page 11: The Transport Layer Chapter 6 12/14/2015.

Transport Protocol

(a) Environment of the data link layer.(b) Environment of the transport layer.

04/21/23 www.ishuchita.com 11

Page 12: The Transport Layer Chapter 6 12/14/2015.

Addressing

TSAPs, NSAPs and transport connections.04/21/23 www.ishuchita.com 12

Page 13: The Transport Layer Chapter 6 12/14/2015.

Connection Establishment

How a user process in host 1 establishes a connection with a time-of-day server in host 2.04/21/23 www.ishuchita.com 13

Page 14: The Transport Layer Chapter 6 12/14/2015.

Connection Establishment (2)

(a) TPDUs may not enter the forbidden region.(b) The resynchronization problem.

04/21/23 www.ishuchita.com 14

Page 15: The Transport Layer Chapter 6 12/14/2015.

Connection Establishment (3)

Three protocol scenarios for establishing a connection using a three-way handshake. CR denotes CONNECTION REQUEST. (a) Normal operation, (b) Old CONNECTION REQUEST appearing out of nowhere. (c) Duplicate CONNECTION REQUEST and duplicate ACK.

04/21/23 www.ishuchita.com 15

Page 16: The Transport Layer Chapter 6 12/14/2015.

Connection Release

Abrupt disconnection with loss of data.04/21/23 www.ishuchita.com 16

Page 17: The Transport Layer Chapter 6 12/14/2015.

Connection Release (2)

The two-army problem.04/21/23 www.ishuchita.com 17

Page 18: The Transport Layer Chapter 6 12/14/2015.

Connection Release (3)

Four protocol scenarios for releasing a connection. (a) Normal case of a three-way handshake. (b) final ACK lost.

6-14, a, b

04/21/23 www.ishuchita.com 18

Page 19: The Transport Layer Chapter 6 12/14/2015.

Connection Release (4)

(c) Response lost. (d) Response lost and subsequent DRs lost.

6-14, c,d

04/21/23 www.ishuchita.com 19

Page 20: The Transport Layer Chapter 6 12/14/2015.

Flow Control and Buffering

(a) Chained fixed-size buffers. (b) Chained variable-sized buffers. (c) One large circular buffer per connection.

04/21/23 www.ishuchita.com 20

Page 21: The Transport Layer Chapter 6 12/14/2015.

Flow Control and Buffering (2)

Dynamic buffer allocation. The arrows show the direction of transmission. An ellipsis (…) indicates a lost TPDU.04/21/23 www.ishuchita.com 21

Page 22: The Transport Layer Chapter 6 12/14/2015.

Multiplexing

(a) Upward multiplexing. (b) Downward multiplexing.04/21/23 www.ishuchita.com 22

Page 23: The Transport Layer Chapter 6 12/14/2015.

Crash Recovery

Different combinations of client and server strategy.04/21/23 www.ishuchita.com 23

Page 24: The Transport Layer Chapter 6 12/14/2015.

A Simple Transport Protocol

• The Example Service Primitives

• The Example Transport Entity

• The Example as a Finite State Machine

04/21/23 www.ishuchita.com 24

Page 25: The Transport Layer Chapter 6 12/14/2015.

The Example Transport Entity

The network layer packets used in our example.04/21/23 www.ishuchita.com 25

Page 26: The Transport Layer Chapter 6 12/14/2015.

The Example Transport Entity (2)

Each connection is in one of seven states:

1. Idle – Connection not established yet.

2. Waiting – CONNECT has been executed, CALL REQUEST sent.

3. Queued – A CALL REQUEST has arrived; no LISTEN yet.

4. Established – The connection has been established.

5. Sending – The user is waiting for permission to send a packet.

6. Receiving – A RECEIVE has been done.

7. DISCONNECTING – a DISCONNECT has been done locally.

04/21/23 www.ishuchita.com 26

Page 27: The Transport Layer Chapter 6 12/14/2015.

The Example Transport Entity (3)

04/21/23 www.ishuchita.com 27

Page 28: The Transport Layer Chapter 6 12/14/2015.

The Example Transport Entity (4)

04/21/23 www.ishuchita.com 28

Page 29: The Transport Layer Chapter 6 12/14/2015.

The Example Transport Entity (5)

04/21/23 www.ishuchita.com 29

Page 30: The Transport Layer Chapter 6 12/14/2015.

The Example Transport Entity (6)

04/21/23 www.ishuchita.com 30

Page 31: The Transport Layer Chapter 6 12/14/2015.

The Example Transport Entity (7)

04/21/23 www.ishuchita.com 31

Page 32: The Transport Layer Chapter 6 12/14/2015.

The Example Transport Entity (8)

04/21/23 www.ishuchita.com 32

Page 33: The Transport Layer Chapter 6 12/14/2015.

The Example Transport Entity (9)

04/21/23 www.ishuchita.com 33

Page 34: The Transport Layer Chapter 6 12/14/2015.

The Example Transport Entity (10)

04/21/23 www.ishuchita.com 34

Page 35: The Transport Layer Chapter 6 12/14/2015.

The Example as a Finite State Machine

The example protocol as a finite state machine. Each entry has an optional predicate, an optional action, and the new state. The tilde indicates that no major action is taken. An overbar above a predicate indicate the negation of the predicate. Blank entries correspond to impossible or invalid events.

04/21/23 www.ishuchita.com 35

Page 36: The Transport Layer Chapter 6 12/14/2015.

The Example as a Finite State Machine (2)

The example protocol in graphical form. Transitions that leave the connection state unchanged have been omitted for simplicity.04/21/23 www.ishuchita.com 36

Page 37: The Transport Layer Chapter 6 12/14/2015.

The Internet Transport Protocols: UDP

• Introduction to UDP

• Remote Procedure Call

• The Real-Time Transport Protocol

04/21/23 www.ishuchita.com 37

Page 38: The Transport Layer Chapter 6 12/14/2015.

Introduction to UDP

The UDP header.04/21/23 www.ishuchita.com 38

Page 39: The Transport Layer Chapter 6 12/14/2015.

Remote Procedure Call

Steps in making a remote procedure call. The stubs are shaded.04/21/23 www.ishuchita.com 39

Page 40: The Transport Layer Chapter 6 12/14/2015.

The Real-Time Transport Protocol

(a) The position of RTP in the protocol stack. (b) Packet nesting.04/21/23 www.ishuchita.com 40

Page 41: The Transport Layer Chapter 6 12/14/2015.

The Real-Time Transport Protocol (2)

The RTP header.04/21/23 www.ishuchita.com 41

Page 42: The Transport Layer Chapter 6 12/14/2015.

The Internet Transport Protocols: TCP• Introduction to TCP• The TCP Service Model• The TCP Protocol• The TCP Segment Header• TCP Connection Establishment• TCP Connection Release• TCP Connection Management Modeling• TCP Transmission Policy• TCP Congestion Control• TCP Timer Management• Wireless TCP and UDP• Transactional TCP

04/21/23 www.ishuchita.com 42

Page 43: The Transport Layer Chapter 6 12/14/2015.

The TCP Service Model

Some assigned ports.

Port Protocol Use21 FTP File transfer23 Telnet Remote login25 SMTP E-mail69 TFTP Trivial File Transfer Protocol79 Finger Lookup info about a user80 HTTP World Wide Web

110 POP-3 Remote e-mail access119 NNTP USENET news

04/21/23 www.ishuchita.com 43

Page 44: The Transport Layer Chapter 6 12/14/2015.

The TCP Service Model (2)

(a) Four 512-byte segments sent as separate IP datagrams.

(b) The 2048 bytes of data delivered to the application in a single READ CALL.

04/21/23 www.ishuchita.com 44

Page 45: The Transport Layer Chapter 6 12/14/2015.

The TCP Segment Header

TCP Header.04/21/23 www.ishuchita.com 45

Page 46: The Transport Layer Chapter 6 12/14/2015.

The TCP Segment Header (2)

The pseudoheader included in the TCP checksum.04/21/23 www.ishuchita.com 46

Page 47: The Transport Layer Chapter 6 12/14/2015.

TCP Connection Establishment

(a) TCP connection establishment in the normal case.(b) Call collision.

6-31

04/21/23 www.ishuchita.com 47

Page 48: The Transport Layer Chapter 6 12/14/2015.

TCP Connection Management Modeling

The states used in the TCP connection management finite state machine.04/21/23 www.ishuchita.com 48

Page 49: The Transport Layer Chapter 6 12/14/2015.

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 by the event causing it and the action resulting from it, separated by a slash.

04/21/23 www.ishuchita.com 49

Page 50: The Transport Layer Chapter 6 12/14/2015.

TCP Transmission Policy

Window management in TCP.04/21/23 www.ishuchita.com 50

Page 51: The Transport Layer Chapter 6 12/14/2015.

TCP Transmission Policy (2)

Silly window syndrome.04/21/23 www.ishuchita.com 51

Page 52: The Transport Layer Chapter 6 12/14/2015.

TCP Congestion Control

(a) A fast network feeding a low capacity receiver.(b) A slow network feeding a high-capacity receiver.04/21/23 www.ishuchita.com 52

Page 53: The Transport Layer Chapter 6 12/14/2015.

TCP Congestion Control (2)

An example of the Internet congestion algorithm.04/21/23 www.ishuchita.com 53

Page 54: The Transport Layer Chapter 6 12/14/2015.

TCP Timer Management

(a) Probability density of ACK arrival times in the data link layer.

(b) Probability density of ACK arrival times for TCP.04/21/23 www.ishuchita.com 54

Page 55: The Transport Layer Chapter 6 12/14/2015.

Wireless TCP and UDP

Splitting a TCP connection into two connections.04/21/23 www.ishuchita.com 55

Page 56: The Transport Layer Chapter 6 12/14/2015.

Transitional TCP

(a) RPC using normal TPC.(b) RPC using T/TCP.04/21/23 www.ishuchita.com 56

Page 57: The Transport Layer Chapter 6 12/14/2015.

Performance Issues

• Performance Problems in Computer Networks

• Network Performance Measurement

• System Design for Better Performance

• Fast TPDU Processing

• Protocols for Gigabit Networks

04/21/23 www.ishuchita.com 57

Page 58: The Transport Layer Chapter 6 12/14/2015.

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.04/21/23 www.ishuchita.com 58

Page 59: The Transport Layer Chapter 6 12/14/2015.

Network Performance Measurement

The basic loop for improving network performance.

1. Measure relevant network parameters, performance.

2. Try to understand what is going on.

3. Change one parameter.

04/21/23 www.ishuchita.com 59

Page 60: The Transport Layer Chapter 6 12/14/2015.

System Design for Better Performance

Rules:

1. CPU speed is more important than network speed.

2. Reduce packet count to reduce software overhead.

3. Minimize context switches.

4. Minimize copying.

5. You can buy more bandwidth but not lower delay.

6. Avoiding congestion is better than recovering from it.

7. Avoid timeouts.

04/21/23 www.ishuchita.com 60

Page 61: The Transport Layer Chapter 6 12/14/2015.

System Design for Better Performance (2)

Response as a function of load.04/21/23 www.ishuchita.com 61

Page 62: The Transport Layer Chapter 6 12/14/2015.

System Design for Better Performance (3)

Four context switches to handle one packet with a user-space network manager.04/21/23 www.ishuchita.com 62

Page 63: The Transport Layer Chapter 6 12/14/2015.

Fast TPDU Processing

The fast path from sender to receiver is shown with a heavy line.The processing steps on this path are shaded.04/21/23 www.ishuchita.com 63

Page 64: The Transport Layer Chapter 6 12/14/2015.

Fast TPDU Processing (2)

(a) TCP header. (b) IP header. In both cases, the shaded fields are taken from the prototype without change.

04/21/23 www.ishuchita.com 64

Page 65: The Transport Layer Chapter 6 12/14/2015.

Fast TPDU Processing (3)

A timing wheel.04/21/23 www.ishuchita.com 65

Page 66: The Transport Layer Chapter 6 12/14/2015.

Protocols for Gigabit Networks

Time to transfer and acknowledge a 1-megabit file over a 4000-km line.04/21/23 www.ishuchita.com 66