CSMA/CD simulation

By

Description

This is a simple simulation of CSMA/DA on a 5-computer LAN setup written in JavaScript. The computers can send telegrams to each other and use exponential backoff to space out repeated retransmissions of the same block of data.

A red block means collision, all other colors represent data. Darker grey squares below each computer indicate the possible slots the computer can choose for retransmitting. Random choices are indicated by green. Manually chosen slots are colored dark red.

The number on device screens displays the number of retries the device has made to transmit a telegram. The number next to the cable displays the number of slot times left until the device attempts to retransmit the last packet.

Switching on short telegrams illustrates what would happen if the telegrams were too short. – the transmitting device will think the transmission was successful even if there was a collision.

Licenced under MIT, the full source for this project can be found at GitHub.

Instructions