21
Wi-Fi

Wi-Fi. Basic structure: – Stations plus an access point – Stations talk to the access point, then to outside – Access point talks to stations – Stations

Embed Size (px)

Citation preview

Page 1: Wi-Fi. Basic structure: – Stations plus an access point – Stations talk to the access point, then to outside – Access point talks to stations – Stations

Wi-Fi

Page 2: Wi-Fi. Basic structure: – Stations plus an access point – Stations talk to the access point, then to outside – Access point talks to stations – Stations

Wi-Fi

• Basic structure:– Stations plus an access point– Stations talk to the access point, then to outside– Access point talks to stations– Stations talk to stations

• Design goal:– A MAC protocol to determine who talks next

Page 3: Wi-Fi. Basic structure: – Stations plus an access point – Stations talk to the access point, then to outside – Access point talks to stations – Stations

Wireless communications

• Signal decays according to a power law with the distance, at least to the power of -2 with distance

• Comparing to Ethernet, what is the difference (as far as MAC is concerned)?

• When a station is sending, not all stations can hear. No real 100% carrier sense.– In Ethernet, everybody can hear everybody

Page 4: Wi-Fi. Basic structure: – Stations plus an access point – Stations talk to the access point, then to outside – Access point talks to stations – Stations

Wireless communications

• When a station is sending, it cannot hear other stations – cannot decide if there is a collision. No CD in wireless LAN.– In Ethernet, the sender can determine if there is

collision and abort immediately.

Page 5: Wi-Fi. Basic structure: – Stations plus an access point – Stations talk to the access point, then to outside – Access point talks to stations – Stations

Wireless communications

• Being able to sense the carrier does not mean that you can decode the data

• If received signal having power P means that you can decode the data, it may be true that at power P/2 you can realize that there is something going on

Page 6: Wi-Fi. Basic structure: – Stations plus an access point – Stations talk to the access point, then to outside – Access point talks to stations – Stations

Wireless communication• The received signal can be decoded if the signal to noise

ratio is larger than a certain threshold. Whether there is a collision depends on the signal to noise ratio at the receiver.

• You may allow two transmissions at the same time without collision. – In Ethernet, two simultaneous transmission means collision

A DCB A DCB

A->B, C->D A->B, D->C

Page 7: Wi-Fi. Basic structure: – Stations plus an access point – Stations talk to the access point, then to outside – Access point talks to stations – Stations

Wireless communications

• Hidden terminal, A->B, C->D. C did not hear A.

A DCB

• Exposed terminal. A->B, C->D. C hears A.

A DCB

Page 8: Wi-Fi. Basic structure: – Stations plus an access point – Stations talk to the access point, then to outside – Access point talks to stations – Stations

Medium Access Control (MAC) Layer 802.11

• Asynchronous Data Service– DCF (Distributed Coordination Function)

• Contention-Based Medium Access Control• CSMA/CA: Carrier Sense Multiple Access/Collision Avoidance• For elastic applications like email, file transfer

• Time-Bounded Service– PCF (Point Coordination Function)

• Contention Free Medium Access Control• Optional access method works like polling• For time-sensitive voice/video applications

Page 9: Wi-Fi. Basic structure: – Stations plus an access point – Stations talk to the access point, then to outside – Access point talks to stations – Stations

Problems

• What problems will occur if apply Ethernet MAC?– No CD, does not know whether there is a collision– No CD, channel waste could be large using 1-

persistent– Cannot hear all other people means the sender

cannot be sure that he can reserve the whole channel.

Page 10: Wi-Fi. Basic structure: – Stations plus an access point – Stations talk to the access point, then to outside – Access point talks to stations – Stations

Fixes

• No CD, use ACK. If there is no ACK, assume there is collision

• No CD, has to use non-persistent to reduce collision by AVOIDING COLLISION, CA

• Cannot hear other people, so devise some channel reservation technique

Page 11: Wi-Fi. Basic structure: – Stations plus an access point – Stations talk to the access point, then to outside – Access point talks to stations – Stations

DCF’s Main Idea• When get a packet to send, sense the channel. If channel

is busy, wait until the channel is free for DIFS. Start to backoff for a random time. If busy before reaching zero, freeze bo counter, and reactivate when idle for DIFS again. If counted to 0 and channel is still idle, send.

• After receives a packet, send ACK. • If no ACK received, double the window and retry.

