Notes 5b Aloha Protocol
Notes 5b Aloha Protocol
, in
WiFI?
Assume no-one is in charge; this is a distributed system
1
ALOHA Network + ALOHA Protocol
• Seminal computer network connecting the
Hawaiian islands in the late 1960s
– When should nodes send?
– A new protocol was devised by Norm
Abramson …
Simple idea:
Node just sends when it has Hawaii
traffic.
If there was a collision (no ACK
received) then wait a random
time and resend
2
ALOHA Protocol (2)
• Some frames will
be lost, but many
may get through…
• Good idea?
3
ALOHA Protocol (3)
• Simple, decentralized protocol that works
well under low load!
: © 2009 IEEE
5
CSMA (Carrier Sense Multiple Access)
• Improve ALOHA by listening for
activity before we send (Doh!)
– Can do easily with wires, not wireless
6
CSMA (2)
• Still possible to listen and hear
nothing when another node is
sending because of delay
7
CSMA (3)
• CSMA is a good defense against
collisions only when BD is small
8
CSMA/CD (with Collision Detection)
• Can reduce the cost of collisions by
detecting them and aborting (Jam)
the rest of the frame time
– Again, we can do this with wires
9
CSMA/CD Complications
• Want everyone who collides to
know that it happened
– Time window in which a node may
hear of a collision is 2D seconds
10
CSMA/CD Complications (2)
• Impose a minimum frame size that
lasts for 2D seconds
– So node can’t finish before collision
– Ethernet minimum frame is 64 bytes
11
CSMA “Persistence”
• What should a node do if another
node is sending?
What now?
Now! Uh oh Now!
13
CSMA “Persistence” (3)
• Intuition for a better solution
– If there are N queued senders, we
want each to send next with
probability 1/N
Send p=½ Whew Send p=½
14
Binary Exponential Backoff (BEB)
• Cleverly estimates the probability at 1/2n
– 1st collision, wait 0 or 1 frame times
– 2nd collision, wait from 0 to 3 times
– 3rd collision, wait from 0 to 7 times …
16
Modern Ethernet
• Based on switches, not multiple
access, but still called Ethernet
Switch
Switch ports
Twisted pair
17
• How do wireless nodes share a
single link? (Yes, this is WiFi!)
– Build on our simple, wired model
Send? Send?
18
Wireless Complications
• Wireless is more complicated than
the wired case (Surprise!)
1. Nodes may have different areas of
coverage – doesn’t fit Carrier Sense »
2. Nodes can’t hear while sending –
can’t Collision Detect »
≠ CSMA/CD
19
Different Coverage Areas
• Wireless signal is broadcast and
received nearby, where there is
sufficient SNR
20
Hidden Terminals
• Nodes A and C are hidden terminals when sending to B
– Can’t hear each other (to coordinate) yet collide at B because
A not aware of B in Transmitting
– We want to avoid the inefficiency of collisions
21
Exposed Terminals
• B and C are exposed terminals when sending to A and D
– Can hear each other yet don’t collide at receivers A and D
– We want to send concurrently to increase performance
22
Nodes Can’t Hear While Sending
• With wires, detecting collisions
(and aborting) lowers their cost
• More wasted time with wireless
Wired Wireless
Collision Collision
X Resend XXXXXXXXX Resend
X Time XXXXXXXXX
23
Possible Solution: MACA
– 802.11 uses a refinement of MACA (later)
• Protocol rules:
1.A sender node transmits a RTS (Request-To-Send, with frame length)
2.The receiver replies with a CTS (Clear-To-Send, with frame length)
3.Sender transmits the frame while nodes hearing the CTS stay silent
– Collisions on the RTS/CTS are still possible, but less likely
24
MACA – Hidden Terminals
• AB with hidden terminal C
1. A sends RTS, to B
A B C D
25
MACA – Hidden Terminals (2)
• AB with hidden terminal C
2. B sends CTS, to A, and C too
RTS
A B C D
26
MACA – Hidden Terminals (3)
• AB with hidden terminal C
2. B sends CTS, to A, and C too
Alert!
RTS
A B C D
CTS CTS
27
MACA – Hidden Terminals (4)
• AB with hidden terminal C
3. A sends frame while C defers
Quiet...
Frame
28
MACA – Exposed Terminals
• BA, CD as exposed terminals
– B and C send RTS to A and D
A B C D
29
MACA – Exposed Terminals (2)
• BA, CD as exposed terminals
– A and D send CTS to B and C
RTS RTS
A B C D
30
MACA – Exposed Terminals (3)
• BA, CD as exposed terminals
– A and D send CTS to B and C
All OK All OK
RTS RTS
A B C D
CTS CTS
31
MACA – Exposed Terminals (4)
• BA, CD as exposed terminals
– A and D send CTS to B and C
Frame Frame
A B C D
32
802.11, or WiFi
• Very popular wireless LAN To Network
Access
started in the 1990s Point
• Clients get connectivity from a
(wired) AP (Access Point) Client
• It’s a multi-access problem
• Various flavors have been
developed over time
– Faster, more features
33
802.11 Physical Layer
• Uses 20/40 MHz channels on ISM bands
– 802.11b/g/n on 2.4 GHz
– 802.11 a/n on 5 GHz
35
802.11 CSMA/CA for Multiple Access
• Sender avoids collisions by inserting small random gaps
– E.g., when both B and C send, C picks a smaller gap, goes first
Send?
Send?
Time
36
The Future will be for 802.11 as….
• Likely ubiquitous for Internet connectivity
– Greater diversity, from low- to high-end devices
• Innovation in physical layer drives speed
– And power-efficient operation too
• More seamless integration of connectivity
– Too manual now, and limited (e.g., device-to-device)
37
Data Link Layer
38
Data Link Layer Topics to Cover
Error Detection and Correction
Data Link Control and Protocols
Multiple Access
Local Area Networks
Wireless LANs
39
Multiple access problem
• Example: a classroom of many wanting to interact!!!
• Compare with Human protocols:
40
Multiple access protocols
• In LANs, WiFi, satellite networks, cocktail party
• If more than 2 users send @ the same time - collision
• All collided packets are lost -> waste of bandwidth
41
Taxonomy of Multiple-Access Protocols
42
Random Access Protocols
• In random access or contention methods, no
station is superior to another station and none is
assigned the control over another. No station
permits, or does not permit, another station to
send. At each instance, a station that has data to
send uses a procedure defined by the protocol to
make a decision on whether or not to send.
43
ALOHA Network
• Developed by Norm Abramson at the Univ. of Hawaii
– mountainous islands → land-based network difficult to install
– fully decentralized protocol
ACK ACK
ACK ACK
44
Pure Aloha
• The node immediately transmits its frame completely
• If the frame is collided it retransmits the frame again (after
completely transmitting its collided frame) with the probability p
45
• Assumptions Slotted Aloha Operation
• all frames same size when node obtains fresh frame, it transmits in next slot
• time is divided into equal size slots, time to no collision, node can send new frame in next slot
transmit 1 frame if collision, node retransmits frame in each subsequent
• nodes start to transmit frames only at beginning of slot with prob. p until success
slots
• nodes are synchronized
• if 2 or more nodes transmit in slot, all nodes detect
collision
46
Frames in a Slotted ALOHA Network
47
Slotted Aloha
• Pros Cons
• single active node can collisions, wasting slots
continuously transmit at full idle slots
rate of channel nodes may be able to detect
• highly decentralized: only slots collision in less than time to
in nodes need to be in sync transmit packet
• simple clock synchronization
48
Multiple Access Protocols
ALOHA
49
Carrier Sense Multiple Access
• Invented to minimize collisions and increase the performance
• A station now “follows” the activity of other stations
• Simple rules for a polite human conversation
– Listen before talking
– If someone else begins talking at the same time as you, stop talking
• CSMA:
– A node should not send if another node is already sending
• carrier sensing
• CD (collision detection):
– A node should stop transmission if there is interference
• collision detection
50
Carrier Sense Multiple Access
• If everyone is sensing the medium how come that collisions still occur ?
channel
propagation
delay
51
CSMA (cnt’d)
ALOHA
53
Collision Detection
• How the station detects a collision?
• Examples:
– detecting voltage level on the line
– detecting power level
– detecting simultaneous transmission &
reception
54
CSMA with Collision Detection (CSMA/CD)
55
Multiple Access Protocols
ALOHA
56
CSMA with Collision Avoidance -CSMA/CA-
• no collisions
57
Further Readings:
Computer Communication &
Networks
Chapter 12 (B.A Forouzan)
Section 12.1
(Cover only those contents which are related to topics covered in class)
Datalink Layer: Multiple Access
58