Medium Access Control (MAC) Protocols for Ad hoc Wireless Networks - II CS: 647 Advanced Topics in Wireless Networks Drs. Baruch Awerbuch & Amitabh Mishra Department of Computer Science Johns Hopkins University 2-1
Outline Wireless MAC Issues Hidden terminal problem Exposed terminal problem Capture MAC Performance Metrics Wireless MAC Classification Distributed Wireless MAC Protocols Aloha Slotted Aloha CSMA CSMA/CA 802.11 MAC DCF Backoff Hiper Lan MAC 2-2
Contention-based Protocols ALOHA Developed in the 1970s for a packet radio network by Hawaii University. Whenever a terminal (MS) has data, it transmits. Sender finds out whether transmission was successful or experienced a collision by listening to the broadcast from the destination station. Sender retransmits after some random time if there is a collision. Slotted ALOHA Improvement: Time is slotted and a packet can only be transmitted at the beginning of one slot. Thus, it can reduce the collision duration. 2-3
Contention Protocols (Cont d) CSMA (Carrier Sense Multiple Access) Improvement: Start transmission only if no transmission is ongoing CSMA/CD (CSMA with Collision Detection) Improvement: Stop ongoing transmission if a collision is detected CSMA/CA (CSMA with Collision Avoidance) Improvement: Wait a random time and try again when carrier is quiet. If still quiet, then transmit CSMA/CA with ACK CSMA/CA with RTS/CTS 2-4
Pure ALOHA Collision mechanism in ALOHA Node 1 Packet Node 2 Packet Waiting a random time Retransmission Retransmission 1 2 3 3 2 Collision Time Node 3 Packet when frame first arrives - transmit immediately collision probability increases: frame sent at t 0 collides with other frames sent in [t 0-1,t 0 +1] 2-5
Pure (unslotted) ALOHA collision probability increases: frame sent at t 0 collides with other frames sent in [t 0-1,t 0 +1] 2-6
Throughput of Pure ALOHA The probability of successful transmission P s is the probability no other packet is scheduled in an interval of length 2T. P = P( no_ collision) s = e 2gT, where g is the packet rate of the traffic. The throughput S th of pure Aloha as: S = gte 2gT Defining G = gt to normalize offered load, we have S th = Ge 2G Differentiating S th with respect to G and equating to zero gives The Maximum throughput of ALOHA is S ds dg max th = Ge + e = or G = 2 G 2 G 2 0 1 / 2 1 = 0.184 2 e 2-7
Slotted ALOHA Assumptions all frames same size time is divided into equal size slots, time to transmit 1 frame nodes start to transmit frames only at beginning of slots nodes are synchronized if 2 or more nodes transmit in slot, all nodes detect collision Operation when node obtains fresh frame, it transmits in next slot no collision, node can send new frame in next slot if collision, node retransmits frame in each subsequent slot with prob. p until success 2-8
Slotted ALOHA Pros single active node can continuously transmit at full rate of channel highly decentralized: only slots in nodes need to be in sync simple Cons collisions, wasting slots idle slots nodes may be able to detect collision in less than time to transmit packet clock synchronization 2-9
Throughput of Slotted ALOHA The probability of successful transmission P s is the probability no other packet is scheduled in an interval of length T. P = e s gt S th = gte where g is the packet rate of the traffic. The throughput S th of pure Aloha as: gt Defining G= gt to normalize offered load, we have S th = Ge The Maximum throughput of ALOHA is 1 Smax = 0.368 e G Differentiating S th with respect to G and equating to zero gives th G G ds dg = Ge + e = 0 2-10
Throughput 0.5 0.4 0.368 S: Throughput 0.3 0.2 0.1 0.184 Aloha Slotted Aloha 0 0 2 4 6 8 G 2-11
CSMA (Carrier Sense Multiple Access) Max throughput achievable by slotted ALOHA is 0.368. CSMA gives improved throughput compared to Aloha protocols. Listens to the channel before transmitting a packet (avoid avoidable collisions). 2-12
CSMA collisions spatial layout of nodes collisions can still occur: propagation delay means two nodes may not hear each other s transmission collision: entire packet transmission time wasted note: role of distance & propagation delay in determining collision probability 2-13
Kinds of CSMA CSMA Nonpersistent CSMA Persistent CSMA Unslotted Nonpersistent CSMA Slotted Nonpersistent CSMA Unslotted persistent CSMA Slotted persistent CSMA 1-persistent CSMA p-persistent CSMA 2-14
Nonpersistent CSMA Protocols Nonpersistent CSMA Protocol: Step 1: If the medium is idle, transmit immediately Step 2: If the medium is busy, wait a random amount of time and repeat Step 1 Random backoff reduces probability of collisions Waste idle time if the backoff time is too long For unslotted nonpersistent CSMA, the throughput is given by: 2α T Ge Sth = αg G(1 + 2α ) + e Here τ is the propagation delay, and T is the packet transmission time. S is the throughput and G is offered load. Also, τ α = T 2-15
Nonpersistent CSMA Protocols For slotted nonpersistent CSMA, the throughput is given by: S th (1 α Ge e = α G 2α T + α ) 2-16
1-persistent CSMA Protocols 1-persistent CSMA Protocol: Step 1: If the medium is idle, transmit immediately S th Step 2: If the medium is busy, continue to listen until medium becomes idle, and then transmit immediately There will always be a collision if two nodes want to retransmit (usually you stop transmission attempts after few tries) For unslotted 1-persistent CSMA, the throughput is given by: G G (1 + [ 1 + G + α G (1 + G + α G / 2) ] e (1 + α G ) e G (1+ 2α ) = α G G (1+ α ) 2α ) (1 e ) + For slotted 1-persistent CSMA, the throughput is given by: αg G (1+ α ) G(1 + α e ) e Sth = αg G (1+ α ) (1 + α )(1 e ) + αe 2-17
p-persistent CSMA Protocols p-persistent CSMA Protocol: Step 1: If the medium is idle, transmit with probability p, and delay for worst case propagation delay for one packet with probability (1-p) Step 2: If the medium is busy, continue to listen until medium becomes idle, then go to Step 1 Step 3: If transmission is delayed by one time slot, continue with Step 1 A good tradeoff between nonpersistent and 1- persistent CSMA 2-18
How to Select Probability p? Assume that N nodes have a packet to send and the medium is busy Then, Np is the expected number of nodes that will attempt to transmit once the medium becomes idle If Np > 1, then a collision is expected to occur Therefore, network must make sure that Np 1 to avoid collision, where N is the maximum number of nodes that can be active at a time 2-19
Throughput 1.0 0.01-persistent CSMA 0.9 Nonpersistent CSMA 0.8 S: Throughput 0.7 0.6 0.5 0.4 0.3 0.2 0.1 Aloha 0.1-persistent CSMA 0.5-persistent CSMA Slotted Aloha 1-persistent CSMA 0 0 1 2 3 4 5 6 7 8 9 Traffic Load G 2-20