arXiv:1911.08449v1 [cs.NI] 19 Nov 2019 ihabte iwo h or nterlpos nalthese all ran eve transmitter’s In or the laptops. hundreds within their to users/receivers video on tablets. of live board broadcast thousands their to the on need of clas stage we theatre view scenarios, the large better in of fa a students view allows provide with it better to concerts, is a spot. example in get Another parking or to phones, open seats specta their an away enable on find can replay transmitter vehicles the such bird-vie watch help stadiums, the to sport large receivers lot broadcast In parking many can a and transmitter of applications. wireless transmitter many has a single This example, a range. transmission with its within network be a will content in video this cove will of [1]. same it 16% streams 2021, the traffic; video by At Internet live and per [1]. all well, ExaBytes as of years) rising 48 82% two is than every content 11 more video (doubling from time to 2021 rise 2017 will in in traffic month month mobile overall per Inde the ExaBytes Networking that Visual networ shows Cisco wireless report exponentially. in bandwidth increased higher has and quality greater for osi omnbcueo aiu hne maret such impairments channel various of because common is loss eoal ewr oig eltm applications. real-time coding, network decodable faster feedback magnitude collect to i of time packets orders enough users. lost not many two more is there recovers to where and up practice, encoder, CrowdWiFi is the RACE than netw that dense in CrowdWiFi show video in We live used broadcasting RIDNC for solution system optimal recovery commercial high the loss a encoder, as packet CrowdWiFi packets the performing with lost RACE that many compare encoder We as encoder. RIDNC nearly light a recover RACE, can propose We IDNC. to dead proach delivery dens urgent o the in number to impractical applications. due the real-time desirable is with of not grows This is fro runtime users. which their feedback users, of) addition, collecting of percentage In of number networks. large cost maximum the a the at (or nearly possible So recover (IDNC). packets can coding lost solutions network these decodable instantly of s recovery on packet o existing rely number time, often short maximum a the within recover packets To lost ha deadline. which delivery applications short and real-time for particularly lenging, ∗ Keywords Abstract nti ae,w osdrwrls racs flv media live of broadcast wireless consider we paper, this In need the devices, mobile of popularity in increase the With nti ok eitoueRDC admecdn ap- encoding random a RIDNC, introduce we work, this In adigpce losses. packet Handling arefi@ualberta.ca, aktLs eoeyi racs o Real-Time for Broadcast in Recovery Loss Packet Pce osrcvr nwrls racs schal- is broadcast wireless in recovery loss —Packet — ieesbodat aktls eoey instantly recovery, loss packet broadcast, Wireless plctosi es ieesNetworks Wireless Dense in Applications † [email protected], .I I. NTRODUCTION nwrls omncto,packet communication, wireless In fhnArefi Afshin ∗ n ai Khabbazian Majid and , estrict ve olutions ge. all m orks. from tors line For ses me a , ks w n n x e r r f f oei Phr.Teeaesbpia DCecdr in encoders IDNC suboptimal are There to NP-hard. back-offs is large code employ to collisions. have of nodes number m the feedback as reduce collecting higher of even overhead be the practice, is In packet packets. data a of from size the that 1000 Assuming user. per overhead 20 edrsz fUP Pad821 r respectively The are network. 802.11 802.11 and a IP in UDP, IP of over size UDP consider header using overhead, this transmitted of is with amount network the on a To intuition networks. dense numeric in th overhead a of significant o a most is or broadcast This all encode ceivers. from IDNC in feedback collecting existing recovery require However, typically loss [4]. packet applications real-time for solution attractive oe,w ou ncdsta lo ntnaeu eoiga decoding instantaneous allow that receivers. codes the t on using focus of t instead we before Therefore, codes, packet. packets the any coded as decoding aim, several start i can this receive for that to suitable receivers interval, not require are many time codes Codes as fountain short Network recover and Random a (RNC) it. to transmissions. of within is for number aim possible limited time with our as enough [3], packets have and lost not [2] all to may recover similar to transmitter Instead, not the therefore, recover as to is, packets time objective limited Our has packet. transmitter deadlin lost delivery the packet that urgent means have which but losses, packet some a solutions only effective is more are i there there (i.e., however, when receivers broadcast), multiple packets an are of there lost is When This recover receiver. do receiver. single to it the if way from Wi-Fi packet acknowledgment effective in a an example, retransmits receive For transmitter not packet. the lost 802.11), packets lost each (IEEE recover retransmit to simply method basic to A fading. mutli-path as ahrcie a eoe t isn aktb Oigthe possesses. XORing it packets by two packet way, the This missing a with only. its construct packet packet recover to coded coded more can packets the receiver a three transmit each However, the and time. XOR packet, to more coded c is one transmitter solution is packets the efficient three three receiver packets, all recover and To two transmit three. packet packet missing missing is (thr two afte realizes receiver pa that one, missing transmitter is one Suppose the receiver that range. feedback/acknowledgments) packets, transmission three its transmitting within receivers h eodcalnewt DCi htfidn noptimal an finding that is IDNC with challenge second The ntnl eoal ewr oe (IDNC). codes network decodable Instantly eltm applications. Real-time three with transmitter a consider example, simple a As ye,and bytes, † ye,tebnwdhrqieetfrcletn feedback collecting for requirement bandwidth the bytes, 100 , eirMme,IEEE Member, Senior sr saotta eurdt rnmtsxfl data full six transmit to required that about is users 34 ye.Ti ed oa least at to leads This bytes. 100 eevr/sr.Spoeta feedback that Suppose receivers/users. eltm plctoscntolerate can applications time Real , 62 ye fheader of bytes DCi an is IDNC 8 case n bytes, ough re- e hese . cket lost hey get es, ay an es rs is y a s 1 f r t 2 the literature. However, the computational complexity of these the performance gap between RLNC and IDNC. They also encoders grows with the number of users. When the number propose a number of coding solutions with varying delay- of users grows, these solutions start to become slow and tradeoffs. Fragouli et al. [23] examine different unsuitable for real time applications. Some works in the usages of feedback in networks with coding capabilities, and literature (e.g., [5]) tried to tackle this problem by assigning illustrate benefits including adaptive parameter optimization cluster heads and collecting feedback from them (instead of all to provide better quality of services. They also consider the users). These algorithms are relatively complicated and rely on possibility of using network coding to the feedback packets, the spacial packet loss correlation. Some existing studies show and examine design of acknowledgment packets. that such correlation is low [6]. The most relevant work to ours among these studies is [3], Contributions. In this work, we introduce RIDNC, a ran- [24], in which the authors show that the problem of finding a dom approach to IDNC encoding. We prove that, in dense code that is instantly decodable by the maximum number of networks, a single RIDNC packet can recover nearly as many receivers is NP-hard. They also propose a polynomial time lost packets as possible. Using the RIDNC approach, we code construction method for the case where all receivers propose RACE, a fast RAndom IDNC Encoder that works experience an identical erasure rate. with limited feedback from users, yet recovers as many lost There is a large body of work on IDNCs that aim to reduce packets as the optimal RIDNC encoder. Using simulations, the completion time, which is the time needed to deliver we compare RACE with one of the best IDNC-based packet packets to all the receivers. Some of these works assume that recovery solutions, verify the superior performance of RACE some packets are more important to be delivered than other in speed and in recovering lost packets, and confirm its low packets [22], [25]. As argued in [3] minimizing the completion communication overhead in dense networks. time is not the right objective for real-time applications. What The rest of the paper is organized as follows. Section II is important in such applications is rather to deliver as many covers related work in the literature. In Section III, the system packets as possible within a strict delivery deadline. For this model and problem definition are presented. In Section IV, we reason, similar to [3], [24], [26], [27], we focus on designing motivate the use of RIDNC in dense networks, and propose the IDNCs that are instantly decodable by as many users as RACE encoder. Simulation results are presented in Section V, possible. and the paper is concluded in Section VI. There are two other problem setups in the literature that resemble the problem considered in this paper. These problems are index coding [28] and data exchange [29]. The objective II. RELATED WORK of both index coding and data exchange is to minimize Ahlswede et al. first introduced network coding in [7] and the number of transmissions to achieve a certain goal. For showed that it can improve throughput. Since then, there example, in the index coding problem, each receiver demands has been extensive research work on designing coding-based a single packet from the set of packets at the transmitter. The solutions for different applications. In the case of single- objective is to satisfy all these demands with minimum number wireless broadcast, the transmitter can use random linear of transmissions. The objectives considered in index coding network codes (RLNC) [8]–[15] and Raptor codes [16] to and data exchange are different from our objective, which is deliver packets with minimum number of transmissions, and to construct a single code that is instantly decodable by the with low coding complexity, respectively. These solutions are, maximum number of users. however, not suitable for real-time applications such as live video streaming, as packets have strict delivery deadline in III. PROBLEM STATEMENT AND SYSTEM MODEL such applications. To meet the delivery deadline, a received Similar to the work of Le et al. [3], [24], we define the coded packet needs to be decoded within a short time win- problem as follows. We consider a single wireless base station dow; otherwise it would be useless hence discarded. Instantly (also referred to as transmitter) and N users (also referred to Decodable Network Codes (IDNC) [17]–[19] are a family of as receivers) U = {u1,u2,u3, ··· ,uN }. We assume that all Opportunistic Network Codes (ONC) [20]–[22] that minimize users are within the transmission range of the base station. this decoding time at the cost of lower throughput than RLNCs. The base station has M packets P = {p1,p2,p3, ··· ,pM } IDNCs have the following distinguishing properties: 1) a to broadcast to all N users. It first broadcasts these M coded packet is constructed by simply XORing a number of packets using M transmissions. This step is called the initial plain packet. 2) a received coded packet is either instantly transmission phase. The base station is then granted a short decoded using the past decoded packets or discarded (i.e., it is time to recover as many lost packet as possible by transmitting not stored for later decoding). Because of the latter property, few coded packets. IDNCs have been the subject of several work studying real In IDNC (and RIDNC), the encoder at the transmitter time multimedia broadcast [8], [9], [23]. constructs a coded packet by XORing a subset of packets Eryilmaz et al. [8] study the delay gain of coding in unreli- C ⊆P. The number of packets in C (i.e., |C|) is referred able networks. They find closed-form expressions for the delay to as the code degree. At the receiver side, a received coded performance with or without coding, and show significant packet is used by the decoder to recover/decode a lost packet; delay gains when coding is used. They further extend their if not successful, the coded packet is discarded (i.e., it is not results to general network topologies. Yu et al. [9] analyze the buffered for later use). The decoder is able to recover a lost tradeoff between throughput and decoding delay, and examine packet iff the receiver has exactly one lost packet in the set C. 3

