Chapter 6 The Transport Layer The Transport Service

  • Slides: 38
Download presentation
Chapter 6 The Transport Layer

Chapter 6 The Transport Layer

The Transport Service • • Services Provided to the Upper Layers Transport Service Primitives

The Transport Service • • Services Provided to the Upper Layers Transport Service Primitives Berkeley Sockets An Example of Socket Programming: – An Internet File Server

Services Provided to the Upper Layers The network, transport, and application layers.

Services Provided to the Upper Layers The network, transport, and application layers.

Transport Service Primitives The primitives for a simple transport service.

Transport Service Primitives The primitives for a simple transport service.

Transport Service Primitives (2) The nesting of TPDUs, packets, and frames.

Transport Service Primitives (2) The nesting of TPDUs, packets, and frames.

Transport Service Primitives (3) A state diagram for a simple connection management scheme. Transitions

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.

Berkeley Sockets The socket primitives for TCP.

Berkeley Sockets The socket primitives for TCP.

Socket Programming Example: Internet File Server 6 -6 -1 Client Code

Socket Programming Example: Internet File Server 6 -6 -1 Client Code

Socket Programming Example: Internet File Server (2) Server Code

Socket Programming Example: Internet File Server (2) Server Code

Transport Functions • • • Addressing Connection Establishment Connection Release Flow Control and Buffering

Transport Functions • • • Addressing Connection Establishment Connection Release Flow Control and Buffering Multiplexing Crash Recovery

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

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

Addressing TSAPs, NSAPs and transport connections.

Addressing TSAPs, NSAPs and transport connections.

Connection Establishment How a user process in host 1 establishes a connection with a

Connection Establishment How a user process in host 1 establishes a connection with a time-of-day server in host 2.

Connection Establishment (2) Three protocol scenarios for establishing a connection using a three-way handshake.

Connection Establishment (2) 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.

Connection Release Abrupt disconnection with loss of data.

Connection Release Abrupt disconnection with loss of data.

Connection Release (2) 6 -14, a, b Four protocol scenarios for releasing a connection.

Connection Release (2) 6 -14, a, b Four protocol scenarios for releasing a connection. (a) Normal case of a three-way handshake. (b) final ACK lost.

Connection Release (3) 6 -14, c, d (c) Response lost. (d) Response lost and

Connection Release (3) 6 -14, c, d (c) Response lost. (d) Response lost and subsequent DRs lost.

Flow Control and Buffering (a) Chained fixed-size buffers. (b) Chained variable-sized buffers. (c) One

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

Flow Control and Buffering (2) Dynamic buffer allocation. The arrows show the direction of

Flow Control and Buffering (2) Dynamic buffer allocation. The arrows show the direction of transmission. An ellipsis (…) indicates a lost TPDU.

Multiplexing (a) Upward multiplexing. (b) Downward multiplexing.

Multiplexing (a) Upward multiplexing. (b) Downward multiplexing.

Crash Recovery Different combinations of client and server strategy.

Crash Recovery Different combinations of client and server strategy.

Position of UDP in the TCP/IP protocol suite

Position of UDP in the TCP/IP protocol suite

UDP versus IP

UDP versus IP

Port numbers

Port numbers

IP addresses versus port numbers

IP addresses versus port numbers

ICANN ranges

ICANN ranges

Well-known ports used with UDP

Well-known ports used with UDP

Socket address

Socket address

UDP Header The UDP header.

UDP Header The UDP header.

Pseudoheader for checksum calculation

Pseudoheader for checksum calculation

UDP design

UDP design

The control-block table

The control-block table

Real-Time Protocol (RTP) § RTP: to transport audio and video data § RFC 1889

Real-Time Protocol (RTP) § RTP: to transport audio and video data § RFC 1889 § RTP packet provides – payload type identification – packet sequence numbering – timestamp § RTP runs in the end systems § RTP packets are encapsulated in UDP segments § Interoperability: If two Internet phone applications run RTP, then they may be able to work together

RTP runs on top of UDP RTP libraries provide a transport-layer interface that extend

RTP runs on top of UDP RTP libraries provide a transport-layer interface that extend UDP: • port numbers, IP addresses • payload type identification • packet sequence numbering • timestamp

RTP over OS (a) The position of RTP in the protocol stack. (b) Packet

RTP over OS (a) The position of RTP in the protocol stack. (b) Packet nesting.

RTP Header The RTP header.

RTP Header The RTP header.

Payload Type (7 bits)

Payload Type (7 bits)

RTP Header Format § Sequence Number (16 bits): Increments by one for each RTP

RTP Header Format § Sequence Number (16 bits): Increments by one for each RTP packet sent, and may be used to detect packet loss and to restore packet sequence. § Timestamp field (32 bits): Reflects the sampling instant of the first byte in the RTP data packet. – For audio, timestamp clock typically increments by one for each sampling period (for example, each 125 usecs for a 8 KHz sampling clock) – if application generates chunks of 160 encoded samples, then timestamp increases by 160 for each RTP packet when source is active. Timestamp clock continues to increase at constant rate when source is inactive. § SSRC field (32 bits): Identifies the source of the RTP stream. Each stream in a RTP session should have a distinct SSRC.