What is Aloha protocol – Pure Aloha – Slotted Aloha?
In the computer networks, the devices access the common underlying shared medium (e.g LAN cable ) before sending frames. Aloha protocol provides an access control mechanism, for shared channel/medium. For example, a local area network connects multiple computers to each other over a common physical network, using wires, hubs, switches, routers, etc.
When a station sends a packet to another computer over the LAN, the sender broadcasts the packet. At the same time, if there are other broadcasts from other computers then are chances of collision and the packets will be garbled.
Note that the collision problem may occur only in broadcast networks. Aloha protocol provides a mechanism for communication over a common shared medium to transmit a packet reliably.
In other networks like peer to peer, no need for Aloha protocol, as there is no sharing of a medium with others, so no collision. In the following section, we will describe each type of aloha protocol in detail.
What are pure aloha and slotted aloha?
The first version of the aloha protocol is named Pure Aloha. After that, a more efficient version was developed which was named slotted aloha. Both pure aloha and slotted aloha work for a shared broadcast network, such as LAN or WiFi LAN.
What is Pure Aloha?
As the name suggests pure aloha is the original version of the aloha protocol. Following is the procedure in pure aloha for communication.
- When a network station needs to send a frame, it sends it immediately and waits for an acknowledgment.
- If the sender receives an acknowledgment, the sender may send the next frame.
- If no acknowledgment sender assumes the frame has been garbled and retransmits the same frame after a random time to avoid collision again.
What is slotted Aloha?
The next version is more efficient. The following describes the protocol procedure for the slotted aloha protocol.
- In slotted aloha, time is divided into slots. A sender may send a frame at the start of the time slot.
- If the sender does not send at the start then it will wait for the next slot.
- If two sender sends the frames at the beginning of the time slot, there will be a collision and the frame will be garbled.
- If the acknowledgment is not received, the frame is retransmitted in a new slot.