0% found this document useful (0 votes)
19 views185 pages

CN Mod2

The document provides an overview of the Physical and Data Link Layers of the OSI model, detailing the functions and attributes of the Physical Layer, including signal types, transmission media, data flow, and transmission modes. It also describes various physical topologies (Star, Bus, Ring, and Mesh) and transmission media (Guided and Unguided), highlighting their characteristics, advantages, and disadvantages. Additionally, it covers specific types of guided media such as twisted-pair, coaxial, and fiber-optic cables, as well as unguided media like radio waves and microwaves.

Uploaded by

Harsh Patel
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)
19 views185 pages

CN Mod2

The document provides an overview of the Physical and Data Link Layers of the OSI model, detailing the functions and attributes of the Physical Layer, including signal types, transmission media, data flow, and transmission modes. It also describes various physical topologies (Star, Bus, Ring, and Mesh) and transmission media (Guided and Unguided), highlighting their characteristics, advantages, and disadvantages. Additionally, it covers specific types of guided media such as twisted-pair, coaxial, and fiber-optic cables, as well as unguided media like radio waves and microwaves.

Uploaded by

Harsh Patel
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/ 185

Computer Networks

By,
Prof. Nilam Navil Rais
Module 2

Physical and Data Link Layer


Physical Layer in OSI Model
 The OSI model: Open Systems Interconnection Model, defines
the transmission of data from one system to another in a
computer network.
 Example:

 To successfully communicate between systems of distinct


architectures, the ISO presented the 7-layered OSI model in
1984.
 The individual layer of the OSI model is a package of
3
protocols.
Physical Layer in OSI Model

4
Physical Layer in OSI Model
• It is the layer that interacts with the transmission media,
the physical part of the network that connects network
components together.
• This layer is involved in physically carrying information
from one node in the network to the next.
• It maintains the data quality by implementing the
required protocols on different network modes and
maintaining the bit rate through data transfer using a
wired or wireless medium.
• The data in the data link layer consists of Os and 1s
organized into frames that are ready to be sent across
the transmission medium. This stream of Os and 1s
must first be converted into another entity: signals.
• The physical layer converts the data frame received
from the data link layer into bits, i.e., in terms of ones
5
and zeros.
 Attributes of the physical layer:
1. Signals: The data is first converted to a signal for efficient
data transmission. There are two kinds of signals:
• Analog Signals: These signals are continuous waveforms in
nature and are represented by continuous electromagnetic
waves for the transmission of data.
• Digital Signals: These signals are discrete in nature and
represent network pulses and digital data from the upper
layers.

Analog Signals Digital Signals


6
 Attributes of the physical layer:

2. Transmission media: Data is carried from source


to destination with the help of transmission media.

There are two sorts of transmission media:


• Wired Media: The connection is established with
the help of cables. For example, fiber optic cables,
coaxial cables, and twisted pair cables.
• Wireless Media: The connection is established
using a wireless communication network. For
example, Wi-Fi, Bluetooth, etc.
7
 Attributes of the physical layer:

3. Data Flow: It describes the rate of data flow and


the transmission time frame.

The factors affecting the data flow are as follows:


• Encoding: Encoding data for transmission on the
channel.
• Error-Rate: Receiving erroneous data due to noise
in transmission.
• Bandwidth: The rate of transmission of data in the
channel.
8
 Attributes of the physical layer:
4. Transmission mode: It describes the direction of
the data flow.
Data can be transmitted in three sorts of
transmission modes as follows:
• Simplex mode: a one-way communication where a
device can only send data. Examples are a mouse,
keyboard, etc.
• Half-duplex mode: supports one-way
communication, i.e., either data can be transmitted
or received. An example is a walkie-talkie.
• Full-duplex mode: two-way communication, i.e., the
device can send and receive data at the same time.
An example is cellular communication.
9
 Attributes of the physical layer:
5. Noise in transmission: Transmitted data can get
corrupted or damaged during data transmission due to
many reasons.
Some of the reasons are mentioned below:
• Attenuation: It is a gradual deterioration of the network
signal on the communication channel. When a signal
travels through a medium it loses energy overcoming
the resistance of the medium. Amplifiers are used to
compensate for this loss of energy by amplifying the
signal.
To show the loss or gain of energy the unit “decibel” is
used.
dB = 10log10P2/P1
P1 - input signal
P2 - output signal 10
Attenuation
11
 Attributes of the physical layer:

• Dispersion: In the case of Dispersion, the data is


dispersed and overlapped during transmission, which
leads to the loss of the original data.
• Data Delay: The transmitted data reaches the
destination system outside the specified frame time.

12
Physical Topology

• Physical topology refers to the specification or


structure of the connections of the network between
the devices where the transmission will happen.
• There are four types of topologies, which are as
follows:
1. Star Topology
2. Bus Topology
3. Ring Topology
4. Mesh Topology

13
Physical Topology
1. Star Topology:
• Star topology is a sort of network topology in which
each node or device in the network is individually
joined to a central node, which can be a switch or a
hub. This topology looks like a star, due to which this
topology is called star topology.

14
Physical Topology
2. Bus Topology:
• Bus topology comprises a single communication line
or cable that is connected to each node. The backbone
of this network is the central cable, and each node can
communicate with other devices through the central
cable.

15
Physical Topology
2. Bus Topology:
• The signal goes from the ground terminator to the
other terminator of the wire. The terminator stops the
signal once it reaches the end of the wire to avoid
signal bounce.
• Each computer communicates independently with
other computers in what is called a peer-to-peer
network.
• Each computer has a unique address, so if a message
is to be sent to a specific computer, the device can
communicate directly with that computer.

• The advantage of bus topology is that collapse in one


device will not affect other devices. The bus topology
is not expensive to build because it uses a single wire
16
and works well for small networks..
Physical Topology
3. Ring Topology:
• In a ring topology, the devices are connected in the
form of a ring so that each device has two neighbors
for communication. Data moves around the ring in
one direction.

17
Physical Topology
3. Ring Topology:
• As you can see, all four devices are connected to each
other in the form of a ring. Each device has two
neighbors. Node 2 and Node 4 are neighbors of Node
1; similarly, Node 1 and Node 3 are neighbors of
Node 2, and so on.
• The advantage of ring topology is that if you want to
add another device to the ring, you will need an
additional cable to do so. Similarly, you can remove a
device and join the wires.

18
Physical Topology

4. Mesh Topology:
• In a mesh topology, each system is directly joined to
every other system.

19
Physical Topology
4. Mesh Topology:
• The advantage of mesh topology is that there will be
no traffic issues as each device has a dedicated
communication line.
• If one system is not functioning, it will not affect
other devices.
• It provides more security or privacy.
• The drawback of mesh topology is that it is expensive
and more complex than other topologies.

