Top Banner
TRANSPORT LAYER Prepared By: Reshma Dayma
32
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Transport layer

TRANSPORT LAYER Prepared By: ReshmaDayma

Page 2: Transport layer

TRANSPORT LAYERTransport layer provides logical communication between application process running on different host.

Application processes use the logical communication provided by the transport layer to send messages to each other, free of the worry about details of the physical infrastructure used to carry these messages.

Page 3: Transport layer

SERVICES PROVIDED TO UPPER LAYERGoal of the transport layer is to efficient, reliable and cost effective service to application layer.

To provide the service, transport layer uses service provided by network layer.

Hardware and software within the transport layer that provides service is called transport layer entity.

Transport layer provides two types service to application layer.

Connection oriented service

Connectionless service

Page 4: Transport layer

Quality of ServiceIt can be said that primary function of transport layer is, enhancing the QoS provided by network layer.

Transport layer allows user to specify some minimum, acceptable and desired value for quality of service parameters at the time of connection set up.

list of the quality of parameters are given here.

The process of negotiating QoS parameter while Connection establishment is called option negotiation.

Connection Establishment Delay

Connection Establishment Fail Probability

Throughput

Transit Delay

Residual error date

Protection

Priority

Resilience

Page 5: Transport layer

Transport Service PrimitivesTransport service primitives allows transport user like application programs to access transport service.

Difference between network service and transport service.

1. network service is used only by transport layer, while transport service is used by number of application programs.

2. network layer service model services offered by real network, real network can lost the packet, so network layer services are not 100% reliable. Transport layer services are reliable, it provides reliable service using unreliable network.

The primitives for a simple transport service.

Page 6: Transport layer

Transport Service PrimitivesListen: executed by server. It means server is ready to accept connection. It blocks the process of server until connection request comes.

Connect: executed by client to request the connection. It sends connection req. TPDU(transport protocol data unit) (packet) to server. If server is able to handle connection then it sends Connection accepted TPDU.

Send: executed to send data to other end.

Receive: when ever client or server is waiting for data, It executes Receive primitive. This is also blocking primitive.

Disconnect: to disconnect connection. Two variants of disconnect.

1. Asymmetric: either side issues disconnect, connection will be released.

2. Symmetric: both the side need to separately execute disconnect.

Page 7: Transport layer

Transport Service Primitives

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.

Page 8: Transport layer

Berkeley Sockets

Berkeley Socket Primitives for TCP

Page 9: Transport layer

ELEMENTS OF TRANSPORT PROTOCOLAddressing

TSAPs, NSAPs and transport connections.

Page 10: Transport layer

ELEMENTS OF TRANSPORT PROTOCOL

Page 11: Transport layer

CONNECTION ESTABLISHMENT

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.

Page 12: Transport layer

CONNECTION RELEASEConnection at transport can be released in two way.

1. asymmetric: if one of host terminates connection, then in both the direction, data communication will be terminated.

2. symmetric: if one of the host disconnects connection, then it can not send the data but it can receive it.

Page 13: Transport layer

CONNECTION RELEASEAsymmetric Release

Abrupt disconnection with loss of data.

Page 14: Transport layer

CONNECTION RELEASE

(a) Normal case of a three-way handshake. (b) final ACK lost.

Page 15: Transport layer

CONNECTION RELEASE

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

Page 16: Transport layer

CONNECTION RELEASETCP Connection Release uses symmetric approach. It is called Four Way handshaking for connection termination.

Page 17: Transport layer

FLOW CONTROL & BUFFERINGTransport layer manages end to end to flow. If the receiver is not able to cope with the flow of data, then data flow should be control from sender side, that part is done on Transport layer.

Data link layer is also doing flow control, but it controls flow of data between adjacent nodes in path from source to destination.

Reasons of packet loss at receiver is slow processing speed or insufficient buffer to store the data.

Buffer are allocated at sender and receiver side. If the network service is reliable, so every send TPDU sent will be delivered to receiver and will be buffered and processes at receiver, so no need to keep buffer at sender.

But if network service is unreliable and receiver may not able to handle every incoming TPDU then sender should also keep a buffer, where copy of TPDU resides until it’s ACK comes.

Page 18: Transport layer

FLOW CONTROL & BUFFERINGBuffers can be allocate in fixed size when connection sets up or buffer can be varied dynamically according to free memory. First case is called static buffer allocation.

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

Page 19: Transport layer

FLOW CONTROL & BUFFERINGDynamic Buffer Allocation: as connection are opened and closed, memory available changes, so sender and receiver dynamically adjust buffer allocations.

