Sunteți pe pagina 1din 24

P2P Internet Telephony : Skype

Distributed System Middleware(CS237)


Shin Hyung Kang(42043753), MS in Networked Systems

5/26/12

Outline
Introduction Related underlying techniques
P2P-Kazaa Traditional Internet telephony-SIP

Skype network architecture Skype software and functions Login Process Relay call establishment
5/26/12

Skype Introduction
P2P application based on Kazaa architecture
Developed by the founder of Kazaa(file-sharing com-

pany, Niklas Zennstrom, Janus Friis)

Similar capabilities to the MSN and others


However, the underlying protocols quite different

Proprietary protocol
Reverse engineering, experiments analysis

5/26/12

Skype-underlying techniques
P2P overlay: Kazaa
Super-node Lookup is based on some variation of flooding

Classical SIP telephony architecture


Centralized elements for login authentication SIP registar/Proxy

Global Index technology STUN and TURN in the node itself


Little known 5/26/12

Underlying techniquesP2P
1. Napster - Centralized 2. Gnutella - Decentralized 3. Kazaa - Hybrid

5/26/12

P2P Overview - Centralized


Napster
Based on central inclien t clien t

dex server

Clients register and

give list of files to share

clien
File t
-------------------------------------

Serv er
reply query

clien t

Direct download
File D ow

clien t

clien t

nload

clien t

5/26/12

P2P Overview - Distributed


Gnutella
Fully distributed sys-

tem

Flooding based

search

Direct download

5/26/12

P2P Overview - Hybrid


Kazaa
Not centralized

like Napster
Not decentralized

Supe r Node Supe r Node

Supe r Node

Ordinary Node

like Gnutella Flooding

Smart Query

Supe r Node

5/26/12

Underlying techniquesSIP
SIP Network Ele-

ments

DNS Server

User Agents Proxy Servers


Location Server

DNS
Outbound Proxy Server

SIP

Registrar Location service

Inbound Proxy Server

SIP SIP
UAC

SIP

Media(RTP)

UAS

5/26/12

SIP-Call Setup
DNS Server

4. DNS Lookup
Outbound Proxy Server

5. INVITE 9. 200 OK 12. ACK

Location Server

6. Lookup 2. 200 1. REGIS- OK 8. 200 TER OK 7. INVITE 13. ACK


UAS Inbound Proxy Server

3. INVITE

10. 200 OK 11. ACK


UAC

13. RTP media 14. BYE 15. 200 OK

Caller Alice

Callee Bob

5/26/12

How to make a variation of Skype


P2P + SIP = a variation of Skype Remove centralized elements
DNS Hash Key/Smart flooding Proxy Server Peers

5/26/12

Variation of Skype: Distributed SIP


Address binding Information SIP Proxy, Registar, DNS Lookup/rou ting

Registaration

Chord, CAN, Kademlia SIP Message

5/26/12

SkypeIn / Skype Network Architecture SkypeOut servers

Skype login server Message exchange with the login server during login

Two types of nodes


Ordinary hosts Super nodes(SN)

Similar to SIP registrar, Proxy server

Skype login server


Only centralized ele-

ment

PSTN gateway server


Skype In/Out call
5/26/12

ordinary host (SC) super node (SN) neighbor relationships in the Skype network

Skype Super Node

5/26/12

SN IP address distribution US : 84% Asia : 9% Europe : 7%

Skype Client(SC)
Listens on particular ports for incoming Maintains Host caches Wideband codecs Maintains Buddy list Encrypts messages end-to-end Determines if it is behind a NAT or a firewall

5/26/12

Skype software - Port


TCP/UDP listening port randomly chosen on

installation

TCP listening port at 80 and 443

5/26/12

Skype software Host Cache


pairs
Refreshed regularly, Stored as XML file

Local list of super node IP address and port

Upon startup the client reads an entry from

the host cache, and tries to connect to this SN.


If connection fails (the SN is offline; it is no

longer part of the network, etc) it reads next entry and tries to connect to it.

5/26/12

Skype software Host Cache


ml

C:\Users\sh\AppData\Roaming\Skype\shared.x

12,806 Bytes !!!s


5/26/12

Skype software Bootstrap IP/Port


the Skype executable with HC entries
IP address:port 66.235.180.9:33033 66.235.181.9:33033 212.72.49.143:33033 195.215.8.145:33033 64.246.49.60:33033 64.246.49.61:33033 64.26.48.23:33033 Reverse lookup result sss1.skype.net No PTR result No PTR result No PTR result rs-64-246-49-60.ev1.net rs-64-246-49-61.ev1.net ev1s-64-246-48-23.ev1servers.net Authority section ns1.hopone.net ns1.hopone.net

Bootstrap IP address and port pairs hardcoded in Used, when unable to establish TCP connection

ns07.customer.eu.level3.net ns3.DK.net ns2.ev1.net ns2.ev1.net ns1.ev1.net

<Bootstrap SN IP address and Hostnames ob5/26/12 tained by a reverse Lookup>

Login Process
Start

TCP connection attempt with HC IP/port80

YES

Connected

No
Send UDP to HC IP/Port TCP connection attempt with HC IP/port443

Success

YES

Response within 5sec

YES
Success

Connected

No

No
Attempt=5 ?

Failure

TCP connection attempt with HC IP/Port

YES

YES

Connected

No

No
Wait for 6 sec

5/26/12

NAT and Firewall Traversal


NAT and firewall it is behind
No global NAT and firewall traversal

Variant of STUN protocol to determine the type of

5/26/12

Call Relay
TCP con S ction Skype Netnec S onne tion N CP c work B T N Media SC SC A 1 2 Me di NA edia M a NA Host cache T T S (HC) A N S B C C N D E E SC = Relay Node S Skype (RN) N Client 5/26/12
1. 2. 3. 4. 5. 6.

Skype Functions: Call Establishment


n

Caller and callee are behind port-restricted NAT and UDP-blocking firewall

5/26/12

2323

References [1] An Analysis of the Skype Peer-to-Peer Internet Telephony Protocol bySalman A. Baset and Henning Schulzrinne [2] Silver Needle in the Skype by Philippe Biondi and Desclaux Fabrice [3] Skype Relay Calls: Measurements and Experiments by Wookyun Kho, Salman Baset, and Henning Schulzrinne

Thank you

5/26/12

S-ar putea să vă placă și