Download Medium Access Control in Computer Networks: MAC Types, Channel Allocation, and Performance and more Study notes Computer Science in PDF only on Docsity!
Medium Access Control
CSC 343· 643 WAKE FORESTU N I V E R S I T Y Department of Computer Science Fall 2008
Internet Protocols CSC 343· 643 Medium Access Control 1
Local Area Networks
- Previously we have primarily discussed point-to-point connections
- Connecting two stations together
- Now consider connecting multiple stations together
- Local Area Networks (LAN) have a broadcast characteristic
- Each station connected to a medium shared by others
- Transmission of one station is received by all others
- Routing is not required What does this mean?
- Given multiple local stations, how are they connected?
LAN Topologies
interface^ Ring Station
Unidirectionalring
ring LAN bus LAN
shared medium
Station
- Ring
- Unidirectional, receive on one link and transmit on the other Is this routing?
- Bus
- Stations tap into shared medium How are stations typically connected?
- Topology will impact the Medium Access Control (MAC)
E. W. Fulp Fall 2008
Internet Protocols CSC 343· 643 Medium Access Control 3
Medium Access Control
A LAN consists of multiple stations sharing a medium
- Method to control access → Medium Access Control (MAC)
Transmission medium
Medium-dependent sublayer
Convergence sublayer
MAC sublayer
LLC sublayer
Network layer
Physical layer
Link layer
- Technically MAC is a sublayer (bottom of the data-link layer)
MAC Types
Three general types: contention, round-robin, and reservation
- Contention - No permission to send
- pure ALOHA, slotted ALOHA, CSMA, CSMA/CD
- Bus topology (and wireless)
- Round robin - Send when you have permission
- Token passing or polling
- Ring or bus topology
- Reservation - Request before sending
- Similar to TDM
- Dynamic, must request slot before sending
- Ring or bus topology Is control centralized or distributed in the above?
E. W. Fulp Fall 2008
Internet Protocols CSC 343· 643 Medium Access Control 7
Pure ALOHA
Protocol developed at the University of Hawaii (1970’s)
- Simple protocol: Send when you have data to send
- Collisions may occur
- Two frames transmitted at (or during) the same time
- Signal garbled, data is lost
- Even just a single bit overlap...
- Since broadcast, sender can always tell if collision occurred
- Listen during transmissiona
- If collision, wait a random time and try again Why random?
a (^) Actually wireless networks may not do this
Performance of Pure ALOHA
- Assume a fixed frame size (constant transmission time)
- Users generate new frames according to a Poisson distribution with mean n frames per frame-time - If n > 1 more frames generated than channel can handle - For reasonable performance, assume 0 < n < 1
- Assume the probability of k transmission attempts during a frame-time is also Poisson, with mean g per frame-time We will consider the case where g ≥ n, why?
- Under any load the throughput is s = p 0 · g where p 0 is the probability that a frame does not suffer a collision
E. W. Fulp Fall 2008
Internet Protocols CSC 343· 643 Medium Access Control 9
- Assume you are sending the gray frame, let t be the time to send
Collides withthe start of the shadedframe
Collides withthe end of t the shadedframe
to t (^) o+ t t (^) o+ 2t t (^) o+ 3t Vulnerable Time
- When would another frame collide with the gray frame?
- The vulnerable period is between t 0 and t 0 + 2t Why is the collision at the beginning a possibility?
Slotted ALOHA
An improvement of ALOHA, where time is divided into slots
- Time divided into discrete slots (equal to one frame)
- Requires users to agree on slot boundaries (not trivial)
- Continuous protocol is now discrete
- Simple protocol: Send when you have data, must wait until beginning of next slot
- Vulnerable period is halved Why is the vulnerable period halved?
- As a result throughput is
s = g · e−g
E. W. Fulp Fall 2008
Internet Protocols CSC 343· 643 Medium Access Control 13
(^00) 0.5 1 1.5 2 2.5 3
0.4 ALOHA Systems
attempts per frame-time
throughput
Pure ALOHASlotted ALOHA
- Highest possible throughput 36.8% occurs when g = 1
- Therefore, the best performance is when 37% slots are empty, 37% are successes, and 26% are collisions
Carrier Sense Multiple Access Protocols
- ALOHA systems were precursors to CSMA
- All are contention-based access protocols Slotted ALOHA improved pure ALOHA by...
- CSMA increases performance by
- Listening to the carrier before sending (as the name implies)
- Does assume tprop << ttrans
- Three different CSMA types
- 1-persistent
- non-persistent
- p-persistent
- CSMA types differ on when they access an idle channel
E. W. Fulp Fall 2008
Internet Protocols CSC 343· 643 Medium Access Control 15
CSMA Variations
1-persistent, listen to medium before sending
- If idle transmit, otherwise go to step 2
- If busy, continue to listen until channel idle, then transmit immediately
non-persistent, listen to medium before sending
- If idle then transmit immediately, otherwise go to step 2
- If busy then wait random amount of time, then go to step 1
p-persistent, listen to medium before sending
- If idle transmit with probability p, otherwise go to step 2
- If busy then wait until channel idle, then go to step 1
- Consider the worst case
- Let the propagation time between the two farthest stations (A and B) be tprop
- At time t 0 station A transmits
- At time t 0 + tprop − station B transmits
- Station B detect the collision immediately
- Station A detects at time t 0 + tprop − + tprop ≡ t 0 + 2tprop
A Packet startsat time 0 B A Packet almostat B at τ - ∋ B
Collision attime τ
A B
Noise burst gets A back to A at 2τ B
(a) (b)
(c) (d)
E. W. Fulp Fall 2008
Internet Protocols CSC 343· 643 Medium Access Control 19
- Therefore a station cannot be certain it has seized the medium until 2 tprop has passed
- As a result CSMA/CD systems require frames to be long enough to allow collision detection prior to end of transmission - Collision detection can only occur during transmission
p-Persistent and CSMA/CD Performance
- Consider 20 stations using p-persistent or CSMA/CD
- Assume the p value is set to the optimal value
- The average utilization per station for different MAC’s
(^00 2 4 6 8 )
0.030.
0.080.
time
utilization
Ethernet
(^00 2 4 6 8 )
0.030.
0.080.
time
utilization
p-Persistent
What is the difference between CSMA/CD and p-persistent? Disadvantage of optimal p-persistent?
E. W. Fulp Fall 2008
Internet Protocols CSC 343· 643 Medium Access Control 21
Dynamic p-Persistent
- Set the value of p based on the number of stations
- A collision is a good indicator [Kester & Fulp 04]
- Let nw be the number of collisions during time w, then p = (^2) ·^1 nw
(^00 2 4 6 8 )
0.040.
0.090.
time
utilization
p-Persistent
(^00 2 4 6 8 )
0.040.
0.090.
time
utilization
Dynamic p-Persistent
What are the advantages of dynamic p-persistent
CSMA/CD and Token Passing Performance
- Want to compare utilization contention and token passing
u = throughput data rate
- Define the following variables r data rate of channel d maximum distance between any two stations v velocity of signal propagation l frame length (fixed)
- Throughput is number of bits transmitted per unit time
throughput = (^) d l v +^ rl
E. W. Fulp Fall 2008
Internet Protocols CSC 343· 643 Medium Access Control 25
- Using the definition of a
a = (^) ttprop f rame
= d/v l/r = r l ·· vd
rewrite the utilization equation (using the throughput equation) as
u = (^) 1 +^1 a
- Therefore utilization will depend on a (propagation delay and frame transmission time)
Token Passing
- Assume a LAN with n stations, with maximum normalized propagation delay of a
- Furthermore, assume each station is always prepared to send
- Time on the ring will alternate between data transmission and token passing - Refer to a single instance of a data frame followed by a token as a cycle Define the following variables c average time for cycle tdata average time to transmit data frame ttoken average time to transmit token
E. W. Fulp Fall 2008
Internet Protocols CSC 343· 643 Medium Access Control 27
- The average cycle rate is (^1) c = (^) tdata+^1 ttoken , therefore
u = (^) t tdata data +^ ttoken
a > 1 t0^ t0 + 1^ t0 + a^ t0 +1 + a
a < 1 t0^ t0 + a^ t0 + 1^ t0 + 1 + a
100 -1^100
1 Token Passing
a
throughput
n=1n= n=
E. W. Fulp Fall 2008
Internet Protocols CSC 343· 643 Medium Access Control 31
CSMA/CD Performance
- Assume time is divided into slots, where a slot is twice the propagation delay (max time to detect a collision)
- Assume n stations, where each station transmits with probability p for every slot Contentionslots
Transmissioninterval Contentioninterval intervalIdle
t (^) o
Frame Frame Frame Frame
Time
- There are two types of intervals to consider
- Transmission, duration is (^21) a slots
- Contention
- To compute contention interval, must determine the probability q that one station seizes the medium
q =
⎝ n 1
⎠ (^) p(1 − p)n−^1 = n · p(1 − p)n−^1
where p is the probability a station transmits during a slot Maximum occurs when p = (^) n^1
q =
1 − (^) n^1
)n− 1
- The mean length of the contention interval w is
E[w] =
∑^ ∞
i=
i · p{i slots in a row with collision followed by one success}
∑^ ∞
i=
i · q(1 − q)i^ =
1 − q q
E. W. Fulp Fall 2008
Internet Protocols CSC 343· 643 Medium Access Control 33
- CSMA/CD utilization is determined using the length of the transmission interval and the cycle
u = 21 a 1 2 a +^
1 −q q
1 + 2a 1 − qq
100 -1^100
0.8 CSMA/CD
a
throughput
n=5n= n=
Wireless Station Problems
Assume in the following two diagrams, a station’s range is one hop
station A transmitting
Radio range
A B C D
- Hidden station problem using CSMA
- Assume station A is transmitting to B
- If C senses the medium, it will not hear A
- If C then transmits it will interfere with B
- Frame transmitted by A is lost, but A would never sense it...
E. W. Fulp Fall 2008
Internet Protocols CSC 343· 643 Medium Access Control 37
station B transmitting
Radio range
A B C D
- Exposed station problem using CSMA
- Assume station B is transmitting to A
- If C senses the medium and concludes it cannot send to D
- However, it could send to D without interfering with A How is this possible?
- Therefore, before transmitting a station needs to know the activity around the receiver
MACA
Multiple Access with Collision Avoidance (MACA) is a wireless MAC
- Assume station A wishes to send to station B
- A starts with a Request To Send (RTS) message
- B replies with a Clear To Send (CTS) message
- If A receives a CTS from B, then it transmits the data
- Neighboring stations react as follows
- Stations hearing the RTS wait long enough for the CTS
- Stations hearing the CTS wait long enough for the data What is long enough?
Does this solve the hidden and exposed station problems?
E. W. Fulp Fall 2008
Internet Protocols CSC 343· 643 Medium Access Control 39
A sending an RTS to B B responding with CTS to A
Range of B'stransmitter
Range of A's transmitter
A RTS
E
C B D A CTS
E
C B D
- Consider station C, within range of A but not B
- C hears the RTS from A but not the CTS from B
- C can transmit while the data is transmitted
- Consider station D, within range of B but not A
- D does not hear the RTS from A, but hears the CTS from B
- D waits to transmit after the data is sent Can collisions still occur?