0% found this document useful (0 votes)
47 views23 pages

Unit 3-1

The document discusses the transport layer of the OSI model. It describes the functions and services of the transport layer, including process-to-process communication, addressing with port numbers, encapsulation and demultiplexing. It also explains the two main transport layer protocols, TCP and UDP, and compares their differences in terms of reliability, error checking and connection-orientation.

Uploaded by

sanketmhetre018
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)
47 views23 pages

Unit 3-1

The document discusses the transport layer of the OSI model. It describes the functions and services of the transport layer, including process-to-process communication, addressing with port numbers, encapsulation and demultiplexing. It also explains the two main transport layer protocols, TCP and UDP, and compares their differences in terms of reliability, error checking and connection-orientation.

Uploaded by

sanketmhetre018
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/ 23

TRANSPORT LAYER

1. INTRODUCTION
 The transport layer is the fourth layer of the OSI model and is the core of the Internet
model.
 It responds to service requests from the session layer and issues service requests to
the network Layer.
 The transport layer provides transparent transfer of data between hosts.
 It provides end-to-end control and information transfer with the quality of service
needed by the application program.
 It is the first true end-to-end layer, implemented in all End Systems (ES).
TRANSPORT LAYER FUNCTIONS / SERVICES
 The transport layer is located between the network layer and the application layer.
 The transport layer is responsible for providing services to the application layer; it
receives services from the network layer.
 The services that can be provided by the transport layer are
1. Process-to-Process Communication
2. Addressing : Port Numbers
3. Encapsulation and Decapsulation
4. Multiplexing and Demultiplexing
5. Flow Control
6. Error Control
7. Congestion Control

Transport service primitives


A service is specified by a set of primitives. A primitive means operation. To access the
service a user process can access these primitives. These primitives are different for
connection oriented service and connectionless service.
There are five types of service primitives:

1. LISTEN : When a server is ready to accept an incoming connection it executes the


LISTEN primitive. It blocks waiting for an incoming connection.
2. CONNECT : It connects the server by establishing a connection. Response is
awaited.
3. RECIEVE: Then the RECIEVE call blocks the server.
4. SEND : Then the client executes SEND primitive to transmit its request followed by
the execution of RECIEVE to get the reply. Send the message.
5. DISCONNECT : This primitive is used for terminating the connection. After this
primitive one can’t send any message. When the client sends DISCONNECT
packet then the server also sends the DISCONNECT packet to acknowledge the
client. When the server package is received by client then the process is
terminated.
Consider an application with a server and a number of remote clients.
a. To start with,the server executes a LISTEN primitive,typically by calling a library
procedure that makes a system call to block the server until a client turns up.
b. For lack of a better term,we will reluctantly use the somwhat ungainly acronym
TPDU(Transport Protocol Data Unit) for message sent from transport entity to
transport entity.
c. Thus,TPDUs(exchanged by the transport layer) are contained in
packets(exchanged by the network layer).
d. In turn,packets are contained in frames(exchanged by the data link layer).
e. When a frame arrives,the data link layer processes the frame header and passes
the contents of the frame payload field up to the network entity.
f. When a client wants to talk to the server, it executes a CONNECT primitive.
g. The transport entity carries out this primitives by blocking the caller and sending a
packet to the server.
i. The client’s CONNECT call causes a CONNECTION REQUEST TPDU to be sent to the
server.
j. When it arrives, the transport entity checks to see that the server is blocked on a
LISTEN.
k. It then unblocks the server and sends a CONNECTION ACCEPTED TPDU back to the
client.
l. When this TPDU arrives, the client is unblocked and the connection is established. Data
can now be exchanged using the SEND and RECEIVE primitives.
m. In the simplest form, either party can do a(blocking)RECEIVE to wait for the other party
to do a SEND. When the TPDU arrives, the receiver is unblocked.
n. It can then process the TPDU and send a reply. As long as both sides can keep track of
whose turn it is to send, this scheme works fine.
o. When a connection is no longer needed, it must be released to free up table space
within the two transport entities.

TRANSPORT LAYER PROTOCOLS


 Three protocols are associated with the Transport layer.
 They are
(1) UDP –User Datagram Protocol
(2) TCP – Transmission Control Protocol

USER DATAGRAM PROTOCOL (UDP)


