CN UNIT-III

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 17

UNIT-III

SYLLABUS:
Transport Layer: Introduction and Transport-Layer Services,
Multiplexing and De-multiplexing, Connectionless Transport: UDP,
Principles of Reliable Data transfer, Connection-Oriented Transport:
TCP, Principles of Congestion Control, TCP Congestion Control
Introduction:
 It Is the 4TH Layer in OSI Reference Model
 The Transport Layer is regarded as the highest of the
lower layer protocols in the OSI protocol stack.
 The Transport layer provides the means to establish, maintain,
and release transport connections on behalf of session entities.
 It provides reliable end-to-end data transport.
 The transport layer protocols are implemented in the end
systems but not in the network routers.
 A computer network provides more than one protocol to the
network applications. For example, TCP and UDP are two
transport layer protocols that provide a different set of services
to the network layer.
 All transport layer protocols provide multiplexing/DE
multiplexing service. It also provides other services such as
reliable data transfer, bandwidth guarantees, and delay
guarantees.

Transport layer Services:


 The services provided by the transport layer are similar to those
of the data link layer.
 The data link layer provides the services within a single network
while the transport layer provides the services across an
internetwork made up of many networks.
 The data link layer controls the physical layer while the
transport layer controls all the lower layers.
The services provided by the transport layer protocols can be
divided into five categories:

o End-to-end delivery
o Addressing
o Reliable delivery
o Flow control
o Multiplexing

End-to-end delivery:

The transport layer transmits the entire message to the destination.


Therefore, it ensures the end-to-end delivery of an entire message
from a source to the destination.

Addressing:

Transport Layer header includes service point address which is port


address. This layer gets the message to the correct process on the
computer unlike Network Layer, which gets each packet to the
correct computer.

Reliable delivery:

The transport layer provides reliability services by retransmitting the


lost and damaged packets.
The reliable delivery has four aspects:

o Error control
o Sequence control
o Loss control
o Duplication control

Error Control

o The primary role of reliability is Error Control. In reality, no


transmission will be 100 percent error-free delivery. Therefore,
transport layer protocols are designed to provide error-free
transmission.

Sequence Control

o The second aspect of the reliability is sequence control, which is


implemented at the transport layer.
o On the sending end, the transport layer is responsible for
ensuring that the lower layers can use the packets received from
the upper layers.

Loss Control

Loss Control is a third aspect of reliability. The transport layer


ensures that all the fragments of a transmission arrive at the
destination, not some of them.
Duplication Control

Duplication Control is the fourth aspect of reliability. The transport


layer guarantees that no duplicate data arrive at the destination.
Sequence numbers are used to identify the lost packets; similarly, it
allows the receiver to identify and discard duplicate segments.

Flow Control:

In this layer, flow control is performed end to end.

Design Issues with Transport Layer


 Accepting data from Session layer, split it into segments and
send to the network layer.
 Ensure correct delivery of data with efficiency.
 Isolate upper layers from the technological changes.
 Error control and flow control.

Multiplexing & De-Multiplexing:

 Multiplexing is a process that allows multiple signals to travel


simultaneously over a single communication channel or path.
Multiplexing in computer networks increases the amount of
data that can be transmitted in a given time over a given
bandwidth.
 Multiplexing divides a given path logically into several short
paths and then uses each path to transmit the data of an
individual node. The following image shows an example of this
concept.
Fig: Multiplexing & De-Multiplexing

 In multiplexing, two devices are mainly used;


a multiplexer and a DE multiplexer. Both devices work on
both ends of the path. A multiplexer works on the transmitting
side and a DE multiplexer works on the receiving side.
 A multiplexer merges signals of all nodes and loads them on the
medium/path. When these signals arrive at the DE multiplexer,
the DE multiplexer separates all the signals and passes them to
their respective nodes.
 There are several types of multiplexing, depending on the
technique used to merge signals. Some common and most
widely used techniques are explained below.

Figure – Abstract view of multiplexing and DE multiplexing


Multiplexer DE multiplexer

Multiplexer processes the digital DE multiplexer receives digital


information from various sources information from a single source and
into a single source. converts it into several sources

It is known as Data Selector It is known as Data Distributor

Multiplexer is a digital switch DE multiplexer is a digital circuit

It follows combinational logic type It also follows combinational logic type

It has n data input It has single data input

It has a single data output It has n data outputs

It works on many to one It works on one to many operational


operational principle principle

In time division Multiplexing,


multiplexer is used at the In time division Multiplexing, DE
transmitter end multiplexer is used at the receiver end

Connectionless Transport (UDP):

UDP (User Datagram Protocol) is a communications protocol that is


primarily used for establishing low-latency and loss-tolerating
connections between applications on the internet. It speeds up
transmissions by enabling the transfer of data before the receiving
party provides an agreement.
Features:
 UDP is used when acknowledgement of data does not hold any
