0% found this document useful (0 votes)
4 views112 pages

Unit II

Unit II covers the Physical and Data Link Layers of networking, detailing transmission media, modes, modulation, and multiplexing techniques. It explains the roles of the Physical Layer in transmitting data as bits and the Data Link Layer in ensuring reliable communication through framing, error detection, and flow control. Various types of guided and unguided media, along with their applications, are also discussed, alongside framing techniques and access control protocols.

Uploaded by

manasi.a.more24
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)
4 views112 pages

Unit II

Unit II covers the Physical and Data Link Layers of networking, detailing transmission media, modes, modulation, and multiplexing techniques. It explains the roles of the Physical Layer in transmitting data as bits and the Data Link Layer in ensuring reliable communication through framing, error detection, and flow control. Various types of guided and unguided media, along with their applications, are also discussed, alongside framing techniques and access control protocols.

Uploaded by

manasi.a.more24
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

Unit II

PHYSICAL & DATA LINK LAYER


Contents
Physical Layer: Transmission media- Guided media, unguided media. Transmission Modes:
Simplex, Half-Duplex and Full-Duplex. Modulation & Multiplexing.
Data Link Layer: Design issues, Framing Techniques, Error detection, Error correction, Data Link
layer Protocols: Simplex, Stop and Wait, Sliding Window Protocol. MAC: Access Control
Protocols (ALOHA, CSMA, CSMA/CD), Ethernet, Wireless LAN: Architecture, Protocol Stack
Physical Layer
It co-ordinates the functions required to transmit bit stream over physical medium.
Provides physical interface for transmission of information.
Defines rules by which bits are passed from one system to another on a physical communication
medium.
Covers all - mechanical, electrical, functional and procedural - aspects for physical
communication.
Functions
The Physical Layer is responsible for sending raw data as bits over a physical medium.
It converts data into signals that can travel through wires, fiber optics, or wireless channels
(encoding) and turns these signals back into data at the receiver (decoding).
It ensures signals are transmitted correctly and uses techniques like modulation to prepare the
data for transmission and demodulation to retrieve it at the other end.
This layer also decides how data flows (one-way, two-way alternately, or simultaneously)
through transmission modes and controls the speed and timing of data transmission to keep
everything running smoothly.
Transmission media
Guided Media
Types of Guided Media
❑ Twisted-Pair Cable
❑ Coaxial Cable
❑ Fiber-Optic Cable

Twisted-pair and coaxial cable use metallic (copper) conductors that accept and transport
signals in the form of electric current.
Optical fiber is a cable that accepts and transports signals in the form of light.
Twisted-pair cable
One of the wires is used to carry signals to the receiver, and the other is used only as a ground
reference.
In addition to the signal sent by the sender on one of the wires, interference (noise) and
crosstalk may affect both wires and create unwanted signals.
If the two wires are parallel, the effect of these unwanted signals is not the same in both wires
because they are at different locations relative to the noise or crosstalk sources (e,g., one is
closer and the other is farther).
Types
UTP (Unshielded Twisted Pair)
STP (Shielded Twisted Pair)
UTP categories
Category 1 Voice only (Telephone)
Category 2 Data to 4 Mbps (Localtalk)
Category 3 Data to 10Mbps (Ethernet)
Category 4 Data to 20Mbps (Token ring)
Data to 100Mbps (Fast Ethernet)
Category 5
Data to 1000Mbps (Gigabit
Category 5e
Ethernet)
Data to 2500Mbps (Gigabit
Category 6
Ethernet)
Coaxial cable
Categories of coaxial cables
Coaxial cables are categorized by their radio government (RG) ratings.
Each RG number denotes a unique set of physical specifications, including the wire gauge of the
inner conductor, the thickness and type of the inner insulator, the construction of the shield,
and the size and type of the outer casing.

Category Impedance Use

RG-59 75 Ω Cable TV

RG-58 50 Ω Thin Ethernet


Thick
RG-11 50 Ω
Ethernet
Fiber-optic cable
A fiber optic cable is a network cable that contains strands of glass fibers inside an insulated
casing.
They're designed for long distance, very high performance data networking and
telecommunications.
Compared to wired cables, fiber optic cables provide higher bandwidth and can transmit data
over longer distances.
Fiber optic cables support much of the world's internet, cable television and telephone systems
Unguided Media
Unguided media, also known as wireless or Unbounded transmission media , uses
electromagnetic waves to transmit data without any physical medium. Signals propagate
through free space such as air or vacuum.
The main types of unguided media are radio waves, microwaves, and infrared waves.
Features:
❑ Signals propagate through air or free space
❑ Less secure due to broadcast nature
❑ Suitable for long-distance communication
Radio Waves
Radio waves are a type of electromagnetic wave that can easily be generated and can propagate
through buildings and other obstacles.
They do not require line-of-sight between transmitting and receiving antennas, making them highly
suitable for broadcast communication and wireless data transmission.
Frequency Range:
❑ 3 kHz – 300 GHz

Applications:
❑ AM and FM radio broadcasting, television transmission, cordless phones, and wireless communication.

Types of Radio Waves:


❑ Shortwave: AM radio broadcasting
❑ VHF (Very High Frequency): FM radio and television
❑ UHF (Ultra High Frequency): Television and mobile communication
Microwaves
Micro waves are a form of unguided transmission media that use line-of-sight communication,
where the transmitting and receiving antennas must be properly aligned.
The transmission range depends on the height of the antennas.
Microwaves operate in the frequency range of 1 GHz to 300 GHz and are widely used in mobile
communication, satellite links, and television distribution.
Advantages:
❑ Cost-effective compared to laying physical cables
❑ No need for land acquisition
❑ Suitable for communication over difficult terrains and oceans
❑ Supports high data transmission rates
Infrared
Infrared waves are used for short-range wireless communication and operate in the frequency
range of 300 GHz to 400 THz.
They cannot penetrate solid obstacles, which limits their range but helps minimize interference
between nearby systems.
Infrared waves are commonly used in TV remote controls, wireless keyboards, mice, and
printers.
Applications of Transmission Media
Transmission Media Application
Unshielded Twisted Pair (UTP) Local Area Networks (LAN), telephones