Each protocol provides a different type of service and should be used appropriately.
UDP - UDP is an unreliable connectionless transport-layer protocol used for its simplicity
and efficiency in applications where error control can be provided by the application-layer
process.
User Datagram Protocol (UDP) is a connectionless, unreliable transport protocol.
 UDP adds process-to-process communication to best-effort service provided by IP.
 UDP is a very simple protocol using a minimum of overhead.
 UDP is a simple demultiplexer, which allows multiple processes on each host to
communicate.
 UDP does not provide flow control , reliable or ordered delivery.
 UDP can be used to send small message where reliability is not expected.
 Sending a small message using UDP takes much less interaction between the sender
and receiver.
 UDP allow processes to indirectly identify each other using an abstract locator called
port or mailbox

Advantages of UDP

 It does not require any connection for sending or receiving data.


 Broadcast and Multicast are available in UDP.
 UDP can operate on a large range of networks.
 UDP has live and real-time data.
 UDP can deliver data if all the components of the data are not complete.

Disadvantages of UDP

 We can not have any way to acknowledge the successful transfer of data.
 UDP cannot have the mechanism to track the sequence of data.
 UDP is connectionless, and due to this, it is unreliable to transfer data.
 In case of a Collision, UDP packets are dropped by Routers in comparison to TCP.
 UDP can drop packets in case of detection of errors.

TRANSMISSION CONTROL PROTOCOL (TCP)


TCP - TCP is a reliable connection-oriented protocol that can be used in any application
where reliability is important.
 TCP is a reliable, connection-oriented, byte-stream protocol.
 TCP guarantees the reliable, in-order delivery of a stream of bytes. It is a full-duplex
protocol, meaning that each TCP connection supports a pair of byte streams, one
flowing in each direction.
 TCP includes a flow-control mechanism for each of these byte streams that allow the
receiver to limit how much data the sender can transmit at a given time.
 TCP supports a demultiplexing mechanism that allows multiple application programs
on any given host to simultaneously carry on a conversation with their peers.
 TCP also implements congestion-control mechanism. The idea of this mechanism is
to prevent sender from overloading the network.
 Flow control is an end to end issue, whereas congestion control is concerned with
how host and network interact.

TCP (Transmission Control Protocol) is one of the main protocols of the Internet protocol suite. It lies
between the Application and Network Layers which are used in providing reliable delivery services. It is a
connection-oriented protocol for communications that helps in the exchange of messages between
different devices over a network. The Internet Protocol (IP), which establishes the technique for sending
data packets between computers, works with TCP.

Advantages of TCP

 It is reliable for maintaining a connection between Sender and Receiver.


 It is responsible for sending data in a particular sequence.
 Its operations are not dependent on OS.
 It allows and supports many routing protocols.
 It can reduce the speed of data based on the speed of the receiver.

Disadvantages of TCP

 It is slower than UDP and it takes more bandwidth.


 Slower upon starting of transfer of a file.
 Not suitable for LAN and PAN Networks.
 It does not have a multicast or broadcast category.
 It does not load the whole page if a single data of the page is missing.

Differences between TCP and UDP

The main differences between TCP (Transmission Control Protocol) and UDP (User Datagram
Protocol) are:

Transmission Control Protocol


Basis User Datagram Protocol (UDP)
(TCP)

TCP is a connection-oriented UDP is the Datagram-oriented


protocol. Connection protocol. This is because

orientation means that the there is no overhead for opening a


Type of Service communicating devices should connection, maintaining a
establish a connection before connection, or terminating a
transmitting data and should connection. UDP is efficient for
close the connection after broadcast and multicast types of
transmitting the data. network transmission.
TCP is reliable as it guarantees the The delivery of data to the
Reliability delivery of data to the destination destination cannot be guaranteed in
router. UDP.
Transmission Control Protocol
Basis User Datagram Protocol (UDP)
(TCP)

TCP provides extensive error-


checking mechanisms. UDP has only the basic error-
Error checking
checking mechanism using
mechanism It is because it provides flow checksums.
control and acknowledgment of
data.
An acknowledgment segment is
Acknowledgment No acknowledgment segment.
present.

Sequencing of data is a feature of


There is no sequencing of data in
Transmission Control
UDP. If the order is required, it has
Sequence
Protocol (TCP). this means that to be managed by the application
packets arrive in order at the layer.
receiver.
TCP is comparatively slower than UDP is faster, simpler, and more
Speed
UDP. efficient than TCP.