significance.
 UDP is good protocol for data flowing in one direction.
 UDP is simple and suitable for query based communications.
 UDP is not connection oriented.
 UDP does not provide congestion control mechanism.
 UDP does not guarantee ordered delivery of data.
 UDP is stateless.
 UDP is suitable protocol for streaming applications such as
VoIP, multimedia streaming

UDP Header:
UDP header is as simple as its function.

UDP header contains four main parameters:


 Source Port - This 16 bits information is used to identify the source port
of the packet.
 Destination Port - This 16 bits information, is used identify application
level service on destination machine.
 Length - Length field specifies the entire length of UDP packet (including
header). It is 16-bits field and minimum value is 8-byte, i.e. the size of
UDP header itself.
 Checksum - This field stores the checksum value generated by the
sender before sending. IPv4 has this field as optional so when checksum
field does not contain any value it is made 0 and all its bits are set to zero.
UDP application
Here are few applications where UDP is used to transmit data:
 Domain Name Services
 Simple Network Management Protocol
 Trivial File Transfer Protocol
 Routing Information Protocol
 Kerberos
Connection Oriented Transport (TCP):
The transmission Control Protocol (TCP) is one of the most
important protocols of Internet Protocols suite. It is most widely
used protocol for data transmission in communication network such
as internet.
Working of TCP:
In TCP, the connection is established by using three-way handshaking. The
client sends the segment with its sequence number. The server, in return, sends
its segment with its own sequence number as well as the acknowledgement
sequence, which is one more than the client sequence number. When the client
receives the acknowledgment of its segment, then it sends the acknowledgment
to the server. In this way, the connection is established between the client and
the server.
Features

 TCP is reliable protocol. That is, the receiver always sends


either positive or negative acknowledgement about the data
packet to the sender, so that the sender always has bright clue
about whether the data packet is reached the destination or it
needs to resend it.
 TCP ensures that the data reaches intended destination in the
same order it was sent.
 TCP is connection oriented. TCP requires that connection
between two remote points be established before sending
actual data.
 TCP provides error checking and recovery mechanism.
 TCP provides end-to-end communication.
 TCP provides flow control and quality of service.
 TCP operates in Client/Server point-to-point mode.
 TCP provides full duplex server, i.e. it can perform roles of both
receiver and sender.
 The segment consists of a header of 20 to 60 bytes, followed by
data from the Application.


 Source Port (16-bits) - It identifies source port of the application
process on the sending device.
 Destination Port (16-bits) - It identifies destination port of the
application process on the receiving device.
 Sequence Number (32-bits) - Sequence number of data bytes of a
segment in a session.
 Acknowledgement Number (32-bits) - When ACK flag is set, this
number contains the next sequence number of the data byte expected
and works as acknowledgement of the previous data received.
 Data Offset (4-bits) - This field implies both, the size of TCP header (32-
bit words)
 Reserved (3-bits) - Reserved for future use and all are set zero by
default.
 Flags (1-bit each)
 Windows Size - This field is used for flow control between two stations
and indicates the amount of buffer (in bytes) the receiver has allocated
for a segment, i.e. how much data is the receiver expecting.
 Checksum - This field contains the checksum of Header, Data and
Pseudo Headers.
 Urgent Pointer - It points to the urgent data byte if URG flag is set to 1.
 Options - It facilitates additional options which are not covered by the
regular header. Option field is always described in 32-bit words
Differences between TCP & UDP:
BASIS FOR COMPARISON
TCP UDP
Meaning TCP establishes UDP sends the data directly
connection between to the destination computer
the computers without checking whether
before transmitting the system is ready to
the data receive or not
Expands to Transmission User Datagram Protocol
Control Protocol
Connection Type Connection Oriented Connection Less
BASIS FOR COMPARISON
TCP UDP
Speed Slow Fast
Reliability Highly Reliable Unreliable
Header Size 20 Bytes 8 Bytes
Acknowledgement It takes It neither takes
acknowledgement of acknowledgement nor it re
data and has the transmits the lost data.
ability to re transmit,
if the user requests.

(Or)
Differences between TCP/UDP:

TCP UDP
Transmission Control Protocol User Datagram Protocol
Reliable Unreliable
Connection-oriented Connectionless
Segment retransmission and flow No windowing or
control through windowing retransmission
Segment sequencing No sequencing
Acknowledge sequencing No acknowledgment
Slow Fast
Highly Reliable Unreliable
20 Bytes 8 Bytes

Applications that use TCP:

1. HTTP
2. FTP
3. Telnet
4. SMTP, POP3
Port Transport
Service name
Number protocol

20, 21 File Transfer Protocol (FTP) TCP

22 Secure Shell (SSH) TCP and UDP

