0% found this document useful (0 votes)
16 views26 pages

CN 2

The document discusses various data link layer protocols, focusing on elementary datalink protocols such as Stop and Wait, Sliding Window, Go-Back-N ARQ, and Selective Repeat ARQ. It also covers channel allocation problems, multiple access protocols like Aloha and CSMA/CD, and introduces Wireless LANs, detailing their advantages. Each protocol is explained with its operational rules and characteristics, emphasizing their applications in data transmission.

Uploaded by

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

CN 2

The document discusses various data link layer protocols, focusing on elementary datalink protocols such as Stop and Wait, Sliding Window, Go-Back-N ARQ, and Selective Repeat ARQ. It also covers channel allocation problems, multiple access protocols like Aloha and CSMA/CD, and introduces Wireless LANs, detailing their advantages. Each protocol is explained with its operational rules and characteristics, emphasizing their applications in data transmission.

Uploaded by

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

Computer Networks

Unit 2

Prepared By
Dr.Sasikumar Perumal
Elementary Datalink Protocols
• Stop and Wait Protocol
• Before understanding the stop and Wait protocol, we first know about the error control
mechanism. The error control mechanism is used so that the received data should be exactly
same whatever sender has sent the data. The error control mechanism is divided into two
categories, i.e., Stop and Wait ARQ and sliding window. The sliding window is further divided
into two categories, i.e., Go Back N, and Selective Repeat. Based on the usage, the people
select the error control mechanism whether it is stop and wait or sliding window.
• What is 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. 2
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.
3

4
What is noiseless protocol?

It is a unidirectional protocol in which data frames are traveling in only one


direction-from the sender to receiver. The data link layer of the receiver immediately
removes the header from the frame and hands the data packet to its network layer, which
can also accept the packet immediately.

5
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.
• 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( Automatic Repeat Request)

2. Selective Repeat ARQ( Automatic Repeat Request)

6
Go-Back-N ARQ( Automatic Repeat Request)
• 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.

7
The example of Go-Back-N ARQ

8
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.

9
The example of the Selective Repeat ARQ protocol

10
Channel Allocation Problem
• Process in which a single channel is divided and allotted to multiple users in order to carry
user specific tasks.
• There are user’s quantity may vary every time the process takes place.
• If there are N number of users and channel is divided into N equal-sized sub channels,
Each user is assigned one portion.
• If the number of users are small and don’t vary at times, then Frequency Division
Multiplexing can be used as it is a simple and efficient channel bandwidth allocating
technique.
• Channel allocation problem can be solved by two schemes: Static Channel Allocation in
LANs and MANs, and Dynamic Channel Allocation.

11
These are explained as following below.
1. Static Channel Allocation in LANs and MANs:
It is the classical or traditional approach of allocating a single channel among multiple
competing users using Frequency Division Multiplexing (FDM). if there are N users, the
frequency channel is divided into N equal sized portions (bandwidth), each user being
assigned one portion. since each user has a private frequency band, there is no interference
between users.
• However, it is not suitable in case of a large number of users with variable bandwidth
requirements.
It is not efficient to divide into fixed number of chunks

2. Dynamic Channel Allocation:


• In dynamic channel allocation scheme, frequency bands are not permanently assigned to
the users. Instead channels are allotted to users dynamically as needed, from a central
pool.
• The allocation is done considering a number of parameters so that transmission
interference is minimized.
• This allocation scheme optimises bandwidth usage and results is faster transmissions.

12
Multiple Access protocols
1. Aloha

2.CSMA(Carrier Sense Multiple Access)

What is aloha?
• Aloha is designed for wireless LAN (Local Area Network) but can also be used in a shared
medium to transmit data.
• In aloha, any station can transmit data to a channel at any time.
• It does not require any carrier sensing.
• I .Pure Aloha
• Pure aloha is used when data is available for sending over a channel at stations.
• In pure Aloha, when each station transmits data to a channel without checking whether
the channel is idle or not, the chances of collision may occur, and the data frame can be
lost.
13
Frames in pure ALOHA

• When a station transmits the data frame to a


channel without checking whether the channel
is free or not, there will be a possibility of the
collision of data frames.
• Station expects the acknowledgement from
the receiver, and if the acknowledgement of
the frame is received at the specified time,
then it will be OK; otherwise, the station
assumes that the frame is destroyed.
• Then station waits for a random amount of
time, and after that, it retransmits the frame
until all the data are successfully transmitted
to the receiver.

14
Slotted Aloha
• There is a high possibility of frame hitting in pure aloha, so slotted aloha is designed to
overcome it. Unlike pure aloha, slotted aloha does not allow the transmission of data
whenever the station wants to send it.

