- HubPages»
- Technology»
- Computers & Software»
- Computer How-Tos & Tutorials
Carrier Sense Multiple Access/ Collision Detection (CSMA/CD)
Carrier Sense Multiple Access/ Collision Detection (CSMA/CD)
In networking collision is a phenomena for when two or more devices send data or start transmitting on a single segment simultaneously, if this is the case collision will occur on that segment.
In Ethernet world several collisions may occur on a segment in a day depending on the number of station on that segment and there is mechanism to handle such collision, the mechanism is called carrier sense multiple access/ collision detection (CSMA/CD).
Figure 1
To understand the carrier sense multiple access / collision detection assume a small network of four PCs, A, B, C and D (Figure 1). if Station A wants to start sending some data or communicating with B, it will first sense the carrier or segment for any going on transmission, if there is any communication or activity occurring on the segment the station will know that the carrier or segment is busy then it defers its transmission and keep sensing until it found the carrier or segment free. After sensing the segment or carrier free, it will start its transmission, on the other hand when An already starts its communication, The station D also try to initiate the transmission but found the medium busy and defer its transmission.
This whole process of carrier sensing on an Ethernet segment is called carrier sense multiple access CSMA.
Figure 2
Now there is a probability that when A senses the carrier or segment free, at the same time station C which also wants to communicate or transmit data to B sensed the carrier free. If this will be the case then A and C both sense the carrier / segment free at the same time and start sending or transmitting the data simultaneously, this simultaneous activity will cause a collision between A and C on the segment. In CSMA/CD there is mechanism to handle such situation and it handles by Collision detection CD part of CSMA/CD.
The collision detection mechanism states that if any station on the segment listen back their transmission in scramble or distort form it will know that the collision occurs on the segment. After detecting the collision both stations will stop their transmission for the random amount of time, and transmit a 32 bit jam signal on the segment to let other stations know that a collision is occurred at the segment so any other station intended to transmit on the segment will also wait for a random amount of time, the random amount of time known as “Backoff delay” which uses the exponential back off algorithm.
The reason for this random amount of time is as the collision occurs between the two or more stations who wants to transmit and fortunately senses the carrier free at the same time, so there is a probability that in the absence of this back off delay the both station or any other station could again sense the medium free right after the collision and transmit simultaneously, which will again let the collision occur. That’s why this back off delay or random amount wait time reduces the probability of collision on the segment right after the collision.
In our example when A and C both sense the carrier free simultaneously and transmit a collision occur on the segment between their transmission, which returns their transmissions in scramble and distort form and both stations know about the collision, A 32 bit jam signal will be passed all the stations on the segment to let them know about the collision, which invokes exponential back off algorithm on the Station A, B, and C. All three stations will randomly wait before retransmission, and then start transmitting.