1 of 39

COMPUTER NETWORKS

MODULE-4

TRANSPORT LAYER

1

2/28/2024

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

/skit.org.in

/skit.org.in

/skit.org.in

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

2/28/2024

1

2 of 39

2

2/28/2024

TRANSPORT LAYER:

• The transport layer builds on the network layer to provide data transport from a process on a source machine to a process on a destination machine with a desired level of reliability that is independent of the physical networks currently in use.

• It provides the abstractions that applications need to use the network.

��

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

/skit.org.in

/skit.org.in

/skit.org.in

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

2/28/2024

2

3 of 39

TRANSPORT SERVICE

Services Provided to the Upper Layers

• provide efficient, reliable, and cost effective data transmission service to its users, normally processes in the application layer.

• The software and/or hardware within the transport layer that does the work is called the transport entity.

• The transport entity can be located in the operating system kernel, in a library package bound into network applications, in a separate user process, or even on the network interface card.

3

2/28/2024

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

/skit.org.in

/skit.org.in

/skit.org.in

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

2/28/2024

3

4 of 39

Types of transport service.

  • Connection-oriented and
  • connectionless

• The connection-oriented transport service –

    • connections have three phases:

establishment, data transfer, and release.

    • Addressing and flow control are also provided

• it can be difficult to provide a connectionless transport service on top of a connection-oriented network service, since it is inefficient to set up a connection to send a single packet and then tear it down

immediately afterwards.

4

2/28/2024

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

/skit.org.in

/skit.org.in

/skit.org.in

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

2/28/2024

4

5 of 39

Transport Service Primitives

5

2/28/2024

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

/skit.org.in

/skit.org.in

/skit.org.in

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

2/28/2024

5

6 of 39

Segment / Transport Protocol Data Unit

6

2/28/2024

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

/skit.org.in

/skit.org.in

/skit.org.in

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

2/28/2024

6

7 of 39

Berkeley Sockets

7

2/28/2024

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

/skit.org.in

/skit.org.in

/skit.org.in

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

2/28/2024

7

8 of 39

Berkeley Sockets

8

2/28/2024

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

/skit.org.in

/skit.org.in

/skit.org.in

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

2/28/2024

8

9 of 39

ELEMENTS OF TRANSPORT PROTOCOLS

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

9

2/28/2024

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

/skit.org.in

/skit.org.in

/skit.org.in

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

2/28/2024

9

10 of 39

Addressing

  • The method used to define transport addresses to which processes can listen for connection requests are called ports.

• Generic term

    • TSAP (Transport Service Access Point) to mean a specific endpoint in the transport layer.
    • Endpoints in the network layer are called NSAPs (Network Service Access Points).

• Application processes, both clients and servers, can attach themselves to a local TSAP to establish a connection to a remote TSAP

10

2/28/2024

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

/skit.org.in

/skit.org.in

/skit.org.in

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

2/28/2024

10

11 of 39

Addressing- Portmapper.

  • Stable TSAP addresses
    • For example mail server is found on TCP port 25.
    • work for a small number of key services that never change
  • Portmapper
    • find the TSAP address corresponding to a given service name, a user sets up a connection to the portmapper (which listens to a well-known TSAP).
    • The user then sends a message specifying the service name, and the portmapper sends back the TSAP address.
    • Then user releases the connection with the portmapper and establishes a new one with the desired service.
    • In this model, when a new service is created, it must register itself with the portmapper, giving both its service name and its TSAP. It records this information in its internal database
    • Analogous to Telephone directory

11

2/28/2024

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

/skit.org.in

/skit.org.in

/skit.org.in

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

2/28/2024

11

12 of 39

inetd versus Initial connection protocol

  • Initial connection protocol
  • Inetd - every conceivable server listening at a well-known TSAP, each machine that wishes to offer services to remote users has a special process server that acts as a proxy for less heavily used servers.
  • This server listens to a set of ports at the same time, waiting for a connection request.
  • Potential users of a service begin by doing a CONNECT request, specifying the TSAP address of the service they want. If no server is waiting for them, they get a connection to the process server

12

2/28/2024

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

/skit.org.in

/skit.org.in

/skit.org.in

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

2/28/2024

12

13 of 39

Connection Establishment: Packet lifetime

  • It can be set to a known maximum
  • 3 techniques:
    • Restricted subnet design
    • Putting a hop counter in each packet
    • Time stamping in each packet

13

2/28/2024

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

/skit.org.in

/skit.org.in

/skit.org.in

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

2/28/2024

13

14 of 39

Connection Establishment

  • Uses a 3-way handshake
    • It includes any method that prevents packets from looping, combined with some way of bounding delay including congestion over the longest possible path.
    • It is difficult, given that internets may range from a single city to international in scope.

14

2/28/2024

Normal operation

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

/skit.org.in

/skit.org.in

/skit.org.in

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

2/28/2024