Objective. As in [3], [24], our objective is to recover Proof: See Appendix A. as many lost packets as possible using a few number of coded packet transmissions. This objective is motivated by the B. RACE: The Proposed RIDNC encoder following facts: 1) Real-time applications often have a strict and urgent The core of RACE (and any RIDNC encoder) is the code packet delivery deadline. Therefore, the transmitter has degree calculation. When the code degree is calculated, the limited time, hence limited number of transmission task of an RIDNC encoder is simple: it XORs a random subset opportunities to recover lost packets. of packets. The challenge of RIDNC encoder is to estimate the 2) Real-time applications can often tolerate some packet optimal code degree as accurate and as fast as possible with losses. preferably limited feedback from users. Following, we first ex- Channel model. To analyze the performance of encoders, plain how RACE, our proposed RIDNC encoder, estimates the we model the channel between the transmitter and users by optimal code degree for the first coded packet (Algorithm 1). a packet erasure channel, where a packet is either correctly The general case of code degree estimation is then presented in Algorithm 2. received or lost. The packet lost probability of user ui, 1 ≤ Estimating the optimal degree for the first coded packet. i ≤ N, is denoted by Ei and is referred to as the packet erasure Let the random variable Y be the number of lost packets rate of ui. We assume that different users can have different d packet erasure rates, and that packet receptions at different recovered when the transmitted coded packet is the XOR of d users are independent. packets selected uniformly at random from P. By definition, the optimal code degree d∗ is IV. RANDOM INSTANTLY DECODABLE NETWORK d∗ E Y . CODING = argmax [ d] 1≤d≤M Random Instantly Decodable Network Coding (RIDNC) is a random encoding approach to IDNC. In RIDNC, the encoder For the first coded packet, we have first decides on a code degree d. It then simply selects d N d−1 packets uniformly at random, and XORs them to generate E[Yd]= d ·Ei(1 −Ei) a coded packet. The simplicity of RIDNC allows design of i=1 fast encoders. Fast encoders are attractive for packet loss X where E is the erasure rate of user u . Therefore, if the encoder recovery in broadcast of real-time applications because these i i knows the erasure rates E , it can calculate the optimal code applications often have urgent packet delivery deadlines. i degree d∗ for the first coded packet. RACE, however, has no A. Asymptotic Optimality of RIDNC prior information on the erasure rates of users. To estimate the optimal code degree, it therefore collects limited feedback The main task of a RIDNC encoder is to find a good from a subset of users right after the initial transmission phase. code degree. Different code degrees result in different packet Let S be the index of users from which feedback is recovery performances. For example, suppose that every user collected. The feedback collected from user ui, i ∈ S, is is missing exactly one packet out of M packets. A small code the number of packets ui has received during the initial degree, in this case, would result in a poor packet recovery, transmission phase. After collecting all these feedback, RACE while the code degree of M would result in recovering all the estimates the optimal code degree d∗ as lost packets (assuming that the coded packet is received by all the users). hi (M − h ) ˆ d−1 i hi +1 Suppose the transmitter is granted a transmission (after the d = argmax M · . (1) ≤ ≤ M +2 1 d M i∈S  d ! initial transmission phase) to recover as many lost packets as X possible. The next theorem states that, in a dense network, ifa The estimation (1) is inspired by Theorem 2. In the theo- RIDNC encoder chooses the right code degree, it can recover rem, the assumption that erasure rates come from a uniform nearly as many lost packet as possible by any other packet distribution—while they likely come from non-uniform dis- recovery solution. Recall that N and M denote the number of tributions in practice—is only to estimate the optimal code users and the number of packets, respectively, degree. One may justify this assumption by the fact that the

