peer-to-peer sip

45
Peer-to-Peer SIP David Bryan July 27, 2005

Upload: phillip-larsen

Post on 30-Dec-2015

188 views

Category:

Documents


1 download

DESCRIPTION

Peer-to-Peer SIP. David Bryan July 27, 2005. p2psip.org. Affiliation(s). Overview. Motivation What is Peer-to-Peer? Why P2P SIP? P2P basics Approaches to P2P SIP P2P SIP/SOSIMPLE Problems, barriers, and future work. What is Peer-to-Peer?. Peer-to-Peer (P2P) technology - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Peer-to-Peer SIP

Peer-to-Peer SIP

David Bryan

July 27, 2005

Page 2: Peer-to-Peer SIP

www.p2psip.org

Affiliation(s)

p2psip.org

Page 3: Peer-to-Peer SIP

www.p2psip.org

Overview

• Motivation

• What is Peer-to-Peer?

• Why P2P SIP?

• P2P basics

• Approaches to P2P SIP

• P2P SIP/SOSIMPLE

• Problems, barriers, and future work

Page 4: Peer-to-Peer SIP

www.p2psip.org

What is Peer-to-Peer?

• Peer-to-Peer (P2P) technology– Fundamentally different than client server– Nodes cooperate to provide (collectively) the

functionality a central server would provide – Not all nodes provide all services/know

everything, but as a group they do

Page 5: Peer-to-Peer SIP

www.p2psip.org

What is Peer-to-Peer?

Client Server:

Page 6: Peer-to-Peer SIP

www.p2psip.org

What is Peer-to-Peer?

Peer-to-Peer

Page 7: Peer-to-Peer SIP

www.p2psip.org

Motivating Cases

• Small deployments– Security– Lack of resource

• Limited/No Internet connectivity

• Ad-Hoc and ephemeral groups

• Censorship or impeded access

• Large scale decentralized communications– Skype (sort of)

Page 8: Peer-to-Peer SIP

www.p2psip.org

Client/Server Session

Page 9: Peer-to-Peer SIP

www.p2psip.org

Problem w/Remote Server

Organization B

InternetOrganization A

Page 10: Peer-to-Peer SIP

www.p2psip.org

Why P2P?

• Infrastructure independence– No central servers– Don’t need connectivity

• Simple discovery and setup

• Privacy

• Highly scalable

• Lack of central control

• Dynamic DNS doesn’t offer all of this

Page 11: Peer-to-Peer SIP

www.p2psip.org

P2P Session

Page 12: Peer-to-Peer SIP

www.p2psip.org

Why SIP?

• Widely established protocol– Standards based– Compatibility with existing equipment– Reuse existing software components– Many problems already solved

• SIP is already “mostly” P2P– SIP vs. H.323

• Support for both IM and VoIP– SIP/SIMPLE vs. XMPP

Page 13: Peer-to-Peer SIP

www.p2psip.org

Related Work

• Skype– Not as P2P as they imply, non-standard

• EarthLink’s SIP Share– Use SIP messages to encode filesharing DHT

• Others in this area– Kundan Singh/Henning Schulzrinne at

Columbia University

Page 14: Peer-to-Peer SIP

www.p2psip.org

P2P Basics

• Most famous use of P2P is file sharing• Most famous infamous use of P2P is file sharing– Each user stores some number of files on the

network, ask peers for the file

• Can also share other resources or services, no need to be files

• Connected to each other in a logical network called an overlay

Page 15: Peer-to-Peer SIP

www.p2psip.org

Overlay Network

• Collection of nodes, connected logically in some way

• The connections in the overlay are frequently not related to those in the physical network

Page 16: Peer-to-Peer SIP

www.p2psip.org

Flooding w/TTL

TTL = 1TTL = 2TTL = 3

Node broadcasts to neighborsNode(s) respond directly

Page 17: Peer-to-Peer SIP

www.p2psip.org

Problems w/Flood

• Inefficient!– Lots of network traffic– Multiple nodes respond (can be good or bad)

• No guarantee of completion – some outside of TTL “horizon”