14

15 of 39

Connection Establishment – delayed packet

second method consists of having the

    • hop count initialized to some appropriate value and
    • decremented each time the packet is forwarded.
    • IP discards any packet whose hop counter is zero.

15

2/28/2024

Old duplicate CONNECTION REQUEST appearing out of nowhere

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

/skit.org.in

/skit.org.in

/skit.org.in

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

2/28/2024

15

16 of 39

Connection Establishment- delayed request & reply

Third method requires each packet to bear the time it was created, with the routers agreeing to discard any packet older than some agreed-upon time.

16

2/28/2024

Duplicate CONNECTION REQUEST and duplicate ACK

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

/skit.org.in

/skit.org.in

/skit.org.in

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

2/28/2024

16

17 of 39

Connection Release

17

2/28/2024

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

/skit.org.in

/skit.org.in

/skit.org.in

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

2/28/2024

17

18 of 39

18

2/28/2024

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

/skit.org.in

/skit.org.in

/skit.org.in

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

2/28/2024

18

19 of 39

FLOW CONTROL AND BUFFERING

  • It is done by sliding window on each connection to keep a fast transmitter from over running a slow receiver.
  • Buffering is done at sender.
    • The sender buffers all the TPDUs sent to the receiver.
  • Buffer size varies for different TPDUs. They are:
    • Chained Fixed-size Buffers
    • Chained Variable-size Buffers
    • One large Circular Buffer per Connection

19

2/28/2024

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

/skit.org.in

/skit.org.in

/skit.org.in

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

2/28/2024

19

20 of 39

Chained Fixed-size Buffers v/s Chained Variable-size Buffers

Chained Fixed-size Buffers: If most TPDUs are nearly the same size, the buffers are organized as a pool of identical size buffers, with one TPDU per buffer.

Chained Variable-size Buffers: This is an approach to the buffer-size problem. i.e., if there is wide variation in TPDU size, from a few characters typed at a terminal to thousands of characters from file transfers, some problems may occur:

  • If the buffer size is chosen equal to the largest possible TPDU, space will be wasted whenever a short TPDU arrives.
  • If the buffer size is chosen less than the maximum TPDU size, multiple buffers will be needed for long TPDUs. To overcome these problems, we employ variable-size buffers.

20

2/28/2024

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

/skit.org.in

/skit.org.in

/skit.org.in

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

2/28/2024

20

21 of 39

Circular Buffer per Connection

A single large circular buffer per connection is dedicated when all connections are heavily loaded.

    • Source Buffering is used for low band width bursty traffic
    • Destination Buffering is used for high band width smooth traffic.
    • Dynamic Buffering is used if the traffic pattern changes randomly.

21

2/28/2024

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

/skit.org.in

/skit.org.in

/skit.org.in

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

2/28/2024

21

22 of 39

MULTIPLEXING

22

2/28/2024

  • Up-Ward Multiplexing.

it is up to the transport layer to group port connections according to their destination and map each group onto the minimum number of port connections.

  • Down-Ward Multiplexing/inverse multiplexing
    • If too many transport connections are mapped onto the one network connection, the performance will be poor.

.

    • If too few transport connections are mapped onto one network connection, the service will be expensive.
    • The possible solution is to have the transport layer open multiple connections and distribute the traffic among them on round-robin basis

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

/skit.org.in

/skit.org.in

/skit.org.in

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

2/28/2024

22

23 of 39

Crash Recovery

Problem from host crashes?

  • Clients want to continue working when servers crash and then quickly reboot.
  • Eg. let us assume that one host, the client, is sending a long file to another host, the file server, using a simple stop-and-wait protocol.
  • The transport layer on the server simply passes the incoming TPDUs to the transport user, one by one. Partway through the transmission, the server crashes.
  • When it comes back up, its tables are reinitialized, so it no longer knows precisely where it was

23

2/28/2024

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

/skit.org.in

/skit.org.in

/skit.org.in

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

2/28/2024

23

24 of 39

Crash Recovery

  • In an attempt to recover its previous status, the server might send a broadcast TPDU to all other hosts, announcing that it had just crashed and requesting that its clients inform it of the status of all open connections.
  • Each client can be in one of two states:
    • One TPDU outstanding, S1, or
    • no TPDUs outstanding, S0.
  • Based on only this state information, the client must decide whether to retransmit the most recent TPDU.
  • At first glance it would seem obvious: the client should retransmit only if and only if it has an unacknowledged TPDU outstanding (i.e., is in state S1) when it learns of the crash.

24

2/28/2024

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

/skit.org.in

/skit.org.in

/skit.org.in

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

2/28/2024

24

25 of 39

25

2/28/2024

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

/skit.org.in

/skit.org.in

/skit.org.in

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

2/28/2024

25

26 of 39

CONGESTION CONTROL

  • Transport entities on many machines send too many packets into the network too quickly, the network will become congested
    • performance degrades due to delayed/lost packet.