There is no retransmission of lost


Retransmission of lost packets is
Retransmission packets in the User Datagram
possible in TCP, but not in UDP.
Protocol (UDP).

TCP has a (20-60) bytes variable UDP has an 8 bytes fixed-length


Header Length
length header. header.

Weight TCP is heavy-weight. UDP is lightweight.

Uses handshakes such as SYN, ACK, It’s a connectionless protocol i.e. No


Handshaking Techniques
SYN-ACK handshake

Broadcasting TCP doesn’t support Broadcasting. UDP supports Broadcasting.

TCP is used by HTTP, HTTPs, FTP, UDP is used by DNS, DHCP, TFTP,
Protocols
SMTP and Telnet. SNMP, RIP, and VoIP.

The TCP connection is a byte UDP connection is a message


Stream Type
stream. stream.

Overhead Low but higher than UDP. Very low.

This protocol is primarily utilized in This protocol is used in situations


Applications situations when a safe and where quick communication is
trustworthy communication necessary but where dependability
procedure is necessary, such as in is not a concern, such as VoIP, game
Transmission Control Protocol
Basis User Datagram Protocol (UDP)
(TCP)

email, on the web surfing, and streaming, video, and music


in military services. streaming, etc.

IP address

An IP address is a unique address that identifies a device on the internet or a local network. IP
stands for "Internet Protocol," which is the set of rules governing the format of data sent via the
internet or local network.

In essence, IP addresses are the identifier that allows information to be sent between devices on a
network: they contain location information and make devices accessible for communication. The
internet needs a way to differentiate between different computers, routers, and websites. IP
addresses provide a way of doing so and form an essential part of how the internet works.

An IP address is a string of numbers separated by periods. IP addresses are expressed as a set of


four numbers — an example address might be 192.158.1.38. Each number in the set can range from
0 to 255. So, the full IP addressing range goes from 0.0.0.0 to 255.255.255.255.

IP addresses are not random. They are mathematically produced and allocated by the Internet
Assigned Numbers Authority (IANA), a division of the Internet Corporation for Assigned Names
and Numbers (ICANN). ICANN is a non-profit organization that was established in the United
States in 1998 to help maintain the security of the internet and allow it to be usable by all. Each
time anyone registers a domain on the internet, they go through a domain name registrar, who pays
a small fee to ICANN to register the domain.

Watch this video to learn what IP address is, why IP address is important and how to protect it from
hackers:

The use of IP addresses typically happens behind the scenes. The process works like this:

1. Your device indirectly connects to the internet by connecting at first to a network connected
to the internet, which then grants your device access to the internet.
2. When you are at home, that network will probably be your Internet Service Provider (ISP).
At work, it will be your company network.
3. Your IP address is assigned to your device by your ISP.
4. Your internet activity goes through the ISP, and they route it back to you, using your IP
address. Since they are giving you access to the internet, it is their role to assign an IP
address to your device.
5. However, your IP address can change. For example, turning your modem or router on or off
can change it. Or you can contact your ISP, and they can change it for you.
6. When you are out and about – for example, traveling – and you take your device with you,
your home IP address does not come with you. This is because you will be using another
network (Wi-Fi at a hotel, airport, or coffee shop, etc.) to access the internet and will be
using a different (and temporary) IP address, assigned to you by the ISP of the hotel, airport
or coffee shop.

Types of IP addresses
Private IP addresses

Every device that connects to your internet network has a private IP address. This includes
computers, smartphones, and tablets but also any Bluetooth-enabled devices like speakers, printers,
or smart TVs. With the growing internet of things, the number of private IP addresses you have at
home is probably growing. Your router needs a way to identify these items separately, and many
items need a way to recognize each other. Therefore, your router generates private IP addresses that
are unique identifiers for each device that differentiate them on the network.

Public IP addresses

A public IP address is the primary address associated with your whole network. While each
connected device has its own IP address, they are also included within the main IP address for your
network. As described above, your public IP address is provided to your router by your ISP.
Typically, ISPs have a large pool of IP addresses that they distribute to their customers. Your public
IP address is the address that all the devices outside your internet network will use to recognize
your network.

Types of IP Address

1. IPv4 (Internet Protocol Version 4)


2. IPv6 (Internet Protocol Version 6)

IPv4