20
Transmission Media
Transmission medium and physical layer
Classes of transmission media
GUIDED MEDIA

• It is defined as the physical medium through which


the signals are transmitted.
• It is also known as Bounded media.

Types Of Guided media::

1. Twisted-Pair Cable
2. Coaxial Cable
3. Fiber-Optic Cable
Twisted-pair cable

• Twisted pair is a physical media made up of a pair of cables


twisted with each other.
• A twisted pair cable is cheap as compared to other
transmission media.
• Installation of the twisted pair cable is easy, and it is a
lightweight cable.
• The frequency range for twisted pair cable is from 0 to
3.5KHz.
• A twisted pair consists of two insulated copper wires
arranged in a regular spiral pattern.
• The degree of reduction in noise interference is determined
by the number of turns per foot. Increasing the number of
turns per foot decreases noise interference.
Twisted-pair cable
Types of Twisted-pair cable
UTP and STP cables
UTP Unshielded Twisted Pair cables

• An unshielded twisted pair is widely used in telecommunication.

• Following are the categories of the unshielded twisted pair


cable:
1. Category 1: Category 1 is used for telephone lines that have
low-speed data.
2. Category 2: It can support upto 4Mbps.
3. Category 3: It can support upto 16Mbps.
4. Category 4: It can support upto 20Mbps. Therefore, it can be
used for long-distance communication.
5. Category 5: It can support upto 200Mbps.
UTP Unshielded Twisted Pair cables

• Advantages Of Unshielded Twisted Pair:

 It is cheap.
 Installation of the unshielded twisted pair is easy.
 It can be used for high-speed LAN.

• Disadvantage:

 This cable can only be used for shorter distances because of


attenuation.
Shielded Twisted Pair cables

• A shielded twisted pair is a cable that contains the mesh


surrounding the wire that allows the higher transmission
rate.
• Characteristics Of Shielded Twisted Pair:

 The cost of the shielded twisted pair cable is not very


high and not very low.
 An installation of STP is easy.
 It has higher capacity as compared to unshielded
twisted pair cable.
 It has a higher attenuation.
 It is shielded that provides the higher data
transmission rate.
Shielded Twisted Pair cables

• Disadvantages

 It is more expensive as compared to UTP and coaxial


cable.
 It has a higher attenuation rate.
Coaxial Cable

• Coaxial cable is very commonly used transmission


media, for example, TV wire is usually a coaxial cable.
• The name of the cable is coaxial as it contains two
conductors parallel to each other.
• It has a higher frequency as compared to Twisted pair
cable.
• The inner conductor of the coaxial cable is made up of
copper, and the outer conductor is made up of copper
mesh. The middle core is made up of non-conductive cover
that separates the inner conductor from the outer
conductor.
• The middle core is responsible for the data transferring
whereas the copper mesh prevents from the
EMI(Electromagnetic interference).
Coaxial cable
Coaxial cable is of two types:
1.Baseband transmission: It is defined as the process
of transmitting a single signal at high speed.
2.Broadband transmission: It is defined as the process
of transmitting multiple signals simultaneously.

Advantages Of Coaxial cable:


•The data can be transmitted at high speed.
•It has better shielding as compared to twisted pair cable.
•It provides higher bandwidth.

Disadvantages Of Coaxial cable:


•It is more expensive as compared to twisted pair cable.
•If any fault occurs in the cable causes the failure in the
entire network.
Optical fiber cable

•Fibre optic cable is a cable that uses electrical signals for


communication.
•Fibre optic is a cable that holds the optical fibres coated in
plastic that are used to send the data by pulses of light.
•The plastic coating protects the optical fibres from heat, cold,
electromagnetic interference from other types of wiring.
•Fibre optics provide faster data transmission than copper
wires.
Diagrammatic representation of fibre optic cable:
Basic elements of Fibre optic cable:

•Core: The optical fibre consists of a narrow strand of glass


or plastic known as a core. A core is a light transmission
area of the fibre. The more the area of the core, the more
light will be transmitted into the fibre.
•Cladding: The concentric layer of glass is known as
cladding. The main functionality of the cladding is to provide
the lower refractive index at the core interface as to cause
the reflection within the core so that the light waves are
transmitted through the fibre.
•Jacket: The protective coating consisting of plastic is
known as a jacket. The main purpose of a jacket is to
preserve the fibre strength, absorb shock and extra fibre
protection.
Advantages of fibre optic cable over copper::

• Greater Bandwidth: The fibre optic cable provides more


bandwidth as compared copper. Therefore, the fibre optic
carries more data as compared to copper cable.
• Faster speed: Fibre optic cable carries the data in the
form of light. This allows the fibre optic cable to carry the
signals at a higher speed.
• Longer distances: The fibre optic cable carries the data
at a longer distance as compared to copper cable.
• Better reliability: The fibre optic cable is more reliable
than the copper cable as it is immune to any temperature
changes while it can cause obstruct in the connectivity of
copper cable.
• Thinner and Sturdier: Fibre optic cable is thinner and
lighter in weight so it can withstand more pull pressure than
copper cable.
UNGUIDED MEDIA: WIRELESS

• Unguided media transport electromagnetic waves without using a


physical conductor. This type of communication is often referred
to as wireless communication.

• In unguided media, air is the media through which the


electromagnetic energy can flow easily.
• Unguided transmission is broadly classified into three categories:
1. Radio Waves
2. Microwaves
3. Infrared
Radio waves:

•Radio waves are the electromagnetic waves that are


transmitted in all the directions of free space.
•Radio waves are omnidirectional, i.e., the signals are
propagated in all the directions.
•The range in frequencies of radio waves is from 3Khz to 1 Ghz.
•In the case of radio waves, the sending and receiving antenna
are not aligned, i.e., the wave sent by the sending antenna can
be received by any receiving antenna.
•An example of the radio wave is FM radio.
Omnidirectional antenna
Radio waves:

•Applications Of Radio waves:

 A Radio wave is useful for multicasting when there is one


sender and many receivers.
 An FM radio, television, cordless phones are examples of a
radio wave.

•Advantages Of Radio transmission:

 Radio transmission is mainly used for wide area networks


and mobile cellular phones.
 Radio waves cover a large area, and they can penetrate
the walls.
 Radio transmission provides a higher transmission rate.
Microwaves:

•In the electromagnetic spectrum, waves within the frequencies


1GHz to 300GHz are called microwaves.
•Microwaves travel in straight lines, and so the transmitter and
receiver stations should be accurately aligned to each other.
•Since it is unidirectional, it allows multiple receivers in a row to
receive the signals without interference.
•Microwaves do not pass through buildings. So, indoor
receivers cannot be used effectively.
•Microwaves need unidirectional antennas to send out signals.
Microwaves:
Microwaves:

