TSIN01 Information Networks Lecture 8 Danyo Danev Division of Communication Systems Department of Electrical Engineering Linköping University, Sweden September 24 th, 2018 Danyo Danev TSIN01 Information Networks Lecture 8 1 / 29
Lecture overview Agenda Tree algorithm Tree algorithm improvements First-Come First-Serve (FCFS) algorithm Danyo Danev TSIN01 Information Networks Lecture 8 2 / 29
Tree algorithm We assume slotted channel, Poisson arrivals, collision or perfect reception, (0, 1, e) immediate feedback, retransmission of collisions, and an infinite set of nodes When collision occurs in slot k, all nodes not involved in collision go into waiting mode, the rest are split into two subsets (e.g. by coin flip) All nodes of the first subset transmit in slot k + 1. If that slot is idle or successful, the nodes of the second subset transmit in slot k + 2. Alternatively, if a collision occurs in slot k + 1 the first subset is split again and the nodes of the second subset wait for the resolution of that collision Danyo Danev TSIN01 Information Networks Lecture 8 3 / 29
Tree algorithm We can describe the splitting procedure with a binary tree The root is the set of nodes involved in the initial collision S is split up into L (left- transmit ) and R (right- wait ) If collision occurs, L is further split in subsets LL and LR Subsets with at least 2 packets correspond to tree vertices with upward branches Subsets with 0 or 1 packet correspond to leaf vertices All packets in the left subset and all its descendants (due to further splitting) are transmitted before the packets in the right subset Danyo Danev TSIN01 Information Networks Lecture 8 4 / 29
Example of tree algorithm Danyo Danev TSIN01 Information Networks Lecture 8 5 / 29
Tree algorithm: stack description From the (0, 1, e) feedback each node can construct the tree, keep track of its own subset in that tree, and determine when to transmit its backlogged packet An alternative description is to consider a stack When a collision occurs the set of nodes involved is split into two subsets and these are pushed on the stack The subset at head of stack is then removed and retransmitted (with splitting and pushing on stack if collision occurs) Danyo Danev TSIN01 Information Networks Lecture 8 6 / 29
Tree algorithm: stack description A backlogged node keeps track of when to retransmit by a counter determining the position of its subset in the stack When a packet is involved in collision, the counter is set to 0 or 1 depending on which subset it is placed in When the counter is 0, the packet is retransmitted If the counter is nonzero, it is incremented by 1 for each collision and decremented by 1 for each success or idle A collision resolution period (CRP) is defined to be completed when a success or idle occurs and there are no remaining elements on the stack When a CRP is completed a new CRP is started with the packets that arrived during the previous CRP Danyo Danev TSIN01 Information Networks Lecture 8 7 / 29
Tree algorithm: smart initialization If many slots are required for a CRP it is likely that many packets have arrived during that time In the new CRP, there will be many collision untill the subsets become small A solution is to immediately split the new arrivals into j subsets, at the end of a CRP j is chosen so that the expected number of nodes per subset is slightly greater than 1 These j subsets are placed on the stack and then a new CRP begins Danyo Danev TSIN01 Information Networks Lecture 8 8 / 29
Tree algorithm: smart initialization Each node keeps track of the number of elements in the stack and number of slots since the end of the previous CRP The nodes involved in the CRP also keep track of their position in the stack On completion of a CRP, each node determines a new number j of subsets from the expected number of new arrivals The nodes with new arrivals waiting randomly choose one of those j subsets and set their counter to the corresponding stack position The maximal throughput available with this algorithm, optimized over the choice of j, is 0.43 packets per slot Danyo Danev TSIN01 Information Networks Lecture 8 9 / 29
Tree algorithm: improvement 1 If a collision is followed by an idle slot, all packets involved in the collision were assigned to the second subset and collision was guaranteed An improvement would be upon detecting an idle slot following a collision, to directly split this second set into two sets and retransmit the first one Similarly, if an idle occurs again, the second subset is again split before retransmission, and so forth The improvement can be stated in the stack case too. Each node must keep track of an additional binary state that is 1, if for some i 1, the last i slots contained one collision followed by i 1 idle slots, otherwise the state is 0 If feedback is 0 and the state is 1, then state remains 1 and the set on the top of stack is split into two that are pushed on stack instead of the old head element Danyo Danev TSIN01 Information Networks Lecture 8 10 / 29
Tree algorithm: improvement 1 The maximal throughput with this improvement is 0.46 packets per slot In practice there is a problem with this improved algorithm, if an idle slot is incorrectly perceived by the receiver as a collision then the algorithm continues splitting indefinitely Thus, after some number h of idle slots following a collision, the algorithm should be modified to not split any further but instead retransmit the current subset If the feedback is very reliable h can be fairly large, otherwise h should be small Danyo Danev TSIN01 Information Networks Lecture 8 11 / 29
Tree algorithm: improvement 2 Consider a collision followed by another collision Let x be the number of packets in first collision and x L and x R the number of packets in the L and R subsets from the split, thus x = x L + x R Assuming that x is Poisson and that the splitting into L and R is done randomly so that x L and x R are independent (and Poisson due to random splitting) Given the two collisions, we know x L + x R 2 and x L 2 and since the latter implies the former, conditioning on both is the same as conditioning on the latter only Danyo Danev TSIN01 Information Networks Lecture 8 12 / 29
Tree algorithm: improvement 2 Given the feedback of two collisions we thus get P (x R = k x L 2) = P (x R = k) since x L and x R are independent On the other hand P (x L = k x L 2) = P (x L = k)/p (x L 2) > P (x L = k) = P (x R = k) = P (x R = k x L 2) if k 2 (and 0 otherwise) Thus most packets are probably in L and the small expected number of packets in R makes it reasonable to avoid devoting a slot to R but instead count these packets as waiting new arrivals With this improvement and splitting done on arrival time, we get the first-come first-serve (FCFS) splitting algorithm Danyo Danev TSIN01 Information Networks Lecture 8 13 / 29
Example of tree algorithm improvements Danyo Danev TSIN01 Information Networks Lecture 8 14 / 29
Unblocked stack algorithm The tree algorithm requires all nodes to monitor channel feedback and keep track of when each CRP ends If new arrivals instead just join the subset of nodes at head of stack, and only backlogged nodes monitor the feedback, we get an algorithm called unblocked stack algorithm The tree algorithm is often called blocked stack algorithm, since new arrivals are blocked until the end of current CRP Since new arrivals are added to the head of the stack, collisions involve a somewhat larger number of packets on the average Because of the likelihood of three or more packets in collision, higher maximum throughput can be obtained by splitting into three subsets rather than two Maximal throughput for unblocked stack algorithm is 0.40 Danyo Danev TSIN01 Information Networks Lecture 8 15 / 29
FCFS splitting algorithm In FCFS, splitting is done based on packet arrival times Each subset consists of all packets that arrived in a given time interval When a collision occurs that interval is split into two smaller intervals The earlier interval is transmitted first, so packets successfully depart in the order of their arrival At each slot k, the packets to be transmitted are those that arrived in some earlier allocation interval from T (k) to T (k) + α(k) Danyo Danev TSIN01 Information Networks Lecture 8 16 / 29
FCFS splitting algorithm We can think of the packets arriving after T (k) + α(k) as being in a queue of unknown size All nodes keep track of the allocation interval over which service (transmission) is taking place The algorithm is specified by the set of rules by which nodes calculate T (k) and α(k) for each successive k on basis of the feedback from previous slot These rules are the tree algorithm with the two improvements mentioned, specialized to the case of splitting according to arrival time Danyo Danev TSIN01 Information Networks Lecture 8 17 / 29
FCFS splitting algorithm: 1st improved rule When a collision occurs, the allocation interval is split into two equal subintervals The leftmost (longest-waiting) subinterval L is the allocation interval in slot k + 1 When idle follows collision the previous rightmost interval R is known to contain two or more packets Due to the 1st improvement, it is immediately split RL forms the allocation interval in slot k + 2 Danyo Danev TSIN01 Information Networks Lecture 8 18 / 29
FCFS splitting algorithm: 1st improved rule Danyo Danev TSIN01 Information Networks Lecture 8 19 / 29
FCFS splitting algorithm: 2nd improved rule When collision follows collision we would like to regard R as if it had never been part of an allocation interval L contains at least two packets and is split into LL and LR LL forms the allocation interval and LR waits Due to the 2nd improvement, the algorithm simply forgets about R (moves it to the next CRP) At end of CRP, instead of splitting into some number of subsets (as in the tree algorithm), we choose a new allocation interval of some given size α 0 Danyo Danev TSIN01 Information Networks Lecture 8 20 / 29
FCFS splitting algorithm: 2nd improved rule Danyo Danev TSIN01 Information Networks Lecture 8 21 / 29
FCFS splitting algorithm: 2nd improved rule The 2nd improvement corresponds to pruning the tree so it never has more than two leaves, or in stack language the stack never remembers more than the top two elements Whenever the allocation corresponds to the left subset of a split, there is a corresponding right subset that might have to be transmitted later Conversely, when allocation corresponds to a right subset there are no more waiting intervals The nodes only need to remember the allocation interval and whether it is a right or left interval By convention the initial interval of a CRP is considered a right interval Danyo Danev TSIN01 Information Networks Lecture 8 22 / 29
FCFS splitting algorithm: summary If feedback = e then T (k) = T (k 1), α(k) = 1 2α(k 1), σ(k) = L If feedback = 1 and σ(k 1) = L then T (k) = T (k 1) + α(k 1), α(k) = α(k 1), σ(k) = R If feedback = 0 and σ(k 1) = L then T (k) = T (k 1) + α(k 1), α(k) = 1 2α(k 1), σ(k) = L If feedback = 0 or 1 and σ(k 1) = R then T (k) = T (k 1) + α(k 1), α(k) = min(α 0, k T (k)), σ(k) = R The initial size of allocation interval is some constant value α 0 that can be chosen to either minimize delay for a given arrival rate or to maximize the stable throughput Danyo Danev TSIN01 Information Networks Lecture 8 23 / 29
FCFS splitting algorithm: Markov chain A CRP evolution can be visualized by a Markov chain Danyo Danev TSIN01 Information Networks Lecture 8 24 / 29
FCFS splitting algorithm: Markov chain The node at the left side of the chain corresponds to the initial and final slot of the CRP; it is split in two to visualize the beginning and end of a CRP An idle or a collision from a left allocation interval generates one additional split with a smaller left allocation interval and corresponds to a transition from (L, i) to (L, i + 1), where i is the number of splits A success from a left interval leads to a right interval with no additional split and corresponds to a (L, i) to (R, i) transition A success from a right interval ends the CRP and corresponds a transition back to (R, 0) A collision from a right interval causes a new split and corresponds to a transition from (R, i) to (L, i + 1) Danyo Danev TSIN01 Information Networks Lecture 8 25 / 29
FCFS splitting algorithm: performance A CRP can be analyzed using the Markov chain to calculate transition and state probabilities, and eventually when the drift is negative Maximum throughput is 0.4871 at λα 0 = 1.266 λα 0 is the expected number of packets in original allocation interval; as expected it is somewhat larger than 1 If α 0 is chosen to be 2.6 = 1.266/0.4871 then FCFS is stable for λ < 0.4871 Expected delay is very hard to analyze, but upper and lower bounds have been developed Danyo Danev TSIN01 Information Networks Lecture 8 26 / 29
FCFS splitting algorithm: performance Danyo Danev TSIN01 Information Networks Lecture 8 27 / 29
FCFS splitting algorithm: improvements Splitting intervals into equal-size subintervals is slightly non-optimal in achieving maximum stable throughput When splitting to optimally-sized subintervals the maximum stable throughput is 0.4878 The maximum stable throughput using assumptions 1-6b is unknown; an upper bound is 0.587 For any finite set of m nodes, we can achieve any throughput up to 1 packet per slot with TDM, but with TDM the expected delay (for a given λ) increases linearly with m FCFS achieves bounded-delay independently of m Much higher throughputs than 0.4878 are achievable if the slotted assumption is abandoned and early feedback is available when the channel is idle or experiencing a collision Danyo Danev TSIN01 Information Networks Lecture 8 28 / 29
Next lecture Topics CSMA: Carrier Sense Multiple Access CSMA Slotted ALOHA CSMA Slotted ALOHA: Pseudo-Bayesian stabilization CSMA Unslotted ALOHA FCFS with CSMA Multiaccess reservations CSMA/CD (Collision Detection): slotted and unslotted Packet radio networks (PRN) Danyo Danev TSIN01 Information Networks Lecture 8 29 / 29