Home » Computer Network » Carrier Sense Protocol: Working and Comparison with Collision-Free Protocols

Carrier Sense Protocol: Working and Comparison with Collision-Free Protocols

Last updated:

Support this post with a reaction:

6,671 views

In computer networks, multiple computers and devices often share a common communication channel to transmit data. When two or more devices try to send data at the same time, their signals may interfere with each other. This situation is known as a collision.

To manage access to a shared communication channel, different channel allocation and access control protocols are used. Two important approaches are Carrier Sense Protocol and Collision-Free Protocol.

Carrier Sense Protocol allows devices to check the communication channel before transmitting data. Collision-Free Protocol uses an organized mechanism to provide transmission opportunities to devices and prevent collisions.

Both methods help manage communication between multiple devices and improve the efficiency of data transmission.

Carrier Sense Protocol

Carrier Sense Protocol is a channel access method in which a device listens to or senses the communication medium before transmitting data.

It is based on the principle of checking whether the channel is currently being used by another device.

If the channel is idle, the device can start transmitting data. If the channel is busy, the device waits until the ongoing transmission is completed.

Carrier Sense Multiple Access (CSMA) is a commonly used protocol based on this principle. It allows multiple devices to share a common communication medium while reducing the chances of data collisions.

However, carrier sensing cannot completely eliminate collisions. Two devices may check the channel at almost the same time, find it idle, and begin transmitting simultaneously.

Working of Carrier Sense Protocol

The working of Carrier Sense Protocol involves the following steps:

  1. Channel Sensing: Before sending data, a device checks the communication channel to determine whether another device is transmitting information.
  2. Checking Channel Availability: After sensing the channel, the device determines whether it is idle or busy.
  3. Transmission When Idle: If the channel is idle, the device starts transmitting its data through the communication medium.
  4. Waiting When Busy: If the channel is already being used by another device, the device waits until the ongoing transmission is completed.
  5. Collision Occurrence: Sometimes, two devices may sense the channel as idle at nearly the same time and begin transmitting simultaneously. This can cause a collision.
  6. Retransmission: If the protocol supports collision detection, the devices stop transmission after detecting a collision. They wait for a random period and attempt to transmit again.

Figure: Working of Carrier Sense Protocol

Device Wants to Send Data
|
|
Sense the Channel
|
Is Channel
Idle?
/ \
Yes No
| |
Send Data Wait
| |
| Check Again
|_________|
|
Transmission
Complete

Types of Carrier Sense Multiple Access (CSMA)

CSMA uses different persistence methods to decide when a device should transmit data.

1. 1-Persistent CSMA

In 1-Persistent CSMA, a device continuously senses the communication channel until it becomes idle. As soon as the channel becomes free, the device immediately starts transmitting data.

If two or more devices are waiting for the channel, they may transmit at the same time when it becomes free. This can result in a collision.

Working of 1-Persistent CSMA :

  • The device senses the communication channel.
  • If the channel is busy, it continuously checks the channel.
  • If the channel becomes idle, it immediately transmits data.
  • If a collision occurs, the device waits for a random period and tries again.

Example: If two computers are waiting for a busy channel, both may start transmitting immediately when the channel becomes free, causing a collision.

2. Non-Persistent CSMA

In Non-Persistent CSMA, a device senses the communication channel before transmitting data. If the channel is busy, the device does not continuously check it. Instead, it waits for a randomly selected period before sensing the channel again.

This method reduces the possibility of collisions because devices may wait for different amounts of time before attempting transmission.

Working of Non-Persistent CSMA:

  • The device senses the communication channel.
  • If the channel is idle, it transmits data.
  • If the channel is busy, it waits for a random period.
  • After waiting, it checks the channel again.
  • If the channel is free, it begins transmission.

Example: If two computers find the channel busy, they may wait for different random periods. This reduces the possibility of both transmitting at the same time.

3. P-Persistent CSMA