Characteristics of Microwave:

•Bandwidth: It supports the bandwidth from 1 to 10 Mbps.


•Short distance: It is inexpensive for short distance.
•Long distance: It is expensive as it requires a higher tower for a
longer distance.
•Attenuation: Attenuation means loss of signal. It is affected by
environmental conditions and antenna size.
Microwaves:

Advantages Of Microwave:

 Microwave transmission is cheaper than using cables.


 It is free from land acquisition as it does not require any land
for the installation of cables.
 Microwave transmission provides an easy communication in
terrains as the installation of cable in terrain is quite a difficult
task.
 Communication over oceans can be achieved by using
microwave transmission.
Microwaves:

Disadvantages of Microwave transmission:

 Eavesdropping: An eavesdropping creates insecure


communication. Any malicious user can catch the signal in the
air by using its own antenna.
 Out of phase signal: A signal can be moved out of phase by
using microwave transmission.
 Susceptible to weather condition: A microwave transmission
is susceptible to weather condition. This means that any
environmental change such as rain, wind can distort the signal.
 Bandwidth limited: Allocation of bandwidth is limited in the
case of microwave transmission.
Infrared:

• An infrared transmission is a wireless technology used for


communication over short ranges.
• The frequency of the infrared in the range from 300 GHz to
400 THz.
• It is used for short-range communication such as data
transfer between two cell phones, TV remote operation, data
transfer between a computer and cell phone resides in the
same closed area.
Infrared:

• Characteristics Of Infrared:

 It supports high bandwidth, and hence the data rate will be


very high.
 Infrared waves cannot penetrate the walls. Therefore, the
infrared communication in one room cannot be interrupted by
the nearby rooms.
 An infrared communication provides better security with
minimum interference.
 Infrared communication is unreliable outside the building
because the sun rays will interfere with the infrared waves.
Data Link Layer
Data Link Layer Design Issues:
(Functions of Data Link Layer )
• Designing the Data Link Layer involves addressing several
key issues to ensure efficient and reliable communication
over a physical medium.
• Here are some critical design considerations and
challenges:
1. Frame Structure:

• Issue: Determining the format and structure of frames


that encapsulate data from the Network Layer.
• Considerations: Includes the size of headers and
trailers, error detection mechanisms (e.g., CRC), and the
placement of control information.
Data Link Layer Design Issues:
(Functions of Data Link Layer )
2. Error Detection and Correction:
•Issue: Ensuring data integrity despite potential transmission
errors.
•Considerations: Selecting appropriate error detection techniques
(e.g., CRC, parity bits) and error correction mechanisms (e.g.,
ARQ protocols) to handle detected errors effectively.

3. Flow Control:
•Issue: Managing the rate of data transmission between sender and
receiver to prevent data loss or overflow.
•Considerations: Implementing flow control mechanisms such as
sliding window protocols (e.g., Stop-and-Wait, Go-Back-N,
Selective Repeat) to regulate data flow based on the receiver's
capacity.
Data Link Layer Design Issues:
(Functions of Data Link Layer )
4. Access Control:
•Issue: Controlling access to the shared physical medium in multi-
access networks.
•Considerations: Selecting appropriate access control methods
like CSMA/CD (used in Ethernet) or CSMA/CA (used in wireless
networks) to manage medium contention and prevent collisions.

5. Addressing:
•Issue: Assigning and managing unique addresses (e.g., MAC
addresses) to network devices.
•Considerations: Designing efficient addressing schemes to ensure
each device on a network segment is uniquely identified,
facilitating accurate data delivery.
Data Link Layer Design Issues:
(Functions of Data Link Layer )
6. Reliability and Efficiency:
•Issue: Balancing reliability (data integrity and delivery assurance)
with efficiency (minimal overhead and maximum throughput).
•Considerations: Optimizing protocol design and parameters (e.g.,
acknowledgment mechanisms, retransmission strategies) to achieve
a balance between reliability and performance.

7. Compatibility and Interoperability:


•Issue: Ensuring compatibility between different network devices
and technologies.
•Considerations: Designing protocols and standards that facilitate
interoperability across diverse hardware and software environments,
adhering to industry standards (e.g., IEEE standards for Ethernet).
Data Link Layer Design Issues:
(Functions of Data Link Layer )
8. Security:
•Issue: Protecting data confidentiality, integrity, and availability
at the Data Link Layer.
•Considerations: Integrating security features such as
encryption, authentication, and access control mechanisms into
the Data Link Layer protocols to safeguard network
communications.

9. Scalability:
•Issue: Supporting network growth and increasing demands for
bandwidth and connectivity.
•Considerations: Designing scalable protocols and architectures
that can accommodate expanding network infrastructures and
evolving technological advancements.
Data Link Layer Design Issues:
(Functions of Data Link Layer )

10. Performance Optimization:

• Issue: Enhancing network performance in terms of latency,


throughput, and response times.
• Considerations: Implementing efficient data handling
techniques, reducing protocol overhead, and leveraging
hardware acceleration to optimize Data Link Layer
performance.
Services Provided to Network Layer:

• DLL takes packets from network layer from


source m/c to network layer to destination m/c.
Types of Services provided by Data Link Layer :

The Data link layer generally provides or offers three types of


services as given below :

1. Unacknowledged Connectionless Service


2. Acknowledged Connectionless Service
3. Acknowledged Connection-Oriented Service
Unacknowledged Connectionless Service :

• In this service, source machine generally transmits


independent frames to destination machine without having
destination machine to acknowledge these frames.
• This service is called as connectionless service because there
is no connection established among sending or source
machine and destination or receiving machine before data
transfer or release after data transfer.
• In Data Link Layer, if anyhow frame is lost due to noise,
there will be no attempt made just to detect or determine loss
or recovery from it. This simply means that there will be no
error or flow control.
• An example can be Ethernet.
Acknowledged Connectionless Service :

• provides acknowledged connectionless service i.e. packet delivery


is simply acknowledged, with help of stop and wait for protocol.
• each frame that is transmitted by Data Link Layer is simply
acknowledged individually and then sender usually knows
whether or not these transmitted data frames received safely.
• There is no logical connection established and each frame that is
transmitted is acknowledged individually.
• simply provides means by which user of data link can just send or
transfer data and request return of data at the same time.
• It also uses particular time period that if it has passed frame
without getting acknowledgment, then it will resend data frame on
time period.
• more reliable than unacknowledged connectionless service.
• generally useful over several unreliable channels, like wireless
systems, Wi-Fi services, etc.
Acknowledged Connection-Oriented Service :

• In this type of service, connection is established first among