Shielded Twisted Pair (STP) Industrial networks, environments with high interference

Optical Fiber Cable Long-distance communication, internet backbones

Coaxial Cable Cable TV, broadband internet, CCTV

Radio Wireless communication, AM/FM radio, mobile phones

Infrared Remote controls, short-range communication

Microwave Satellite communication, radar, long-distance links


Transmission Modes
Transmission modes also known as communication modes, define how data is transferred
between devices in a network or bus system.
They are classified into three types
❑ Simplex Mode
❑ Half-Duplex Mode
❑ Full-Duplex Mode.
Simplex Mode
In Simplex mode, the communication is unidirectional, as on a one-way street.
Only one of the two devices on a link can transmit, the other can only receive.
The simplex mode can use the entire capacity of the channel to send data in one direction.
Pros of Simplex Mode
❑ It is the most cost-effective mode, as it only requires one communication channel.
❑ There is no need for coordination between the transmitting and receiving devices, which simplifies the
communication process.
❑ Simplex mode is particularly useful in situations where feedback or response is not required, such as
broadcasting or surveillance.

Cons of Simplex Mode


❑ Only one-way communication is possible.
❑ There is no way to verify if the transmitted data has been received correctly.
❑ Simplex mode is not suitable for applications that require bidirectional communication.
Half-Duplex Mode
In half-duplex mode, each station can both
transmit and receive, but not at the same
time. When one device is sending, the other
can only receive, and vice versa.
The half-duplex mode is used in cases where
there is no need for communication in both
directions at the same time.
The entire capacity of the channel can be
utilized for each direction.
Full-Duplex Mode
In full-duplex mode, both stations can transmit and receive simultaneously. It is used when
communication in both directions is required all the time.
The capacity of the channel, however, must be divided between the two directions.
Here, signals going in one direction share the capacity of the link with signals going in another
direction, this sharing can occur in two ways:
❑ Either the link must contain two physically separate transmission paths, one for sending and the other
for receiving.
❑ Or the capacity is divided between signals traveling in both directions.
Modulation
Modulation :Modulation is the process of changing a carrier signal (high-frequency wave)
according to the information signal (data) to enable efficient transmission over long distances.
Modulation can be digital or analog, the input wave of the analog signal varies continuously like
a sine wave.
Modulation can be defined as the process of converting data into waves by adding information
to a carrier signal.
Such a signal can be transmitted electronically or optically, but it must have a consistent
waveform.
Why modulation is needed:
❑ Reduces antenna size
❑ Increases transmission range
❑ Improves signal quality and reduces noise
Line Codes
NRZ (Non-Return-to-Zero)
❑ the positive voltage defines bit 1 and the zero voltage defines bit 0.

NRZ Invert (NRZI)


❑ If there is no change, the bit is 0; if there is a change, the bit is 1.

Manchester
❑ In Manchester encoding, the duration of the bit is divided into two halves.
◦ The voltage remains at one level during the first half and moves to the other level in the second half.
◦ The transition at the middle of the bit provides synchronization

Bipolar encoding
❑ 1 is called a ‘‘mark’’ and a 0 is called a ‘‘space.’’
Multiplexing
Multiplexing is the set of techniques that allows the simultaneous transmission of multiple
signals across a single data link.
In a multiplexed system, n lines share the bandwidth of one link. Following Figure shows the
basic format of a multiplexed system.
The lines on the left direct their transmission streams to a multiplexer (MUX), which combines
them into a single stream (many-to one).
At the receiving end, that stream is fed into a demultiplexer (DEMUX), which separates the
stream back into its component transmissions (one-to-many) and directs them to their
corresponding lines
Types of Multiplexing
Multiplexing can be classified as:
❑ Frequency Division Multiplexing (FDM)
❑ Time-Division Multiplexing (TDM)
❑ Wavelength Division Multiplexing (WDM)
Frequency Division Multiplexing
The frequency spectrum is divided among the
logical channels and each user has exclusive
access to his channel.
It sends signals in several distinct frequency
ranges and carries multiple video channels on
a single cable.
Each signal is modulated onto a different
carrier frequency and carrier frequencies are
separated by guard bands.
The bandwidth of the transmission medium
exceeds the required bandwidth of all the
signals.
Time Division Multiplexing
Each user periodically gets the entire
bandwidth for a small burst of time, i.e. entire
channel is dedicated to one user but only for a
short period of time.
It is very extensively used in computer
communication and telecommunication.
Sharing of the channel is accomplished by
dividing available transmission time on a
medium among users.
It exclusively uses Digital Signaling instead of
dividing the cable into frequency bands.
Wavelength Division Multiplexing
It is the same as FDM but applied to fibers,
only the difference is that here the operating
frequencies are much higher actually they are
in the optical range.
There's great potential for fibers since the
bandwidth is so huge.
Fibers with different energy bands are passed
through a diffraction grating prism.
Combined on the long-distance link and then
split at the destination.
It has got high reliability and very high
capacity.
Data Link Layer
Data link layer attempts to provide reliable communication over the physical layer interface.
Breaks the outgoing data into frames and re-assemble the received frames.
Create and detect frame boundaries.
Handle errors by implementing an acknowledgement and retransmission scheme.
Implement flow control.
Functions
Framing-
❑ Divides the stream of bits into manageable data units called frames.

Physical addressing-
❑ Adds a header to the frame to define the sender and/or receiver of the frame.

Flow control-
❑ Imposes a flow control mechanism to avoid overwhelming the receiver.

Error control-
❑ Adds mechanisms to detect and retransmit damaged or lost frames.
Access control-
❑ Determine which device has control over the link at any given time.

Link establishment and termination:


❑ Establishes and terminates the logical link between two nodes.

