Peer-to-Peer Signalling Marcin Matuszewski marcin@netlab.hut.fi S-38.115 Signalling Protocols Introduction P2P architectures Skype Mobile P2P Summary Agenda 1
Introduction Peer-to-Peer (P2P) is a communications model in which each communication node (peer) has both server and client capabilities either party can initiate a communication session applications connect with each other directly Various definitions exist Peer-to-Peer popularity The most popular P2P application is content sharing e.g. Napster, Kazaa, Direct Connect P2P accounts for the lion's share of rising bandwidth consumption Other applications are also gaining popularity e.g. Skype - Voice over P2P, Mobile P2P 2
P2P basics How to find specific peer that hosts desired data within decentralized network? Looks for the certain content n1 n4 n7 n2 n3 n6 n8 has the content n5 queries along the network through known peers Pure P2P architecture Control and data are completely distributed No centralized server Example: Gnutella Advantage Resilience to node failures Disadvantage Inter-peer connections tend to form a power-law graph (a small number of highly connected peers) Simple broadcast search is not efficient (delay, bandwidth) TTL is used to limit flooding => many improvements have been proposed (next slides) 3
Pure P2P architecture - Chord Chord provides improvements to the searching process Nodes in a network are organized in a circle Each node and each key have assigned identifiers Node identifiers: SHA1(IP address) Key Identifiers: SHA1(key itself) K57 N60 Each key is assigned to N3 its successor K45 N51 K30 N32 K25 N19 K11 Chord - Finger Table The information stored in the Finger Table is used for scalable node localisation 4
Chord - key localisation process Chord joining node Node 21 asks its successor the following question: Am I your predecessor? If node 26 joins the network an answer to this question is: NO, node 26 is my predecessor 5
Properties of Chord Availability Protocol functions very well even if the system is in a continuous state of change Scalability Lookup grows only logarithmically with the number of nodes Load balancing Keys are spread evenly over the nodes Flexible naming No constraints on a key structure Not suitable for search engines Chord supports exact match, cannot handle queries similar to one or more keys Centralized P2P architecture Centralized server provides meta-data (e.g. list of files shared by each peer) Communication is directly between peers Example: Napster Advantages Searches can be quick and need very little bandwidth Disadvantages Server represents a single point of failure for entire system Can be easily attacked Have limited resources => scalability issue File transfer Query: music.mp3 6
Semi-centralized P2P architecture There are two types of peers in a network: Gateways (Super-peers) more powerful peers become gateways to a network form a pure P2P network between themselves handle search requests on behalf of clients Clients (Ordinary-peers) less powerful peers act as clients to the gateway peers upload metadata information about shared files to gateways Semi-centralized P2P - KaZaA KaZaA is an example of semi-centralized P2P network Super-Peers (SPs) are normal peers that have been automatically elected as the super-peers based on their up time, bandwidth, connectivity, CPU power, IP address (public vs private) Super-peers maintain a database with: file identifiers, their children are sharing metadata (file name, file size, contenthash, file descriptors) corresponding IP addresses of children SP maintain long-lived TCP connections with other SPs 7
KaZaA cont. KaZaA peers frequently exchange list of super-peers Ordinary-Peer (OP) maintains list of 200 super-peers Super-Peer (SP) appears to maintain list of thousands of SPs All of the signaling traffic between peers is encrypted Handshaking traffic for connection establishment List of super-peers exchange Metadata upload Queries and replies File transfer between nodes is not encrypted TCP is used for both file transfer and signaling traffic KaZaA cont. Files searching OP sends a query with a keyword to its SP SP returns IP addresses and related metadata that correspond to the match from its database SP may forward query to one or more SPs to which it is connected Query visits only a small subset of SPs so the result represent only a small subset of all files stored in KaZaA network SPs frequently change their SP-SP connections on a time scale of tens of minutes => Larger part of network can be explored 8
Skype Skype is another application of peer-to-peer concept It provides very successful internet telephony, instant messaging and file transfer services Skype is a proprietary protocol in contrast to SIP and H.323 Researchers are trying to apply P2P principle to SIP-based systems Skype architecture Skype login server Skype has a similar architecture as its predecessor KaZaA There are three types of nodes in the Skype network: Ordinary-peers Super-peers Central login server The login server stores all of user names and passwords and ensures that names are unique across the Skype name space 9
Skype some facts It uses TCP for signaling and both UDP and TCP for transporting media traffic It uses ilbc, isac or a third party unknown codec probably developed by GlobalIPSound All of the user communication is encrypted using AES 256-bit (Advanced Encryption Standard) It uses a variation of STUN and TURN for NAT and firewall traversal Buddy list is signed digitally, encrypted and is local to the machine (not stored on the central server like in case of MSN Messenger) Skype - login After installation a client connects to some bootstrap super-peers, since its Super- Peer list is empty, and acquires the address of the Login Server Normal login: Skype client (OP) connects to a Super-Peer OP authenticates the user name and password with the Login Server 10
Skype - user search Client sends an user name to SP and as an answer receives four IP addresses and port numbers Subsequently the client contacts these four nodes If it cannot find the user it sends request to its SP once again and as a result receives eight IP addresses and port numbers The process continues until the user is found If the user is behind a NAT and an UDP-restricted firewall, SP searches user on behalf of the client Search results are cashed in the intermediate nodes Skype - call establishment If both a caller and a callee have public IP addresses, a caller sends signaling information over TCP to a callee If a callee is behind a port-restricted NAT, caller sends signaling information over TCP to an online Skype node that forwards it to a callee If both a callee and a caller are behind a portrestricted NAT and an UDP-restricted firewall both exchange the information with an online Skype node 11
Mobile P2P Faster residential Internet connection, more powerful desktops, and cheaper storage were the main drivers stimulating P2P growth. We can observe a similar technological change in mobile networks Research on mobile P2P file sharing is ongoing in the Networking Laboratory! Mobile P2P challenges Shortage of resources: Battery, CPU, Memory, Network connection Widely used P2P applications/protocols have to be redesigned Business issues Understand and analyze the impact of peerto-peer services on the mobile market and its value chain Identify some key application scenarios that are likely to be attractive to users 12
Summary P2P architecture offers scalability, robustness and fault tolerance Content sharing is a dominant P2P application however other applications are emerging SIP over P2P concept aims to improve scalability and usability of standardized SIP applications In the near future we will see P2P services provided by mobile service operators Thank you! 13
References Ion Stoicay, Robert Morrisz, David Liben-Nowellz, David R. Kargerz, M. Frans Kaashoekz, Frank Dabekz,Hari Balakrishnanz Chord: A Scalable Peer-to-peer Lookup Protocol for Internet Applications Kundan Singh, Henning Schulzrinne, Peer-to-Peer Internet Telephony using SIP Salman A. Baset, Henning Schulzrinne, An Analysis of the Skype Peer-to-Peer Internet Telephony Protocol www.skype.com 14