sender and receiver or source and destination before data is
transferred.
• Then data is transferred or transmitted along with this established
connection.
• In this service, each of frames that are transmitted is provided
individual numbers first, so as to confirm and guarantee that each
of frames is received only once that too in an appropriate order
and sequence.
Frames and Packets:

• A frame is a structured unit of data at the Data Link Layer of the


OSI model or the DLL in the TCP/IP model.
• Frames are created by encapsulating the Network Layer (Layer 3)
packets into a format suitable for transmission over the physical
medium (such as Ethernet, Wi-Fi, etc.).
Structure of a Frame:

Frames typically consist of the following components:

• Header: It contains the source and the destination addresses of


the frame.

• Payload: The payload is the actual data from the Network Layer
packet

• Trailer (optional): It contains the error detection and error


correction bits.
Frames and Packets

Features Frames Packets


A frame is a type of data A packet is a protocol data
Definition unit that is utilized in the unit utilized in the network
data link layer. layer.

It has the source and It has the source and


Includes
destination MAC address. destination IP address.

Frames are created in the The packets are created in


Associated OSI layer
OSI's data link layer. the network layer.

It is encapsulated within a
Correlation It encapsulates a packet.
frame.
It is associated with Layer It is associated with Layer
Layer
2. 3.

Addressing It has physical addressing. It has logical addressing.


FRAMING

• The data link layer needs to pack bits into frames, so


that each frame is distinguishable from another.
• The simple act of inserting a letter into an envelope
separates one piece of information from another; the
envelope serves as the delimiter.
Types of Framing:

• Framing can be of two types:


1. fixed sized framing
2. variable sized framing.

• Fixed-sized Framing
 Here the size of the frame is fixed and so the frame
length acts as delimiter of the frame. Consequently, it
does not require additional boundary bits to identify the
start and end of the frame.
 Example − ATM cells.
 Drawback: It goes through internal fragmentation when
the size of data is less than as compared to the size of
the frame.
Types of Framing:

• Variable – Sized Framing


 Here, the size of each frame to be transmitted may
be different. So additional mechanisms are kept to
mark the end of one frame and the beginning of the
next frame.
 It is used in local area networks.
• Three approaches:
1. Character count
2. Character-oriented protocol (Byte Stuffing)
3. Bit-oriented protocol (Bit Stuffing)
Character count:

• The first framing method uses a field in the header to


specify the number of characters in the frame.
• When the data link layer at the destination sees the
character count, it knows how many characters follow
and hence where the end of the frame is.
Character count:
Character-Oriented protocol :

• Data is 8 bit characters


• Header, the source and destination addresses and other
control information
• Trailer, error detection or error correction
• To separate one frame from the next, an 8bit (1 byte) flag
is added at the beginning and end of the frame.
• Flags may contain special characters.
Character-Oriented protocol :

• Any pattern used for the flag could also be part of the
information.
• If this happens, the receiver, when it encounters this
pattern in the middle of the data, thinks it has reached
the end of the frame.
• To fix this problem, a byte-stuffing (or character
stuffing) strategy is added to character-oriented
framing.
Character-Oriented protocol (Byte Stuffing) :

• In byte stuffing, a special byte is added to the data section of


the frame when there is a character with the same pattern as
the flag.
• This byte is called the ESCAPE character(ESC)
• When the receiver encounters the ESC character, it removes
it from data section and treats the next character as data and
not a flag.
• Byte stuffing by the escape character allows the presence of
the flag in the data section of the frame, but it creates another
problem that if the text contains one or more escape
characters followed by a flag then the receiver removes the
escape character, but keeps the flag, which is incorrectly
interpreted as the end of the frame.
Character-Oriented protocol (Byte Stuffing) :

• To solve this problem, the escape characters that are part of


the text must also be marked by another escape character.
• In other words, if the escape character is part of the text, an
extra one is added to show that the second one is part of the
text.
Character-Oriented protocol (Byte Stuffing) :
Character-Oriented protocol (Byte Stuffing) :
Character-Oriented protocol (Byte Stuffing) :

Limitations of Character-Oriented Protocol:

 Character-oriented framing is suitable when only text


exchanged by the data link layers. It is not useful for
sending other types of information such as graphs,
images audio, and video or other multimedia data.
 Character-oriented protocols present another problem in
data communications. The universal coding systems in
use today, such as Unicode, have 16-bit and 32-bit
characters that conflict with 8-bit characters.
Bit oriented protocol (Bit Stuffing ):
• Each frame begins and ends with a special bit pattern,
01111110
• Whenever the sender's data link layer encounters five
consecutive 1s in the data, it automatically stuffs a 0 bit into the
outgoing bit stream.
• This bit stuffing is analogous to byte stuffing, in which an
escape byte is stuffed into the outgoing character stream
before a flag byte in the data.
• When the receiver sees five consecutive incoming 1 bits,
followed by a 0 bit, it automatically destuffs (i.e., deletes) the 0
bit.
• Just as byte stuffing is completely transparent to the network
layer in both computers, so is bit stuffing.
• If the user data contain the flag pattern, 01111110, this flag is
transmitted as 011111010 but stored in the receiver's memory
as 01111110.
A frame in a bit-oriented protocol
Bit stuffing and unstuffing:
FLOW AND ERROR CONTROL:

• Data communication requires at least two devices working


together, one to send and the other to receive.
• Even such a basic arrangement requires a great deal of
coordination for an intelligible exchange to occur.
• The most important responsibilities of the data link layer are
flow control and error control.
• Collectively, these functions are known as data link control.
Flow control refers to a set of procedures
used to restrict the amount of data that
the sender can send before waiting for
acknowledgment.
Error control in the data link layer is
based on automatic repeat request,
which is the retransmission of data.
Error Detection and Correction
Error Types

• Whenever bits flow from one point to


another, they are subject to unpredictable
changes because of interference.
• This interference can change the shape of
the signal.
• Error Types:
1. Single-Bit Error
2. multiple bit errors
2. Burst Error
Error Types

• Single bit error − In the received frame, only


one bit has been corrupted, i.e. either
changed from 0 to 1 or from 1 to 0.
Error Types

• Multiple bits error − In the received frame,


more than one bits are corrupted.
Error Types

• Burst Error:
 The two or more bits are changed from 0 to
1 or from 1 to 0 is known as Burst Error.
 The Burst Error is determined from the first
corrupted bit to the last corrupted bit.
Redundancy

Error detection and correction uses the


concept of redundancy, which means adding
extra bits for detecting errors at the
destination.
Redundancy
Detection versus Correction

• In error detection, we are looking only to see


if any error has occurred. Answer is yes or no.

• In error correction, we need to know the


exact number of bits that are corrupted and their
location in the message.

• Number of the errors and the size of the


message are important factors.
Methods for error correction:

• Forward error correction