Frame sequencing:
❑ Transmits/receives frames sequentially.

Frame acknowledgment:
❑ Provides/expects frame acknowledgments.
Design issues
1. Services provided to the network layer
The data link layer act as a service interface to the network layer.
The principle service is transferring data from network layer on sending machine to the network layer
on destination machine. This transfer also takes place via DLL (Data link-layer).
It provides three types of services:
❑ Unacknowledged and connectionless services.
◦ Here the sender machine sends the independent frames without any acknowledgement from the sender.
◦ There is no logical connection established.
❑ Acknowledged and connectionless services.
◦ There is no logical connection between sender and receiver established.
◦ Each frame is acknowledged by the receiver.
◦ If the frame didn’t reach the receiver in a specific time interval it has to be sent again.
◦ It is very useful in wireless systems.
❑ Acknowledged and connection-oriented services
◦ A logical connection is established between sender and receiver before data is trimester.
◦ Each frame is numbered so the receiver can ensure all frames have arrived and exactly once.
2. Frame synchronization -
❑ The source machine sends data in the form of blocks called frames to the destination machine.
❑ The starting and ending of each frame should be identified so that the frame can be recognized by the
destination machine.

3. Flow control -
❑ Flow control is done to prevent the flow of data frame at the receiver end.
❑ The source machine must not send data frames at a rate faster than the capacity of destination
machine to accept them.

4. Error control -
❑ Error control is done to prevent duplication of frames.
❑ The errors introduced during transmission from source to destination machines must be detected and
corrected at the destination machine.
Framing Techniques
Since the physical layer merely accepts and transmits a stream of bits without any regard to
meaning or structure, it is upto the data link layer to create and recognize frame boundaries.
This can be accomplished by attaching special bit patterns to the beginning and end of the
frame.
If these bit patterns can accidentally occur in data, special care must be taken to make sure
these patterns are not incorrectly interpreted as frame delimiters.
The four framing methods that are widely used are
❑ 1. Byte count.
❑ 2. Flag bytes with byte stuffing.
❑ 3. Flag bits with bit stuffing.
❑ 4. Physical layer coding violations.
Byte count
This framing method uses a field in the header
to specify the number of bytes in the frame.
When the data link layer at the destination
sees the byte count, it knows how many bytes
follow and hence where the end of the frame
is.
The disadvantage is that if the count is garbled
by a transmission error, the destination will
lose synchronization and will be unable to
locate the start of the next frame. So, this
method is rarely used.
Flag bytes with byte stuffing
The second framing method gets around the problem of resynchronization after an error by
having each frame start and end with special bytes.
Often the same byte, called a flag byte, is used as both the starting and ending delimiter.
In byte stuffing, special byte that is basically known as ESC (Escape Character) that has
predefined pattern is generally added to data section of the data stream or frame when there is
message or character that has same pattern as that of flag byte.
But receiver removes this ESC and keeps data part that causes some problems or issues.
In simple words, we can say that character stuffing is addition of 1 additional byte if there is
presence of ESC or flag in text.
Flag bits with bit stuffing
The third method allows data frames to contain an arbitrary number of bits and allows character
codes with an arbitrary number of bits per character.
At the start and end of each frame is a flag byte consisting of the special bit pattern 01111110 .
Whenever the sender's data link layer encounters five consecutive 1s in the data, it
automatically stuffs a zero bit into the outgoing bit stream.
When the receiver sees five consecutive 1s in the incoming data stream, followed by a zero bit,
it automatically destuffs the 0 bit.
The boundary between two frames can be determined by locating the flag pattern.
Physical layer coding violations
In this method, the message is encoded by the encoding method in such a way that both the
sender and receiver can recognize it.
This method provides some reserved signals that indicate the start and end of the frame. We
are using “coding violation” to delimit the frame of the data link layer.
We apply a reserved signal to the original data sent by the sender so that there is no problem on
the receiver side to identify the data.
High-High (11) and Low-Low (00) are error codes used as escapes to differentiate data link layer
frames.
Error detection
Error on Communication Channel
❑ When the sender sends data to the receiver over the communication channel, the data may be lost or
corrupted, which generates an error.
❑ Several factors exist on the channel that are responsible for changing one or more bits of the message.
❑ Sometimes the error is not a problem on the network. For example, random errors can be tolerated
when the sender and receiver communicate in audio or video format. But when sender and receiver
transmit and receive data as text, we expect a high degree of accuracy over the network.

Types of Errors
❑ When the sender sends the message in the form of bits from its physical layer to the physical layer of
the recipient, some unexpected changes may occur due to interference.
❑ The original meaning and shape of the message may change due to interference, leading to errors.
❑ There are 2 types of errors as follows:
◦ Single-bit error
◦ Burst error
Error-Detecting Codes
Error-correcting codes are widely used on wireless links, which are notoriously noisy and error
prone when compared to optical fibers.
There are 3 types of error-detection codes we can use to detect errors in communication.
They are as follows:
❑ 1. Parity.
❑ 2. Checksums.
❑ 3. Cyclic Redundancy Checks (CRCs).
Parity
In the Parity bit method, an additional bit is added to each word to make error detection
possible on the communication channel.
The parity bit has two values, either 0 or 1.
Types of parity.
❑ Even Parity: The sender is sending the message as a stream of bits over the communication channel.
After adding a parity bit (1 or 0) to the message, the number of 1’s becomes even then it is known as
even-parity.
❑ Odd Parity: The sender is sending the message as a stream of bits over the communication channel.
After adding a parity bit (1 or 0) to the message, the number of 1’s becomes odd then it is known as
odd-parity.
Checksums
The problem with the parity bit method is that it reliably detects only one-bit errors in the
message.
If the message contains a burst error, the parity bit method will not work.
Therefore, the parity bit is only used when cables are challenging for error detection, as those
cables have very low error rates.
To solve the problem of the parity bit method, the checksum method is used.
The checksum is the complement of the total of all the code-words.
The Checksum is placed at the end of the message.
The checksum method operates on words instead of bits.
As you can see in the above diagram that a 24-bit size message is divided into 3 smaller
messages of 8 bits each. Now, the sender will sum all the 8 bits of the message and complement
the result, which is the checksum.
After the checksum is calculated, the sender will put the checksum in the message and send it to
the receiver. Now, the receiver will sum up all the received messages of 8 bits.
After that, the receiver will sum the result with the checksum, which was calculated by the
sender. If the value of the sum’s complement becomes 0, the receiver confirms that there is no
error in the message.
Cyclic Redundancy Checks (CRCs)
Cyclic redundancy check is another error detection technique, also known as polynomial code.
In this method, redundancy bits are added to the original message before transmission so that if
an error occurs midway through transmission, the receiver can detect it and inform the sender.
Redundant bits are decided by the divisor, and in CRC, the divisor is predetermined. To
understand better, let’s look at an example of a CRC.
In the above diagram, the size of the data-word 1011000100 and the divisor 10011 are 10 bits
and 5 bits, respectively. Therefore, a total of redundant bits will be added to the data word,
which is one smaller than the size of the divisor.
So, you can see in the diagram that four 0’s have been added to the original message, which
makes 10110001000000.
After that, the CRC will be calculated on behalf of the sender and sent to the receiver. On the
receiver side, the receiver will also calculate the CRC to detect whether an error has occurred or
not.
If the value of remainder becomes 0000, then the receiver ensures that the message received is
not corrupted.
Checksum Example
❑ Word 1: 1001100110011001
❑ Word 2: 1100110011001100