26

2/28/2024

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

/skit.org.in

/skit.org.in

/skit.org.in

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

2/28/2024

26

27 of 39

Goals of congestion control

Desirable Bandwidth Allocation

  1. Efficiency and Power
    • goodput (or rate of useful packets arriving at the receiver)

power =delay / load

27

2/28/2024

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

/skit.org.in

/skit.org.in

/skit.org.in

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

2/28/2024

27

28 of 39

2. Max-Min Fairness

An allocation is max-min fair if the bandwidth given to one flow cannot be increased without decreasing the bandwidth given to another flow with an allocation that is no larger.

28

2/28/2024

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

/skit.org.in

/skit.org.in

/skit.org.in

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

2/28/2024

28

29 of 39

3. Convergence

  • A good congestion control algorithm should rapidly converge to the ideal operating point, and it should track that point as it changes over time.

29

2/28/2024

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

/skit.org.in

/skit.org.in

/skit.org.in

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

2/28/2024

29

30 of 39

Regulating the Sending Rate

The sending rate may be limited by 2 factors.

    • Flow control - there is insufficient buffering at the receiver.
    • Congestion - there is insufficient capacity in the network.

The way in which the rates are increased or decreased is given by a control law.

    • AIMD (Additive Increase Multiplicative Decrease)

30

2/28/2024

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

/skit.org.in

/skit.org.in

/skit.org.in

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

2/28/2024

30

31 of 39

THE INTERNET TRANSPORT PROTOCOLS

  • connectionless protocol - UDP
  • connection oriented – TCP

UDP header

31

2/28/2024

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

/skit.org.in

/skit.org.in

/skit.org.in

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

2/28/2024

31

32 of 39

The IPv4 pseudoheader included in the UDP checksum

32

2/28/2024

 

Source address

 

Destination address

 

0 0 0 0 0 0 0 0

 Protocol = 17

 

UDP length

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

/skit.org.in

/skit.org.in

/skit.org.in

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

2/28/2024

32

33 of 39

REMOTE PROCEDURE CALL

33

2/28/2024

  • RPC is used to call remote programs using the procedural call.
  • Information can be transported from the caller to the callee in the parameters and can come back in the procedure result.
  • No message passing is visible to the application programmer

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

/skit.org.in

/skit.org.in

/skit.org.in

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

2/28/2024

33

34 of 39

TCP-Transmission Control Protocol

  • Provides reliable data transfer(connection oriented service)
  • The different issues to be considered are:
    • The TCP Service Model
    • The TCP Protocol
    • The TCP Segment Header
    • The Connection Management
    • TCP Transmission Policy
    • TCP Congestion Control
    • TCP Timer Management.

34

2/28/2024

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

/skit.org.in

/skit.org.in

/skit.org.in

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

2/28/2024

34

35 of 39

The TCP Service Model

  • Sender and receiver create end points called SOCKETS
  • Each socket has a socket number(address)consisting of the IP address of the host, called a “PORT” (= TSAP )
  • To obtain TCP service a connection must be explicitly established between a socket on the sending machine and a socket on the receiving machine
  • All TCP connections are full duplex and point to point
  • A TCP connection is a byte stream the data is delivered as chunks.

35

2/28/2024

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

/skit.org.in

/skit.org.in

/skit.org.in

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

2/28/2024

35

36 of 39

The TCP Protocol

  • Every byte on a TCP connection has its own 32-bit sequence number.
  • The basic protocol used by TCP entities is sliding window protocol.
  • When a sender transmits a segment, it also starts a timer.
  • When the segment arrives at the destination, the receiving TCP entity sends back acknowledgement number equal to the next sequence number it expects to receive.
  • If the sender's timer goes off before the acknowledgement is received, the sender transmits the segment again.

36

2/28/2024

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

/skit.org.in

/skit.org.in

/skit.org.in

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

2/28/2024

36

37 of 39

The TCP Segment Header

37

2/28/2024

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

/skit.org.in

/skit.org.in

/skit.org.in

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

2/28/2024

37

38 of 39

TCP Connection Establishment

38

2/28/2024

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

/skit.org.in

/skit.org.in

/skit.org.in

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

2/28/2024

38

39 of 39

TCP Connection Release

  • Each simplex connection is released independently of its sibling.
  • To release a connection, either party can send a TCP segment with the FIN bit set, which means that it has no more data to transmit. When the FIN is acknowledged, that direction is shut down for new data. Data may continue to flow indefinitely in the other direction, however.
  • When both directions have been shut down, the connection is released.
  • Normally, four TCP segments are needed to release a connection, one FIN and one ACK for each direction. However, it is possible for the first ACK and the second FIN to be contained in the same segment, reducing the total count to three.

39

2/28/2024

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

/skit.org.in

/skit.org.in

/skit.org.in

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

2/28/2024

39