Mac Sublayer
Mac Sublayer
CSMA CD
Disadvantage of CSMA CD
CSMA/CA
Advantage of CSMA CA
S. No CSMA CD CSMA CA
It is the type of
It is the type of
CSMA to
CSMA to avoid
detect the
1. collision on a
collision on a
shared
shared
channel.
channel.
It is the It is the
collision collision
2.
detection avoidance
protocol. protocol.
It is used in the
It is used in
802.11
3. 802.3 Ethernet
Ethernet
network cable.
network.
It works in It works in
4. wired wireless
networks. networks.
It is effective It is effective
after collision before collision
5.
detection on a detection on a
network. network.
It minimizes It minimizes
7. the recovery the risk of
time. collision.
It is more
It is less
popular than
9. popular than
the CSMA CA
CSMA CD.
protocol.
CSMA/CA
This method was developed to decrease the chances of collisions
when two or more stations start sending their signals over the data
link layer. Carrier Sense multiple access requires that each
station first check the state of the medium before sending.
The persistence methods can be applied to help the station take
action when the channel is busy/idle.
1. Carrier Sense Multiple Access with Collision Detection
(CSMA/CD):
In this method, a station monitors the medium after it sends a
frame to see if the transmission was successful. If successful, the
transmission is finished, if not, the frame is sent again.
In the diagram, starts sending the first bit of its frame at t1 and
since C sees the channel idle at t2, starts sending its frame at t2. C
detects A’s frame at t3 and aborts transmission. A detects C’s
frame at t4 and aborts its transmission. Transmission time for C’s
frame is, therefore, t3-t2 and for A’s frame is t4-t1
So, the frame transmission time (Tfr) should be at least twice the
maximum propagation time (Tp). This can be deduced when the
two stations involved in a collision are a maximum distance apart.
Process: The entire process of collision detection can be explained
as follows:
Throughput and Efficiency: The throughput of CSMA/CD is much
greater than pure or slotted ALOHA.
For the 1-persistent method, throughput is 50% when G=1.
For the non-persistent method, throughput can go up to 90%.
2. Carrier Sense Multiple Access with Collision Avoidance
(CSMA/CA) –
The basic idea behind CSMA/CA is that the station should be able
to receive while transmitting to detect a collision from different
stations. In wired networks, if a collision has occurred then the
energy of the received signal almost doubles, and the station can
sense the possibility of collision. In the case of wireless networks,
most of the energy is used for transmission, and the energy of the
received signal increases by only 5-10% if a collision occurs. It
can’t be used by the station to sense collision. Therefore CSMA/CA
has been specially designed for wireless networks.
These are three types of strategies:
1. InterFrame Space (IFS): When a station finds the channel busy it
senses the channel again, when the station finds a channel to be
idle it waits for a period of time called IFS time. IFS can also be
used to define the priority of a station or a frame. Higher the IFS
lower is the priority.
2. Contention Window: It is the amount of time divided into slots. A
station that is ready to send frames chooses a random number of
slots as wait time.
3. Acknowledgments: The positive acknowledgments and time-out
timer can help guarantee a successful transmission of the frame.
Characteristics of CSMA/CA :
1. Carrier Sense: The device listens to the channel before
transmitting, to ensure that it is not currently in use by another
device.
2. Multiple Access: Multiple devices share the same channel and can
transmit simultaneously.
3. Collision Avoidance: If two or more devices attempt to transmit
at the same time, a collision occurs. CSMA/CA uses random
backoff time intervals to avoid collisions.
4. Acknowledgment (ACK): After successful transmission, the
receiving device sends an ACK to confirm receipt.
5. Fairness: The protocol ensures that all devices have equal access
to the channel and no single device monopolizes it.
6. Binary Exponential Backoff: If a collision occurs, the device waits
for a random period of time before attempting to retransmit. The
backoff time increases exponentially with each retransmission
attempt.
7. Interframe Spacing: The protocol requires a minimum amount of
time between transmissions to allow the channel to be clear and
reduce the likelihood of collisions.
8. RTS/CTS Handshake: In some implementations, a Request-To-
Send (RTS) and Clear-To-Send (CTS) handshake is used to
reserve the channel before transmission. This reduces the chance
of collisions and increases efficiency.
9. Wireless Network Quality: The performance of CSMA/CA is
greatly influenced by the quality of the wireless network, such as
the strength of the signal, interference, and network congestion.
10. Adaptive Behavior: CSMA/CA can dynamically adjust its
behavior in response to changes in network conditions, ensuring
the efficient use of the channel and avoiding congestion.
Overall, CSMA/CA balances the need for efficient use of the shared
channel with the need to avoid collisions, leading to reliable and
fair communication in a wireless network.
Process: The entire process of collision avoidance can be explained
as follows:
Types of CSMA Access Modes:
There are 4 types of access modes available in CSMA. It is also
referred as 4 different types of CSMA protocols which decide the
time to start sending data across shared media.
1. 1-Persistent: It senses the shared channel first and delivers the
data right away if the channel is idle. If not, it must wait
and continuously track for the channel to become idle and then
broadcast the frame without condition as soon as it does. It is an
aggressive transmission algorithm.
2. Non-Persistent: It first assesses the channel before transmitting
data; if the channel is idle, the node transmits data right away. If
not, the station must wait for an arbitrary amount of time (not
continuously), and when it discovers the channel is empty, it sends
the frames.
3. P-Persistent: It consists of the 1-Persistent and Non-Persistent
modes combined. Each node observes the channel in the
1Persistent mode, and if the channel is idle, it sends a frame with
a P probability. If the data is not transferred, the frame restarts
with the following time slot after waiting for a (q = 1-p
probability) random period.
4. O-Persistent: A supervisory node gives each node a transmission
order. Nodes wait for their time slot according to their allocated
transmission sequence when the transmission medium is idle.
Advantages of CSMA:
1. Increased efficiency: CSMA ensures that only one device
communicates on the network at a time, reducing collisions and
improving network efficiency.
2. Simplicity: CSMA is a simple protocol that is easy to implement
and does not require complex hardware or software.
3. Flexibility: CSMA is a flexible protocol that can be used in a wide
range of network environments, including wired and wireless
networks.
4. Low cost: CSMA does not require expensive hardware or
software, making it a cost-effective solution for network
communication.
Disadvantages of CSMA:
1. Limited scalability: CSMA is not a scalable protocol and can
become inefficient as the number of devices on the network
increases.
2. Delay: In busy networks, the requirement to sense the medium
and wait for an available channel can result in delays and
increased latency.
3. Limited reliability: CSMA can be affected by interference, noise,
and other factors, resulting in unreliable communication.
4. Vulnerability to attacks: CSMA can be vulnerable to certain
types of attacks, such as jamming and denial-of-service attacks,
which can disrupt network communication.
CSMA/CD (Carrier Sense Multiple Access/ Collision Detection) is a
media access control method that was widely used in Early
Ethernet technology/LANs when there used to be shared Bus
Topology and each node ( Computers) was connected by Coaxial
Cables. Nowadays Ethernet is Full Duplex and Topology is either
Star (connected via Switch or Router) or point-to-point ( Direct
Connection). Hence CSMA/CD is not used but they are still
supported though.
Consider a scenario where there are ‘n’ stations on a link and all
are waiting to transfer data through that channel. In this case, all
‘n’ stations would want to access the link/channel to transfer their
own data. The problem arises when more than one station
transmits the data at the moment. In this case, there will be
collisions in the data from different stations.
CSMA/CD is one such technique where different stations that
follow this protocol agree on some terms and collision detection
measures for effective transmission. This protocol decides which
station will transmit when so that data reaches the destination
without corruption.
How Does CSMA/CD Work?
Step 1: Check if the sender is ready to transmit data packets.
Step 2: Check if the transmission link is idle.
The sender has to keep on checking if the transmission
link/medium is idle. For this, it continuously senses transmissions
from other nodes. The sender sends dummy data on the link. If it
does not receive any collision signal, this means the link is idle at
the moment. If it senses that the carrier is free and there are no
collisions, it sends the data. Otherwise, it refrains from sending
data.
Step 3: Transmit the data & check for collisions.
The sender transmits its data on the link. CSMA/CD does not use
an ‘acknowledgment’ system. It checks for successful and
unsuccessful transmissions through collision signals. During
transmission, if a collision signal is received by the node,
transmission is stopped. The station then transmits a jam signal
onto the link and waits for random time intervals before it
resends the frame. After some random time, it again attempts to
transfer the data and repeats the above process.
Step 4: If no collision was detected in propagation, the sender
completes its frame transmission and resets the counters.
How Does a Station Know if Its Data Collide?
Consider the above situation. Two stations, A & B.
Propagation Time: Tp = 1 hr ( Signal takes 1 hr to go from A to B)
At time t=0, A transmits its data.
t= 30 mins : Collision occurs.
After the collision occurs, a collision signal is generated and sent to
both A & B to inform the stations about the collision. Since the
collision happened midway, the collision signal also takes 30
minutes to reach A & B.
Therefore, t=1 hr: A & B receive collision signals.
This collision signal is received by all the stations on that link.
Then,
How to Ensure that it is our Station’s Data that Collided?
For this, Transmission time (Tt) > Propagation Time (Tp) [Rough
bound]
This is because we want that before we transmit the last bit of our
data from our station, we should at least be sure that some of the
bits have already reached their destination. This ensures that the
link is not busy and collisions will not occur.
But, above is a loose bound. We have not taken the time taken by
the collision signal to travel back to us. For this consider the worst-
case scenario.
Consider the above system again.
At time t=0, A transmits its data.
t= 59:59 mins : Collision occurs
This collision occurs just before the data reaches B. Now the
collision signal takes 59:59 minutes again to reach A. Hence, A
receives the collision information approximately after 2 hours, that
is, after 2 * Tp.
Hence, to ensure tighter bound, to detect the collision completely,
Tt > >= 2 * Tp
This is the maximum collision time that a system can take to detect
if the collision was of its own data.
What should be the Minimum length of the Packet to be
Transmitted?
Transmission Time = Tt = Length of the packet/ Bandwidth of the
link
[Number of bits transmitted by sender per second]
Substituting above, we get,
Length of the packet/ Bandwidth of the link>= 2 * Tp
Length of the packet >= 2 * Tp * Bandwidth of the link
Padding helps in cases where we do not have such long packets. We
can pad extra characters to the end of our data to satisfy the above
condition.
Features of Collision Detection in CSMA/CD
Carrier Sense: Before transmitting data, a device listens to the
network to check if the transmission medium is free. If the
medium is busy, the device waits until it becomes free before
transmitting data.
Multiple Access: In a CSMA/CD network, multiple devices share
the same transmission medium. Each device has equal access to
the medium, and any device can transmit data when the medium
is free.
Collision Detection: If two or more devices transmit data
simultaneously, a collision occurs. When a device detects a
collision, it immediately stops transmitting and sends a jam signal
to inform all other devices on the network of the collision. The
devices then wait for a random time before attempting to
transmit again, to reduce the chances of another collision.
Backoff Algorithm: In CSMA/CD, a backoff algorithm is used to
determine when a device can retransmit data after a collision.
The algorithm uses a random delay before a device retransmits
data, to reduce the likelihood of another collision occurring.
Minimum Frame Size: CSMA/CD requires a minimum frame
size to ensure that all devices have enough time to detect a
collision before the transmission ends. If a frame is too short, a
device may not detect a collision and continue transmitting,
leading to data corruption on the network.
Advantages of CSMA/CD
Simple and widely used: CSMA/CD is a widely used protocol for
Ethernet networks, and its simplicity makes it easy to implement
and use.
Fairness: In a CSMA/CD network, all devices have equal access
to the transmission medium, which ensures fairness in data
transmission.
Efficiency: CSMA/CD allows for efficient use of the transmission
medium by preventing unnecessary collisions and reducing
network congestion.
Disadvantages of CSMA/CD
Limited Scalability: CSMA/CD has limitations in terms of
scalability, and it may not be suitable for large networks with a
high number of devices.
Vulnerability to Collisions: While CSMA/CD can detect
collisions, it cannot prevent them from occurring. Collisions can
lead to data corruption, retransmission delays, and reduced
network performance.
Inefficient Use of Bandwidth: CSMA/CD uses a random backoff
algorithm that can result in inefficient use of
network bandwidth if a device continually experiences collisions.
Susceptibility to Security Attacks: CSMA/CD does not provide
any security features, and the protocol is vulnerable to security
attacks such as packet sniffing and spoofing.
IEEE 802.3: This was the original standard given for 10BASE-
5. It used a thick single coaxial cable into which a connection
can be tapped by drilling into the cable to the core. Here, 10 is
the maximum throughput, i.e. 10 Mbps, BASE denoted use of
baseband transmission, and 5 refers to the maximum segment
length of 500m.
IEEE 802.3a: This gave the standard for thin coax (10BASE-
2), which is a thinner variety where the segments of coaxial
cables are connected by BNC connectors. The 2 refers to the
maximum segment length of about 200m (185m to be precise).
IEEE 802.3i: This gave the standard for twisted pair (10BASE-
T) that uses unshielded twisted pair (UTP) copper wires as
physical layer medium. The further variations were given by
IEEE 802.3u for 100BASE-TX, 100BASE-T4 and 100BASE-
FX.
IEEE 802.3i: This gave the standard for Ethernet over Fiber
(10BASE-F) that uses fiber optic cables as medium of
transmission.
Since the token rotates in the ring, it is guaranteed that every node
gets the token within some specified time. So there is an upper
bound on the time of waiting to grab the token so that starvation is
avoided. There is also an upper limit of 250 on the number of nodes
in the network.
Listen Mode − In the listen mode, the incoming bits are simply
transmitted to the output line with no further action taken.
Talk or Transmit Node − The ring interface is set to the talk or
transmit node when the station connected to the ring interface
has acquired a token. The direct input to output connection
through the single bit buffer is disconnected.
By-pass Mode − This mode reaches when the node is down.
Any data is just bypassed. There is no one-bit delay in this
mode.
Handling Breakage
The main problem with a ring network is that the network goes
down when the ring cable breaks down or gets tempered. The
solution to this problem is the use of a wire centre, as shown in the
figure.
This wire center bypasses the terminals that have gone down from
the ring. This is done by connecting the bypass relay for that station.
These relays are generally controlled by the software that operates
automatically in case of station failure. The use of a wire center
improves the reliability and maintainability of the ring network.
Priority and Reservation
Time Bounding
A station that is in possession of the token only can transmit his
frames. It may transmit one or more data frames but before the
expiry of Token Holding Time (THT). Typically, this time is 10
milliseconds. After the THT, the token frame must be handed over
to some other station.
The monitor station sets the timer on when each time the token
passes. If the token does not regenerate in the allotted time, it is
assumed to be lost, and then the monitor station generates a new
token and sends it to the ring. If the monitor fails, a second station is
designated as back-up.