CRC Example
❑ Data = 1101011011
❑ Generator Polynomial = 10011 (degree 4)
Error correction
The error detection method is used to check whether an error has occurred in the data. Now it’s
time to learn how we can fix the detected errors using error correction methods. The error
correction method is used to find out the exact number of corrupted bits to correct.
Error correction can be done in two ways:
❑ Backward Error Correction
❑ Forward Error Correction
Backward Error Correction:
❑ In simple words, the receiver sends an acknowledgment to the sender when corrupt data is received,
and the sender retransmits the data to the receiver.

Forward Error Correction:


❑ When the receiver receives data that contains errors, the receiver attempts to retrieve and correct the
data using methods.
❑ The 4 main methods of Forward-Error correction are as follows:
◦ Hamming Codes
◦ Binary Convolution Codes
◦ Reed-Solomon Codes
◦ Low-Density Parity-Check Codes
Hamming Codes
In each forward error correction method, the message has m bits size and r bits of a check or
redundant bits are added, and the sum of message ‘m’ bits and redundant “r” bits is known as a
block.
The sender creates the block on his behalf using Hamming or Binary Convolution method and
sends it to the receiver.
The receiver will use the error correction methods on the message to correct the error.
The position of the bits changed in the block during transmission is called the Hamming
distance.
The Hamming distance is calculated on binary strings that have the same length.
Rule to Find Number of Parity Bits
If
•m = number of data bits
•r = number of parity bits
Then:
(m + r + 1) ≤ 2r
As you can see in the above diagram, the hamming distance between two code-words is simply
the number of bits that differ between two streams of bits. So, here the Hamming distance is
‘4’.
When the receiver has calculated the Hamming distance, it will correct the error in the message
using the Hamming code. In Hamming code, the position of the parity bits is in the power of 2.
After the receiver detects the position of the parity bits, the receiver will perform an XOR
operation to find the value of the parity bits and correct the error.
Binary Convolution Codes
The second most useful method is binary
convolution. In this method, the sender will
encode the message and produce a sequence of
output bits.
Here, the output of the message depends on the
current and previous bits.
Convolution code is used in mobile phone
systems, wireless communication, and satellite
communication, etc.
Convolution code has 3 states, input, internal, and
output. Based on the input and the current state,
the output will be calculated by performing the
shifting process to the internal state.
When the receiver decodes the convolution code
by tracing the sequence of input bits sent by the
sender that produces the output, the receiver will
detect and correct errors.
Reed-Solomon Codes
Reed-Solomon and low-density parity-check methods overcome the problems of Hamming
codes and binary convolution codes.
For example, the convolution code fails if there are too many errors in the received message,
but we can overcome this problem using the Reed-Solomon method.
Reed-Solomon codes are used with convolution codes. It contains additional redundant bits to
provide reliable communication and a method for the receiver to correctly correct errors.
In general, convolution codes are good at handling isolated bit errors, but if there are too many
errors in the received message, the convolution code fails.
Adding Reed-Solomon code to the convolution code protects against single and burst errors,
which overcome the problem of convolution codes.
Low-Density Parity-Check Codes
Low-density parity checking codes are great for large block sizes because they have excellent
error-correction capabilities.
In this method, each output bit on the receiver side is made up of a fraction of the input bits,
which leads to a matrix representation that has a low-density 1s code, hence known as a
low-density parity-check.
In today’s networks, most new protocols include LDPC codes.
LDPC is part of the standard for digital video transmission, Ethernet with 10 Gbps speeds,
power-line networks, and 802.11.
Data Link layer Protocols
Elementary Data Link Protocols
❑ Data Link Layer communicates with the network layer and physical layer.
❑ Generally, the data link layer receives packets and sends the data to the physical layer in form of
frames.
❑ Elementary Data Link Protocols ensure reliability over a network during the transmission of frames.
❑ The Elementary data link protocols help the data link layer solve problems such as frame loss or damage
and flow control.
❑ Types
◦ Simplex
◦ Stop & Wait

Sliding Window Protocols