IPv4 address consists of two things that are the network address and the host address. It stands for
Internet Protocol version four. It was introduced in 1981 by DARPA and was the first deployed
version in 1982 for production on SATNET and on the ARPANET in January 1983.

IPv4 addresses are 32-bit integers that have to be expressed in Decimal Notation. It is represented by
4 numbers separated by dots in the range of 0-255, which have to be converted to 0 and 1, to be
understood by Computers. For Example, An IPv4 Address can be written as 189.123.123.90.

IPv4 Address Format

IPv4 Address Format is a 32-bit Address that comprises binary digits separated by a dot (.).
IPv4 Address Format

IPv6

IPv6 is based on IPv4 and stands for Internet Protocol version 6. It was first introduced in December
1995 by Internet Engineering Task Force. IP version 6 is the new version of Internet Protocol, which
is way better than IP version 4 in terms of complexity and efficiency. IPv6 is written as a group of 8
hexadecimal numbers separated by colon (:). It can be written as 128 bits of 0s and 1s.

IPv6 Address Format

IPv6 Address Format is a 128-bit IP Address, which is written in a group of 8 hexadecimal numbers
separated by colon (:).

IPv6 Address Format

Difference Between IPv4 and IPv6


IPv4 IPv6

IPv4 has a 32-bit address length IPv6 has a 128-bit address length

It Supports Manual and DHCP address


It supports Auto and renumbering address configuration
configuration

In IPv4 end to end, connection integrity is


In IPv6 end-to-end, connection integrity is Achievable
Unachievable
IPv4 IPv6

The address space of IPv6 is quite large it can produce


It can generate 4.29×109 address space
3.4×1038 address space

The Security feature is dependent on the


IPSEC is an inbuilt security feature in the IPv6 protocol
application

Address representation of IPv4 is in decimal Address Representation of IPv6 is in hexadecimal

Fragmentation performed by Sender and


In IPv6 fragmentation is performed only by the sender
forwarding routers

In IPv4 Packet flow identification is not In IPv6 packet flow identification are Available and uses the
available flow label field in the header

In IPv4 checksum field is available In IPv6 checksum field is not available

It has a broadcast Message Transmission In IPv6 multicast and anycast message transmission
Scheme scheme is available

In IPv4 Encryption and Authentication facility In IPv6 Encryption and Authentication are provided
not provided

IPv6 has a header of 40 bytes fixed


IPv4 has a header of 20-60 bytes.

IPv4 can be converted to IPv6 Not all IPv6 can be converted to IPv4

IPv4 consists of 4 fields which are separated


IPv6 consists of 8 fields, which are separated by a colon (:)
by addresses dot (.)

IPv4’s IP addresses are divided into five


different classes. Class A , Class B, Class C, IPv6 does not have any classes of the IP address.
Class Da , Class E.

IPv4 supports VLSM(Variable Length subnet


IPv6 does not support VLSM.
mask).

Example of IPv6:
Example of IPv4: 66.94.29.13
2001:0000:3238:DFE1:0063:0000:0000:FEFB
Connection-Oriented vs Connectionless Service
S. Comparison
Connection-oriented Service Connection Less Service
No Parameter

It is designed and developed based on


1. Related System It is service based on the postal system.
the telephone system.

It is used to create an end to end


It is used to transfer the data packets
connection between the senders to the
2. Definition between senders to the receiver without
receiver before transmitting the data
creating any connection.
over the same or different network.

It does not create any virtual connection


It creates a virtual path between the
3. Virtual path or path between the sender and the
sender and the receiver.
receiver.

It requires authentication before


It does not require authentication before
4. Authentication transmitting the data packets to the
transferring data packets.
receiver.

Data Packets All data packets are received in the same Not all data packets are received in the
5.
Path order as those sent by the sender. same order as those sent by the sender.

Bandwidth It requires a higher bandwidth to transfer It requires low bandwidth to transfer the
6.
Requirement the data packets. data packets.

It is a more reliable connection service It is not a reliable connection service


because it guarantees data packets because it does not guarantee the
7. Data Reliability
transfer from one end to the other end transfer of data packets from one end to
with a connection. another for establishing a connection.

There may be congestion due to not


There is no congestion as it provides an
providing an end-to-end connection
8. Congestion end-to-end connection between sender
between the source and receiver to
and receiver during transmission of data.
transmit of data packets.
User Datagram Protocol (UDP), Internet
Transmission Control Protocol (TCP) is an
Protocol (IP), and Internet Control
9. Examples example of a connection-oriented
Message Protocol (ICMP) are examples of
service.
connectionless service.