Theorem 1. Let GR denote the expected number of recovered transmitter has no information about erasure rates prior to lost packets when the optimal code degree is used by the collecting feedback. Note that any prior information about the RIDNC encoder. Let Gopt denote the maximum number of lost erasure rates (e.g, knowing users’ erasure rate distributions) packets that is possible to recover by any solution. can be used in Theorem 2 to improve the estimate of the Then, for any arbitrary small positive real numbers δ and ǫ, optimal code degree. Nevertheless, simulation results show that we have this estimate is virtually as good as the optimal code degree. GR ≥ (1 − δ) · Gopt, An advantage of (1) is that a major part of it can be pre- computed: as stated in Corollary 1, evaluating dˆwould require with probability at least 1 − ǫ, if only a single matrix multiplication of complexity O(M 2). 3 ln 2 ln 1 Note that this computational complexity does not grow with N ≥ ǫ · M the number of users N. p∗ · δ2   4

Theorem 2. Suppose that the erasure rates of users are Algorithm 1 Code degree estimation for the first coded packet uniformly distributed in the interval [0,1]. Let Hi be the event 1: // Pre-computation that user ui has received hi packets in the initial transmission 2: // The umber of packets ′ M ← |P| phase. Let the random variable Yd be the number of recovered 3: Π ← Zero matrix of size M × M packets when the transmitted coded packet is the XOR of d 4: for all i ∈ [1,...,M] do // Number of packets to be packets selected uniformly at random. XORed Then 5: for all j ∈ [0,...,M − 1] do j N hi (M−j) (M − hi) Π (i−1) j+1 ′ d−1 hi +1 6: i,j ← M · E[Y |H ,H ,...,HN ]= · . ( ) M+2 d 1 2 M M +2 i i=1  d !   X 7: // Realtime computation  8: n ← Number of feedback samples 9: S ← collectRandomSamples(n) 10: V ← Zero vector of size M Proof: See Appendix B. 11: for all ui,i ∈ S do 12: j ← # packets received by ui // Ignore if ui has received all 13: Vj ← Vj +1 // Ignore if ui has received all 14: Gain ← 0 Corollary 1. Let nj be the number of users that have received 15: Num j, 0 ≤ j ≤ M, packets during the initial transmission phase, ← 0 T 16: G ← Π × V and V = [n0,n1,...,nM−1] . Let Π be a M × M matrix, such that 17: for all d ∈ [1,...,M] do // code degree j 18: if Gi > Gain then i−1 (M − j) j +1 Π = · , 19: Gain ← G i,j M M +2 d  i 20: dˆ← d Π 21: return dˆ where i,j denotes the element  in the ith row and jth column of Π. Then ˆ Π V d = argmax ( × )d 1≤d≤M Example 1. Suppose the number of packets is M = 10. The Π Π V Π V matrix is pre-computed as where ( × )i denotes the ithe element of × . .08 .15 .20 .23 .25 .25 .23 .20 .15 .08 0 .03 .09 .16 .22 .28 .31 .31 .27 .17 0 0 .02 .06 .12 .21 .29 .35 .35 .25  0 0 0 .01 .05 .12 .22 .33 .40 .33 Π 0 0 0 0 .01 .05 .14 .28 .42 .42 Proof: We have =  0 0 0 0 0 .01 .07 .20 .40 .50    000000 .02 .12 .35 .58 hi 0000000 .04 .27 .67 (M − hi) h +1   dˆ d−1 i  00000000 .15 .75 = argmax M ·  000000000 .83 ≤ ≤ M +2 1 d M i∈S  d !   X Suppose the following vector is the summary of the collected M j  d−1 (M − j) j +1 feedback. = argmax M · · nj ≤d≤M  M +2  T 1 j=0  d ! V X = [0001124479] ,   M  For instance, the value of V at index eight is seven. This = argmax Πd,j · nj implies that seven users (out of all users from which feedback ≤d≤M   1 j=0 Π V X was collected) have received 8 packets. Given and , the Π V Π V = argmax ( × )d .  product × is computed as 1≤d≤M

