Multimedia Communication Services Traffic Modeling and Streaming Medium Access Control algorithms Introduction and details on Aloha networks with infinite nodes Università degli Studi di Brescia A.A. 2014/2015 Francesco Gringoli Master of Science in Communication Technologies and Multimedia
Medium Access Control: why Multiple nodes: Dedicated or Shared transmission medium? 1. Solution everybody connected to everybody else : E.g., N nodes connected to all others N ( N -1 ) separated cables Unpractical and expensive Unfeasible!! 2. Solution everybody connected to intermediator E.g., N nodes connected to intermediator N separated cables What if cables are virtual, i.e., radio signals? What is the intermediator? Bottom line: need to arbitrate transmissions Think to a talk show: anchorman decides who speaks Arbiter can be physical entity Arbitration can be a distributed algorithm Nodes decide who will transmit next Traffic Modeling and Streaming 2
Medium Access Control: why Today: PCs connected by Ethernet switches (wired) Dedicated cables, PC-to-switch (star-like topology) No collisions but excess frames can be dropped Yesterday: PCs connected by Ethernet coax (wired) Single shared transmission medium (bus-like topology) Cheap, suited to old fashioned traffic patterns, mostly bursted Lot of issues, hard to localize, low performance 50Ω Common bus (shared) 50Ω Network interfaces Signal flow along both directions, cancelled by 50Ω terminators TODAY: SAME APPROACH IN WIRELESS NETWORKS!! Traffic Modeling and Streaming 3
MAC: approaches Final goal for a MAC algorithm Avoid collisions when multiple nodes can transmit at the same time Deterministic algos (no collisions): Time Division Multiple Access (TDMA) Frequency/Wavelength Division Multipling (FDM,WDM) Token Passing (Token Ring, Token Bus, FDDI) Non deterministic algos (with collisions): Aloha Carrier Sense Multiple Access Carrier Sense Multiple Access/Collision Detection: Ethernet, 802.3 Carrier Sense Multiple Access/Collision Avoidance: 802.11abgn Traffic Modeling and Streaming 4
MAC: non deterministic Need rules to recover after collisions (storms possible too) Aloha: simple algo, uses positive ACK to detect collisions Note: it s not a layer 4 ACK CSMA: like Aloha but checks medium is free before transmitting CSMA/CD: no ack, checks collisions during transmission Used in IEEE802.3 (Ethernet) networks CSMA/CA: like CSMA with more complex rules to avoid collisions Used in IEEE802.11 (WiFi) networks All these methods do not support high traffic patterns Time wasted during collisions + need more time to recover If traffic above a threshold: network collapse Traffic Modeling and Streaming 5
Multimedia Communication Services Traffic Modeling and Streaming Medium Access Control algorithms Aloha networks with infinite nodes Università degli Studi di Brescia A.A. 2014/2015 Francesco Gringoli Master of Science in Communication Technologies and Multimedia
AlohaNet Aloha: primitive algorithm (1971!), basis for the others Design to implement network between HawaÏ Isles Low bit-rate UHF channels, frequency f fixed Broadcast transmissions Need positive ACK ACK Transmission procedure i=1! while ( i <= maxattemps ) do!!send packet!!wait for acknowledgement or timeout!!if ack received then leave!!wait for random time!!increment i! ACK is broadcasted too: red arrow: a logic flow Blue arrows: physical flow end do! Traffic Modeling and Streaming 7
AlohaNet Don t listen the channel before and during transmission Tx&Rx at the same time was too complex to implement in 1971 When node has packet, transmit it immediately Wait for a positive ack transmitted by the receiver No ack means packet was lost Retransmit it Two versions: Slotted Aloha: time is slotted, stations are synchronized E.g., all packets have the same length Non-Slotted Aloha: no rules for packet length and timings Traffic Modeling and Streaming 8
Slotted Aloha Based on slotted time, a few hypotheses: All packets have the same length Each packet is transmitted in a time-unit Δt (slot) Transmitters are synchronized: tx t start = j Δt, t end ( j + 1 ) Δt Arrival times are poisson i.i.d. at everyone of m nodes Global arrival rate is λ, local is λ/m Collision: if two or more nodes transmit in the same slot Receivers do not understand packets and transmitters No collision: only one node transmits Note: we neglect transmission errors!! Traffic Modeling and Streaming 9
Slotted Aloha: simple analysis Retransmission strategy: a) Each node works (busy) on only one packet at time: no queuing b) Busy node said Backlogged, two cases A new (fresh) packet is waiting for transmission, occur in the next slot An old packet is waiting for retransmission after collision, occur in the next slot c) After collision a packet will be transmitted soon or later d) Nodes are infinite ( m = ); e) New packets only at idle (non busy) nodes Notes Because of d) λ/m tiny arrivals at Backlogged nodes are negligible Only few nodes are Backlogged Because of a) maximum delay is limited queue 1 slot N slot N+1 t = now Traffic Modeling and Streaming 10
Slotted Aloha: simple analysis/2 Summing up: A new (fresh) packet arrives only in a non Backlogged node This packet will be transmitted asap in the next slot, collision is possible When slot ends: node knows if packet collided or was received Collided: node turns Backlogged, waits for some (random) slots, retransmits Received: node turns idle, waits for a fresh packet Arrival/transmission model: Fresh packets transmitted in the same slot: Poisson, rate λ Total transmissions/slot: Poisson, rate µ > λ Includes fresh and retransmitted packets! When collision occurs, involved nodes turns backlogged Fresh arrivals: Poisson λ slot N-1 slot N slot N+1 Transmissions: Poisson µ, G = µt Let be G = µ T is the offered traffic t = ora 11 Traffic Modeling and Streaming
Slotted Aloha: simple analysis/3 Let s focus on a node which we know it will transmit in the next slot Tx has success if nobody else transmits a) 0 tx (non-bcklgd nodes with no pkts, bcklgd do not trx) b) 1 tx (at least one node txed), collision! G P( k) k = e G k! Successful transmission, P OK = P( k = 0)= e -G On average in a slot G packets are attempted - Of these only P OK are received which leads to throughput Ge -G = D(G) Upper bound for D(G) is: D G = Ge G G = e G Ge G = 0 G =1,D max =1/e 0.368 Traffic Modeling and Streaming 12
Slotted Aloha: simple analysis/4 If channel possibilities are known Find maximum number of arrivals λ More than that is useless, no possibilities to transmit it! Must be λt < 1/e : two values of G so that D(G) = λt In G [G min, G max ] network works If G < G min either Too few traffic generated Too few retransmissions If G > G max too many retransmissions Varying G means change retransmission rate at bcklgd nodes Traffic Modeling and Streaming 13 T
Aloha: simple analysis Hypotheses: Infinite nodes All frames have the same length, require T for transmission fresh traffic is Poisson, arrival is λ, and it is transmitted immediately Backlogged nodes Retransmit independently of the others (including backlogged and not) Wait exponentially distributed time retransmitted traffic is Poisson Number of packets transmitted including fresh and retransmissions Poisson process with µ > λ Let be G = µt the offered traffic Traffic Modeling and Streaming 14
Aloha: simple analysis/2 Let s focus on a node that starts transmitting in t = 0 Tx is OK (success) if no other node transmits k = 0 nodes have transmitted in [-T, T ] (apart the one we know) Probability P(tx OK) = P suc = P[ k = 0 ] = exp(-2µt ) Success on average: E[suc] = 1 P suc + 0 [1 P suc ] = exp( -2µT ) On long time s : µs frames txed, and µs exp(- 2µT) successful Average throughput (over T ): θ = µt exp( - 2µT ) If 2µT = 2 G =1 we get θ max θ max = 1/(2e) 0.18 T T t = 0 Traffic Modeling and Streaming 15
Aloha vs Slotted-Aloha Slotted-Aloha more efficient: Removing uncertainty at beginning of a transmission attempts increase network efficiency! Offered traffic G Traffic Modeling and Streaming 16
Aloha-slotted: simulation Infinite nodes {method 1} Set packet length (duration) T, fixed Set G, offered traffic in T (include fresh + retransmission) Set µ = G/T (arrival density), initialize T suc = 0, T tot = 0 Repeat N times the experiment: Focus on transmission starting in t = 0 Choose Y, exponential s. side r.v. mean 1/µ, time to next arrival Tx success if Y > T next arrival transmitted with next slot! Y Cumulate success T suc = T suc + T Refresh T tot = T tot + Y Compute throughput θ G Change G, plot θ = θ(g) ( ) = T suc Prev pkt Cur pkt T T T t = 0 tot Traffic Modeling and Streaming 17
Aloha: simulation Infinite nodes {method 1} Set packet length (duration) T, fixed Set G, offered traffic in T (include fresh + retransmission) Set µ = G/T (arrival density), initialize T suc = 0, T tot = 0 Repeat N times the experiment: Focus on transmission starting in t = 0 Choose Y, exponential s. side r.v. mean 1/µ, time to next arrival Tx success if Y > 2T next arrival transmitted after this packet Cumulate success T suc = T suc + T Refresh T tot = T tot + Y Compute throughput Change G, plot θ = θ(g) ( ) = T suc θ G T tot Traffic Modeling and Streaming 18 T Y min t = 0 T
Aloha-slotted: simulation Infinite nodes {method 2} Simulate consecutive arrivals, check if collisions occur in every slot KO OK KO KO OK Y 1 Y 2 Y 3 Y 4 Y 5 Y 6 Y 7 Slot k-th extends in [(k 1)T, kt ] Cumulate inter arrival times Y n If cumulated time exceeds kt : go to next slot (k+1)-th - Count arrivals inside the slot, if only 1 increase success Traffic Modeling and Streaming 19
Aloha-slotted: simulation Infinite nodes {method 2}/2 Set T, offered rate G, T TOT, now = 0, now SLOT = 0, suc = 0, arr SLOT = 0 while ( now T TOT ) Choose Y, r.v. exponential s. side mean 1/µ, µ = G/T, now SLOT = now SLOT + Y if now SLOT > T : count arrivals, go to next slot if arr SLOT == 1: suc++ now SLOT = now SLOT % T (modulo, or remainder) arr SLOT = 0 Increase arr SLOT Refresh now = now + Y Compute channel usage θ(g) = suc T/T TOT Change G, plot θ = θ(g) Traffic Modeling and Streaming 20
Aloha: simulation Infinite nodes {method 2} Maintain collision state coll T now current time T END end time current transmission T now = T END coll=0 Example: T=1 t=0 Y=1 T now +=1=1 T now > T END &coll==0 T END = T now + T = 2 t =0 t =1 set T suc ++, coll=0 t =0 t =1 t =2 T END T now T now T END Y=0.5 T now +=0.5=1.5 T now < T END T END = T now + T = 2.5 t =0 t =1.5 set coll=1 t =2 t = 0 t = 1.5 t =2.5 T now T END Y=1.5 T now +=1.5=3 t =0 t =2 t =3 T now >T END &coll==1 set coll=0 T now T END T END = T now + T = 4 t =0 t = 3 t = 4 T END T now T now T END Traffic Modeling and Streaming 21
Aloha: simulation Infinite nodes {method 2}/2 Set packet length (duration) T fixed and offered traffic G Initialize T suc = 0, T now = 0, T end = 0, coll = 0, T TOT while( T now T TOT ) Compute Y, r.v. exponential s. side mean 1/µ, µ = G/T Refresh T now = T now + Y if T now > T end : current packet does not collide with previous ones if coll == 0 : last tx OK» set T suc = T suc + T set coll = 0, T end = T now + T else : collision coll = 1 Compute throughput θ(g) = T suc / T tot KO coll=1 T now coll==1 KO coll=0 coll==0 OK Traffic Modeling and Streaming 22 T T end T now T coll=0 T end T now
Aloha vs Slotted-Aloha, theory and simulation Offered traffic G Traffic Modeling and Streaming 23