Routing Algorithm
A routing algorithm is a procedure that lays down the route or path to transfer data packets from
source to the destination. They help in directing Internet traffic efficiently. After a data packet leaves its
source, it can choose among the many different paths to reach its destination. Routing algorithm
mathematically computes the best path, i.e. “least – cost path” that the packet can be routed through.

1. Flooding
Flooding is a non-adaptive routing technique following this simple method: when a data packet
arrives at a router, it is sent to all the outgoing links except the one it has arrived on.

For example, let us consider the network in the figure, having six routers that are connected through
transmission lines.

Using flooding technique −

 An incoming packet to A, will be sent to B, C and D.


 B will send the packet to C and E.
 C will send the packet to B, D and F.
 D will send the packet to C and F.
 E will send the packet to F.
 F will send the packet to C and E.

Advantages of Flooding

 It is very simple to setup and implement, since a router may know only its neighbours.
 It is extremely robust. Even in case of malfunctioning of a large number routers, the packets
find a way to reach the destination.
 All nodes which are directly or indirectly connected are visited. So, there are no chances for
any node to be left out. This is a main criteria in case of broadcast messages.
 The shortest path is always chosen by flooding.

Limitations of Flooding

 Flooding tends to create an infinite number of duplicate data packets, unless some measures
are adopted to damp packet generation.
 It is wasteful if a single destination needs the packet, since it delivers the data packet to all
nodes irrespective of the destination.
 The network may be clogged with unwanted and duplicate data packets. This may hamper
delivery of other data packets.

2. Distance Vector Routing (DVR) Protocol


A distance-vector routing (DVR) protocol requires that a router inform its neighbors of
topology changes periodically. Historically known as the old ARPANET routing algorithm
(or known as Bellman-Ford algorithm).
Bellman Ford Basics – Each router maintains a Distance Vector table containing the
distance between itself and ALL possible destination nodes. Distances,based on a chosen
metric, are computed using information from the neighbors’ distance vectors.

Distance Vector Algorithm –

1. A router transmits its distance vector to each of its neighbors in a routing packet.
2. Each router receives and saves the most recently received distance vector from each of its
neighbors.
3. A router recalculates its distance vector when:
o It receives a distance vector from a neighbor containing different information than
before.

Example – Consider 3-routers X, Y and Z as shown in figure. Each router have their routing table.
Every routing table will contain distance to the destination nodes.
Consider router X , X will share it routing table to neighbors and neighbors will share it routing
table to it to X.

As we can see that distance will be less going from X to Z when Y is intermediate node(hop) so it
will be update in routing table X.

Similarly for Z also –


Finally the routing table for all –

Advantages of Distance Vector routing –


 It is simpler to configure and maintain than link state routing.

Disadvantages of Distance Vector routing –

o It is slower to converge than link state.


o It is at risk from the count-to-infinity problem.
o It creates more traffic than link state since a hop count change must be propagated to
all routers and processed on each router. Hop count updates take place on a periodic
basis, even if there are no changes in the network topology, so bandwidth-wasting
broadcasts still occur.
o For larger networks, distance vector routing results in larger routing tables than link
state since each router must know about all other routers. This can also lead to
congestion on WAN links.

3.Congestion Control
What is congestion?
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 refers to the techniques used to control or prevent congestion. Congestion control
techniques can be broadly classified into two categories:

Open Loop Congestion Control


Congestion Control is a mechanism that controls the entry of data packets into the network, enabling a
better use of a shared network infrastructure and avoiding congestive collapse. Congestive-Avoidance
Algorithms (CAA) are implemented at the TCP layer as the mechanism to avoid congestive collapse in a
network.

Open loop congestion control policies are applied to prevent congestion before it happens. The
congestion control is handled either by the source or the destination.

Policies adopted by open loop congestion control –

1. Retransmission Policy :
It is the policy in which retransmission of the packets are taken care of. If the sender feels
that a sent packet is lost or corrupted, the packet needs to be retransmitted. This
transmission may increase the congestion in the network.
To prevent congestion, retransmission timers must be designed to prevent congestion and
also able to optimize efficiency.

