410 likes | 690 Views
Ch 12. Multiple Access. Multiple Access for Shared Link. Dedicated link Point-to-point connection is sufficient Shared link Link is not dedicated – Wireless medium, Ethernet Controlling the access to the medium Who will use the medium? . Taxonomy of Multiple Access. 12.1 Random Access.
E N D
Multiple Access for Shared Link • Dedicated link • Point-to-point connection is sufficient • Shared link • Link is not dedicated – Wireless medium, Ethernet • Controlling the access to the medium • Who will use the medium?
12.1 Random Access • Random access (or contention) • No station is superior to another station (no centralized authority) • No scheduled time for transmission – transmission is random • No rules specify which station would send next – stations compete with each other (contention)
Station 2 Xmits t Station 1 decides to Xmit Collision occurs Pure (Original) ALOHA • Earliest random access, developed at the University of Hawaii in early 1970s • Basic procedure • If a station has a frame to send, then it sends a frame immediately (hoping that none transmits simultaneously) • Then, check whether the transmission is successful (by receiving an ACK) • Collision: two or more users’ transmissions overlap resulting in packet loss
Example of Four Stations • Only two frames (1.1 and 3.2) are successful
Reliable Transmission • Retransmission • The sender checks whether a transmission is successful by receiving an ACK from the receiver • If unsuccessful, the sender retransmits the frame • Binary Exponential Back-off • Before retransmission, wait for random amount of time • If it is the first retransmission, random within [0,T], where T is a time unit (often, max round-trip propagation delay) • If it is the second retransmission, random within [0, 2T] • If it is the third retransmission, random within [0, 4T] • … • If it is the k-th retransmission, random within [0, 2kT]
Example 12.1 • The stations on a wireless ALOHA network are a maximum 600km apart. If we assume that signals propagate at 3x108 m/s, we find T = (600x103)/(3x108) = 2ms. Now we can find the value of backoff time TB for different Ks. • For K = 1, TB = 0 or 2ms • For K = 2, TB = 0, 2, 4, or 6ms • For K = 3, TB = 0, 2, 4, 6, 8, 10, 12, or 14ms • In many cases, there are maximum K. For example, if K > 10, the range is set to [0, …, 210-1] TB
Vulnerable Time • Vulnerable time is a time interval, in which there is a possibility of collision Assume that all stations send fixed-length frames
N stations Each station transmits λ (new) packets/ sec Arrival from each station is Poisson Fixed Packet lengths Time to transmit a packet m=Tfr Throughput Analysis : Pure Aloha
Throughput Analysis : Pure Aloha • Due to collisions : Total rate of packets attempting transmission = λ′ λ′ > λ • G = Actual traffic intensity or utilization G = N λ′m
Throughput Analysis : Pure Aloha • Any transmissions by any station between times t-m and t+m will cause a collision Pr {Successful transmission} = Pr {No arrivals occur in time [t-m, t+m] | An arrival occurs at time t} = Pr {No arrivals occurring in time (t-m,t+m)} = Pr {No arrivals occur in time 2m} = e-N λ′ (2m) • Hence, Ps = Pr {Successful transmission} = e-2G(Because G = N λ′m) vulnerable time
Throughput Analysis : Pure Aloha • S = G e-2G : Pure Aloha throughput equation dS/dG = e-2G - 2G e-2G At the peak of S, e-2G(1 - 2G) = 0 G* = 1 / 2 = 0.5 Smax = 0.5e-1 = 1 / (2e) Smax ≈ 0.18 • For Pure ALOHA the max. throughput is 18% of channel capacity. Suitable for highly bursty traffic (computer traffic)
Ge-G S 0.184 Smax Ge-2G G* G Throughput Analysis : Pure Aloha
Slotted ALOHA • Time-slotted system • Slotted ALOHA: stations must send a frame only at the beginning of the time slot
Vulnerable Time of Slotted ALOHA • Improves the efficiency • Vulnerable time is Tfr(Recall that pure ALOHA has vulnerable time of 2Tfr) • When a data arrives, it waits until the next slot
Pr {Success} = e-G Similar to pure Aloha: S = G e-G , dS/dG = 0G* = 1 Smax = 1/e ≈ 0.36 Slotted Aloha improves throughput by a factor of 2!!! However, maintaining slots consistently in a distributed system is difficult Throughput Analysis: Slotted Aloha
Throughput Analysis: Slotted Aloha 0.368 Smax Ge-G S 0.184 Ge-2G G* G
Simulating Slotted-ALOHA Network • nonAttempt = 0; collision = 0 • for i=0 to 9 do • throughput(i) = 0 • variable p(i) is given within [0, 1] • for t=1 to 1000 do /* simulate for 1000 time slots */ • for i=0 to 9 do /* simulate with 10 stations */ • X(i) = 0 • for i=0 to 9 do • X(i) = 1 with probability p(i) /* station i transmits at this time slot */ • Y = X(0) + X(1) + … + X(9) • case Y • == 0: nonAttempt = nonAttempt + 1 • == 1: throughput(i) = throughput(i) + 1 • >= 2: collision = collision + 1 • endfor • print nonAttempt, collision, throughput(0), throughput(1),…, throughput(9)
Carrier Sense Multiple Access (CSMA) • Intended to reduce collision • A station senses the medium before trying to use it (i.e., listen to the medium before sending) • If a station finds that there is an ongoing transmission in the medium, it should not send
Collision under CSMA • CSMA can reduce collision, but cannot eliminate B C
Vulnerable Time of CSMA • Vulnerable time = propagation time Tp
Persistence: CSMA High chance of collision • 1-persistent • If the medium is busy, sense continuously • If the medium is idle, send a frame • non-persistent • If busy, wait for a random amount of time • If idle, send a frame • p-persistent • If busy, sense continuously • If idle, send a frame with prob. p, and wait for a time slot with prob. 1-p Low efficiency
CSMA/CD • CSMA with Collision Detection • Station monitors the medium after it sends a frame • If it detects a collision, it stops transmitting immediately • Before sending the last bit of the frame, the sending station must detect the collision restriction on the frame size
CSMA/CA • CSMA with Collision Avoidance • Signal attenuation makes it hard to detect a collision (usual in wireless environments) • Inter-Frame Space (IFS): a station defers transmission for an IFS time, even if the channel is found idle • Contention windows: a station randomly picks a time slot of contention window as its wait time • Acknowledgement: data still can be corrupted
Cautions in CSMA/CA • IFS can be used to prioritize stations: stations with a higher priority will have a shorter IFS • Fairness: when a station finds that the channel is busy while it waits in the contention window, it freezes the timer, which will restart when the channel becomes idle
12.2 Controlled Access • Reservation access • A station needs to make a reservation before sending data time
Controlled Access (2) • Polling • Primary station (central entity) manages other secondary stations • Select: check whether the primary station can send a frame to a secondary station • Poll: check whether a secondary station has a frame to send to the primary station
Controlled Access (3) • Token passing • Stations in a network are organized in a logical ring • A special packet called token (there is only one token in the network) is circulated in the network • A station should wait for the token before sending data • The station who holds the token can send data • Once the station finishes its transmission, it passes the token to the next station • Token management: the token has to be monitored to ensure that it has not been lost or destroyed
12.3 Channelization • Frequency Division Multiple Access (FDMA)
Channelization (2) • Time Division Multiple Access (TDMA)
Channelization (3) • Code Division Multiple Access (CDMA)
Chip sequence of CDMA • Orthogonal sequences: ci * cj = 0 if i ≠ j • Each station j has its sequence cj, and sends cj for to send 1 or –cj for to send 0
CDMA (Cont) • Decoding for Station 2’s receiver in CDMA
CDMA (Cont) • At sender • di = 0 or 1 • At receiver of Station 3: • Result = c3 * (d1* c1 + d2 * c2 + d3 * c3 + d4 * c4) = 0 + 0 + d3 * (c3 * c3) + 0
Homework • Exercise in Chap. 12 • 11, 12, 13, 14, 15, 23 • Additional problem • Simulate Slotted-ALOHA networks (see Slide 22) • 1) Draw nonAttemptwhen p(i) = p for all i, changing p = 0.04, 0.06, 0.08, 0.1, 0.12, 0.14, 0.16, 0.18, 0.2 • 2) Repeat 1) with collision • 3) Repeat 1) with ithroughput(i) • 4) Obtain throughput(i)’s when p(i) = 0.02 x i, AND compare with the results when p(i) = 0.1 for all i