When the nodes are interconnected with a hub (as opposed to
a link-layer switch), as shown in "Ethernet" Figure 2, the Ethernet
LAN is a true broadcast LAN - that is, when an adapter transmits a frame, all
of the adapters on the LAN receive the frame.
Because Ethernet can employ broadcast, it needs
a multiple access protocol. Ethernet uses the celebrated CSMA/CD multiple
access protocol. Recall from "Multiple Access Protocols" that CSMA/CD
does the following:
1. An adapter may begin to transmit at any time; that is, there is no notion of time slots.
2. An adapter never transmits a frame when it senses that some other adapter is transmitting; that is, it uses carrier sensing.
3. A transmitting adapter aborts its transmission as soon as it detects that another adapter is also transmitting; that is, it uses collision detection.
4. Before attempting a retransmission, an adapter waits a random time that is typically small compared with the time to transmit a frame.
These mechanisms give CSMA/CD much better performance than slotted ALOHA in a LAN environment. In fact, if the maximum propagation delay between stations is very small, the efficiency of CSMA/CD can approach 100 percent.
But note that the second and third mechanisms listed above require each Ethernet adapter to be able to (1) sense when some other adapter is transmitting and (2) detect a collision while it is transmitting.
Ethernet adapters perform these two tasks by measuring voltage levels before and during transmission.
Each adapter runs the CSMA/CD protocol without explicit coordination with the other adapters on the Ethernet. Within a specific adapter, the CSMA/CD protocol works as follows:
1. The adapter obtains a datagram from the network layer, prepares an Ethernet frame, and puts the frame in an adapter buffer.
2. If the adapter senses that the channel is idle (that is, there is no signal energy entering the adapter from the channel for 96 bit times), it starts to transmit the frame. If the adapter senses that the channel is busy, it waits until it senses no signal energy (plus 96 bit times) and then starts to transmit the frame.
3. While transmitting, the adapter monitors for the presence of signal energy coming from other adapters. If the adapter transmits the entire frame without detecting signal energy from other adapters, the adapter is finished with the frame.
4. If the adapter detects signal energy from other adapters while transmitting, it stops transmitting its frame and instead transmits a 48-bit jam signal.
5. After aborting (that is, transmitting the jam signal), the adapter enters an exponential backoff phase. Specifically, when transmitting a given frame, after experiencing the nth collision in a row for this frame, the adapter chooses a value for K at random from {0,1,2, . . . , 2m - 1} where m = min(n,10). The adapter then waits K . 512 bits times and then returns to Step 2.
0 Comments