P-Persistent CSMA is generally used in slotted communication channels. In this method, a device transmits data with a probability of P when the channel becomes idle.

With a probability of (1 − P), the device waits for the next time slot and checks the channel again.

This method controls the probability of transmission and helps reduce collisions.

Working of P-Persistent CSMA :

  • The device senses the communication channel.
  • If the channel is busy, it waits.
  • If the channel is idle, it transmits with probability P.
  • With probability (1 − P), it waits for the next time slot.
  • The process continues until transmission begins.

Example: If P is 0.5, the device has a 50% probability of transmitting in an available time slot and a 50% probability of waiting for the next slot.

Collision-Free Protocol

A Collision-Free Protocol is a channel access method designed to prevent multiple devices from transmitting data simultaneously over a shared communication medium.

In this protocol, devices follow a predefined procedure to obtain permission or a turn to transmit data. Only the device that receives permission can use the communication channel during its allocated transmission opportunity.

Unlike Carrier Sense Protocol, which allows devices to compete for channel access after sensing the medium, Collision-Free Protocol uses coordination to organize transmission.

This method avoids collisions and reduces the need for retransmitting data because of simultaneous transmissions.

Examples of collision-free protocols include the Bit-Map Protocol, Binary Countdown Protocol, and Token Passing Protocol.

Working of Collision-Free Protocol

The working of a Collision-Free Protocol involves the following steps:

  1. Transmission Request: Devices that have data to send indicate their requirement to access the communication channel.
  2. Channel Coordination: The protocol coordinates the requests received from different devices.
  3. Channel Allocation: A transmission opportunity is assigned to a particular device according to the protocol rules.
  4. Data Transmission: The selected device transmits its data through the communication channel.
  5. Next Device Selection: After the transmission is completed, the next eligible device receives its opportunity to transmit data.
  6. Continuous Communication: The process continues until all devices that require communication have received their transmission opportunities.

Types of Collision-Free Protocols

1. Bit-Map Protocol

Bit-Map Protocol is a collision-free channel allocation method in which each device gets a specific position or slot to indicate whether it has data to transmit.

The protocol uses a reservation period before actual data transmission.

Working of Bit-Map Protocol :

  • Each device is assigned a position in a reservation sequence.
  • A device that wants to transmit data sets its corresponding bit to 1.
  • A device that has no data to transmit leaves its bit as 0.
  • After the reservation period, devices transmit data according to the order of their reservations.

Example: If five devices are connected and devices 1, 3, and 5 want to transmit data, their corresponding bits are set to 1. These devices then transmit in the specified order.

2. Binary Countdown Protocol

Binary Countdown Protocol is a collision-free method in which devices use binary numbers to compete for channel access.

Each device has a unique binary address. When multiple devices request the channel, they transmit their address bits. The device with the highest priority according to the binary comparison wins access to the channel.

Working of Binary Countdown Protocol :

  • Devices that want to transmit data begin sending their binary addresses.
  • The addresses are compared bit by bit.
  • Devices that lose the comparison stop participating.
  • The device with the highest priority obtains permission to transmit data.

Example: If three devices have binary addresses 101, 110, and 011, the device with address 110 wins under the usual highest-binary-value priority rule.

3. Token Passing Protocol

Token Passing is a channel access method in which a special control frame called a token circulates among connected devices.

Only the device holding the token is allowed to transmit data. After completing its transmission, the device passes the token to the next device.

Working of Token Passing Protocol :

  • A special token circulates among network devices.
  • A device waits until it receives the token.
  • The device holding the token transmits its data.
  • After transmission, it passes the token to the next device.
  • The process continues among the connected devices.

Example: In a token ring network, computers pass a token in sequence. Only the computer holding the token can transmit data.

Difference Between Carrier Sense Protocol and Collision-Free Protocol

