Data Link layer Application Overview of IEEE 802.11 LLC: On transmission, assemble data into a frame with address and CRC fields. On reception, disassemble frame, perform address recognition and CRC validation. Presentation Session MAC controls access to the physical channel according to a predetermined set of rules Transport Network Logical Link Control (LLC) Datalink Medium Access Control (MAC) Physical Wireless Medium: A Chaotic Environment The Design Challenges are... Medium access to shared medium Noisy and unreliable wireless channel... Collision detection is not possible always... Mobility changes neighbor set Two approaches Reservation-based Two approaches Reservation-based - TDMA (slotted access to channel) Contention-based - requires tight coordination - requires time synchronization - grows with n - FDMA (Frequency is divided) 1
Two approaches Reservation-based - TDMA (slotted access to channel) Contention based MAC: IEEE 802.11 - requires tight coordination - requires time synchronization Infrastructure based - grows with n - FDMA (Frequency is divided) Without infrastructure Contention-based - Works nicely for single shared wireless channel. - More suitable for ad hoc wireless network IEEE 802.11 with Access Point Hybrid Network But we will discuss on ad hoc wireless networks Inter Frame Spacing (IFS) No Access Point SIFS, Slot time, DIFS (from shortest to longest) Coordination is more difficult SIFS (Short Inter frame space) Provides highest priority access to the channel Defined for short control messages IEEE 802.11--Two modes of operation: DCF (Distributed Coordination Function) Appropriate for ad hoc wireless networks No controller PCF (Point Coordination Function) Appropriate for networks with AP AP controls medium access For example between data and ACK DIFS (Distributed inter-frame space) Used by stations that are operating under the DCF mode. Some math: SIFS < Slot time < DIFS DIFS = SIFS + 2*Slot time 2
Parameters at a glance (IEEE 802.11b Standard) Rules to consider for MAC protocols When should I access the channel DIFS duration 50 micro seconds What should I do if collision occurs Slot time 20 micro seconds SIFS duration 10 micro seconds How would I know whether my transmission was successful How can I ensure that I am sharing the channel fairly with my neighbors Rule 1: When to access the channel? ALOHA - Transmit whenever you want (LIFE IS GOOD.. ;-) - Frequent chances of collisions - Low channel utilization (18%) We will now see how these rules are set for IEEE 802.11 A B C D Rule 1: When to access the channel? Rule 1: When to access the channel? Slotted ALOHA - Transmit only at the beginning of a slot - Chances of collisions halved - Channel utilization doubled (36%) CSMA (Carrier Sense Multiple Access) - Listen before you talk CS part Carrier Sensing - Physical carrier sensing If received signal strength on antenna is larger than some threshold then medium is busy (RSSI-received signal strength indicator) A B C D - Virtual Carrier sensing Discussed later on 3
CSMA/?? CD or CA CA?? Physical Carrier Sensing illustrated Collision Detection is not always possible Full duplex radio device (capable of transmitting and receiving at once) is very costly Successful transmission does not mean a successful reception (see next slide) DIFS- Distributed (DCF) Inter-Frame space duration 50 micro seconds Physical Carrier Sensing is not good enough Solution: Virtual Carrier sensing The hidden-station problem Collision occurs Virtual Carrier Sensing Virtual Carrier Sensing 4
Formally VCS and frame formats Duration field DATA Sender ACK Receiver Blue/red Node Yellow Node NAV (BSY) Virtual CS NAV (BSY) When fourfour-way handshake is used? Not for broadcast packets Doesn t make any sense Back off to a random point in time and try again For short unicast packets (not used) - part introduces overhead Rule 2: What if collision occurs? For long unicast packets Makes sense Long data packets are protected by - dialogue In summary There is a parameter called Threshold_ If packet size is less than THreshold_ use two-way handshake (DATA_ACK) Otherwise use four way handshake Binary Exponential Back off (BEB) When BEB is used BEB explained When medium is found busy either by Physical or Virtual CS (to avoid collisions) When collision occurs (to resolve contention) Back off Try later IEEE 802.11 uses binary exponential back off (BEB) Think about visually impaired human being After every successful transmission (to deal with fairness) Choose a random number between [0, CW] Suppose the random number is n Count n idle slots before transmission Choose a random number and start counting down CW is called contention window Pause if medium becomes busy during count down 5
Back--off illustrated (previous Back example ) Back--off illustrated Back Back off for 14 slots Slot time 20 micro seconds DIFS- Distributed (DCF) Inter-Frame space duration 50 micro seconds Rule 3: Detecting successful transmission Why BackBack-off is called exponential After every unsuccessful attempts double CW min = 31 CW max= 1023 CW Not a CSMA/CD like Ethernet, it is a CSMA/CA For unicast packets Provision for Acknowledgement Absent of ACK means unsuccessful transmission BEB 1200 1000 800 CW Collision detection is absent 600 BEB 400 200 0 0 2 4 6 8 Take few attempts (don t try for ever) Short retry limit (typically 7) used for short packets Long retry limit (typically 5) used for long packets Probability of failure in consecutive attempts is pretty low For broadcast packets No way to know.. Attempts ACK illustrated DIFS Rule 4: Fairness issue DATA Sender SIFS ACK Receiver Back off after every successful transmission SIFS Note that DATA is followed by ACK after SIFS duration What will happen if station 1 has more packet to transmit at this moment 6
Rule 4: Fairness issue (unhandled fairness issue) Parameters at a glance Tunable parameters Short retry limit Long retry limit Physical CS threshold threshold Back off after every unsuccessful attempt What will happen if this frame experiences collision Putting Pieces Together Work out how duration fields are calculated? State diagram 7