Computer Networks ALOHA
Slotted ALOHA and Pure ALOHA
Slotted ALOHA and Pure ALOHA are both types of Random Access Protocol used in network communication for sharing a common communication medium. They were among the earliest methods designed to handle multiple devices trying to transmit data simultaneously over the same channel, and they aim to resolve the issue of collisions in networks.
Collisions in Network Communication
When a collision occurs in network communication (such as in CD or in ALOHA protocols), it refers to a situation where two or more devices attempt to send data simultaneously on the same communication channel. This results in the data being garbled or lost. However, collisions in this context are electronic signaling events and do not cause physical harm to the wires or communication medium.
1. Low Voltage and Power:
- The electrical signals transmitted over network cables (like Ethernet cables) are very low in voltage and power. A collision simply means that signals from multiple devices interfere with each other, causing the data to become corrupted or unintelligible.
- Even though two signals may overlap or collide, their combined electrical power is not enough to cause any damage to the wire. The wires are designed to handle these low-power signals easily.
2. Collision Detection Mechanism (CSMA/CD):
- In protocols like CD, the devices on the network are constantly monitoring the wire. When a collision is detected, the devices stop transmitting immediately to prevent further issues. After detecting a collision, they send out a special signal called a jam signal to inform other devices that a collision occurred. Then, the devices wait for a random amount of time (using an algorithm like exponential backoff) before attempting to retransmit.
- This collision detection and backoff mechanism prevents excessive load on the wire, ensuring that the devices don’t continuously transmit and overload the system.
3. Current and Data Signals are Very Different from Short Circuits:
- The electrical signals used in data communication are controlled pulses of voltage and current. These signals are meant to be interpreted by network devices (like computers, routers, or switches) as bits of data. A collision just results in two signals overlapping, which leads to data corruption but no physical damage.
- By contrast, an electrical short circuit happens when a high-current electrical path is created unintentionally, usually due to exposed wires touching each other or improper connections. This can cause heat buildup and potentially damage the wiring or devices. In network communication, the current involved in data transmission is far too small to cause overheating or physical damage, even in the event of a collision.
4. Wires are Designed for Robustness:
- Ethernet cables and other network cables are designed to handle a range of electrical conditions without damage. They use insulated copper wires (in the case of traditional Ethernet cables) that can easily carry the data signals necessary for communication without risk of damage from collisions.
- The wires are also shielded or twisted in such a way that they minimize EMI, further protecting against the risk of damage or loss of signal quality.
5. Collisions are a Logical Event, Not a Physical One:
- In network communication, a collision is a logical event, meaning it’s related to the way data is being transmitted and interpreted, not the physical integrity of the wire. The wire simply carries the electrical signals, and the collision refers to two signals overlapping, not an electrical failure.
- The result of a collision is usually just corrupted data, which leads to a retransmission of the data. Devices on the network are programmed to recognize collisions and handle them appropriately.
6. Built-in Error Detection and Retransmission:
- In most network protocols, there’s a built-in system for error detection. If data gets corrupted due to a collision, the devices involved will detect this through methods like checksums or CRC. After detecting an error, the devices will simply discard the corrupted data and try to resend it.
- This process ensures that data integrity is maintained without causing any harm to the physical medium.
Summary:
- A collision in networking does not involve dangerous electrical surges. Instead, it refers to two or more devices sending data at the same time, leading to a mix of signals. The low voltage and power of the
References
Information
- date: 2024.10.06
- time: 20:14
Link to original
Computer Networks CSMA(CD CA)
Computer Networks CSMA(CD CA)
CSMA (Carrier Sense Multiple Access)
CSMA is a media access control protocol used in network communication to manage how devices share a common communication medium, such as Ethernet or wireless networks. It is designed to reduce collisions that occur when two or more devices try to send data at the same time on the same channel.
How CSMA Works:
- Carrier Sense: Before a device sends data, it first listens (or “senses”) the channel to check if it is idle or busy. The idea is to only send data when the channel is clear, to reduce the chances of collision.
- Multiple Access: Multiple devices share the same communication medium (e.g., Ethernet cable or wireless spectrum).
- Action on Busy Medium: If the medium is busy (i.e., another device is already transmitting), the device waits until the medium becomes idle before attempting to transmit. However, even with carrier sensing, collisions can still occur if two devices sense the medium as idle and begin transmitting at the same time.
Types of CSMA Protocols:
There are two primary types of CSMA protocols to handle what happens when a collision occurs:
- CSMA/CD (Collision Detection) – Used in wired networks.
- CSMA/CA (Collision Avoidance) – Used in wireless networks.
CSMA/CD (Carrier Sense Multiple Access with Collision Detection)
CSMA/CD is a refinement of CSMA used primarily in Ethernet (wired networks). It not only senses the carrier but also detects if a collision has occurred during data transmission.
Key Steps in CSMA/CD:
- Carrier Sense: The device listens to the channel to check if it’s idle or busy.
- Transmit: If the channel is idle, the device begins transmitting data.
- Collision Detection: While transmitting, the device also listens to the medium to detect any collisions (which happen when another device transmits at the same time).
- A collision is detected if the signal on the wire is different from the expected signal.
- Jam Signal: When a collision is detected, the device sends out a jam signal to notify all other devices on the network that a collision has occurred.
- Backoff and Retransmit: After detecting a collision and sending the jam signal, the device stops transmitting and waits for a random backoff time before attempting to retransmit the data. The backoff time increases with each successive collision (this is known as exponential backoff).
Efficiency:
- CSMA/CD is efficient for wired networks with low to moderate traffic. However, as the network traffic increases, collisions also increase, reducing overall efficiency.
- Collision detection is only possible in wired networks, where devices can monitor the signal on the shared communication medium (like an Ethernet cable).
CSMA/CD Use Case:
- Used in Ethernet (IEEE 802.3) networks, which were the standard for wired LANs before the introduction of modern switching technology.
- With the advent of full-duplex Ethernet (where data can flow in both directions simultaneously without collisions), CSMA/CD is now mostly obsolete.
CSMA/CA (Carrier Sense Multiple Access with Collision Avoidance)
CSMA/CA is used primarily in wireless networks, such as Wi-Fi (IEEE 802.11), where it’s difficult or impossible to detect collisions due to the nature of wireless transmission. Instead of detecting collisions, CSMA/CA tries to avoid collisions before they happen.
Why Collision Detection is Difficult in Wireless Networks:
- Wireless networks often suffer from the hidden node problem, where a device cannot hear transmissions from other devices because they are out of range, even though those devices may be communicating with the same router or access point.
- Unlike in wired networks, a device can’t listen while transmitting, which makes detecting collisions in real-time difficult or impossible.
Key Steps in CSMA/CA:
- Carrier Sense: The device listens to the channel to check if it’s idle. If the channel is busy, the device waits for a random backoff period before trying again.
- Collision Avoidance Mechanism:
- RTS/CTS (Request to Send / Clear to Send): To further reduce the chance of collisions, CSMA/CA may use a handshake mechanism. Before sending data, the sender device sends an RTS (Request to Send) signal to the receiver. If the receiver is ready to accept the transmission, it replies with a CTS (Clear to Send) signal. Once the sender receives the CTS, it knows that the channel is clear, and it proceeds with the data transmission.
- Transmit: Once the device senses the channel is idle and/or receives the CTS signal, it begins transmitting the data.
- Acknowledgment: After the data is successfully transmitted, the receiver sends an acknowledgment (ACK) to confirm that the data was received correctly.
Efficiency:
- CSMA/CA is more complex than CSMA/CD due to the added mechanisms like RTS/CTS and the acknowledgment process, but it is more suitable for wireless networks where collisions are harder to detect.
- It’s not as efficient as CSMA/CD for heavy traffic because the RTS/CTS mechanism introduces some overhead, but it significantly reduces the chances of collisions.
CSMA/CA Use Case:
- Used in Wi-Fi (IEEE 802.11) wireless LANs, which rely on CSMA/CA to manage the sharing of the wireless spectrum and to avoid collisions between wireless devices.
Comparison: CSMA/CD vs. CSMA/CA
Feature CSMA/CD CSMA/CA Main Application Wired networks (e.g., Ethernet) Wireless networks (e.g., Wi-Fi) Collision Handling Detects collisions after they happen Avoids collisions before they happen Collision Mechanism Monitors the wire for collisions during transmission Uses RTS/CTS and waiting periods to avoid collisions Efficiency High in low-traffic, wired networks Best suited for wireless, where collisions are hard to detect RTS/CTS Not used Optional mechanism to reduce collisions Backoff Uses exponential backoff to retransmit data after collisions Uses random backoff after sensing a busy channel
Key Differences:
Collision Detection vs. Collision Avoidance:
- CSMA/CD detects collisions and then takes steps to recover from them, while CSMA/CA tries to prevent collisions before they occur.
Wired vs. Wireless:
- CSMA/CD is suited for wired networks where it is possible to detect collisions by monitoring the wire.
- CSMA/CA is suited for wireless networks where detecting collisions is difficult, so avoidance strategies are used.
Performance in Different Environments:
- CSMA/CD is effective in wired networks with low to moderate traffic, but its efficiency drops as traffic increases due to more frequent collisions.
- CSMA/CA is better for wireless networks, but it introduces more overhead due to the additional mechanisms like RTS/CTS.
Conclusion:
- CSMA/CD is designed for wired networks like Ethernet, where collisions can be detected and resolved through retransmission.
- CSMA/CA is designed for wireless networks like Wi-Fi, where avoiding collisions is critical since detecting them is impractical.
- While CSMA/CD has largely become obsolete with modern full-duplex Ethernet and switching, CSMA/CA remains a core protocol in wireless communications.
References
Information
Link to original
- date: 2024.10.06
- time: 20:22