–Receiver tries to guess the message by using
redundant bits. (for small no. of errors)

• Retransmission
–Receiver detects the error and asks the sender
for retransmission.
Coding

• Redundancy is done through coding


• Coding analyses the existing data to generate
redundant bits
• The data and redundant bits are sent to
receiver
• The receiver checks the data with the
redundant bits to see if any error has occurred
General idea of coding
Coding

• Two categories of coding:


1. Block coding:
 Linear Block codes
 Cyclic Codes
2. Convolution coding (not in syllabus)
Linear Block codes

1. Single parity check


2. Two-dimensional parity check
3. Hamming Code
Single Parity Check

• Single Parity checking is the simple mechanism


and inexpensive to detect the errors.
• In this technique, a redundant bit is also known as
a parity bit which is appended at the end of the data
unit so that the number of 1s becomes even.
Therefore, the total number of transmitted bits would
be 9 bits.
• If the number of 1s bits is odd, then parity bit 1 is
appended and if the number of 1s bits is even, then
parity bit 0 is appended at the end of the data unit.
Single Parity Check

• At the receiving end, the parity bit is calculated from


the received data bits and compared with the
received parity bit.
• This technique generates the total number of 1s even,
so it is known as even-parity checking.
Single Parity Check
Drawbacks Of Single Parity Checking

•It can only detect single-bit errors which are very rare.
•If two bits are interchanged, then it cannot detect the
errors.
Two-Dimensional Parity Check

• Performance can be improved by using Two-


Dimensional Parity Check which organizes the
data in the form of a table.
• Parity check bits are computed for each row,
which is equivalent to the single-parity check.
• In Two-Dimensional Parity check, a block of bits
is divided into rows, and the redundant row of bits
is added to the whole block.
• At the receiving end, the parity bits are compared
with the parity bits computed from the received
data.
Two-Dimensional Parity Check
Two-Dimensional Parity Check

Drawbacks Of 2D Parity Check

•If two bits in one data unit are corrupted and two bits
exactly the same position in another data unit are also
corrupted, then 2D Parity checker will not be able to detect
the error.
•This technique cannot be used to detect the 4-bit errors or
more in some cases.
Hamming codes

Hamming Weight:
• The Hamming weight of a codeword is equal to the number of
non-zero elements in the codeword.
• Hamming weight of a codeword c is denoted by w(c). It refers to
the number of 1’s in a binary code.

• Example:

Consider a code C= {0100, 1111},


It has two codewords: 0100 and 1111.
Hamming weight of these codewords is w(0100)=1 and w(1111)=4.
Here, w(0100) has a hamming weight of 1 because it has one non-
zero element (0100) in its codeword.
Similarly, w(1111) has a hamming weight of 4 as it has four non-
zero elements (1111) in it.
Hamming codes

Hamming Distance
• Hamming distance between two codewords is the number of
places by which the codewords differ.
• For two codes c1 and c2, the hamming distance is denoted as
d(c1 ,c2).
• It is the number of positions at which corresponding symbols of
two equal length strings are different.
• It is named after Richard Hamming, an American mathematician
and computer engineer.
• Example:
Considering codewords c1=0100 and c2=1111,
the hamming distance between the two codewords is 3 because they
differ at the 1st, 3rd and 4th places in the code.
Hamming codes

Minimum Hamming Distance


• For two codewords of same length, it is define as the minimum or
smallest hamming distance between the two codewords.
• It is calculated by counting the number of positions in which the
corresponding symbols are different.
• It is denoted by d* or dmin.
• Example: Consider four codewords as: c1=010, c2=011, c3=111,
c4=101. The hamming distance between codewords is:
010 ⊕ 011 = 001, d(010, 011) = 1
010 ⊕ 111 = 101, d(010, 111) = 2
010 ⊕ 101 = 111, d(010, 101) = 3
011 ⊕ 111 = 100, d(011, 111) = 1
011 ⊕ 101 = 110, d(011, 101) = 2
111 ⊕ 101 = 010, d(111, 101) = 1;
Therefore the minimum hamming distance is dmin = 1, as from
all hamming distances smallest value is 1.
Important Terms for Hamming Code

1. Redundant Bits - These are the extra binary bits added externally
into the original data bit to prevent damage to the transmitted data and
are also needed to recover the original data.

The expression applied to deduce the redundant value is,

2 ^ r >= d+r+1
Where, d - “Data Bits”
r - “Redundant Bits”, r = {1, 2, 3, …….. n}

Example: Assuming the number of data bits is 7, find the number of


redundant bits.
2^r >= r+7+1
2^4 >=4+8 [r=4]
The number of redundant bits = 4.
Working of Hamming Code

Step 1 – Find the position of the data bits and the number of redundant
bits in the original data. The number of redundant bits is deduced from
the expression [2^r >= d+r+1].

Step 2 - Fill in the data bits and redundant bit, and find the parity bit
value using the expression [2^p, where, p - {0,1,2, …… n}].

Step 3 - Fill the parity bit obtained in the original data and transmit the
data to the receiver side.

Step 4 - Check the received data using the parity bit and detect any error
in the data, and in case damage is present, use the parity bit value to
correct the error.
Example for Hamming Code

Example 1: The data bit to be transmitted is 1011010., to be solved using


the hamming code method.

•Determining the Number of Redundant Bits and their Position in


the Data,
The data bits = 7
The redundant bit,
2^r >= d+r+1
2^4 >= 7+4+1
16 >= 12, [So, the value of r = 4.]
Position of the redundant bit, applying the 2^p expression:
2^0 - P1
2^1 - P2
2^2 - P4
2^3 - P8
Example for Hamming Code

Applying the data bits in Fig. 1.


Example for Hamming Code

Finding the Parity Bits, for ”Even parity bits,”


1. P1 parity bit is deduced by checking
all the bits with 1’s in the least significant
location.

P1: 1, 3, 5, 7, 9, 11

P1 - P1, 0, 1, 1, 1, 1
P1 - 0
Example for Hamming Code

Finding the Parity Bits, for ”Even parity bits,”

2. P2 parity bit is deduced by checking all


the bits with 1’s in the second significant
location.
P2: 2, 3, 6, 7, 10, 11

P2 - P2, 0, 0, 1, 0, 1
P2 - 0
Example for Hamming Code

Finding the Parity Bits, for ”Even parity bits,”

3. P4 parity bit is deduced by checking all the bits with 1’s in the third
significant location.
P4: 4, 5, 6, 7

P4 - P4, 1, 0, 1
P4 - 0
4. P8 parity bit is deduced by checking all the bits with 1’s in the fourth
significant location.
P8: 8, 9, 10, 11

P8 – P8, 1, 0, 1
P8 - 0
Example for Hamming Code

So, the original data to be transmitted to the receiver side is:


