Lecture 12 December 04, 2017 Wireless Access Graduate course in Communications Engineering University of Rome La Sapienza Rome, Italy 2017-2018
Random Medium Access Control Part II - CSMA and Collision Avoidance
Carrier Sensing Multiple Access Random Access protocols The Carrier Sensing Multiple Access (CSMA) protocol CSMA Issues Collision Avoidance (CA) Out-of-band (BTMA) In-band (MACA) CSMA with Collision Avoidance (CSMA-CA)
Carrier Sensing Multiple Access In networks with high traffic load ALOHA is not effective due to collisions Performance can be improved by introducing Carrier Sensing, leading to Carrier Sensing Multiple Access (CSMA) When a terminal A has packets to transmit, it senses the channel before starting transmission If another terminal B is already transmitting, terminal A detects its transmission In this case A postpones its own transmission When A senses the channel as idle for a predefined amount of time, it assumes the channel as available and starts transmission.
CSMA and propagation delay Let us consider two terminals and let us assume that a packet is generated at Terminal 1 at t = t 1 and another packet is generated at Terminal 2 at t = t 2 > t 1 Terminal 1 d Propagation time: a = d/c Terminal 2 Terminal 2 should delay its transmission if t 2 - t 1 < T, in order to avoid collision Although Terminal 2 senses the channel for a time w before transmitting, collision can still occur because of the propagation time a, depending on the distance d between the two terminals As will be shown in the next slides, the collision depends on t 1, t 2 and a
CSMA: Example of correct decision Terminal 1 transmits the packet in t = t 1 + w The packet emitted by Terminal 1 propagates to Terminal 2 during its channel sensing phase Terminal 2 detects the packet transmitted by terminal 1 and defers transmission Collision is correctly avoided Condition for correct decision
CSMA: Example of wrong decision Terminal 1 transmits the packet in t = t 1 + w Terminal 2 starts carrier sensing in t = t 2 Terminal 2 does not detect the packet transmitted by Terminal 1 and starts transmission in t = t 2 + w The packet emitted by Terminal 1 propagates to Terminal 2 after its channel sensing phase is concluded and collision occurs Condition for wrong decision
CSMA: the role of the channel sensing period w For a given propagation time a the duration of the channel sensing time w has no impact on the collision probability: Short w Long w
Throughput of CSMA We take the same assumptions introduced for calculating the ALOHA throughput: Poisson arrivals Collision or perfect reception Immediate feedback Infinite set of nodes Poisson retransmission Furthermore, we have an additional hypothesis: Random (Poisson) rescheduling: a packet transmission that is deferred due to busy channel is not scheduled immediately after the end of the busy channel period, but after a random time chosen following a Poisson process (this approach is defined nonpersistent CSMA) Under the above hypotheses, it can be shown* that the throughput is given by the relation: S= Ge -ag G(1+2a)+e -ag S= Ge -2G Note that since the propagation delay is different for every pair of terminals, throughput is evaluated with parameter a being set to the largest possible delay in the network (normalized by packet duration), leading to a lower bound for system performance * Kleinrock, L. and F.A. Tobagi, Packet Switching in Radio Channels: Part I Carrier Sense Multiple-Access Modes and Their Throughput-Delay Characteristics, IEEE Transactions on Communications., Volume: 23, Issue: 12 December 1975), 1400 1416.
Throughput of CSMA 1 Throughput S 0.8 0.6 0.4 G=0.5, S=1/2e G=1, S=1/e a=0.25 a=0 ALOHA Slotted ALOHA CSMA Ideal MAC a=0.50 0.2 a=1 a=0.75 0 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 Offered Traffic G
CSMA Issues Performance of CSMA heavily depends on network scenario Wireless networks are in fact characterized by: 1. Varying network topology 2. Partial connectivity This can lead to errors in protocols that work perfectly fine in wired networks In the case of CSMA, the wireless medium has two effects that significantly reduce performance: The Hidden terminal The Exposed terminal
CSMA Issues Hidden terminal H S D Node S is sending a packet to D that is acting only as receiver Node H, willing to transmit, starts the Carrier Sensing procedure, sensing the channel for the time period w defined in the protocol After a time w, H that cannot detect transmission by node S (due to limited radio coverage), assumes the medium is available
CSMA Issues Hidden terminal D2 H S D H starts transmitting, causing a collision in D, and potentially a loss of both packets N.B.: Since the wireless medium is inherently broadcast, this issue arises even if H is not willing to transmit to D, but to another terminal D2 within its range!
CSMA Issues Exposed terminal D1 S1 S2 D2 at t = 0 S1 starts packet transmission to D1 at t = t 0, S2 wants to transmit a packet to D2 S2 starts the Carrier Sensing procedure S2 detects a transmission that is already active, and assumes the channel is busy, postponing thus transmission to D2 Since D2 is not reached by S1, however, transmission S2 -> D2 could have been activated without causing collisions
Collision Avoidance Collision Avoidance (CA) mechanisms have been proposed in order to solve the hidden terminal problem. CA-based protocols can be divided in: Out-of-Band CA protocols: Collision Avoidance is performed on a dedicated channel, physically separated (usually in frequency) from the data channel Example: Busy Tone Multiple Access (BTMA) In-band CA protocols: Collision Avoidance is performed on the same channel used for data traffic Example: Medium Access with Collision Avoidance (MACA)
Out-of-Band CA: Busy Tone Multiple Access (BTMA) In BTMA the available bandwidth is split into two channels: A message channel (used for DATA) A busy-tone channel (used for Collision Avoidance) The BTMA was originally designed for a centralized network architecture, with a Base Station and a set of access terminals Base Station Terminal The Base Station uses the busy-tone channel to avoid collisions between access terminals
BTMA in the centralized architecture Base Station Transmission on the busy-tone channel Transmission on the message channel Terminal When a terminal has a packet to transmit to the Base Station, it senses the busy-tone channel for a time t d If the busy-tone channel is idle, the terminal sends the packet on the message channel As soon as the Base Station detects that the message channel is busy, it emits a sinusoidal tone on the busy tone channel All access terminals will be inhibited from transmitting until the busy-tone channel will be released by the Base Station
BTMA in a distributed architecture In a centralized architecture BTMA is an effective way of avoiding collisions between DATA transmissions The adoption of BTMA in a distributed network architecture is attractive because it can address the hidden terminal problem In a distributed architecture, BTMA can be used as follows: When a terminal S has a packet to transmit to the Base Station, it senses the busy-tone channel for a time t d If the busy-tone channel is idle, the terminal turns on the busy-tone signal and starts transmitting the packet on the message channel Any other terminal that detects the message channel as busy turns on the busytone signal In this way it is assured that when a terminal S is transmitting, all nodes within a two-hop range of S are inhibited from transmission This approach significantly reduces the probability of having hidden terminals in the network On the other hand, BTMA has a strong disadvantage: the amplification of the exposed terminal
BTMA and exposed terminals Example of the amplification of the exposed terminal problem
In-band CA: Medium Access with Collision Avoidance (MACA) MACA does not use Carrier Sensing, in the sense that terminals start transmitting a packet without spending any time sensing the channel In MACA when a terminal has a data packet to send, it does not transmit directly the data packet, but instead starts a Collision Avoidance procedure with the intended destination, based on three steps: 1. Transmission of a Request-To-Send (RTS) packet from source to destination 2. Transmission of a Clear-To-Send (CTS) packet from destination to source, in response to the CTS 3. Transmission of the DATA packet from source to destination, after reception of the CTS The procedure is called handshaking
MACA: Request-To-Send The RTS is emitted by source S, and is received by destination D and by all other terminals within transmission range of S (terminal A1 in figure) The RTS includes: The ID of the source S The ID of the destination D The expected duration of the DATA packet to be transmitted The RTS has two goals: A1 S D A2 a. communicating to all terminals within range of S that a transmission is going to start b. trigger the destination D to emit a CTS message in reply to the RTS After the reception of the RTS, A1 will expect to hear the CTS transmitted by D in reply to the RTS If A1 does not hear the CTS within a given time, it can start transmitting in any moment, since it is out of transmission range of D
MACA: Clear-To-Send The CTS is emitted by the destination D, and is received by the source S and by all other terminals within transmission range of D (terminal A2 in figure) S D A2 The CTS includes: A1 The IDs of S and D The expected duration of the DATA packet to be transmitted The CTS has two goals: a. communicating to all terminals within range of D that a reception is going to start b. trigger the source S to emit the DATA packet Terminal A2 will hear the CTS and will know that a transmission is going to start, even if it did not hear the CTS transmitted by S If A2 has packets to send, it will thus postpone the transmission until the transmission S->D is over Since CS is not used, A2 understands how long it will have to wait by reading the content of the CTS
MACA: Advantages The adoption of the RTS/CTS exchange relieves both the hidden and exposed terminal problems Let us compare CSMA and MACA in the following topology: A1 S D A2 If CSMA is adopted: A1 is an exposed terminal, since it senses the medium busy due to S A2 is a hidden terminal, since it is not aware of the transmission from S to D and can cause a collision
MACA: Advantages The adoption of the RTS/CTS exchange relieves both the hidden and exposed terminal problems Let us compare CSMA and MACA in the following topology: A1 S D A2 If MACA is adopted: When the handshake between S and D is performed: A1 hears the RTS but not the CTS: it concludes that D is out of range, and is thus free to start a transmission -> no more an exposed terminal A2 misses the RTS, but hears the CTS: it concludes that D is receiving from a terminal S out of range, and defers transmission -> no more a hidden terminal
MACA: Collisions The adoption of the RTS/CTS exchange relieves both the hidden and exposed terminal problems Note that collision is still possible between RTS packets: RTS RTS A1 S D A2 The effect of RTS collisions is however lower than in the case of DATA collisions for two reasons: 1. No DATA information is lost 2. RTS packets are usually very short (20 Bytes) and thus a collision keeps the channel busy for a short time
CSMA with Collision Avoidance (CSMA-CA) Although MACA was proposed as an alternative to CSMA protocols, CSMA and In-band Collision Avoidance can be combined in order to get the advantages provided by MACA and reduce the probability of having collisions on the RTS packets (CSMA-CA) The CSMA-CA approach is adopted in the Distributed Foundation Wireless MAC (DFWMAC) adopted in the IEEE 802.11 standard (WiFi) In DFWMAC the handshaking is formed of four steps. The four steps are: 1. RTS (Direction: S -> D) 2. CTS (D -> S) 3. Data (S -> D) 4. Acknowledge (Ack) (D -> S) CSMA is adopted before transmitting the RTS packet