48
Part I: Network Part I: Network Coding Coding

Part I: Network Part I: Network Coding Coding

  • Upload
    others

  • View
    8

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Part I: Network Part I: Network Coding Coding

Part I: Network Part I: Network CodingCoding

Page 2: Part I: Network Part I: Network Coding Coding

Existing networkExisting network

• Independent data stream sharing the same network resources

– Packets over the Internet

– Signals in a phone network– Signals in a phone network

– An analog: cars sharing a highway.

• Information flows are separated.

• What about we mix them?

Page 3: Part I: Network Part I: Network Coding Coding

Why do we want to mix information flows?Why do we want to mix information flows?

• The core notion of network coding is to allow and encourage mixing of data at intermediate network nodes.

• R. Ahlswede, N. Cai, S.-Y. R. Li, and R. W. Yeung, "Network Information Flow", IEEE Transactions on Information Theory, IT-46, pp. 1204-1216, 2000.

Page 4: Part I: Network Part I: Network Coding Coding

Network coding increases throughputNetwork coding increases throughput

• Butterfly network

• Multi-cast: throughput increases from 1 to 2.

a, b a, b

a b

a

a b

ba⊕b

a⊕b a⊕b

Page 5: Part I: Network Part I: Network Coding Coding

Network coding saves energy & delay in Network coding saves energy & delay in wireless networkswireless networks

• A wants to send packet a to C.

• C wants to send packet b to A.

A CBa a

• B performs coding

A CBbb

A CBa b

A CBa⊕b a⊕b

Wireless broadcast

Page 6: Part I: Network Part I: Network Coding Coding

Linear coding is enoughLinear coding is enough

• Linear code: basically take linear combinations of input packets.– Not concatenation!

– 3a+5b: has the same length as a, b.– 3a+5b: has the same length as a, b.

– + is xor in a field of 2.

• Even better: random linear coding is enough.– Choose coding coefficients randomly.

Page 7: Part I: Network Part I: Network Coding Coding

EncodeEncode

• Original packets: M1, M2, L, Mn.

• An incoming packet is a linear combination of the original packets

• X=g M +g M +L+g M .• X=g1M1+g2M2+L+gnMn.

• g=(g1, g2, L, gn) is the encoding vector.

• Encoding can be done recursively.

Page 8: Part I: Network Part I: Network Coding Coding

An exampleAn example

• At each node: do linear encoding of the incoming packets.

• Y=h1X1+h2X2+h3X3

• Encoding vector is attached with the • Encoding vector is attached with the packet.

X1X2 X3

YY

Y

Page 9: Part I: Network Part I: Network Coding Coding

DecodeDecode

• To recover the original packets M1, M2, L,

Mn.

• Receive m (scrambled) packets.

• How to recover the n unknowns?• How to recover the n unknowns?

– First, m ≥ n.

– The good thing is, m=n is sufficient.

• Received packets: Y1, Y2, L, Yn.

Page 10: Part I: Network Part I: Network Coding Coding

Coding schemeCoding scheme

• To decode, we have the linear system:

• Yi=ai1M1+ai2M2+L+ainMn

• As long as the coefficients are independent we can solve the linear independent we can solve the linear system.

• Theorem: (1) There is a deterministic encoding algorithm; (2) Random linear coding is good, with high probability.

Page 11: Part I: Network Part I: Network Coding Coding

Practical considerations (1)Practical considerations (1)

• Decoding: receiver keeps a decoding matrix recording the packets it received so far.

• When a new packet comes in, its coding • When a new packet comes in, its coding vector is inserted at the bottom of the matrix, then perform Gaussian elimination.

• When the matrix is solvable, we are done.

Page 12: Part I: Network Part I: Network Coding Coding

Practical consideration (2)Practical consideration (2)

• Control the decoding effort (size of the matrix).

• Group packets into generations. Packets in the same generation are encoded.in the same generation are encoded.

• Delay: in practice typically not much higher.

Page 13: Part I: Network Part I: Network Coding Coding

Implication of network codingImplication of network coding

• Successful reception of information

– does not depend on the receiving packet

content.

– But rather depend on receiving a sufficient – But rather depend on receiving a sufficient

number of independent packets.

Page 14: Part I: Network Part I: Network Coding Coding

What next?What next?