Example for Hamming Code

Error Detecting and Correction of the Data Received:


Assume that during transmission, the data bit at position 7 is changed from
1 to 0. Then by applying the parity bit technique, we can identify the error:
Example for Hamming Code

Error Detecting and Correction of the Data Received:

To identify the position of the error bit, use the new parity values as,
0 1 1 1
[0+2^2+2^1+2^0]
7, i.e., same as the assumed error position.

To correct the error, simply reverse the error bit to its complement, i.e., for
this case, change 0 to 1, to obtain the original data bit.
Example for Hamming Code

Example 2: The data bit to be transmitted is 111011., to be solved using


the hamming code method.

•Determining the Number of Redundant Bits and Position in the


Data,
The data bits = 6
The redundant bit,
2^r >= d+r+1
2^4 >= 6+4+1
16 >= 11, [So, the value of r = 4.]
Position of the redundant bit, applying the 2^p expression:
2^0 - P1
2^1 - P2
2^2 - P4
2^3 - P8
Example for Hamming Code

Applying the data bits in Fig. 1.

1 1 P8 1 0 1 P4 1 P2 P1
Example for Hamming Code

Finding the Parity Bits, for ”Even parity bits,”

1. P1 parity bit is deduced by checking all the bits with 1’s in the least
significant location.
P1: 1, 3, 5, 7, 9

P1 - P1, 1, 1, 1, 1
P1 - 0

2. P2 parity bit is deduced by checking all the bits with 1’s in the second
significant location.
P2: 2, 3, 6, 7, 10

P2 - P2, 1, 0, 1, 1
P2 - 1
Example for Hamming Code

Finding the Parity Bits, for ”Even parity bits,”

3. P4 parity bit is deduced by checking all the bits with 1’s in the third
significant location.
P4: 4, 5, 6, 7

P4 - P4, 1, 0, 1
P4 - 0
4. P8 parity bit is deduced by checking all the bits with 1’s in the fourth
significant location.
P8: 8, 9, 10

P8 – P8, 1, 1
P8 - 0
Example for Hamming Code

So, the original data to be transmitted to the receiver side is:

1 1 0 1 0 1 0 1 1 0
Example for Hamming Code

Error Detecting and Correction of the Data Received:

Assuming that there is an error during transmission in the above hamming


code example, and the data bit at position 5 changes from 1 to 0.

10 9 8 7 6 5 4 3 2 1
1 1 0 1 0 1 0 1 1 0

1 1 0 1 0 0 0 1 1 0

Then by applying the parity bit technique, we can identify the error:
P1: 1, 3, 5, 7, 9

P1 - 0, 1, 0, 1, 1
P1 - 1
Example for Hamming Code

Error Detecting and Correction of the Data Received:

10 9 8 7 6 5 4 3 2 1
1 1 0 1 0 1 0 1 1 0

1 1 0 1 0 0 0 1 1 0
P2: 2, 3, 6, 7, 10 P4: 4, 5, 6, 7

P2 - 1, 1, 0, 1, 1 P4 - 0, 0, 0, 1
P2 -0 P4 - 1

P8: 8, 9, 10

P8 – 0, 1, 1
P8 - 0
Example for Hamming Code

Error Detecting and Correction of the Data Received:


Parity values obtained in the above deduction vary from the originally
deduced parity values, proving that an error occurred during data
transmission.
To identify the position of the error bit, use the new parity values as,
0 1 0 1
[0+2^2+0+2^0]
5 i.e., same as the assumed error position.

To correct the error, simply reverse the error bit to its complement, i.e., for
this case, change 1 to 0, to obtain the original data bit.
10 9 8 7 6 5 4 3 2 1
1 1 0 1 0 0 0 1 1 0

original data: 1 1 0 1 0 1 0 1 1 0
Checksum

• A Checksum is an error detection technique based on


the concept of redundancy.

• It is divided into two parts:


1. Checksum Generator
2. Checksum Checker
Checksum

1. Checksum Generator

 A Checksum is generated at the sending side.


 Checksum generator subdivides the data into equal
segments of n bits each, and all these segments are
added together by using one's complement arithmetic.

 The sum is complemented and appended to the


original data, known as checksum field.

 The extended data is transmitted across the network.


Checksum

The Sender follows the given steps:

1. The block unit is divided into k sections, and each of


n bits.
2. All the k sections are added together by using one's
complement to get the sum.
3. The sum is complemented and it becomes the
checksum field.
4. The original data and checksum field are sent across
the network.
Checksum

Checksum Checker

 A Checksum is verified at the receiving side.


 The receiver subdivides the incoming data into equal
segments of n bits each, and all these segments are
added together, and then this sum is complemented.

 If the complement of the sum is zero, then the data is


accepted otherwise data is rejected.
Checksum

•The Receiver follows the given steps:


1. The block unit is divided into k sections and each of n bits.
2. All the k sections are added together by using one's complement
algorithm to get the sum.
3. The sum is complemented.
4. If the result of the sum is zero, then the data is accepted otherwise
the data is discarded.
Checksum
Checksum

Example:

Suppose that the sender wants to send 4 frames each of 8 bits,


where the frames are 11001100, 10101010, 11110000 and
11000011.
Example:
Cyclic Redundancy Check (CRC)

• The Cyclic Redundancy Check (CRC)first generate a short


binary sequence that is called as CRC code. It is created by
performing a mathematical operation on the data being
transmitted.
• CRC uses Generator Polynomial which is available on both
sender and receiver side.
• Example:
Generator polynomial is of the form like x^3 + x + 1.
This represents key 1011.
x2 + 1 represents key 101.
Cyclic Redundancy Check (CRC)
Cyclic Redundancy Check (CRC)

• Sender Side (Generation of Encoded Data from Data and


Generator Polynomial (or Key)):

1. The binary data is first augmented by adding k-1 zeros in the end
of the data
2. Use modulo-2 binary division to divide binary data by the key and
store remainder of division.
3. Append the remainder at the end of the data to form the encoded
data and send the same
• Receiver Side (Check if there are errors introduced in
transmission):

1. Perform modulo-2 division again and if the remainder is 0, then


there are no errors.
Cyclic Redundancy Check (CRC)

• Modulo 2 Division:

1. In each step, a copy of the divisor (or data) is XORed with


the k bits of the dividend (or key).
2. The result of the XOR operation (remainder) is (n-1) bits,
which is used for the next step after 1 extra bit is pulled down
to make it n bits long.
3. When there are no bits left to pull down, we have a result.
The (n-1)-bit remainder which is appended at the sender
side.
Cyclic Redundancy Check (CRC)

• Example 1 (No error in transmission):

Data word to be sent - 100100

Key - 1101
3 2
[ Or generator polynomial x + x + 1]
Cyclic Redundancy Check (CRC)

