Building Low-maintenance Expressways for P2P Systems Zhichen Xu and Zheng Zhang Presented By Swetha...

38
Building Low- Building Low- maintenance maintenance Expressways for P2P Expressways for P2P Systems Systems Zhichen Xu and Zheng Zhang Zhichen Xu and Zheng Zhang Presented Presented By By Swetha Boinepally Swetha Boinepally

Transcript of Building Low-maintenance Expressways for P2P Systems Zhichen Xu and Zheng Zhang Presented By Swetha...

Page 1: Building Low-maintenance Expressways for P2P Systems Zhichen Xu and Zheng Zhang Presented By Swetha Boinepally.

Building Low-maintenance Building Low-maintenance Expressways for P2P Expressways for P2P

SystemsSystemsZhichen Xu and Zheng ZhangZhichen Xu and Zheng Zhang

PresentedPresented ByBy

Swetha BoinepallySwetha Boinepally

Page 2: Building Low-maintenance Expressways for P2P Systems Zhichen Xu and Zheng Zhang Presented By Swetha Boinepally.

Overview Overview What are “Expressways” ? CAN CAN construction Routing in CAN Overview of Expressway Building Expressway Routing with Expressways Tuning towards load balance On demand maintenance Analysis of routing Tuning towards best performance Conclusion

Page 3: Building Low-maintenance Expressways for P2P Systems Zhichen Xu and Zheng Zhang Presented By Swetha Boinepally.

Introduction Introduction

“Expressway” is an auxiliary mechanism to deliver high routing performance.

Expressways are auxiliary data structures.

Page 4: Building Low-maintenance Expressways for P2P Systems Zhichen Xu and Zheng Zhang Presented By Swetha Boinepally.

Real Life Expressways Vs. Expressways in Real Life Expressways Vs. Expressways in P2P SystemsP2P Systems

Expressways in P2P systems are analogous to the real world expressways.

Attributes of expressways: - Auxiliary mechanisms. Not a wholesale replacement of local

routes. - Greater span per ‘hop’.

- High bandwidth. Difference between real life expressways and

expressways in P2P systems: Expressways in P2P systems are - Self organized. - Self maintained. - Adaptive to changing network.

Page 5: Building Low-maintenance Expressways for P2P Systems Zhichen Xu and Zheng Zhang Presented By Swetha Boinepally.

Why CAN ?Why CAN ?

CAN has performance of O(N^1/d)Expressways improves the routing

performance to O(log N)Highly scalableSimple routing algorithmLow maintenance cost

Page 6: Building Low-maintenance Expressways for P2P Systems Zhichen Xu and Zheng Zhang Presented By Swetha Boinepally.

Content Addressable Network(CAN)Content Addressable Network(CAN)

CAN is a distributed infrastructure which provides hash table like functionality.

CAN organizes the logical space as a d-dimensional Cartesian coordinate space.

Entire coordinate space is partitioned among all the nodes.

Each node owns its individual zone within overall space.

Page 7: Building Low-maintenance Expressways for P2P Systems Zhichen Xu and Zheng Zhang Presented By Swetha Boinepally.

CAN constructionCAN construction All nodes are represented in the coordinate

space. When a new node joins, it joins a node that

is close to it in IP distance. The existing node will split its allocated zone

into half. The neighbors of the split zone must be

notified. When a node leaves the network, its zone

should be taken over by one of its neighboring nodes .

Page 8: Building Low-maintenance Expressways for P2P Systems Zhichen Xu and Zheng Zhang Presented By Swetha Boinepally.

Example Example

Page 9: Building Low-maintenance Expressways for P2P Systems Zhichen Xu and Zheng Zhang Presented By Swetha Boinepally.

Routing in CANRouting in CAN

CAN node maintains a coordinate routing table that holds the IP address and the virtual coordinates of each of its neighboring zones.

A CAN message includes the destination coordinates. Using its neighbor coordinate set, a node routes a message towards its destination by simply forwarding to the neighbor with coordinates closest to the destination coordinates.

Page 10: Building Low-maintenance Expressways for P2P Systems Zhichen Xu and Zheng Zhang Presented By Swetha Boinepally.

ExampleExample

We consider a 2-d Cartesian space with 16 equal zones.

Each node has maximum of 4 neighbors.

Maximum routing path length is 3 hops.