• Benefits of network coding

• Applications of network coding

Page 15: Part I: Network Part I: Network Coding Coding

Throughput (capacity) with codingThroughput (capacity) with coding

• Multi-cast problem: one source, N receivers in a

directed network. Each edge has a maximum

capacity.

• Without coding, the maximum throughput routing • Without coding, the maximum throughput routing

is NP-hard.

• Proof: reduction from Steiner tree packing.

• Nodes share network resources.S

Page 16: Part I: Network Part I: Network Coding Coding

Throughput (capacity) with codingThroughput (capacity) with coding

• With coding each destination can ignore the other destinations.

• Receiving data rate = min-cut.

• As if the user is using the entire network • As if the user is using the entire network by itself.

• Offer throughput benefit for unicast as well.S

Page 17: Part I: Network Part I: Network Coding Coding

Example: butterfly networkExample: butterfly network

• 2 uni-cast flow. Data rate=2.

Page 18: Part I: Network Part I: Network Coding Coding

Example: butterfly networkExample: butterfly network

• S1R2, S2R1. Data rate=1.

Page 19: Part I: Network Part I: Network Coding Coding

Summary on throughput gainSummary on throughput gain

• In directed graph, the throughput gain by network coding can be arbitrarily large.

• In undirected graph, the throughput gain is at most 2.

• Without coding, the max throughput routing is • Without coding, the max throughput routing is NP-hard.

• With coding, the max throughput coding is achievable by linear programming.– Just decide on the rate of each edge.

– Ignore the content.

Page 20: Part I: Network Part I: Network Coding Coding

Robustness and stabilityRobustness and stability

• Each encoded packet is “equally important” opportunistic routing.

• A, C may go sleep randomly without telling

B. B sends a⊕b, so whoever wakes up B. B sends a⊕b, so whoever wakes up can get new information.

A CBa b

A CBa⊕b a⊕b

Wireless broadcast

Page 21: Part I: Network Part I: Network Coding Coding

Example I: application Example I: application in gossip algorithmin gossip algorithm

• Assume n nodes each holding a packet, all of

them want all packets.

• Gossip algorithm: in each round each node

picks randomly another node and exchange 1 picks randomly another node and exchange 1

message.

• Question: what is the number of rounds (in

expectation)?

• Answer: O(n logn).

• Why? --- coupon collection problem

Page 22: Part I: Network Part I: Network Coding Coding

Gossip with codingGossip with coding

• Aka. algebraic gossip.

• Each node encodes with random linear combination of incoming (received) messages.messages.

• O(n) is enough with high probability.

• This is optimal.

Page 23: Part I: Network Part I: Network Coding Coding

Example II: Example II: packet erasure networkspacket erasure networks

• Want 2 things: low delay and high rate.

• But, packets get dropped in the middle.

• Two approaches in the literature:

– Repeat: low delay, low rate.– Repeat: low delay, low rate.

– Error correction: max rate, high delay.

• With coding, we can achieve OPT rate & delay.

Page 24: Part I: Network Part I: Network Coding Coding

Example II: packet erasure networksExample II: packet erasure networks

• Model packet loss– Congestion, buffer overflow, fading in wireless

channels.

1. End-to-end acknowledgement & Retransmission (TCP style)Retransmission (TCP style)

– Retransmissions use up resources.

– Multicast: possibly only a subset of nodes need retransmission.

2. Erasure error correction codes• First code the original k data items into n pieces.

• Recover the original data from any k pieces.

Page 25: Part I: Network Part I: Network Coding Coding

33--node examplenode example

• Erasure channel: with probability e(AB), e(BC) packet disappears on the link.

• A retransmit, B simply forward.

A CBe(AB) e(BC)

• A retransmit, B simply forward.

– Throughput: # (re)-transmissions for a packet

to reach C = 1/[(1-e(AB))(1-e(BC))].

– Why?

Page 26: Part I: Network Part I: Network Coding Coding

33--node examplenode example

• Erasure coding on each link separately.

– Node A encode k data into k/(1-e(AB)) pieces.

– Roughly B gets k data pieces, reconstruct.

A CBe(AB) e(BC)

– Roughly B gets k data pieces, reconstruct.

– Do the same at link BC.

– Extra delay for reconstruction at B.

