[Ns-developers] CSMA module enhancements

Tommaso Pecorella tpecorella at mac.com
Thu Jun 5 14:30:14 PDT 2014

Hi all,

this is just to fix & share some ideas I have about the current CSMA module.

Fact: the CSMA module implements a half-duplex bus-based CSMA link. I'm not aware if it is compliant with a particular 802.3 version, it may be.
In any case, the actual Ethernet links are a bit different, and trying to use it for a Gbps Ethernet may result in ... disappointing results.

I honestly think that we should prioritize a revamp of the csma module. There are some odd behaviours and some expected behaviour to introduce.

Odd behaviour (may be as well classified as a bug). The channel is busy for too long.
The CSMA channel changes to TRANSMITTING when the source start the Tx, then switches to PROPAGATING, and changes back to IDLE after the propagation delay.

This is... wrong, in may ways. The Rx node does know that the channel is busy after the propagation delay, not before. As a consequence, it "sees" the channel busy for the Tx time, not Tx+delay.
This has an heavy impact on the Tx backoffs, but it simplifies a LOT the collision detection. Still, it limits the Tx rate if the channel.

E.g., 10ms delay, 100Mbps, 1000Bytes. 
The packet will need 0,08 ms, but the channel will be busy for 10.08ms. That's about 0.8 Mbps... OUCH.

This is a plain, friggin' bug.
Note: I didn't check if the P2P link has the same "bug".

The second odd behaviour is the delay. If the model is a bus, then what the delay is modeling ? The maximum delay between two nodes? That's incorrect, since there's a limit in the standard.
Moreover, if it's a bus, then the delay should be different for each node, not the same for all. The only topology with the same delay between all the nodes is a hub with patches of the same length. Still, the delay is bounded by the standard.
This is not documented in any place.

The third odd behaviour is the half-duplex thing, but in order to fix it we should also provide a hub and a switch model (at least).

Please, comments. Also because I did a set of TCP tests over a p2p and a csma link. Only 2 nodes, same channel speed and delay. The csma performances... can not be justified.



PS: I think that a lot of confusion is due to the lack of a proper 802.3 model. Users see "csma" and use it as an Ethernet. But the csma model is not Ethernet. As a paradox, the p2p model is closer to an Ethernet than the csma model :\


``... anyone can do any amount of work, provided it isn't the
  work he is supposed to be doing at that moment.''
-- Robert Benchley, in Chips off the Old Benchley, 1949


Tommaso Pecorella - Ph.D.

Assistant professor
Dpt. Ingegneria dell'Informazione
Università di Firenze

CNIT - Università di Firenze Unit

via di S. Marta 3
50139, Firenze

email: tommaso.pecorella at unifi.it
       tommaso.pecorella at cnit.it

phone : +39-055-4796412
mobile: +39-320-4379803
fax   : +39-055-494569

More information about the Ns-developers mailing list