• In slotted Aloha, the shared channel is divided into a fixed time interval called slots. So that,
if a station wants to send a frame to a shared channel, the frame can only be sent at the
beginning of the slot, and only one frame is allowed to be sent to each slot. If the station is
failed to send the data, it has to wait until the next slot.
• However, there is still a possibility of a collision because suppose if two stations try to send
a frame at the beginning of the time slot.
15
Carrier Sense Multiple Access (CSMA)
• This method was developed to decrease the chances of collisions when two or more stations
start sending their signals over the data link layer. Carrier Sense multiple access requires
that each station first check the state of the medium before sending.
• CSMA/CD (Carrier Sense Multiple Access/ Collision Detection) is a media access control
method that was widely used in Early Ethernet technology/LANs when there used to be
shared Bus Topology and each node ( Computers) was connected by Coaxial Cables.
Nowadays Ethernet is Full Duplex and Topology is either Star (connected via Switch or
Router) or point-to-point ( Direct Connection). Hence CSMA/CD is not used but they are still
supported though.
• Consider a scenario where there are ‘n’ stations on a link and all are waiting to transfer data
through that channel. In this case, all ‘n’ stations would want to access the link/channel to
transfer their own data. The problem arises when more than one station transmits the data at
the moment. In this case, there will be collisions in the data from different stations.
• CSMA/CD is one such technique where different stations that follow this protocol agree on
some terms and collision detection measures for effective transmission. This protocol decides
which station will transmit when so that data reaches the destination without corruption.

16
How Does CSMA/CD Work?
• Step 1: Check if the sender is ready to transmit data packets.
• Step 2: Check if the transmission link is idle.
The sender has to keep on checking if the transmission link/medium is idle. For this, it
continuously senses transmissions from other nodes. The sender sends dummy data on
the link. If it does not receive any collision signal, this means the link is idle at the
moment. If it senses that the carrier is free and there are no collisions, it sends the data.
Otherwise, it refrains from sending data.
• Step 3: Transmit the data & check for collisions.
The sender transmits its data on the link. CSMA/CD does not use an ‘acknowledgment’
system. It checks for successful and unsuccessful transmissions through collision signals.
During transmission, if a collision signal is received by the node, transmission is stopped.
The station then transmits a jam signal onto the link and waits for random time intervals
before it resends the frame. After some random time, it again attempts to transfer the
data and repeats the above process.
• Step 4: If no collision was detected in propagation, the sender completes its frame
transmission and resets the counters.

17
How Does a Station Know if Its Data Collide?

• Consider the above situation. Two stations, A & B.


• Propagation Time: Tp = 1 hr ( Signal takes 1 hr to go from A to B)
• At time t=0, A transmits its data.
• t= 30 mins : Collision occurs.
• After the collision occurs, a collision signal is generated and sent to both A & B to inform the
stations about the collision. Since the collision happened midway, the collision signal also
takes 30 minutes to reach A & B.
• Therefore, t=1 hr: A & B receive collision signals.
• This collision signal is received by all the stations on that link. 18
Features of Collision Detection in CSMA/CD
• Carrier Sense: Before transmitting data, a device listens to the network to check if the
transmission medium is free. If the medium is busy, the device waits until it becomes free
before transmitting data.
• Multiple Access: In a CSMA/CD network, multiple devices share the same transmission
medium. Each device has equal access to the medium, and any device can transmit data
when the medium is free.
• Collision Detection: If two or more devices transmit data simultaneously, a collision occurs.
When a device detects a collision, it immediately stops transmitting and sends a jam signal
to inform all other devices on the network of the collision. The devices then wait for a
random time before attempting to transmit again, to reduce the chances of another collision.
• Back off Algorithm: In CSMA/CD, a back off algorithm is used to determine when a device
can retransmit data after a collision. The algorithm uses a random delay before a device
retransmits data, to reduce the likelihood of another collision occurring.
• Minimum Frame Size: CSMA/CD requires a minimum frame size to ensure that all devices
have enough time to detect a collision before the transmission ends. If a frame is too short, a
device may not detect a collision and continue transmitting, leading to data corruption on
the network. 19
Advantages of CSMA/CD
• Simple and widely used: CSMA/CD is a widely used protocol for Ethernet networks, and
its simplicity makes it easy to implement and use.
• Fairness: In a CSMA/CD network, all devices have equal access to the transmission
medium, which ensures fairness in data transmission.
• Effi ciency: CSMA/CD allows for efficient use of the transmission medium by preventing
unnecessary collisions and reducing network congestion.