Page 12: Wi-Fi. Basic structure: – Stations plus an access point – Stations talk to the access point, then to outside – Access point talks to stations – Stations

Difference with Ethernet

• In Ethernet, a station will pick a backoff timer, sleep for that amount of time, then wake up. – When waking up, two cases:

• Medium is free: send• Medium is busy: wait until free and send

• In Wi-Fi DCF, a station will pick a backoff timer backoff, while still monitor the medium– If the medium is busy during the backoff, will freeze the

timer.• Someone who waited longer will have a larger chance to send

Page 13: Wi-Fi. Basic structure: – Stations plus an access point – Stations talk to the access point, then to outside – Access point talks to stations – Stations

Simplified 802.11 DCF operation for unicast in implementation

• (Automating Cross-Layer Diagnosis of Enterprise Wireless Networks, Sigcomm 2007 )

• The first packet does not have to experience the backoff before it is sent; backoff after a successful packet transmission. So if there is a packet following the first packet, it will go through the backoff process before transmission.

Page 14: Wi-Fi. Basic structure: – Stations plus an access point – Stations talk to the access point, then to outside – Access point talks to stations – Stations

DCF

• Do you want the ACK to have the same priority as data packets?

• How do you make sure that ACK has higher priority?

• Use time. You have to wait for a certain amount time before you can send.

• High priority packets wait shorter.

Page 15: Wi-Fi. Basic structure: – Stations plus an access point – Stations talk to the access point, then to outside – Access point talks to stations – Stations

DCF

• The SIFS, DIFS. SIFS is for control packets. DIFS is for data packets.

• When a station wants to send, if it is a control packet, sense the channel for SIFS, then send. If it is a data packet, sense the channel for DIFS, then send.

Page 16: Wi-Fi. Basic structure: – Stations plus an access point – Stations talk to the access point, then to outside – Access point talks to stations – Stations

Rate

• 802.11 supports multiple rates. • 802.11g has 6,9,12,18,24,36,48,54 Mbps.• Lower rates have lower loss probabilities.

Page 17: Wi-Fi. Basic structure: – Stations plus an access point – Stations talk to the access point, then to outside – Access point talks to stations – Stations

Research Challenge

• Any problem do you see in the design of 802.11 MAC?

• Hint: wireless packets are subject to random loss, e.g., if you just walk by and blocked the line-of-sight path, the packet may be lost. In this case, what will 802.11 MAC do? What should be done?

Page 18: Wi-Fi. Basic structure: – Stations plus an access point – Stations talk to the access point, then to outside – Access point talks to stations – Stations

Further improvement

• Further improvement by improving carrier sense

• The problem is other people cannot hear me sending, so they will send.

• So, how to make sure that they will know I am sending?

Page 19: Wi-Fi. Basic structure: – Stations plus an access point – Stations talk to the access point, then to outside – Access point talks to stations – Stations

RTS/CTS• RTS/CTS in the place for carrier sense

– RTS – reserves channel for a bit of time, if sender hasn’t heard other CTSes

– CTS – sender replies if it hasn’t heard any other RTSes

– Both messages include time. Network Allocation Vector (NAV)

– If no CTS, exponential backoff– “RTS-CTS-DATA”

Page 20: Wi-Fi. Basic structure: – Stations plus an access point – Stations talk to the access point, then to outside – Access point talks to stations – Stations

RTS/CTS• 802.11 standardized both CSMA/CA and RTS/CTS• In practice, most operators disable RTS/CTS

– Very high overhead!• RTS/CTS packets sent at “base rate” (6Mbps for 802.11g)

– Avoid collisions regardless of transmission rate

– Most deployments are celluar (base stations), not ad hoc. Neighboring cells are often configured to use non-overlapping channels, so hidden terminals on downlink are rare• Hidden terminal on uplink possible, but if clients mostly d/l, then uplink

packets are small.• THIS MAY CHANGE. And is likely not true in your neighborhood!

– When CS range >> reception range, hidden terminal less important

Page 21: Wi-Fi. Basic structure: – Stations plus an access point – Stations talk to the access point, then to outside – Access point talks to stations – Stations

PCF

• The AP acts as the master and sends out beacon signals for polling stations and stations can sign up for certain amount of bandwidth use

• Co-exists with DCF. • How to make sure that beacon signals have

higher priority?– PIFS