Sender Side:

Remainder is 001
Hence the encoded data sent is:
100100001.
Cyclic Redundancy Check (CRC)

Receiver Side:
Code word received at the receiver side 100100001

The remainder is all zeros.


Hence, the data received has no error.
Cyclic Redundancy Check (CRC)

Example 2: (Error in transmission)

Data word to be sent - 100100

Key - 1101
Cyclic Redundancy Check (CRC)

Sender Side:

Remainder is 001
Hence the encoded data sent is:
100100001.
Cyclic Redundancy Check (CRC)

Receiver Side:

Let there be an error in transmission media

Code word received at the receiver side - 100000001


Cyclic Redundancy Check (CRC)

Receiver Side:

Since the remainder is not all


zeroes, the error is detected at
the receiver side.
Elementary Data Link Protocols
NOISELESS CHANNELS

• an ideal channel in which no frames are lost,


duplicated, or corrupted.
• The noiseless channel has the following two
protocols:

1. Simplest Protocol
2. Stop-and-Wait Protocol
1. SIMPLEST Protocol:

• direct transfer of data from the source to the destination without any
intermediate processing.
• the channel is assumed to be noise-free
• sending one bit at a time, with no error correction or flow control
mechanisms in place.
• does not have any mechanisms for controlling the flow of data or
detecting and correcting errors
• protocol assumes that the receiver is always ready to process any data
frames sent by the sender immediately.
• only allows data to flow from the sender to the receiver, is known as a
one-way protocol.
• this protocol is unidirectional, there is no need for an acknowledgment
or confirmation of receipt.
• there is no data loss during transmission, there is no need to resend or
retransmit the data.
Flow Diagram in Simplest Protocol:
2. STOP-AND-WAIT Protocol

• used for reliable data transmission in a noiseless channel.


• the sender sends a single packet at a time and waits for an
acknowledgment (ACK) from the receiver before sending the
next packet.
• This way, the sender can ensure that each packet is received
by the receiver and has been successfully processed.
• If the sender does not receive an ACK within a certain time
frame, the packet is considered lost and must be
retransmitted.
• simple and efficient, but it has one major drawback.
• only one packet can be transmitted at a time, the overall data
transmission rate is relatively slow.
2. STOP-AND-WAIT Protocol

• flow of data frames at the receiver side may become too fast for
it to be processed, causing the need for temporary storage.
• the limited storage space of the receiver may result in the loss
or discarding of frames, or even denial of service.
• To prevent this, the sender must slow down their rate of
transmission, which is achieved through the use of ACK
messages from the receiver.
• The sender sends a single frame and waits for confirmation
from the receiver before sending the next one, adding flow
control to the previous protocol.
• communication remains unidirectional for data frames, but
ACK frames flow in the opposite direction.
Flow Diagram of STOP-AND-WAIT Protocol :
NOISY CHANNELS

• used in communication systems where the transmission


channel may introduce errors into the transmitted data.
• designed to deal with errors in the communication channel
and ensure that the data being transmitted is received
accurately at the receiver end.
• minimize the error rate in the transmitted data by using
techniques such as error detection and correction, flow
control, and retransmission of lost or corrupted data
frames.
• The noiseless channel have following protocols:
1. Stop-and-Wait Automatic Repeat Request
2. Go-Back-N Automatic Repeat Request
3. Selective Repeat Automatic Repeat Request
1. STOP-AND-WAIT ARQ Protocol:

• used for reliable data transmission over a noisy channel.


• the sender only sends one frame at a time and waits for an
acknowledgment (ACK) from the receiver before sending
the next frame.
• This helps to ensure that the receiver receives the data
correctly and eliminates the need for retransmission in the
case of errors caused by the noisy channel.
• The sender continuously monitors the channel for errors,
and if an error is detected, it waits for the next ACK before
resending the frame.
• This protocol adds error control to the basic unidirectional
communication of data frames and ACK frames in the
opposite direction.
Note

Error correction in Stop-and-Wait ARQ is


done by keeping a copy of the sent
frame and retransmitting of the frame
when the timer expires.
Note

In Stop-and-Wait ARQ, we use sequence


numbers to number the frames.
The sequence numbers are based on
modulo-2 arithmetic.
Note

In Stop-and-Wait ARQ, the


acknowledgment number always
announces in modulo-2 arithmetic the
sequence number of the next frame
expected.
1. STOP-AND-WAIT ARQ Protocol:
2. GO-BACK-N ARQ Protocol:

• The Go-Back-N ARQ protocol is a type of sliding window


protocol where the sender transmits a window of packets to
the receiver, and the receiver sends back an acknowledgment
(ACK) to the sender indicating successful receipt of the
packets.
• The size of the sender window in Go Back N ARQ is equal to
N.
• The size of the receiver window in Go Back N ARQ is equal
to 1.
• When the acknowledgment for one frame is not received by
the sender or the frames received by the receiver are out of
order, then the whole window starting from the corrupted
frame is retransmitted.
2. GO-BACK-N ARQ Protocol:
3. Selective Repeat ARQ:

• sender sends several frames specified by a window size even


without the need to wait for individual acknowledgement from the
receiver

• retransmitted frame is received out of sequence.

• only the lost or error frames are retransmitted, whereas correct


frames are received and buffered.

• The receiver while keeping track of sequence numbers buffers the


frames in memory and sends NACK for only frames which are
missing or damaged.

• The sender will send/retransmit a packet for which NACK is


received.
3. Selective Repeat ARQ:
Sub-layers of Data Link Layer:

• The data link layer is classified into two sub-layers:

1. Logical Link Control (LLC) or Data Link Control (DLC) Sublayer


2. Media Access Control (MAC) Sublayer:
Sub-layers of Data Link Layer

1. Logical Link Control (LLC) or Data Link Control (DLC)


Sublayer :

 LLC or DLC is the topmost layer of the data link layer.


 It deals with the communication between the lower layers and
upper layers.
 This sublayer runs above the data link layer and provides flow
control and error information.
 It is responsible for assigning the frame sequence number.
 It specifies the mechanism that can be used to address stations on
a transmission medium and to control the data exchanged between
the sender and the receiver.
Sub-layers of Data Link Layer

2. Media Access Control (MAC) Sublayer :

 The bottom sublayer of the Data Link Layer is the Media Access
Control.
 It is also known as Medium Access Control.
 It provides multiplexing and flow control for the transmission media.
 The main responsibility of this sublayer is to encapsulate the frame,
check for transmission errors, and then allow the frame to be
forwarded to the upper layer.
 It determines who is permitted to access the media at any given
time.
THE CHANNEL ALLOCATION PROBLEM

• In broadcast networks, single channel is shared by several


