Multiple Access Protocols - ALOHA and CSMA
In questa pagina 9
In questa pagina 7
The problem: one medium, many stations
On the link layer (Data Link Layer and FramingThe data link layer (DLL) delivers a frame from a node to an adjacent node over a link. Services: framing, medium access (MAC) with 48-bit MAC addresses, flow control, error detection and correction. It splits into DLC (framing, error and flow control) and MAC (shared medium access). Framing delimits frames with a flag: byte-oriented protocols (8-bit flag, ESC) use byte stuffing, bit-oriented ones (flag 01111110) use bit stuffing, which inserts a 0 after every five consecutive 1s.Data Link Layer and Framing →) problems split into two families. Data Link Control (DLC: framing, error control with ARQ Protocols - Stop-and-Wait, Go-Back-N and Selective RepeatARQ (Automatic Repeat reQuest) makes an error-prone link reliable: the receiver acknowledges (ACK) frames received correctly and the sender retransmits when the timeout expires. Timeouts (against deadlock) and sequence numbers (against duplicates) are needed. With t_G = t_F + 2 tau_p + t_A and error probability p: Stop-and-Wait rho = t_F(1-p)/t_G; Go-Back-N with window N >= t_G/t_F rho = (1-p)/(1+(N-1)p); Selective Repeat rho = 1-p. Efficiency eta = rho I/F. The optimal window is the pipe capacity in packets. For Selective Repeat there is also an optimal frame length: with overhead o and bit error probability P_b, x_opt is about o/2 + sqrt(o/P_b) (shorter frames when the channel errs more).ARQ Protocols - Stop-and-Wait, Go-Back-N and Selective Repeat →, flow control) applies to both point-to-point and shared links. Medium Access Control (MAC) is needed only when the medium is shared (usually broadcast, everybody hears everybody): it decides when a station may transmit a frame.
The MAC delivers the LLC PDU between source and destination station and offers an acknowledged service. The MAC PDU contains:
| Field | Content |
|---|---|
| Destination address (DA) | bytes |
| Source address (SA) | bytes |
| Control | depends on the MAC protocol |
| Information | the upper-layer (LLC) PDU |
| FCS (Frame Check Sequence) | bytes for frame integrity check |
MAC protocols fall into three families:
- random access: ALOHA, slotted ALOHA, CSMA, CSMA/CD, CSMA/CA;
- controlled access: reservation, polling, token passing;
- channelization: FDMA, TDMA, OFDMA, CDMA, SDMA.
The performance (throughput, delay) of random protocols is computed in Performance of Multiple Access ProtocolsWith Poisson arrivals, the success probability of a frame is the probability that no other frame arrives in the vulnerable time: pure ALOHA P_S = e^(-2G), throughput S = G e^(-2G) with maximum 1/(2e) = 0.18 at G = 1/2; slotted ALOHA S = G e^(-G) with maximum 1/e = 0.37 at G = 1; non-persistent CSMA with a = tau_p/t_F: S = G e^(-aG) / (G(1+2a) + e^(-aG)), which tends to 1 as a tends to 0 but collapses for large a, where slotted ALOHA is better. For TDMA (M/D/1) E[T] = t_F (N_u/2 + S N_u / (2(1-S)) + 1 + a) and for FDMA E[T] = t_F (N_u + S N_u / (2(1-S)) + a): FDMA is slower by t_F (N_u/2 - 1).Performance of Multiple Access Protocols →. Here the algorithms are described.
Random access: the idea
In random (or contention) access no station is superior to the others: whoever has data uses a procedure to decide whether to transmit, and there is no predetermined instant to transmit. Stations compete for the channel. If two stations transmit at the same time there is a collision and the frames involved are very likely lost.
Every protocol answers four questions:
- when may a station access the medium?
- what does it do if the medium is busy?
- how is success or failure of a transmission established?
- what does it do if there is an access conflict?
Pure ALOHA
Designed in the early 1970s to link computers on different islands of the Hawaiian archipelago (no cables): it is the protocol of ALOHAnet, the first wireless packet data network (History and Structure of the InternetThe Internet grew from ARPANET (1969), a packet-switched network; TCP/IP (1972-77) moved error control from the network nodes to the end hosts, which is what makes it scalable; today it is a network of networks made of local, regional and national ISPs that exchange traffic by peering at IXPs, with IANA, IETF, IRTF, IAB and ISOC coordinating addresses and standards.History and Structure of the Internet →).
Definition (pure ALOHA algorithm).
- When: as soon as there is something to transmit.
- Medium busy? Transmit anyway, without looking.
- Outcome: an ACK/NACK scheme with a timeout. If the ACK does not arrive within the timeout, a collision is assumed.
- Conflict: wait a random time (backoff) and retransmit; repeat until success.
The backoff is random for a precise reason: two stations that collided, if they waited the same time, would retransmit together again and collide forever.
One single bit of a frame coexisting on the channel with one single bit of another frame destroys both: pure ALOHA has no rule limiting overlap.
Definition (vulnerable time of pure ALOHA). If station B starts transmitting a frame at time (the frame lasts ), the frame suffers no collision only if no other frame (new or retransmitted) starts from seconds before to seconds after its start. The vulnerable time is
Why two : a frame started before has already ended when B starts, so it does not disturb; but a frame started in is still going when B begins, and one started in overlaps the tail of B. The critical interval is long.
Example. A -bit frame on a Mbit/s channel: ms. If B starts at ms, any other frame starting between ms and ms destroys it: ms.
Grafico interattivo: Vulnerable time of pure ALOHA with tF = 1 ms: frame B starts at 10 ms (lasts 10-11 ms); the coloured band, from 9 to 11 ms, is the start interval that destroys B. A1 (starts at 9.3) and A2 (starts at 10.7) collide, A3 (ends at 9.4) and A4 (starts at 11.3) do not
Slotted ALOHA
Definition (slotted ALOHA algorithm). Time is divided into slots of duration and stations are forced to start transmitting only at the beginning of a slot. A frame generated mid-slot waits for the start of the next one (mean wait ). Otherwise the algorithm is that of pure ALOHA (ACK, timeout, random backoff).
Since everybody starts only at slot boundaries, two frames overlap either completely or not at all: collision occurs only if two frames are ready in the same slot. The vulnerable time halves:
The price is synchronization: all stations must know the slot boundaries.
The maximum normalized throughput of pure ALOHA is about , that of slotted ALOHA about (), twice as much (Performance of Multiple Access ProtocolsWith Poisson arrivals, the success probability of a frame is the probability that no other frame arrives in the vulnerable time: pure ALOHA P_S = e^(-2G), throughput S = G e^(-2G) with maximum 1/(2e) = 0.18 at G = 1/2; slotted ALOHA S = G e^(-G) with maximum 1/e = 0.37 at G = 1; non-persistent CSMA with a = tau_p/t_F: S = G e^(-aG) / (G(1+2a) + e^(-aG)), which tends to 1 as a tends to 0 but collapses for large a, where slotted ALOHA is better. For TDMA (M/D/1) E[T] = t_F (N_u/2 + S N_u / (2(1-S)) + 1 + a) and for FDMA E[T] = t_F (N_u + S N_u / (2(1-S)) + a): FDMA is slower by t_F (N_u/2 - 1).Performance of Multiple Access Protocols → gives the proof).
CSMA: listen before talking
Definition (CSMA). Carrier Sense Multiple Access: each station listens to the medium before transmitting (listen before talk) and transmits only if it finds it idle.
The collision probability decreases, but does not vanish, because of the propagation delay : a station may sense the channel idle only because the first bit sent by another station has not reached it yet.
Definition (vulnerable time of CSMA). It is the (maximum) propagation time from one end of the medium to the other:
Why: if a station starts transmitting and another tries to do so within , the latter has not sensed anything yet and there is a collision. But once the first bit of the frame has reached the opposite end, all stations have sensed it and refrain.
Example. A km bus with propagation m/s: s. A -bit frame at Mbit/s: s. The vulnerable time is s, one tenth of the frame (); for pure ALOHA it would be s, twenty times more. If instead were comparable to (satellite, very fast network), listening would help little: the difference between CSMA and ALOHA disappears.
Variants: what to do if the channel is busy
| Variant | Algorithm | Effect |
|---|---|---|
| 1-persistent | listens continuously; as soon as the channel is idle transmits immediately (with probability 1); if busy keeps listening | high collision probability: two or more waiting stations transmit together as soon as the channel frees |
| non-persistent | listens once: if idle transmits immediately; if busy waits a random backoff and listens again | fewer collisions (random wait), but lower efficiency: the channel stays idle while frames are waiting |
| p-persistent | channel has slots of duration maximum ; if idle: with probability transmits; with probability waits for the start of the next slot and listens again | fewer collisions and better efficiency |
In detail, p-persistent, if the channel is idle:
- with probability send the frame;
- with probability wait for the start of the next slot and listen again:
- if still idle go back to point 1;
- if busy, behave as after a collision and apply the backoff procedure (e.g. binary exponential backoff, see LAN - Ethernet and Wi-FiA LAN covers a limited area and is defined by the IEEE 802.x family (802.3 Ethernet, 802.11 Wi-Fi), which splits the link layer into LLC and MAC. Ethernet is connectionless, with no flow control and no ACK; it uses 1-persistent CSMA/CD; the frame is 64 to 1518 bytes (6-byte addresses, type/length, data 46-1500, 4-byte CRC) and the 64 B minimum comes from t_F >= 2 tau_p. From 10 Mbit/s on coax up to 10 Gbit/s on fibre, with full-duplex switches removing collisions. Wi-Fi (802.11) uses CSMA/CA, has BSS (with access point) and ad hoc modes, EBSS with a distribution system, adapts its bitrate to the SNR, and has hidden and exposed terminal problems, partly solved by RTS/CTS and NAV.LAN - Ethernet and Wi-Fi →: the interval from which the wait is drawn doubles at each collision); when the backoff timer expires go back to point 1.
Logic of the values: is the 1-persistent case; with small the probability that several waiting stations start together drops, but some slots of idle channel are wasted.
Non-persistent CSMA (the Wi-Fi one). Flow: monitor the channel; if idle, send the frame; if no ACK arrives do a random backoff and, while attempts remain, start over; if the channel is busy do a random backoff immediately and listen again. The link layer thus uses a stop-and-wait retransmission policy (ARQ Protocols - Stop-and-Wait, Go-Back-N and Selective RepeatARQ (Automatic Repeat reQuest) makes an error-prone link reliable: the receiver acknowledges (ACK) frames received correctly and the sender retransmits when the timeout expires. Timeouts (against deadlock) and sequence numbers (against duplicates) are needed. With t_G = t_F + 2 tau_p + t_A and error probability p: Stop-and-Wait rho = t_F(1-p)/t_G; Go-Back-N with window N >= t_G/t_F rho = (1-p)/(1+(N-1)p); Selective Repeat rho = 1-p. Efficiency eta = rho I/F. The optimal window is the pipe capacity in packets. For Selective Repeat there is also an optimal frame length: with overhead o and bit error probability P_b, x_opt is about o/2 + sqrt(o/P_b) (shorter frames when the channel errs more).ARQ Protocols - Stop-and-Wait, Go-Back-N and Selective Repeat →).
CSMA/CD (Ethernet)
Definition (CSMA/CD). Carrier Sense Multiple Access with Collision Detection: adds to CSMA the detection of collisions while transmitting. The station monitors the medium during frame transmission:
- if the energy level on the channel is consistent with the transmission of its own frame, all is well;
- if it is abnormal (higher), there is a collision: transmission is aborted and a short jamming signal is sent to warn all other stations.
Algorithm: monitor the channel; if idle send the frame; on collision send the jam signal and, if attempts remain, do a random backoff and retry; otherwise terminate. Here too the link layer uses stop-and-wait. Advantage over CSMA: as soon as a frame is understood to be lost, the channel stops being wasted with the rest of a frame doomed to be lost.
Minimum transmission duration
For detection to work, the station must notice the collision before it has finished transmitting the frame. If it had already sent the last bit when the collision reaches it, it would believe it succeeded and would never retransmit that frame (no lower layer would discover it).
Worst case. Station A starts transmitting at . Another station B, at the other end of the medium, starts just before A's signal reaches it, i.e. at . The collision occurs near B, but its effect travels back to A in another : A notices at . B is sure to have captured the channel only after .
Formula (minimum frame duration in CSMA/CD). To be sure a transmission succeeded,
The second relation follows by substituting (frame length in bits over bitrate) and multiplying both sides by . The meaning: the frame must contain at least as many bits as fit on the medium in the round-trip time, (the bandwidth-delay product of Network Performance AnalysisNetwork performance is measured by traffic metrics (bitrate R0, the link maximum; throughput S <= R0, data delivered successfully; goodput at the application layer), delay (end-to-end d = d_proc + d_queue + d_trans + d_prop with d_trans = L/R and d_prop = d/v; jitter; RTT), pipe capacity (BDP = rate times delay) and reliability (PER, PDR, PLR). The throughput of a path is that of its bottleneck link, the minimum bitrate, remembering that shared links split their capacity.Network Performance Analysis →).
Grafico interattivo: Space-time diagram of the CSMA/CD worst case (position on the x axis from A at 0 to B at 1; time on the y axis in units of tau_p): A starts at t = 0, B starts at t = tau_p, just before sensing A; the collision reaches A at t = 2 tau_p, so A must still be transmitting
Example (reference values). Mbit/s and s (the maximum delay, including repeaters): s, so bit B. This is exactly the minimum Ethernet frame length (LAN - Ethernet and Wi-FiA LAN covers a limited area and is defined by the IEEE 802.x family (802.3 Ethernet, 802.11 Wi-Fi), which splits the link layer into LLC and MAC. Ethernet is connectionless, with no flow control and no ACK; it uses 1-persistent CSMA/CD; the frame is 64 to 1518 bytes (6-byte addresses, type/length, data 46-1500, 4-byte CRC) and the 64 B minimum comes from t_F >= 2 tau_p. From 10 Mbit/s on coax up to 10 Gbit/s on fibre, with full-duplex switches removing collisions. Wi-Fi (802.11) uses CSMA/CA, has BSS (with access point) and ad hoc modes, EBSS with a distribution system, adapts its bitrate to the SNR, and has hidden and exposed terminal problems, partly solved by RTS/CTS and NAV.LAN - Ethernet and Wi-Fi →).
Performance and network size. Compare ():
- Mbit/s, kbit, m of cable: ms, s, so : propagation is negligible, collisions are very rare.
- Same network at Gbit/s: s and : now propagation and transmission are equal, CSMA/CD is much less efficient (and the constraint would not be met).
- If the shared medium is "compressed" into a box (hub or switch, a few cm), becomes tiny and a mini-LAN results where the problem disappears.
CSMA/CA (Wi-Fi)
Definition (CSMA/CA). Carrier Sense Multiple Access with Collision Avoidance: invented for wireless networks, where a collision cannot be detected during transmission (one's own transmission overwhelms what is received). Collisions are not detected, they are avoided.
There are four ingredients: IFS, contention window (CW), ACK, and optionally RTS/CTS.
Interframe space (IFS). When the channel is idle the station does not transmit immediately: it waits a time called IFS. The data frame starts after the channel has been sensed idle for seconds (a protocol constant; in the standard slots). IFSs also give priority: a shorter IFS goes first. They are , with s fixed in 802.11 (the minimum separation: round-trip propagation plus local MAC processing).
Two-way handshake. The data frame starts only after of idle channel; the receiver answers with an explicit ACK after a time . Since , the ACK has priority over any new frame. The link layer uses stop-and-wait retransmission: if the frame fails it is retransmitted until success or the maximum number of attempts.
Contention window and backoff. If the channel is busy (or after a failure) a random time is waited, with this mechanism:
- the contention window is defined, expressed in transmission slots (constant duration );
- when the channel is found busy, an integer backoff counter is drawn uniformly in (each of the values has probability ); the backoff time is ;
- start from and doubles at every failure of the frame (), up to (in 802.11 s; the standard values are , powers of two minus one);
- the channel is sensed at the end of each slot: while idle the counter decreases by one; when busy the countdown freezes and resumes when the channel is idle again;
- transmission is allowed when the counter reaches .
Grafico interattivo: Contention window CW after n consecutive failures (802.11 standard): 15, 31, 63, ..., 1023 and then stays at the maximum
Example. At the first attempt and s: if is drawn the station waits s of idle channel. If the channel becomes busy after idle slots, the counter stays frozen at until the other transmission ends, then resumes and at the station transmits. The station with the lowest counter wins the contention: this is why stations that waited longer (frozen counter) tend to go first next time.
Why the window doubles. Two stations in contention draw the same value, and therefore collide, with probability (independent draws): about with . After a failure and the probability drops to about : the more stations contend, the wider the window must be, and doubling widens it only when a collision happened. The mean wait of one draw is slots: with , slots s.
Even with all these precautions a collision can still destroy data (two stations draw the same ), and data may also be corrupted during transmission. The positive ACK and the timeout assure the sender that the receiver got the frame.
RTS/CTS and NAV (optional). To reduce collisions due to stations that do not hear each other (hidden terminal, see LAN - Ethernet and Wi-FiA LAN covers a limited area and is defined by the IEEE 802.x family (802.3 Ethernet, 802.11 Wi-Fi), which splits the link layer into LLC and MAC. Ethernet is connectionless, with no flow control and no ACK; it uses 1-persistent CSMA/CD; the frame is 64 to 1518 bytes (6-byte addresses, type/length, data 46-1500, 4-byte CRC) and the 64 B minimum comes from t_F >= 2 tau_p. From 10 Mbit/s on coax up to 10 Gbit/s on fibre, with full-duplex switches removing collisions. Wi-Fi (802.11) uses CSMA/CA, has BSS (with access point) and ad hoc modes, EBSS with a distribution system, adapts its bitrate to the SNR, and has hidden and exposed terminal problems, partly solved by RTS/CTS and NAV.LAN - Ethernet and Wi-Fi →):
- the station that won the channel sends a control frame RTS (Request To Send) to the destination;
- after a interval only the destination answers with a CTS (Clear To Send), heard by everybody: "I am ready to receive";
- after another the source sends the data; after the ACK arrives;
- all other stations hearing RTS or CTS set a timer, the NAV (Network Allocation Vector), indicating how long must pass before they may listen to the channel again; before sensing the channel every station checks whether its NAV has expired.
The NAV is a "virtual" listening of the channel: even a station that does not hear the data transmission knows the channel is busy.
Summary of random access protocols
| Protocol | Rule | Vulnerable period |
|---|---|---|
| ALOHA | no rule: transmit as soon as there is a frame, regardless of network state | |
| Slotted ALOHA | start transmitting only at the beginning of a slot | |
| CSMA | before transmitting, listen to the channel and check nobody else is transmitting | |
| CSMA/CD | like CSMA, and keep listening during transmission, aborting on collision | (with ) |
| CSMA/CA | IFS + CW + ACK + RTS/CTS + NAV | (collisions avoided, not detected) |
Controlled access
Here stations do not compete: a mechanism decides who may transmit, and there are no collisions.
Reservation. Time is divided into intervals; in each interval a reservation frame precedes the data frames. With stations there are exactly minislots, one per station. A station with data reserves in its minislot; those that reserved send data after the reservation frame.
Polling (used, e.g., in Bluetooth). One station is primary and the others secondary (star topology, Network Types and TopologiesNetworks are classified by extent (BAN, WLAN, LAN, MAN, WAN, WSN), by transmission medium (air, fibre, copper, visible light) and by topology: bus (shared medium, collisions), star (central node, bottleneck), ring (each node forwards to the next), mesh (a direct link between every pair: n(n-1)/2 links). The choice depends on reliability, scalability, protocol and physical medium.Network Types and Topologies →): all exchanges go through the primary device, which controls the link and decides who uses the channel and when; the primary always starts and uses the poll and select functions to avoid collisions. Drawback: if the primary fails, the system fails.
- Select (the primary has something to send): the primary warns the secondary of the incoming transmission with a SEL frame containing the secondary's address, and waits for an ACK confirming it is ready; then it sends the data and the secondary answers with an ACK.
- Poll (the primary wants to receive): it asks each device whether it has something to send; the polled secondary answers with a NAK (nothing to say) or with data; with data the primary reads the frame and returns an ACK. The walk time is the time to pass control from one station to the next in the polling cycle.
Token passing. Stations are organized in a logical ring, each with a predecessor and a successor. A special packet, the token, circulates on the ring: holding the token gives the right to access the channel. A station with data waits for the token from its predecessor, keeps it and sends data, and at the end releases it, passing it to the successor; a station without data passes the token immediately. Token management requires limiting the holding time (otherwise a station monopolizes the network) and checking that the token is not lost or destroyed.
Channelization
The channel is split among stations in a fixed way, by frequency, time, code or space.
| Method | How it splits the channel |
|---|---|
| FDMA (Frequency Division) | the available band is divided into frequency bands; each band is reserved for one station for all the time; bandpass filters confine frequencies; suited to continuous flows (cellular telephony) |
| TDMA (Time Division) | stations share the channel band in time: each is assigned a slot; the problem is synchronization (each station must know the start and position of its slot, hard over large distances because of propagation delays) |
| OFDMA (Orthogonal FDMA) | the band is distributed to different users at the same instant; subcarriers assigned to contiguous groups; used together with TDMA, resources are split in the time-frequency plane (in 4G/5G each block is a Resource Block) |
| CDMA (Code Division) | each station uses the whole band and all transmit simultaneously, told apart by special codes (like two people talking privately in a crowded room using a language others do not understand) |
| SDMA (Space Division) | whole band for the whole time, but users are multiplexed in space with directional beams (antenna arrays): different areas reuse the same frequency |
Versione ripasso
- The problem. On a shared (usually broadcast) medium the MAC decides when a station transmits. The DLC (framing, errors, flow) also applies to point-to-point links (Data Link Layer and FramingThe data link layer (DLL) delivers a frame from a node to an adjacent node over a link. Services: framing, medium access (MAC) with 48-bit MAC addresses, flow control, error detection and correction. It splits into DLC (framing, error and flow control) and MAC (shared medium access). Framing delimits frames with a flag: byte-oriented protocols (8-bit flag, ESC) use byte stuffing, bit-oriented ones (flag 01111110) use bit stuffing, which inserts a 0 after every five consecutive 1s.Data Link Layer and Framing →). The MAC frame holds DA (6 bytes), SA (6 bytes), control, information (LLC) and FCS (4 bytes).
- Three families. Random access: ALOHA, slotted ALOHA, CSMA, CSMA/CD, CSMA/CA. Controlled access: reservation, polling, token passing. Channelization: FDMA, TDMA, OFDMA, CDMA, SDMA. Performance: Performance of Multiple Access ProtocolsWith Poisson arrivals, the success probability of a frame is the probability that no other frame arrives in the vulnerable time: pure ALOHA P_S = e^(-2G), throughput S = G e^(-2G) with maximum 1/(2e) = 0.18 at G = 1/2; slotted ALOHA S = G e^(-G) with maximum 1/e = 0.37 at G = 1; non-persistent CSMA with a = tau_p/t_F: S = G e^(-aG) / (G(1+2a) + e^(-aG)), which tends to 1 as a tends to 0 but collapses for large a, where slotted ALOHA is better. For TDMA (M/D/1) E[T] = t_F (N_u/2 + S N_u / (2(1-S)) + 1 + a) and for FDMA E[T] = t_F (N_u + S N_u / (2(1-S)) + a): FDMA is slower by t_F (N_u/2 - 1).Performance of Multiple Access Protocols →.
- Random access. No station is superior and there is no predetermined instant: if two transmit together there is a collision. Every protocol answers four questions: when to access, what to do if busy, how to decide success, what to do on conflict.
Pure ALOHA
- Algorithm. Transmit as soon as there is a frame, without looking at the channel. Outcome via ACK and timeout. If the ACK is missing, random backoff and retransmit. Backoff is random because stations waiting the same time would collide again.
- Collision. A single bit of overlap destroys both frames.
- Vulnerable time : no other frame may start from before to after the start.
- Example. -bit frame at Mbit/s, ms, start at ms: collides with any frame starting between 9 and 11 ms.
Slotted ALOHA
- Time divided into slots of duration ; start only at a slot boundary (mean wait ). Two frames overlap completely or not at all.
- Vulnerable time : it halves. The price is synchronization.
- Maximum throughput. About for pure ALOHA and for slotted, twice as much (Performance of Multiple Access ProtocolsWith Poisson arrivals, the success probability of a frame is the probability that no other frame arrives in the vulnerable time: pure ALOHA P_S = e^(-2G), throughput S = G e^(-2G) with maximum 1/(2e) = 0.18 at G = 1/2; slotted ALOHA S = G e^(-G) with maximum 1/e = 0.37 at G = 1; non-persistent CSMA with a = tau_p/t_F: S = G e^(-aG) / (G(1+2a) + e^(-aG)), which tends to 1 as a tends to 0 but collapses for large a, where slotted ALOHA is better. For TDMA (M/D/1) E[T] = t_F (N_u/2 + S N_u / (2(1-S)) + 1 + a) and for FDMA E[T] = t_F (N_u + S N_u / (2(1-S)) + a): FDMA is slower by t_F (N_u/2 - 1).Performance of Multiple Access Protocols →).
CSMA (listen before talk)
- Listen to the medium and transmit only if idle. Collisions do not vanish: the propagation delay remains, because another station's first bit may not have arrived yet.
- Vulnerable time : after all stations have heard the frame and refrain.
- Example. km bus, m/s: s. -bit frame at Mbit/s: s, so . Vulnerable s against s for pure ALOHA.
| variant | algorithm | effect |
|---|---|---|
| 1-persistent | listens continuously; when idle transmits at once (probability 1) | many collisions: several waiting stations start together |
| non-persistent | listens once; if busy waits a random backoff and listens again | fewer collisions, but the channel stays idle while frames wait |
| p-persistent | slots of duration ; when idle transmits with probability , otherwise waits for the next slot and listens again; if busy, backoff | fewer collisions and better efficiency |
CSMA/CD (Ethernet)
- Idea. Like CSMA, but during transmission the energy level on the channel is monitored. If consistent with one's frame all is well; if higher there is a collision: transmission is aborted and a jam signal is sent to warn the other stations. Then random backoff and retry.
- Why a minimum frame. Worst case: A starts at ; B, at the other end, starts just before A's signal reaches it, at . The collision comes back to A at . If A had already finished it would believe it succeeded and never retransmit the frame.
- Formula. , i.e. .
- Example. Mbit/s, s: s, so bit B, the minimum Ethernet frame length (LAN - Ethernet and Wi-FiA LAN covers a limited area and is defined by the IEEE 802.x family (802.3 Ethernet, 802.11 Wi-Fi), which splits the link layer into LLC and MAC. Ethernet is connectionless, with no flow control and no ACK; it uses 1-persistent CSMA/CD; the frame is 64 to 1518 bytes (6-byte addresses, type/length, data 46-1500, 4-byte CRC) and the 64 B minimum comes from t_F >= 2 tau_p. From 10 Mbit/s on coax up to 10 Gbit/s on fibre, with full-duplex switches removing collisions. Wi-Fi (802.11) uses CSMA/CA, has BSS (with access point) and ad hoc modes, EBSS with a distribution system, adapts its bitrate to the SNR, and has hidden and exposed terminal problems, partly solved by RTS/CTS and NAV.LAN - Ethernet and Wi-Fi →).
- Depends on . With Mbit/s, kbit, 200 m: ms, s, , collisions are rare. At 10 Gbit/s, and CSMA/CD does not hold.
CSMA/CA (Wi-Fi)
- Idea. On wireless networks a collision cannot be detected during transmission (one's own transmission covers what is received): it is avoided.
- IFS (Interframe Space). The channel must be idle for before transmitting; in the standard slots, with s and . A shorter IFS gives priority.
- Two-way handshake. Data are acknowledged with an explicit ACK after . Since , the ACK goes before any new frame. If the frame fails it is retransmitted (stop-and-wait) until success or the maximum number of attempts.
- Backoff. A counter is drawn uniform in , time with s. , doubling at each failure up to (values ). At each idle slot the counter decreases by one; on a busy channel it freezes; at transmit.
- Example. and s: wait of s of idle channel. The lowest counter wins; stations that waited longer, with frozen counters, tend to go first next time.
- RTS/CTS and NAV (optional). Against the hidden terminal (LAN - Ethernet and Wi-FiA LAN covers a limited area and is defined by the IEEE 802.x family (802.3 Ethernet, 802.11 Wi-Fi), which splits the link layer into LLC and MAC. Ethernet is connectionless, with no flow control and no ACK; it uses 1-persistent CSMA/CD; the frame is 64 to 1518 bytes (6-byte addresses, type/length, data 46-1500, 4-byte CRC) and the 64 B minimum comes from t_F >= 2 tau_p. From 10 Mbit/s on coax up to 10 Gbit/s on fibre, with full-duplex switches removing collisions. Wi-Fi (802.11) uses CSMA/CA, has BSS (with access point) and ad hoc modes, EBSS with a distribution system, adapts its bitrate to the SNR, and has hidden and exposed terminal problems, partly solved by RTS/CTS and NAV.LAN - Ethernet and Wi-Fi →): 1) the source sends RTS to the destination; 2) after only the destination answers with CTS, heard by all; 3) after data go and after the ACK; 4) other stations hearing RTS or CTS set the NAV (Network Allocation Vector), a timer saying how long to wait, even if they do not hear the data. It is virtual listening of the channel.
Summary of random access
| protocol | rule | vulnerable period |
|---|---|---|
| ALOHA | no rule | |
| Slotted ALOHA | start only at a slot boundary | |
| CSMA | listen before transmitting | |
| CSMA/CD | like CSMA, listening during transmission | (with ) |
| CSMA/CA | IFS, CW, ACK, RTS/CTS, NAV | (collisions avoided, not detected) |
Controlled access
- Reservation. Time divided into intervals, each with a reservation frame and minislots, one per station. Whoever has data reserves in its minislot, then transmits. No collisions.
- Polling (Bluetooth). One primary station and the secondaries, in a star topology (Network Types and TopologiesNetworks are classified by extent (BAN, WLAN, LAN, MAN, WAN, WSN), by transmission medium (air, fibre, copper, visible light) and by topology: bus (shared medium, collisions), star (central node, bottleneck), ring (each node forwards to the next), mesh (a direct link between every pair: n(n-1)/2 links). The choice depends on reliability, scalability, protocol and physical medium.Network Types and Topologies →). The primary does select (warns with SEL, waits for ACK, then sends data) and poll (asks each one: NAK if nothing, data otherwise). The walk time is the time to pass from one station to the next. If the primary fails, the whole network fails.
- Token passing. Stations on a logical ring; the token gives the right to transmit. Whoever has data keeps it, transmits and passes it to the successor; whoever has none passes it immediately. The holding time must be limited and token loss monitored.
Channelization
- FDMA: frequency bands reserved for all the time (analog cellular). TDMA: one time slot per station; synchronization is hard over large distances. OFDMA: subcarriers assigned to groups of users at the same instant, combined with TDMA (4G/5G, Resource Block). CDMA: whole band, different codes for each station. SDMA: directional antenna beams, same frequency in different areas.
- Typical mistakes: believing CSMA eliminates collisions ( remains); forgetting that CSMA/CD requires ; confusing RTS/CTS (reserves the channel) with the ACK (confirms the frame); using the same backoff for all stations.