Routing Overlay Case of Study: PASTRY: Andrea Marin
Routing Overlay Case of Study: PASTRY: Andrea Marin
Andrea Marin
2009
Introduction
Design overview
Self-adaptation
Improving the routing performance
Presentation outline
1 Introduction
2 Design overview
3 Self-adaptation
Node join
Node departure
What is PASTRY?
Routing idea
In each routing step, a node normally forwards the message to a
node whose NodeId shares with the key a prefix that is at least one
digit longer than than the key shares with the present node. If
such a node is not known, the message is forwarded to a node that
shares the same prefix of the actual node but its NodeId is
numerically closer to the key,
State of a node
Neighborhood set
Leaf set
The leaf set contain the |L| NodeIds closest to the current node’s
NodeId
D: key to route
R`i the entry in the routing table R at column i with
0 ≤ i ≤ 2b and row `, 0 ≤ ` ≤ b128/bc
Li the i-th closest nodeId in the leaf set L,
−b|L|/2c ≤ i ≤ b|L|/2c
D` the value of the l’s digit in the key D
shl(A, B): the length of the prefix shared among A and B in
digits
A address of the current node
Routing algorithm
if L−b|L|/2c ≤ D ≤ L+b|L|/2c then
/* Route to a leaf */
forward to Li s.th. |D − Li | is minimal
end
else
` ← shl(D, A)
if R`D` 6= null then
/* Route to a node in the routing table */
forward to R`D`
end
else
/* Get as close as you can ... */
forward to T ∈ L ∪ R ∪ M s.th. shl(T , D) ≥ l,
|T − D| < |A − D|
end
Andrea Marin Routing overlay case of study: PASTRY
Introduction
Design overview
Self-adaptation
Improving the routing performance
Routing performance
Proof
If the target node is reached using the routing table, each step
reduces the set of possible target of 2b
If the target node is in L, then we need 1 step
The third case is more difficult to treat. It is unlikely to
happen, experimental results with uniform NodeId, give:
If |L| = 2b , probability < 0.02
If |L|2b+1 , probability = < 0.006
When case 3 happens it adds an additional step
Reliability
Join message
Let ` = shl(X , A) ≥ 0
Rows from 0 to ` of A become rows from 0 to ` of X
Row ` + 1 of X is row ` + 1 of B, where B is the node after A
in the path to Z
X sends M, L and the routing table to each node from A to
Z . These update their states
Simultaneous arrivals cause contention solved using timestamp
Messages sent for a node join are O(log2b N)
Scenario:
Node X fails
Node A has X in the leaf set
Actions performed by A to repair its leaf set:
If NodeIdA > NodeIdX then A requires the leaf set of the leaf
node with lowest NodeId
If NodeIdA < NodeIdA then A requires the leaf set of the leaf
node with highest NodeId
A uses the received set to repair its own
Scenario:
Node X fails
Node A has X as target in the routing table in position R`d
Actions performed by A to repair its routing table:
A asks the entry R`d for each target in its routing table R`i
with i 6= d
If none answers with a live node then it passes to row R`+1
and repeats the procedure
If a node exists this procedure finds it with high probability
Main idea
Assumptions:
Scalar proximity metric
E.g.: number of routing hops, geographic distance
The proximity space given by the proximity metric is
Euclidean
Triangulation inequality holds
If the metric is not Euclidean PASTRY routing keeps working
but it may be not optimized
Goal:
The nodes in the path of a message delivery from A to B are
close according to the proximity metric.
Scenario:
Assume a network satisfies the required property
We show that when a new node X joins the network the
property is maintained
X knows A that is assumed to be close to X
Idea:
R0 of A is used for X . If the property holds for A and A is
close to X then the property holds for S
R1 of X is R1 of B, i.e., the node reached from A. Why can
B be considered close to X ? The distance should be weighted
on the number of possible targets!
The same argument applies to the other routing table rows
Further improvements
Locality property