0% found this document useful (0 votes)
92 views58 pages

Notes 5b Aloha Protocol

Uploaded by

The UnCONFUSED
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
92 views58 pages

Notes 5b Aloha Protocol

Uploaded by

The UnCONFUSED
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 58

How do nodes share a single link? Who sends when, e.g.

, in
WiFI?
Assume no-one is in charge; this is a distributed system

We will explore random multiple access control (MAC) protocols


This is the basis for classic Ethernet
Remember: data traffic is bursty

Busy! Zzzz.. Ho hum

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!

• Not efficient under high load


– Analysis shows at most 18% efficiency
– Improvement: divide time into slots and
efficiency goes up to 36%

• We’ll look at other improvements


4
Classic Ethernet
• ALOHA inspired Bob Metcalfe to
invent Ethernet for LANs in 1973
– Nodes share 10 Mbps coaxial cable
– Hugely popular in 1980s, 1990s

: © 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

• So does this eliminate collisions?


– Why or why not?

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

Jam! XXXXXXXX Jam!

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?

• Idea: Wait until it is done, and send


12
CSMA “Persistence” (2)
• Problem is that multiple waiting
nodes will queue up then collide
– More load, more of a problem

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 …

• BEB doubles interval for each successive


collision
– Quickly gets large enough to work
– Very efficient in practice
15
Classic Ethernet, or IEEE 802.3
• Most popular LAN of the 1980s, 1990s
– 10 Mbps over shared coaxial cable, with baseband signals
– Multiple access with “1-persistent CSMA/CD with BEB”

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
• AB with hidden terminal C
1. A sends RTS, to B

A B C D

25
MACA – Hidden Terminals (2)
• AB with hidden terminal C
2. B sends CTS, to A, and C too

RTS
A B C D

26
MACA – Hidden Terminals (3)
• AB 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)
• AB with hidden terminal C
3. A sends frame while C defers
Quiet...
Frame

28
MACA – Exposed Terminals
• BA, CD as exposed terminals
– B and C send RTS to A and D

A B C D

29
MACA – Exposed Terminals (2)
• BA, CD as exposed terminals
– A and D send CTS to B and C

RTS RTS
A B C D

30
MACA – Exposed Terminals (3)
• BA, CD 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)
• BA, CD 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

• OFDM modulation (except legacy 802.11b)


– Different amplitudes/phases for varying SNRs
– Rates from 6 to 54 Mbps plus error correction
– 802.11n uses multiple antennas; see “802.11
with Multiple Antennas for Dummies”
34
802.11 Link Layer
• Multiple access uses CSMA/CA (next); RTS/CTS optional
• Frames are ACKed and retransmitted with ARQ
• Funky addressing (three addresses!)
• Errors are detected with a 32-bit CRC
• Many, many features (e.g., encryption, power save)
Packet from Network layer (IP)

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:

– “Give everyone a chance to speak”


– “Don’t speak until you are spoken to”
– “Don’t monopolize the conversation”
– “Raise your hand if you have a question”
– “Don’t interrupt when someone is speaking”
– “Don’t fall asleep when someone else is talking”

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

• Ideally, the MAC protocol for a broadcast channel with the


bit-rate R bps should satisfy:
– if only 1 node is sending then the throughput is R
– when M nodes have data to send than the throughput is R/M
– decentralized protocol – no master
– simple & inexpensive to implement

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)

 increases the chance for collisions


• Reduces the chance of collisions  1-persistant
 p-persistant
• reduces the efficiency
 Decreases the chance for collisions
 Improves efficiency
52
Multiple Access Protocols

ALOHA

53
Collision Detection
• How the station detects a collision?

• There are many collision detection


methods!
– Most of them are analog processes.

• Examples:
– detecting voltage level on the line
– detecting power level
– detecting simultaneous transmission &
reception
54
CSMA with Collision Detection (CSMA/CD)

• CSMA/CD can be in one of the three states: contention, transmission,


or idle.
• Example of CSMA/CD: Ethernet
• How long does it take before stations realize that there has been a collision?

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

You might also like