– # transmissions for one packet to reach C is

1/(1-e(AB)) + 1/(1-e(BC))

Page 27: Part I: Network Part I: Network Coding Coding

33--node example: why coding helpsnode example: why coding helps

• Node B does not bother decode or reconstruct,

instead, send random linear combination of what

is received

A CBe(AB) e(BC)

is received

– No delay for decoding in the middle.

– Node A encode k data into k/(1-e(AB)) pieces.

– Roughly B gets k data pieces.

– B again boost up to k/(1-e(BC)) pieces.

– C is able to reconstruct.

Page 28: Part I: Network Part I: Network Coding Coding

Applications of network coding: P2PApplications of network coding: P2P

• Avalanche (http://research.microsoft.com/~pablo/avalanche.aspx)

• BitTorrent-style P2P sharing with network coding.– Big file gets chopped into small pieces.

– Randomly coded.

– Participants share their coded pieces.– Participants share their coded pieces.

• Why use coding?– Topology of the P2P users is hard to know.

– Optimal packet scheduling for large files is difficult.

– Robustness to user join/leave.

– Easy to incorporate incentive mechanisms (prevent free-riding).

Page 29: Part I: Network Part I: Network Coding Coding

Wireless networksWireless networks

• Wireless links are broadcast nature.

A CBa b

A CBa⊕b a⊕b

• Bidirectional traffic for a path:

– First alternate for two directions.

– Then use coding/wireless broadcast.

– Double the capacity.

A CB

Wireless broadcast

Page 30: Part I: Network Part I: Network Coding Coding

A perfect match: Wireless networks + A perfect match: Wireless networks + network codingnetwork coding

• Wireless channels are lousy. Make use of

overhearing for opportunistic routing.

– Residential wireless mesh network

– Many-to-many broadcast (or gossip algorithm with

broadcast).broadcast).

• Network coding is good with

– Large network

– No global topology information

– Unreliable links/nodes.

Page 31: Part I: Network Part I: Network Coding Coding

Sensor networks + network codingSensor networks + network coding

• Radio calibration– Tuning them to the same channel is energy costly.

– Channel assignment to maximize throughput is highly non-trivial.

• Untuned (non-calibrated) radios• Untuned (non-calibrated) radios– Two devices may not be able to communicate.

– With a group of them, the change that there exists two with the same channel is high. (Birthday paradox)

– But we don’t know which pair can communicate.

– Send coded packets blindly.

– Even multi-hop works (without discovering the path).

Page 32: Part I: Network Part I: Network Coding Coding

Birthday paradoxBirthday paradox

• In a room of n people, ProbNo two people have the same birthday.

Page 33: Part I: Network Part I: Network Coding Coding

Birthday paradoxBirthday paradox

2 people with the same birthday

There is one guy with the same birthday as you.

Page 34: Part I: Network Part I: Network Coding Coding

Network TomographyNetwork Tomography

• Network diagnosis of loss rate of links.

• In a multi-cast tree, the receivers that miss the

same packet can derive the failed link.

• With coding one can get more detailed • With coding one can get more detailed

information about the failure links from the

pattern of the received codes.

– Active diagnosis

– Passive network monitoring.

Page 35: Part I: Network Part I: Network Coding Coding

SecuritySecurity

• Information gets smashed.

• Protection from eavesdroppers.– It is difficult to interpret and short-term overhear does

not work.

• Packet modification is harder too. • Packet modification is harder too. – Need to fake data that makes sense

– Challenge: no idea about the original data packets.

• Jamming– Less of a problem. Jamming a few packets does not

affect a large set of data packets much.

Page 36: Part I: Network Part I: Network Coding Coding

SummarySummary

• Network coding is good for– Scalability

– Limited topological information

– Highly dynamic network– Highly dynamic network

• Key insights– Treat the packets equally

– No need to read the content, just do counting

– Anything helps.

– Don’t need to know what is where.

Page 37: Part I: Network Part I: Network Coding Coding

ReferencesReferences

• A 6-page network coding introduction.

• C. Fragouli, J. Le Boudec, Jorg Widmer, Network coding: an instant primer.

• Network coding webpage:• Network coding webpage:

http://tesla.csl.uiuc.edu/~koetter/NWC/

• A book: “Network coding theory”.