0.00 4.51 6.78 7.86 8.31 8.44 8.39 ... 7.50 T | {z } . index i=5 Theh largest element of the above vector is at index i =5i, thus Algorithm 1 returns dˆ=5 as the code degree. Algorithm 1 shows how RACE estimates the optimal degree for the first coded packet. As shown in the algorithm, the Estimating optimal code degrees for multiple packets. matrix Π is pre-computed, and the matrix V is simply filled in After transmission of each coded packet, the optimal code with the collected feedback. Therefore, the main computation degree can change. To estimate the new optimal code degree, of Algorithm 1 is to calculate the product Π × V which can RACE does not request feedback from users as this increases be done in O(M 2). the communications overhead and delay. Instead, as shown in 5

Algorithm 2, it estimates the number of packets each user has Algorithm 2 Code degree estimation in RACE using its latest information about the user, and the code degree 1: M ← |P| // number of packets of the last transmitted coded packet. 2: Number of feedback samples D n ← To this end, Algorithm 2 maintains a M × M matrix , a 3: Number of coded packets V r ← generalization of the vector in Algorithm 1. The value of 4: // Set of constructed coded packets D R ←∅ i,j is an estimate of the number of users that have received 5: S ← collectRandomSamples(n) i packets in the initial transmission phase, but currently have 6: D ← Zero matrix of size (M + 1) × (M + 1) j (j i) packets because of possible recoveries by the coded ≥ 7: for all u ,i ∈ S do packet transmissions. Initially, D is filled with the collected i D 8: i ←# packets received by ui feedback from users, so the initial values of are all accurate. 9: D ← D +1 After each transmission, the values of D are updated as i,i i,i 10: for all i ∈ [1,...,r] do Di,j ← Di,j − αc,j · Di,j + αc,j−1 · Di,j−1, 11: Gain ← 0 12: Num ← 0 where j 13: for all d ∈ [1,...,M] do (M − j) i +1 ′ α = c−1 · , 14: D ← D c,j M M +2  c 15: G ← 0 16: for all j ,...,M do and c is the code degree of the last transmitted coded packet. ∈ [0 − 1]  17: for all k ∈ [j,...,M − 1] do By Theorem 2, the parameter αc,j is an estimate of the k (M−k) probability that a node which has received i packets in the (d−1) j+1 D 18: tmpGain ← M · M+2 · j,k initial transmission phase, and currently has j packets has ( d ) 19: G ← G + tmpGain  benefited from the last transmitted coded packet. In other D′ D′ D 20: j,k+1 ← j,k+1 + tmpGain words, i,j is an estimate of the number of users that received D′ D′ i packets in the initial transmission phase but currently have 21: j,k ← j,k − tmpGain j ≥ i packets. Using the updated matrix D, and by simply 22: if G > Gain then applying Theorem 2, Algorithm 2 esimates the code degree 23: Gain ← G for the next coded packet. 24: Num ← d Collecting feedback. To statistically represent the set of 25: D′′ ← D′ receivers/users in the network, the receivers that send feedback 26: D ← D′′ are selected uniformly at random. To collect feedback from 27: dˆi ← Num // estimated optimal code degree of the the selected users, different mechanisms can be employed. ith packet Following, we explain two possible feedback mechanisms. 28: return (dˆ1, dˆ2,..., dˆr) For the first mechanism, we assume that the transmitter is aware of the IDs of the receivers. This is a reasonable assumption because receivers typically connect to the trans- V. SIMULATION RESULTS mitter to receive the multicast service. To request feedback, the transmitter can then randomly select receivers, and embed Comparing RACE with the Optimal RIDNC encoder. the list of selected IDs in a packet to notify the selected We first compare the performance of RACE with the optimal receivers. To minimize collisions, the selected receivers can RIDNC encoder. Recall that, by Theorem 1, in dense network, transmit their feedback in the same order as their IDs appear the optimal RIDNC is capable of recovering virtually as many in the packet. Note that even without following such order lost packets as possible by any other recovery solution. of transmission, the MAC layers of the selected users are In the optimal RIDNC, the transmitter knows the erasure there to handle the contention. Also, our solutions require rates of all users, and receives feedback from all users after only a small number of feedback. Therefore, there is a smaller each transmission to calculate the optimal code degree. In chance of collisions compare to the case where feedback is RACE, however, the optimal code degree is estimated using a collected from all/majority of users. In addition, as shown in one-time feedback (right after the initial transmission phase), the simulations, our solutions are not sensitive to few possible and without the knowledge of erasure rates. feedback losses. Figures 1, 2, and 3 compare the gain of RACE and the For the second mechanism, we assume that the transmitter optimal RIDNC encoder for various number of coded packet does not have the IDs of the receivers, but has an estimate transmissions. The gain is calculated as the total number of of the number of receivers. In this case, the transmitter can packets recovered divided by the total number of users, aver- ask the receivers to send feedback with a probability p, set by aged over 1,000 simulation runs. As shown, RACE performs the transmitter. For instance, if the transmitter estimates the very close to the optimal RIDNC. This is despite the fact number of receivers to be 100, and it wishes to collect about that RACE has no knowledge of erasure rates, and receives 20 feedback, then it can set p to be equal or slightly higher than feedback from users only once. 0.2. This solution has lower communication overhead than the Sensitivity of RACE to the number of feedback. In the first solution, and does not require knowledge of IDs of the next set of simulations, we evaluate the sensitivity of the gain receivers. of RACE to the number of feedback. Recall that RACE collects 6 feedback only once (before the transmission of the first coded VI. CONCLUSION packet). Figures 4 and 5 show the result of our simulations In dense networks, it is not practical to collect feedback for a dense network with 500 users. The dashed line shows from all or a large percentage of users. This is especially the gain of RACE when feedback is collected from all users. the case when broadcasting for real-time applications, which The solid curve is the gain of RACE versus the number of have urgent delivery deadlines. Considering this limitation, we 1 feedback requested . This result shows that RACE needs only proposed RACE, a fast and light random IDNC (RIDNC) en- a small number of feedback to nearly achieve its full gain. For coder. We proved that, in dense networks, the optimal RIDNC instance, it shows that RACE can achieve 90% of its full gain encoder is capable of recovering nearly as many lost packets using feedback from up to ∼ 2% of users. as possible by any other solution. Then, using simulations, we showed that RACE can recover virtually as many lost Comparing RACE with the CrowdWiFi encoder. Among packets as the optimal RIDNC. Also, we compared RACE with the existing solutions, two were reported to achieve near the CrowdWiFi encoder, a fast and high performing packet optimal gain: the recovery algorithm used by CrowdWiFi [2] recovery solution used in CrowdWiFi, a commercial system (referred to as the CrowdWiFi encoder), and the Multi-Slot 2 for broadcasting video in dense networks. The results show Max Clique [3]. The CrowdWiFi encoder has a better runtime that RACE can recover more lost packets than the CrowdWiFi than Multi-Slot Max Clique, thus we used it as our baseline encoder in practice, where there is not enough time to collect to evaluate the gain and speed of RACE. many feedback. In addition, RACE is up to two orders of CrowdWiFi by Streambolico [30] is a commercial system magnitude faster than the CrowdWiFi encoder. These make for broadcasting live video in dense networks such as stadiums, RACE a better solution than the state-of-the-art for recovering and conferences. A major contributor in the high performance lost packets in broadcast for real-time applications in dense of CrowdWiFi is its encoder, which works as follows. In the networks. first step, the CrowdWiFi encoder selects a packet, say c, that is wanted by the most number of users. At step i > 1, the encoder selects a packet p such that c⊕p is instantly decodable by more users than c. If such a packet p exists, it replaces c with c ⊕ p and moves on to the next step; otherwise, it stops and returns c as the coded packet.

