chapter 6 the transport layer. the transport service services provided to the upper layers. quality...

20
Chapter 6 The Transport Layer

Upload: teresa-arnold

Post on 31-Dec-2015

217 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Chapter 6 The Transport Layer. The Transport Service Services provided to the Upper Layers. Quality of Service Transport service primitives Services provided

Chapter 6

The Transport Layer

Page 2: Chapter 6 The Transport Layer. The Transport Service Services provided to the Upper Layers. Quality of Service Transport service primitives Services provided

The Transport Service• Services provided to the Upper Layers.

• Quality of Service

• Transport service primitives

• Services provided to upper layer – Provide efficient reliable and cost effective services

to processes in the application layer– Transport entity does the work (could exist in OS, in

a user process or a library pkg.) next slide– Connection oriented and connectionless (but this is

also in the network layer). Why do we need transport layer at all? See two slides from this one.

Page 3: Chapter 6 The Transport Layer. The Transport Service Services provided to the Upper Layers. Quality of Service Transport service primitives Services provided

The Transport Service• Services provided to upper layer

TPDU = Transport protocol data unit

Page 4: Chapter 6 The Transport Layer. The Transport Service Services provided to the Upper Layers. Quality of Service Transport service primitives Services provided
Page 5: Chapter 6 The Transport Layer. The Transport Service Services provided to the Upper Layers. Quality of Service Transport service primitives Services provided

The Transport Service• Why two distinct layers?

– Network layer is part of communication subnet and is run by the carrier (for WAN’s).

– What if network layer is unreliable, loses packets or crashes?

– Users have no control over subnet and cannot poor service problems

– Need to put a layer on top of network layer that improves the quality of service.

– Lost pkts + bad data can be detected and compensated for by the trans. Layer.

Page 6: Chapter 6 The Transport Layer. The Transport Service Services provided to the Upper Layers. Quality of Service Transport service primitives Services provided

The Transport Service• Why two distinct layers?

– App programs can be written using standard primitives and have them work on a wide variety of networks - ignoring subnet interfaces and poor transmission

– Isolates upper layers from imperfections of subnet– Bottom 4 layers are transport service provider– Upper layers are called transport service user

Page 7: Chapter 6 The Transport Layer. The Transport Service Services provided to the Upper Layers. Quality of Service Transport service primitives Services provided

The Transport Service• Quality of Service

– Bridges gap between a possibly unreliable network layer and what the transport users want

– Connection establishment delay, connection establishment failure probability, throughput, transit delay, residual error ratio, protection, priority, resilience

– Connection establishment delay amt. Of time elapsing between a transport connection being requested and its confirmation being recd.

– Connection establishment failure probability is the prob. Of a conn. Not being estd. Withing the max. establishment delay time.

Page 8: Chapter 6 The Transport Layer. The Transport Service Services provided to the Upper Layers. Quality of Service Transport service primitives Services provided

The Transport Service• Quality of Service

– Throughput parameter measures the number of bytes of user data transferred per second, measured over some time interval.

– Transit delay measures the time between a mess. Being sent by the transport user on the source machine and its being recd. By the transport user on the destination machine.

– Residual error ratio measures the number of lost of garbled messages as a fraction of total sent

– Protection transport user can specify protection against wiretappers.

Page 9: Chapter 6 The Transport Layer. The Transport Service Services provided to the Upper Layers. Quality of Service Transport service primitives Services provided

The Transport Service• Quality of Service

– Throughput parameter measures the number of bytes of user data transferred per second, measured over some time interval.

– Transit delay measures the time between a mess. Being sent by the transport user on the source machine and its being recd. By the transport user on the destination machine.

– Residual error ratio measures the number of lost of garbled messages as a fraction of total sent

– Protection transport user can specify protection against wiretappers.

Page 10: Chapter 6 The Transport Layer. The Transport Service Services provided to the Upper Layers. Quality of Service Transport service primitives Services provided

The Transport Service• Quality of Service

– Priority indicate some connections are more impt than others - in case of congestion make sure that the higher-priority connections get serviced before the low priority ones.

– Resilience probability of the transport layer itself spontaneously terminating a connection due to internal problems or congestion.

Page 11: Chapter 6 The Transport Layer. The Transport Service Services provided to the Upper Layers. Quality of Service Transport service primitives Services provided

The Transport Service• Transport service primitives

– TSP allows users of the transport layer to access transport service. Primitive TPDU sent Meaning

LISTEN (none) Block until some process tries to connectCONNECT CONNECTION REQ. Actively attempt to establish a connection

SEND DATA Send informationRECEIVE (none) Block until a DATA TPDU arrives

DISCONNECT DISCONNECTION REQ. This side wants to release connection

123451 Server executes a LISTEN. Server blocks until client shows up.2 Client executes CONNECT. Transport layer blocks client, sends pkt. to server.

