0% found this document useful (0 votes)
63 views

Transport Layer

This document discusses the transport layer in computer networks. It covers several key topics: - The transport layer provides reliable and cost-effective data transport between source and destination machines independently of the physical network. - The transport layer aims to provide efficient, reliable, and cost-effective service to applications. It uses services from the network layer to achieve this goal. - Transport protocols implement transport services and address issues like connection establishment, flow control, multiplexing, and error handling. Well-known transport protocols are TCP and UDP.

Uploaded by

Learn Up
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
63 views

Transport Layer

This document discusses the transport layer in computer networks. It covers several key topics: - The transport layer provides reliable and cost-effective data transport between source and destination machines independently of the physical network. - The transport layer aims to provide efficient, reliable, and cost-effective service to applications. It uses services from the network layer to achieve this goal. - Transport protocols implement transport services and address issues like connection establishment, flow control, multiplexing, and error handling. Well-known transport protocols are TCP and UDP.

Uploaded by

Learn Up
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 64

Computer Networks

(IT-503)

By: Jigyasu Dubey


Department of Information
Technology
The Transport Layer
 Heart of the whole protocol hierarchy
 To provide reliable, cost-effective data transport
from the source machine to the destination
machine
 Independent of physical network

16/11/2014 Computer Networks(IT 503) SVITS, Indore 3


The Transport Service

• Services Provided to the Upper Layers


• Transport Service Primitives

16/11/2014 Computer Networks(IT 503) SVITS, Indore 4


Services Provided to the Upper Layers

 The ultimate goal of the transport layer is to


provide
 Efficient
 Reliable

 Cost-effective service

to its user, normally processes in the application layer.

To achieve this goal, the TL makes use of the services


provided by the Network Layer.

16/11/2014 Computer Networks(IT 503) SVITS, Indore 5


 The H/W or S/W within the TL that does work is
called the Transport Entity.
 The transport entity can be located in the
Operating system kernel, in a separate user
process, in a library package bound into network
applications

16/11/2014 Computer Networks(IT 503) SVITS, Indore 6


Services Provided to the Upper Layers

The network, transport, and application layers.

16/11/2014 Computer Networks(IT 503) SVITS, Indore 7


 There are two types of transport
services
 Connection oriented
 Connectionless

16/11/2014 Computer Networks(IT 503) SVITS, Indore 8


 The existence of the transport layer makes it
possible for the transport service to be more
reliable than the underlying network service
 Lost packets can be detected and compensated for
by the transport layer
 Transport service primitives can be implemented
as calls to library procedure

16/11/2014 Computer Networks(IT 503) SVITS, Indore 9


 N/W service calls may vary considerably from
N/W to N/W.
 Hiding N/W services behind an set of transport
service primitives
 Application programmer can write code
according to a standard set of primitives

16/11/2014 Computer Networks(IT 503) SVITS, Indore 10


 In the real world it fulfills the key
function of isolating the upper layers
from the technology, design and
imperfections of the subnet.

16/11/2014 Computer Networks(IT 503) SVITS, Indore 11


Transport Service Primitives

The primitives for a simple transport service.

16/11/2014 Computer Networks(IT 503) SVITS, Indore 12


Transport Service Primitives (2)

The nesting of TPDUs, packets, and frames.

16/11/2014 Computer Networks(IT 503) SVITS, Indore 13


Elements of Transport Protocols
• Addressing
• Connection Establishment
• Connection Release
• Flow Control and Buffering
• Multiplexing
• Crash Recovery

16/11/2014 Computer Networks(IT 503) SVITS, Indore 14


 The transport service is implemented by a
transport protocol used between the two transport
entities.
 In some ways, transport protocols look like the
data link protocols.
 Both have to deal with error control, sequencing
and flow control

16/11/2014 Computer Networks(IT 503) SVITS, Indore 15


Transport Protocol

(a) Environment of the data link layer.


(b) Environment of the transport layer.

16/11/2014 Computer Networks(IT 503) SVITS, Indore 16


Addressing

TSAPs, NSAPs and transport connections.


16/11/2014 Computer Networks(IT 503) SVITS, Indore 17
Connection Establishment

How a user process in host 1 establishes a connection


with a time-of-day server in host 2.

16/11/2014 Computer Networks(IT 503) SVITS, Indore 18


Connection Establishment

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.

16/11/2014 Computer Networks(IT 503) SVITS, Indore 19


(c) Duplicate CONNECTION REQUEST and duplicate ACK

16/11/2014 Computer Networks(IT 503) SVITS, Indore 20


Connection Release

 Easier than establishing one


 Two styles:
 Asymmetric release – like telephone system works
 Symmetric release – treats the connection as two
separate unidirectional connections
 Require each one to be released separately

Asymmetric release is abrupt and may


result in data loss.

16/11/2014 Computer Networks(IT 503) SVITS, Indore 21


Connection Release

