voip over p2p networksledvina/dht/voip.pdf · –interactive: user can control operation, e.g....
TRANSCRIPT
Víctor Ramos - UAM Iztapalapa October 7, 2006
1
VoIPVoIP over P2P over P2P networksnetworks
VVííctorctor RamosRamos
UAMUAM--IztapalapaIztapalapa
RedesRedes y y TelecomunicacionesTelecomunicaciones
http://laryc.izt.uam.mx/~vramos
Víctor Ramos 2
• 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.
What is the What is the ““InternetInternet”” ??
Víctor Ramos - UAM Iztapalapa October 7, 2006
2
Víctor Ramos 3
Víctor Ramos 4
Internet service: Best effortInternet 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 - UAM Iztapalapa October 7, 2006
3
Víctor Ramos 5
Audio over the Internet: Audio over the Internet: AdvantagesAdvantages
Víctor Ramos 6
Audio over traditional Audio over traditional PSTNsPSTNs
Víctor Ramos - UAM Iztapalapa October 7, 2006
4
Víctor Ramos 7
Convergence of voice and data Convergence of voice and data netsnets
Víctor Ramos 8
Business scenarios to support IP Business scenarios to support IP telephonytelephony
Víctor Ramos - UAM Iztapalapa October 7, 2006
5
Víctor Ramos 9
Audio over a packet switching Audio over a packet switching network as the Internetnetwork 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 10
Rating quality with the ERating quality with the E--modelmodel• 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 - UAM Iztapalapa October 7, 2006
6
Víctor Ramos 11
Classes of audio applicationsClasses 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 12
Audio streaming classAudio streaming class
Data stream
Playback pt Rcv pt
In transmission
or to be transmitted
• Streaming: Application usage of data during its transmission.
– 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 - UAM Iztapalapa October 7, 2006
7
Víctor Ramos 13
The other two classesThe 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 14
Transport of audio over the InternetTransport 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 - UAM Iztapalapa October 7, 2006
8
Víctor Ramos 15
Internet service can be badInternet service can be bad
• 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.
– Round-trip time set to 0 when a packet
is lost.
RT
T (
ms)
Probe number
9 % of probes are lost in this experiment.
Víctor Ramos 16
Challenges in supporting audio: Challenges in supporting audio: DelayDelay
• 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 msecinteractivity 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 - UAM Iztapalapa October 7, 2006
9
Víctor Ramos 17
Solve jitter by delaying Solve jitter by delaying packetspackets
Víctor Ramos 18
FEC via variable encodingsFEC 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
2 3 41 2 31
Original audio stream
Addition of FEC (c = 1)
Transmission
3 42 31 Received stream (2 lost)
3 41 2 After decoding FEC
0
0
Víctor Ramos - UAM Iztapalapa October 7, 2006
10
Víctor Ramos 19
Peer-to-peer Networks
Víctor Ramos 20
DefinitionDefinition ofof P2P*P2P*
1. Significant autonomy from central servers.
2. Exploits resources at the edges of theInternet– G storage and content
– G CPU cycles
– G human presence
3. Resources at edge have intermittentconnectivity, being added & removed
*Tutorial on P2P: Dan Rubenstein and Keith Ross, Infocom2004
Víctor Ramos - UAM Iztapalapa October 7, 2006
11
Víctor Ramos 21
ApplicationsApplications deployeddeployed overoverP2P P2P networksnetworks
• 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 overemerging overlays– PlanetLab
• Wireless ad-hocneworks.
Víctor Ramos 22
P2P file P2P file sharingsharing• Alice runs P2P clientapplication on hernotebook computer
• Intermittentlyconnects to Internet; gets new IP addressfor each connection
• Registers her content
• Asks for “Hey Jude”
• Application displaysother peers that havecopy of Hey Jude.
• Alice chooses one of thepeers, Bob.
• File is copied from Bob’s PC to Alice’s notebook: P2P.
• While Alice downloads,other usersuploading from Alice.
Víctor Ramos - UAM Iztapalapa October 7, 2006
12
Víctor Ramos 23
• Is success due to massive number ofservers or simply because content is“free” ?
Víctor Ramos 24
SkypeSkype: P2P : P2P VoIPVoIP
• VoIP client developed in 2003 by theorganization that created Kazaa.
• It claims that it can (almost) cross NATs andfirewalls.
• Better voice quality than other VoIP clients(?)
• It encrypts calls e2e.
• It stores user information in a decentralizedway.
• It also supports instant messaging andconferencing.
Víctor Ramos - UAM Iztapalapa October 7, 2006
13
Víctor Ramos 25
SkypeSkype architecturearchitecture
• Two types of nodes: Ordinary hosts andsuper nodes.
• Ordinary host (SC): Skyp app used toplace voice calls.
• Super node (SN): Ordinary host’s end-point on the Skype network.
• Any SC with enough resources is a candidate to become an SN.
Víctor Ramos 26
SkypeSkype architecturearchitecture (2)(2)• SC connects to an SN and authenticates itselfwith the Skype login server.
• The Skype login server is not a Skype node. Itstores 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 storedand propagated in a decentralized way.
Víctor Ramos - UAM Iztapalapa October 7, 2006
14
Víctor Ramos 27
SkypeSkype architecturearchitecture (3)(3)
Víctor Ramos 28
SkypeSkype architecturearchitecture (4)(4)
• Each SC maintains a table of reachablenodes called host cache (HC).
• An HC is stored in an XML file andcontains IP addresses and port numbersof super nodes.
Víctor Ramos - UAM Iztapalapa October 7, 2006
15
Víctor Ramos 29
World World mapmap ofof supernodessupernodes
Víctor Ramos 30
SkypeSkype vsvs otherother VoIPVoIP clientsclients
• Why Skype users report better voicequality 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 - UAM Iztapalapa October 7, 2006
16
Víctor Ramos 31
SkypeSkype vsvs otherother VoIPVoIP clientsclients(2)(2)
• It tries to get the best available network andCPU resources during its execution.
• It changes its priority on Windows while a callis being established.
• Comparing the mouth-to-ear delay of YahooMessenger, Google Talk, and MSN Messenger with Skype, the latter reports the better m2e delay.
• So, under the same network conditions, it ismore likely that the best subjective voicequality is reported for Skype clients.
Víctor Ramos 32
BlockingBlocking SkypeSkype traffictraffic
• Why ?
• Corporate nodes are potentialcandidates to become SN.
• But this would relay unwanted trafficthrough the corporate network.
• But, blocking Skype traffic can becomevery difficult.
Víctor Ramos - UAM Iztapalapa October 7, 2006
17
Víctor Ramos 33
HowHow toto blockblock SkypeSkype traffictraffic??• 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 34
HowHow toto preventprevent a a nodenode toto becomebecome anan SN?SN?
• One choice is to put a bandwidth limiteron Skype when no call is in progress.
• This is a quite “un-social” way of using Skype.
Víctor Ramos - UAM Iztapalapa October 7, 2006
18
Víctor Ramos 35
ConclusionConclusion
• Skype differs significantly from otherP2P file sharing applications: mainly onthe user behavior.
• P2P VoIP shows as an attractive solutionfor real-time voice transmission over theInternet.
• Besides Skype, there is also Netappel, and others to come.
Víctor Ramos 36
ReferencesReferences• 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.