3 A Computer Network Hosts are sources/destinations of data RoutersHostsHosts are sources/destinations of dataRouters relay data
4 Network Coding Performing coding on the content of packet on routers Increases multicast capacity in wired networks - Alswede et. al, 2000.y1y1f1(y1,y2,y3)y1y2f2(y1,y2,y3)y3y3y3Routing Network CodingNetwork coding refers to the notion of performing coding on the content of packet throughout the network. Let’s think about a router in conventional networks. What it does is forwarding messages. Each packet on an output link is just a copy of a message on an input link. But in network coding, the router can perform some computation, so that each message on an output link can be a function of the messages on the input links. So you can have some processing, or coding, in the network, instead of just at the endpoints. What would that buy you?
5 Benefit of Network Coding yxCBAxxyx yACBCBAACByCBAyCBAy = x (x y)x4 transmissions without NC3 transmissions with NC(Katabi’05, Chou’04)
6 Benefit of Network Coding yxCBAyxxCBACBAx+yACByCBACBAy2 transmissions with PNC/ANCCBAx(Zhang’06, Katabi’07)4 transmissions without NC
7 NC achieves multicast capacity a+b,a,ba,bboptimal routing throughput = 1network coding throughput = 2Alswede, Cai, Li, Yeung (2000):mintЄT MinCut(s,t) is always achievable by network codingh = mintЄT MinCut(s,t) is “multicast capacity”senderNetwork coding was first developed for wired multicasting. The good thing of network coding is that it increase end-to-end throughput in multicasting. In this wired network example where each link has unit capacity network coding can achieve end-to-end throughput of 2 whereas conventional multicast can achieve end-to-end throughput of 1.In this example, since the given network is simple, we can easily identify where and how to code to achieve optimal capacity of the network.receivercoding node
8 How to code? Given: Directed graph (V,E) Sender s Receiver set T (subset of V)
9 Random Linear Coding [Chou’03, Ho’03] SenderxyzEvery packet p carries e = [e1 e2 e3] encoding vector prefix indicating how it is constructed(e.g., coded packet p = ∑eixi where xi is original packet)Aαx + βy + γzbufferOn every intermediate node, we transmit a random mix/combination of packets in its local buffer.Random combinationDestinationIntermediate nodes randomlymix incoming packets togenerate outgoing packets
10 Preliminaries- Linear Algebra Vectors (lowercase boldface)r1 = (1, 2, 3), r2 = (1, 2, 1)Linear combinationa*r1+b*r2 where a and b are scalarsLinear independenceif there is no pair a and b such that a*r1 + b* r2 = 0 and a are b non-zeroPackets represented as vectors256byte packet = > a set of 256 elementsLinear combination of two packets => linear combination of two vectors
11 Random Linear Coding Original Packets p1 p2 p3 g*p1 + h*p2 + e*p3 = n3 a*p1 + b*p2 + c*p3 = n1d*p1 + e*p2 + f*p3 = n2n1n2n3From mathematics point of view, packets are no more than vectors and vectors are sets of numbers. A linear combination of packets are the same as a linear combination of vectors. Shown an example here, we can generate n1 which is a linear combination of p1,2,3 by performing addition operation of the three packets or vectors after multiplying three scalar a, b, and c to the three packets respectively. We choose the three scalar a, ,b, and c randomly hence the name of random linear coding.
14 Mobile Peer-to-Peer(P2P) P2P file sharing in mobile wireless networksFully connectedIntermittently connected (opportunistic ad-hoc)Should leverage mobility!
15 You are driving to Vegas You hear of this new show on the radio Video preview on the web (20MB) Video clip to download after seeing a billborad on the way to Vegas…
16 P2P in opportunistic ad-hoc networks: mobility assisted dissemination GRYY2RRRInternetYYYWhen you hit other cars possessing other uses of the file, you retrieve those pieces form the other users.Gossiping Availability of BlocksExchange Blocks via multi-hop pullingDownloading Blocks from AP
17 Network Coding in P2P Swarming P2P File SwarmingFile is divided into many small pieces for distributionClients request different pieces from the server/other peersWhen all pieces are downloaded, clients can re-construct the whole fileMissing coupon problemP2P using Network CodingAvalanche, Infocom’051265Server34135624To download a file you retrieve piece by piece from other piers and when you collect all the pieces then you are done. But there is a drawback so-called missing coupon problem. Sometime, it is really difficult to collect the last piece that completes downloading. You spend 10% of time to download 99% of pieces and 90% of time to download the last problematic piece.123456
19 Network Coding Helps Coupon Collection C1 Sends Block 1C2 Sends a Coded Block: B1+B2C3 Sends Block 2B1+B2B1+B2B2B2B1+B2B1B1B1B2C1C2C3B1+B2B2B1B1+B2B1B1+B2B2C4C5C6C4 and C6 successfully recovered both blocksC5 Sends a Coded Block: B1+B2
20 CodeTorrent: Basic Idea BufferInternetBufferBuffer“coded” blockB1File: k blocksB2B3Bk+*a1*a2*a3*akRandom Linear CombinationRe-Encoding: Random Linear Comb. of Encoded Blocks in the BufferOutside Range of APExchange Re-Encoded BlocksDownloading Coded Blocks from APMeeting Other Vehicles with Coded Blocks
21 Design Rationale Single-hop better than multihop Network coding Multi-hop data pulling does not perform well in MANET (routing O/H is high)Users in multi-hop may not forward packets not useful to them (lack of incentive)!Network codingMitigates rare piece problemMaximizes benefits of overhearingExploits mobilityCarry-and-forward coded blocks
22 CodeTorrent - Beaconing Periodic broadcasting of peer ID and its code vectorUsed for searching helpful nodes: those who have at least one linearly independent code block+++Red is Helpful!
23 CodeTorrent - Single-hop pulling A peer pulls coded blocks from the helpful peers1. G pulls a coded block from R2. G checks helpfulness and repeatsRandom Linear combinationRGetBlockYGG sends a GetBlock message to RR prepares a re-encoded blockR broadcasts the re-encoded blockCheck helpfulness: If helpful, store it!
24 Simulations - Setup Terrain: 2.4x2.4 km2 Qualnet 3.9 IEEE b / 2MbpsTerrain: 2.4x2.4 km2Distributing 1MB file4KB/block * 250 blocks1KB per packetRandomly located 3 ApsComparing CarTorrent (w/ AODV) with CodeTorrentAODV w/ net-diameter 3 hopsCodeTorrent with GF(256)
25 Fraction of the # pieces/rank of all the interested nodes Simulation ResultsOverall downloading progressFraction of the # pieces/rank of all the interested nodes200 nodes 40% popularityTime (seconds)
26 Simulation Results (2) Impact of mobility Speed helps disseminate from AP’s and C2CSpeed hurts multihop routing (CarT)Car density+multihop promotes congestion (CarT)Avg. Download Time (s)40% popularity
27 Overhead Issues Packet header Computation Overheard Each packet carries encoding vector and its size scales with # of piecesif file size = 1GB & packet size = 1KB, 1M pieces exist and thus encoding vector size = 1MB, too large!Computation OverheardDecoding takes O(n3)X1X2X3e1e2e3+[e1,e2,e3]e1X1+e2X2+e3X3
28 Reducing overhead Divide file into “generations” Pieces only in the same generation can be combinedCoupon collection problem again!50MB one generation5 generations of 10MB14
30 Multicast in Real Testbed Very unreliable!ODMRP 80% delivery (2-hop) 60% delivery (3-hop)Lose RTS/CTS protection
31 Robust Multicast using NC In wireless multihop multicast, one must consider:Random errors, external interference /jamming, collisions;Motion, path breakageTarget application:Multicast (buffered) video streamingSome loss toleranceSome delay tolerance (store & playback at destination) - non interactive
32 Problem StatementMulticast streaming in mobile wireless networks is non-trivialStreaming requires: high reliability (but not 100%), low delay (but not 0)But network is: unreliable, bandwidth-limitedMajor concern: packet dropsLossy wireless channel (uncorrelated, random like errors)Route breakage due to mobility, congestion, etc (correlated errors)
33 Conventional vs NC Multicast Conventional ApproachesTime diversity => O/H, delay?Recovery scheme a la ARQ (Reliable Multicast)(End-to-end) Coding (FEC, MDC, …)Multipath diversity (ODMRP, …) => O/H?NC ApproachMain ingredient: Random Linear Coding (RLC)Exploit time and multipath diversityControlled-loss (near 100%), bounded-delay (hundreds of ms)Suitable for buffered streamingReal time version (tens of ms delay bound) exists
34 Simulation Settings Metrics QualNet 100 nodes on 1500 x 1500 m2 5 Kbytes/sec traffic (512B packet)Random Waypoint Mobility varying max speedMetricsGood packet ratios: num. of data packets received within deadline (1sec) vs. total num. of data packets generatedNormalized packet O/H: total no. of packets generated vs no. of data packet receivedDelay: packet delivery time from the source application to receiver applications
35 ODMRP vs NC: Reliability Good Packet Rationetwork coding achieves near 100% delivery flat lines regardless of mobility types; whereas with conventional routing as mobility increase delivery ratio decrease
36 ODMRP vs NC: Efficiency Important results is this: network coding approach improves reliability but incurs only half the overhead compared to conventional routing
37 ODMRP vs NC: DelayIs this fundamental trade-off?
38 Coding at sender An application generates a stream of frames … Block/Generation 1Block 2Network layer generates stream of coded packets…(delay)Generation 1Generation 2timeA random linear combination of Block 1 framesA random linear combination of Block 2 frames
39 Forwarding – Conventional Routing forwardersSourceReceiverSelect least number of nodes as forwarders to form a path b/w a S-R pairand each forwarder transmits each packet once
40 Problem – Conventional Routing forwardersReceiverWhat if route breaks?forwardersWhat if random error occurs?
41 Forwarding – NC approach forwardersSourceReceiverSelect most nodes in between a S-R pair as forwarders and each forwarder transmits one packet per generation once (what about packet storm problem?)A node becomes a forwarder if (hop count to Source + hop count to Receiver) is less than hop distance of S-R pair
42 Robustness of NC approach Robust to mobilityRobust to random errors
44 Setting up a multicast mesh Every coded packet carries in the header three more fields, vldd, dist, and nustThe one-bit field vldd is set if either the sender is a multicast receiver or has received a previous block packet with vldd bit set from one of the sender’s downstream nodesA node considers a neighboring node to be downstream if the neighboring node transmits a packet with a larger dist value than the dist value the node maintainsEach node maintains as a local variable dist, indicating the hop distance from the multicast data source and copies its value to every code packet the node transmits.Every time a node transmits a coded packet, dist is recalculated as one plus the biggest dist value found in the headers of the packets which are combined to yield the coded packetConversely, a node considers a neighboring node to be a upstream node if the neighboring node transmits a coded packet in a new block or a smaller dist valueEach node also maintains nust, indicating the number of upstream nodes as a local variable and records its value in the header of every packet the node transmitsA node broadcasts to the neighborhood r coded packets
45 Concluding remarks Two protocols covered Network coding helps CodeTorrent: NC-based mobile P2P protocolCodeCast: NC-based multicast protocolNetwork coding helpsmitigate coupon collection problem in P2Pexploit broadcast nature of wireless medium