CSMA / CD |
CSMA / CA |
It is the type of
CSMA to detect the collision on a shared channel. |
It is the type of
CSMA to avoid collision on a shared channel. |
It is the
collision detection protocol. |
It is the
collision avoidance protocol. |
It is used in
802.3 Ethernet network cable. |
It is used in the
802.11 Ethernet network. |
It works in wired
networks. |
It works in
wireless networks. |
It is effective
after collision detection on a network. |
It is effective
before collision detection on a network. |
Whenever a data
packet conflicts in a shared channel, it resends the data frame. |
Whereas the CSMA
CA waits until the channel is busy and does not recover after a collision. |
It minimizes the
recovery time. |
It minimizes the
risk of collision. |
The efficiency of
CSMA CD is high as compared to CSMA. |
The efficiency of
CSMA CA is similar to CSMA. |
It is more
popular than the CSMA CA protocol. |
It is less
popular than CSMA CD. |
Saturday, 28 September 2024
CSMA (Carrier Sense Multiple Access)
It is a carrier sense multiple access based on media access protocol to 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 Access Modes
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.
Non-Persistent: It is the access mode of CSMA that defines before transmitting the data, each node must sense the channel, and if the channel is inactive, it immediately sends the data. Otherwise, the station must wait for a random time (not continuously), and when the channel is found to be idle, it transmits the frames.
P-Persistent: It is the combination of 1-Persistent and Non-persistent modes. The P-Persistent mode defines that each node senses the channel, and if the channel is inactive, it sends a frame with a P probability. If the data is not transmitted, it waits for a (q = 1-p probability) random time and resumes the frame with the next time slot.
CSMA/ CD
It is a carrier sense multiple access/ collision detection network protocol to transmit data frames. The CSMA/CD protocol works with a medium access control layer. Therefore, it first senses the shared channel before broadcasting the frames, and if the channel is idle, it transmits a frame to check whether the transmission was successful. If the frame is successfully received, the station sends another frame. If any collision is detected in the CSMA/CD, the station sends a jam/ stop signal to the shared channel to terminate data transmission. After that, it waits for a random time before sending a frame to a channel.
Working of CSMA/CD
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.
Collision detection in CSMA/CD
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.
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
Efficiency:
It is a carrier sense multiple access/collision avoidance network protocol for carrier transmission of data frames. It is a protocol that works with a medium access control layer.
CSMA/CA protocol is used in wireless networks because they cannot detect the collision so the only solution is collision avoidance.
1. Interframe Space
2. Contention window
3. Acknowledgements
1. Interframe Space(IFS)
• Whenever the channel is found idle, the station does not transmit immediately. It waits for a period of time called interframe space(IFS).
• When channel is sensed to be idle, it may be possible that same distant station may have already started transmitting and the signal of that distant station has not yet reached other stations.
• Therefore the purpose of IFS time is to allow this transmitted signal to reach other stations.
• If after this IFS time, the channel is still idle, the station can send, but it still needs to wait a time equal to contention time.
• IFS variable can also be used to define the priority of a station or a frame.
2.Contension window : It is an amount of time divided into slots.
• A station that is ready to send chooses a random number of slots as its wait time.
• The number of slots in the window changes according to the binary exponential back-off strategy. It means that is set of one slot the first time and then double each time the station cannot detect an idle channel after the IFS time.
• This is very similar to the p-persistent method except that a random outcome defines the number of slots taken by the waiting station.
• In contension window the station needs to sense the channel after each item slot.
• If the station finds the channel busy, it does not restart the process. It just stops the timer and restarts it when the channel is sensed as idle.
3.Acknowledgement :
• Despite all the precautions, collisions may occur and destroy the data.
• The positive acknowledgement and the time-out timer can help guarantee that receiver has received the frame.
Difference between CSMA/CD and CSMA/CA :
Subscribe to:
Post Comments (Atom)
Peer-to-Peer Networks
Peer-to-Peer (P2P) networks are a decentralized type of network architecture where each device (or node) on the network can act as both a...
-
Peer-to-Peer (P2P) networks are a decentralized type of network architecture where each device (or node) on the network can act as both a...
-
TCP (Transmission Control Protocol) and UDP (User Datagram Protocol) are two fundamental transport layer protocols that define how data is t...
-
Delay-Tolerant Networking (DTN) is a network architecture designed to handle communications in environments where traditional networking pr...
No comments:
Post a Comment