Department of Communications and Networking S-38.2131/3133 Networking Technology, laboratory course A/B Work Number 29: VoIP Student Edition Preliminary Exercises and Laboratory Assignments Original document by Ilkka Kiiskinen updated 13.2.2007 Pasi Lehto updated 29.8.2012 Neela Shrestha & Erik Kosonen updated 29.04.2014 Erik Kosonen
Table of Contents 1. Preliminary Exercises...3 1.1 Introduction...3 1.2 QoS preliminary questions...3 1.3 Signalling preliminary questions...4 2. Laboratory work...5 2.1 Introduction...5 2.2 Topology and network connections...5 2.3 Configuration of SIP Components...6 2.4 SIP Trunking...7 2.5 QoS and codecs...7 2.6 VoIP Security and threats...8 3. Final Report...8 4. Useful References...9 APPENDIX A...9 Page 2 of 9
1. Preliminary Exercises 1.1 Introduction Voice over Internet Protocol, VoIP, has been on spotlight during the past few years. VoIP is a technology which allows you to make a telephone call over a data network, like Internet. This laboratory work gets you familiar with signalling, codecs, quality of service and security in VoIP-technology. In preliminary exercises students will compare SIP and H.323 VoIP signalling protocols on a theoretical level. However the laboratory assignments are only about the SIP protocol. 1.2 QoS preliminary questions PQ1: (7 points) VoIP has been considered as a killer application by many specialists. Which economical and technical benefits can be achieved by implementing VoIP? What about the dis-benefits? PQ2: (3 points) Silence compression. What do the following acronyms stand for? Explain their functions briefly: VAD, DTX, and CNG. PQ3: (6 points) Get familiar with the most typical audio codecs: G.711, G.723.1, G.729A and AMR. Find the main characteristics for those speech coders (sampling rate, bit rate, frame size if frame-based). PQ4: (5 points) Explain Absolute Category Rating (ACR) and Mean Opinion Score (MOS) value? How are they related with each other? What are the MOS values of G.711, G.723.1, G.729A and GSM 06.10 codecs? PQ5: (2 points) What does SPIT acronym stand for? Tell briefly about it (Max. four sentences). PQ6: (3 points) What does STUN acronym stand for? What is the purpose of a STUN protocol? PQ7: (2,5 points) Find the ITU-T G.114 recommendations for one-way transmission time. What are the reference values for the different one-way delay classes? Page 3 of 9
1.3 Signalling preliminary questions PQ8: (6 points) Compare SIP (Session Initiation Protocol) and H.323-protocol. Compare at least six (6) features. PQ9: (9 points) Mention the architectural components of SIP and H.323 protocol. Explain the function of each. PQ10: (4 points) There are two types of gatekeeper signalling methods in H.323, which are they? Draw the signalling messages of a succeeded call signalling procedure in both methods. PQ11: (4 points) Before entering the lab, it is recommended for students to familiarize themselves with Asterisk VoIP software. Especially how to add and create extensions and simple sip configurations. (extensions.conf and sip.conf files). Include an example of your extension configuration. Useful link: http://www.asterisk.org/docs Read the working instructions and the questions, so that you have already a picture of the work in your mind. So you may find the answers for the final report questions a bit easier. As well you may skip prefaces during the work if you have already read them forehand and you may complete the work a bit quicker. Page 4 of 9
2. Laboratory work 2.1 Introduction The laboratory equipment is configured around SIP solutions. There are two designated SIP -servers (both are virtual) which are running Asterisk based VoIP software. Both are used to provide SIP VoIP service. Also there should be at least two VoIP phones and a Dummy-pc for various network simulation scenarios. It is also possible to utilize so called softphones on VoIP-pc. All the configurations are designed to be done from VoIP-pc, but the students can use the dummy pc for configuring as well. Dummy-pc has Ubuntu-server edition installed on it, whic is command-line only, so there is no graphical interface. VoIP-pc has Ubuntu 12.04 installation with classic graphical Gnome Desktop. SSH can be used to access all the hardware remotely, except the VoIP phones. They do not support it, instead the configuration can be accessed via web interface. 2.2 Topology and network connections The topology of the VoIP laboratory assignment is demostrated in figure (1) below. Figure 1: VoIP topology Notes: VoIP-PC (10.38.224.1) is for management, but it also has software based VoIP phone (softphone) installed, which is used in lab assignments. Page 5 of 9
2.3 Configuration of SIP Components Q1. (2 points) First configure the SIP servers. Start with sip1.voip.lab (10.38.224.10). Add the configurations to create an account for Phone1 in sip1 according to your preliminary report. Also add dial plan for Phone1 in file /etc/asterisk/extensions.conf according to your preliminary report. Start the asterisk server with the command service asterisk start or /etc/init.d/asterisk start You can enter to the asterisk command-line interface (CLI) in verbose level 5 with the asterisk -rvvvvv command (Requires root privileges, sudo) Some useful commands are: CLI> sip reload #when sip.conf file is changed CLI> dialplan reload #when extensions.conf file is changed CLI> sip show peers CLI> sip show peer <peer-id> CLI> sip show channels Q2. (2points) Next, configure IP address, subnet mask, gateway and DNS servers in Phone1 with the help of manual attached to the index A. Check IP status of the each phone and also confirm that you can ping the VoIP phones. Q3. (2 points) Your task is to capture a packets containing SIP phone registration sequence. Start Wireshark with the commands given below. Configure the Phone1 via web interface. Enter the IP address of the phones in the address bar of web browser. Assign an extension number 1001 to the Phone1. The details should match to that of the dial plan in extensions.conf file in SIP server. Confirm the changes. The Light on right side of the phone should turn solid green on successful registration to SIP server. Run soft-phone Twinkle (an yellow star logo) on your VoIP-PC and configure it for extension 1002. Verify that the registration is successful. Stop the packet capture and analyse the captured packet. You can also see the registration message in Asterisk console. WireShark Commands: connect via SSH: ssh -X capture@capture.noc.lab Password: capture Start wireshark: sudo wireshark (requires root rights) Capture the traffic through interface eth1. Remember to mirror correct ports on the DLINK switch to the capture interface. Ask assistant if you cannot access the switchcontrol. Q4. (3 point) Start another packet capture. Call extension 1002 from Phone 1. Capture the packet during the call. Which codec is used during the call? How is the call made? Analyse the captured packets briefly in final report. Q5. (1 point) In this lab, what type of SIP server is this asterisk server, Proxy, Redirect or Registrar server? Why? Page 6 of 9
Q6. Similarly, configure SIP server sip2.voip.lab and VoIP Phone3 for extension 2001. Now, call 1001 or 1002 from Phone3. Is the call successful, why? 2.4 SIP Trunking Q7. (4 points) Enable trunking on SIP servers sip1.voip.lab and sip2.voip.lab. Start the packet capture and then make call to phone2 from phone1. Is the call successful? Which codec is used during the call? 2.5 QoS and codecs Real network consists of limited bandwidth along with latency, jitter, delays. These factors are to be introduced in our network using tc, netem and wondershaper. There is a dummy pc to emulate wide area network using netem (Network Emulation). It allows to test protocols by emulating variable delays, loss, duplication and reordering. Netem is used with command line tool tc (traffic control). You can learn more about it from the link: http://www.linuxfoundation.org/collaborate/workgroups/networking/netem Some useful commands for the lab are as below: To add certain delay to packets out of interface eth0, #tc qdisc add dev eth0 root netem delay <100ms> To add delay with random variation #tc qdisc change dev eth0 root netem delay <100ms> <10ms> To introduce loss in the network #tc qdisc change dev eth0 root netem loss <1%> For packet duplication/corruption #tc qdisc change dev eth0 root netem duplicate/corrupt <1%> For bandwidth limiting, another traffic shaping script called wondershaper. Check man pages for the commands. Call quality analysis is done in rather simplified in this lab work. Students grade VoIP call quality based on human opinion by using MOS (Mean Opinion Score) grading. The MOS scale with values ranging from 0 for unacceptable to 5 for perfect communication. Q8. (2 points) Induce varying delays and random jitter in the network. At least use values 0ms, 100ms, 200, 500ms, 1000ms and 10000ms to simulate calls from local call to a satellite call. Check the quality of call between phones and its MOS value. Analyse the results in few sentences. Mention highest delay for acceptable VoIP call and the effect of delay and jitter in the call. Page 7 of 9
Q9. (2 points) Change the delay to zero and then alter the packet loss values. Use values 0%, 5%, 10%, 25% and 50%. Check the quality of call between phones and its MOS value. Analyse the results in few sentences and also write the highest loss value for acceptable VOIP call. How does packet duplication and corruption affect in the VOIP call? Q10. (2 points) Get familiar with different kinds of codecs and the effects of codecs on limited bandwidth. Change codecs to be used in sip.conf file with parameters disallow and allow. Also limit available bandwidth with wondershaper. Apply bandwidth limitation on both interfaces eth0 and eth1 on the Dummy PC. Use codecs g711 (ulaw / alaw), g729 at bandwidth 16kbps, 32 kbps, 64 kbps, 128 kbps, 256kbps and 1024 kbps. Note that G.711 (PCM U/A) codec is defined as ulaw or alaw in asterisk configuration. 2.6 VoIP Security and threats VoIP hasn t survived without security problems. Companies implementing VoIP services tend to be concerned about quality issues and ignore security. The threads are mostly similar as for any of the data and the securing methods doesn t differ from the securing methods of the other data either. The differences concern mostly about architecture and some service features. This part scratches only the surface of VoIP-security. The idea of this part is to show how unsecured VoIP-traffic may be. Q11. (3 pts) Start wireshark again. Ensure that the extensions are using the G.711 (ulaw or alaw) codec. Make a call to any phone and capture the traffic again. Keep talking to each other about 20 seconds. Filter the RTP traffic from the rest of the traffic in wireshark. Go to Telephony menu->rtp->show All Streams. There select a RTP stream from the list, preferably with largest packet count. Push the Analyze button. Save payload as.au file and listen the file with any media player. On Ubuntu system you can use Rhytmbox. Remember to transfer your files via SCP to the VoIP-PC (10.38.224.1). Did you succeed in decoding and did you hear anything? Let the assistant hear the captured conversation. 3. Final Report FQ1. There are many more codecs involved with the VoIP technology. Find and list here at least four more along with their basic properties: sampling rate, bit rate, frame size (if frame-based). FQ2. What security threats can be found for VoIP traffic or system? Mention at least four of them. (One of them may be closer than you thought) FQ3. Give few tips to improve VoIP security. Page 8 of 9
4. Useful References Wondershaper: http://ubuntuforums.org/showthread.php?t=25911 Netem: http://www.linuxfoundation.org/collaborate/workgroups/networking/netem Sip: http://tools.ietf.org/html/rfc3665 Skype gateways: http://www.voip-info.org/wiki/view/skype+gateways Asterisk: http://www.asterisk.org/docs APPENDIX A VOIP Phones checking or configuring via keypad: Check Configure IP Address **90# **80# then <ip address># Subnet Mask **91# **81# then <subnet mask># Gateway **92# **82# then <gateway># DNS1 **93# **83# then <dns1># DNS2 **94# **84# then <dns2># DHCP **88# then 0# to disable DHCP **88# then 1# to enable DHCP VOIP Phones checking or configuring via web: Dial **90# to get ip address of the phone. Then enter the address in address bar of browser. Login: admin Password: admin In the account settings, activate the account and change the required parameters. Note: PC used for login should be on the same network as the of phone. Page 9 of 9