2. Window Policy :
The type of window at the sender’s side may also affect the congestion. Several packets in
the Go-back-n window are re-sent, although some packets may be received successfully at
the receiver side. This duplication may increase the congestion in the network and make it
worse.
Therefore, Selective repeat window should be adopted as it sends the specific packet that
may have been lost.

3. Discarding Policy :
A good discarding policy adopted by the routers is that the routers may prevent congestion
and at the same time partially discard the corrupted or less sensitive packages and also be
able to maintain the quality of a message.
In case of audio file transmission, routers can discard less sensitive packets to prevent
congestion and also maintain the quality of the audio file.

4. Acknowledgment Policy :
Since acknowledgements are also the part of the load in the network, the acknowledgment
policy imposed by the receiver may also affect congestion. Several approaches can be used
to prevent congestion related to acknowledgment.
The receiver should send acknowledgement for N packets rather than sending
acknowledgement for a single packet. The receiver should send an acknowledgment only if
it has to send a packet or a timer expires.

5. Admission Policy :
In admission policy a mechanism should be used to prevent congestion. Switches in a flow
should first check the resource requirement of a network flow before transmitting it further.
If there is a chance of a congestion or there is a congestion in the network, router should
deny establishing a virtual network connection to prevent further congestion.

All the above policies are adopted to prevent congestion before it happens in the network.
Closed Loop Congestion Control

Closed loop congestion control techniques are used to treat or alleviate congestion after it happens.
Several techniques are used by different protocols; some of them are:

1. Backpressure :
Backpressure is a technique in which a congested node stops receiving packets from upstream node.
This may cause the upstream node or nodes to become congested and reject receiving data from
above nodes. Backpressure is a node-to-node congestion control technique that propagate in the
opposite direction of data flow. The backpressure technique can be applied only to virtual circuit
where each node has information of its above upstream node.

2. Choke Packet Technique :


Choke packet technique is applicable to both virtual networks as well as datagram subnets. A choke
packet is a packet sent by a node to the source to inform it of congestion. Each router monitors its
resources and the utilization at each of its output lines. Whenever the resource utilization exceeds
the threshold value which is set by the administrator, the router directly sends a choke packet to the
source giving it a feedback to reduce the traffic. The intermediate nodes through which the packets
has traveled are not warned about congestion.

3. Implicit Signaling :
In implicit signaling, there is no communication between the congested nodes and the source. The
source guesses that there is congestion in a network. For example when sender sends several
packets and there is no acknowledgment for a while, one assumption is that there is a congestion.

4. Explicit Signaling :
In explicit signaling, if a node experiences congestion it can explicitly sends a packet to the source
or destination to inform about congestion. The difference between choke packet and explicit
signaling is that the signal is included in the packets that carry data rather than creating a different
packet as in case of choke packet technique.
Explicit signaling can occur in either forward or backward direction.

 Forward Signaling : In forward signaling, a signal is sent in the direction of the


congestion. The destination is warned about congestion. The receiver in this case adopt
policies to prevent further congestion.
 Backward Signaling : In backward signaling, a signal is sent in the opposite direction of
the congestion. The source is warned about congestion and it needs to slow down.

Stop and Wait protocol


Here stop and wait means, whatever the data that sender wants to send, he sends the data to the
receiver. After sending the data, he stops and waits until he receives the acknowledgment from the
receiver. The stop and wait protocol is a flow control protocol where flow control is one of the
services of the data link layer.

It is a data-link layer protocol which is used for transmitting the data over the noiseless channels. It
provides unidirectional data transmission which means that either sending or receiving of data will
take place at a time. It provides flow-control mechanism but does not provide any error control
mechanism.

The idea behind the usage of this frame is that when the sender sends the frame then he waits for
the acknowledgment before sending the next frame.

Primitives of Stop and Wait Protocol

The primitives of stop and wait protocol are:

Sender side

Rule 1: Sender sends one data packet at a time.

Rule 2: Sender sends the next packet only when it receives the acknowledgment of the previous
packet.

Therefore, the idea of stop and wait protocol in the sender's side is very simple, i.e., send one
packet at a time, and do not send another packet before receiving the acknowledgment.

Receiver side

Rule 1: Receive and then consume the data packet.


Rule 2: When the data packet is consumed, receiver sends the acknowledgment to the sender.

Therefore, the idea of stop and wait protocol in the receiver's side is also very simple, i.e., consume
the packet, and once the packet is consumed, the acknowledgment is sent. This is known as a flow
control mechanism.

