ESPOO–VANTAA INSTITUTE OF TECHNOLOGY Voice over IP Demonstration 3: VoIP Protocols Demonstration Network On this demonstration, we have a single Linux laptop, that simulates a simple IP telephony network of two SIP User Agents. Protocol packets, datagrams and messages may be captured and analysed by the Ethernet protocol analyser, as shown in Figure 1. Ethereal IP IP linphone linphone Figure 1: A gateway between the IP telephony system and POTS. For SIP UA, a console based linphonec is used (a graphical Gnome linphone application is also offered). For test calls, sipomatic listens to a non-default SIP port of 5064, answers a call and plays a wellcome voice message. All communications is taking place using the loopback test interface (this is Linux!). Ethereal, Linphone and Sipomatic For simplicity, it is easiest to start the Ethereral protocol analyser first and start capturing from the lo0 interface. For a test call using the loopback interface, we must set up the sipomatic server to listen to the port 5064: [root@laptop root]# ethereal& [root@laptop root]# sipomatic MediaStreamer-Message: Found /dev/dsp. oRTP-Message: oRTP-0.7.1initialized. ** Message: Starting using url sip:robot@127.0.0.1:5064 | INFO1 | <eXosip.c: 332> eXosip: Reseting timer to 15s before waking up! VANHA MAANTIE 6 02650 ESPOO matti.puska@evitech.fi VOICE OVER IP DEMO3: VOIP PROTOCOLS 1 MATTI PUSKA ESPOO–VANTAA INSTITUTE OF TECHNOLOGY While sipomatic occupies the console in foreground and displays SIP messages and other debug information, we must open a second terminal for the SIP UA. Using the linphonec console application commands, we dial to user robot on the loopback interface using port 5064 for SIP signalling. After the wellcome message we terminate the call and close the linphonec application: [root@laptop root]# linphonec Ready. linphonec> call sip:robot@127.0.0.1:5064 Contacting sip:robot?@127.0.0.1:5064 linphonec> Connected. terminate Communication ended. linphonec> <Ctrl> c [root@laptop root]# The sipomatic server records all SIP messages and their detail on the console. For example, INVITE is used to initiate a call. Because SIP and SDP messages use text encoding, they are easy to decode: INVITE sip:robot@127.0.0.1:5064 SIP/2.0 Via: SIP/2.0/UDP 127.0.0.1:5060;rport;branch=z9hG4bK1886724648 From: <sip:root@192.168.151.107>;tag=623921884 To: <sip:robot@127.0.0.1:5064> Call-ID: 1902702998@127.0.0.1 CSeq: 20 INVITE Contact: <sip:root@127.0.0.1:5060> Max-Forwards: 5 User-Agent: Linphone-1.1.0/eXosip Subject: Phone call Expires: 120 Allow: INVITE, ACK, CANCEL, BYE, OPTIONS, REFER, SUBSCRIBE, NOTIFY, MESSAGE Content-Type: application/sdp Content-Length: 346 Call Setup Phone calls must be set up, maintained and terminated, and signalling messages are used for this, both on a circuit switched and packet switched network. On a VoIP system, also session parameters must be agreed on. Session Initiation Protocol is a popular IP based signalling protocol. On our example, call setup includes the following SIP messages (Figure 2): • INVITE • Trying • Dialog Established • Ringing • OK. VANHA MAANTIE 6 02650 ESPOO matti.puska@evitech.fi VOICE OVER IP DEMO3: VOIP PROTOCOLS 2 MATTI PUSKA ESPOO–VANTAA INSTITUTE OF TECHNOLOGY The call is terminated by a BYE. Figure 2: SIP Signalling messages. For example, the INVITE request includes a request line, message header and message body. From the Ethereal drill-down symbols, we may have a closer look at each of these parts. Some SIP messages include a Session Description Prototocol message for session negotiation. Also SDP messages are text coded. Each line contains an identifier, an equal to sign and the value. For example, the INVITE message includes version, owner, session, contact, time, media, and audio lines: v=0 o=root 123456 654321 IN IP4 127.0.0.1 s=A conversation c=IN IP4 127.0.0.1 t=0 0 m=audio 7078 RTP/AVP 0 3 8 110 111 115 101 b=AS:20 a=rtpmap:0 PCMU/8000/1 a=rtpmap:3 GSM/8000/1 VANHA MAANTIE 6 02650 ESPOO matti.puska@evitech.fi VOICE OVER IP DEMO3: VOIP PROTOCOLS 3 MATTI PUSKA ESPOO–VANTAA INSTITUTE OF TECHNOLOGY a=rtpmap:8 PCMA/8000/1 a=rtpmap:110 speex/8000/1 a=rtpmap:111 speex/16000/1 a=rtpmap:115 1015/8000/1 a=rtpmap:101 telephone-event/8000 a=fmtp:101 0-11 Audio Data Voice samples are transported over the UDP port 7078, as agreed on the media line of the SDP message. G.711ulaw samples are encapsulated with RTP message headers and send periodically. RTP header includes necessary information for real-time data timing, reordering and loss detection (Figure 3): Figure 3: RTP Message header and payload. For each RTP stream, there are RTCP message exchange as well. Normally, each RTP sender sends periodic Sender Reports. Additional Information On my web page, there is an Ethereral capture of the demo call. You may open this with Ethereral, either on Win or Linux, filter the protocol you are interested in and analyse messages (or segments or datagrams or packets). The file name is linphone. VANHA MAANTIE 6 02650 ESPOO matti.puska@evitech.fi VOICE OVER IP DEMO3: VOIP PROTOCOLS 4 MATTI PUSKA