ns-3 (version 3.30), Python (python 2.7+
or python 3.5+
), C++ compiler (clang++
or g++
), Gnuplot
- Download and build
ns-3
following the official document here. - Copy the files exactly into the folders of the
ns-3
. (Be aware of thewscript
insrc->applications
, otherwise the video streaming application will not be installed!) - Run
./waf
or./waf build
to build the new application. - Run
./waf --run videoStreamer 2> stream.dat
for the testing program and make output data file(you can changeCASE
invideoStreamTest.cc
for different network environments).
- Type the following commands
awk '$1=="0" {print $2 "\t" $3}' stream.dat > buffer.dat
awk '$1=="1" {print $2 "\t" $3}' stream.dat > playtime.dat
awk '$1=="2" {print $2 "\t" $3}' stream.dat > videolevel.dat
gnuplot
set term png
set output "stream.png"
set y2tics
set tics nomirror
set y2range [0:5]
plot "buffer.dat" using 1:2 title "BufferCount" with linespoints, "playtime.dat" using 1:2 title "PlayTime" with linespoints, "videolevel.dat" using 1:2 axes x1y2 title "ResolutionLevel" with linespoints
- Quit gnuplot and check
stream.png
file.
This video streaming program start with high video resolution. It automatically modify the video quality according to the current buffering. If you want to get more detailed information, check the Results
section right down below.
- (1) P2P network with 1 server and 1 client
- (2) Wireless network with 1 server and 1 client
Set a m_videoSpeed
in video-stream-client.cc
, and you are expected to get the graph like this.
- (1) P2P Link
- (2) WiFi Link
The left axis of the graph is video playtime. Since the video is 300 frames and the program takes 5 frames per second, we can see the total playtime is around 60 seconds.
The right axis of the graph is resolution level. There are 6 resolution levels(0 to 5) and always start from level 5.
The buffer count is a buffering counter to reproduce the image, but it may be seen that it does not exceed 1 second or more.
Set a m_videoSpeed
in video-stream-client.cc
, and you are expected to get the graph like this.
- (1) P2P Link
- (2) WiFi Link
Set a m_videoSpeed
in video-stream-client.cc
, and you are expected to get the graph like this.
- (1) P2P Link
- (2) WiFi Link
Set a m_videoSpeed
in video-stream-client.cc
, and you are expected to get the graph like this.
- (1) P2P Link
- (2) WiFi Link
Set a m_videoSpeed
in video-stream-client.cc
, and you are expected to get the graph like this.
- (1) P2P Link
- (2) WiFi Link
Set a m_videoSpeed
in video-stream-client.cc
, and you are expected to get the graph like this.
- (1) P2P Link
- (2) WiFi Link
동영상 길이는 총 300 frame
1초당 5 frame 영상을 송출한다고 가정
사용자가 특정 배속으로 동영상을 요청하면 1초당 frame 수가 배속에 비례하여 증가
1 frame당 해상도(resolution) level
Resolution Level 0 : 100001 bytes for 1 frame
Resolution Level 1 = 150001 bytes for 1 frame
Resolution Level 2 = 200001 bytes for 1 frame
Resolution Level 3 = 230001 bytes for 1 frame
Resolution Level 4 = 250001 bytes for 1 frame
Resolution Level 5 = 300001 bytes for 1 frame
초기에 resolution level 5 로 동영상을 전송
버퍼링이 1초 이상 지속되면 resolution level을 조절해 버퍼링을 1초 이하로 줄임.
버퍼에 충분한 frame이 존재하면 다시 resolution level을 증가.
- 1:1 P2P Link
- 1:1 WiFi Link