# Multiple access What if multiple machines are sharing the same link?

## Presentation on theme: "Multiple access What if multiple machines are sharing the same link?"— Presentation transcript:

Multiple access What if multiple machines are sharing the same link?

Random access In random access protocols, any device can send data at any time, so long as the rules for sending are followed. Nobody is privileged. The goal of the protocols is to maximize use of the link and minimize collisions - when two devices try to talk at the same time.

ALOHA Pure ALOHA: Whenever the sender has a frame to send, it sends the frame. If no ACK is received, assume a collision: –Wait a random amount of time. This avoids everybody resending the collided frames at the same time. (the back-off time, T B ) –Re-send the frame and repeat. –After some maximum number of attempts, K max, give up and wait until later.

Pure ALOHA is pretty lousy at delivering frames, and has a very large vulnerable time. Slotted ALOHA tries to fix this by having rules for when a station can send. –Time is divided into slots of T fr length. –A station can send only at the beginning of a slot. –Thus, if you are the only station that sends a frame at the beginning of a slot, that frame will get through.

CSMA Carrier Sense Multiple Access Before sending, a station must check the link to make sure it is free. Significantly reduces the probability of a collision, at the cost of extra overhead. Vulnerable time of T p. –What are the rules if the link is busy or idle? 1-persistent: Send frame immediately when the link is idle. (Ethernet) Nonpersistent: Check link; if idle, send; if busy, wait random time and check again. p-persistent: 1.If the link is idle, send frame with a probability p. 2.With probability q = 1-p, wait for next slot and check link again. –If idle, do 1. –Else, wait random time and try again.

CSMA/CD CSMA leaves it unclear what to do in case of a collision. To detect a collision, the sender listens to the link after sending a frame: –If it detects nothing else in T fr, it assumes no collision. –If, however, it detects other bits in less than the frame transmission time, there must have been a collision.

Frame size in CSMA/CD If the frame size is too small, there will be lots of undetected collisions. In particular, the problem is if T fr < 2*T p.

CSMA/CA Ideally, we would like to avoid collissions all together (hence Collision Avoidance). Collision detection is not always feasible, especially in high-attenuation media (e.g., wireless). Collision avoidance involves not transmitting the instant the link is idle. Wait the interframe space (IFS). This ensures that some distant device has not already started sending. If the channel is still idle, wait through the contention window - essentially a random number of time slots. If the channel is busy, stop the timer until the channel is idle, then restart it. If the channel is idle after the contention window, send.

Controlled Access Random access methods can reduce, but never eliminate, the chance of a collision. They do so at the cost of higher overhead, but at the benefit of maximal use of the link. Controlled access protocols eliminate collisions by only giving sending rights to one device at a time. However, the link might be wasted if an authorized device has nothing to send or hogs the credentials.

Reservation To use the link, a device needs to make a reservation. –Each time slot is preceded by set of reservation slots, one for each device on the network. –If a device wants to send a data frame, it makes a reservation. –After the reservation slots have passed, each frame that made a reservation sends its data in order.

Polling Polling works in networks set up as primary/secondary architectures, where all communication must go through the primary device. –The primary can send data whenever the link is free. (the select function) –If the primary has nothing to send, it polls each of the secondary devices, one at a time, until it finds one with data to send.

Token passing Used in token-ring networks, where each devidce has a predecessor and a successor. –A device can only send when it has the token - a special packet handed around the ring –A token can only be received the predecessor and sent to the successor.

Channelization In channelization, sending devices share the bandwidth of a link and send simultaneously. Primarily useful in cases where communication is relatively continuous (such as phones) FDMA - link is divided into frequency bands and each sending device is assigned a band. TDMA - link is divided into time slots which are allocated to sending devices.

Code Division Multiple Access CDMA works a little differently. The link consists of only one channel, but all devices can transmit at the same time. –Each device is assigned a code, c i. –Codes have two important properties: –The result of multiplying any two codes together is 0. –The result of multiplying any code by itself is the number of devices on the network. –The data on the link are:

Codes are simply vectors, with one slot for each device on the network. The rule for sending to utilize the codes is: 0 bit = -1; 1 bit = 1; idle = 0 If a device wants to send a bit, it multiplies that bit by its code, which yields a vector. Since the nature of signals is such that they are additive, each device sending to the link simultaneously has the effect of adding these vectors together. For another device to extract a bit it multiplies the total signal on the link by the code of the device it wants to listen to.