| Teaching the CSMA protocol through the Benchmark Lan-T |
Problem
Implement the CSMA protocol for packet communication
between a number of nodes connected to a common bus.
Concepts
Listen-before-transmit to improve efficiency
Effect of propagation delay
Program Development
In ALOHA, a node transmits whenever it wishes without regard to the activities
of other nodes. This may cause a collision with the transmission of another
node, resulting in both packets being lost.

Under heavy load, frequent collisions can severely reduce the throughput. By adding a modest amount of hardware to the NIU, it is possible to detect the presence of a transmission on the network. We can then modify the transmission protocol to require a node to listen to the network before transmission. Only if the network is idle is the node permitted to transmit. This is referred to as Carrier Sense Multiple Access (CSMA) for historical reasons: it was first used in radio networks where a packet is modulated onto a carrier frequency. The presence of this carrier was sensed.

It is still possible to get collisions due to the non-zero delay between sensing idle and actually starting transmission and the propagation delay of the signal along the bus to other stations. Refer to Figure 1 which shows activity on the network over a period of time. The X-axis represents time, while the Y-axis represents space. Assume that a node A decides to transmit a packet. At time t0 it senses the network and finds it idle. After some hardware/software latency of δ , it actually starts transmitting at time t1. This signal propagates at a high but finite speed, and reaches node B at time t2. Note that t2 - t1 = t* δ , where t is the propagation time per metre of the electrical signal (approximately 5ms/m) and d is the distance between nodes A and B.
Thus, even after A has started transmitting, B could sense the cable as being idle and start transmission at time t3 < t2. As shown in the figure, B's packet propagates towards A and at some point both packets collide and are lost. Notice that t3 could even be earlier than t1. In fact, t3 could be anywhere in the range (t1- τ - δ, t1+ τ + δ ) and cause a collision (see Figure 2). This interval is referred to as the vulnerable period. If B started transmitting before t1- τ - δ , A would find the network busy at t1 and would not transmit, avoiding a collision.
| Trying it Out |
First, set the bit delay in the Network Emulator Unit to 0. Measure throughput X for various values of offered load G. Now, increase the bit delay in steps up to the maximum. In each case, measure X versus G. Plot all the curves on a single graph and compare them. Note that the parameter a = (end-to-end delay in bits)/ (packet length in bits) = (bit delay * N)/P, where N is the number of nodes and P is the packet length in bits. Your curves should resemble Figure 3.

Applications
Especially useful in radio-based LANs
Exercises
Set up one node as the controller to automate the running of a series of
experiments (see Problems under Experiment E4.1).
Implement non-persistent CSMA. Compare performance to that of 1-persistent CSMA and to the theoretical curves [Tanenbaum 88].
Implement p-persistent CSMA. Experiment with different values of p. Can you devise an adaptive p-persistent CSMA in which p varies with load and which performs better than with fixed p? Compare performance to that of non- and 1-persistent CSMA.
Repeat the experiments at higher bit rates. Can you explain any change in the curves?
For more information on what different areas of computer networks and data
communication technologies are possible to be covered through Benchmark LanT
please visit our website www.benchmark-electronics.com.
| Page 1 |Page 2 | Page 3 | Page 4 | Top |