BasisCarrier Sense ProtocolCollision-Free Protocol
MeaningDevices sense the channel before transmitting data.Devices follow an organized procedure to obtain permission to transmit.
Working PrincipleChecks whether the channel is idle or busy.Uses coordination or reservation to allocate transmission opportunities.
Channel AccessDevices compete for channel access.Devices receive an organized transmission opportunity.
CollisionCollisions are possible.Designed to prevent collisions.
TransmissionStarts when the channel is sensed as idle.Starts when the device receives permission or its turn.
Waiting TimeWaits when the channel is busy or after a collision.Waits for its allocated transmission opportunity.
EfficiencyWorks well under light traffic.Avoids collision-related transmission wastage.
ComplexityComparatively simple.Generally requires additional coordination.
RetransmissionMay require retransmission after collisions.Normally does not require collision-based retransmission.
ExamplesCSMA, CSMA/CD, CSMA/CABit-Map Protocol, Binary Countdown, Token Passing

Advantages of Carrier Sense Protocol

  1. Simple Implementation: Carrier Sense Protocol is relatively easy to implement because devices only need to check the communication channel before transmitting data.
  2. Reduced Collisions: It reduces the possibility of collisions by allowing devices to sense the channel before starting transmission.
  3. Efficient Channel Usage: Devices can transmit data whenever the communication channel is available, making effective use of the shared medium.
  4. Less Coordination Overhead: It does not require a central controller to assign every transmission opportunity.
  5. Suitable for Light Traffic: It performs efficiently when a small number of devices are communicating through the shared channel.

Disadvantages of Carrier Sense Protocol

  1. Collision Possibility: Two devices may sense the channel as idle at nearly the same time and begin transmitting simultaneously, causing a collision.
  2. Performance Under Heavy Traffic: When many devices attempt to transmit data, the possibility of collisions and waiting increases.
  3. Unpredictable Delay: Devices may experience different waiting times depending on channel availability and network traffic.
  4. Retransmission Overhead: When collisions occur, the affected data may need to be transmitted again, increasing network overhead.
  5. Hidden Terminal Problem: In wireless networks, two devices may not detect each other’s transmissions but may interfere with each other at a common receiver.

Advantages of Collision-Free Protocol

  1. Prevents Data Collisions: It coordinates channel access so that multiple devices do not transmit simultaneously during conflicting transmission opportunities.
  2. Organized Communication: Devices follow a predefined procedure to obtain permission and transmit data in an orderly manner.
  3. Better Performance Under Heavy Traffic: It avoids repeated collisions when many devices are trying to access the communication channel.
  4. Reduced Retransmission: Since simultaneous transmission conflicts are prevented, less time is wasted on collision-based retransmissions.
  5. Fair Channel Access: Protocols such as token passing provide devices with organized opportunities to transmit data.

Disadvantages of Collision-Free Protocol

  1. Complex Implementation: These protocols require additional mechanisms for coordination, reservation, or permission management.
  2. Coordination Overhead: Some communication time is used for reservation messages, token passing, or other control information instead of actual data transmission.
  3. Waiting Time: A device may need to wait for its allocated turn even when the channel is not being used by another device.
  4. Less Efficient Under Light Traffic: When only a few devices have data to transmit, the coordination process may introduce unnecessary overhead.
  5. Protocol Failure: In token-based systems, losing or duplicating a token can disturb communication and require recovery procedures.

Applications of Carrier Sense Protocol

  1. Ethernet Networks: Traditional shared Ethernet networks use CSMA/CD to manage access to a shared communication medium.
  2. Wireless Networks: Wi-Fi uses CSMA/CA to reduce the possibility of collisions when multiple devices share a wireless channel.
  3. Local Area Networks: Carrier sensing is used in shared-medium communication systems to coordinate data transmission.

Applications of Collision-Free Protocol

  1. Token Ring Networks: Token passing provides an organized way for connected devices to transmit data.
  2. Industrial Communication: Collision-free access methods are useful in systems where predictable communication is important.
  3. Control Networks: Organized channel access can be used in networks that require coordinated communication between multiple devices.