Peer-to-peer networks

Peer-to-peer networks
Ant Rowstron
Microsoft Research
1
Talk overview
• Overview of Overlays/DHTs
• Overview of Wireless Routing protocols
• Description of Virtual Ring Routing
– A routing protocol inspired by DHTs
2
Underlays (Networks)
Provides point-to-point
communication
A
B
3
Overlay
A
B
4
Overlay and underlay
5
Unstructured overlays
• Unstructured overlays
– No/weak constraint on neighbors
(for correctness)
– Algorithmically simple – poor
performance
• Flood based techniques etc.
Example: Gnutella, BitTorrent
6
Unstructured overlays
• Unstructured overlays
– No/weak constraint on neighbors
(for correctness)
– Algorithmically simple – poor
performance
• Flood based techniques etc.
Example: Gnutella, BitTorrent
7
Structured overlays
• Structured overlays
– Constraints on neighbors
– Algorithmically more
complex
• DHT API, KBR API
Example: Distributed Hash Table (DHTs) - CAN, Chord, Pastry, Tapestry (2001)
8
Distributed Hash Tables (Pastry)
• Large id space
• NodeIds picked randomly from space
id space
• Keys picked randomly from space
• Key is managed by its root node:
• Live node with id closest to the key
nodeId
key
root node
for key
9
Node routing state
0*
1*
2*
3*
20*
21*
22*
23*
200*
201*
202*
203*
2030*
2031*
2032*
2033*
203231
nodeId
leaf set
• Topology aware routing table
• NodeIds and keys in some base 2b (e.g., 4)
• Prefix constraints on nodeIds for each slot
• Pick closest node satisfying slot constraints
10
Routing
• Prefix matching: each hop resolves an extra key digit
nodeId
key
323310
323211
203231
route(m, 323310)
322021
313221
11
Using DHTs
• Keys picked randomly from space
• E.g. SHA1(“www.microsoft.com”)
id space
nodeId
key
root node
for key
• Generic building block
–
–
–
–
–
Application-level multicast
File Systems
Web Caches
File Sharing
Etc
12
DHT experiences
• DHTs are:
–
–
–
–
–
Self-organizing
Decentralized
Fault-tolerant/churn tolerant
Scalable
Performance
• Question:
– Can we apply lessons to underlay routing protocols?
13
Wireless routing protocols
• Large number of wireless routing protocols
• Numerous scenarios:
– Mesh, Sensor, Mobile, VLAN, etc
• Protocols traditionally target a scenario
• Protocols use either:
– Flooding
– Coordinates
14
Proactive routing
Nodes have complete
topology map
Example: OLSR, DSDV
15
Reactive routing
Example: DSR, AODV
16
Coordinate-based routing
lookup service
y
lookup(p)
fixed identifier
address
p at (4,1)
q at (2,2)
p at (4,1)
(x,y)
x
Example: GPSR, BVR
17
Previous work on wireless routing
• Flooding based algorithms scale poorly
– Flood on topology changes or discover routes
• Geographical and landmark routing
– Scale well but nodes have identifier and address
• Some apps (sensor networks) may require just address
– DHT-like structure to translate between the two
• Route setup delays
• Additional maintenance overhead
• Another target for attacks
18
VRR: Virtual Ring Routing
• A fundamentally different approach
Virtual
Ring
Routing
No flooding
Single topologyindependent address
19
VRR: The Virtual Ring
FFF
0
Topology-independent
node identifiers
910
90E
8F6
8F0
8E2
Each node maintains
a virtual neighbor set (vset)
Nodes organized into virtual ring
by increasing identifier value
20
VRR: Routing paths
8F6
8F6
physical network topology
Nodes only maintain routing paths to virtual neighbors:
• Paths maintained proactively
• Paths are bidirectional and typically multi-hop
VRR: Forwarding table
14A
endpointA
endpointB
nextA
8F6
90E
me
910
8F6
10E
14A
140
F42
me
F42
8F6
forwarding table for node 8F6
nextB
pathId
F42
me
10E
F42
31
10
2
FF
• Paths recorded in forwarding tables along path
• Forwarding table contains
• Paths between node and vset members
• Paths between other nodes that go through node
• Paths to physical neighbors
F42
8F6
10E
140
VRR: Forwarding table state
• Physical neighbors
• VSet paths
• Other VSet paths
Physical network topology
23
VRR: Example routing
physical network topology
VRR: Example routing
physical network topology
VRR: Example routing
physical network topology
VRR: Example routing
physical network topology
VRR: Example routing
physical network topology
VRR: Routing summary
• Paths to virtual neighbors ensure correctness
• Stretch empirically small
• Many alternate paths to route around failures
VRR: Node joining
broadcast hellos
Send
request
to 16E
to findsetup
physical
neighbors
164
8F6
19A
Network Topology
16E
VRR: Node joining
16E
sends
164
sends
setup
to
16E
addssetup
noderequests
to16E
vset
to
nodes
receivedsetup
vset
with
its vset
when
itinreceives
164
171
8F6
19A
Network Topology
16E
VRR: Handling failures
• Routing state is hard
– No end-to-end heartbeats
– Failures detected on missing acks or hellos
– Local repair attempted first;
– Otherwise, teardowns sent along all affected paths
• Two techniques to ensure consistency
– Symmetric failure detection and acks on teardowns
• If x marks y faulty, y is guaranteed to mark x faulty
– Lightweight optimistic transactions
• If in doubt abort (teardown)
Evaluation
• Evaluated using:
– Simulations (ns-2)
• Mobility
– Testbeds
• UCB Sensor Testbed with 68 mica2dot motes
• MSRC 111 node 802.11a Wireless Testbed
33
Sensor Mesh: VRR vs BVR
34
Failures: VRR vs BVR
35
Office Mesh: VRR vs LQSR
10
8
LQSR
VRR
Mbps
6
4
2
0
Machines
36
Mobility: Simulation
• Simulation in ns-2
– 802.11b MAC
– Mobility: 0-20 m/s
– CBR: 1 packet/sec
37
Implementing Networking Services
• Implement “lookups” using key-based routing?
VRR ARP:
Flood-based ARP:
Hash(192.169.0.45)
ARP: 192.169.0.45
192.169.0.45
192.169.0.45
Nodes organized
into virtual ring. 38
Conclusions
• Overlay routing at the network layer
• VRR implements wireless routing
– Scalable: no flooding
– Single location-independent identifier per node
• No translation from identifiers to addresses
– No route discovery or translation delays
• VRR implements a DHT
– Strong consistency
– No additional overhead
Further information
• VRR Paper:
– M. Caesar, M. Castro, E. Nightingale, G. O'Shea and A.
Rowstron, "Virtual Ring Routing: Network routing
inspired by DHTs", Sigcomm 2006
http://research.microsoft.com/~antr/
40