CONN. REQ. TPDU sent to server. Transport entity checks if server is blockedon a LISTEN. If so, sends CONN. ACCEPTED TPDU to client. On recpt. by client, client is unblocked.

3,4 Can use SEND/RECEIVE now. Blocking is used.5 Asymmetric DISCONNECT - either party can issue a DISCONN. primitive.

Symmetric - one side does DISC means no more data from that side, but itis willing to recv. data from other side. Connection released when both do DISC.

Page 12: Chapter 6 The Transport Layer. The Transport Service Services provided to the Upper Layers. Quality of Service Transport service primitives Services provided

Bezerkely sockets• Sockets

Primitive MeaningSOCKET Create a new communication end point. Alloc. table space. Success returns a file descriptor (FD).

BIND Attach a local address to a socket. After address binding, remote clients can connect.

LISTEN Announce readiness to accept conns; give queue size. Nonblocking.

ACCEPT Block caller until conn attempt comes. Spawn socket+new FD. Listen on orig. sock.

CONNECT Actively attempt to establish conn (1). Blocks caller. On completion, unblocked.

SEND Send some data over the connection

RECEIVE Receive data from the connection

CLOSE Release the connection. It is symmetric.

S

ERVER

CLIENT

1 Client must first use SOCKET primitive.

Page 13: Chapter 6 The Transport Layer. The Transport Service Services provided to the Upper Layers. Quality of Service Transport service primitives Services provided

Establishing a connection• Three way handshake (Normal Operation)

– Host 1 chooses seq number = x and sends CONNECTION REQUEST (CR) to host 2.

– Host 2 replies with CONNECTION ACCEPTED (ACK) acknowledging x and announcing its own seq = y

– Host 1 acks host 2 choice of initial seq number (y) in the first set of data that it sends.

• Three way handshake (Old Duplicate)– First TPDU is a delayed CR (arrives at host 2

without 1 knowing)– 2 responds by sending an ACK

Page 14: Chapter 6 The Transport Layer. The Transport Service Services provided to the Upper Layers. Quality of Service Transport service primitives Services provided

Releasing a connection• Releasing a connection

– Two ways - asymmetric and symmetric– Asymmetric - hang up the phone. Symmetric each

party hangs up - each connection is unidirectional.

Connection is established. H1 sends 1 TPDU. It sends another, but H2 sends a disconnect request (DR) andconnection is lost and data remain in limbo.

Page 15: Chapter 6 The Transport Layer. The Transport Service Services provided to the Upper Layers. Quality of Service Transport service primitives Services provided

NORMAL

FINALACKLOST

RESPONSELOST

RESPONSELOST & SUBSEQ.DR’s LOST

Page 16: Chapter 6 The Transport Layer. The Transport Service Services provided to the Upper Layers. Quality of Service Transport service primitives Services provided

Releasing a connection• Read paragraphs 1, 2, 3 on page 502 on your

own.

• Ignore 6.2.4, 6.2.5, 6.2.6,

• Ignore section 6.3

Page 17: Chapter 6 The Transport Layer. The Transport Service Services provided to the Upper Layers. Quality of Service Transport service primitives Services provided

• TCP (Transmission Control Protocol) – Connection oriented (UDP - User Datagram Protocol

is connectionless).– Designed to dynamically adapt to properties of the

internetwork since different topologies, bandwidths, delays & packet sizes exist on the internetwork.

– Need to distinguish between TCP transport entity (softw.) & TCP proto. (rules). Clear from the context.

• TCP Service Model– Service is obtained by having sender and receiver

create sockets. Sockets have IP address of host as well as a 16 bit number (port) associated with it.

TCP and UDP

Page 18: Chapter 6 The Transport Layer. The Transport Service Services provided to the Upper Layers. Quality of Service Transport service primitives Services provided

• TCP Service Model– Service is obtained by having sender and receiver

create sockets. Sockets have IP address of host as well as a 16 bit number (port) associated with it.

– More than one conn. can terminate in same socket. – Port numbers < 1024 are well known ports - e.g.,

FTP is port 21, Telnet 23.– TCP is full dup. & point-to-point (no broad or multi)– Byte stream not message stream. e.g., user writes

4x512 bytes to TCP stream. Receiver may get it as 2048 bytes, 2x1024 bytes, 4x512 bytes.

TCP and UDP

Page 19: Chapter 6 The Transport Layer. The Transport Service Services provided to the Upper Layers. Quality of Service Transport service primitives Services provided

TCP Segment Header

Page 20: Chapter 6 The Transport Layer. The Transport Service Services provided to the Upper Layers. Quality of Service Transport service primitives Services provided

• Fixed format 20byte header.

• Source port/dest. Port (1024 and above)

• Seq number

• Acknowledgement # is not the last byte correctly received but the next byte expected

• TCP Header length - how many 32 bit words are contained in the TCP header.

TCP Segment Header