Make your own free website on Tripod.com

CS 635 Lecture 4, Part 2

CSMA/CD

CSMA/CD Ethernet is organized around the concept of layered protocols.

 IEEE 802.3 Format and Layers

The data link layer consists of  the data encapsulation/de capsulation entity and the transmit/receive media access management entity. The major functions of these entities are as follows:

Data encapsulation/decapsulation:
Media-access management
Data encoding/decoding
Channel access:
In a CSMA/CD network, each station has both a transmit and receive side to provide the incoming/outgoing flow of data. The transmit side is invoked when a user wishes to transmit data to another station on the network;

Operation of the transmit and receive layers

The transmit data encapsulation entity receives the user data and constructs the MAC frame. It also appends the frame check-sequence field to the data and passes the frame to media-access management, which buffers the frame until the channel is free. The channel is senses as free when it sees a carrier sense signal turned off from the transmit channel-access entity in the physical layer. After a brief delay, media-access management passes the frame to the physical layer.

At the physical layer on the transmit side, data encoding transmit the synch signal (preamble). In addition, it encodes the binary data stream to a self-clocking Manchester code. The signal is then passed to transmit channel access, which introduces the signal onto the channel.

The CSMA/CD (MAC) frame is transmitted to all stations connected to the channel. The signal propagates away from the originating node in both directions to the other nodes. A receiving station senses the preamble, synchronizes itself onto the signal, and turns on the carrier sense signal. Then, receive channel access passes the signal up to data decoding. The data decoding entity translates the Manchester code back to the conventional binary data stream and passes the frame up to media access management.

Like its counterpart on the transmit side, media-access management buffers the frame until the carrier sense signal has been turned off from receive channel access. The carrier sense signal goes off and indicates that all the bits have arrived. Media-access management can now pass the data up to data decapsulation. Data decapsulation performs and error check on the data to determine if the frame is destined for its node. It it is, is passes it to the user layer with the destination address (DA), source address (SA), and the LLC data unit.
 

Collisions

With ALOHA, slotted ALOHA or CSMA, when two frames collide, the medium remains unusable until both damaged frames are fully transmitted. 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. The 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 (repeat from step 1)
With CSMA/CD, the amount of wasted capacity is reduced to the time it takes to detect a collision. How long does it take to detect a collision?
Baseband bus - the worst case occurs when two stations are as far apart as possible.  The time no greater than twice the end-to-end propagation delay. (figure 6.2, p 179)
Broadband bus - the worst case occurs for two stations as close together as possible and as far as possible from the headend. The maximum time to detect a collision is four times the propagation delay from an end of the cable to the headend (figure 6.3, p 181)

An important rule followed in most CSMA/CD systems, including the IEEE standard, is that frames should be long enough to allow collision detection prior to the end of transmission. If shorter frames are used, collision detection does not occur, and CSMA/CD exhibits the same performance as that of the less efficient CSMA  protocol.

Another way to view collisions is through slot time, the time required for a frame to propagate though the entire channel and the delay in acquisition of the channel. An Ethernet 10 Mbit/s channel (baseband) has a propagation delay of 450 bit times (45us x 10,000,000 = 450). Ethernet requires a slot time to be larger than the sum of the propagation time (450 bits) and the maximum jam time (48 bits)

I f the signal is propagated to all parts of the channel without collisions, the station that has transmitted the signal is said to have acquired or seized the channel. Once this occurs, collisions are avoided, since all stations have detected the signal and defer to to it. However, in the event of the collision, the transmit channel access component notices the interference on the channel (in the form of voltage abnormalities) and turns on a special collision-detection signal to transmit media-access management.

Transmit media-access management performs two functions to manage the collision. First it enforces the collision by transmitting a special bit sequence called the jam. The purpose of the jam is to ensure that the duration of the collision is long enough to be noticed by all the other transmitting stations involved in the collision.  The CSMA/CD LAN requires that the jam  be at least 32 (but not more than 48) bits. This guarantees that the duration of the collision is sufficient to ensure its detection by all the transmitting stations on the network. Its limited length also ensures that the stations will no falsely interpret it as a valid frame. Any frame containing fewer than 64 bytes (octets) is presumed to be a fragment resulting from a collision and is discarded by any other receiving stations on the link.

Second: After the jam is sent, it terminates the transmission and schedules the transmission and schedules the transmission for a later time, based on a random wait selection.  The termination of frame transmission decreases the effect of a long frame collision manifesting itself on the channel for an extended time.

At the receiving station, the bits resulting from the collision are decoded  by the physical layer. The fragmented frames received from the collision are distinguished from valid frames by the receive media-access management layer. It notices that the collision fragment is smaller than the shortest valid frame and discards the fragments. Consequently, the jam is used to ensure all transmitting stations notice the collision, and the fragmented frame is transmitted to ensure that any receiving station ignores the transmission.

Both  Ethernet and IEEE 802.3  use 1-persistent algorithm to manage collisions and channel contention. Both nonpersistent and p-persistent have performance problems. In the nonpersistent case, capacity is wasted because the medium will generally remain idle following the end of a transmission even if there are stations waiting to send. In the p-persistent case, p must be set low enough to avoid instability, with the result of bad delays under light load.  The 1-persistent (p=1) should be even more unstable than p-persistent. However, the wasted time due to collision is very short (if the frames are long relative to propagation delay), and with random backoff, the two stations involved in a collision are unlikely to collide on their next tries.

To ensure that backoff maintains stability, IEEE 802.3 and Ethernet use truncated binary exponential backoff. A station will attempt to transmit repeatedly in the face of repeated collisions, but after each collision, the mean value of the random delay is double. After 16 unsuccessful attempts, the station gives up and reports an error. In addition, this 1-persistent algorithm is applied to an integral multiple of a slot time (512 bits).

The 1-persistent algorithm with exponential backoff is efficient over a wide range of loads. At low loads, 1-persistence guarantees that a station can seize the channel as soon as it goes idle, in contrast to the non- and p-persistent schemes. At high loads, it is at least as stable as the other techniques.

One side effect of the backoff algorithm is that it has LIFO effect; stations with no or few collisions will have a chance to transmit before stations that have waited longer.
 

Broad Band Base Band
Carrier Sense Listen for presence of a carrier on the outbound channel Listen for presence of transitions on the channel (no carrier to sense in digital signaling)
Collision Detection 1) Bit by bit comparison between transmitted and received data
2) The head end looks for higher than expected signal strength
High voltage swings. The signal on the cable at the transceiver exceeds the maximum that could be produced on transceiver alone
 

CSMA/CD performs best under conditions when aggregate channel utilization is relatively low (less than 30% utilization).

MAC Frame
 


 Description of an Ethernet controller

 Top  Prev Next