550 likes | 564 Views
Wireless Mesh Networks. XORs in the Air A. Zubow. “XORs in The Air: Practical Wireless Network Coding”, Sachin Katti, Hariharan Rahul, Wenjun Hu, Dina Katabi, Muriel M´edard, Jon Crowcroft, http://piper.csail.mit.edu/papers/copesc.pdf. Introduction - COPE.
E N D
Wireless Mesh Networks XORs in the Air A. Zubow “XORs in The Air: Practical Wireless Network Coding”, Sachin Katti, Hariharan Rahul, Wenjun Hu, Dina Katabi, Muriel M´edard, Jon Crowcroft, http://piper.csail.mit.edu/papers/copesc.pdf
Introduction - COPE • New Architecture For Wireless Mesh Networks • Routers Forward & Code (Mix) Packets • Intelligent Mixing Improves Throughput • Prior Work = Theoretical & Multicast • This Study = Practical & Unicast • COPE = Inter-flow Network Coding • MORE = Intra-flow Network Coding
COPE • Substantially improves throughput • ‘Coding Shim’ between IP and MAC Layers • Finds coding opportunities • Benefits by sending multiple packets in single transmission (wireless broadcast)
COPE: Simple Example • Bob & Alice • Current approach = 4 transmissions • COPE = 3 transmissions • Thus allowing for increased throughput • Coding+MAC
COPE: Even Bigger Savings • Previous example: obvious throughput gains • COPE exploits shared nature of wireless medium (broadcast) • Nodes overhear transmissions • Store these packets for short time • Sends data out telling what it has heard • This data is used for opportunistic coding
Opportunistic Coding • Each node uses knowledge of what it’s neighbors have (which packets) • This information allows for source to send XOR’ed packets intelligently • It knows who will be able to decode the encoded packet • Allows for more than two flows • Allows for multiple packets to be coded
COPE = 2 Key Principles • COPE exploits broadcast nature of wireless channel • COPE employs network coding • Packets are mixed before transmission • COPE addresses: • Unicast traffic • Dynamic & bursty flows • Other practical issues regarding implementation
Summarized Findings • Network coding can improve wireless throughput • When congested with mainly UDP flows throughput gains 3 - 4x • For mesh networks connected to Internet via AP gains depend on total download / upload traffic @ AP • w/o hidden terminals TCP throughput increases about 38%
Background (Theory) Famous Butterfly Example: • All Links Can Send One Message Per Unit of Time • Sources Want to Hit Both Receivers • Coding (Again) Increases Overall Throughput
Background (cont.) • Ahlswede et al. pioneered network coding • Routers that mix information allow communication to achieve multicast capacity • Li et al. found for multicast linear codes sufficient to achieve max capacity bounds
COPE Overview • COPE terms:
COPE Overview • 3 Main Techniques • Opportunistic Listening • Opportunistic Coding • Learning Neighbor State
COPE Overview:Opportunistic Listening • Wireless is a broadcast medium • Many chances for nodes to overhear • COPE sets all nodes as promiscuous • They store overheard packets for time (T) • Default T = .5 seconds • Also: reception reports are sent out • These are tacked onto normal output • Includes seq. number of stored packets
COPE Overview:Opportunistic Coding • Q.: Which packets do we combine to achieve maximum throughput? • A.: Send as many (native packets) as possible while ensuring nexthop has enough info to decode.
COPE Overview:Opportunistic Coding • Always seeking largest N that satisfies above rule
COPE Overview:Learning Neighbor State • Each node announces its stored packets in reception reports • Sometimes reports don’t get through • Congestion or in times of light traffic • To solve this problem: educated guess • Estimation of probability that neighbor has packet based on delivery probability
COPE’s Gains • How Beneficial is COPE? • Throughput improvement depends on: • Coding opportunities • Traffic patterns
COPE’s Gains:Coding Gain • Coding Gain: • # transmissions w/o coding to the minimum # transmissions w/ Coding • Remember Alice & Bob? • Coding gain = 4/3 = 1.33
COPE’s Gains:Coding Gain • Maximum Achievable Coding Gain? • For arbitrary topologies - open question • Authors prove: • With listening certain topologies benefit
COPE’s Gain:Coding Gain • Interesting to note: • Previous slide talks about theoretical gain • In practice gains are lower due to: • Coding opportunities • Packet header overhead • Medium losses • COPE coding gains are not lost when medium is fully utilized.
COPE’s Gain:Coding+MAC Gain • Interaction between coding & MAC • Beneficial results • Example Bob & Alice • MAC divides bandwidth between 3 • w/o coding router sends 2 x more • Makes router a bottleneck • COPE allows routers queue to drain fast • Coding + MAC gain of Alice & Bob = 2
COPE’s Gain:Coding+MAC Gain • Authors Prove:
Making It Work - Packet Coding Algorithm • Packets are never delayed • If there is nothing to code with, send anyway • Preference to XOR with similar lengths • Small packet XOR with large = less bandwidth • If one must XOR different lengths - pad • Never code packets to same next hop
Making It Work - Packet Coding Algorithm • Searching for appropriate packets to code is efficient • FIFO output queue: • De-queue, small or large?, Look at appropriate queues (only heads to avoid reordering) • Worst case - looks @ 2M packets (M=# neighbors) • Packet reordering bad (TCP thinks congestion) • Doesn’t happen much but if so they are put in order before transport layer
Making It Work - Packet Coding Algorithm • Finally relay nodes all estimate probability that neighbor has packet prior to sending • PD must stay higher than threshold G (G = 0.8 default) • If equation is above G each nexthop has probability G of being able to decode next packet
Making It Work - Packet Decoding • Fairly Simple • Each node maintains a packet pool • Searches hash table keyed on packet ID • XORs native packets with coded packets • Gets packet meant for it (node)
Making It Work -Pseudo-Broadcast • 802.11 Has Two MAC Modes: • Unicast • Broadcast • Unicast • Packets Are Ack-ed • Exponential Backoff • Broadcast • Un-Reliable • No Backoff
Making It Work -Pseudo-Broadcast • Pseudo-Broadcast • Piggy backs unicast • Link-layer destination set to one intended node • XOR header added • Other nodes can overhear transmission • If receiving node is nexthop - continue • Else store packet in buffer • More reliable than pure broadcast • Packets have several tries to get to destination • Snooping nodes get more chances to update their buffers
Making It Work - Hop-by-Hop ACKs and Retransmissions • (Again) Encoded packets require all nexthops to acknowledge receipt of native packet • Packets headed many places & only link layer designated hop returns synchronous ACK • COPE may guess node has enough info to decode when it really does not
Making It Work - Hop-by-Hop ACKs and Retransmissions • When a node sends an encoded packet it schedules a retransmission event for each encoded native packet • If any packet is not Ack-ed within some threshold (time) that native packet is encoded and re-sent later • Nexthops receive packets and ACK immediately upon decoding via header (or control packets which are also used for reception reports)
Making It Work - TCP Packet Reordering • Asynchronous ACKs can cause packet reordering • TCP may see this as congestion • COPE has ordering agent • For each TCP flow ending @ host • Maintains packet buffer • Records last TCP sequence number • Will not pass on packets to transport layer until no hole exists or timer times out
Implementation Details: Packet Format • COPE inserts variable length coding header • Only shaded fields below required
Implementation Details: Packet Format • First Block: Metadata for decoding • ENCODED_NUM: # Encoded • For each packet PKT_ID (Dest. IP & Seq. #) • MAC of nexthop (for each native packet) • Reception Reports • REPORT_NUM: # of Reports • SRC_IP: Source of reported rackets • Last_PKT: last packet heard from source • Bit map of recently heard packets
Implementation Details: Packet Format • Asynchronous ACKs • Cumulative ACKs on per neighbor basis • Local sequence numbers established • ACK headers start with # of ACKs • Each ACK starts with MAC of neighbor • Next each ACK has pointer to end of cumulative ACKs • Finally, bit map shows missing packets
Experimental Results • 20 Node wireless testbed • Results: • When many random UDP flows: • Throughput 3 - 4x increase • Traffic does not use congestion control: • Throughput improves - exceeding coding gain • Mesh network -> internet via gateway • Throughput improvement between 5 - 70% • w/o hidden terminals TCP’s gain agrees with expected coding gain
Experimental Results: Testbed • 20 Node wireless network • Two floors connected by open lounge • Offices, passages, etc. • Paths btw 1 & 6 hops • Loss rate btw 0 - 30% • 802.11a @ 6 Mb/s
Experimental Results: Testbed • Nodes ran Linux / used Click toolkit • Testbed used Srcr routing protocol • Djikstra’s shortest path algorithm • Each node had 802.11 card w/ omni-directional antenna • 802.11 ad hoc mode w/ RTS / CTS disabled • udpgen & ttcp used to generate traffic • Long-live flows & attempt to match internet traffic
Metrics • Network throughput • E2E throughput • Throughput gain • Ratio of measured network throughputs with and without COPE • What else might have been interesting?
COPE in Gadget Topologies • Toy topologies • Very small loss rate & no hidden terminals (40 different runs) • Long-lived TCP flows • Close to expected (minus overhead)
COPE in Gadget Topologies • Above results show that w/ congestion control results lean towards coding gain rather than Coding+MAC • When many long-lived flows (TCP) bottleneck senders backoff (to avoid drop) • This leaves only coding gains
COPE in Gadget Topologies • Repeat of Above w/ UDP • Coding+MAC Gains (Better Than TCP) • Coding Allows Downstream Routers to Avoid Dropping Packets Already Having Consumed Bandwidth Worcester Polytechnic Institute
COPE in an Ad Hoc Network • TCP • TCP flows arrive w/ poisson process • Pick sender & receiver randomly • Traffic models Internet • No significant improvement (2-3%) • Hidden terminals are culprit • Many retransmissions • Queues @ bottlenecks never build up • Therefore no coding gains (or opportunities) • Would TCP do better w/o collisions?
COPE in an Ad Hoc Network • Compressed topology • Within carrier sense range • Artificially impose original loss rates • Hidden terminals = no more • At peak 38% gain over no coding
COPE in an Ad Hoc Network • UDP (back to large scale testbed) • Random sender / receiver • File size follows Internet studies • 500 experiments…
COPE in an Ad Hoc Network • Scare coding opp. at low demands • demand up / congestion up / gain up
COPE in an Ad Hoc Network • Low demand - reports arrive to late • Demand goes up - bottlenecks form - longer wait times - nodes get more reports • Demands get higher - high loss rates of reception reports - guessing relied upon
COPE in an Ad Hoc Network • @ peak gain point (5.6 Mb/s) • On average 3 packets coded together • Packets drained from bottlenecks faster • Throughput gains 3 - 4 x
COPE in a Mesh Access Network • Growing interest in accessing Internet via multi-hop network with one (or more) gateways • Nodes divided into 4 sets (1 is gateway) • UDP flows • Fluctuate upload / download traffic • Gain goes up as upload traffic up