the above figure shows the working of the stop and wait protocol. If there is a sender and receiver, then
sender sends the packet and that packet is known as a data packet. The sender will not send the second
packet without receiving the acknowledgment of the first packet. The receiver sends the acknowledgment
for the data packet that it has received. Once the acknowledgment is received, the sender sends the next
packet. This process continues until all the packet are not sent. The main advantage of this protocol is its
simplicity but it has some disadvantages also. For example, if there are 1000 data packets to be sent, then
all the 1000 packets cannot be sent at a time as in Stop and Wait protocol, one packet is sent at a time.

Sliding Window Protocol


The sliding window is a technique for sending multiple frames at a time. It controls the data packets
between the two devices where reliable and gradual delivery of data frames is needed. It is also
used in TCP (Transmission Control Protocol).

In this technique, each frame has sent from the sequence number. The sequence numbers are used
to find the missing data in the receiver end. The purpose of the sliding window technique is to
avoid duplicate data, so it uses the sequence number.
Types of Sliding Window Protocol

Sliding window protocol has two types:

1. Go-Back-N ARQ
2. Selective Repeat ARQ

Go-Back-N ARQ

Go-Back-N ARQ protocol is also known as Go-Back-N Automatic Repeat Request. It is a data link
layer protocol that uses a sliding window method. In this, if any frame is corrupted or lost, all
subsequent frames have to be sent again.

The size of the sender window is N in this protocol. For example, Go-Back-8, the size of the sender
window, will be 8. The receiver window size is always 1.

If the receiver receives a corrupted frame, it cancels it. The receiver does not accept a corrupted
frame. When the timer expires, the sender sends the correct frame again. The design of the Go-
Back-N ARQ protocol is shown below.

The example of Go-Back-N ARQ is shown below in the figure.


Selective Repeat ARQ

Selective Repeat ARQ is also known as the Selective Repeat Automatic Repeat Request. It is a data
link layer protocol that uses a sliding window method. The Go-back-N ARQ protocol works well if
it has fewer errors. But if there is a lot of error in the frame, lots of bandwidth loss in sending the
frames again. So, we use the Selective Repeat ARQ protocol. In this protocol, the size of the sender
window is always equal to the size of the receiver window. The size of the sliding window is
always greater than 1.

If the receiver receives a corrupt frame, it does not directly discard it. It sends a negative
acknowledgment to the sender. The sender sends that frame again as soon as on the receiving
negative acknowledgment. There is no waiting for any time-out to send that frame. The design of
the Selective Repeat ARQ protocol is shown below.
The example of the Selective Repeat ARQ protocol is shown below in the figure.
Services Provided to Data Link Layer
The primary service of the data link layer is to support error-free transmission. The physical layer
sends the data from the sender’s hub to the receiver’s hub as raw bits. The data link layer should
recognize and correct some errors in the communicated data.

The data link layer provides a distinct connection to the network layer. It is used to handle
communication bugs, control the data stream, and manage sender and receiver inconsistency by
maintaining the multiple services. It can work these actions in the following method −

 Unacknowledged connectionless service − This contains separate frames from the source
host to the destination host without some acknowledgment structure. It does not have any
link established or launched. It does not manage with frame recovery due to channel noise.
 Acknowledged connectionless service − The transmission medium is more error-prone.
This requires acceptance service for each frame shared between two hosts to provide that
the frame has occurred correctly.
 Acknowledged connection-oriented service − This layer supports this service to the
network layer by settling a link between the source and destination hosts before any
information removal occurs.
 Framing − In this layer, it receives a raw bitstream from the physical layer that cannot be
bug-free. The data link layer divides the bitstreams into frames to provide a frequent change
of bitstreams to the network layer.
 Error Control − It includes sequencing frames and sending control frames for acceptance.
A noisy channel can avoid scanning of bits, falling bits from a frame, introducing specific
bits in the frame, frames final sinking, etc.
 Flow Control − There is another fundamental problem in the data link design to regulate
the cost of data communication between two source and destination hosts. If the conflict
among the source and destination hosts data sending and receiving speed, it will create
packets to drop at the receiver end.
 Sequence Integrity − The data link layer supports the data bits sequence and sends them to
the physical layer in the similar sequence as received from the network layer. It supports a
reliable share of data link service data unit (DLSDU) over the data link connections.

You might also like