Abrupt disconnection with loss of data.


16/11/2014 Computer Networks(IT 503) SVITS, Indore 22
Connection Release
 A more sophisticated release protocol is needed to
avoid data loss

 One way – use Symmetric Release


 Each direction is released independently of other one
 A host can continue to receive data even after it has
sent a DR

This protocol does not always work.

16/11/2014 Computer Networks(IT 503) SVITS, Indore 23


Connection Release

The two army problem


16/11/2014 Computer Networks(IT 503) SVITS, Indore 24
Connection Release (3)

6-14, a, b

Four protocol scenarios for releasing a connection. (a) Normal case of a


three-way handshake. (b) final ACK lost.

16/11/2014 Computer Networks(IT 503) SVITS, Indore 25


Connection Release (4)

6-14, c,d

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

16/11/2014 Computer Networks(IT 503) SVITS, Indore 26


Flow Control and Buffering

(a) Chained fixed-size buffers. (b) Chained variable-sized buffers.


(c) One large circular buffer per connection.
16/11/2014 Computer Networks(IT 503) SVITS, Indore 27
Buffer Size
 If most TPDUs are nearly the same size
 Organize buffers as a pool of identical size buffers
 With one TPDU per buffer
 If there is a wide variation in TPDU size
 A pool of fixed size buffer presents problem
 Size is chosen equal to largest TPDU
 Space will be wasted when short TPDU arrives
 Size is chosen less than the Max. TPDU
 Multiple buffers needed for long TPDU

16/11/2014 Computer Networks(IT 503) SVITS, Indore 28


Buffer Size
 Second approach – use variable size buffer
 Advantage – better memory utilization
 Drawback – complicated buffer management
 Third approach – dedicate a single large circular
buffer per connection
 Good use of memory if all connections are heavily
loaded
 Poor if some connection are lightly loaded

16/11/2014 Computer Networks(IT 503) SVITS, Indore 29


Flow Control and Buffering (2)

Dynamic buffer allocation. The arrows show the direction


of transmission. An ellipsis (…) indicates a lost TPDU.
16/11/2014 Computer Networks(IT 503) SVITS, Indore 30
Multiplexing

(a) Upward multiplexing. (b) Downward


multiplexing.
16/11/2014 Computer Networks(IT 503) SVITS, Indore 31
The Internet Transport Protocols: UDP

• Introduction to UDP

16/11/2014 Computer Networks(IT 503) SVITS, Indore 32


Introduction to UDP
The UDP header.

16/11/2014 Computer Networks(IT 503) SVITS, Indore 33


The Internet Transport Protocols:
TCP

16/11/2014 Computer Networks(IT 503) SVITS, Indore 34


Introduction to TCP

 TCP – Transmission Control Protocol


 Provide a reliable end-to-end byte stream over an
unreliable internetwork.
 Formally defined in RFC 793, 1122, & 1323
 TCP must furnish reliability

16/11/2014 Computer Networks(IT 503) SVITS, Indore 35


The TCP Service Model

Some assigned ports.


Port Protocol Use
21 FTP File transfer
23 Telnet Remote login
25 SMTP E-mail
69 TFTP Trivial File Transfer Protocol
79 Finger Lookup info about a user
80 HTTP World Wide Web
110 POP-3 Remote e-mail access
119 NNTP USENET news

16/11/2014 Computer Networks(IT 503) SVITS, Indore 36


The TCP Service Model (2)

(a) Four 512-byte segments sent as separate IP datagrams.


(b) The 2048 bytes of data delivered to the application in a single
READ CALL.

16/11/2014 Computer Networks(IT 503) SVITS, Indore 37


The TCP Protocol

 Every byte on a TCP connection has its own 32-


bit seq. no.
 Sending and receiving entities exchange data in
form of segments
 TCP segment consist of a fixed 20 bytes header +
optional part followed by zero or more data bytes

16/11/2014 Computer Networks(IT 503) SVITS, Indore 38


TCP Protocol

 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, send
back a segment bearing an acknowledgement
number equal to the next seq. no. it expects to
receive
 Timer out retransmit segment again
16/11/2014 Computer Networks(IT 503) SVITS, Indore 39
TCP Segment

 Every segment begins with a fixed format, 20


byte header, may followed by header options
 After options up to 65,535 – 20 – 20 = 65,495
data bytes may follow
 Segments without any data are legal and are
commonly used for ack and ctr messages.

16/11/2014 Computer Networks(IT 503) SVITS, Indore 40


The TCP Segment Header

TCP Header.
16/11/2014 Computer Networks(IT 503) SVITS, Indore 41
The TCP Segment Header (2)

The pseudoheader included in the TCP checksum.

16/11/2014 Computer Networks(IT 503) SVITS, Indore 42


TCP Connection Establishment

6-31

(a) TCP connection establishment in the normal case.


(b) Call collision.

16/11/2014 Computer Networks(IT 503) SVITS, Indore 43