We implemented the CrowdWiFi encoder, and compared it against RACE. As shown in Figures 6 and 7, RACE can recover more lost packets than the CrowdWiFi encoder where the number of feedback is small. This is an advantage because the transmitter does not have enough time to collect many feedback when broadcasting for real-time applications. As the number of collected feedback increases, the gap between the gain of the two encoders reduces, and at some “cross point” the CrowdWiFi encoder can recover the same number of lost packets as RACE. To get to this cross point, however, a considerable number of feedback has to be collected. In addition, at this point, the CrowdWiFi encoder is significantly slower than RACE. For instance, when the number of packets is M = 20 and the maximum erasure rate is 20%, the cross point occurs around 0.15 × N feedback, as illustrated in Figures 6. As shown in Figure 8b, when M=20 and the maximum erasure rate is 20%, RACE is about a factor of 3.5F faster than the CrowdWiFi encoder, where F denotes the number of collected feedback. Combining the two, we get that RACE is 3.5×(0.15N) > 0.5N faster than the the CrowdWiFi encoder at the cross point. This speedup factor ranges from 50 to 500 in a dense network with 100 to 1000 users.

1Feedback packets get lost just like other packets. 2The runtime of CrowdWiFi encoder was wrongly reported to be exponen- tial in [3]. 7

