Pages

Data Communication & networking

This blog is for undergraduate/graduate students who require some basic information about their subjects or any other topic related to data communication.

Monday, 28 March 2011

CSMA

CSMA( Carrier Sense Multiple Access):
With CSMA, a station wishing to transmit first listens to the
medium to determine if another transmission is in progress (carrier sense). If the medium is in use, the station must wait. If the medium is idle, the station may transmit. It may happen that two or more stations attempt to transmit at about the same time. If this happens, there will be a collision. To account for this, a station waits a reasonable amount of time, after transmitting, for an acknowledgment, taking into account the maximum round-trip propagation delay, and the fact that the acknowledging station must also contend for the channel in order to respond. If there is no acknowledgment, the station assumes that a collision has occurred and retransmits. 
We have 3 approaches in CSMA.

1-Non- Presistant: It is called as Patient CSMA. A station wishing to transmit listens to the medium and obeys the following rules.
  • If the medium is idle then transmit, other wise go to step 2.
  • If the medium is busy then wait for an amount of time from a probability distribution and repeat step 1.
The problem with non-presistant is that, the capacity is wasted because the medium is generally remain idle following the end of transmission even if there are one or more stations waiting to transmit. To avoid idle channel time, we have 1-presistant.

2- 1-Presistant: A station wishing to transmit listens to the medium and obeys the following rules,
  • If the medium is idle, transmit; otherwise, go to step 2.
  • If the medium is busy, continue to listen until the channel is sensed idle; then
    transmit immediately.
If two or more stations are waiting to transmit, a collision is guaranteed.

3- P-Presistant:
  • If the medium is idle, transmit with probability P, and delay one time unit with prob(1-p). The time unit is typically equal to the maximum propogation delay.
  • If the medium is busy, continue to listen until the channel is idle and repeat step 1.
  • If the transmission is delayed one time unit, repeat step 1.
The maximum utilization depends on the length of the frame and on the propagation time, the longer the frame or the shorter the propagation time, the higher the utilization.


CSMA/CD (Carrier Sense Multiple Access With Collision Detection):
CSMA, although more efficient than ALOHA or slotted ALOHA, still has one glaring inefficiency: When two frames collide, the medium remains unusable for the duration of transmission of both damaged frames. For long frames, compared to propagation time, the amount of wasted capacity can be considerable. This waste can be reduced if a station continues to listen to the medium while transmitting. This leads to the following rules for CSMA/CD:
 
1. If the medium is idle, transmit; otherwise, go to step 2.
2. If the medium is busy, continue to listen until the channel is idle, then transmit immediately.
3. If a collision is detected during transmission, transmit a brief jamming signal to assure that all stations know that there has been a collision and then cease transmission.
4. After transmitting the jamming signal, wait a random amount of time, then attempt to transmit again.

CSMA/CD Operation:
Figure 13.1 illustrates the technique for a baseband bus. At time to, station A begins transmitting a packet addressed to D. At tl, both B and C are ready to transmit. B senses a transmission and so defers. C, however, is still unaware of A's transmission and begins its own transmission. When A's transmission reaches C, at t2, C detects the collision and ceases transmission. The effect of the collision propagates back to A, where it is detected some time later, t3, at which time A ceases transmission.

Binary exponential back off:
random waiting period but consecutive collisions increase the mean waiting time, mean waiting time doubles in the first 10 retransmission attempts
  • after first collision, waits 0 or 1 slot time.
  • if collided again (second time), waits 0, 1, 2 or 3 slots.
  • if collided for the ith time, waits 0, 1, …, or 2i-1 slots.
  • the randomization interval is fixed to 0 … 1023 after 10th collision.
  • station tries a total of 16 times and then gives up if cannot transmit.

3 comments: