Title: BATON
1BATON
- A Balanced Tree Structure for
- Peer-to-Peer Networks
??f??s??? ????? ?a?a???t?? ?ats????G??????
?a??a??t??Te?d???? ??a?as??d??G??????
??a????aß???a??a ???µµ?da??e???????
??sµ??S???? ???e??d??
2??µ? t?? BATON
- ?? overlay d??t?? t?? ?ATON ßas??eta? se ??a
d?ad??? ?s????p?µ??? d??t?? - ??a d??t?? e??a? ?s????p?µ??? a?? ??a ???e ??µß?
t??, t? ???? t?? d?? ?p?d??t??? t?? ??µß??
d?af??e? ?at? ??a t? p??? - ???e ??µß?? a???e? se ??a ep?ped? L ?a? ??e? ??a?
a???µ? (ap? 1 ??? 2L) - St??? ??µß??? ???e ep?p?d?? d????ta? a???µ?? sa?
?a ?p???a? ???? ?? ??µß?? (t??e?? d??t??) - ???e ??µß?? a?t?st???e? se ??a peer t??
s?st?µat??
3??µ? t?? BATON (2)
- ???e peer ap????e?e? de??te? st? pat??a, sta
pa?d??, st??? ?e?t??e? (in-order d??s??s?) ?a? se
??a s????? ap? ??µß??? ?d??? ep?p?d?? sta de???
?a? sta a??ste?? t?? - O? te?e?ta??? ap????e???ta? st??? ?at????????
p??a?e? (left right routing tables) - St??? p??a?e? ap????e???ta? s??desµ?? p???
??µß??? p?? ap????? ap?st?se?? ?se? µe d???µe??
t?? 2 ap? t?? ??µß? - ?? de? ?p?????? ??p???? ??µß??, e?s????ta? null
e???af?? ??a a?t??? st??? p??a?e? - ??a a??ste?? (? de??) routing table e??a? ?eµ?t?
a? de? ?p?????? ?????e? null e???af?? se a?t?
4?a??de??µa
0
Links to parent, children
Links to adjacent nodes
2
1
Links to neighbor nodes
4
3
5
6
8
10
9
9
7
14
13
12
11
20
16
15
19
17
18
28
21
25
26
27
22
24
23
5Te???µata
- Te???µa 1 ??a d??t?? e??a? ?s????p?µ??? a? t?
a??ste?? ?a? t? de?? routing table ???e ??µß??
p?? ??e? pa?d? e??a? ?eµ?ta - Te???µa 2 ?? ??a? ??µß??, ?st? ? x, pe????e? ??a
s??desµ? p??? ??a ???? ??µß?, ?st? y, st?
a??ste?? ? de?? routing table, t?te ? ????a? t??
x ?a s??d?eta? µe t?? ????a t?? y (e?t?? a? ?????
?d?? ????a)
6Node Join
- G?a ?a e?sa??e? ??a? ??µß?? a??e? ?a ??????e?
??a? ?d? ?p?????ta ??µß?, st?? ?p??? st???e? Join
Request. - ???e ??µß?? p?? ?aµß??e? Join Request ???e? ta
e??? - ?? ta Routing Tables t?? e??a? full ?a? ??e?
????te?a ap? 2 pa?d??, t?? d??eta? ?? pa?d? t??
(Te???µa 1) - ??af??et???
- ?? ??p??? ap? ta Routing Tables t?? de? e??a?
full, p????e? t?? a?t?s? st?? pat??a. - ?????? a? ?p???e? ??µß?? st? Routing Table t??
p?? ??e? ????te?a ap? 2 pa?d??, p????e? t??
a?t?s? se a?t??. - ?????? p????e? t?? a?t?s? se ??p???? ?e?t??? t??
(in-order neighbor)
7Node Join ?a??de??µa 1
- At (8)
- are (8)s Rtables full? Y
- has (8) less than 2 children? N
- has (8) a neighbor with less than
- 2 children? Y
- ? forward REQ to him (7)
At (16) are (16)s Rtables full? N ? forward REQ
to parent (8)
- At (7)
- are (7)s Rtables full? Y
- has (7) less than 2 children? Y
- (x) becomes a child of (7)
(x) knows node (16) (x) sends JOIN REQ to (16)
0
2
1
4
3
5
6
9
10
8
7
14
13
12
11
20
17
18
19
15
16
x
28
21
25
26
27
22
24
23
Join REQ
x
8Node Join ?a??de??µa 2
- At (4)
- are (4)s Rtables full? Y
- has (4) less than 2 children? N
- has (4) a neighbor with less than
- 2 children? ?
- ? forward REQ to one adjacent
At (19) are (19)s Rtables full? Y has (19) less
than 2 children? Y ? (x) becomes a child of (19)
0
(x) knows node (4) (x) sends JOIN REQ to (4)
x
1
2
Join REQ
4
3
5
6
10
7
9
8
14
13
12
11
20
16
15
17
18
19
28
21
25
26
27
22
24
23
x
9Node Join
- ? a?t?s? ??a e?sa???? µp??e? ?a p??????e? O(logN)
f????, af?? e?a?t?ta? ap? t? ???? t?? d??d???. - ?ta? ??a? ??µß?? x d??eta? ??a? ??µß? y ?? pa?d?
t??, t? e???? t?µ?? p?? e??p??ete?, µ?????eta?
st??? d?? ??µß??? - ?p?s??, e??µe?????ta? ?at?????a ?? adjacent t??
- x ?a? t?? y, a?????a µe t? a? t? y e?s???e?
sa? a??ste?? ? de?? pa?d? t?? x. - ?????, ? x e??µe???e? ????? t??? ??µß??? st?
a??ste?? ?a? st? de?? routing table t?? ??a t??
?pa??? t?? y
a
a
x
x
y
10Node Departure
- G?a ?a ap?????se? ??a? ??µß?? f????
- ?? de? ?p???e? ??µß?? sta Routing Table t?? p??
??e? pa?d?? µp??e? ?a ap?????se? - ??af??et???, p??pe? ?a ß?e? ??p???? ??µß? ?a t??
a?t??atast?se? (FINDREPLACEMENT) - G?a ?a ap?????se? ??a? es?te????? ??µß?? µ?a
a?t?s? FINDREPLACEMENT se ??a? ?e?t????? t??
??µß? (in-order) - ???????µ?? FINDREPLACEMENT ??a t?? ??µß? n
- ?? ? n ??e? a??ste?? pa?d? p????e? t?? a?t?s? se
a?t? - ?????? a? ??e? de?? pa?d? p????e? t?? a?t?s? se
a?t? - ?????? a? ?p???e? ??µß?? m sta Routing Table t??
p?? ??e? ??p??? pa?d?, p????e? t?? a?t?s? se
??p??? pa?d? t?? m - ?????? a?t??a??st? t?? ??µß? p?? ???e? ?a
ap?????se?
11?a??de??µa Node Departure
0
2
1
18
4
3
5
6
10
7
9
8
14
13
12
11
16
15
20
17
19
18
12Node Departure
- ? a?t?s? FINDREPLACEMENT µp??e? ?a p??????e?
O(logN) f????, af?? e?a?t?ta? ap? t? ???? t??
d??d???. - ???? ??a? ??µß?? y a?t??atast?se? ??a ??µß? x, ?
?p???? ap????e? ap? t? d??t??, p??pe? ?a
e??µe??se? t??? ?e?t??????? t?? ??µß??? ?a? t??
????a t?? ?t? ?a ap?????se? ?a? µ?????e? t? e????
t?µ?? p?? e??p??ete? se a?t??? - ???? ?? ??µß?? µe s??d?sµ??? st?? x p??pe? ?a
e??µe?????? ?ste ?a de?????? st?? y (????a?,
pa?d??, ?e?t?????? ??µß??, ??µß?? p?? e??a?
s??d?sµ??? st?? x sta routing tables)
13Match Query
- ??a??t??µe se ???e ??µß? ??a e???? t?µ??
- G?a ???e ??µß? t?? Routing Table ap????e???µe t?
e???? t?µ?? p?? e??p??ete? - ?? e???? t?µ?? p?? e??p??ete?ta? ap? ??a? ??µß?
p??pe? ?a e??a? µe?a??te?? ap? t? e???? p??
e??p??ete?ta? ap? t? a??ste?? ?p?d??d?? ?a?
µ????te?? a?t?? t?? de???? ?p?d??d??? - ?ta? ??a? ??µß?? x d??eta? ??a exact match query
e????e? p??ta a? a???e? st? d??? t?? e???? - ??af??et??? d??µ????e? t?? a?a??t?s? st?? ??µß?
p?????sµ?? s?µf??a µe t?? a??????? a??????µ?
14Exact Match Query Algorithm
- Algorithm search exact(node n, query q, value v)
- If ((LowerBound(n)ltv) and (vltUpperBound(n)))
- q is executed at x 1
- Else
- If (UpperBound(n)ltv)
- mTheFarthestNodeSatisfyingCondition
- (lowerBound(m)ltv)
- If (there exists such an m)
- Forward q to m
- Else
- If (RightChild(n)!null)
- Forward q to RightChild(n)
- Else
- Forward q to RightAdjacentNode(n)
- End If
- End If
- Else
- //A similar process is followed towards the left
- End If
15?a??de??µa exact query
0
(45-51)
2
1
(72-75)
(12-17)
4
(23-29)
3
5
6
(5-8)
(54-61)
(81-85)
10
7
9
8
14
13
12
11
(34-39)
(89-93)
(0-5)
(8-12)
(17-23)
(61-68)
(75-81)
(51-54)
16
15
19
18
17
(29-34)
(39-45)
(68-72)
(85-89)
(93-100)
16Range Query
- ??a range query ?e?t????e? µe t?? ?d?? a???ß??
t??p? ?p?? ?a? ??a exact query, µe t?? d?af???
?t? ??????µe ??a µ?a t?µ? t?? a?a??t??µe???
e????? µe t? e???? ??p???? ??µß?? - ?ta? ß?e?e? ? t?µ? ????µe ??a tµ?µa t?? e?????
t?µ?? p?? a?a??t??µe - ???????µe de??? ?a? a??ste?? t?? ??µß?? ??a ?a
?a?????µe t? ??t??µe?? e????
17Data Insertion - Deletion
- ???s?µ?p????µe t?? d?ad??as?a a?a??t?s?? ??a
exact match query ??a ?a ß???µe t?? ??µß? st??
?p??? ?a ???e? ? e?sa???? - ??te???µe t?? e?sa????
- St??? ??µß??? st? a??ste?? (de??) ???? t??
d??t??? ???µ????µe t? e???? t??? a? ? t?µ? p??
e?s??eta? de? ?a??pteta? ap? t? ?p????? e???? - G?a t?? d?a??af? ded?µ???? ß??s???µe µe t??
µ???d? p?? ???s?µ?p??e?ta? ??a exact query t??
??µß? p?? ?e????eta? ta ded?µ??a ?a? ta
d?a???f??µe