Mac
Transcript of Mac
![Page 1: Mac](https://reader030.fdocuments.in/reader030/viewer/2022032513/55d0d813bb61ebbe798b4734/html5/thumbnails/1.jpg)
MAC Layer Protocols for Wireless Networks
![Page 2: Mac](https://reader030.fdocuments.in/reader030/viewer/2022032513/55d0d813bb61ebbe798b4734/html5/thumbnails/2.jpg)
What is MAC?
MAC stands for Media Access Control. A MAC layer protocol is the protocol that controls access to the physical transmission medium on a LAN.
It tries to ensure that no two nodes are interfering with each other’s transmissions, and deals with the situation when they do.
![Page 3: Mac](https://reader030.fdocuments.in/reader030/viewer/2022032513/55d0d813bb61ebbe798b4734/html5/thumbnails/3.jpg)
CSMA/CD MAC
CSMA/CD architecture used in Ethernet is a common MAC layer standard.
It acts as an interface between the Logical Link Control sublayer and the network's Physical layer.
![Page 4: Mac](https://reader030.fdocuments.in/reader030/viewer/2022032513/55d0d813bb61ebbe798b4734/html5/thumbnails/4.jpg)
![Page 5: Mac](https://reader030.fdocuments.in/reader030/viewer/2022032513/55d0d813bb61ebbe798b4734/html5/thumbnails/5.jpg)
Normal Ethernet OperationNormal Ethernet Operation
A
B
D
Data
C
Address mismatchpacket discarded
Address mismatchpacket discarded
Address matchpacket processed
Send datato node D
Transmitted packet seenby all stations on the LAN
(broadcast medium)
![Page 6: Mac](https://reader030.fdocuments.in/reader030/viewer/2022032513/55d0d813bb61ebbe798b4734/html5/thumbnails/6.jpg)
Ethernet CollisionsEthernet Collisions
A
B C
D
CollisionData transmission for A
Data transmission for C
![Page 7: Mac](https://reader030.fdocuments.in/reader030/viewer/2022032513/55d0d813bb61ebbe798b4734/html5/thumbnails/7.jpg)
Ethernet Transmission FlowchartEthernet Transmission Flowchart transmit packet
assemble packet
deferring on?
starttransmission send jam signal
increment attempts
compute and waitbackoff time
done excessivecollision errors
donetransmit ok
transmissiondone
?
yes
no yes
yes
no
no
yes
collision detect?
too manyattempts ?
![Page 8: Mac](https://reader030.fdocuments.in/reader030/viewer/2022032513/55d0d813bb61ebbe798b4734/html5/thumbnails/8.jpg)
Interference / Collisions
Interference on node b(“Hidden terminal problem”)
a
b
c
a b
ab
c d
Interference on node b
a and b interfere and hear noise only
Packets which suffered collisions should be re-sent.
Ideally, we would want all packets to be sent collision-free, only once…
![Page 9: Mac](https://reader030.fdocuments.in/reader030/viewer/2022032513/55d0d813bb61ebbe798b4734/html5/thumbnails/9.jpg)
Contention-based protocols CSMA — Carrier Sense Multiple Access
Ethernet (CSMA/CD) is not enough for wireless (collision at receiver cannot detect at sender)
MACA Protocol
A B C
Hidden terminal: A is hidden from C’s CS
![Page 10: Mac](https://reader030.fdocuments.in/reader030/viewer/2022032513/55d0d813bb61ebbe798b4734/html5/thumbnails/10.jpg)
Hidden Terminal Problem
A and C want to send data to B1. A senses medium idle and sends data2. C senses medium idle and sends data3. Collision occurs at B
A B C
Data Data
![Page 11: Mac](https://reader030.fdocuments.in/reader030/viewer/2022032513/55d0d813bb61ebbe798b4734/html5/thumbnails/11.jpg)
Collision Avoidance w/ RTS/CTS
A and C want to send to B1. A sends RTS (Request To Send) to B2. B sends CTS (Clear To Send) to A
C “overhears” CTS from B3. C waits for duration of A’s transmission
A B C
1.RTS
2.CTS2.CTS
3.Data
![Page 12: Mac](https://reader030.fdocuments.in/reader030/viewer/2022032513/55d0d813bb61ebbe798b4734/html5/thumbnails/12.jpg)
Overview of MAC Protocols Contention-based protocols (contd.)
MACAW — improved over MACA RTS/CTS/DATA/ACK Fast error recovery at link layer
IEEE 802.11 Distributed Coordination Function (DCF) Largely based on MACAW Called CSMA/CA
![Page 13: Mac](https://reader030.fdocuments.in/reader030/viewer/2022032513/55d0d813bb61ebbe798b4734/html5/thumbnails/13.jpg)
802.11 DCF (Distributed Coordinate Function)
Station listens before transmission If medium is free for more than DIFS: transmits Otherwise, uses exponential backoff mechanism
![Page 14: Mac](https://reader030.fdocuments.in/reader030/viewer/2022032513/55d0d813bb61ebbe798b4734/html5/thumbnails/14.jpg)
Interframe space (IFS)
SIFS : used by ACK, CTS, poll response(short)
PIFS : used by PC (point coordinator) when issuing polls(point)
DIFS : used by ordinary asynchronous traffic(distributed)
![Page 15: Mac](https://reader030.fdocuments.in/reader030/viewer/2022032513/55d0d813bb61ebbe798b4734/html5/thumbnails/15.jpg)
IEEE 802.11 DCF
Distributed coordinate function: ad hoc mode Virtual and physical carrier sense (CS)
Network allocation vector (NAV), duration field Binary exponential backoff RTS/CTS/DATA/ACK for unicast packets Broadcast packets are directly sent after
CS
![Page 16: Mac](https://reader030.fdocuments.in/reader030/viewer/2022032513/55d0d813bb61ebbe798b4734/html5/thumbnails/16.jpg)
Virtual Carrier Sense
Timing relationship
![Page 17: Mac](https://reader030.fdocuments.in/reader030/viewer/2022032513/55d0d813bb61ebbe798b4734/html5/thumbnails/17.jpg)
Random Backoff
Pick a timeslot chosen uniformly in [0, CW]
Listen up to chosen slot Transmit if nobody else started transmitting Wait if somebody else started transmitting
Time
![Page 18: Mac](https://reader030.fdocuments.in/reader030/viewer/2022032513/55d0d813bb61ebbe798b4734/html5/thumbnails/18.jpg)
Example: A Successful Transmission
A and B happened to choose different slots Node A chooses slot 4, hears nothing, transmits Node B chooses slot 8, hears Node A, waits
Success: exactly one node in first non-vacant slot
Node A:
Node B:
Slot choice (slot #4)
Slot choice (slot #8)
Time
![Page 19: Mac](https://reader030.fdocuments.in/reader030/viewer/2022032513/55d0d813bb61ebbe798b4734/html5/thumbnails/19.jpg)
Example: A Collision A and B happened to choose slot 4
Both listen and hear nothing Both transmit simultaneously
Collision: ≥ 2 nodes in first non-vacant slot
Node A:
Node B:
Slot choice (slot #4)
Slot choice (slot #4)
Time
![Page 20: Mac](https://reader030.fdocuments.in/reader030/viewer/2022032513/55d0d813bb61ebbe798b4734/html5/thumbnails/20.jpg)
High Contention Causes Collisions in CSMA
Uniform distribution “fills up,” quickly
Unacceptable collision rate above ~15 transmitting sensors
![Page 21: Mac](https://reader030.fdocuments.in/reader030/viewer/2022032513/55d0d813bb61ebbe798b4734/html5/thumbnails/21.jpg)
Binary Exponential Backoff (BEB)
• Creating more slots for solving the collision problem
![Page 22: Mac](https://reader030.fdocuments.in/reader030/viewer/2022032513/55d0d813bb61ebbe798b4734/html5/thumbnails/22.jpg)
Problems with BEB
Takes time for every node to increase CW Especially if traffic is spatially-correlated and
bursty Waste backoff slots if collisions cause
CW to increase
BEB causes performance to suffer
![Page 23: Mac](https://reader030.fdocuments.in/reader030/viewer/2022032513/55d0d813bb61ebbe798b4734/html5/thumbnails/23.jpg)
Q&A