23 Telnet TCP

25 Simple Mail Transfer Protocol (SMTP) TCP

50, 51 IPSec

53 Domain Name System (DNS) TCP and UDP

67, 68 Dynamic Host Configuration Protocol (DHCP) UDP

69 Trivial File Transfer Protocol (TFTP) UDP

80 Hyper Text Transfer Protocol (HTTP) TCP

110 Post Office Protocol (POP3) TCP

119 Network News Transport Protocol (NNTP) TCP

123 Network Time Protocol (NTP) UDP

135-139 NetBIOS TCP and UDP

143 Internet Message Access Protocol (IMAP4) TCP and UDP

161, 162 Simple Network Management Protocol (SNMP) TCP and UDP

389 Lightweight Directory Access Protocol TCP and UDP

443 HTTP with Secure Sockets Layer (SSL) TCP and UDP

989, 990 FTP over SSL/TLS (implicit mode) TCP

TCP and
3389 Remote Desktop Protocol
UDP
Principles of Reliable Data Transfer:
 Transport Layer Protocols are central piece of layered
architectures, these provides the logical communication
between application processes.
 These processes uses the logical communication to transfer data
from transport layer to network layer and this transfer of data
should be reliable and secure.
 The data is transferred in the form of packets but the problem
occurs in reliable transfer of data.
For example, TCP (Transmission Control Protocol) is a reliable data
transfer protocol that is implemented on top of an unreliable layer, i.e.,
Internet Protocol (IP) is an end to end network layer protocol.

Figure: Study of Reliable Data Transfer

In this model, we have design the sender and receiver sides of a


protocol over a reliable channel. In the reliable transfer of data the
layer receives, the data from the above layer breaks the message in
the form of segment and put the header on each segment and
transfer. Below layer receives the segments, remove the header from
each segment, and make it a packet by adding to header.
Figure: Study of Unreliable Data Transfer

Similarly, in an unreliable channel we have design the sending and


receiving side. The sending side of the protocol is called from the
above layer to rdt_send() then it will pass the data that is to be
delivered to the application layer at the receiving side (here rdt-
send() is a function for sending data where rdt stands for reliable
data transfer protocol and _send() is used for the sending side).
Principles of congestion control:
A state occurring in network layer when the message traffic is so
heavy that it slows down network response time.
Effects of Congestion
 As delay increases, performance decreases.
 If delay increases, retransmission occurs, making situation worse.
Congestion control algorithms

1. Leaky Bucket Algorithm


2. Token bucket Algorithm

1. Leaky Bucket Algorithm:

Let us consider an example to understand

Imagine a bucket with a small hole in the bottom. No matter at what


rate water enters the bucket, the outflow is at constant rate. When
the bucket is full with water additional water entering spills over the
sides and is lost.

Similarly, each network interface contains a leaky bucket and the


following steps are involved in leaky bucket algorithm:
1. When host wants to send packet, packet is thrown into the
bucket.
2. The bucket leaks at a constant rate, meaning the network
interface transmits packets at a constant rate.
3. Bursty traffic is converted to a uniform traffic by the leaky bucket.
4. In practice, the bucket is a finite queue that outputs at a finite rate.
2. Token bucket Algorithm:

Need of token bucket Algorithm:-

The leaky bucket algorithm enforces output pattern at the average


rate, no matter how bursty the traffic is. So in order to deal with the
bursty traffic we need a flexible algorithm so that the data is not lost.
One such algorithm is token bucket algorithm.

Steps of this algorithm can be described as follows:


1. In regular intervals tokens are thrown into the bucket. ƒ
2. The bucket has a maximum capacity. ƒ
3. If there is a ready packet, a token is removed from the bucket, and
the packet is sent.
4. If there is no token in the bucket, the packet cannot be sent.
Let’s understand with an example,
In figure (A) we see a bucket holding three tokens, with five packets
waiting to be transmitted. For a packet to be transmitted, it must
capture and destroy one token. In figure (B) We see that three of the
five packets have gotten through, but the other two are stuck waiting
for more tokens to be generated.

Ways in which token bucket is superior to leaky bucket:


The leaky bucket algorithm controls the rate at which the packets
are introduced in the network, but it is very conservative in nature.
Some flexibility is introduced in the token bucket algorithm. In the
token bucket, algorithm tokens are generated at each tick (up to a
certain limit). For an incoming packet to be transmitted, it must
capture a token and the transmission takes place at the same rate.
Hence some of the busty packets are transmitted at the same rate if
tokens are available and thus introduces some amount of flexibility
in the system.
Formula:

M*s=C+ρ*s
where
S – is time taken
M – Maximum output rate
ρ – Token arrival rate
C – Capacity of the token bucket in byte
Let’s understand with an Example,

You might also like