660 likes | 681 Views
Wireless Media Access Control (MAC). Multiple Access Problem. Consider a conference … If one person speaks, all can hear If more than one person speaks at the same time, voices are garbled ( 曲解 ) How should participants coordinate actions so that
E N D
Multiple Access Problem • Consider a conference… • If one person speaks, all can hear • If more than one person speaks atthe same time, voices are garbled (曲解) • How should participants coordinate actions so that • The number of messages exchanged per second is maximized, and/or • Time spent waiting for a chance to speak is minimized
3 2 4 1 Shared Multiple Access Medium 5 M Multiple Access Problem • Broadcast transmission medium • Message from any transmitter is received by all receivers • Colliding messages are garbled (曲解、竄改、斷章取義) • Goal • Maximize message throughput • Minimize mean waiting time
Some Simple Solutions • Use a moderator • A speaker must wait for moderator to call on him, even if no one else wants to speak • What if the moderator’s connection breaks? • Distributed solution • Speak if no one else is speaking • But if two speakers are waiting for a third to finish, guarantee collision • Designing good schemes is hard!
Solving the Problem • Choose a base technology • To isolate traffic from different stations • Can be in time domain or in frequency domain • Choose how to allocate a limited number of transmission resources to a larger set of contending users
Design Choices • Centralized vs. distributed design • Is there a moderator or not? • In a centralized solution, one of the stations is a master and the others are slaves • In a distributed solution, all stations are peers • Circuit-mode vs. packet-mode • Do stations send steady streams or bursts of packets? • With streams, it does not make sense to contend for every packet • With packets, it makes sense to contend for every packet to avoid wasting bandwidth
Constraint: Spectrum Scarcity • Radio spectrum is hard to come by • Only a few frequencies available for long-distance communication • Multiple access schemes must be careful not to waste bandwidth
Constraint: Radio Link Properties • Radio links are error prone • Fading • Multipath interference • Hidden terminals • Transmitter heard only by a subset of receivers • Capture effect • On collision, station with higher power overpowers the other • Lower powered station may never get a chance to be heard 請google何謂“near-far problem”?
Parameter ‘a’ • The number of packets sent by a source before the farthest station receives the first bit 留意:transmission time與propagation delay的差異
Impact of ‘a’ on Collision Recovery Schemes • ‘a’ determines what happens when two senders transmit simultaneously • With small ‘a’, packets collide and senders can know soon by listening to the medium • With large ‘a’, collisiontakes longer time after packet is transmitted [Only sensing medium is not sufficient to recoverfrom collision. [More protocol structure is required.
Performance Metric: Normalized Throughput • Goodput (實際資料吞吐量,不含重傳) • Fraction of link capacity used to carry non-retransmitted packets • Success rate • Example • With no collisions, 1000 packets/sec • With a particular scheme and workload, 250 packets/sec • goodput = 0.25 (Realistic multiple access schemes → 0.1 to 0.9)
Performance Metrics: Stability • With heavy load, is all the time spent on resolving contentions? • If yes unstable • With a stable algorithm, throughput does not decrease with offered load • 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
Performance Metrics: Mean Delay and Fairness • Mean delay • Amount of time a station has to wait before it successfully transmits a packet • Depends on the load and the characteristics of the medium • Fairness • No single definition • ‘No-starvation’: source eventually gets a chance to send
Base Technologies • Isolates data from different sources • Three basic choices • Frequency division multiple access (FDMA) • Time division multiple access (TDMA) • Code division multiple access (CDMA)
FDMA • Simplest • Best suited for analog links • Each station has its own frequency band, separated by guard bands • Receivers tune to the right frequency • Number of frequencies is limited • Reduce transmitter power; reuse frequencies in non-adjacent cells • Example: voice channel = 30 KHz • 833 channels in 25 MHz band • With hexagonal cells, partition into 118 channels each • But with N cells in a city, can get 118N calls → win if N > 7
TDMA • All stations transmit data on same frequency, but at different times • Needs time synchronization • Pros (正方) • Users can be given different amounts of bandwidth • Mobiles can use idle time to determine best base station • Can switch off power when not transmitting • Cons(反方) • Synchronization overhead • Greater problems with multipath interference on wireless links
CDMA • Frequency hopping • Users separated both by time and frequency • Send at a different frequency at each time slot • Or, convert a single bit to a code (direct sequence) • Receiver can decipher bit by inverse process
CDMA • Pros (正面) • Hard to spy • Immune from narrowband noise • No need for all stations to synchronize • No hard limit on capacity of a cell • All cells can use all frequencies • Cons(反面) • Implementation complexity • Need for power control (to avoid capture effect) • Need for a large contiguous frequency band (for direct sequence)
FDD and TDD • Two ways of converting a wireless medium to a duplex channel • In Frequency Division Duplex, uplink and downlink use different frequencies • In Time Division Duplex, uplink and downlink use different time slots • Can combine with FDMA/TDMA • Examples • TDD/FDMA in second-generation cordless phones • FDD/TDMA/FDMA in digital cellular phones
Centralized Access Schemes • One station is master, and the others are slaves • Slave can transmit only when the master allows • Fit in some situations • Wireless LAN, where a base station is the only station that can see everyone • Cellular telephony, where a base station is the only one capable of high transmit power
Centralized Access Schemes • 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
Centralized Circuit-Mode Access Schemes • When a station wants to transmit, it sends a message to the master using packet mode • Master allocates transmission resources to slaves • Slave uses the resources until it is done • No contention during data transfer • Used primarily in cellular phone systems • EAMPS: FDMA • GSM/IS-54: TDMA • IS-95: CDMA • …
Centralized Packet-Mode Access: Polling (輪詢) • 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
0 1 Centralized Packet-Mode Access: Probing (探測) 0 1 0 1 0 1 • 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 BS polls 01* 0** 00* collide collide Station replies 000 001 Station transmits (assumed addresses: 000-111)
註:Binary Search Tree Traversal • 在此採“前序”(pre-order traversal)方式 • 或以編碼來看,依數字小者到數字大者(0002→0012→0102→0112→…→1112)為檢視順序
Centralized Packet-Mode Access: Reservation-Based Schemes • 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 • Master computes a transmission schedule and announces the schedule to the slaves • Packet collisions are only for minislots, so overhead on contention is reduced minislots data slots data slots data slots data slots data slots schedule Reservation requests reserved
目標:考慮優先等級、增加即時資料的吞吐量,讓多扇區的天線同時工作,但盡量減少碰撞,多個工作站可同時傳輸封包目標:考慮優先等級、增加即時資料的吞吐量,讓多扇區的天線同時工作,但盡量減少碰撞,多個工作站可同時傳輸封包 • M sectorized Nmulti-beam antennasystem(例:M = 3, N = 12) • 相容於WiFi網路的運作機制,於contention-free period提出新作法 • 以輪詢(點名)的方式讓工作站發送資料
PrioritizationProcedure優先順序化程序 AID:association identitySIFS: short interframe space PIFS: priority interframe space (= SIFS + slot time)PE: priority enquiry PR: priority response A(Si):set of stations in sector Siresponding to the enquiry 由「免競爭週期」開頭之beacon(信標)播送後開始,基站每一區的天線以問答的方式獲知所負責的區域中有哪些優先權的工作站。從優先權高者詢問,符合的工作站將回應,基站將把單一回應的工作站加入輪詢名單,紀錄(AID, beam_location)形式,此例紀錄(1010,b10)。一旦發生碰撞,立即進入「排解碰撞程序」(Collision Resolution Period)
Collision Resolution排解碰撞程序 RE:registration enquiry; RR: registration response 第一輪,(0110,b1)與(0100,b7)加入輪詢名單;第二輪,僅第1區發生碰撞,該區分為兩半,各區配置的波束改變。之後依新的配置發出RE,符合的工作站以RR回應;第三輪無人回應;第四輪,(1011,b5)與(0111,b7)加入輪詢名單
Polling Period輪詢程序 基站廣播輪詢名單PL(polling list)封包,被允入的工作站保持清醒,未被允入的工作站則可休眠;此例第一輪點名讓工作站6、7、10同時發送封包;第二輪點名讓工作站9、11、8同時發送封包。完成發送的工作站可進入休眠模式以節電。留意sector的組態在過程中的調整
Distributed Schemes • Compared with a centralized scheme • More reliable • Lower message delays • Often allow higher network utilization • But more complicated • Almost all distributed schemes are packet mode • Decentralized polling • Like centralized polling, except there is no master • Each station is assigned a slot that it uses • If nothing to send, slot is wasted • All stations must share a time base
Decentralized Probing 0 1 0 1 0 1 0 1 • Also called tree based multiple access • Without a master (BS) • Works poorly with many active stations, or when all active stations are in the same subtree All 0** stations transmit packets All 00* stations transmit packets station 000 transmits packet station 001 transmits packet All 01* stations transmit packets (assumed addresses: 000-111) collide collide
Carrier Sense Multiple Access (CSMA) • A fundamental advance: check whether the medium is active before sending a packet (i.e. carrier sensing) • “Listen before talk” • Unlike polling/probing, a node with something to send does not have to wait for a master or for its turn in a schedule • If medium idle, then send • If collision happens, detect and resolve • Works when ‘a’ is small
Simplest CSMA Scheme • Send a packet as soon as medium becomes idle • On sensing busy • Wait for idle →persistent • Set a timer and try later →non-persistent Problem with persistent: two stations waiting to speak will collide
Reducing Collision Probability: p-Persistent CSMA • Applies to slotted channels • A waiting station does not launch a packet immediately when the channel becomes idle • p: probability of sending a packet when the medium becomes idle • First toss a coin, and send a packet only if the coin comes up heads • If the coin comes up tails, the station waits for some time (defers until the next slot), then repeats the process • Hard to choose p • if p small, then waste time • if p large, more collisions Best p depends on the number of contending nodes
Handling the Collision Problem: Exponential Backoff • Each station, after transmitting a packet, checks whether the packet transmission is successful • On collision, choose timeout randomly from doubled range • Backoff range adapts to number of contending stations • No need to choose p • Need to detect collisions: Ethernet內建“碰撞偵測電路” (collision detect circuit) → CSMA/CD (collision detection) • 但WiFi網路則採不同機制
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 the sender in Ethernet • Half-duplex radios cannot detect collision at the sender Wireless LAN Ethernet LAN B A B C C A
CSMA/CA (Collision Avoidance) • Used in wireless LANs (譬如WiFi網路) • Cannot detect collision because transmitter overwhelms colocated receiver • Need explicit acks (acknowledgments) • This makes collisions more expensive • Should reduce the number of collisions
CSMA/CA Algorithm • First check if the medium is busy • If so, wait for the medium to become idle • Wait for interframe spacing • Set a contention timer to an interval randomly chosen in the range [0, CW] • On timeout, send packet and wait for ack • If no ack, assume packet loss • Double CW, then repeat the above steps to retransmit • If another station transmits while counting down, freeze until packet completes transmission
CSMA/CA Algorithm: Backoff Procedure (Source: IEEE Std 802.11-2007, pp. 261—262. 取自2007年版IEEE802.11規格)
Example: Sending a Frame with CSMA/CA Station A is the first to send a frame. While A is sending, stations B and C become ready to send. They see that the channel is busy and wait for it to become idle. Shortly after A receives an acknowledgement, the channel goes idle. However, rather than sending a frame right away and colliding, B and C both perform a backoff. C picks a short backoff, and thus sends first. B pauses its countdown while it senses that C is using the channel, and resumes after C has received an acknowledgement. B soon completes its backoff and sends its frame.
Hidden terminal Some stations in an area cannot hear transmissions from others, though base can hear both Exposed terminal Some (but not all) stations can hear transmissions from stations not in the local area Hidden Terminal vs. Exposed Terminal Problems A collide B C A D B C deferred transmission
Dealing with Hidden and Exposed Terminals • CSMA/CA works when every station can receive transmissions from every other station? • Not always true • CSMA/CA does not work in two cases: • With hidden terminal, collision because carrier not detected • With exposed terminal, idle station because carrier is incorrectly detected
Busy Tone Multiple Access (BTMA) • Uses a separate “busy-tone” channel • When station is receiving a message, it places a tone on this channel • Everyone who wants to talk to a station knows that it is busy • Even if they cannot hear transmission that that station hears • Problems • BTMA requires splitting frequency band • More complex receivers (need two tuners) • Separate bands may have different propagation characteristics • 解方: Use a single frequency band, but use explicit messages to tell others that receiver is busy
RTS CTS Multiple Access Collision Avoidance (MACA) 此為WiFi解決hidden node problem的作法 • In MACA, before sending data, send a Request_to_ Send (RTS) to intended receiver • Receiving station, if idle, sends Clear_to_Send (CTS) • Sender then sends data • If station overhears RTS, it waits long enough for a CTS to be sent by a receiver • If a station hears CTS, it waits long enough for the data packet to be transmitted Area cleared by RTS Area cleared by CTS
ALOHA and Its Variants 此為LoRa的多重存取機制 • ALOHA is one of the earliest multiple access schemes • Stations transmit whenever they have data to send • Detect collision or wait for an ack • If no acknowledgment (or collision), try again after a random waiting time • If there is a collision, all nodes have to re-transmit packets • No exponential backoff