Page 11: Building Low-maintenance Expressways for P2P Systems Zhichen Xu and Zheng Zhang Presented By Swetha Boinepally.

D-dimensional SpaceD-dimensional Space

For a d-dimensional space which is partitioned into n equal zones

The average routing path length is

(d/4)(n^(1/d)) hops.# of neighbors for an individual node is

2d.

Page 12: Building Low-maintenance Expressways for P2P Systems Zhichen Xu and Zheng Zhang Presented By Swetha Boinepally.

Scaling ResultsScaling Results

The previous results show that for a d-dimensional space, we can grow the number of nodes(zones) without increasing the per node state.

The average routing path length grows in proportion to (n^(1/d)).

Thus the routing performance in CAN is

O(n^(1/d)).

Page 13: Building Low-maintenance Expressways for P2P Systems Zhichen Xu and Zheng Zhang Presented By Swetha Boinepally.

Overview of ExpresswaysOverview of Expressways Expressways of CAN’s have

routing tables of increasing span. The entire space is partitioned

into zones of different spans with smallest zones correspond to the CAN zones and any other zones are called Expressway zones.

Each node owns a CAN zone and is also a resident of the Expressway zone that encloses its CAN zone.

Expressway zones and CAN zones are recorded in each node in data structure called “Total routing table”.

Page 14: Building Low-maintenance Expressways for P2P Systems Zhichen Xu and Zheng Zhang Presented By Swetha Boinepally.

Contd… Contd…

In this example, CAN zones are at level 3, four of neighboring CAN zones make one level 2 expressway and four such level 2 zones make a level 1 zone.

Total routing table of node 1 consists of the default routing table of CAN(plain arcs) and expressway routing tables(thick and long arcs)

Page 15: Building Low-maintenance Expressways for P2P Systems Zhichen Xu and Zheng Zhang Presented By Swetha Boinepally.

Contd…Contd…

Total routing table RT : RT = < R0, R1, R2, . . . ., RL> where RL corresponds to the

node’s default routing table that CAN already builds.

Ri(i=0 to L-1) is called an Expressway routing table that has larger span. Smaller the i larger the span.

For each neighboring expressway zone, the expressway routing table keeps the address of one or more nodes in that zone.

In the previous figure, CAN zones are at level 3 and each CAN zone is 1/64 th of entire Cartesian space.

Page 16: Building Low-maintenance Expressways for P2P Systems Zhichen Xu and Zheng Zhang Presented By Swetha Boinepally.

Building ExpresswaysBuilding Expressways The algorithm for building expressway is “Evolving snapshot”.

According to the algorithm, at regular intervals of system growth, snapshots of current routing table are taken.

Each node takes the snapshot independently by observing its zone size, with which it may infer to what stage the system has grown.

For node x, suppose the current zone size is x.R.Z and the target size is x.R(L-1).Z/K. if the x’s current size shrinks to its target size then it takes a new snapshot by incrementing L. where K is the span of the expressway.

Page 17: Building Low-maintenance Expressways for P2P Systems Zhichen Xu and Zheng Zhang Presented By Swetha Boinepally.

Notations Used Notations Used

Page 18: Building Low-maintenance Expressways for P2P Systems Zhichen Xu and Zheng Zhang Presented By Swetha Boinepally.

Procedure for New Node JoinProcedure for New Node Join When a node y splits with x, it inherits all entries of

x’s total routing table other than x’s current routing table.

Procedure when a node y joins node x: { y.RT = <x.R0,x.R1,……,x.RL-1,y.RL> repeat the procedure for testing for a new snap shot }

Both nodes test to see if its current zone has shrunken to 1/K th of its last snapshot.

Page 19: Building Low-maintenance Expressways for P2P Systems Zhichen Xu and Zheng Zhang Presented By Swetha Boinepally.

Algorithm to Test a New SnapshotAlgorithm to Test a New Snapshot

Procedure for testing for new snapshot:

//executed by both x and y

If (RL.Z <= RL-1.Z/K)

{ RL+1 = RL

RT=<R0,R1,…..,RL,RL+1>

L=L+1

}

Page 20: Building Low-maintenance Expressways for P2P Systems Zhichen Xu and Zheng Zhang Presented By Swetha Boinepally.

Expressway TreeExpressway Tree

