CSMA/CA & CSMA/CD
PROTOCOL
Prepared By:
Aditi Nandi Tokder
Assistant Professor
ECE Department
Techno Main Salt Lake
Contents CSMA/CA
- Methods to avoid collision
- CSMA/CA Flowchart
- Advantage & Disdavantage
CSMA/CD
- Working Steps
- Advantage & Disadvantage
Carrier Sense Multiple Access with Collision Avoidance (CSMA/CA)
CSMA/CA is one of the network protocols for data frame transmission. When the station
sends the data frame on the channel then it receives the acknowledgment in response to the
sent data frame to test whether the channel is idle or not. When the station receives a single
signal, it means that there is no collision and data has been successfully received by the
receiver. But in case of collision, the station receives two signals: its signal and the second
signal sent by the other station
Methods used in the CSMA/ CA to avoid the collision:
Interframe space
Contention window
Acknowledgement
If the station wants to transmit the data then it waits until the channel becomes idle and when the channel
becomes idle station does not immediately send the data but waits for some time. This period is known as the
Interframe Space or IFS.
Interframe Space or IFS:
Contention Window:
The contention window is a time that is divided into time slots. When the station is ready for
data transmission after waiting for IFS then it chooses the random amount of slots for waiting.
After waiting for the random number of slots if the channel is still busy then the station does not
initiate the whole process again, the station stops its timer and restarts again when the
channel is sensed idle.
For contention window, value of random number R is in between 0 to 2^K -1 Putting K=0, R=0
K=1, R=0/1
K=2, value of R is any value from 0 to 3
K=3, value of R is any value from 0 to 7
If K=2, taking value of R=3, contention window size = 5sec*3=15 sec ( assuming every slot is of 5
second)
Acknowledgement:
There may be a chance of collision or data may be corrupted during the transmission. Positive acknowledgment
and time-out are used in addition to ensuring that the receiver has successfully received the data.
Flowchart
Advantage Of CSMA/CA
CMSA/CA prevents collision.
Due to acknowledgements, data is not
lost unnecessarily.
It avoids wasteful transmission.
It is very much suited for wireless
transmissions.
Disadvantage Of CSMA/CA
The algorithm calls for long waiting
times.
It has high power consumption.
Carrier Sense Multiple Access with Collision Detection (CSMA/CD)
CSMA/CD 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) were connected By Coaxial Cables. Now a Days
Ethernet is Full Duplex and Topology is either Star (connected via Switchor 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. Problem
arises when more than one stationtransmits the data at the moment. In this case, there will be collisions in the
data fromdifferent 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.
Advantage Of CSMA/CD
Better than CSMA/CA for collision detection
Avoids wasted transmission
Shares bandwidth at each station
Lower overhead than CSMA CA
Disadvantage Of CSMA/CD
Limited scalability
Not suitable for long-distance networks
Performance is negatively impacted when a
large number of devices are introduced
Working Steps:
Step 1: Check if the sender is ready for
transmitting data packets.
Step 2: Check if the transmission link is idle?
Step 3: Transmit the data & check for collisions.
Step 4: If no collision was detected in propagation, the
sender completes its frametransmission and resets the
counters.
How does a station know if its data collide?
Consider 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 &Btoinformthe stations
about a 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.
Thank You

CSMA .pdf

  • 1.
    CSMA/CA & CSMA/CD PROTOCOL PreparedBy: Aditi Nandi Tokder Assistant Professor ECE Department Techno Main Salt Lake
  • 2.
    Contents CSMA/CA - Methodsto avoid collision - CSMA/CA Flowchart - Advantage & Disdavantage CSMA/CD - Working Steps - Advantage & Disadvantage
  • 3.
    Carrier Sense MultipleAccess with Collision Avoidance (CSMA/CA) CSMA/CA is one of the network protocols for data frame transmission. When the station sends the data frame on the channel then it receives the acknowledgment in response to the sent data frame to test whether the channel is idle or not. When the station receives a single signal, it means that there is no collision and data has been successfully received by the receiver. But in case of collision, the station receives two signals: its signal and the second signal sent by the other station Methods used in the CSMA/ CA to avoid the collision: Interframe space Contention window Acknowledgement If the station wants to transmit the data then it waits until the channel becomes idle and when the channel becomes idle station does not immediately send the data but waits for some time. This period is known as the Interframe Space or IFS. Interframe Space or IFS:
  • 4.
    Contention Window: The contentionwindow is a time that is divided into time slots. When the station is ready for data transmission after waiting for IFS then it chooses the random amount of slots for waiting. After waiting for the random number of slots if the channel is still busy then the station does not initiate the whole process again, the station stops its timer and restarts again when the channel is sensed idle. For contention window, value of random number R is in between 0 to 2^K -1 Putting K=0, R=0 K=1, R=0/1 K=2, value of R is any value from 0 to 3 K=3, value of R is any value from 0 to 7 If K=2, taking value of R=3, contention window size = 5sec*3=15 sec ( assuming every slot is of 5 second) Acknowledgement: There may be a chance of collision or data may be corrupted during the transmission. Positive acknowledgment and time-out are used in addition to ensuring that the receiver has successfully received the data.
  • 5.
    Flowchart Advantage Of CSMA/CA CMSA/CAprevents collision. Due to acknowledgements, data is not lost unnecessarily. It avoids wasteful transmission. It is very much suited for wireless transmissions. Disadvantage Of CSMA/CA The algorithm calls for long waiting times. It has high power consumption.
  • 6.
    Carrier Sense MultipleAccess with Collision Detection (CSMA/CD) CSMA/CD 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) were connected By Coaxial Cables. Now a Days Ethernet is Full Duplex and Topology is either Star (connected via Switchor 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. Problem arises when more than one stationtransmits the data at the moment. In this case, there will be collisions in the data fromdifferent 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. Advantage Of CSMA/CD Better than CSMA/CA for collision detection Avoids wasted transmission Shares bandwidth at each station Lower overhead than CSMA CA Disadvantage Of CSMA/CD Limited scalability Not suitable for long-distance networks Performance is negatively impacted when a large number of devices are introduced
  • 7.
    Working Steps: Step 1:Check if the sender is ready for transmitting data packets. Step 2: Check if the transmission link is idle? Step 3: Transmit the data & check for collisions. Step 4: If no collision was detected in propagation, the sender completes its frametransmission and resets the counters. How does a station know if its data collide? Consider 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 &Btoinformthe stations about a 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.
  • 8.