VoIP over P2P networks Víctor Ramos UAM-Iztapalapa Redes y Telecomunicaciones Victor.Ramos@ieee.org http://laryc.izt.uam.mx/~vramos What is the Internet? The IP protocol suite and related mechanisms and applications (what is standardized at IETF). An international network interconnection made of ISPs, enterprises, campus, etc. Philosophy: Intelligence at the edges. Fastest possible forwarding of packets. No states in the network. Víctor Ramos 2 1
Víctor Ramos 3 Internet service: Best effort Packets are routed throughout the Internet without any guarantee by IP (Internet Protocol): Packets can be lost: Congestion in routers, transmission errors over wireless links, link outage, etc. Packets can be delayed: Queuing in routers, handoff in wireless networks, retransmissions at the link layer, etc. Packets be replicated. And packets can be delivered out of order. TCP improves this service for data transfer applications... Víctor Ramos 4 2
Audio over the Internet: Advantages Víctor Ramos 5 Audio over traditional PSTNs Víctor Ramos 6 3
Convergence of voice and data nets Víctor Ramos 7 Business scenarios to support IP telephony Víctor Ramos 8 4
Audio over a packet switching network as the Internet Audio signal is divided into time frames: Frame Size Each frame is sampled, coded and sent in a separate packet. Look ahead: A codec may wait a little before coding a frame in order to get more information on the audio signal, which may improve the coding. Many codes exist, with different coding rates and different qualities. Silence detection and suppression: Most codecs detect the silence and stop the transmission until the speaker resumes talking. Víctor Ramos 9 Rating quality with the E-modelE E-model: A model merging objective and subjective measures to predict the subjective quality a user will give to a voice call. The quality is evaluated using a subjective measure R that ranges from 0 to 100. The higher the rate, the better the quality. The quality of audio is acceptable if it is within the range 70-100 (comparable to the quality perceived in Public Switched Telephone Networks). Víctor Ramos 10 5
Classes of audio applications Three classes of applications: Streaming Unidirectional Real-Time Interactive Real-Time Each class might be broadcast (multicast) or may simply be unicast (point-to-point). Víctor Ramos 11 Audio streaming class Streaming: Application usage of data during its transmission. Data stream Playback pt Rcv pt In transmission or to be transmitted Clients request audio files from servers and listen to them during the download, e.g. RealPlayer. Interactive: User can control operation, e.g. pause, resume, fast forward. Important and growing application due to reduction of storage costs, increase in high speed net access from homes, enhancements to caching and introduction of QoS in IP networks. No strict constraints on the delay (5 to 10 seconds judged acceptable). Víctor Ramos 12 6
The other two classes Unidirectional Real-Time: Similar to existing radio stations, but delivery on the network. Non-interactive, just listen. No strict constraints on the delay, rate and losses are important. Interactive Real-Time : Phone conversation. More stringent delay requirement than Streaming and Unidirectional because of interactivity (good for less than 150 ms, acceptable for less than 400 ms, poor otherwise). This class is what we call IP telephony. Audio over the Internet or VoIP can be any one of the three classes. Víctor Ramos 13 Transport of audio over the Internet Transport of audio over the Internet These applications cannot be supported by TCP for different reasons: TCP introduces delay variability due to retransmissions and reordering. TCP introduces rate variability due to congestion control. Audio applications are sensitive to delay and rate. Moreover, audio applications can tolerate some losses and do not require full reliability: So the best choice is to support audio applications over UDP. But UDP does not provide any guarantee and the service can be very poor. Some measures must be taken! Víctor Ramos 14 7
Internet service can be bad RTT (ms) UDP probes sent at regular time intervals between INRIA and the University of Maryland in July 1992. A probe every 500 ms. Round-trip time (RTT) is measured. Probe number Round-trip time set to 0 when a packet 9 % of probes are lost in this experiment. is lost. Víctor Ramos 15 Challenges in supporting audio: Delay The delay can be large: Large delay harmful for interactive audio: One-way delay < 150 msec very good. One-way delay < 400 msec acceptable, beyond 400 msec interactivity is poor. And large delays exacerbate the problem of echo. Delay is not a problem for non-interactive audio e.g. radio, clips. Different components of delay: Propagation delay on links: NOTHING TO DO. Queuing delay in network routers: Something can be done. Give audio packets priority over data packets in network routers: Quality of Service. Víctor Ramos 16 8
Solve jitter by delaying packets Víctor Ramos 17 FEC via variable encodings Media-specific approach. Packet contents: High quality version of media frame k. Low quality version of media frame k-c (c is a constant called offset). If packet i containing high quality frame k is lost, then one can use packet i+c with low quality frame k in place. 1 2 3 4 Original audio stream 0 1 1 2 2 3 3 4 Addition of FEC (c = 1) Transmission 0 1 2 3 3 4 Received stream (2 lost) 1 2 3 4 After decoding FEC Víctor Ramos 18 9
Peer-to-peer Networks Víctor Ramos 19 Definition of P2P* 1. Significant autonomy from central servers. 2. Exploits resources at the edges of the Internet storage and content CPU cycles human presence 3. Resources at edge have intermittent connectivity, being added & removed Víctor Ramos *Tutorial on P2P: Dan Rubenstein and Keith Ross, Infocom 20 2004 10
Applications deployed over P2P networks P2P file sharing Napster, Gnutella, KazaA, edonkey, etc. P2P communication Instant messaging. VoIP: skype, netappel. P2P computation seti@home DHTs and their apps Chord, CAN, Pastry, Tapestry. P2P apps built over emerging overlays PlanetLab Wireless ad-hoc neworks. Víctor Ramos 21 Alice runs P2P client application on her notebook computer Intermittently connects to Internet; gets new IP address for each connection Registers her content P2P file sharing Asks for Hey Jude Application displays other peers that have copy of Hey Jude. Alice chooses one of the peers, Bob. File is copied from Bob s PC to Alice s notebook: P2P. While Alice downloads,other users uploading from Alice. Víctor Ramos 22 11
Is success due to massive number of servers or simply because content is free? Víctor Ramos 23 Skype: : P2P VoIP VoIP client developed in 2003 by the organization that created Kazaa. It claims that it can (almost) cross NATs and firewalls. Better voice quality than other VoIP clients (?) It encrypts calls e2e. It stores user information in a decentralized way. It also supports instant messaging and conferencing. Víctor Ramos 24 12
Skype architecture Two types of nodes: Ordinary hosts and super nodes. Ordinary host (SC): Skyp app used to place voice calls. Super node (SN): Ordinary host s endpoint on the Skype network. Any SC with enough resources is a candidate to become an SN. Víctor Ramos 25 Skype architecture (2) SC connects to an SN and authenticates itself with the Skype login server. The Skype login server is not a Skype node. It stores usernames and passwords as well as buddy lists. There are SkypeOut and SkypeIn servers: they provide PC-PSTN and viceversa connectivity. Online and offline user information is stored and propagated in a decentralized way. Víctor Ramos 26 13
Skype architecture (3) Víctor Ramos 27 Skype architecture (4) Each SC maintains a table of reachable nodes called host cache (HC). An HC is stored in an XML file and contains IP addresses and port numbers of super nodes. Víctor Ramos 28 14
World map of supernodes Víctor Ramos 29 Skype vs other VoIP clients Why Skype users report better voice quality than with other VoIP clients? Better playout delay control mechanism? Better loss concealment mechanism? Both? Is it due to the dynamics of P2P traffic? Maybe neither of these: Skype is a selfish application. Víctor Ramos 30 15
Skype vs other VoIP clients (2) It tries to get the best available network and CPU resources during its execution. It changes its priority on Windows while a call is being established. Comparing the mouth-to-ear delay of Yahoo Messenger, Google Talk, and MSN Messenger with Skype, the latter reports the better m2e delay. So, under the same network conditions, it is more likely that the best subjective voice quality is reported for Skype clients. Víctor Ramos 31 Why? Blocking Skype traffic Corporate nodes are potential candidates to become SN. But this would relay unwanted traffic through the corporate network. But, blocking Skype traffic can become very difficult. Víctor Ramos 32 16
How to block Skype traffic? One must inspect the payload of the network (TCP, UDP) traffic. At login Skype sends a login message to the login server. The first two messages in that flow are: Skype LS 0x1603010000 -> (5 bytes) <- 0x1703010000 (5 bytes) By blocking all incoming messages who have the signature 0x17030100, Skype is blocked. Víctor Ramos 33 How to prevent a node to become an SN? One choice is to put a bandwidth limiter on Skype when no call is in progress. This is a quite un-social way of using Skype. Víctor Ramos 34 17
Conclusion Skype differs significantly from other P2P file sharing applications: mainly on the user behavior. P2P VoIP shows as an attractive solution for real-time voice transmission over the Internet. Besides Skype, there is also Netappel, and others to come. Víctor Ramos 35 References An Analysis of the Skype Peer-to-Peer Internet Telephony Protocol. Salman A. Baset and Henning G. Schulzrinne. Infocom 2006. An Experimental Study of the Skype Peer-to-Peer VoIP System. Saikat Guha, Neil Daswani and Ravi Jain. IPTPS '06. Jean-Chrysostome Bolot, "Characterizing end-to-end packet delay and loss in the Internet", Journal of High Speed Networks, 2(3):305-323, 1993. Brian Gracely, Voice over IP (VoIP), Cisco Systems Next Generation Internet Symposium, 2001. R. Ramjee, Jim Kurose, Don Towsley and Henning Schulzrinne, "Adaptive playout mechanisms for packetized audio applications in wide area networks," Proceedings of IEEE INFOCOMM, pp. 680--686, June 1994. Prof. Dan Rubenstein, Real time Internet lecture, Columbia University. Prof. Henning Schulzrinne, Tutorial on Voice over IP, ACM SIGCOMM, august 2000. D. De Vleeschauwer, J. Janssen, G. H. Petit and F. Poppe, Quality bounds for packetized voice transport, Alcatel Telecommunications Review (1st quarter 2000) 19-24. Víctor Ramos 36 18