CAN can be thought as building a binary tree since each new node splits a random existing node.

Total routing table can be found by walking down the tree from the root towards the node picking up the snapshot routing tables.

Tree rooted by x when it joined system is called x’s expressway tree.

Page 21: Building Low-maintenance Expressways for P2P Systems Zhichen Xu and Zheng Zhang Presented By Swetha Boinepally.

RoutingRouting If the destination point is within the current zone (RL.Z) then we

can route it using the CAN’s default routing table.

If the node is in some other zone, it iterates through the total routing table, starting from the one with largest span.

It iterates until it finds a routing table whose space does not cover the destination.

Suppose Ri is the routing table whose space does not cover the destination, then Ri is selected and the message will be routed according to Ri to one of Ri’s expressway neighbors.

Page 22: Building Low-maintenance Expressways for P2P Systems Zhichen Xu and Zheng Zhang Presented By Swetha Boinepally.

Pseudo-code for Routing With Pseudo-code for Routing With ExpresswayExpressway

Route with Expressway: If(ptRL.Z) Return; For(i=0;i<=L;i++) If(pt(Ri.Z)) Route using Ri;

Route with Ri: for(j=0;j<d;j++) if(pt<Ri.Z.Lj || pt>Ri.Z.Uj) { Route to xRi.Nj that is close to pt Break; }

Page 23: Building Low-maintenance Expressways for P2P Systems Zhichen Xu and Zheng Zhang Presented By Swetha Boinepally.

Tuning Towards Load BalanceTuning Towards Load Balance

Achieving load balance requires that a node z that routes to x in expressway routing, to have the option for replacing x with any node inside the x’s expressway tree.

Let Z.Ri be the routing table used to route to x and X be the x’s expressway zone, then we pick a point pt in X and route to it. Whoever owns that zone now replaces x in Z.Ri. Here the point pt is selected randomly.

# of nodes that replace x is proportional to the size of x’s Expressway tree and therefore is proportional to the # of residents inside x’s Expressway tree.

Thus the algorithm will automatically balance the load among Expressways.

Page 24: Building Low-maintenance Expressways for P2P Systems Zhichen Xu and Zheng Zhang Presented By Swetha Boinepally.

Default Vs. Random AlgorithmsDefault Vs. Random Algorithms

This figure show the simulation results reporting number of messages each node has to forward with default routing table and the routing table constructed using random selection.

We see that with random selection, more # of messages are forwarded

Page 25: Building Low-maintenance Expressways for P2P Systems Zhichen Xu and Zheng Zhang Presented By Swetha Boinepally.

On-demand MaintenanceOn-demand Maintenance

When a new node joins the network, it updates its expressway neighbors for the EW zones recorded in its total routing table. Such maintenance is proportional to the total levels of expressways, which is O(logkN).

When a node departs, one of its neighbors will take over departed nodes responsibilities. However the departed node can be the expressway neighbor of multiple nodes and its EW functions need to be maintained by some other nodes.

Page 26: Building Low-maintenance Expressways for P2P Systems Zhichen Xu and Zheng Zhang Presented By Swetha Boinepally.

Contd…Contd…

Suppose node x departs from the network, and node y attempts to route to node x, then the request will timeout and node y tries to use the EW with smaller reach.

Now node y picks up a point pt in the space of x recorded in the failed routing table, and route to it. If node z owns the zone in which the point pt lies then node z is now replacement of x to repair y’s snapshot.

On average the total # of nodes that will update their routing table entries is the product of the total # of expressway levels and the # of neighbors in each level, which is O(d.logkN).

Page 27: Building Low-maintenance Expressways for P2P Systems Zhichen Xu and Zheng Zhang Presented By Swetha Boinepally.

StorageStorage

Let m be the # of levels of EWs and m=logkN. The total routing table depth is m and as a result the storage for routing table increases m-folds.

For example, if K=4 and N=2^20 (million nodes), then m is 10 and it takes only few hundred bytes to store the routing table. Therefore storage is not a concern.

Page 28: Building Low-maintenance Expressways for P2P Systems Zhichen Xu and Zheng Zhang Presented By Swetha Boinepally.

Routing with expresswaysRouting with expressways

Routing expressways involves at most m levels of CAN like routing.

Routing algorithm will iterate through the table to get down to the level where the expressway zone doesn't cover the destination. It will the follow the CAN routing to reach an expressway zone that covers the destination.