❑ In two of the Elementary data link protocols, the half-duplex mode was in use.
❑ In the sliding window protocol, the sender and receiver use the same link to send frames and
acknowledgements for data in both directions.
Simplex Protocol
An utopian simplex protocol is a simple protocol because it does not worry about whether
something is going right or wrong on the channel.
In this protocol, data is transmitted in only one direction. Therefore it is unidirectional.
No matter what is happening in the network, the sender and receiver are always ready to
communicate. So they also ignore the delay in processing.
This protocol is just a consideration so that there is infinite buffer space available on the sender
and receiver.
It is an unrealistic protocol, or you can say it is an unrestricted protocol.
Working
In this protocol, the channel used between layer-2 of the sender and receiver never discards or damages
the frame during communication.
In protocol, two entities are sender and receiver, who communicate with each other over a channel.
The sender process and receiver process are running at the data link layer of the sender’s machine and
the receiver’s machine, respectively. Sequence number and acknowledgment number are not used.
Only the undamaged frame arrival process is going on.
As you can see in the diagram, the direction of communication is in only one direction. The sender is
sending the data over the line as fast as possible.
The sender’s machine fetches packets from the network layer, creates frames, and sends the frames
over the line.
On the other hand, the receiver is waiting to receive the frame. The frame comes from the sender, so
the receiver will take the frame that comes into the hardware buffer and send it to the network layer.
After the frame is sent to the network layer, the receiver’s data link layer will sit back to wait for the
next frame.
Simplex Stop-and-Wait Protocol for
Noiseless Channel
In a stop-and-wait protocol, the sender stops after sending a frame to the receiver and waits for an
acknowledgment before sending another frame.
We here assume a noiseless channel that is error-free on which the frame is never damaged or corrupted. Here
the channel is error-free but does not control the flow of data.
Using the simplex stop-and-wait protocol, we can prevent the sender from flooding the receiver with frames
faster than the receiver can process them.
To prevent flooding on the receiver side, one solution is to enable the receiver to process frames back-to-back by
adding a buffer of sufficient size. We can enhance the processing capabilities of the receiver so that it can quickly
pass the received frame to the network layer. But it’s still not a general solution.
Common solutions for addressing flooding issues on the receiver side, providing feedback to the sender to reduce
the flow rate at the receiver.
So that, in the simplex stop-and-wait protocol, the receiver sends a dummy frame back to the sender after the
packet is sent over the network layer, asking the sender to send the next frame.
Frames can be transmitted to or received from the sender or receiver, so the simplex stop-and-wait protocol is
bidirectional.
Working
As we got some basic idea about stop-and-wait protocol. Now, let’s see how the Simplex
stop-and-wait protocol handles flow control over a noiseless channel.
As you can see in the above diagram that the sender is sending the frame to the receiver. After
sending the frame, the sender stops the transmission and waits for the acknowledgment from
the receiver.
As soon as the receiver receives the frame, it opens it and sends it to the network layer for
further processing. Now, the receiver will create an acknowledgment, which allows the sender
to send the next frame.
You can see that the communication is bidirectional, but they are using half-duplex mode.
Simplex Stop-and-Wait Protocol for a
Noisy Channel
Here, assume the general situation in which the sender and receiver on the communication channel make an
error during transmission. Frames can either be damaged or lost completely during transmission.
On a noisy channel, the receiver has only a limited buffer capacity and a limited processing speed, so the protocol
prevents the sender from flooding the receiver with data too fast to handle it.
In rare cases, the frame sent by the sender may be damaged in such a way that the checksum is correct, causing
this and all other protocols to fail. To avoid this situation, a timer is added.
Suppose, receiver’s acknowledgment is lost during transmission, the sender will wait for acknowledgment for
some time, and after the timeout, the sender will send the frame again. This process is repeated until the frame
arrives and the acknowledgment is received from the receiver.
The data link layer is responsible for flow and error control. Therefore, when the sender’s network layer
transmits a series of packets to the data link layer, the data link layer transmits the packets through the receiver’s
data link layer to the network layer.
Here, the network layer has no functionality to check whether there is an error in the packet, so the data link
layer must guarantee to the network layer that no transmission error occurs in the packet. Although duplicate
packets may arrive at the network layer, we can prevent this by using this protocol.
Working
As we have seen in the above section that the network layer does not have the functionality to detect errors or
duplication in the packet, so it is guaranteed by the data link layer that there are no errors in the packet. But
duplicate packets can arrive at the network layer. So, let us understand this scenario with an example.
As you can see in the above diagram, the sender sends the packet in the form of a frame to the receiver. When
the receiver receives the frame, it sends the frame in a packet format to the network layer.
After frame-1 successfully reaches the receiver, the receiver will send an acknowledgment to the sender. The
sender will send the frame-2 after receiving the acknowledgment from the receiver. But as shown in the figure,
frame-2 is lost during transmission. Therefore, the sender will retransmit frame-2 after the timeout.
Further, the receiver is sending an acknowledgment to the sender after receiving frame-2. But the
acknowledgment is completely lost during transmission.
The sender is waiting for the acknowledgment, but the timeout has elapsed, and the acknowledgment has not
been received. So the sender will assume that the frame is lost or damaged, and it will send the same frame again
to the receiver.
The receiver receives the same frame again. But how does the receiver recognize that the packet of the frame is
a duplicate or the original? So, it will use the sequence number to identify whether the packet is duplicate or
new.
Sliding Window Protocol
We can achieve full-duplex mode communication in the sliding window protocol by creating two
instances of one of the Elementary data link protocols.
In two of the Elementary data link protocols, the half-duplex mode was in use. In the sliding
window protocol, the sender and receiver use the same link to send frames and
acknowledgements for data in both directions.
In the sliding window protocol, each frame sent by the sender has a sequence number.
Sequence numbers can range from 0 to 2n-1 when there are n-bit field.
In the sliding window protocol, the sender maintains a set of sequence numbers corresponding
to the frames that are allowed to be sent.
Sending Window and Receiving
Window
The sliding window protocol has the concept of a window. The sender has a sending window,
and the receiver has a receiving window.
The frames on the sender’s machine come within the sending window. Similarly, the receiver
has a receiving window to store the received frame.
The size of the sending and receiving window may vary as per the requirement. Some protocols
have a fixed sending and receiving window size. But in other protocols, the size of the sending
and receiving windows increase and decrease according to the size of the sending and receiving
frames.
The sender looks at the sequence number of frames in the sending window to check which
frames have been sent and can be sent.
There is a possibility of frames being lost during transmission, so the sender keeps all these
frames in a buffer for retransmission. If the sending window size is n, the sender needs n buffers
to hold the un-acknowledged frames.
Types of Acknowledgement
When a frame reaches the receiver, the receiver sends an acknowledgement to the sender, informing
about the received frame information.
There are total 6 types of an acknowledgement as follows:
❑ Positive Acknowledgement:
◦ The Acknowledgement sent by the receiver on receiving a frame successfully is known as positive acknowledgement.
❑ Negative Acknowledgement:
◦ When the frame is lost during transmission and the receiver sends an acknowledgement for the retransmission of the lost frame is known as
negative acknowledgement.
❑ Lost Acknowledgement:
◦ The frame is successfully received by the receiver, but the acknowledgement sent by the receiver to the sender is lost during transmission,
known as lost acknowledgement.
❑ Independent Acknowledgement:
◦ The sender sends frames one by one, and the receiver is sending an acknowledgement of each received frame, this is known as Independent
Acknowledgement.
❑ Cumulative Acknowledgement:
◦ The sender sends a set of frames to the receiver, and the receiver sends an acknowledgement for the next set of frames is known as Cumulative
Acknowledgement.
❑ Delayed Acknowledgement:
◦ When the acknowledgement sent by the receiver reaches the sender after exceeding the time limit is known as delayed acknowledgement.
Typically, the sliding window protocol is used for flow control purposes. In a noisy channel, the
data flow increases when the sender sends multiple frames at once before receiving
acknowledgement of the frame received from the receiver.

