570 likes | 593 Views
Solve a puzzle involving wireless MAC protocols and door toggling. Press switches of doors that are multiples of i to close or open them. Find out which doors are closed at the end of the process.
E N D
Puzzle • Doors numbered 1-100 • All doors initially open • Toggle switch outside every door • If switch is pressed, door will close if it is currently open, and open if it is currently closed • For i=1 to 100, you press switches of doors that are multiples of i • Which doors are closed at the end of the process?
Wireless MAC • CSMA as wireless MAC? • Hidden and exposed terminal problems make the use of CSMA an inefficient technique • Several protocols proposed in related literature – MACA, MACAW, FAMA • IEEE 802.11 standard for wireless MAC
Hidden Terminal Problem Collision • A talks to B • C senses the channel • C does not hear A’s transmission (out of range) • C talks to B • Signals from A and B collide A B C
Exposed Terminal Problem • B talks to A • C wants to talk to D • C senses channel and finds it to be busy • C stays quiet (when it could have ideally transmitted) Not possible A B C D
Hidden and Exposed Terminal Problems • Hidden Terminal • More collisions • Wastage of resources • Exposed Terminal • Underutilization of channel • Lower effective throughput
IEEE 802.11 • The 802.11 standard provides MAC and PHY functionality for wireless connectivity of fixed, portable and moving stations moving at pedestrian and vehicular speeds within a local area. • Specific features of the 802.11 standard include the following: • Support of asynchronous and time-bounded delivery service • Continuity of service within extended areas via a Distribution System, such as Ethernet. • Accommodation of transmission rates of 1, 2, 5.5, 11 Mbps (b), 6, 9, 12, 18, 24, 36, 48, 54 Mbps (a, g), upto 195 Mbps (n) • Support of most market applications • Multicast (including broadcast) services • Network management services • Registration and authentication services
IEEE 802.11 Topology • Independent Basic Service Set (IBSS) Networks • Stand-alone BSS that has no backbone infrastructure and consists of at-least two wireless stations • Often referred to as an ad-hoc network • Applications include single room, sale floor, hospital wing
Infrastructure BSS • Use of an access point • Access points used for all communication including for communication between nodes in the same service area • Association with a specific access point required for the mobile node to be served
Extended Service Set (ESS) • Large coverage networks of arbitrary size and complexity • Consists of multiple cells interconnected by access points and a distribution system, such as Ethernet • Consist of multiple Infrastructure BSS’
IEEE 802.11 Logical Architecture • The logical architecture of the 802.11 standard that applies to each station consists of a single MAC and one of multiple PHYs • Frequency hopping PHY • Direct sequence PHY • Infrared light PHY • OFDM PHY • 802.11 MAC uses CSMA/CA (carrier sense multiple access with collision avoidance)
IEEE 802.11 MAC Layer • Primary operations • Accessing the wireless medium • Joining the network • Providing authentication and privacy • Wireless medium access • Distributed Coordination Function (DCF) mode • Point Coordination Function (PCF) mode
IEEE 802.11 MAC (contd.) • DCF • CSMA/CA – A contention based protocol • PCF • Contention-free access protocol usable on infrastructure network configurations containing a controller called a point coordinator within the access points • Both the DCF and PCF can operate concurrently within the same BSS to provide alternative contention and contention-free periods
CSMA with Collision Avoidance • Carrier Sense Multiple Access with Collision Avoidance (CSMA/CA) • Control packet transmissions precede data packet transmissions to facilitate collision avoidance • 4-way (RTS, CTS, Data, ACK) exchange for every data packet transmission
RTS CTS Data ACK B C A CSMA/CA (Contd.) C knows B is listening to A. Will not attempt to transmit to B. Hidden Terminal Problem Solved through RTS-CTS exchange!
CSMA/CA (Contd.) • Can there still be collisions? • Control packet collisions (C transmitting RTS at the same time as A) • C does not register B’s CTS • C moves into B’s range after B’s CTS
CSMA/CA Algorithm • Sense channel (CS) • If busy • Back-off to try again later • Else • Send RTS • If CTS not received • Back-off to try again later • Else • Send Data • If ACK not received • Back-off to try again later • Next packet processing
CSMA/CA Algorithm (Contd.) • Maintain a value CW (Contention-Window) • If Busy, • Wait till channel is idle. Then choose a random number between 0 and CW and start a back-off timer for proportional amount of time (Why?). • If transmissions within back-off amount of time, freeze back-off timer and start it once channel becomes idle again (Why?) • If Collisions (Control or Data) • Binary exponential increase (doubling) of CW (Why?)
Carrier Sensing and Network Allocation Vector • Both physical carrier sensing and virtual carrier sensing used in 802.11 • If either function indicates that the medium is busy, 802.11 treats the channel to be busy • Virtual carrier sensing is provided by the NAV (Network Allocation Vector)
NAV • Most 802.11 frames carry a duration field which is used to reserve the medium for a fixed time period • Tx sets the NAV to the time for which it expects to use the medium • Other stations start counting down from NAV to 0 • When NAV > 0, medium is busy
SIFS SIFS SIFS Illustration Sender RTS DATA Receiver CTS ACK NAV RTS CTS
Interframe Spacing • 802.11 uses 4 different interframe spacings • Interframe spacing plays a large role in coordinating access to the transmission medium • Varying interframe spacings create different priority levels for different types of traffic!
Types of IFS • SIFS • Short interframe space • Used for highest priority transmissions – RTS/CTS frames and ACKs • DIFS • DCF interframe space • Minimum idle time for contention-based services (> SIFS)
Types (contd.) • PIFS • PCF interframe space • Minimum idle time for contention-free service (>SIFS, <DIFS) • EIFS • Extended interframe space • Used when there is an error in transmission
Power Saving Mode (PS) • 802.11 stations can maximize battery life by shutting down the radio transceiver and sleeping periodically • During sleeping periods, access points buffer any data for sleeping stations • The data is announced by subsequent beacon frames • To retrieve buffered frames, newly awakened stations use PS-poll frames • Access point can choose to respond immediately with data or promise to delivery it later
IEEE 802.11 MAC Frame Format • Overall structure: • Frame control (2 octets) • Duration/ID (2 octets) • Address 1 (6 octets) • Address 2 (6 octets) • Address 3 (6 octets) • Sequence control (2 octets) • Address 4 (6 octets) • Frame body (0-2312 octets) • FCS (4 octets)
Wireless Fair Queuing • Wireless channel capacities are scarce • Fair sharing of bandwidth becomes critical • Both short-term and long-term fairness important
Wireless FQ & Wireless Environment • Location dependent and bursty errors • For the same wireless channel, a mobile station might experience a clean channel while another might experience high error rates. Why? • In wireline fair queuing, the channel is either usable by all flows or unusable by any of the flows …
Wireless Channel Model • Base station performs arbitration • Schedules both uplink and downlink traffic • Neighboring cells use different channels • Every mobile host has access to base-station
Wireless Channel Characteristics • Dynamically varying capacity • Location dependent channel errors and bursty errors • Contention • No global state • Scarce resources (battery & processing power)
Service Model • Short term fairness • Long term fairness • Short term throughput bounds • Long term throughput bounds • Delay bounds for packets
Some terminology … • Error free service • Leading flows • Lagging flows • In sync flows
Impact of Location Dependent Errors • Example 1 • 3 flows f1, f2, f3 • Period 1: f3 experiences lossy channel • Flows f1 and f2 receive ½ of channel • Period 2: f3 experiences clear channel • Wireline fair queuing would give a net service of 5/6 to f1 and f2, and 1/3 to f3 – UNFAIR! • Wireline fair queuing does not distinguish between flows that are not backlogged and flows that are backlogged but cannot transmit!
Impact (Contd.) • Example 2 • Same scenario • Flow f1 has only 1/3 offered service • Hence, for period 1 f2 receives 2/3 service • If some compensation is given to f3 during period 2, should f1 be penalized for compensating f3?
Issues addressed by Wireless Fair Scheduling • Is it acceptable to compromise on separation for f1? • How soon should f3 get its share back? • Should f2 give up service and over what period of time?
Generic Wireless FS Model • Error free service • Lead/lag/in-sync • Compensation model • Channel monitoring and prediction
Error Free Service • Reference for how much service a flow should receive in an ideal error free channel • Example: WFQ • Each packet stamped with a finish tag based upon the packet’s arrival time and the weight of the flow • Packet with the minimum finish tag transmitted
Lead and lag model • Lag • Lead • Two approaches • Lag of flow incremented as long as the flow is backlogged and is unable to transmit. Such a flow will be compensated at a later time. • Lag of flow incremented only if the slot given up by the flow is taken up by another flow (which will have its lead incremented). At a later time, compensation will be given at the expense of a flow with lead.
Compensation Model • No explicit compensation • Flow with maximum lag is given preference • Leading and lagging flows swap slots • Bandwidth is reserved for compensation
Instantiations • Channel state dependent packet scheduling (CSDPS) • Idealized wireless fair queuing (IWFQ) • Wireless packet scheduling (WPS) • Channel-condition independent fair queuing (CIFQ) • CBQ-CSDPS • Server based fairness approach (SBFA) • Wireless fair service (WFS)
CSDPS • CSDPS allows for the use of any error-free scheduling discipline – e.g. WRR with WFQ spread • When a flow is allocated a slot and is not able to use it, CSDPS skips that flow and serves the next flow • No measurement of lag or lead • No explicit compensation model
CSDPS (Contd.) • Lagging flows can thus make up lags only when leading flows cease to become backlogged or experience lossy channels sometime • No long-term or short-term fairness guarantees
IWFQ • WFQ is used for the error free service • Packets tagged as in WFQ. Of the flows observing a clean channel, the flow with the minimum service tag packet is served • Tags implicitly capture the service differences between flows (lagging flows will have a smaller service and hence will be scheduled earlier)
IWFQ (Contd.) • Channel capture by lagging flows possible resulting in short term unfairness and starvation • Even in-sync flows can become lagging during such capture periods • Coarse short-term fairness guarantees because of possible starvation • Provides long-term fairness
WPS • WRR with WFQ spread used for error free service • A frame of slot allocations generated by WPS based on WRR (with WFQ spread) • Intra frame swapping attempted when a flow is unable to use a slot • If intra-frame swapping is not possible lag incremented as long as another flow can use the slot
WPS (Contd.) • At the beginning of next frame, weights for calculating spread readjusted to accommodate lag and lead • If intra-frame swapping succeeds most of the time, in-sync flows not affected • Complete channel capture prevented as each flow has a non-zero weight when frame spread is calculated • No short-term fairness guarantees, but provides long-term fairness
CIFQ • STFQ (Start time fair queuing) used for the error free service • Lag or lead computed as the difference between the actual service and the error free service • A backlogged leading flow relinquishes slot with a probability p, a system parameter • A relinquished slot is allocated to the lagging flow with the maximum normalized lag
CIFQ (Contd.) • In-sync flows not affected since lagging flows use slots given up by leading flows • Lagging flows can still starve leading flows under pathological scenarios • Provides both short-term and long-term fairness
CBQ-CSDPS • Same as IWFQ except that no explicit error free service is maintained • Rather, lead/lag is measured based on the actual number of bytes s transmitting during each time window • A flow with normalized rate r is leading if it has received channel allocation in excess of s*r, and lagging if it has received channel allocation less than s*r • Lagging flows are allowed precedence
CBQ-CSDPS • Same problem as in IWFQ – lagging flows given precedence, and hence can capture channel • Short term fairness is thus not guaranteed • Additionally, leads and lags are computed not based on error-free service, but based on a time window of measurement … performance sensitive to the time window