Page 38: Part I: Network Part I: Network Coding Coding

Coding in storageCoding in storage

Page 39: Part I: Network Part I: Network Coding Coding

Use coding for fault toleranceUse coding for fault tolerance

• If a sensor die, we lose the data.

• For fault tolerance, we have to duplicate data s.t.

we can recover the data from other sensors.

• Straight-forward solution: duplicate it at other

places. places.

• Storage size goes up!

• Use coding to keep storage size as the same.

• What we pay: decoding cost.

Page 40: Part I: Network Part I: Network Coding Coding

Problem setupProblem setup

• Setup: we have k data nodes, and n>k storage nodes (data nodes may also be storage nodes).

• Each data node generates one piece of data.

• Each storage node only stores one piece of (coded) data.

• We want to recover data by using any k storage • We want to recover data by using any k storage nodes.

• Sounds familiar? Reed Solomon code.

• But it is centralized -- we need all the k inputs to generate the coded information.

Page 41: Part I: Network Part I: Network Coding Coding

Distributed random linear codeDistributed random linear code

• Each node sends its data to m=O(lnk) random storage nodes.

• A storage node may • A storage node may receive multiple pieces of data c1, c2, … ck, but it stores a random combination of them. E.g., a1c1+a2c2+…+akck, where a’s are random coefficients.

Page 42: Part I: Network Part I: Network Coding Coding

Coding and decodingCoding and decoding

• Storage size is kept almost the same as before.

• The random coefficients can be generated by a pseudo-random generator. Even if we store the coefficients, the size is not much.

• Claim: we can recover the original k pieces of data from any k • Claim: we can recover the original k pieces of data from any k storage nodes.

• Think of the original data as unknowns (variables).

• Each storage node gives a linear equation on the unknowns a1c1+a2c2+…+akck = s.

• Now we take k storage nodes and look at the linear system.

Page 43: Part I: Network Part I: Network Coding Coding

Coding and decodingCoding and decoding

• Take k storage nodes at random.

n by k matrixStorage nodes

Data nodes

n by k matrixnodesEach column has m non-zeros placed randomly

k by k k =Coded

info

Need to argue

that this matrix

has full rank,

I..e, invertible.

Page 44: Part I: Network Part I: Network Coding Coding

Main theoremMain theorem

• A bipartite graph G=(X, Y), |X|=k, |Y|=k.

• X: the data nodes; Y: the k storage nodes.

• Edmond’s theorem: the matrix has full rank if the bipartite graph has a perfect matching.

• Now, we only need to show that the bipartite graph G has a perfect matching with high probability.

Page 45: Part I: Network Part I: Network Coding Coding

Main theoremMain theorem

• Upper bound: if each data node picks O(lnk) storage randomly, the bipartite graph G has a perfect matching with high probability.

• Lower bound: Ω(lnk) is necessary.

• Proof: – Any storage node has to have at least one piece of data. – Any storage node has to have at least one piece of data.

– Otherwise, the matrix has a zero row!

– Throw data randomly to cover all the storage nodes.

– Coupon collector problem: each time get a random coupon. In order to collect all n different types of coupon, with high probability one has to get in total Ω(nln n) coupons.

Page 46: Part I: Network Part I: Network Coding Coding

Perimeter storagePerimeter storage

• Potential users outside the network have easy access to perimeter nodes; Gateway nodes are positioned on the perimeter.

Page 47: Part I: Network Part I: Network Coding Coding

Pros and ConsPros and Cons

• No extra infrastructure, only a point-to-point routing scheme is needed.

• Robust to errors – just take k good copies.

• Fault tolerance – sensors die? Fine…

• No centralized processing, no routing table or global knowledge of any sort.global knowledge of any sort.

• Very resilient to packet loss due to the random nature of the scheme.

• Achieves certain data privacy. If the coding scheme (the random coefficients) is kept from the adversary, the adversary only sees random data.

Page 48: Part I: Network Part I: Network Coding Coding

Pros and ConsPros and Cons

• Information is coded, in other words, scrambled.

• Have to decode the whole k pieces, even only 1

piece of data is desired.

• Doesn’t explore locality – usually we don’t go to

arbitrary k storage nodes, we go to the closest k arbitrary k storage nodes, we go to the closest k

nodes.