1 of 32

UNIT-4

THE TRANSPORT LAYER

2 of 32

THE TRANSPORT LAYER

Recap…

3 of 32

THE TRANSPORT LAYER

Topics

  1. Transport service
  2. Elements of transport protocol
  3. A Simple Transport Protocol
  4. Internet transport layer protocols: UDP and TCP.

4 of 32

THE TRANSPORT LAYER

Transport service

5 of 32

THE TRANSPORT LAYER

  1. Transport service
    1. Services Provided to the Upper Layers
    2. Transport Service Primitives
    3. Berkeley Sockets

6 of 32

Transport service

Services Provided to the Upper Layers:

    • The ultimate goal of the transport layer is to provide efficient, reliable, and cost-effective data transmission service to its users.
    • To achieve this, the transport layer makes use of the services provided by the network layer.
    • The software and/or hardware within the transport layer that does the work is called the transport entity

7 of 32

Transport service

8 of 32

Transport service

Services Provided to the Upper Layers:

2 types of services:

    • The connection-oriented transport service
    • The connection-less transport service

9 of 32

Transport service

The connection-oriented transport service :

connections have three phases:

    • Establishment
    • Data transfer
    • Release.

10 of 32

Transport service

Transport Service Primitives

    • To allow users to access the transport service, the transport layer must provide some operations to application programs
    • The connection-oriented transport service is reliable.
    • The transport layer can also provide unreliable (datagram) service

11 of 32

Transport service

12 of 32

Transport service

13 of 32

THE SOCKET PRIMITIVES FOR TCP

Berkeley Sockets

    • Sockets were first released as part of the Berkeley UNIX 4.2BSD software distribution in 1983.
    • there is a socket-style API for Windows called ‘‘winsock.’’

14 of 32

THE TRANSPORT LAYER

15 of 32

THE TRANSPORT LAYER

16 of 32

THE TRANSPORT LAYER

Elements of transport protocol

17 of 32

Elements of transport protocol

    • Addressing
    • Connection Establishment
    • Connection Release
    • Error Control and Flow Control
    • Multiplexing
    • Crash Recovery

18 of 32

Elements of transport protocol

Addressing

    • When an application (e.g., a user) process wishes to set up a connection to a remote application process, it must specify which one to connect to.
    • In the Internet, these endpoints are called ports.
    • We use the generic term TSAP (Transport Service Access Point)

19 of 32

Elements of transport protocol

Addressing

20 of 32

Elements of transport protocol

Addressing

21 of 32

Elements of transport protocol

Connection Establishment

    • THREE-WAY HANDSHAKING

22 of 32

Elements of transport protocol

Connection Release

    • Disconnect Request(DR)

23 of 32

Elements of transport protocol

Error Control and Flow Control

    • Error control is ensuring that the data is delivered with the desired level of reliability, usually that all of the data is delivered without any errors.
    • Flow control is keeping a fast transmitter from overrunning a slow receiver.

24 of 32

Error Control and Flow Control

    • 1. A frame carries an error-detecting code (e.g., a CRC or checksum) that is used to check if the information was correctly received.
    • 2. A frame carries a sequence number to identify itself and is retransmitted by the sender until it receives an acknowledgement of successful receipt from the receiver. This is called ARQ (Automatic Repeat reQuest).
    • 3. There is a maximum number of frames that the sender will allow to be outstanding at any time, pausing if the receiver is not acknowledging frames quickly enough. If this maximum is one packet the protocol is called stop-and-wait. Larger windows enable pipelining and improve performance on long, fast links.
    • 4. The sliding window protocol combines these features and is also used to support bidirectional data transfer.

25 of 32

Multiplexing

    • In this figure, four distinct transport connections all use the same network connection (e.g., IP address) to the remote host.

26 of 32

Crash Recovery

    • If the transport entity is entirely within the hosts, recovery from network and router crashes is straightforward
    • ‘‘recovery from a layer N crash can only be done by layer N + 1,’’ and then only if the higher layer retains enough status information to reconstruct where it was before the problem occurred.

27 of 32

THE TRANSPORT LAYER

A Simple Transport Protocol

28 of 32

A Simple Transport Protocol

The Example Service Primitives

    • CONNECT: we will have a library procedure connect that can be called with the appropriate parameters necessary to establish a connection.
    • The parameters are the local and remote TSAPs.
    • When a process wants to be able to accept incoming calls, it calls LISTEN
    • To release a connection, we will use a procedure DISCONNECT.

29 of 32

A Simple Transport Protocol

The Example Service Primitives

connum = LISTEN(local)

connum = CONNECT(local, remote)

status = SEND(connum, buffer, bytes)

status = RECEIVE(connum, buffer, bytes)

status = DISCONNECT(connum)

30 of 32

A Simple Transport Protocol

Packet Types

31 of 32

A Simple Transport Protocol

32 of 32

A Simple Transport Protocol