Advanced Internetworking Lab 5 - Multimedia networking rev 1.0 Markus Hidell <mahidell@kth.se> Voravit Tanyingyong <voravit@kth.se> Royal Institute of Technology (KTH) Telecommunication Systems Lab (TSlab) Isafjordsgatan 39 164 40 Kista Name: Date: Lab assistant signature: IK2215: Lab 5 - Multimedia Networking Page 1 of 10
1. Introduction In this lab, you will get practical experience of multimedia networking by means of streaming stored media (audio/video). You will look into different ways to get access to the stored media i.e. via HTTP, and the real-time streaming protocol (RTSP). You will also look at alternative approach to distribute the stored multimedia content. 2. Overview Preparation Lab setup Streaming stored media Content Distribution Network (CDN) Peer-to-Peer streaming 3. Preparation 3.0. Reading Material In order to be able to complete the lab on schedule you need to prepare. Below is a list of reading material that you must complete before coming to the lab. 1. Course book: Read chapter 7 (7.1-7.4) 2. Course web: Additional materials DNS configuration study how to configure the DNS server. DHCP configuration study how to configure DHCP server. Browser configuration if your browser does not support RTSP, you might need to make it recognize RTSP protocol. To do this, read the following: o http://kb.mozillazine.org/register_protocol o http://www.masspolicy.org/pdf/firefox_rstp.pdf 3. DNS and DHCP configuration (optional): DNS The ISC BIND distribution (http://www.isc.org/sw/bind/) contains several files with useful information: o BIND FAQ o BIND Administration Reference Manual (our equipment uses BIND 9.4). o Other man pages that you may find interesting e.g. named(8), named.conf(5) man pages. DHCP The ISC DHCP distribution (http://www.isc.org/sw/dhcp/) contains several files and man pages with useful information: IK2215: Lab 5 - Multimedia Networking Page 2 of 10
o dhcpd(8) man page. o dhcpd.conf sample file. o Several other man pages that you may find interesting e.g. dhcprelay(8), dhcpd.conf(5), dhcpd.leases(5) and dhclient(8) man pages. 4. Wireshark documentation (optional): Extensive information about how to use Wireshark network protocol analyzer can be found at Wireshark's home page (http://www.wireshark.org/docs/) 3.1. Preparation Questions Below are a number of preparation questions that you must complete before coming to the lab. The lab assistants will go over your answers before the lab starts and if you have not completed them in a satisfactory way you will be sent home so you can prepare in a proper way. Question 1 What are the two key characteristics of networked multimedia applications? Question 2 What is packet jitter? Question 3 What does Real Time Streaming Protocol (RTSP) use for and what is its default port? Question 4 Explain what does a TCP slow-start mean? Question 5 Explain the overall communication process of streaming stored multimedia (how do the client and the server communicate?) IK2215: Lab 5 - Multimedia Networking Page 3 of 10
Question 6 What is a content distribution network (CDN) and why are the key benefits in using CDN for distributing multimedia? Question 7 Explain briefly about Peer-to-Peer architecture? 4. Lab setup Figure 1: Lab setup There are 4 groups in total, 4-6 persons per group. Each group should have the following equipment: 1 switch 5 straight cables 4 laptops - 2 IBM and 2 Dell with their respective power adapters (You are encouraged to use your own laptops!) IK2215: Lab 5 - Multimedia Networking Page 4 of 10
5. Streaming stored media In this first part of the lab you will be setting up a simple local network for testing media streaming. Each group should use corresponding IP address according to the Figure 1. A DNS and DHCP configuration has already been prepared by the lab instructor. Gateway for each group is already provided by the lab instructor. You will work in a group of 4-6 students. 5.1. Streaming stored media with HTTP In this part of the lab you will be accessing a video media through a web server Now do the following: 1. Connect all laptops to a local switch (DO NOT connect to the switch to the gateway as yet!) 2. On DNS/DHCP server, do the following: a. Configure IP address (make sure you stop dhclient process!) b. Configure default gateway c. Configure /etc/resolv.conf file to use local machine as a DNS server by having nameserver point to your IP address. d. Configure DNS and DHCP accordingly. (You can get preconfigured configuration files from the course web and uncomment the configuration for your group) e. Start DNS and DHCP server daemons. 3. Connect the switch to the gateway and check that everything is working properly. 4. To monitor the traffic, run "sudo wireshark" command to start wireshark as root. (If you want to see only traffic between you and the media server, you can write "ip.addr == 192.168.0.2" in the filter string and click on "Apply" button). 5. Open the web browser. Clear all private data and then go to the URL http://media.lab, click on the link for this section and observe the captured data on wireshark. 6. Once the video start to play on the browser, you can click pause and play a few times while observing the captured data on wireshark. 7. Answer all the question below 8. Call lab assistant to show your setup and result. Question: Explain the overall communication process between the client and the server and compare it to the process in the course book (Figure 7.1 p.627) IK2215: Lab 5 - Multimedia Networking Page 5 of 10
Question: Can you see packet jitter? How does the application prevent it from happening? Question: Does the client close TCP connection when you pause the video streaming? Question: Can you move forward or backward to see a certain part of the video? 5.2. Streaming stored media with RTSP Now do the following: 1. Continue from the previous section, do the following a. Clear all private data from the browser, then close the browser b. Reset the live capture on the wireshark (click "stop" and "start" to clear all captured data) 2. Open the web browser. Clear all private data and then go to the URL http://media.lab, click on the link for this section and observe the captured data on wireshark. 3. Once the video start to play on the browser, you can click pause and play a few times while observing the captured data on wireshark. 4. Stop the media player. Observe the captured data on wiershark. 5. Answer all the question below 6. Call lab assistant to show your setup and result. Question: Explain the overall communication process between the client and the server. Question: Is it possible to move forward or backward to see a certain part of the video? If so, why? IK2215: Lab 5 - Multimedia Networking Page 6 of 10
Question: What other protocols related to multimedia streaming can you see? What are their functions in the streaming process and what transport protocol do they run on top of? 6. Content Distribution Network (CDN) In this part of the lab, you will be looking at the alternative approach to distributing stored multimedia content by means of introducing a content distribution network. We will use the normal HTTP streaming as our test protocol. The DNS/DHCP server in each group will also be used as a CDN server. You will still work in a group of 4-6 students. Now do the following: 1. Continue from the previous section, do the following a. Clear all private data from the browser, then close the browser b. Reset the live capture on the wireshark (click "stop" and "start" to clear all captured data) 2. On CDN server, do the following: a. Edit /etc/bind/named.conf.local to enable cdn.lab domain b. Edit /etc/bind/db.cdn.lab to point www record to the IP address of your server. Make sure you also have NS record to the correct group number. c. Restart bind d. Verify that www.cdn.lab resolve correctly by running command "host www.cdn.lab" 3. On CDN server, configure the apache server by doing the following: a. Check what site is enabled by running command "ls /etc/apache2/site-enabled". A name listed there is the enabled site. b. Disable all the apache site by running command "sudo a2dissite <site-name>" c. Create an apache site for www.cdn.lab using default configuration. You can do this by running a command "cp /etc/apache2/site-available/default /etc/apache2/site-available/cdn". d. Enable cdn site by running command "sudo a2ensite cdn" IK2215: Lab 5 - Multimedia Networking Page 7 of 10
e. Run command "cd /var/www" to go to web root directory. f. Run command "sudo mkdir -p media.lab/trailers", to create directory g. Put the video file in the folder that you just created. (You can download the video file from the media server using "sudo wget http://media.lab/trailers/sample_300kbit.mp4" command, make sure that you have public read access to the file by running command "chmod +r <video_file>). h. Restart apache with command "sudo /etc/init.d/apache2 restart" i. Verify that the apache server is running properly. 4. On the clients, open the web browser. Clear all private data and then go to the URL http://media.lab, click on the link for this section and observe the captured data on wireshark. (make sure to change the filter of your wireshark to "ip.addr==192.168.0.2 or ip.addr==192.168.x.2", where x is your group number.) 5. Once the video start to play on the browser, you can click pause and play a few times while observing the captured data on wireshark. 6. Answer all the question below 7. Call lab assistant to show your setup and result. Question: From which machine did you get the media stream from? Explain the overall communication process between the client and the streaming server Question: What do you think is the benefit of using CDN in this case? 7. Peer-to-Peer streaming In this part of the lab, you will be looking at an alternative approach to distributing stored multimedia content by means of peer-to-peer streaming. IK2215: Lab 5 - Multimedia Networking Page 8 of 10
Peer-to-Peer streaming is a new emerging technology. There are various on-going researches and products available for you to download and try on the Internet. In this part of the lab, we will be using SwarmPlayer (you can download it from http://trial.p2p-next.org), which is a piece of software developed by P2Pnext project, in which TSlab is involved in. Now do the following: 1. Make sure that you have SwarmPlayer installed in your laptop, then run SwarmPlayer. Right click on SwarmPlayer icon on the task bar and select the options. Click on Advance button and clear the cache. 2. Reset the live capture on the wireshark. (Don't forget to remove the filter!) 3. Open the web browser. Clear all private data and then go the URL http://media.lab, click on the link for this section. Make sure that you select to open it with SwarmPlayer (the Swarmplayer binary is most likely located at /usr/bin/swarmplayer) and observe the captured data on wireshark. 4. Answer all the question below 5. Call lab assistant to show your setup and result. Question: From where did the content come from? Question: Do you think the performance is improved with this approach compared to the CDN approach? Question: What are the key benefits of using P2P streaming? IK2215: Lab 5 - Multimedia Networking Page 9 of 10
8. Last step Now do the following: 1. On all laptops, Clear the cache on Swarmplayer. You can do this by running Swarmplayer. Right click on SwarmPlayer icon on the task bar and select the options. Click on Advance button and clear the cache. 2. On all laptops, switch user to root and run "shutdown -h now" at the shell terminal. Wait until the machine is completely turned off before closing the lid. 3. Put all equipment back in the right boxes. 4. Thank you! End of Lab 5 IK2215: Lab 5 - Multimedia Networking Page 10 of 10