100 Opt. RIDNC 100 Opt. RIDNC 100 100 80 RACE 80 RACE 80 80

(%) 60 (%) 60 (%) 60 (%) 60 40 40 40 40

Gain Gain Gain Opt. RIDNC Gain Opt. RIDNC 20 20 20 RACE 20 RACE 0 0 0 0 10 250 500 750 1,000 10 250 500 750 1,000 10 250 500 750 1,000 10 250 500 750 1,000 No. of users No. of users No. of users No. of users (a) 1 coded packets (b) 2 coded packets (c) 3 coded packets (d) 4 coded packets

Fig. 1: Comparing the gain of RACE and the optimal RINDC. The number of packets is M = 20 and the erasure rates are uniformly distributed in the interval (0, 0.1).

100 Opt. RIDNC 100 Opt. RIDNC 100 100 80 RACE 80 RACE 80 80

(%) 60 (%) 60 (%) 60 (%) 60 40 40 40 40

Gain Gain Gain Opt. RIDNC Gain Opt. RIDNC 20 20 20 RACE 20 RACE 0 0 0 0 10 250 500 750 1,000 10 250 500 750 1,000 10 250 500 750 1,000 10 250 500 750 1,000 No. of users No. of users No. of users No. of users (a) 1 coded packets (b) 2 coded packets (c) 3 coded packets (d) 4 coded packets

Fig. 2: Comparing the gain of RACE and the optimal RINDC. The number of packets is M = 20 and the erasure rates are uniformly distributed in the interval (0, 0.2).

100 Opt. RIDNC 100 Opt. RIDNC 100 100 80 RACE 80 RACE 80 80

(%) 60 (%) 60 (%) 60 (%) 60 40 40 40 40

Gain Gain Gain Opt. RIDNC Gain Opt. RIDNC 20 20 20 RACE 20 RACE 0 0 0 0 10 250 500 750 1,000 10 250 500 750 1,000 10 250 500 750 1,000 10 250 500 750 1,000 No. of users No. of users No. of users No. of users (a) 1 coded packets (b) 2 coded packets (c) 3 coded packets (d) 4 coded packets

Fig. 3: Comparing the gain of RACE and the optimal RINDC. The number of packets is M = 20 and the erasure rates are uniformly distributed in the interval (0, 0.3).

40 40 40

30 30 30 (%) (%) (%) 20 20 20

Gain 10 Feedback from all users Gain 10 Feedback from all users Gain 10 Feedback from all users Varied no. of feedback Varied no. of feedback Varied no. of feedback 0 0 0 1 20 40 60 80 100 1 20 40 60 80 100 1 20 40 60 80 100 No. of feedback No. of feedback No. of feedback (a) E ≤ 10%. (b) E ≤ 20%. (c) E ≤ 30%.

Fig. 4: With up to 4, 8, and 13 feedback respectively, RACE achieves at least 90% of its full gain. This result is independent of the number of users. Here, we set the number of users to 500, and the number of packets to M = 20. 8

100 100 100

75 75 75

(%) 50 (%) 50 (%) 50

Gain 25 Feedback from all users Gain 25 Feedback from all users Gain 25 Feedback from all users Varied no. of feedback Varied no. of feedback Varied no. of feedback 0 0 0 1 20 40 60 80 100 1 20 40 60 80 100 1 20 40 60 80 100 No. of feedback No. of feedback No. of feedback (a) E ≤ 10%. (b) E ≤ 20%. (c) E ≤ 30%.

Fig. 5: With up to 7, 5, and 6 feedback respectively, RACE achieves at least 90% of its full gain. This result is independent of the number of users. Here, we set N = 500, M = 20, and the number of coded packets to four.

40 40 40

30 30 30 (%) (%) (%) 20 20 20

Gain RACE Gain RACE Gain RACE 10 10 10 CrowdWiFi CrowdWiFi CrowdWiFi 0 0 0 1 10 20 30 40 50 1 20 40 60 80 100 1 40 80 120 160 200 No. of feedback No. of feedback No. of feedback (a) 100 Users. (b) 500 Users. (c) 1000 Users.

Fig. 6: The CrowdWiFi encoder requires feedback from about 15% of all users to recover as many lost packets as RACE. The number of packets is M = 20 and the erasure rates are uniformly distributed in the interval (0, 0.2).

40 40 40

30 30 30 (%) (%) (%) 20 20 20

Gain RACE Gain RACE Gain RACE 10 10 10 CrowdWiFi CrowdWiFi CrowdWiFi 0 0 0 1 10 20 30 40 50 1 50 100 150 200 250 1 100 200 300 400 500 No. of feedback No. of feedback No. of feedback (a) 100 Users. (b) 500 Users. (c) 1000 Users.

Fig. 7: The CrowdWiFi encoder requires feedback from about 40% of all users to recover as many lost packets as RACE. The number of packets is M = 10 and the erasure rates are uniformly distributed in the interval (0, 0.2).

600 600 600 M = 10 M = 10 M = 10 450 M = 20 450 M = 20 450 M = 20 300 300 300

Speedup 150 Speedup 150 Speedup 150

0 0 0 1 20 40 60 80 100 1 20 40 60 80 100 1 20 40 60 80 100 No. of feedback No. of feedback No. of feedback (a) E ≤ 10%. (b) E ≤ 20%. (c) E ≤ 30%.