Page 29: Building Low-maintenance Expressways for P2P Systems Zhichen Xu and Zheng Zhang Presented By Swetha Boinepally.

Analysis Analysis

The average routing hops in any level are (d/3)K^(1/d) hops and number of levels the routing will travel are logkN levels. Thus there are (logkN)(d/3)K^(1/d) hops in the worst case.

The bigger the K, the less levels of expressways there are and routing at each level is more expensive, so we need to find the optimal K.

Page 30: Building Low-maintenance Expressways for P2P Systems Zhichen Xu and Zheng Zhang Presented By Swetha Boinepally.

Contd…Contd…

Let f(x)=(d/3).(x^1/d).logxN Taking the derivative and equating it to zero: f(x)’= 0 => (d/3).(1/d.x^(1/d-1).lnN/lnx = x^(1/d-1).lnN/(lnx)^2 on simplification we get 1/d=1/lnx => x=e^d Thus the optimal K is e^d and the optimal routing

performance is f(x)=(d/3).((e^d)^1/d).log(e^d)N =d/3.e.lnN/d =e/3 lnN Thus the routing performance of CAN using

expressways is O(lnN). And it is independent of choice of d.

Page 31: Building Low-maintenance Expressways for P2P Systems Zhichen Xu and Zheng Zhang Presented By Swetha Boinepally.

Expressway Performance Compared With Expressway Performance Compared With Theoretical ValuesTheoretical Values

In the figure, theoretical performance using EW is compared with results obtained using simulation.

There are small deviations in these values.

Page 32: Building Low-maintenance Expressways for P2P Systems Zhichen Xu and Zheng Zhang Presented By Swetha Boinepally.

Expressway Performance Compared With Expressway Performance Compared With CAN With Different DCAN With Different D

In this graph, we can see that the EW performance with d=1 outperforms the basic CAN with d=5.

Page 33: Building Low-maintenance Expressways for P2P Systems Zhichen Xu and Zheng Zhang Presented By Swetha Boinepally.

Tuning Towards Best PerformanceTuning Towards Best Performance

Tuning towards network conditionsLocating closest nodes using

coordinate mapsRoute around congested nodeTuning according to application needs

Page 34: Building Low-maintenance Expressways for P2P Systems Zhichen Xu and Zheng Zhang Presented By Swetha Boinepally.

Locating Closest NodesLocating Closest Nodes

Build maps of network coordinates, and utilizing the archival capacity of P2P system itself to store and maintain the maps in various zones in CAN.

Any node can find a resident close to it in a given expressway zone Z by consulting the appropriate map.

There is one map for each expressway zone in the system.

Page 35: Building Low-maintenance Expressways for P2P Systems Zhichen Xu and Zheng Zhang Presented By Swetha Boinepally.

Route Around Congested NodeRoute Around Congested Node

In Internet like dynamic environment, the traffic flow is unpredictable and the common problem to deal with is congestion.

Congestion can be avoided by detecting the congested node, reporting and finding the alternate route.

To find the appropriate expressway neighbor, each node will periodically update its map with the information about its load.

Page 36: Building Low-maintenance Expressways for P2P Systems Zhichen Xu and Zheng Zhang Presented By Swetha Boinepally.

Tuning According to Application NeedsTuning According to Application Needs

Reducing the per hop distance may not necessarily reduce the total delay.

To account for the communicating patterns of application, the total routing table of node keeps the addresses of multiple nodes, instead of keeping the address of the node that is physically closest to it.

While routing to a destination, we attempt to balance the per hop distance and the total number of logical hops to achieve overall small latency.

Routing performance can be further improved by allocating some storage at each node to cache routes based on runtime behavior.

Page 37: Building Low-maintenance Expressways for P2P Systems Zhichen Xu and Zheng Zhang Presented By Swetha Boinepally.

Summary Summary

Using expressways the performance of routing in CAN is improved from O(N^1/d) to O(ln N).

The important attributes of P2P systems are to reduce maintenance cost, and to provide venues to tune the system to suit the application needs and the underlying network conditions. Such that it beats O(ln N) in practice.

Page 38: Building Low-maintenance Expressways for P2P Systems Zhichen Xu and Zheng Zhang Presented By Swetha Boinepally.

Thank YouThank You