• Nodes working on behalf of others– DOS risk, but doubles traffic otherwise

• Gnutella was a flood based design

Page 18: Peer-to-Peer SIP

www.p2psip.org

Structured P2P

• Basic idea is that what you are looking for has an identifier– Locate items in the overlay based on the

identifier– Distributed Hash Table (DHT), Content

Addressable Networks (CAN)– Since “everything has its place”, eliminate

false negatives– Since you can go (close to) directly to the item

you want, more efficient

Page 19: Peer-to-Peer SIP

www.p2psip.org

Distributed Hash Tables

• Every resource has a keyword, hashed to produce a Resource ID, or key

• Every node participating hashes a unique property (IP address) to produce a Node ID

• The resource itself, or information about how to find it, for a particular Resource ID is stored at a node with a similar Node ID

Page 20: Peer-to-Peer SIP

www.p2psip.org

Chord

• Algorithm/Implementation for a DHT in a circular namespace– 0 and max ID are neighbors

• A resource w/key k is stored by the first node with Node ID ≥ k– This node is called the successor node of key

k

Page 21: Peer-to-Peer SIP

www.p2psip.org

Example Chord Ring

• Example namespace is 0-31

• Wraps at 0/31• Values increase

clockwise• Sometimes called

an identifier circle

0

15

31

7

1 23

45

6

Page 22: Peer-to-Peer SIP

www.p2psip.org

Example Chord Ring

IDs/key namespace is 0-31

Node DNode-ID 29

Node ANode-ID 2

Node CNode-ID 18

Node BNode-ID 13

Item A, key = 5

Item B, key = 18

Item C, key = 30

Stores:Item A, key = 5

Stores:Item B, key = 18

Stores:Item C, key = 30

Page 23: Peer-to-Peer SIP

www.p2psip.org

Finger Tables

• Each node keeps n “fingers” spaced around the ring to route messages (where address space is 2n)– Fingers point 1, 2, 4, …2n-1 away from the node the

ring, so nodes know more about neighbors than distant nodes

• Most distant finger is ½ the distance across the identifier ring, so all fingers are in the node’s “half”

• If no node at the exact value the finger should point to, points to the next actual node

Page 24: Peer-to-Peer SIP

www.p2psip.org

Example Finger Table

• Namespace 0-31 is size 25, so 5 fingers

• Node is 3, so fingers are:

0

15

31

7

1 23

45

6

f[0] Offset 20=1 Points to 3+1=4

f[1] Offset 21=2 Points to 3+2=5

f[2] Offset 22=4 Points to 3+4=7

f[3] Offset 23=8 Points to 3+8=11

f[4] Offset 24=16 Points to 3+16=19

Page 25: Peer-to-Peer SIP

www.p2psip.org

Example Finger Table

• Namespace 0-31 is size 25, so 5 fingers

• Node is 3, so fingers are:

f[0] Offset 20=1 Points to 3+1=4

f[1] Offset 21=2 Points to 3+2=5

f[2] Offset 22=4 Points to 3+4=7

f[3] Offset 23=8 Points to 3+8=11

f[4] Offset 24=16 Points to 3+16=19

3

4

5

7

1119

Page 26: Peer-to-Peer SIP

www.p2psip.org

11

Example Finger Table

• If only nodes 3, 6, 11 are in the overlay:

f[0] Offset 20=1 Points to 3+1=4(6)

f[1] Offset 21=2 Points to 3+2=5(6)

f[2] Offset 23=4 Points to 3+4=7(11)

f[3] Offset 24=8 Points to 3+8=11(11)

f[4] Offset 25=16 Points to 3+16=19(3)

3

6

Page 27: Peer-to-Peer SIP

www.p2psip.org

Routing in Chord

• Chord routes by sending messages to some node nearer the desired resource

• The nearer node sends to an even closer node on behalf of sender

• Process repeats until a node receiving the message knows its successor controls that space– Returns address of successor, sender and

responsible node then exchange data

Page 28: Peer-to-Peer SIP

www.p2psip.org