Fig. 8: Speedup: the ratio of runtime of the CrowdWiFi encoder over that of RACE. 9

APPENDIX A APPENDIX B PROOF OF THEOREM 1 PROOF OF THEOREM 2

′ Let the binary random variable yd,i be the number of recovered packet at user ui, and

hi Let C denote the set of packets XORed to generate the coded d−1 (M − hi) packet, and xi,C, 1 ≤ i ≤ N, C ⊆P, be a binary random ∆i = M . variable such that  d 1 if the coded packet 1) is received at user i, and We have  xi,C = 2) results in a packet recovery at user i;  E[y′ |H ] 0 Otherwise d,i i 1 ′ Note that a user cannot recover any packet if it does not receive = E[yd,i|Hi, Ei = ǫ]P r(Ei = ǫ|Hi)dǫ the coded packet. That is why the random variable xi,C is set Z0 1 hi to zero if the coded packet is not received at node i. Also, a d−1 (M − hi) received coded packet can result in a packet recovery only if = M · (1 − ǫ) P r(Ei = ǫ|Hi)dǫ the user is missing exactly one packet from the set C. Z0  d ! 1 N  The random variable XC = i=1 xi,C is the sum of N = ∆i · (1 − ǫ)P r(Ei = ǫ|Hi)dǫ independent binary random variables, thus, by a Chernoff 0 Z 1 bound, we get P P r(Ei = ǫ) = ∆i · (1 − ǫ) · P r(Hi|Ei = ǫ)dǫ 2 P r(H ) −δ µC Z0 i P r(XC > (1 + δ)µC) ≤ e 3 (2) 1 P r(Hi|Ei = ǫ) = ∆i · (1 − ǫ) dǫ N ∗ 1 0 P r(Hi) Let PC = N · i=1 P r(xi,C = 1) and p = maxC⊆P PC . We ∗ Z 1 have µC = N · PC and GR = maxC∈P µC = N · p . By (2), P r(Hi|Ei = ǫ) we get P = ∆i · (1 − ǫ) 1 dǫ 0 P r(H |E = x)P r(E = x)dx Z 0 i i i GR 1 P r (XC > (1 + δ)GR)= P r XC > (1 + δ) · · µC 0 (1 − ǫ)PR r(Hi|Ei = ǫ)dǫ µC = ∆i ·   1 P r(H |E = x)dx p∗ R 0 i i = P r XC > (1 + δ) · · µC 1 M hi M−hi PC 0 (1R − ǫ) d (1 − ǫ) ǫ dǫ   = ∆i · 1 M hi M−hi R 0 d (1 − x) x dx ∗ p 1 hi+1 M−hi ≤ P r XC > (1 + δ · ) · µC 0 R(1 − ǫ) ǫ dǫ PC = ∆i · 1 h M−h R (1 − x) i x i dx  δ′  0   1 ′2 hi+1 M+1−(hi+1) −δ·µC  (1 − ǫ) ǫ dǫ 3 R0 ≤ e | {z } = ∆i · 1 . ∗ hi M−hi p 2 (1 − x) x dx ′2 −(δ· ) NPC R 0 −δ ·N·PC PC = e 3 = e 3 We have R 2 ∗ ǫ ≤ e−δ Np ≤ . ∀ a,b,a − b ∈ Z≥0 2M 1 M b a−b b!(a − b)! The total number of subsets C of P is 2 , and P r(XC > f(a,b)= (1 − x) x dx = , ǫ 0 (a + 1)! (1 + δ)GR) ≤ 2M for every random variable XC. Therefore, Z by the union bound, the probability that XC > (1 + δ)GR for thus at least one set C is at most ′ f(M +1,hi + 1) M ǫ E[yd,i|Hi] = ∆i · 2 · M = ǫ. f(M,hi) 2 (b+1)!(a−b)! Thus, (a+2)! = ∆i · b!(a−b)! Gopt = max XC ≤ (1 + δ)max µC = (1+ δ)GR. (a+1)! C⊆P C⊆P h +1 = ∆ · i . with probability at least 1 − ǫ. Therefore, i M +2

GR ≥ (1 − δ) · Gopt, Note that ′ ′ with probability at least 1 − ǫ. E[yd,i|H1,H2,...,HN ]= E[yd,i|Hi], 10