The sliding window protocols also send multiple frames from sender to receiver to improve
channel efficiency. For that, they use flow control mechanisms, which provide reliable
communication.
Here, the term sliding window refers to the buffers or memory that consists of frames.
There are 3 types of sliding window protocols used for flow control.
❑ Stop-and-Wait ARQ Protocol
❑ Go-Back-N ARQ Protocol
❑ Selective Repeat ARQ Protocol
Stop-and-Wait ARQ Protocol
In the Stop-and-Wait ARQ protocol, the size of the sending window and receiving window is 1.
Since the sender and receiver window size is ‘1’, the sender transmits one frame and waits for
an acknowledgement from the receiver before sending the next one.
It is also known as a one-bit sliding window protocol because only one bit is transmitted on a
channel.
Working
As shown in the above figure, Sn is at the 0th position. So the sender will send frame-0 to the
receiver. As soon as the receiver receives frame-0, it will check the Rn and send ACK-1 to the
sender, as it wants frame-1 from the sender.
Now, the sender receives ACK-1 and sends frame-1 to the receiver. But frame-1 is lost during
transmission. Therefore, the sender will wait for the acknowledgement from the receiver until
the timeout.
After the timeout, the sender will again send frame-1 to the receiver. Now, the receiver Rn is on
the 0th frame because it wants the next frame, which is frame-0.
So, the receiver will send ACK-0 to the sender, and the sender will send the second frame-0 to
the receiver. The receiver sends ACK-1, but it is lost during transmission.
So the sender will resend the frame-0 to the receiver, but the receiver will discard it as it is
duplicated, and ACK-1 is sent to the sender. Similarly, this process continues until all the frames
have been sent to the receiver.
Data Link Layer –Sub Layers
DLL is divided into two Sub-Layers
❑ LLC Sub Layer
❑ MAC Sub Layer
Logical Link Control Sub Layer
It is upper portion of the Data Link layer.
Performs Flow control and management of connection errors.
LLC supports three types of connections:
❑ Unacknowledged connectionless service:
◦ Does not perform reliability checks or maintain a connection, very fast, most commonly used
❑ Connection oriented service:
◦ Once the connection is established, blocks of data can be transferred between nodes until one of the node terminates the
connection.
❑ Acknowledged connectionless service:
◦ Provides a mechanism through which individual frames can be acknowledged.
Media Access Control Sub Layer
This sub layer contains methods to regulate the timing of data signals and eliminate collisions.
The MAC sub layer determines where one frame of data ends and the next one starts - frame
synchronization.
There are four means of frame synchronization:
❑ Time based,
❑ Character counting,
❑ Byte stuffing and
❑ Bit stuffing.
MAC
The concept of MAC addresses originated at Xerox PARC, where early networking technologies
were developed. Over time, MAC addressing became standardized under IEEE 802
specifications.
Media Access Control (MAC) is a networking concept at the Data Link Layer (Layer 2) that
governs how devices share a communication channel.
It minimizes collisions, ensures efficient transmission, and uses unique MAC addresses (assigned
to each device’s NIC) for accurate data delivery within a local network.
Channel Allocation
On a network, multiple devices are communicating with each other. It is the responsibility of the
data link layer to provide reliable communication by allocating a channel to the device for
communication.
Allocating channels to specific devices for communication is known as channel allocation.
The data link layer allocates a single broadcast channel between competing devices.
Depending on the network and geographic region, the channel can be guided media or
unguided media. On the channel, several nodes are connected.
The purpose of a channel is to connect one device to another device on a network for
communication.
Channel Allocation Schemes
Channel allocation problem plays a major role in the network.
There are two types of channel allocation schemes used on the network. They are as follows:
1. Static Channel Allocation:
❑ This is a traditional way of allocating a single channel among multiple users. In static allocation, the
channel’s bandwidth is split into equal-sized portions among users, and each user gets a portion of the
bandwidth.

2. Dynamic Channel Allocation:


