Download Medium Access Control

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Deep packet inspection wikipedia , lookup

Cracking of wireless networks wikipedia , lookup

Piggybacking (Internet access) wikipedia , lookup

STANAG 3910 wikipedia , lookup

IEEE 1355 wikipedia , lookup

Transcript
Medium Access Control
Nick Feamster
CS 4251 Computer Networking II
Spring 2008
Some Multiple Access Protocols
• CSMA/CD
• Token passing
• Wireless LAN Protocols
Random Access MAC Protocols
• Non-Carrier-Sense protocols: doesn’t “listen” to
the channel before transmitting
– ALOHA
• Carrier-Sense protocols: senses the channel
before transmitting
– CSMA (Carrier Sense Multiple Access): does not
detect collision.
– CSMA/CD (Ethernet): A node “listens” before/while
transmitting to determine whether a collision happens.
ALOHA
• Radio-based communication network
– Developed in 1970s at the Univ of Hawaii
• Basic idea: transmit when a node has data to be
sent.
– Receiver sends ACK for data
– Detect collisions by timing out for ACK
– Recover from collision by trying after random delay
• Too short: large number of collisions
• Too long: underutilization
Ethernet MAC
• If line is idle (no carrier sensed) send packet
immediately
• If line is busy (carrier sensed) wait until idle and
transmit packet immediately
• If collision detected
– Stop sending and jam signal
– Jam signal: make sure all other transmitters are
aware of collision
– Wait a random time (Exponential backoff), and try
again
Questions
• How does sender detect collision?
• How long does it take?
Ethernet Performance
• Ethernets work best under light loads
– Utilization over 30% is considered heavy
• Peak throughput worse with
– More hosts
• More collisions needed to identify single sender
– Smaller packet sizes
• More frequent arbitration
– Longer links
• Collisions take longer to observe, more wasted
bandwidth
Ethernet MAC Protocol
Collision detection can take as long as 2 .
Carrier Sense Multiple Access (CSMA)
• Listen to medium and wait until it is free
(no one else is talking)
• Wait a random backoff time
• Advantage: Simple to implement
• Disadvantage: Cannot recover from a collision
Wireless Interference
• Two transmitting stations interfere with each
other at the receiver
• Receiver gets garbage
A
B
C
Carrier Sense Multiple Access
with Collision Detection (CSMA-CD)
• Procedure
– Listen to medium and wait until it is free
– Start talking, but listen to see if someone else starts talking too
– If collision, stop; start talking after a random backoff time
• Used for hub-based Ethernet
• Advantage: More efficient than basic CSMA
• Disadvantage: Requires ability to detect collisions
– More difficult in wireless scenario
Collision Detection in Wireless
• No “fate sharing” of the link
– High loss rates
– Variable channel conditions
• Radios are not full duplex
– Cannot simultaneously transmit and receive
– Transmit signal is stronger than received signal
Solution: Link-Layer Acknowledgments
• Absence of ACK from receiver signals packet
loss to sender
• Sender interprets packet loss as being caused
by collision
Problem: Does not handle hidden terminal cases.
Carrier Sense Multiple Access
with Collision Avoidance (CSMA-CA)
• Similar to CSMA but control frames are
exchanged instead of data packets
–
–
–
–
RTS: request to send
CTS: clear to send
DATA: actual packet
ACK: acknowledgement
Carrier Sense Multiple Access
with Collision Avoidance (CSMA-CA)
• Small control frames lessen the cost of collisions
(when data is large)
• RTS + CTS provide “virtual carrier sense”
• protects against hidden terminal
A
B
Random Contention Access
• Slotted contention period
– Used by all carrier sense variants
– Provides random access to the channel
• Operation
–
–
–
–
Each node selects a random backoff number
Waits that number of slots monitoring the channel
If channel stays idle and reaches zero then transmit
If channel becomes active wait until transmission is
over then start counting again
Virtual Carrier Sense
• Provided by RTS & CTS
• Prevents hidden terminal collisions
• Typically unnecessary
RTS
CTS
A
B
C
Physical Carrier Sense Range
• Carrier can be sensed at
lower levels than packets can
be received
– Results in larger carrier sense
range than transmission range
– More than double the range in
NS2 802.11 simulations
Receive Range
Carrier Sense Range
• Long carrier sense range
helps protect from
interference
Hidden Terminal Revisited
• Virtual carrier sense no longer needed in this
situation
RTS
CTS
A
B
C
Physical Carrier Sense
Physical Carrier Sense
• Energy detection threshold
– Monitors channel during “idle” times between packets to
measure the noise floor
– Energy levels above the this noise floor by a threshold trigger
carrier sense
• DSSS correlation threshold
– Monitors the channel for Direct Sequence Spread Spectrum
(DSSS) coded signal
– Triggers carrier sense if the correlation peak is above a threshold
– More sensitive than energy detection (but only works for 802.11
transmissions)
• High BER disrupts transmission but not detection