Network Coding for Wireless Networks Wireless Communication Project by Group 2 1 Network Coding for Wireless Networks 1 INTRODUCTION 2 COPE DESCRIPTION 3 COPE IMPLEMENTATION 4 ANALOG NETWORK CODING 2 Introduction Why? What? Network Coding Definitions 3 Definitions 1 2 Max-flow Min-cut Theory Unicast, Multicast 3 Throughput 4 Max-Flow Min-Cut Theorem • (From Wiki) The max-flow min-cut theorem is a statement in optimization theory about maximal flows in flow networks • The maximal amount of flow is equal to the capacity of a minimal cut. • The maximum flow in a network is dictated by its bottleneck. [1] S.-Y. R. Li, R. W. Yeung, and N. Cai, “Linear network Coding”, IEEE Trans. 5 Graph • Graph G(V,E): consists of a set V of vertices and a set E of edges. – V consists of sources, sinks, and other nodes – A member e(u,v) of E has a capacity c(u,v) to send information from u to v 3 A 2 S 3 D B 3 2 4 2 T C 3 6 Min-Cuts and Max-Flows • • • • • Cuts: Partition of vertices into two sets Size of a Cut = Total Capacity Crossing the Cut Min-Cut: Minimum size of Cuts = 5 Max-Flows from S to T Min-Cut = Max-Flow 3 S 3 A 3 3 3 S2 2 D 3 2 A 3 3 4 1 2 D B 2 2 C 3 2 2 3 2 3 B 2 4T C T 3 7 Unicast | Multicast | Broadcast Broadcast Multicast Unicast Unicast communicat ion is oneto-one. Multicast communicat ion is oneto-many. Broadcast communicat ion is oneto-all. 8 Throughput • The amount of data transferred from one place to another or processed in a specified amount of time. • Data transfer rates for disk drives and networks are measured in terms of throughput. Typically, throughputs are measured in kbps, Mbps and Gbps. 9 Wire vs Wireless Wire vs Wireless WIRE An edge between two nodes means that the two nodes are physically connected. Multicast communication is studied while network coding of multiple unicast flows remains a largely unknown territory. The traffic rate (or distribution) is predetermined and do not change. WIRELESS Network Modeling The channel of one particular edge is actually shared by other neighboring edge. Traffic Pattern Unicast communication is the dominate traffic pattern. Traffic rates are varies over time rather than constant. Traffic Rate 10 Introduction Definitions Why? Network Coding What? 11 What is NETWORK CODING Network Coding is a field of information theory and coding theory and is a method of attaining maximum information flow in a network. Network Coding Theory points out that it is necessary to consider encoding/decoding data on nodes in network in order to achieve optimal throughput. 12 Multicast Problem • Butterfly Networks: Each edge’s capacity is 1. • Max-Flow from A to D = 2 • Max-Flow from A to E = 2 • Multicast Max-Flow from A to D and E = 1.5 • Max-Flow for each individual connection is not achieved. A 1 1 B C 0.5 1 0.5 1 F 1 1 G 0.5 1 D 1 10.5 E 13 b1 • Ahlswede et al. (2000) – With network coding, every sink obtains the maximum flow. B A b1 b2 b2 C F b1 b1+b2 b1+b2 D G b2 b1+b2 E 14 [2] Rudolf Ahlswede, Ning Cai, Shuo-Yen Robert Li, and Raymond W. Yeung. Network information flow. COPE COPE is an opportunistic approach to network coding to increase the throughput of wireless mesh networks. COPE inserts a coding layer between the IP and MAC layers, which identifies coding opportunities and benefits from them by forwarding multiple packets in a single transmission. [3] S. Katti, D. Katabi, W. Hu, and R. Hariharan, “The importance of being opportunistic: Practical network coding 15 for wireless environments An information exchange scenario Relay Alice Alice’s packet Bob’s packet Bob Bob’s packet Alice’s packet • Multi-hop unicast requires 4 transmissions • Can we do better? 16 Can Network Coding help - An idea XOR = Relay Alice Alice’s packet Bob’s packet Bob Bob’s packet Alice’s packet 3 transmissions instead of 4 Saves bandwidth & power 33% throughput increase 17 Analog Network Coding Analog network coding mixes signals instead of bits. Wireless routers forward signals instead of packets. It achieves significantly higher throughput than both traditional wireless routing and prior work on wireless network coding(COPE). 18 Introduction Definitions What? Network Coding Why? 19 Why is NETWORK CODING 1 Improve network throughput 2 Superior performance in reducing the number of retransmissions in lossy networks 3 Is able to smoothly handle extreme situations where the server and nodes leave the system 20 COPE Wireless Communication Project by Group 2 Contents 1 General idea 2 Opportunistic listening 3 Opportunistic coding 4 Opportunistic routing General idea of cope What is cope? Cope is an opportunistic approach to network coding to increase throughput of wireless mesh networks. The main characteristic of COPE is opportunism. What is opportunism? General idea of cope Opportunistic listening Opportunistic coding Opportunistic routing General idea of cope A B C D E Opportunistic Listening 1.Nodes have opportunities to hear packets even when they are not the intended receiver. 2.Nodes store all the packets they hear within a limited time slot T. 3.Nodes send reception reports to their neighbors, helping to create more coding opportunities. pool A Que A B E D C B Output E1 E2 E E3 pool D Output A1 A2 A3 E1:B to E A1:D to A pool A Que A B E E1 D B Output C E E1 E2 E3 pool E1 D Output A1 A2 A3 E1:B to E A1:D to A pool E1 A Que A B E D C B E E1 Output E2 E3 pool E1 Output A1 A2 A3 D E1:B to E A1:D to A pool E1 I have E1 A Que E1 A B E D C B Output E2 E E3 pool D Output A1 A2 A3 E1:B to E A1:D to A pool E1 A Que E1 A E1 B E D C B Output E2 E E3 pool D Output A1 A2 A3 E1:B to E A1:D to A pool E1 A Que E1 A E1 B E D C B Output E2 E E3 pool A1 A1 D Output A2 A3 A1 E1:B to E A1:D to A pool E1 A Que E1 A E1 B E D A1 B Output E2 C E A1 A1 E3 pool D Output A2 A3 E1:B to E A1:D to A pool E1 A Que E1 A E1 A1 B E D C B Output E2 E I have A1 E3 pool A1 D Output A2 A3 E1:B to E A1:D to A pool E1 A Que A Node A have packet E1 Node E haveCoding packet A1 Node A want packet A1 Node E want packet E1 opportunity So I can give Node A So I can give Node E E1 A1 E1+A1 E1+A1 E1 B E A1 D C B Output E2 E E3 pool A1 D Output A2 A3 E1:B to E A1:D to A pool E1 Coding opportunity A Que E1 E1 E1+A1 A1 A1 A E1 B E A1 D C B Output E2 E E3 pool A1 D Output A2 A3 E1:B to E A1:D to A pool E1 Coding opportunity A Que A E1+A1 E1 B E A1 D C B Output E2 E E3 pool A1 D Output A2 A3 E1:B to E A1:D to A pool E1 A Que A E1 B E A1 D E1+A1 C B Output E2 E E3 pool A1 D Output A2 A3 E1:B to E A1:D to A E1+(E1+A1)=A1 A1 received! pool E1 E1+A1 A Que A E1 B E A1 D C B Output E2 E E1+A1 E3 pool A1 A1+(E1+A1)=E1 E1 received! D Output A2 A3 E1:B to E A1:D to A Opportunistic Coding How can the node decide which packets needed to XOR together? Each node should answer this question based on local information and without consulting with other nodes. Each node has several options to decide which packets to XOR together to gain the maximum throughput. Opportunistic Coding C A B D Opportunistic Coding Packets P1 P2 Next Hops A B P4 P3 P2 B’s queue P3 P4 C D B Node P1 Opportunistic Coding Packet node P1----- A P2-----B P3----- C P4----- D P1 = P2 P4 P4 P3 P2 A P4 + P1 C P1 B P3 D = P1 + P2 P3 Bad coding decision P1 Opportunistic Coding Packet node + P1 P1----- A P2-----B P3----- C P4----- D P3 P4 P4 P3 P2 A P4 = P1 C P1 B P3 D P3 + = P1 = P1 + P3 P3 Better coding decision P1 Opportunistic Coding Packet node P4 P1----- A P2-----B P3----- C P4----- D + P1 + = P4 P4 P3 P2 A P1 P4 + P3 + P1 C B P1 P4 P3 + P3 + = P4 P3 D = P1 = P1 + P3 + P4 P3 Best coding decision P1 Opportunistic Coding Theory: To transmit n packets, p1,…,pn, to n receivers, r1,…,rn, a node can XOR the n packets together only if each intended receiver ri has all n-1 packets pj for j not equals to i. Opportunistic Coding Pi-1 Pi ri-1 ri P3 P2 Pn-2 r3 P1…Pi-1,Pi+1…Pn P1…Pi-2,Pi…Pn r2 P1 rn-2 Pn-1 rn-1 Pn r1 rn :XOR P1 to Pn Opportunistic Coding Whenever a node has a chance to transmit a packet, it tries to find the largest n that satisfies the above rule. The node tries to maximize the number of packets delivered in a single transmission. Opportunistic Routing Can we further reduce the number of transmissions? 1.The path is stored in the packet itself. 2.Check the path, find the opportunities to routing. Opportunistic Routing Path: SABD Reception report source A S B Destination D Conclusion • Main idea of cope: 1.Overhear on the medium. 2.Learn the status of its neighbors. 3.Detect coding opportunities. 4.Code as long as the receivers can decode. COPE IMPLEMENTATION & PERFORMANCE 52 Agenda Data Structure for each node Pseudo broadcast mechanism COPE layer COPE header Gain 53 DATA STRUCTURE 54 A SCENARIO Packet Delivery A B P RR Reception report PC DP P IP packet Ack IP acknowledge G E PF 55 A SCENARIO(II) Packet acknowledge A B Ack RR Reception report C Ack D P IP packet Ack IP acknowledge G Ack E Ack F 56 A SCENARIO(III) Reception Report A RR RR B RR Reception report RR C RR D P IP packet Ack IP acknowledge RR G RR E RR F 57 DATA STRUCTURE A B RR Reception report C D P IP packet Ack IP acknowledge G E F 58 DATA STRUCTURE In Node C C Upper Layer P6 Output Queue: P5 P4 P3 P2 P1 Retransmission pool: Packet Transmitted 59 DATA STRUCTURE In Node C C Upper Layer P6 Output Queue: P5 P4 P3 P2 Retransmission pool: P1 can be deleted Ack Received P1 P1ack If returns is nottoreceived Output Queue after a long to wait time another transmission opportunity 60 DATA STRUCTURE In Node C C Upper Layer P6 Output Queue: P5 P4 P3 P2 P1 Retransmission pool: Px is head for node D Not C. Opportunity Listening Queue: RR:a,b,c,d,x Pa Pb Pc Pd If node C receivenode a neighbor’s whose destination is not Periodical,Each inform itspacket neighbor about what they’ve gotC, Node C just put the packet into the above in its Opportunity Listenning Queue. That queue. is , Reception Report 61 DATA STRUCTURE In Node C C Upper Layer P6 Output Queue: P5 P4 P3 P2 P1 Retransmission pool: Opportunity Listening Queue: Pa Pb Pc Pd Px Neighbors’ virtual Queue: A queue B queue D queue …… ………………………… 62 DATA STRUCTURE In Node C C Upper Layer P6 Output Queue: P5 P4 P3 P2 P1 Retransmission pool: Used for decoding Opportunity Listening Queue: Pa Pb Pc Pd Px Neighbors’ virtual Queue: A queue RR from A B queue RR from B D queue RR from D …… ………………………… Used for Coding 63 DATA STRUCTURE LOGIC • Packet headed to the same destination can never be coded together • It is not necessary to code a packet in opportunity listening queue • It is not necessary to transmit a packet when it is received again from its destination • A node can decode a packet which is coded with one of the packet he once send 64 DATA STRUCTURE Upper Layer P6 Output Queue: P5 P4 P3 P2 P1 Retransmission pool: Opportunity Listening Queue: 65 DATA STRUCTURE 4 PARTS: Output Queue Retransmission Pool Opportunity Listening Queue Neighbor’s Virtual Queue 66 PSEUDO BROADCAST MECHANISM Laptop2 Both laptop2 and laptop3 are the intended Receiver of packet from laptop1 Laptop3 Laptop1 67 [4] Katti S, Rahul H, Hu WJ, Katabi D, Muriel M, Crowcroft J. XORs in the air: Practical wireless networking. PSEUDO BROADCAST Current WLAN medium access mechanism 802.11 MAC: 1. DCF CSMA/CA(mandatory) -Distributed Foundation Wireless MAC -Collision avoidance via randomized back-off -ACK packet for acknowledgement(not for broad cast) 2. DCF RTS/CTS(optional) -avoids hidden terminal and exposed terminal 3. Point Coordination Function(infrastructure mode) How to apply COPE? Opportunistic Listenning? Multiple intended receiver? All neighbors can receive? BROADCAST 68 PSEUDO BROADCAST 802.11 Broadcast mode: 802.11 MAC: 1. DCF CSMA/CA? Yes 2. Back off? No 3. DCF RTS/CTS? No 4. ACK? No POOR RELIABILITY 69 PSEUDO BROADCAST SOLUTION? 802.11 MAC: 1. Develop a brand-new MAC access protocol which is suitable for COPE broadcast Hard to implement…..Unrealistic…. 802.11 WLAN MAC already pervasive 2. a new layer on top the current 802.11 2. Add PSEUDO BROADCAST MAC layer to make link-to-link broadcast reliable. Feasible! 70 PSEUDO BROADCAST Reliability 1. ACK 2. Retransmission(ACK timeout) 3. Multiple Intended Receiver Multi receiver One receiver DIFS& backoff SIFS SIFS Synchronous Acknowledgement does not work! Packet Packet Receiver can send ACK packet asynchronously ACK ACK 1. We can treat Ack packet as a normal packet, ACK packets ACK also go through the DIFS ACK from different Receivers and back off procedure to avoidACK collision ACK 2. Or we can piggy back on packet travelling in the reverse direction Collision! 71 PSEUDO BROADCAST What should be contained in COPE packet? 1. XORed(coded) packet with multiple receivers 2. uncoded packet with multiple receivers(all neighbors) 3. Reception Report with multiple receivers (all neighbors) 4. Packet Acknowledge with certain receiver Later on we will give a detailed description about the COPE packet format 72 COPE LAYER Where does cope layer lies in? COPE layer is a very slim layer lies between Network layer and MAC layer. Network Layer COPE layer MAC layer COPE layer process the network layer packets before they are send to MAC layer COPE layer process the MAC layer frames before they Are send to Network layer It is the COPE layer where the four data structure: Output Queue, Retransmission pool, Opportunistic listening pool And neighbors’ virtual queue lies in. 73 COPE LAYER Sender side Get a packet from network layer Network Layer Add the packet into Output Queue COPE layer Encode if possible MAC layer 74 Get a packet from network layer COPE LAYER Sender side Add the packet into Output Queue Encode if possible Yes Network Layer Encoded? No COPE layer Piggy back Reception Report Add packet to Retransmission pool MAC layer Piggy back asynchronous acknowledge To MAC layer 75 COPE LAYER receiver side Yes Am I the next hop? No Add to opportunity listening pool Network Layer COPE layer Record RR in Extract Reception Report neighbors’ virtual queue If there is any MAC layer Extract acks for me Delete correponding packets in retransmission pool If there is any Get a packet from MAC 76 COPE LAYER receiver side Deliver to Network layer Send into Output Queue No Network Layer Yes Am I destination? COPE layer Decode and schedule Ack MAC layer No Yes This packet is encoded? Decodable? Yes I am the next hop 77 COPE HEADER MAC header Encoded Packet ID COPE header Reception Report(Packet ID) IP header Asynchronous ACK 1. Encoded packet number Enocded packet IDs Intended receiver s 2. Number of packets received Packets ID 3. Received packets’ ID ACK receiver Data Frame 78 Coding Gain [3] S. Katti, D. Katabi, W. Hu, and R. Hariharan, “The importance of being opportunistic: Practical network coding 79 for wireless environments Coding Gain 80 [4] Katti S, Rahul H, Hu WJ, Katabi D, Muriel M, Crowcroft J. XORs in the air: Practical wireless networking. Coding Gain 81 [4] Katti S, Rahul H, Hu WJ, Katabi D, Muriel M, Crowcroft J. XORs in the air: Practical wireless networking. ANALOG NETWORK CODING 82 Alice-Bob topology [5] Katti S, Gollakota S, Katabi D: Embracing Wireless Interference: Analog Network Coding 83 Traditional Approach Alice transmits Bob transmits Router forwards Router forwards Alice Router Bob Time slot 1 Time slot 2 Time slot 3 Time slot 4 84 Digital Network Coding Alice transmits Bob transmits Router forwards Time slot 1 Time slot 2 Time slot 3 Alice Router Bob 85 Analog Network Coding Alice & Bob transmits Router forwards Time slot 1 Time slot 2 Alice Router Bob 86 How can we do it? Alice Bob 87 How can we do it?(Cont.) Alice REC Alice SND 88 How can we do it?(Cont.) • What will Alice do? Demodulate and do some signal processing Note the starting bit for interferenced signal Do XOR for interferenced signal 89 How can we do it?(Cont.) • Smart Alice! • She must learn the characters of the wireless channel • She must store the packets which already sent by herself • She may do the XOR job effectively 90 Easier? • Choose the right modulation method •MSK • Some experiments are already done by using Software Defined Radios (SDR). • Successful results showed that we got significant throughput gains compared to COPE and traditional ways. 91 Drawbacks • Vulnerable to noises • Difficult to use in more complex topology networks 92 93 Wireless Communication Project by Group 2 94 Wireless Communication Project by Group 2 95