Disadvantages of CSMA/CD
• Limited Scalability: CSMA/CD has limitations in terms of scalability, and it may not be
suitable for large networks with a high number of devices.
• Vulnerability to Collisions: While CSMA/CD can detect collisions, it cannot prevent them
from occurring. Collisions can lead to data corruption, retransmission delays, and reduced
network performance.
• Ineffi cient Use of Bandwidth: CSMA/CD uses a random backoff algorithm that can result
in inefficient use of network bandwidth if a device continually experiences collisions.
• Susceptibility to Security Attacks: CSMA/CD does not provide any security features, and
the protocol is vulnerable to security attacks such as packet sniffing and spoofing.
20
Introduction to Wireless LAN
• Wireless LAN stands for Wireless Local Area Network. It is also called LAWN (Local
Area Wireless Network).
• WLAN is one in which a mobile user can connect to a Local Area Network (LAN) through a
wireless connection.
• The IEEE 802.11 group of standards defines the technologies for wireless LANs. For path
sharing, 802.11 standard uses the Ethernet protocol and CSMA/CA (carrier sense multiple
access with collision avoidance).
• Wireless LANs provide high speed data communication in small areas such as building or an
office.
• WLANs allow users to move around in a confined area while they are still connected to the
network.
• In some instance wireless LAN technology is used to save costs and avoid laying cable,
while in other cases, it is the only option for providing high-speed internet access to the
public.
• Whatever the reason, wireless solutions are popping up everywhere.
21
Advantages of WLANs
• Flexibility: Within radio coverage, nodes can communicate without further restriction.
Radio waves can penetrate walls, senders and receivers can be placed anywhere (also
non-visible, e.g., within devices, in walls etc.).
• Planning: Only wireless ad-hoc networks allow for communication without previous
planning, any wired network needs wiring plans.
• Design: Wireless networks allow for the design of independent, small devices which can
for example be put into a pocket. Cables not only restrict users but also designers of
small notepads, PDAs, etc.
• Robustness: Wireless networks can handle disasters, e.g., earthquakes, flood etc.
whereas, networks requiring a wired infrastructure will usually break down completely in
disasters.
• Cost: The cost of installing and maintaining a wireless LAN is on average lower than the
cost of installing and maintaining a traditional wired LAN, for two reasons. First, after
providing wireless access to the wireless network via an access point for the first user,
adding additional users to a network will not increase the cost. And second, wireless LAN
eliminates the direct costs of cabling and the labour associated with installing and
repairing it.
• Ease of Use: Wireless LAN is easy to use and the users need very little new information
to take advantage of WLANs. 22
23
Collision-Free Protocols
• Almost all collisions can be avoided in CSMA/CD but they can still occur during the
contention period.
• The collision during the contention period adversely affects the system performance, this
happens when the cable is long and length of packet are short.
• This problem becomes serious as fiber optics network came into use. Here we shall discuss
some protocols that resolve the collision during the contention period.
• Bit-map Protocol
• Binary Countdown
• Limited Contention Protocols
• The Adaptive Tree Walk Protocol

Collision Free Protocols:


• Pay constant overhead to achieve performance guarantee
• Good when network load is high

24
Switching
• When a user accesses the internet or another computer network outside their immediate
location, messages are sent through the network of transmission media.
• This technique of transferring the information from one computer network to another network
is known as switching.
• Switching in a computer network is achieved by using switches. A switch is a small hardware
device which is used to join multiple computers together with one local area network (LAN).
• Network switches operate at layer 2 (Data link layer) in the OSI model.
• Switching is transparent to the user and does not require any configuration in the home
network.
• Switches are used to forward the packets based on MAC addresses.
• A Switch is used to transfer the data only to the device that has been addressed. It verifies the
destination address to route the packet appropriately.
• It is operated in full duplex mode.
• Packet collision is minimum as it directly communicates between source and destination.
• It does not broadcast the message as it works with limited bandwidth. 25
required?
Switching concept is developed because of the following reasons:
• Bandwidth: It is defined as the maximum transfer rate of a cable. It is a very critical and
expensive resource. Therefore, switching techniques are used for the effective utilization of the
bandwidth of a network.
• Collision: Collision is the effect that occurs when more than one device transmits the message
over the same physical media, and they collide with each other. To overcome this problem,
switching technology is implemented so that packets do not collide with each other.

Advantages of Switching:
• Switch increases the bandwidth of the network.
• It reduces the workload on individual PCs as it sends the information to only that device which
has been addressed.
• It increases the overall performance of the network by reducing the traffic on the network.
• There will be less frame collision as switch creates the collision domain for each connection.

Disadvantages of Switching:
• A Switch is more expensive than network bridges. o A Switch cannot determine the network
connectivity issues easily.
• Proper designing and configuration of the switch are required to handle multicast packets.
26

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy