Download presentation
Presentation is loading. Please wait.
Published byDarren Short Modified over 9 years ago
1
Link Layer: Partitioning Dimensions; Media Access Control using Aloha Y. Richard Yang 11/01/2012
2
2 Outline r Admin. and recap r Intro to link layer r Media access control m ALOHA protocol
3
Admin. r Assignment 3 m Due date: coming Monday m Check web site for office hours and FAQs r Project proposal (due Friday) m Please send email to cs434ta@cs.yale.edu by end of daycs434ta@cs.yale.edu m Subject: Project Proposal m Content: Team members: Topic: One paragraph rough idea: r Exam: next Tuesday in class 3
4
4 Recap r App layer m Handles issues such as UI m Uses lower-layer provided abstractions, e.g., network abstraction –e.g., HttpURLConnection in GoogleSearch Example location service abstraction –e.g., Location Manager, and Location Listener in Assignment 3 r Physical layer capability m sender sends a seq. of bits to a receiver
5
App Layer: Logical Communications 5 E.g.: application r provide services to users r application protocol: m send messages to peer
6
6 Physical Communication application transport network link physical application transport network link physical application transport network link physical application transport network link physical network link physical data
7
7 Protocol Layering and Meta Data Each layer takes data from above r adds header (meta) information to create new data unit r passes new data unit to layer below
8
8 Link layer: Context r Data-link layer has responsibility of transferring datagram from one node to another node r Datagram may be transferred by different link protocols over different links, e.g., m Ethernet on first link, m frame relay on intermediate links m 802.11 on last link transportation analogy r trip from New Haven to San Francisco m taxi: home to union station m train: union station to JFK m plane: JFK to San Francisco airport m shuttle: airport to hotel
9
9 Main Link Layer Services Framing o encapsulate datagram into frame, adding header, trailer and error detection/correction Multiplexing/demultiplexing o use frame headers to identify src, hop dest Media access control Reliable delivery between adjacent nodes o seldom used on low bit error link (fiber, some twisted pair) o common for wireless links: high error rates
10
10 Link Adaptors r link layer typically implemented in “adaptor” (aka NIC) m Ethernet card, modem, 802.11 card r adapter is semi- autonomous, implementing link & physical layers r sending side: m encapsulates datagram in a frame m adds error checking bits, rdt, flow control, etc. r receiving side m looks for errors, rdt, flow control, etc m extracts datagram, passes to receiving node sending node frame receiving node datagram frame adapter link layer protocol
11
11 Outline r Recap r Introduction to link layer r Wireless link access control
12
12 Wireless Access Problem r Single shared broadcast channel m thus, if two or more simultaneous transmissions by nodes, due to interference, only one node can send successfully at a time
13
13 Wireless Access Problem r The general case is challenging and largely still open r We start with the simplest scenario (e.g., 802.11 or cellular up links) in this class: m a single receiver (the Access Point)
14
14 Multiple Access Control Protocol r Protocol that determines how nodes share channel, i.e., determines when nodes can transmit r Communication about channel sharing must use channel itself ! r Discussion: properties of an ideal multiple access protocol.
15
15 Ideal Mulitple Access Protocol Efficient Fair/rate allocation Simple
16
16 MAC Protocols: a Taxonomy Goals r efficient, fair, simple Three broad classes: r channel partitioning m divide channel into smaller “pieces” (time slot, frequency, code) r non-partitioning m random access allow collisions m “taking-turns” a token coordinates shared access to avoid collisions
17
17 Outline r Recap r Introduction to link layer r Wireless link access control m partitioning dimensions
18
18 FDMA FDMA: frequency division multiple access r Channel divided into frequency bands r A transmission uses a frequency band frequency bands time 5 1 4 3 2 6
19
19 TDMA TDMA: time division multiple access r Time divides into frames; frame divides into slots r A transmission uses a slot in a frame
20
20 Example: GSM r A GSM operator uses TDMA and FDMA to divide its allocated frequency m divide allocated spectrum into different physical channels; each physical channel has a frequency band of 200 kHz m partition the time of each physical channel into frames; each frame has a duration of 4.615 ms m divides each frame into 8 time slots (also called a burst) m each slot is a logical channel m user data is transmitted through a logical channel
21
21 higher GSM frame structures 935-960 MHz 124 channels (200 kHz) downlink 890-915 MHz 124 channels (200 kHz) uplink frequency time 12 3 4 5 6 78 GSM TDMA frame 4.615 ms GSM - TDMA/FDMA GSM time-slot (normal burst) 546.5 µs 577 µs tailuser dataTrainingS guard space Suser datatail guard space 3 bits57 bits26 bits 57 bits1 13 S: indicates data or control
22
22 SDMA SDMA: space division multiple access r Transmissions at different locations, if far enough, can transmit simultaneously (same freq.) m Example: the cellular technique Suppose 24 MHz spectrum, 30 K per user #user supported: = 12 34 12 34 12 34 12 34 Using cell #user supported: = Q: why not divide into infinite small cells?
23
23 CDMA CDMA (Code Division Multiple Access) r Unique “code” assigned to each user; i.e., code set partitioning r All transmissions share the same frequency and time; each transmission uses DSSS, and has its own “chipping” sequence (i.e., code) to encode data m e.g. code = -1 1 1 -1 1 -1 1 Examples: Sprint and Verizon, WCDMA
24
24 DSSS Revisited user data d(t) code c(t) resulting signal 1 11 1 1 1 111 X = tbtb tctc t b : bit period t c : chip period 11 1 11 1 1
25
25 Illustration: CDMA/DSSS Using BPSK r Assume BPSK modulation using carrier frequency f : y i (t) = A x i (t)c i (t) sin(2 ft) A: amplitude of signal f : carrier frequency x i (t): data of user i in [+1, -1] c i (t): code of i (a chipping sequence in [+1, -1]) r Suppose only i transmits y(t) = y i (t) r Decode at receiver i m incoming signal multiplied by c i (t) sin(2 ft) m since, c i (t) c i (t) = 1, y i (t)c i (t) sin(2 ft) = A x i (t) sin 2 (2 ft)
26
26 Illustration: Multiple User CDMA r Assume M users simultaneously transmit: y(t) = y 1 (t) + y 2 (t) … + y M (t) r At receiver i, incoming signal y(t) multiplied by c i (t) sin(2 ft) m consider the effect of j’s transmission y j (t)c i (t) sin(2 ft) = A c j (t)c i (t)x j (t) sin 2 (2 f c t)
27
27 CDMA: Deal with Multiple-User Interference r Two codes C i and C j are orthogonal, if m, where we use “.” to denote inner product, e.g. r If codes are orthogonal, multiple users can “coexist” and transmit simultaneously with minimal interference C 1 : 1 1 1 -1 1 -1 -1 -1 C 2 : 1 -1 1 1 1 -1 1 1 -------------------------------------------------- C 1. C 2 = 1 +(-1) + 1 + (-1) +1 + 1+ (-1)+(-1)=0 Analogy: Speak in different languages!
28
28 Capacity of CDMA r In realistic setup, cancellation of others’ transmission is incomplete r Assume the received power at base station from all nodes is the same P (how?) r The power of the transmission with known code is increased to N P, where N is chipping expansion factor r The others remain on the order of P r Assume a total of M users r Then For IS-95 CDMA, N = 1.25M/4800 = 260 B
29
29 Generating Orthogonal Codes r The most commonly used orthogonal codes in current CDMA implementation are the Walsh Codes
30
30 Walsh Codes 1 1,1 1,-1 1,1,1,1 1,1,-1,-1 X X,X X,-X 1,-1,1,-1 1,-1,-1,1 1,-1,-1,1,1,-1,-1,1 1,-1,-1,1,-1,1,1,-1 1,-1,1,-1,1,-1,1,-1 1,-1,1,-1,-1,1,-1,1 1,1,-1,-1,1,1,-1,-1 1,1,-1,-1,-1,-1,1,1 1,1,1,1,1,1,1,1 1,1,1,1,-1,-1,-1,-1 1 2 4 8 n 2n...
31
31 Orthogonal Variable Spreading Factor (OSVF) r Variable codes: Different users use different lengths spreading codes r Orthogonal: diff. users’ codes are orthogonal 1 1,1 1,-1 1,1,1,1 1,1,-1,-1 X X,X X,-X 1,-1,1,-1 1,-1,-1,1 1,-1,-1,1,1,-1,-1,1 1,-1,-1,1,-1,1,1,-1 1,-1,1,-1,1,-1,1,-1 1,-1,1,-1,-1,1,-1,1 1,1,-1,-1,1,1,-1,-1 1,1,-1,-1,-1,-1,1,1 1,1,1,1,1,1,1,1 1,1,1,1,-1,-1,-1,-1 SF=1SF=2SF=4SF=8 SF=nSF=2n... If user 1 is given code [1,1], what orthogonal codes can we give to other users?
32
32 WCDMA Orthognal Variable Spreading Factor (OSVF) r Flexible code (spreading factor) allocation m up link SF: 4 – 256 m down link SF: 4 - 512 WCDMA downlink
33
33 Summary r SDMA, TDMA, FDMA and CDMA are basic media partitioning techniques m divide media into smaller “pieces” (space, time slots, frequencies, codes) for multiple transmissions to share r A remaining question is: how does a network allocate space/time/freq/code?
34
34 Outline r Recap r Introduction to link layer r Wireless link access control m partitioning dimensions m media access protocols
35
35 GSM Logical Channels and Request r Control channels m Broadcast control channel (BCCH) from base station, announces cell identifier, synchronization m Common control channels (CCCH) paging channel (PCH): b ase transceiver station (BTS) pages a mobile host (MS) random access channel (RACH): MSs for initial access, slotted Aloha access grant channel (AGCH): BTS informs an MS its allocation m Dedicated control channels standalone dedicated control channel (SDCCH): signaling and short message between MS and an MS r Traffic channels (TCH) r call setup from an MS BTS MS RACH (request signaling channel) AGCH (assign signaling channel) SDCCH (request call setup) SDCCH (assign TCH) SDCCH message exchange Communication
36
36 Slotted Aloha [Norm Abramson] r Time is divided into equal size slots (= pkt trans. time) r Node with new arriving pkt: transmit at beginning of next slot r If collision: retransmit pkt in future slots with probability p, until successful. Success (S), Collision (C), Empty (E) slots A B
37
37 Slotted Aloha Efficiency Q: What is the fraction of successful slots? suppose n stations have packets to send suppose each transmits in a slot with probability p - prob. of succ. by a specific node: p (1-p) (n-1) - prob. of succ. by any one of the N nodes S(p) = n * Prob (only one transmits) = n p (1-p) (n-1)
38
38 Goodput vs. Offered Load Curve S = throughput = “goodput” (success rate) Define G = offered load = np 0.51.0 1.5 2.0 Slotted Aloha r when G (=p*n) < 1, as p (or n) increases m probability of empty slots reduces m probability of collision is still low, thus goodput increases r when G (=p*n) > 1, as p (or n) increases, m probability of empty slots does not reduce much, but m probability of collision increases, thus goodput decreases r goodput is optimal when G (=p*n) = 1
39
39 Maximum Efficiency vs. n 1/e = 0.37 At best: channel use for useful transmissions 37% of time!
40
40 Dynamics of (Slotted) Aloha r In reality, the number of stations backlogged is changing m we need to study the dynamics when using a fixed transmission probability p r Assume we have a total of m stations (the machines on a LAN): m n of them are currently backlogged, each tries with a (fixed) probability p m the remaining m-n stations are not backlogged. They may start to generate packets with a probability p a, where p a is much smaller than p
41
41 Model n backlogged each transmits with prob. p m-n: unbacklogged each transmits with prob. p a
42
42 Dynamics of Aloha: Effects of Fixed Probability n: number of backlogged stations 0 m successful transmission rate at offered load np + (m-n)p a new arrival rate: (m-n) p a desirable stable point undesirable stable point Lesson: if we fix p, but n varies, we may have an undesirable stable point offered load = 1 - assume a total of m stations - p a << p - success rate is the departure rate, the rate the backlog is reducing dep. and arrival rate of backlogged stations
43
Backup Slides: Error Corrections Codes 43
44
44 Reed-Solomon Codes r Very commonly used, send n symbols for k data symbols m e.g., n = 255, k = 223 r We will discuss the original version (1960) m modern versions are slightly different; they use generator polynomial, but the idea is essentially the same r If the data we want to send is (x0, x1,…, x k-1 ), where x i are data symbols, define polynomial P(t) = x 0 + x 1 t + x 2 t + …x k-1 t k-1 r Assume is a generator of the symbol field (i.e., i not equal to j if i not equal to j) r Then for the data sequence, send P(0), P( ), P( 2 ), P( n-1 ) to receiver
45
45 Reed-Solomon Codes r Receive the message P(0), P( ), P( 2 ), P( n-1 ) r If no error, can recover data from any k equations: since any k equations are independent, they have a unique solution
46
46 Reed-Solomon Codes: Handling Errors r But, what if s errors occur during transmission? r Keep a counter (vote) for each solution r Enumerate all combinations of k equations, for each combination, solve it, and increase the counter of the solution r Identify the solution which gets the largest # of “votes”
47
47 Reed-Solomon Codes r The transmitted data is the correct solution for n-s equations, and thus gets votes (i.e., combinations of k equations) r An incorrect solution can satisfy at most k-1+s equations, and the # of votes it can get is at most:
48
48 Reed-Solomon Codes r If or (n-s > k – 1 + s) or (n-k > 2s – 1) or (n-k s), it can correct any s errors
49
49 Reed-Solomon Codes r The voting-based decoding algorithm proposed in 1960 is inefficient r 1967 - Berlekamp introduced first truly efficient algorithm for both binary and nonbinary codes. Complexity increases linearly with number of errors r 1975 - Sugiyama, et al. Showed that Euclid’s algorithm can be used to decode R-S codes r Below is a typical current decoder
50
50 Pure (unslotted) Aloha r Unslotted Aloha: simpler, no clock synchronization r Whenever pkt needs transmission: m send without awaiting for the beginning of slot r Collision probability increases: m pkt sent at t 0 collide with other pkts sent in [t 0 -1, t 0 +1]
51
51 Pure Aloha (cont.) Assume a node transmit with probability p in one unit of time P(success by a given node) = P(node transmits) * P(no other node transmits in [t 0 -1,t 0 ] * P(no other node transmits in [t 0, t 0 +1] = p. (1-p) n-1. (1-p) n-1 = p. (1-p) 2(n-1) P(success by any of N nodes) = n p. (1-p) 2(n-1) - Bound: 1/(2e) =.18
52
52 Goodput vs. Offered Load S = throughput = “goodput” (success rate) G = offered load = Np 0.51.0 1.5 2.0 0.1 0.2 0.3 0.4 Pure Aloha protocol constrains effective channel throughput! Slotted Aloha
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.