Applying this to SIP

• Use pure DHT to find the other UAs– Could leverage standards for DHT, but there aren’t

any– Some firewalls block DHT traffic as “file sharing”

• Use DHT for location, but implemented as SIP messages– Essentially, use DHT as another registration/location

mechanism– Requires some “tweaks” to Chord

• Use standard SIP to signal once resources are located

Page 29: Peer-to-Peer SIP

www.p2psip.org

SOSIMPLE

• Protocol suggested by myself and Cullen Jennings of Cisco– Available as IETF Internet-Draft

• Implemented and being studied at William & Mary

• Implements a Chord-like DHT using SIP– All traffic is SIP messages– Very similar to Chord, only slight changes

Page 30: Peer-to-Peer SIP

www.p2psip.org

Node vs. User Operations

• Operations can be either Node operations, or User operations– Node operations are DHT related – a node joining, a node

leaving, a node updating its finger table– Use REGISTER for much of this

• User operations are completely separate – More traditional SIP registration here– Registration is stored by Resource ID of hashed username

• A user’s node has a Node ID, but their User ID, and thus registration, will be stored at a different node

• Once a user’s node joins, only means the node is in the DHT. Still need to do a user registration to make calls

Page 31: Peer-to-Peer SIP

www.p2psip.org

Node Joining

Bootstrap NodeNode-ID 023

Node BNode-ID 245

Joining NodeNode-ID 503

1. REGISTER

302 Node B

2. REGISTER

302 Node C3. REGISTER

200 OK

4. Joining node after joinNode-ID 503

Node CNode-ID 520

Differences from Chord: node answers for itself – doesn’t return successor that controls, iterative vs. recursive

Page 32: Peer-to-Peer SIP

www.p2psip.org

User Registration

Node ANode-ID 023

Node BNode-ID 245

Alice’s NodeNode-ID 503

1. REGISTERAlice

302 Node B

2. REGISTER Alice

200 OK

Node CNode-ID 520

Alice (User ID 234)

Stores:Alice’s Registration

Page 33: Peer-to-Peer SIP

www.p2psip.org

Session Establishment

Node ANode-ID 023

Node BNode-ID 245

Node CNode-ID 520

Alice’s NodeNode-ID 503

Alice-> Alice’s Node

Bob-> Bob’s Node

Bob’s NodeNode-ID 683

1. INVITEBob

Alice (User ID 234)

Bob (User ID 011)

Alice hashes Bob and gets 011Alice searches for a registrationwith User ID 011, sends invite

to Node A (023)

Page 34: Peer-to-Peer SIP

www.p2psip.org

Session Establishment

Node ANode-ID 023

Node BNode-ID 245

Node CNode-ID 520

Alice’s NodeNode-ID 503

Alice-> Alice’s Node

Bob-> Bob’s Node

Bob’s NodeNode-ID 683

1. INVITEBob

302 Contact: Bob’s Node

Alice (User ID 234)

Bob (User ID 011)

Node A stores a registration for Bob (User ID 011) and returns

Bob’s Node as a contact in a 302

Page 35: Peer-to-Peer SIP

www.p2psip.org

Session Establishment

Node ANode-ID 023

Node BNode-ID 245

Node CNode-ID 520

Alice’s NodeNode-ID 503

Alice-> Alice’s Node

Bob-> Bob’s Node

Bob’s NodeNode-ID 683

Alice (User ID 234)

Bob (User ID 011)

Alice’s UA now invites Bob’s UACall set up proceeds as normal

100, 180, 200

2. INVITEBob

Page 36: Peer-to-Peer SIP

www.p2psip.org

Session Establishment

Node ANode-ID 023

Node BNode-ID 245

Node CNode-ID 520

Alice’s NodeNode-ID 503

Alice-> Alice’s Node

Bob-> Bob’s Node

Bob’s NodeNode-ID 683

Alice (User ID 234)

Bob (User ID 011)

Media and further signaling flow directly

between UAs

Page 37: Peer-to-Peer SIP

www.p2psip.org

Presence/Buddies