stations.
• This channel can be allocated to only one transmitting user at a
time.
• There are two different methods of channel allocations:

1. Static Channel Allocation- a single channel is divided among


various users either on the basis of frequency (FDM) or on the basis
of time (TDM). In FDM, fixed frequency is assigned to each user,
whereas, in TDM, fixed time slot is assigned to each user.

2. Dynamic Channel Allocation- no user is assigned fixed frequency


or fixed time slot. All users are dynamically assigned frequency or
time slot, depending upon the requirements of the user
MULTIPLE ACCESS PROTOCOLS

• Many protocols have been defined to handle the access to shared


link.

• These protocols are organized in three different groups:

1. Random Access Protocols


2. Controlled Access Protocols
3. Channelization Protocols
Random Access Protocols

• There is no rule that decides which station should send next.


• If two stations transmit at the same time, there is collision and the
frames are lost.
• The various random access methods are:
1. ALOHA
2. CSMA (Carrier Sense Multiple Access)
3. CSMA/CD (Carrier Sense Multiple Access with Collision
Detection)
4. CSMA/CA (Carrier Sense Multiple Access with Collision
Avoidance)
ALOHA

• ALOHA is a multiple-access protocol that allows data to be


transmitted via a shared network channel.
• It was developed by Norman Abramson in the 1970s at the
University of Hawaii.
• Each node or station in ALOHA transmits a frame without
attempting to determine whether the transmission channel is
idle or busy.
• If the channel is idle, the frames will be successfully
transmitted.
• If two frames try to occupy the channel at the same time, they
will collide and be discarded.
• These stations may opt to retransmit the corrupted frames
until successful transmission occurs.
ALOHA

• Types of ALOHA in Computer Network

1. Pure Aloha
2. Slotted Aloha
Pure Aloha

• In pure Aloha, if each station transmits data to a channel without


determining if the channel is idle or not, a collision may occur,
and the data frame may be lost.
• When any station sends a data frame to a channel, the pure
Aloha waits for the receiver's acknowledgment.
• If the receiver's acknowledgment is not received within the given
time, the station waits for a random amount of time, known as
the backoff time (Tb).
• Furthermore, the station may believe the frame has been lost or
destroyed.
• As a result, it retransmits the frame until all of the data is properly
delivered to the receiver.
Pure Aloha:
Pure Aloha

Vulnerable Time for Pure Aloha:

• We assume that the stations send fixed-length frames, which


takes Tt time( Transmission Time) to transmit the frames
completely.
• The Vulnerable time for any station must be twice the
transmission time because to stop the collision of frames, we
must make sure that no other station starts its transmission
between Tt time before and Tt time after the transmitting station.

• Vulnerable Time for Pure Aloha , Vt​=2∗Tt​

Where,
Vt​ is a Vulnerable Time for Pure Aloha,
Tt is the Transmission Time of the station.
Pure Aloha

Vulnerable Time for Pure Aloha:


Pure Aloha

Throughput of Pure Aloha:

Suppose G is the average number of frames created by the system


during a single-frame transmission period. Then the average number
of successful ALOHA transmissions is given by S.
−2G
S=G∗e
• The value of S will be maxed if G=1/2G=1/2.
• So the Smax is 0.184.
• In other words, if one-half a frame is generated during one frame
transmission time, 18.4 percent of these frames will reach their
destination successfully.
• The efficiency of Pure Aloha is 18.4%.
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.
Slotted Aloha
CSMA (Carrier Sense Multiple Access)

• sense the traffic on a channel (idle or busy) before transmitting the


data.
• It means that if the channel is idle, the station can send data to the
channel. Otherwise, it must wait until the channel becomes idle.
• Hence, it reduces the chances of a collision on a transmission
medium.
• CSMA Modes:

1. 1-Persistent:
 In the 1-Persistent mode of CSMA that defines each node,
first sense the shared channel and if the channel is idle, it
immediately sends the data.
 Else it must wait and keep track of the status of the channel
to be idle and broadcast the frame unconditionally as soon
as the channel is idle.
CSMA (Carrier Sense Multiple Access)

1. 1-Persistent:
 If the station detects the channel as idle then the station will
immediately send the data frame with 1 probability that’s why
the name of this method is 1-persistent.
 In this method, there is a high possibility of collision as two or
more station senses the channel idle at the same time and
transmits data simultaneously which may lead to a collision.
CSMA (Carrier Sense Multiple Access)

The behavior of the 1-persistent method of CSMA:


CSMA (Carrier Sense Multiple Access)

2. Non-Persistent:
 In this method of CSMA, if the station finds the channel busy then it
will wait for a random amount of time before sensing the channel
again.
 If the station wants to transmit the data then first of all it will sense
the medium.
 If the medium is idle then the station will immediately send the data.
 Otherwise, if the medium is busy then the station waits for a random
amount of time and then again senses the channel after waiting for
a random amount of time.
 there is less chance of collision in comparison to the 1-persistent
method as this station will not continuously sense the channel but
waiting for a random amount of time.
 the random amount of time is unlikely to be the same for two
stations that’s why this method reduces the chance of collision.
CSMA (Carrier Sense Multiple Access)

2. Non-Persistent:
CSMA (Carrier Sense Multiple Access)

The behavior of the Non-persistent method of CSMA:


CSMA (Carrier Sense Multiple Access)

3. P-Persistent:
• When the transmitting node is ready to transmit data, it senses the
transmission medium for idle or busy.
• If idle, then it transmits immediately.
• If busy, then it senses the transmission medium continuously until it
becomes idle, then transmits with probability p.

4. O- Persistent:
• In this method of CSMA supervisory node assigns a transmission
order to each node in the network.
• When the channel is idle instead of immediately sending the data
channel will wait for its transmission order assigned to them.
CSMA CD
(Carrier Sense Multiple Access Collision Detection)

• used to detect a collision in the media access control (MAC) layer.


• Once the collision was detected, the CSMA CD immediately
stopped the transmission by sending the signal so that the sender
does not waste all the time to send the data packet.
• Suppose a collision is detected from each station while
broadcasting the packets.
• In that case, the CSMA CD immediately sends a jam signal to stop
transmission and waits for a random time context before
transmitting another data packet.
• If the channel is found free, it immediately sends the data and
returns it.
CSMA/CA

(Carrier Sense Multiple Access Collision Avoidance)

• it is a network protocol that uses to avoid a collision rather than


allowing it to occur, and it does not deal with the recovery of
packets after a collision.
• In CSMA CA, whenever a station sends a data frame to a channel,
it checks whether it is in use.
• If the shared channel is busy, the station waits until the channel
enters idle mode.
• Hence, we can say that it reduces the chances of collisions and
makes better use of the medium to send data packets more
efficiently.

You might also like