Multiple Access Protocols
Multiple Access Protocols are essential Medium Access Control (MAC) methods employed in data communication when two or more devices share the same communication channel.
Their primary function is to specify the rules governing when and how a device can transmit data. The overarching goal of these protocols is to avoid collisions, improve efficiency, and ensure fair access for all devices sharing the medium.
They are fundamental in both wired and wireless networks, including widely used technologies like Ethernet, Wi-Fi, and satellite links. The specific choice of protocol is influenced by the network type, traffic load, and desired performance.
Need for Multiple Access Protocols
The necessity for multiple access protocols arises from several critical challenges inherent in shared communication channels:
Collision Management: In a shared medium, if multiple nodes transmit simultaneously, their signals can interfere, leading to collisions. When a collision occurs, none of the receiving nodes can typically make sense of the transmitted frames, causing the data to be lost and the channel to be wasted. Multiple access protocols are needed to reduce or handle these simultaneous transmissions that cause data loss.
Efficient Utilization: These protocols aim to maximize channel usage while ensuring fairness among users. Ideally, when only one node has data to send, it should achieve the full channel transmission rate (R bps). When multiple nodes (M) are active, each should ideally receive an average throughput of R/M bps over a suitable time interval.
Scalability: Multiple access protocols should be designed to support multiple users without requiring centralized scheduling.
Reliability: By managing channel access and collisions, these protocols help to improve the delivery success rate of data and reduce the need for retransmissions.
Classification of Multiple Access Protocols
Multiple access protocols are broadly categorized into three main types based on how they manage access to the shared channel:
Random Access Protocols: ALOHA, Slotted ALOHA, CSMA, CSMA/CD, CSMA/CA.
Controlled Access Protocols: Polling, Token Passing.
Channel Partitioning Protocols: TDMA, FDMA, CDMA.
Random Access Protocols in Network Communication
Random Access Protocols are a category of Medium Access Control (MAC) methods where each network node transmits data whenever it has data to send, without any centralized coordination.
Characteristics of Random Access Protocols:
Design for Shared Channels: such as those found in wireless LANs or Ethernet networks. In such environments, multiple devices are connected to the same medium, and they all need to access it for data transmission.
Collision Occurrence: A significant characteristic of random access protocols is that collisions can occur if two or more stations attempt to transmit at the same time. When a collision happens, the signals from the colliding frames become tangled, rendering them unintelligible to the receivers. Consequently, all frames involved in the collision are lost, and the channel bandwidth is wasted during that interval.
Collision Handling and Retransmission: To manage collisions, if a node experiences a collision, it does not immediately retransmit. Instead, it waits for a random "backoff" time before attempting to retransmit the frame. Each node involved in the collision independently chooses its random delay. This independent choice increases the likelihood that one node will select a shorter delay and successfully transmit its frame without another collision.
Advantages: Simple to implement and efficient under low network load, as there's no fixed allocation of bandwidth. A node can transmit continuously at the full channel rate (R bps) if it's the only active node.
Disadvantages: Under heavy load, as number of active nodes increases, the probability of collisions increases, leading to a greater fraction of the channel's time being wasted on collisions or empty slots, reducing overall efficiency.
Unpredictable Delay: Due to the random backoff mechanism following collisions, the delay experienced by packets can become unpredictable.
Examples of random access protocols include ALOHA, Slotted ALOHA, Carrier Sense Multiple Access (CSMA), CSMA with Collision Detection (CSMA/CD), and CSMA with Collision Avoidance (CSMA/CA).
ALOHA Protocol
The ALOHA Protocol is a foundational Medium Access Control (MAC) method that emerged in the 1970s for wireless communication.
It is classified as a random access protocol, meaning each network node transmits whenever it has data to send, without requiring centralized coordination. When a frame first arrives, the node immediately transmits the entire frame into the broadcast channel.
Collision Handling: Collisions can occur if two or more stations transmit at the same time. If a transmitted frame experiences a collision, rendering it corrupted, the node does not immediately retransmit. Instead, it waits a random amount of time before retransmitting. All nodes involved in a collision independently choose their random delays for retransmission.
Vulnerability to Heavy Traffic: The ALOHA protocol is vulnerable to a high collision probability under heavy traffic. When many nodes frequently attempt to transmit, a significant number of transmissions will result in collisions, leading to a substantial waste of the broadcast channel's bandwidth.
Throughput: The protocol's throughput (S) is described by the formula S = G · e⁻²ᴳ. The maximum throughput is approximately 18%, which occurs when G = 0.5. This low efficiency highlights that only a small fraction of the channel's time is used for successful transmissions, especially when many nodes are active.
Example:
- Two stations A and B transmit simultaneously.
- Frames overlap, causing both to be corrupted.
- Both wait a random backoff time, then retransmit.
Unlike Carrier Sense Multiple Access (CSMA) protocols, ALOHA nodes do not "listen before speaking" (carrier sensing) or "stop speaking" if they detect another node transmitting (collision detection). This makes ALOHA like a "boorish partygoer" who continues to transmit regardless of others.
Slotted ALOHA Protocol
The Slotted ALOHA Protocol is a random access Multiple Access Control (MAC) method that improves upon the original ALOHA protocol by introducing a synchronized time structure.
Time Division into Slots: In Slotted ALOHA, time is divided into equal, discrete slots, with each slot's duration being equal to the time required to transmit one full frame. This means that if a frame has L
bits and the channel rate is R
bits/sec, each slot is L/R
seconds long.
Synchronized Transmission: Nodes are only permitted to start transmitting a frame at the beginning of a time slot. This requires all nodes in the network to be synchronized, so they know precisely when each slot begins. When a node has a new frame, it waits for the start of the next slot to transmit it.
Collision Reduction: This synchronization mechanism reduces the probability of collisions compared to pure ALOHA. By forcing transmissions to begin at slot boundaries, if a collision occurs in Slotted ALOHA, the frames must overlap entirely. This effectively halves the vulnerable period during which a collision can occur, leading to improved efficiency. In pure ALOHA, a node transmits immediately whenever it has data, leading to collisions even if frames only partially overlap.
Collision Handling: If a collision occurs (meaning two or more frames are transmitted in the same slot), the nodes involved detect the collision before the end of the slot. After detecting a collision, each node waits a random amount of time before attempting to retransmit the frame. Specifically, a node will retransmit its frame in each subsequent slot.
Throughput: The theoretical throughput (S) of Slotted ALOHA is given by the formula S = G · e⁻ᴳ. Its maximum throughput is approximately 37%, which is achieved when the average number of transmission attempts per slot (G) is 1.
Example:
Multiple stations, like A and B, participating in a Slotted ALOHA network. They synchronize their transmissions to the predefined time slots.
If Station A transmits in Slot 3 and Station B transmits in Slot 4, both transmissions are successful because they occur in different, non-overlapping slots.
However, if both Station A and Station B attempt to transmit in the same Slot 3, a collision occurs, and their frames are corrupted. Following this, both stations would then back off (wait a random amount of time) before attempting to retransmit their respective frames in a subsequent slot. This random backoff helps prevent them from colliding again immediately.
Slotted ALOHA maintains the advantages of being simple to implement and highly decentralized, allowing a single active node to transmit at the full channel rate. However, it still suffers from wasted slots due to collisions and empty slots when multiple nodes are active.
Carrier Sense Multiple Access (CSMA)
Sensing Before Transmitting: The fundamental principle of CSMA is that a node actively "listens" to the shared communication medium / channel before it transmits a frame to determine if another node is currently transmitting.
A station senses the channel before transmitting.
- If idle - transmit: If the channel is sensed as idle (no other transmissions are detected), the station proceeds to transmit its data.
- If busy - wait: If the channel is sensed as busy (another transmission is detected), the station waits.
Even with carrier sensing, collisions can still happen due to propagation delay of signal of transmission in the network. The longer the propagation delay, the greater the chance of a collision.
Access Modes: To handle the "waiting" aspect when the channel is busy, CSMA defines different access modes:
1-Persistent CSMA: When a station has data to send and finds the channel busy, it waits until the channel becomes idle, and then transmits immediately with probability 1. If a collision occurs, it waits a random time before rechecking and trying again.
Non-Persistent CSMA: If a station finds the channel busy, it does not continuously monitor the channel. Instead, it waits a random amount of time before rechecking if the channel is idle. This reduces the chance of multiple stations starting transmission immediately after a busy channel becomes idle, thus potentially reducing collisions at the cost of higher latency.
P-Persistent CSMA: This mode is often used with slotted channels. If the channel is idle, a station transmits with a certain probability
p
. If it does not transmit (which happens with probabilityq = 1-p
), or if it detects the channel is busy, it waits for the next slot and repeats the process.
CSMA with Collision Detection (CSMA/CD)
CSMA with Collision Detection (CSMA/CD) is a Multiple Access Control (MAC) protocol that significantly enhances the efficiency of shared broadcast channels, particularly in wired networks.
Used in traditional Ethernet (IEEE 802.3).
This protocol combines two core mechanisms:
- Carrier Sensing: This means a station checks the channel before sending data.
- Collision Detection: While a station is transmitting, it monitors the channel for a collision. If it detects that another node is transmitting an interfering frame, it stops transmitting
Working of CSMA/CD :
Sense Channel - If idle, transmit: When a station has a frame to transmit, its adapter first senses the channel. If the channel is idle, begins transmitting its frame. If the channel is busy, it waits until it senses no signal energy before starting transmission.
While transmitting, monitor for a collision: As the adapter transmits the frame, it simultaneously monitors the channel for signals from other adapters. Collisions can still occur in CSMA/CD due to propagation delay, where a node might sense the channel as idle and start transmitting before another node's signal reaches it.
If a collision is detected:
Stop transmission: The transmitting station immediately aborts its transmission. This is a key improvement over ALOHA protocols.
Send a jam signal: After stopping its own transmission, the station sends a short jam signal. This ensures that all other transmitting stations are aware of the collision.
Wait using Binary Exponential Backoff: The station then waits a random amount of time before attempting to retransmit.
Advantages of CSMA/CD include:
Early collision detection saves bandwidth: By stopping transmission as soon as a collision is detected, CSMA/CD prevents the channel from being wasted on transmitting complete corrupted frames, thus conserving bandwidth.
Efficient under low to moderate load: When traffic is not heavy, carrier sensing helps avoid many collisions. When collisions do occur, their early detection and the backoff mechanism allow for efficient recovery.
Limitations of the protocol are:
Not suitable for wireless (hidden node problem): In wireless environments, a node may not be able to "hear" all other nodes due to obstacles or signal fading, even if those other nodes are causing interference at a common receiver. This "hidden terminal problem" makes collision detection unreliable in wireless.
Needs hardware for collision detection: Implementing collision detection requires specific hardware capabilities in the network adapter to simultaneously send and receive signals, which can be costly or impractical in some scenarios.
Applications of CSMA/CD are found in:
- Half-duplex Ethernet.
- Legacy 10Base5, 10Base2, 10Base-T networks.
While CSMA/CD was crucial for early Ethernet, modern Ethernet installations using switches in a star topology typically operate without collisions, making the CSMA/CD MAC protocol largely unnecessary for the direct links between nodes and switches. This is because switches buffer frames and manage transmissions, preventing collisions and allowing full-duplex communication.
Comparison: ALOHA vs. Slotted ALOHA
Aspect | ALOHA | Slotted ALOHA |
---|---|---|
Time Sync | Not required | Required |
Collision Window | Full frame | Single slot |
Throughput | S = Ge⁻²ᴳ | S = Ge⁻ᴳ |
Max Throughput | ≈ 18% | ≈ 37% |
Efficiency | Low | Higher |
Implementation | Simple | More complex (sync) |
Comparison: CSMA vs. CSMA/CD
Aspect | CSMA | CSMA/CD |
---|---|---|
Collision Detection | No | Yes |
Collision Handling | Backoff after timeout | Stop, jam signal, backoff |
Efficiency | Lower | Higher |
Overhead | Low | Higher (jam + detect) |
Hardware Need | Simple | Collision detection circuit |
Application | Wireless LAN (CSMA/CA) | Wired Ethernet |
Overall Comparison Table
Aspect | ALOHA | Slotted ALOHA | CSMA | CSMA/CD |
---|---|---|---|---|
Channel Sensing | No | No | Yes | Yes |
Time Sync | No | Yes | No | No |
Collision Detection | No | No | No | Yes |
Collision Window | Full frame | Single slot | Reduced | Very small |
Max Throughput | 18% | 37% | Higher than ALOHA | Higher than CSMA |
Efficiency | Low | Medium | High | Very high |
Application | Satellite | Wireless sync | Wireless LAN | Wired Ethernet |
Classification of Multiple Access Protocols (Summary)
Multiple access protocols are broadly categorized into three main types based on how they manage access to the shared channel:
Random Access Protocols
are a category of Medium Access Control (MAC) methods where each network node transmits data whenever it has data to send, without any centralized coordination.
Examples:
ALOHA Protocol: Nodes transmit whenever they have data. If a collision occurs, they wait a random time before retransmitting. It is vulnerable to high collision probability, especially under heavy traffic, achieving a maximum throughput of approximately 18%.
Slotted ALOHA Protocol: Time is divided into equal-duration slots, and nodes can only transmit at the beginning of a slot. This reduces collisions compared to pure ALOHA and improves maximum throughput to about 37%.
Carrier Sense Multiple Access (CSMA): Stations first "sense" the channel before transmitting. If the channel is idle, they transmit; if busy, they wait. However, collisions can still occur due to propagation delays, as a station might sense an idle channel before another station's transmission signal reaches it.
CSMA with Collision Detection (CSMA/CD): Used in traditional Ethernet. It combines carrier sensing with collision detection, meaning a transmitting station monitors the channel while sending. If a collision is detected, transmission is immediately stopped, a "jam signal" is sent, and the station waits a random time using Binary Exponential Backoff before retransmitting. This early detection saves bandwidth.
CSMA with Collision Avoidance (CSMA/CA): Used in 802.11 wireless LANs (Wi-Fi) . Due to the difficulty and cost of collision detection in wireless environments (e.g., hidden terminal problem), stations use avoidance techniques instead. It employs link-layer acknowledgments (ACKs) and retransmissions. Stations sense the channel and use a random backoff, but do not detect collisions during transmission. Optional Request to Send (RTS) and Clear to Send (CTS) frames can be used to reserve the channel, further reducing collisions, especially in the presence of hidden terminals .
Controlled Access Protocols:
Impose a more structured way for nodes to access the channel, often involving explicit coordination to avoid collisions.
Examples:
Polling: A designated master node sequentially "polls" each other node, granting it permission to transmit up to a maximum number of frames. This eliminates collisions and empty slots, achieving higher efficiency. However, it introduces a "polling delay" (time to notify a node it can transmit) and makes the master node a single point of failure. The Bluetooth protocol is an example that uses polling.
Token Passing: A small, special-purpose frame called a token is passed among nodes in a fixed, logical order. A node can only transmit frames when it holds the token. Once it finishes transmitting (or if it has no data), it passes the token to the next node. This method is decentralized and highly efficient but vulnerable to token loss or a node failure, requiring complex recovery procedures. Examples include FDDI and IEEE 802.5 token ring.
Channel Partitioning Protocols:
Divide the shared communication channel's available resources (time, frequency, or code) into smaller, dedicated portions, and each node is assigned a unique portion. This approach fundamentally avoids collisions by preventing simultaneous access to the same resource.
- Advantages: Guaranteed bandwidth for each user and no collisions.
- Disadvantages: A node is limited to its allocated portion of bandwidth, even if it's the only active node and the rest of the channel is idle.
Examples:
- Time-Division Multiple Access (TDMA): The channel's time is divided into fixed-duration frames, and each frame is further divided into fixed-size time slots. Each node is assigned specific time slots in which it can transmit. Bluetooth utilizes a TDM-like approach with 625-microsecond time slots. LTE also uses a combination of TDMA and FDMA (OFDM).
- Frequency-Division Multiple Access (FDMA): The channel's total bandwidth (frequency spectrum) is divided into smaller, non-overlapping frequency bands. Each node is assigned a unique frequency band for its transmissions. LTE employs OFDM, which uses multiple channel frequencies in combination with time slots.
- Code Division Multiple Access (CDMA): Each bit sent by a node is encoded using a unique "code" (a sequence of values changing at a faster rate than data bits). Multiple nodes can transmit simultaneously, and a receiver can extract a specific sender's data if it knows that sender's code, even amidst interference. This method "partitions the codespace" and is widely used in wireless LANs and cellular technologies.
The DOCSIS (Data-Over-Cable Service Interface Specifications) protocol, used in cable Internet access, serves as a comprehensive example, incorporating elements of FDM (for separating upstream/downstream channels), TDM (dividing upstream channels into mini-slots), random access (for mini-slot request frames), and centrally allocated time slots (by the Cable Modem Termination System).
Well Known Ports
Well-Known Ports (0-1023) These ports are reserved for standard protocols and are assigned and controlled by ICANN.
Port 20: FTP-data (TCP) - Used for File Transfer Protocol data connection. The client issues a passive open using an ephemeral port, and the data connection is created at the server's well-known port 20.
Port 21: FTP-21 (TCP) - Used for File Transfer Protocol control connection.
Port 23: TELNET (TCP) - For Terminal Network remote login.
Port 25: SMTP (TCP) - Simple Mail Transfer Protocol, used to transfer emails between mail servers. Operates over TCP port 25. An alternative port is 587.
Port 53: DNS (UDP, TCP) - Domain Name System. DNS query and reply messages are typically sent within UDP datagrams to port 53. TCP is used if the response message size is more than 512 bytes, or for zone transfers (e.g., from a secondary to a primary name server).
Port 67: DHCP (UDP, TCP, SCTP) - Dynamic Host Configuration Protocol.
Port 69: TFTP (UDP, TCP, SCTP) - Trivial File Transfer Protocol.
Port 80: HTTP (TCP) - HyperText Transfer Protocol, commonly used by Web servers. Web servers often run on port 80.
Port 143: IMAP (TCP) - Internet Message Access Protocol, used for standard communication. An example mentions IMAP e-mail protocol using port 143.
- Port 443 : HTTPS
Port 520: RIP (UDP) - Routing Information Protocol, used by routers for communication.
Port 993: IMAPS (TCP/SSL) - Internet Message Access Protocol for secure (SSL/TLS) communication. Also mentioned in relation to priority queuing.