Slotted ALOHA

corinna x. chen   |   jee y. lee

 

SC 546 Project: C++ simulation of Slotted ALOHA

Introduction | Goals | Our Project | Simulation | Code

Introduction

Random access protocol is a protocol that implements the random transmission of packets from several nodes, each node having the same probability of transmission. The random access protocols assume that the data rate is constant for all transmission of each node. However, when two or more packets are transmitted to the same destination at the same time, collisions occur causing all packets to be lost. In order to solve this collision problem, MAC protocols allow for collision detections. The random access MAC protocols specify how to detect collisions and how to recover from these collisions. Recovery is usually through delayed retransmission of the packets.

x Simulation

The Slotted Aloha is an example of the MAC protocol. The Slotted Aloha is a synchronized protocol, having "slots" of equal-sized intervals of time. Each node independently transmitts with probability p.

Because this protocol is synchronized, transmission is available only at the beginning of each slot and collision is immediately detected. When collision is detected, packets are retransmitted with a probability of p, until transmission is successful.

Depending on the number of nodes and the probability of successful transmission, the transmission of one packet at a given time slot is as follows:


PROB (only one node transmits given N nodes) = N*p (1-p)^(N-1)

Where: N is the number of nodes

p is the probability of ransmission at each slotted time interval


At best, Slotted Aloha has an efficiency of 37% useful transmission when choosing an optimal p as N-> infinity.


Goals for the project

The goals of this project were:

  • to further understand the Slotted Aloha Random Access Protocol
  • to simulate the Slotted Aloha using the C++ program


Our project

Our Computer Communications and Networking project will simulate the Slotted Aloha using the C++ program. The Slotted Aloha simulations will consist of three nodes transmitting to one destination, each having a probably of transmission p. Because prioritization does not exist in random protocols, the probability is the same for all three nodes.

The program simulates the transmission of one packet for three nodes. Each node will attempt to transmit the packet with a probability of p. If a collision occurs, the nodes wil retransmit. If a transmission is successful, the node will not try to transmit for the rest of the simulation. The simulation will continue until all slots have passed. Due to the limited space in the display, our simulation will only allow 9 slotted time intervals. To focus on the transmissions and collisions of the protocol, the slotted time intervals are controlled by the user and does not represent equal time sharing.

referenced from www.cs.umd.edu/.../417-F01/Slides/ chapter5a-aus/sld021.htm