• Subscribe/Notify used for presence• Subscribe to all available buddies at startup and

periodically• Serve as additional finger table entries

Page 38: Peer-to-Peer SIP

www.p2psip.org

Encoding P2P in SIP

• SIP URI parameters– alg : (defined in draft-ietf-sip-identity) to

convey hash algorithm used– user=node : used when messages are about

node operations, rather than user– resourceID : used on user messages to

indicate what a resource hashes to– overlay-name : indicates name of the

particular overlay (can be more than 1)

Page 39: Peer-to-Peer SIP

www.p2psip.org

Encoding P2P in SIP

• New headers– DHT-NodeID : defines sending node’s node

ID– DHT-Link : used by nodes to exchange

information about fingers, successors, predecessors

Page 40: Peer-to-Peer SIP

www.p2psip.org

Encoding P2P in SIP

REGISTER sip:10.7.7.1 SIP/2.0

To: sip:[email protected];user=node;alg=rsa-sha1;overlay=chat

From: sip:[email protected];user=node;alg=rsa-sha1;overlay=chat

Contact: sip:[email protected];user=node;alg=rsa-sha1;overlay=chat

Expires: 600

DHT-NodeID: rsa-sha1 4737a8fe3d 10.4.2.2

Require: dht

Supported: dht

Register for a node first joining the overlay:

Page 41: Peer-to-Peer SIP

www.p2psip.org

Encoding P2P in SIP

SIP/2.0 200 OK

To: sip:[email protected];user=node;alg=rsa-sha1;overlay=chat

From: sip:[email protected];user=node;alg=rsa-sha1;overlay=chat

Contact: sip:[email protected];user=node;alg=rsa-sha1;overlay=chat

Expires: 600

DHT-NodeID: rsa-sha1 34f2a82eee 10.7.7.1

DHT-Link: P 1 rsa-sha1 312a18dd12 10.8.7.5

DHT-Link: S 1 rsa-sha1 3863a23ad1 10.11.22.233

DHT-Link: F 2 rsa-sha1 459a1211df 10.101.0.45

DHT-Link: F 3 rsa-sha1 a61bd8c100 10.210.78.101

Supported: dht

Require: dht

Response from accepting node:

Page 42: Peer-to-Peer SIP

www.p2psip.org

Encoding P2P in SIP

REGISTER sip:10.5.22.112 SIP/2.0

To: sip:[email protected]; alg=rsa-sha1;overlay=chat;resource-ID=51a6f9098d

From: sip:[email protected];alg=rsa-sha1;overlay=chat;resource-ID=51a6f9098d

Contact: sip:[email protected];alg=rsa-sha1;overlay=chat;resource-ID=51a6f9098d

Expires: 600

DHT-NodeID: rsa-sha1 4737a8fe3d 10.4.2.2

Require: dht

Supported: dht

User Registration:

Page 43: Peer-to-Peer SIP

www.p2psip.org

Problems with P2P SIP

• Like most things SIP, NATs– Same problems, plus some new ones– Super nodes?

• Security– Sybil attacks– DOS (through traffic and true denial)– Encryption– Information “leakage”– Choosing node locations to divert/block

Page 44: Peer-to-Peer SIP

www.p2psip.org

Future Work

• Improved Security

• Adding features– Configuration information, VM storage

• Using overlay for voice traffic as well

• Alternate methods for routing

• Comparing different P2P approaches

Page 45: Peer-to-Peer SIP

www.p2psip.org

References

• draft-bryan-sipping-p2p-01• D. A. Bryan, B. B. Lowekamp and C. Jennings,

SOSIMPLE: Towards a Serverless, Standards-based, P2P Communication System, AAA-IDEA, June 2005

• Stoica et al., Chord: A Scalable Peer-to-Peer Lookup Protocol for Internet Applications, IEEE/ACM Transactions on Networking (to appear)– (Don’t use the algorithms from SIGCOMM paper by same

authors with same title – it contains some algorithmic errors)• I maintain a list of references at

http://www.p2psip.org• Contact me via email

bryan [at] ethernot [dot] org