Video Stream over HSDPA under NS2 Simulation Environment: Tutorial

Instalation

  1. Install Cygwin
  2. Install ns2 2.28
  3. Install Evalvid
  4. Install MyEvalvid_RTP
  5. Install VLC media player. This tutorial uses VLC 0.8.6a.

Video Stream SImulation

  1. Run VLC.
  2. Click File > Open File.
  3. Click Browse > select video file > Click Open.
  4. In Advance Option group box, Check stream/save and Click settings.
  5. In Outputs group box, Check RTP and Input real Virtual PC IP address and port number (Input: 1234).
  6. Click OK in stream output dialog and return to open dialog. Do not click OK in this open dialog.
  7. Run Cygwin, go to RTPtools directory. Type: cd c: .
  8. Press Enter button in keyboard.
  9. Type: cd cygwin/home/”computer user name”/ns-allinone-2.28/ns-2.28/mympeg/ern_evd) .
  10. Press Enter button in keyboard.
  11. Type: ./rtpdump –F hex “real Virtual PC IP address”/1234 > aaa .
  12. Press Enter button in keyboard,
  13. Return to VLC program, click OK in open dialog.
  14. The video will be played and streamed out, and received by RTPdump. The data received will be saved in “aaa” file.
  15. When finishing streaming, return to the cygwin and do ctrl+C to stop receiving the data.
  16. Re-execute rtpdump program, but change parameter to become “-F dump”. This is because we have to save the data payload of each rtp packet. Type: ./rtpdump –F dump “real Virtual PC IP address”/1234 > bbb
  17. Press Enter button in keyboard .
  18. Click “play” in VLC
  19. When finishing streaming, remember to return to the cygwin and do ctrl+C to stop receiving the data.
  20. Close VLC
  21. Now, we have “aaa” and ”bbb” file in c:/cygwin/home/”computer user name”/ns-allinone-2.28/ns-2.28/mympeg/ern_evd directory.
  22. Execute work1.exe program to analyze the information of “aaa” file. Type: ./work1.exe .
  23. Press Enter button in keyboard .
  24. Type: aaa (if you mistyped this input, just press Enter button in keyboard, and repeat to execute work1.exe) .
  25. Press Enter button in keyboard .
  26. Type: st_a00 (if you mistyped this input, just press Enter button in keyboard, and repeat to execute work1.exe). st_a00 is referred to stream trace variable that used in wireless scenario.
  27. Press Enter button in keyboard.
  28. We get “st” file in c:/cygwin/home/”computer user name”/ns-allinone-2.28/ns-2.28/mympeg/ern_evd directory.
  29. Executes wireless scenario. Type: ns Evalvid_eurane.tcl 1.
  30. Press Enter button in keyboard.
  31. After the simulation there will be “sd_a00” and “rd_a00” files in c:/cygwin/home/”computer user name”/ns-allinone-2.28/ns-2.28/mympeg/ern_evd directory.
  32. Execute work2.exe program. Type: ./work2.exe .
  33. Press Enter button in keyboard.
  34. Type: rd_a00 (if you mistyped this input, just press Enter button in keyboard, and repeat to execute work2.exe).
  35. Press Enter button in keyboard.
  36. Type: lost (if you mistyped this input, just press Enter button in keyboard, and repeat to execute work2.exe).
  37. The “rd_a00” file we input is receiver trace file, and “lost” file record mainly the packets which are lost when transmitting.
  38. Press Enter button in keyboard.
  39. Type: 1328 (if you mistyped this input, just press Enter button in keyboard, and repeat to execute work2.exe).
  40. 1328 is rtp packet payload size, not input total packet size. The size of “sd” and “rd” files is IP header + UDP header + rtppayload. We need rtp payload size here, read from second column in “st” file.
  41. Press Enter button in keyboard.
  42. We get “lost” file in c:/cygwin/home/”computer user name”/ns-allinone-2.28/ns-2.28/mympeg/ern_evd directory.
  43. Execute work3.exe program, this program will analyze “lost” file and remove the lost information from data received by rtpdump. Therefore, we can obtain the data which is the same as received in the receiver (such as “ccc” file).
  44. Type: ./work3.exe .
  45. Press Enter button in keyboard.
  46. Type: lost (if you mistyped this input, just press Enter button in keyboard, and repeat to execute work3.exe).
  47. Press Enter button in keyboard.
  48. Type: bbb (if you mistyped this input, just press Enter button in keyboard, and repeat to execute work3.exe).
  49. Press Enter button in keyboard.
  50. Type: ccc (if you mistyped this input, just press Enter button in keyboard, and repeat to execute work3.exe).
  51. Press Enter button in keyboard.
  52. We get “ccc” file in c:/cygwin/home/”computer user name”/ns-allinone-2.28/ns-2.28/mympeg/ern_evd directory.
  53. Re-execute VLC.
  54. Click “File”->”Open Network Stream…”.
  55. Make sure, the configuration in UDP/RTP option and the port is 1234.
  56. Check “Stream/Save” and click “Settings”.
  57. Check “File”.
  58. Click “Browse”. Input the filename you want to save the streaming result. Type: distorted.mp4 ).
  59. Click “Save”.
  60. Check “MP4” in “Encapsulation Method group box”.
  61. Click OK.
  62. Click OK.
  63. Transmit “ccc” file to VLC program by rtpplay. Type: ./rtpplay –v –f ccc “real Virtual PC IP address”/1234.
  64. Press Enter button in keyboard.
  65. The content of “ccc” file is recorded by VLC. Wait until the process complete.
  66. Press Stop in VLC program.
  67. Now we have video result in place where we save the result “distorted.mp4”. We can use media player to view the video results.

*For the .tcl file, I use combination of coding from EURANE sample code and simulation tutorial from Chia-Yu Yu in publication MyEvalvid_RTP: A New Simulation Tool-set Toward More Realistic Simulation. I hope this tutorial will be useful for you.

For suggestion and correction regarding this tutorial, just drop a polite comment belows.. 😀

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s