In dynamic buffer allocation, initially sender will request certain number of buffers based on perceive need. receiver will grant as many buffers as it can. Sender Receiver

<Req. 8 buffers>

<Buff Alloc. 4>

<Seq.:0, data=m0>

< Seq.:1, data=m1>

< Seq.:2, data=m2 > <Ack:2, Buf:2>

<Seq.:3, data=m3><Seq.:4, data=m4>

Page 20: Transport layer

MULTIPLEXING

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

Page 21: Transport layer

CRASH RECOVERYHosts and routers are subject to crash.

router crash is easier to handle since transport entities are alive at the host, routers are only intermediate nodes which forwards packet, they do not have transport layer entity.

How to recover from host crashes?

One client(host) is sending a file to server(receiver host). Transport layer at server simply passes TPDU to transport layer. While transmission was on going, server crashes.

Server crashes and comes up -> table initiated, does not know where it was?

Server sends a broadcast TPDU to all host, announcing that it had just crashed and requesting that its clients inform it about status of all open connection.

Each client can be in one of two states:

S0: no outstanding TPDU

S1: one TPDU outstanding

Page 22: Transport layer

CRASH RECOVERYNow it seems that if TPDU is outstanding, client should transmit it, but there are can be different hidden situations.

1. if server has first sent ACK and before it can send TPDU to next layer, server crashes. In this case, client will get ACK so it will not retransmit, and TPDU is lost by server.

2. if server first sends packet to next layer, then it crashes before it can send ACK. In this case though server has already received TPDU, client thinks TPDU is lost and it will retransmit.

Server(Receiving host) can be programmed in two ways, 1. ACK first 2. write first

Three events are possible at server, sending ACK(A), sending packet to next layer(W), crashing (C).

Three event can occur in six different case: AC(W) AWC C(AW), C(WA) WAC WC(A)

Client(sending host) can be programmed in four ways, 1. always retransmit last TPDU, 2. never retransmit last TPDU, 3. retransmit only in S0, 4. retransmit only in S1.

Page 23: Transport layer

CRASH RECOVERY

Different combinations of client and server strategy.

Page 24: Transport layer

UDPUser datagram protocol(UDP) is used to send and receive data without establishing connection.

UDP packets is consist of 8 byte header followed by data.

UDP length includes 8byte header and data, size of whole segment.

UDP checksum is optional, stored as 0 if not computed.

The UDP header.

Page 25: Transport layer

UDPUDP does not do flow control, error control and retransmission if packet gets lost.

Area where UDP is useful is client server application. Client sends short request to server and gets short reply back.

Application that uses UDP this way is DNS.

If a host needs IP address of www.abc.com, it will send UDP packet to server, server will reply with UDP packet that contains IP address of site.

Page 26: Transport layer

TCPTransmission Control Protocol (TCP) was designed to provide reliable end to end stream over unreliable network.

TCP service is obtain by creating a socket at both client and server side. Each socket has socket address that consist of IP address and port number.

Before sending data, connection must be established between sending and receiving machine.

One socket can be used to establish many connection, many sender can connect with same receiver socket. TCP connections are identified by pair of sockets at both the end.

TCP connection are full duplex and point to point. TCP does not support multicast and broadcast.

TCP connection is byte stream, not a message stream.

Page 27: Transport layer

TCPSending and receiving TCP entities exchange data in form of segment.

TCP segment consist of 20 byte header plus optional part followed by data.

When sender transmits a segment, it also starts timer. When segment arrives at destination, it sends acknowledgment. Acknowledgment contains equal to sequence number of next data.

If timer for segment expires and acknowledgment does not reach to sender, sender infers that packet is not delivered to receiver and it retransmits the segment.

Page 28: Transport layer

TCP HEADER

Page 29: Transport layer

TCP HEADER

Page 30: Transport layer

TCP HEADEROptions available with TCP

1. NAK(negative acknowledgment): host can send negative acknowledgment, it specifies sequence number of data not yet received.

2. timestamp: time stamp of the event when packet is send/received, this option is used to calculate RTT(round trip time at transport layer)

3. TCP payload: host can specify maximum TCP payload(data in TCP packet) size it is willing to accept.

Page 31: Transport layer

TCP CONNECTION ESTABLISHMENTTCP connection is established by Three way handshaking:

Page 32: Transport layer

TCP CONNECTION RELEASETCP Connection Release uses symmetric approach. It is called Four Way handshaking for connection termination.