❑ In dynamic channel allocation, bandwidth is not allocated to the user permanently. The frequency is
allocated to the devices when it is needed on the network. It uses little CPU power, which increases the
optimal resource utilization of the network.
Access Control Protocols
In random access, no device is superior to any other device connected to a channel, and no device has control
over the other device.
Any device can transmit whenever it wants, so the transmission between devices is random. Hence, these
methods are known as random access.
In random access, no device permits another device to send frames on a channel.
At any time, the device uses the protocol when it wants to send a frame. Depending on the protocol, the device
will decide whether to send or not.
Here, there is no scheduled time for a device to transmit the frame. Transmission occurs randomly over a channel
between devices.
In random access, there is no rule as to which device is next to send the frame. So the devices compete with each
other to access the channel to transmit the frame.
Frames will either be lost or modified if more than one device sends over a shared channel. So devices use a
protocol to overcome this problem. We will study these protocols in this tutorial.
The two random access protocols are as follows:
❑ ALOHA
❑ CSMA
ALOHA
ALOHA is a random access method used in wireless LANs and on any shared media. In ALOHA, media is
shared between devices.
It may be possible that when a device sends data over a channel, another station may attempt to send
the data at the same time.
When multiple devices try to send data over the same channel, they collide, and the data gets distorted.
ALOHA includes a simple and elegant way to solve the problem of channel allocation.
ALOHA is applicable for systems in which uncoordinated devices are competing for access to a shared
channel.
There are two types of Aloha methods as follows:
❑ Pure ALOHA
❑ Slotted ALOHA
Pure ALOHA
The idea of the ALOHA system is simple that devices can transmit data whenever they have data
to send. When more than one device sends data at the same time, a collision occurs between
the frames. Therefore, the sender has to detect this problem when it is on the channel.
The device can listen for collisions when transmitting in some systems, such as a wired LAN.
If the frame is lost or destroyed, the sender waits for a random amount of time and resends it.
Here, the wait time is random.
A system in which multiple devices share a channel has conflict is known as a contention system.
As shown in the above figure, there are 4 devices connected on a shared channel. Each device
sends two frames on a single channel.
As you can see, only frame-1.1 and frame-4.2 survive and reach the destination, while other
frames are lost during transmission due to collisions with each other.
Pure Aloha, when a receiver device successfully receives a frame, it sends an acknowledgment
to the sending device.
If the acknowledgment is not received after the time-out period, the sender assumes that the
frame has been destroyed and resends the frame.
After the timeout, collisions between frames occur when all devices resend the lost frame at
once. To avoid collisions, each device waits a random amount of time before resending its
frame.
Random timing helps to avoid more collisions known as back-off time Tb.
Pure Aloha also has a second method to prevent congesting the channel with re-transmitted frames.
In this method, there are maximum K-max attempts to retransmit the frame. The value of K-max is
usually 15.
If the device retransmits the frame for K-max times, the device should give up and try again.
Here the back-off time Tb depends on the number of failed transmissions, which is K.
The time taken to transmit a frame is known as Transmission Time (Tfr). In Pure ALOHA, the vulnerable
time is twice the transmission time.
The throughput of pure ALOHA can be calculated as,
❑ S = G x e(-2G)
◦ Where S = average number of successful transmissions for pure ALOHA,
◦ G = the average number of frames generated by the device during transmission time of one frame.
❑ Pure ALOHA has maximum throughput S-max = 0.184 when G = (1/2)
Slotted ALOHA
In Pure Aloha, no rules determine when a device can send frames over a channel. A device can
send frames on the channel in two conditions.
First, immediately after the transmission of another device has started. Second, immediately
before the transmission of another device begins. But this increases the chances of a collision.
So, slotted ALOHA solves this problem and is used to improve the efficiency of pure ALOHA.
In slotted ALOHA, time is divided into Transmission Time (Tfr) slots, so the device can only send
at the beginning of the time slot.
The device is only allowed to send at the beginning of the synchronized time slot. If it misses, it
will have to wait until the start of the next time slot.
If two devices try to send at the beginning of the same time slot, the possibility of a collision
between the devices still exists.
As shown in the figure, four devices shared a channel. Each device is sending two frames on a
single channel.
Here the collisions are less as compared to pure ALOHA because they send the frame only when
the particular time slot starts.
Out of 8 frames, 4 frames (Frame-1.1, Frame-2.1, Frame-4.1, and Frame-3.2) were successfully
transmitted, and other frames were lost during transmission.
Slotted ALOHA vulnerable time is half that of pure ALOHA.
In slotted ALOHA, throughput can be measured as follows:
❑ S = G x e(-G)
❑ Slotted ALOHA has maximum throughput S-max = 0.368 when G = 1.
Carrier Sense Multiple Access (CSMA)
CSMA is developed to enhance the performance of the network by reducing the possibility of
collisions. In CSMA, the device senses the channel before trying to use it to reduce the
possibility of a collision. In Carrier sense protocol, devices listen to a carrier or transmission and
act accordingly.
CSMA uses the “sense before transmit” or “listen before talk” principle, allowing the device to
sense the channel before using it.
CSMA minimizes the possibility of collisions but does not provide any guarantee to eliminate it
because the propagation delay for sending frames from one device to another may cause
collisions on a channel.
When a device sends a frame, it takes very little time for the first bit to reach each device and
each device to understand it. Simply put, a device can sense the channel and find it idle because
the first bit sent by another device has not yet been received.
As shown in the figure, station B sends the frame at time t1, as it senses the channel and finds it
idle.
Station-C senses the channel at time t2 and finds it idle because still, it has not received the first
bit of Station-B, sent by Station-B on the channel. Now, both the signals will collide on a
channel, and the frame destroyed.
Here the time required for the propagation of the signal from one end of the channel to the
other is known as a propagation or vulnerable time TP.
A collision occurs when two devices send a frame at the same time. But if the first bit of the
frame reaches the end of the channel, each station receives the first bit of the sending station,
so they will not start broadcasting the frame until the station, transmitting the frame, has
completed the transmission.
CSMA with Collision Detection Protocol
(CSMA/CD)
CSMA/CD enhances the algorithm to handle collisions during transmission. Detects whether there is a
collision on a channel or not. In this method, a device monitors the channel after sending the frame to
see if the transmission was successful. The channel shall notify the station in case of collision during
transmission.
CSMA/CD uses persistence methods to understand the channel. Transmission and collision detection is
a continuous process in CSMA/CD.
In CSMA/CD, the station transmits and receives frames continuously and simultaneously.
The station continuously monitors the channel to see if a broadcast has ended or a collision is detected
on a channel. If the collision is not detected, it means that the transmission is complete.
The maximum throughput of CSMA/CD depends on the value of G and the persistence methods. Its
throughput value is higher than that of Aloha’s two protocols.
For the 1-persistent and non-persistent methods, the maximum throughput is approximately 50% (G=1)
and 90% (between G=3 and 8), respectively.
As shown in the figure, Station-A has performed its persistence process and starts sending bits
of the frame at time t1.
Station-C has not yet realized the bit sent by A at the time of t2, so it performs the persistence
method and starts sending bits of its frame.
The collision on the channel occurs at time t3 when Station-C receives the first bit of Station-A.
At time t4, Station-C detects a collision on the channel and aborts transmission.
On the other hand, when the first bit of Station-C’s frame collides with Station-A’s frame at time
t5, Station-A detects the collision and stops transmission.
So, station-A transmits for t5-t1 and station-C for t4-t2.
CSMA/CA
In CSMA/CD, when there is a collision on the channel, the station gets to know about it. It
receives its own signal when there is no collision and receives its own and another station’s
signal when a collision is detected.
CSMA/CA was invented to avoid collisions over a wireless channel, as wireless networks cannot
detect collisions.
Collision is avoided by using three strategies of CSMA/CA.
❑ Inter-Frame Space (IFS)
❑ Contention Window
❑ Acknowledgments
Inter-Frame System
When a station finds the channel idle, it does not transmit the frame immediately. It waits for
some time which is known as inter-frame space or IFS.
When the channel is idle after the IFS time, the station sends the frame after waiting for some
time, equal to the contention time.
IFS is used to define the priority of a station on a channel. For example, a station with a short IFS
has the highest priority among all stations.
Contention Window
The content window is the time that comes immediately after IFS. It is divided into smaller time
slots to prevent multiple accesses on a single channel between devices.
The station ready to send the frame chooses a random number of slots as its waiting time.
The content window is first set to one slot, and if the station cannot detect an idle channel after
IFS time, the slot in the window is doubled each time.
The content window is somehow similar to the P-persistent scheme, but here on a channel, the
random outcome defines the total slots occupied by the waiting station.
Station senses the channel after each time slot in the content window. If the station finds the
channel busy, it does not resume the processing of the content window. It stops the timer and
senses the channel. If the station finds the channel idle, it restarts the timer.
Acknowledgments
Collisions can occur on a single channel resulting in loss of frames.
So, the receiver uses the acknowledgment to acknowledge to the sender that it has received the
frame.
The positive acknowledgment and time-out clock guarantee that the receiver has received the
frame sent by the sender.
Ethernet
Ethernet is a technology that works at the data link layer and the physical layer. Ethernet is
defined by the protocols used at the data link layer and the physical layer.
Ethernet uses guided communications such as twisted-pair cables, coaxial cables, and fiber-optic
cables.
Ethernet is defined in the IEEE 802.2 and IEEE 802.3 standards. It supports 10 Mbps to 100 Gbps
data bandwidths.
There are two types of Ethernet in today’s networks
❑ Classic Ethernet
◦ Classic Ethernet solves the multiple access problem.
❑ Switched Ethernet.
◦ In switched Ethernet, the switch connects different computers.
Wireless LAN
Wireless LANs are increasingly popular, and homes, offices, cafes, libraries, airports, zoos, and
other public places are being outfitted with them to connect computers, PDAs, and smart
phones to the Internet.
Wireless LANs can also be used to let two or more nearby computers communicate without
using the Internet.
The main wireless LAN standard is 802.11.
WLAN is a local area network that uses radio communication to provide mobility to the network
users while maintaining the connectivity to the wired network.
A WLAN basically, extends a wired local area network. WLAN's are built by attaching a device
called the access point(AP) to the edge of the wired network.
Clients communicate with the AP using a wireless network adapter which is similar in function to
an ethernet adapter. It is also called a LAWN is a Local area wireless network.
Architecture
802.11 networks can be used in two modes.
The most popular mode is to connect clients, such as laptops and smart phones, to another
network, such as a company intranet or the Internet.
Infrastructure mode
❑ In infrastructure mode, each client is associated with an AP (Access Point) that is in turn connected to
the other network. The client sends and receives its packets via the AP.
❑ Several access points may be connected together, typically by a wired network called a distribution
system, to form an extended 802.11 network.
❑ In this case, clients can send frames to other clients via their APs.
Ad hoc network.
❑ This mode is a collection of computers that are associated so that they can directly send frames to each
other. There is no access point.
❑ Since Internet access is the killer application for wireless, ad hoc networks are not very popular.
Protocol Stack
The physical layer corresponds fairly well to the OSI physical layer, but the data link layer in all
the 802 protocols is split into two or more sublayers.
In 802.11, the MAC (Medium Access Control) sublayer determines how the channel is allocated,
that is, who gets to transmit next.
Above it is the LLC (Logical Link Control) sublayer, whose job it is to hide the differences
between the different 802 variants and make them indistinguishable as far as the network layer
is concerned.
This could have been a significant responsibility, but these days the LLC is a glue layer that
identifies the protocol (e.g., IP) that is carried within an 802.11 frame.
Several transmission techniques have been
added to the physical layer as 802.11 has
evolved since it first appeared in 1997.
Two of the initial techniques, infrared in the
manner of television remote controls and
frequency hopping in the 2.4-GHz band, are
now defunct.
The third initial technique, direct sequence
spread spectrum at 1 or 2 Mbps in the 2.4-GHz
band, was extended to run at rates up to 11
Mbps and quickly became a hit.
It is now known as 802.11b.

You might also like