TCP Transmission Policy

 Window management in TCP is not


directly tied to acknowledgements

16/11/2014 Computer Networks(IT 503) SVITS, Indore 44


Window management in TCP

16/11/2014 Computer Networks(IT 503) SVITS, Indore 45


Window management in TCP
 Window is 0, sender may not normally send
segments
 Two exceptions:-
 Urgent data may be sent
 Sender may send a 1-byte segment to make receiver
reannounce the next byte expected and window size
TCP provides this option to prevent
deadlock if a window announcement ever
gets lost.

16/11/2014 Computer Networks(IT 503) SVITS, Indore 46


Window management in TCP

 Senders are not required to transmit data as soon


as they come in from application
 Neither are receivers required to send ack ASAP

 This freedom can be exploited to improve


performance

16/11/2014 Computer Networks(IT 503) SVITS, Indore 47


Nagle’s Algorithm
 When data come into sender 1-byte at a time
 Just send first byte and buffer all the rest untill the
outstanding byte is acknowledged
 Then send all buffered char in one TCP segment
 Start buffering again untill they are acknowledged
 Additionally allows a new packet to be sent if
enough data or max. segment
Widely used by TCP, but there are times
when it is better to disable it.
16/11/2014 Computer Networks(IT 503) SVITS, Indore 48
Silly Window Syndrome

 Data passed to sending TCP entity in large block


 Interactive application on receiving side reads
data 1-byte at a time

16/11/2014 Computer Networks(IT 503) SVITS, Indore 49


Silly Window Syndrome

16/11/2014 Computer Networks(IT 503) SVITS, Indore 50


Silly Window Syndrome

 Clark’s solution
 Prevent receiver from sending a window update for 1
byte
 Instead forced to wait until it has a decent amount of
space available and advertised that instead
 Receiver should not send a window update until it can
handle maximum segment size it advertised when
connection established or its buffer is half empty,
whichever is smaller

16/11/2014 Computer Networks(IT 503) SVITS, Indore 51


Silly Window Syndrome

 Clark’s solution
 Sender can also help by not sending tiny segments
 It should try to wait until it has accumulated enough
space in window to send a full segment or at least one
containing half of the receiver’s buffer size

16/11/2014 Computer Networks(IT 503) SVITS, Indore 52


 Nagle’s and Clark’s solution to SWS are
complementry
 Nagle try to solve the problem caused by sending
application delivering data to TCP 1-byte at a
time
 Clark try to solve problem of receiving
application sucking data up from TCP 1-byte at a
time

16/11/2014 Computer Networks(IT 503) SVITS, Indore 53


 Both solutions are valid and can work together
 The goal is for sender not to send small segments
and the receiver not to ask for them

16/11/2014 Computer Networks(IT 503) SVITS, Indore 54


TCP Congestion Control

(a) A fast network feeding a low capacity receiver.


(b) A slow network feeding a high-capacity receiver.
16/11/2014 Computer Networks(IT 503) SVITS, Indore 55
Performance Problems in Computer Networks

The state of transmitting one megabit from San Diego to


Boston
(a) At t = 0, (b) After 500 μsec, (c) After 20 msec, (d) after 40
msec.
16/11/2014 Computer Networks(IT 503) SVITS, Indore 56
Network Performance Measurement

The basic loop for improving network


performance.
 Measure relevant network parameters,
performance.
 Try to understand what is going on.

 Change one parameter.

16/11/2014 Computer Networks(IT 503) SVITS, Indore 57


System Design for Better
Performance
Rules:
 CPU speed is more important than network speed.

 Reduce packet count to reduce software overhead.

 Minimize context switches.

 Minimize copying.

 You can buy more bandwidth but not lower delay.

 Avoiding congestion is better than recovering from it.

 Avoid timeouts.

16/11/2014 Computer Networks(IT 503) SVITS, Indore 58


System Design for Better Performance
(2)
Response as a function of load.

16/11/2014 Computer Networks(IT 503) SVITS, Indore 59


System Design for Better Performance
(3)

Four context switches to handle one packet


with a user-space network manager.

16/11/2014 Computer Networks(IT 503) SVITS, Indore 60


Fast TPDU Processing

The fast path from sender to receiver is shown with


a heavy line.
The processing steps on this path are shaded.

16/11/2014 Computer Networks(IT 503) SVITS, Indore 61


Fast TPDU Processing (2)

(a) TCP header. (b) IP header. In both cases, the shaded


fields are taken from the prototype without change.
16/11/2014 Computer Networks(IT 503) SVITS, Indore 62
Fast TPDU Processing (3)

16/11/2014
A timing wheel. 63
Computer Networks(IT 503) SVITS, Indore
Protocols for Gigabit Networks

Time to transfer and acknowledge a 1-megabit file


over a 4000-km line.
16/11/2014 Computer Networks(IT 503) SVITS, Indore 64

You might also like