′ because yd,i is independent of the events Hj , j 6= i. We have [17] D. Nguyen and T. Nguyen, “Network coding-based wireless media transmission using pomdp,” in Packet Video, 2009, pp. 1–9. N [18] R. A. Costa, D. Munaretto, J. Widmer, and J. Barros, “Informed network ′ ′ E[Yd|H1,H2,...,HN ]= E[yd,i|H1,H2,...,HN ] coding for minimum decoding delay,” in International Conference on i=1 Mobile Ad Hoc and Sensor Systems (MASS), 2008, pp. 80–91. XN [19] S. Rayanchu, S. Sen, J. Wu, S. Banerjee, and S. Sengupta, “Loss-aware = E[y′ |H ] network coding for unicast wireless sessions: design, implementation, d,i i and performance evaluation,” in ACM SIGMETRICS Performance Eval- i=1 uation Review, vol. 36, no. 1. ACM, 2008, pp. 85–96. X h N i [20] H. Seferoglu and A. Markopoulou, “Opportunistic network coding for d−1 (M − hi) hi +1 = · video streaming over wireless,” in Packet Video, 2007, pp. 191–200. M M +2 i=1  d ! [21] W. Chen, K. B. Letaief, and Z. Cao, “Opportunistic network coding X for wireless networks,” in International Conference on Communications REFERENCES  (ICC), 2007, pp. 4634–4639. [1] Cisco visual networking index: Forecast and [22] H. Seferoglu and A. Markopoulou, “Video-aware opportunistic network methodology, 2016-2021. [Online]. Available: coding over wireless networks,” IEEE Journal on Selected Areas in https://www.cisco.com/c/en/us/solutions/collateral/service-provider/visual-networking-index-vni/compleCommunications, vol.te-white-paper-c11-481360.html 27, no. 5, 2009. [2] D. Ferreira, R. A. Costa, and J. Barros, “Real-time network coding for [23] C. Fragouli, D. Lun, M. M´edard, and P. Pakzad, “On feedback for live streaming in hyper-dense WiFi spaces,” IEEE Journal on Selected network coding,” in Annual Conference on Information Sciences and Areas in Communications, vol. 32, no. 4, pp. 773–781, 2014. Systems (CISS), 2007, pp. 248–252. [3] A. Le, A. S. Tehrani, A. Dimakis, and A. Markopoulou, “Recovery [24] A. Le, A. S. Tehrani, A. G. Dimakis, and A. Markopoulou, “Instantly of packet losses in wireless broadcast for real-time applications,” decodable network codes for real-time applications,” in Workshop on IEEE/ACM Transactions on Networking, vol. 25, no. 2, pp. 676–689, Network Coding and Applications (NetCod), 2013, pp. 1–6. 2017. [25] M. Muhammad, M. Berioli, G. Liva, and G. Giambene, “Instantly [4] L. Keller, E. Drinea, and C. Fragouli, “Online broadcasting with decodable network coding protocols with unequal error protection,” in network coding,” in Workshop on Network Coding and Applications International Conference on Communications (ICC), 2013, pp. 5120– (NetCod), 2008. 5125. [5] Y. Bejerano, V. Gupta, C. Gutterman, and G. Zussman, “AMuSe: [26] S. Katti, H. Rahul, W. Hu, D. Katabi, M. M´edard, and J. Crowcroft, Adaptive multicast services to very large groups-project overview,” in “XORs in the air: practical coding,” IEEE/ACM Computer Communication and Networks (ICCCN), 2016, pp. 1–9. Transactions on Networking (ToN), vol. 16, no. 3, pp. 497–510, 2008. [6] D. Salyers, A. Striegel, and C. Poellabauer, “Wireless reliability: [27] A. Arefi, M. Khabbazian, M. Ardakani, and G. Bansal, “Blind instantly Rethinking 802.11 packet loss,” in International Symposium on a World decodable network codes for wireless broadcast of real-time multime- of Wireless, Mobile and Multimedia Networks, WOWMOM, 2008, pp. dia,” IEEE Transactions on Wireless Communications, vol. 17, no. 4, 1–4. pp. 2276–2288, 2018. [7] R. Ahlswede, N. Cai, S.-Y. Li, and R. W. Yeung, “Network information [28] Y. Birk and T. Kol, “Coding on demand by an informed source (ISCOD) flow,” IEEE Transactions on information theory, vol. 46, no. 4, pp. for efficient broadcast of different supplemental data to caching clients,” 1204–1216, 2000. IEEE Transactions on Information Theory, vol. 52, no. 6, pp. 2825– [8] A. Eryilmaz, A. Ozdaglar, M. M´edard, and E. Ahmed, “On the 2830, 2006. delay and throughput gains of coding in unreliable networks,” IEEE [29] S. El Rouayheb, A. Sprintson, and P. Sadeghi, “On coding for cooper- Transactions on Information Theory, vol. 54, no. 12, pp. 5511–5524, ative data exchange,” in Information Theory Workshop on Information 2008. Theory (ITW), 2010, pp. 1–5. [9] M. Yu, N. Aboutorab, and P. Sadeghi, “From instantly decodable [30] CrowdWiFi Streaming, Streambolico, Porto, Portugal, 2016. to random linear network coded broadcast,” IEEE Transactions on Communications, vol. 62, no. 11, pp. 3943–3955, 2014. [10] T. Ho, M. M´edard, R. Koetter, D. R. Karger, M. Effros, J. Shi, and B. Leong, “A random linear network coding approach to multicast,” IEEE Transactions on Information Theory, vol. 52, no. 10, pp. 4413– 4430, 2006. [11] D. E. Lucani, M. M´edard, and M. Stojanovic, “Broadcasting in time- division duplexing: A random linear network coding approach,” in Workshop on Network Coding and Applications (NetCod), 2009, pp. 62–67. [12] L. Lima, M. M´edard, and J. Barros, “Random linear network coding: A free cipher?” in International Symposium on Information Theory (ISIT), 2007, pp. 546–550. [13] S.-Y. Li, R. W. Yeung, and N. Cai, “Linear network coding,” IEEE Transactions on information theory, vol. 49, no. 2, pp. 371–381, 2003. [14] S.-Y. Li, N. Cai, and R. W. Yeung, “On theory of linear network coding,” in International Symposium on Information Theory (ISIT), 2005, pp. 273–277. [15] D. E. Lucani, M. Stojanovic, and M. M´edard, “Random linear network coding for time division duplexing: When to stop talking and start listening,” in INFOCOM, 2009, pp. 1800–1808. [16] A. Shokrollahi, “Raptor codes,” IEEE Transactions on information theory, vol. 52, no. 6, pp. 2551–2567, 2006.