CSMA Simulation

by Choongmin Lee on

Compares the two common MAC protocols, CSMA/CD and DCF (CSMA/CA) using simulation.

Model

  • Each node generates data packets according to a Poisson process with rate λ.
  • No transmission errors.
  • For DCF, propagation time is assumed to be the same for all pairs of nodes; when a node begins to transmit, some times later all the other nodes know it at the same time. This is not true for CSMA/CD, for which each node is equally spaced on the bus and propagation times for each pair of nodes are proportional to their distance.

Parameters

MAC:
octets
bps
μs
μs
bits
μs
μs
μs
μs (= SIFS + 2 × SlotTime)

Simulation

Your browser doesn't support JavaScript or the canvas element.

Animation frame rate: FPS
Simulation speed:
/s

Tip: Click a node to generate a packet independently of the random processes.

Results

Independent variable:
From to increasing by
Take results at seconds
Number of nodes Packet arrival rate (pkts/s) Throughput (pkts/s) Mean packet delay (ms) Collision probability Packet drop rate 1 Packet drop rate 2