multiple access & local area networks prof. a. sahoo kresit
Post on 19-Dec-2015
223 views
TRANSCRIPT
Multiple Access&
Local Area Networks
Prof. A. Sahoo
KReSIT
2
Data LinkLayer
802.3CSMA-CD
802.5Token Ring
802.2 Logical Link Control
PhysicalLayer
MAC
LLC
802.11Wireless
LAN
Network Layer
Network Layer
PhysicalLayer
OSIIEEE 802
Various Physical Layers
OtherLANs
3
12
34
5M
Shared MultipleAccess Medium
Static Channel Allocation Problem Access Model:
Can be modeled as n independent users (one per node), each wanting to communicate with another user and they have no other form of communication.
Channel Allocation ProblemTo manage a single broadcast channel which must be shared among n uncoordinated users in following manner• efficiently i.e. maximize message throughputmaximize message throughput and • fairly and,• minimize mean waiting time mean waiting time
4
• Ring networks
• Multitapped Bus
5 main contexts:1. Wired Local Area
network
1. Wireless Local Area network
1. Packet Radio network
1. Cellular telephony
1. Satellite Communication
Context of Multiple Access Problem
5
Satellite Channel = fin
= fout
6
Possible Model Assumptions for Channel Allocation Problem
0. Listen property :: (applies to satellites)
The sender is able to listen to sent frame one round-trip after sending it.
no need for explicit ACKs
1. Model consists of n independent stations.
2. A single channel is available for communications.
7
Possible Model Assumptions for Channel Allocation Problem
3. Collision Assumption :: If two frames are transmitted simultaneously, they overlap in time and the resulting signal is garbled. This event is a collision.
4a. Continuous Time Assumption :: frame transmissions can begin at any time instant.
4b. Slotted Time Assumption :: time is divided into discrete intervals (slots). Frame transmissions always begin at the start of a time slot.
8
Possible Model Assumptions for Channel Allocation Problem
5a. Carrier Sense Assumption ::
Stations can tell if the channel is busy (in use) before trying to use it. If the channel is busy, no station will attempt to use the channel until it is idle.
5b. No Carrier Sense Assumption ::
Stations are unable to sense channel before attempting to send a frame. They just go ahead and transmit a frame.
9
Centralized versus Distributed
Two fundamental design choice Centralized : (GSM, CDMA)
One station is a master station Other stations are slaves Master decides when a slave can send data
Distributed: (Wireless LAN,Ethernet) No master station every other station is free to talk to any other
station
10
Circuit versus Packet mode
Circuit mode for smooth continuous traffic (voice) Makes sense to allocate part of the link to to the source for its exclusive use,
avoiding link access protocol repeatedly---> circuit mode(GSM)
Packet mode for bursty data traffic Fixed allocation of resource may cause under-utilization Compete for link access for each packet transmission ( GPRS)
11
Constraints
Design of multiple access scheme is highly constrained by implementation environment
Spectrum Scarcity spectrum is scarce resource FCC allows 902-928 Mhz, 2.40-2.48 Ghz for ISM band
for 1- 10 mile with restriction in transmission power Radio link properties
Fading, multi-path interference, hidden and exposed node problem, near-far problem
12
Constraints
Performance of ‘packet mode’ multiple access scheme heavily depends upon
a = D/TD= maximum propagation delay between any two stations (in seconds)T= Time to transmit any average size packets (seconds)
‘a’ is the number of packets that a station can put in the medium before the first bit is received by the receiver. .01 (wired, wireless LAN, cellular packet radio), 100 satellite
Impact of ‘a’ on collision recover scheme: A determines what happens when two senders transmit simultaneously
With small a packet collide soon and senders can know soon by listening to the medium
With large ‘a’, collision takes longer time after packet is transmitted. So only sensing medium is not sufficient to recover from collision. Some more protocol structure is required.
13
The parameter ‘a’
The number of packets sent by a source before the farthest station receives the first bit
14
15
Performance Metrics
Normalized throughput or Goodput Fraction of link capacity devoted to carrying non-retransmitted packet. E.g capacity 1 mbps, packet size 125 bytes, then it should carry 1000 packets
per second. But due to protocol overhead carries only 250 packets/sec. Goodput= .25. Realistic MA schemes --> .1 to .9
Mean Delay Duration a packet has to wait before it gets transmitted successfully Depends on --load, -- MA scheme, -- media characteristic
16
Contd..
Stability When offered load is low medium/ MA scheme can carry the load When load increases, collision increases and systen throughput tend to
decrease. Almost every transmission is a collision. Stable system --> Throughput does not decrease when load increases beyond
certain threshold Proper MA scheme can achieve this by dynamically decreasing the load
when overload is detected if infinite number of uncontrolled stations share a link, then instability is
guaranteed but if sources reduce load when overload is detected, can achieve stability
Fairness No starvation Equal share of bandwidth. max-min fair share: will study later
17
Carrier Sense Multiple Access
Listen before you speak Check whether the medium is active before sending a
packet (i.e carrier sensing) If medium idle, then transmit If collision happens, then detect and resolve
18
CSMA: Distributed, Packet mode scheme
Carrier Sense and its variants: Use of carrier sensing capability to know if someone else is using
the medium 1 persistent
If medium busy, keep sensing If medium Idle send immediately
p persistent If medium busy, keep sensing If medium Idle,
send with probability p, in case of no-send (1-p), wait for 1 time slot, and begin medium
sensing again Non persistent
If medium busy, wait for random time before sensing again If medium Idle send immediately
19
Choice of p in p-persistent system
Time slot is usually set to the maximum propagation delay.
as p decreases, stations wait longer to transmit, but the number of collisions decreases
if np > 1: secondary transmission likely So p < 1/n Large n needs small p which causes delay
20
Collision detection (CSMA/CD)
All aforementioned scheme can suffer from collision Device can detect collision
Listen while transmitting Wait for 2 * propagation delay
21
How to avoid/recover collision
1 persistent and non persistent results in guaranteed collisions when two node decided to transmit simultaneously
Rescue: p persistence or Exponential Back off P persistent:
p= .5, .1, .8 reduces the chance of collision Choice of p:
Trade-off between performance under heavy load and mean packet delay Under heavy load mean number of stations that will send packet is np, if
np > 1 then collision is likely. Therefore choose p < 1/n ( dynamic adjustment??)
Under heavy load mean message delay increase in order to ensure stable throughput.
22
Contd..
Advantages: Dynamically adjusts p, no need to choose p optimally. In high load, backs -off drastically, and reduces load on network
to give stable throughput
Disadvantages Delay increases ?? Fairness??
23
Exponential backoff
On detecting 1st collision for packet x
station A chooses a number r between 0 and 1.
waits for r * slot time and transmit.
Slot time is 2 * propagation delay
On detecting kth collision for packet x
choose r between 0,1,..,(2k –1) When value of k becomes high (10), give up. Randomization increase with larger window, but
delay increases.
24
CSMA/ CD (802.3,Ethernet)Performance
understanding the Ethernet's distributed contention scheme, under high load
transmission interval: is that during which the Ether has been acquired for a successful
packet transmission. contention interval:
is that composed of the retransmission slots Idle interval
No activity
25
CSMA contention interval
Station A transmits. Just before its signal reaches B, station B senses channel is idle and starts transmitting resulting in collision
The longer the propagation delay, the worse the performance of the protocol
26
Contention Interval - 2D
A B
A B
A B
A B
t = 0: A begins transmission
t = D - : packet almost at BB begins transmission
t = D: B detects collision, stops transmitting
t = 2D - : A detects collision
27
CSMA/ CD (802.3,Ethernet)Performance
Metcalfe and Boggs approach:Try to find mean duration of contention intervalOrmean number of contention slots in a contention interval k node is contending in contention period Assume each node transmits with a fixed probability p in any slot What is the probability (‘A’) that some station acquires the channel
in a slot ? A= p(1-p)^k-1 + p(1-p)^k-1 +… k times
= k p(1-p)^k-1 (A is maximized when p =1/k, with A -> 1/e as k tends to infinity.
28
Contd..
what is the probability (Pj) that a contention interval has exactly j slots?
(i.e after the collision, the least size of back off interval chosen by some node is j slots or, what is the probability that some station transmits only at j th slot and not in previous j-1 no slots?)
p(Not transmitted in 1 st slot)= ( 1-A) p(Not transmitted in 1 st slot and 2nd slot)= ( 1-A)(1-A)
Pj= A(1-A) ^j-1 -----(1)
Over a long period of time, the mean number of slots per contention interval is given by
Sumj=0j=inf (j* A(1-A)j-1 ) = 1/A (= mean of geometric
distribution given in (1) )
29
Contd…
Since each slot is 2*Tprop, Mean length of contention interval (w) is
2* Tprop /A Now if Ttrans is time needed for mean packet size then
Channel efficiency (w) is = time required to transmit in absence of collision/
time required to transmit in presence of collision
w= Ttrans / (Ttrans + 2* Tprop /A) So longer the propagation time Tprop( cable length!), the longer the
contention interval. The longer the contention interval, the lesser the
efficiency/throughput
30
Example: Ethernet (IEEE 802.3)
CSMA/CD with jamming Ethernet Address (48 bits)
Example: 08:00:0D:01:74:71
Ethernet Frame Format SFD : Start of frame delimiter (1 bit) FCS : Frame Check Sequence (checksum) L : length of the Data field
31
Minimum frame size
A B
A B
A B
A B
t = 0: A begins transmission
t = D - : packet almost at BB begins transmission
t = 1: B detects collision, stops transmitting
t = 2D - : A detects collision
32
Minimum frame size
It takes A a complete RTT (2D) to detect collision When B detects collision (gets more power than it is
putting out) it generates 48-bit noise burst (“Jam” bits) to warn all other stations
Min. frame size equal to number of bits transmitted during one RTT
33
Minimum frame size
slotTime: number of bits transmitted by a source during the max. RTT (2D = 51.2 sec) for any Ethernet network
Collisions must be detected by sources while still transmitting
All frames must be at least 1 slot (on 10Mbps, this is 512 bits)
34
Ethernet The most widely used LAN Standard is called IEEE 802.3 Uses CSMA/CD with exponential backoff Also, on collision, place a jam signal on wire, so that all
stations are aware of collision and can increment timeout range
‘a’ small =>time wasted in collision is around 50 microseconds
Ethernet requires packet to be long enough that a collision is detected before packet transmission completes (a <= 1) packet should be at least 64 bytes long for longest allowed
segment Max packet size is 1500 bytes
prevents hogging by a single station
35
More on Ethernet
Ethernet types are coded as <Speed><Baseband or broadband><physical medium> Speed = 3, 10, 100 Mbps Physical medium:
“2” is cheap 50 Ohm cable, upto 200 meters “T” is unshielded twisted pair (also used for telephone
wiring) “36” is 75 Ohm cable TV cable, upto 3600 meters
10base5: 500m segment, 100 node, Original, bus topology 10base 2: 185m segment, 30 node, cheap 10baseT: twisted pair; goes to a hub star topology 10baseF : Optical Fiber Ethernet
36
Recent developments
Switched Ethernet each station is connected to switch by a separate UTP wire line card of switch has a buffer to hold incoming packets fast backplane switches packet from one line card to others simultaneously arriving packets do not collide (until buffers
overflow) higher intrinsic capacity than 10BaseT (and more expensive)
37
Fast Ethernet variants
Fast Ethernet (IEEE 802.3u) same as 10BaseT, except that line speed is 100 Mbps spans only 205 m big winner most current cards support both 10 and 100 Mbps cards (10/100
cards) for about $80 ( Old data, probably cheaper now) 100VG Anylan (IEEE 802.12)
station makes explicit service requests to master master schedules requests, eliminating collisions not a success in the market
38
Fast Ethernet variants
Gigabit Ethernet aims to continue the trend still undefined, but first implementation will be based on fiber
links
39
Gigabit Ether Switch
40
KReSIT internet connection
41
Evaluating Ethernet
Pros easy to setup requires no configuration robust to noise
Problems at heavy loads, users see large delays because of backoff nondeterministic service doesn’t support priorities big overhead on small packets
But, very successful because problems only at high load can segment LANs to reduce load
42
Centralized access schemes
One station is master, and the other are slaves slave can transmit only when master allows
Natural fit in some situations wireless LAN (Point coordination function mode, PCF), where
base station is the only station that can see everyone cellular telephony, where base station is the only one capable of
high transmit power Pros
simple master provides single point of coordination
Cons master is a single point of failure
need a re-election protocol master is involved in every single transfer => added delay
43
Polling and probing
Centralized packet-mode multiple access schemes Polling (PCF mode of wireless LAN )
master asks each station in turn if it wants to send (roll-call polling)
inefficient if only a few stations are active, overhead for polling messages is high, or system has many terminals
Probing Putting some intelligence to simple polling stations are numbered with consecutive logical addresses assume station can listen both to its own address and to a set of
multicast addresses master does a binary search to locate next active station
44
Reservation-based schemes
When ‘a’ is large, can’t use a distributed scheme for packet mode (too many collisions and waste of bandwidth) mainly for satellite links
Instead master coordinates access to link using reservations
Some time slots devoted to reservation messages can be smaller than data slots => minislots
Stations contend for a minislot (or own one) Master decides winners and grants them access to link Packet collisions are only for minislots, so overhead on
contention is reduced
45
Reservation Based: Reservation Based: Basic Bit-Map ProtocolBasic Bit-Map Protocol((Collision-Free ProtocolsCollision-Free Protocols))
N stations with addresses 0 to N-1 N one-bit contention slots. If a station i has a frame to send, it sends a one
during contention slot i. Once all stations indicated frame availability, ready
frames are transmitted in address order.
N = 8
46
Bit-Map ProtocolBit-Map Protocol
Representative of reservation protocols (where each station broadcasts its desire to transmit before actual transmission).
Efficiency per frame: With low load = d/(N + d) With high load = d/(1 +
d)
d = number of bits in one frame
47
Bit Map Protocol
Issues Stations' access to the network is unfair: That is, if station
i and station j both want to transmit, and i < j, then station i always first to transmit.
low numbered stations have to wait longer than high numbered stations for the reservation to complete.
Efficiency: at low load, the protocol efficiency is low.
48
Limited Contention Protocol
None of full reservation and full contention mechanisms are not suitable for extreme condition of load.
Reservation scheme is appropriate for high load situation, contention for low load situation
A mix of reservation and contention may be an adaptive and optimal approach
We have seen that probability of successful transmission by some node ( among n contending nodes) is maximized when p <1/n. Decreases drastically with increase of n
Heavily dependent on n or size of contention domain Protocol which can make smaller subgroup of nodes ( and thus
limiting the contention) and then give chance to each group-- Splitting Algorithms
49
Limited contention - Adaptive Tree Walk
Combines best properties of contention and collision free protocols. Divides stations into groups. In first contention slot, everyone is allowed to compete. If collision, then only those in group 1 are allowed to compete, and so on
down the hierarchy.
AA CCBB DD
44
3322
11
HHGGFFEE
776655
50
Decentralized polling
Just like centralized polling, except there is no master Each station is assigned a slot that it uses
if nothing to send, slot is wasted Also, all stations must share a time base
51
Token passing
In distributed polling, every station has to wait for its turn
Time wasted because idle stations are still given a slot What if we can quickly skip past idle stations? This is the key idea of token ring Special packet called ‘token’ gives station the right to
transmit data When done, it passes token to ‘next’ station
=> stations form a logical ring No station will starve
52
Token Ring operation
Frames flow in one direction: upstream to downstream special bit pattern (token) rotates around ring
The ring should be able to hold the token IEEE 802.5---> 1 bit holding buffer
must capture token before transmitting During normal operation, copy packets ( token and data) from input
buffer to output If packet is a token, check if data packets ready to send If not, forward token If so, delete token, and send packets Receiver copies packet and sets ‘ack’ flag Sender removes packet and deletes it When done, reinserts token If ring idle and no token for a long time, regenerate token
53
Logical rings
Can be on a non-ring physical topology
54
Ethernet vs. Token Ring: Ethernet
Dominance
Open standard Proprietary
platforms “forced” to support standards or lose value
FDDI Market $220M 1997, $40M 2001.
Fast Ethernet $150/port
FDDI $750/port
55
Various Token ring networks
Token Ring Networks PRONET: 10Mbps and 80 Mbps rings IBM: 4Mbps token ring 16Mbps IEEE 802.5/token ring 100Mbps Fiber Distributed Data Interface (FDDI)
56
Evaluating token ring Token Holding Time (THT)
10 msec upper bound (ieee 802.5) Token Rotation Time <= ActiveNodes * THT + Ring Latency (RL)
RL significantly large for MANs Pros
medium access protocol is simple and explicit no need for carrier sensing, time synchronization or complex protocols
to resolve contention guarantees zero collisions can give some stations priority over others ( see later) At high loads can effectively become TDM
57
Evaluating token ring
Cons token is a single point of failure
lost or corrupted token trashes network need to carefully protect and, if necessary, regenerate token
all stations must cooperate network must detect and cut off unresponsive stations
stations must actively monitor network ( see next slide) usually elect one station as monitor
58
Token Ring Maintenance Need for a monitor ( increased complexity)
Token may be lost, corrupted Data frame may be orphaned
Monitor sends periodic beacon Monitor election
In absence of beacon, any node transmits ‘claim token’ control packet. The node which can do it first, and seen by everybody, becomes the monitor.
Lost Token: Monitor waits for TimeOut = NoOfStations * THT + RL If no token, insert token
59
Token Ring Maintenance
Garbled frame Check for checksum, and remove
Orphan frame Delete from the ring Use of monitor bit ( if set and seen twice by Monitor, delete it)
Maintaining the length of ring If less than token size, insert delay
60
Priority Operation in Token Ring Used for time critical application
Provides a mechanism that higher priority frames across the nodes will be transmitted first
Same priority frames will have same access right to the ring Priorities are for traffic classes. Token Contains 3 bit priority field. 6 priority level possible
Operation: Token has a certain priority n initially If received packet is token:
A node X, having a packet with priority p, seizes the token if token priority is n <= p
transmits data and, and passes token with its previous priority value n Else passes on the token
In case X received packet is a data and n <= p( reservation) Set priority p and reservation bit Remembers (stacks) the old and new value of p ( Po, Pn) Token holder S, when releasing the token,
sets this p ( received in data frame) in the token ( this ensures that low priority nodes will not be able to seize the token)
61
Priority ( contd..)
In token priority value is not lowered, low priority packet may starve
The node which raised the priority value in the token is responsible for lowering the value ( here X, stacking station, old priority Po, new priority Pn) This is done when X, sees the token coming back with a higher
than/same value as Pn , indicating all higher priority packets are serviced, lowers the ring service value to Po.
Eventually lowest priority packets get serviced. May be extended delay, due to high load of higher
priority pakets
62
Single and double rings
With a single ring, a single failure of a link or station breaks the network => fragile
With a double ring, on a failure, go into wrap mode Used in FDDI
63
Hub or star-ring
Simplifies wiring Active hub is predecessor and successor to every station
can monitor ring for station and link failures Passive hub only serves as wiring concentrator
but provides a single test point Because of these benefits, hubs are practically the only
form of wiring used in real networks even for Ethernet
64
Fiber Distributed Data Interface
FDDI is the most popular token-ring base LAN Dual counterrotating rings, each at 100 Mbps Uses both copper and fiber links Supports both non-realtime and realtime traffic
token is guaranteed to rotate once every Target Token Rotation Time (TTRT) ( see later)
station is guaranteed a synchronous allocation within every TTRT
Supports both single attached and dual attached stations single attached (cheaper) stations are connected to only one of
the rings
65
Physical Properties of FDDI
Dual Ring Configuration
Single and Dual Attachment Stations
(a) (b)
Downstream
Neighbor
UpstreamNeighbor
Concentrator
SAS
SAS
SAS
SAS
SAS
66
Characteristics
Each station imposes a delay (e.g., 50ns) Maximum of 500 stations Upper limit of 100km (200km of fiber) Can be implemented over copper (CDDI) FDDI uses 4b/5b NRZI (Non-Return to Zero Invert
on ones) with 100 Mb/s data rate 10BaseT Ethernet uses Manchester encoding , 10
Mb/s data rate
67
Timed Token Protocol
Target Token Rotation Time (TTRT): agreed-upon upper bound on TRT.
There are 2 types of traffic for FDDI: Asynchronous transmission
Given lower priority Synchronous transmission
is given higher priority, needs upper bound on delay. Sum of all symmetric data transmission time <
TTRT Token Rotation Time (TRT): how long it takes the
token to traverse the ring.TRT <= ActiveNodes x THT + RingLatency
68
Algorithm each node measures TRT between successive arrivals of the token if measured TRT >= TTRT, then token is late so don't send non-
real time ( asynchronous ) data if measured TRT < TTRT, then token is early so OK to send data Always send synchronous data, which has fixed size. define two classes of traffic
synchronous data: can always send. Has fixed size. asynchronous data: can send only if token is early
Example: TRT =100 ms ( I.e. since last time the node has seen the token),
TTRT =200 ms. Suppose node X has 20 ms synchronous data. There for it can send non real time data for 200 - 120 ms. If it consumes 80 ms, then next node do not have any time to send
asynchronous data.
69
Token Maintenance Lost Token
no token when initializing ring bit error corrupts token pattern node holding token crashes
Generating a Token (and agreeing on TTRT) execute when join ring or suspect a failure each node sends a special claim frame that includes the
node's bid for the TTRT when receive claim frame, update bid and forward if your claim frame makes it all the way around the ring:
your bid was the lowest everyone knows TTRT you insert new token
70
Monitoring for a Valid Token should see valid transmission (frame or token) periodically maximum gap = ring latency + max frame <= 2.5ms set timer at 2.5ms and send claim frame if it fires
71
Ethernet vs. Token Ring: Media Access Control Methods
Contention (Ethernet) performs better than token passing on low utilization
LANs high utilization - collisions and retransmission when 2
stations try to communicate simultaneously Token passing
high utilization - superior performance, no collisions QoS – multimedia preference to some applications used to control bus in USB, Firewire, and other
emerging shared media technologies
72
Comparisons
Each station imposes a delay (e.g., 50ns) Maximum of 500 stations Upper limit of 100km (200km of fiber) Can be implemented over copper (CDDI) FDDI uses 4b/5b NRZI (Non-Return to Zero Invert
on ones) with 100 Mb/s data rate 10BaseT Ethernet :10 Mb/s data rate, no of station,
reach: much lower
73
Ethernet vs. Token Ring:
Response Time vs. Load
74
ALOHA (“free for all”)
Stations transmit whenever they have data to send
Detect Collision or Wait for an acknowledgment
If no acknowledgment (or collision), try again after a random waiting time
Collision: If more than one node transmit at the same timeIf there is a collision, all nodes have to re-transmit packets
75
Vulnerable Window
For a given frame, the time when no other frame may be transmitted if a collision is to be avoided.
Assume all packets have same length (L) and require Tp seconds
for transmission Each packet vulnerable to collisions for time Vp = ??
Suppose packet A sent at time to
If pkt B sent any time between to – Tp and to end of packet B
collides with beginning of packet A If pkt C sent any time between to and to + Tp start of packet
C will collide with end of packet A Total vulnerable interval for packet A is 2Tp
t
Packet CPacket B
Tp
Packet ATp
76
Throughput of Pure ALOHA
Based on several assumptions:
1. Traffic Model: transmission attempts follows a Poisson distribution
2. Fixed packet size Poisson Distribution:
Pr[i customers arrive in t time interval] = P[n(t) =i] = (t i e -t)/i!
Where Average arrival rate ( no of arrival per unit tine)
Assume, G = Average number of transmissions in time interval T= T, where T =frame time Probability of i transmission attempts per frame time is
poisson with mean G per frame time Probability that i frames are generated during a frame time
is P[i] = Gi * e-G / i!
77
ALOHA Throughput Let S = number of successful packet transmissions per frame
time (equals channel utilization)
G (= in previous expression )= average number of attempted transmissions per packet time(user load+retransmissions).Then,with Poisson distribution traffic model
Probability that i frames are generated during time interval 2T (vulnerable window) is
P[n(2T) =i] = (G i e –G)/i!
(In an interval two frame times long, the mean number of frames generated will be 2G)
78
ALOHA Throughput
Now Throughput (S) is = offered load G * Prob that no frame suffers collision
S= G * Pr( that there is no transmission in 2T time interval
i.e Pr( n(2T)=0 ) )
Pr( n(2T)=0 )= e - 2G
S= G* e - 2G
79
ALOHA and Slotted ALOHAThroughput versus Load
Peaks at G=.5 ---> max(Throughput) = 1/2e ~ 0.18 ALOHA can achieve maximum throughput of 18.4%
dS/dG = e-2G – 2Ge-2G = 0
Gmax = 1/2 Smax = 1/(2e) = 0.184
0
0.05
0.1
0.15
0.2
0.25
0.3
0.35
0.4
0.01
563
0.03
125
0.06
25
0.12
5
0.25 0.5 1 2 4 8
Ge-G
Ge-2G
G
0.184
0.368
S
80
Slotted ALOHA
Time is divided into slots (i.e., slot = one packet transmission time at least) Master station generates synchronization pulses for time-slots. (e.g., use
“pip” from a satellite) Station waits till beginning of slot to send packet. Stations transmit ONLY at the beginning of a time slot Collisions will occur because more than one frame can send in the slot n But collision probability reduces as Vulnerability Window reduced from 2T
to T;
81
Slotted ALOHA
Goodput doubles. Average no of packet in T (Vulnerable window) time=
P[n(T) =i] = (G i e –G)/i!
So S= G * Pr( that there is no transmission in 2T time interval
i.e Pr( n(T)=0 ) )
Pr( n(T)=0 )= e - G
S= G* e - G
Peaks at G=1 max(Throughput) = 1/e ~ 0.36
dS/dG = e-G – Ge-G = 0
Gmax = 1.0 Smax = 1/e ~ 0.368
82
Aloha (contd..)
Aloha performance :- not dependent on a Reservation Aloha for Satellite ( Kesav 152, Gallgher313)
Observations: ALOHA is an unstable protocol
If G increases to greater than 1 due to fluctuation in offered load, S will decrease
Reduction in throughput means fewer successful packet transmissions and more collisions
Number of retransmissions increases, backlogging messages to be transmitted and traffic load G
This in turn decreases S Results in operating point moving to right and S 0
Random access protocols can be made stable using backoff parameters
83
Comparison
With small p better s but longer delay
1.0
0.9
0.8
0.5
0.4
0.3
0.2
0.1
01 2 3 4 5 6 7 8 90
0.6
0.7
S (
thro
ughp
ut p
er p
acke
t tim
e)
G (attempts per packet time)
PureALOHA
SlottedALOHA
1-persistentCSMA
0.1-persistent CSMA
0.5-persistent CSMA
Nonpersistent CSMA
0.01 persistent CSMA
84
Difference Between Wired and Wireless
If both A and C sense the channel to be idle at the same time, they send at the same time.
Collision can be detected at sender in Ethernet. Half-duplex radios in wireless cannot detect collision
at sender.
A B C
A
B
C
Ethernet LAN Wireless LAN
85
A and C cannot hear each other. A sends to B, C cannot receive A. C wants to send to B, C senses a “free” medium (CS fails) Collision occurs at B. A cannot receive the collision (CD fails). A is “hidden” for C.
Hidden Terminal Problem
BA C
86
Exposed Terminal Problem
A starts sending to B. C senses carrier, finds medium in use and has to wait
for A->B to end. D is outside the range of A, therefore waiting is not
necessary. A and C are “exposed” terminals
A B
CD
87
CSMA: Distributed, Packet mode scheme
Carrier Sense and its variants: Use of carrier sensing capability to know if someone else is using
the medium 1 persistent
If medium busy, keep sensing If medium Idle send immediately
p persistent If medium busy, keep sensing If medium becomes Idle after continuous sensing,
send with probability p, (wait IFS time for 802.11, then do a random back-off)
in case of no-send (1-p), wait for 1 time slot, and begin medium sensing again
If medium is free for IFS period, transmit packet.
88
CSMA: Distributed, Packet mode scheme
Non persistent If medium busy, wait for random time before sensing again If medium Idle send immediately
89
Summary of CSMA schemes
90
802.11 - MAC layer
Traffic services Asynchronous Data Service (mandatory) – DCF Time-Bounded Service (optional) - PCF
Access methods DCF CSMA/CA (mandatory)
collision avoidance via randomized back-off mechanism ACK packet for acknowledgements (not for broadcasts)
DCF w/ RTS/CTS (optional) avoids hidden/exposed terminal problem, provides
reliability PCF (optional)
access point polls terminals according to a list
91
t
medium busy
DIFSDIFS
next frame
contention window(randomized back-offmechanism)
802.11 - CSMA/CA
station which has data to send starts sensing the medium (Carrier Sense based on CCA, Clear Channel Assessment)
if the medium is free for the duration of an Inter-Frame Space (IFS), the station can start sending (IFS depends on service type)
if the medium is busy, the station has to wait for a free IFS plus an additional random back-off time (multiple of slot-time)
if another station occupies the medium during the back-off time of the station, the back-off timer stops (fairness)
slot timedirect access if medium is free DIFS
92
802.11 DCF – basic access
If medium is free for DIFS time, station sends data receivers acknowledge at once (after waiting for SIFS) if the
packet was received correctly (CRC) automatic retransmission of data packets in case of transmission
errors
t
SIFS
DIFS
data
ACK
waiting time
otherstations
receiver
senderdata
DIFS
contention
93
Solution to Hidden/Exposed Terminals
A first sends a Request-to-Send (RTS) to B On receiving RTS, B responds Clear-to-Send (CTS) Hidden node C overhears CTS and keeps quiet
Transfer duration is included in both RTS and CTS Exposed node overhears a RTS but not the CTS
D’s transmission cannot interfere at B
A B C
RTS
CTS CTS
DATA
D
RTS
94
802.11 - Reliability Use acknowledgements
When B receives DATA from A, B sends an ACK If A fails to receive an ACK, A retransmits the DATA Both C and D remain quiet until ACK (to prevent collision of
ACK) Expected duration of transmission+ACK is included in
RTS/CTS packets
A B C
RTS
CTS CTS
DATA
D
RTS
ACK
95
802.11 –RTS/CTS If medium is free for DIFS, station can send RTS with reservation parameter
(reservation determines amount of time the data packet needs the medium) acknowledgement via CTS after SIFS by receiver (if ready to receive) sender can now send data at once, acknowledgement via ACK other stations store medium reservations distributed via RTS and CTS
t
SIFS
DIFS
data
ACK
defer access
otherstations
receiver
senderdata
DIFS
contention
RTS
CTS
SIFS SIFS
NAV (RTS)NAV (CTS)
96
802.11 - Carrier Sensing In IEEE 802.11, carrier sensing is performed
at the air interface (physical carrier sensing), and at the MAC layer (virtual carrier sensing)
Physical carrier sensing detects presence of other users by analyzing all
detected packets Detects activity in the channel via relative signal
strength from other sources Virtual carrier sensing is done by sending MPDU
duration information in the header of RTS/CTS and data frames
Channel is busy if either mechanisms indicate it to be Duration field indicates the amount of time (in
microseconds) required to complete frame transmission Stations in the BSS use the information in the duration
field to adjust their network allocation vector (NAV)
97
802.11 - Collision Avoidance If medium is not free during DIFS time.. Go into Collision Avoidance: Once channel
becomes idle, wait for DIFS time plus a randomly chosen backoff time before attempting to transmit
98
802.11 - Collision Avoidance
For DCF the backoff is chosen as follows: When first transmitting a packet, choose a backoff interval in
the range [0,cw]; cw is contention window, nominally 31 Count down the backoff interval when medium is idle Count-down is suspended if medium becomes busy When backoff interval reaches 0, transmit RTS If collision, then double the cw up to a maximum of 1024
Time spent counting down backoff intervals is part of MAC overhead
99
Example - backoff
data
waitB1 = 5
B2 = 15
B1 = 25
B2 = 20
data
wait
B1 and B2 are backoff intervalsat nodes 1 and 2
cw = 31
B2 = 10
100
802.11 - Priorities
defined through different inter frame spaces – mandatory idle time intervals between the transmission of frames
SIFS (Short Inter Frame Spacing) highest priority, for ACK, CTS, polling response SIFSTime and SlotTime are fixed per PHY layer (10 s
and 20 s respectively in DSSS) PIFS (PCF IFS)
medium priority, for time-bounded service using PCF PIFSTime = SIFSTime + SlotTime
DIFS (DCF IFS) lowest priority, for asynchronous data service DCF-IFS: DIFSTime = SIFSTime + 2xSlotTime
101
802.11 - Congestion Control
Contention window (cw) in DCF: Congestion control achieved by dynamically choosing cw
large cw leads to larger backoff intervals small cw leads to larger number of collisions
Binary Exponential Backoff in DCF: When a node fails to receive CTS in response to its
RTS, it increases the contention window cw is doubled (up to a bound cwmax =1023)
Upon successful completion data transfer, restore cw to cwmin=31