wikiroute

networking recipes

User Tools

Site Tools


qos_project

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
qos_project [2017/12/14 10:09] – [7. [PO2] Implementing QoS] carineqos_project [2021/08/28 09:58] (current) samer
Line 8: Line 8:
  
 The description of the project and the tasks is available for download on Moodle. The description of the project and the tasks is available for download on Moodle.
-===== -Hardware =====+===== - Hardware =====
  
  
Line 14: Line 14:
 [{{ :glinet.jpg?nolink&150 | Figure 1. GL-iNet 6461 wireless router}}][{{ :tp-link.jpg?nolink&150 | Figure 2. TP-Link WR741nd wireless router}}] [{{ :glinet.jpg?nolink&150 | Figure 1. GL-iNet 6461 wireless router}}][{{ :tp-link.jpg?nolink&150 | Figure 2. TP-Link WR741nd wireless router}}]
  
-===== -Software =====+===== - Software =====
  
 The following tools can help in assessing the QoS on the platform: The following tools can help in assessing the QoS on the platform:
Line 42: Line 42:
  
   * Install VLC as in this [[https://thepi.io/how-to-compile-vlc-media-player-with-hardware-acceleration-for-the-raspberry-pi/|tutorial]].   * Install VLC as in this [[https://thepi.io/how-to-compile-vlc-media-player-with-hardware-acceleration-for-the-raspberry-pi/|tutorial]].
-===== -Addressing =====+===== - Addressing =====
  
 The addressing plan of the platform is shown in Fig. 3. Both routers have static addresses on their wan and lan interfaces. DHCP is activated on the LAN interfaces and static leases are configured so as to obtain the addresses on the terminals according to the figure. The addressing plan of the platform is shown in Fig. 3. Both routers have static addresses on their wan and lan interfaces. DHCP is activated on the LAN interfaces and static leases are configured so as to obtain the addresses on the terminals according to the figure.
Line 48: Line 48:
  
  
-===== -Access and Configuration =====+===== - Access and Configuration =====
  
 SSH is activated on the two Raspberry Pi devices connected to the TP-LINK router. Thus, they can be accesses by typing ''ssh -l pi ip_address'' on any terminal. The default password is ''raspberry'' and the ''pi'' user is a sudoer. For advanced debugging, an HDMI cable is available so you can connect the Pi to a display monitor. SSH is activated on the two Raspberry Pi devices connected to the TP-LINK router. Thus, they can be accesses by typing ''ssh -l pi ip_address'' on any terminal. The default password is ''raspberry'' and the ''pi'' user is a sudoer. For advanced debugging, an HDMI cable is available so you can connect the Pi to a display monitor.
Line 62: Line 62:
 </WRAP> </WRAP>
  
-===== -[CO1] Connecting the Platform =====+===== - [CO1] Connecting the Platform =====
  
 Describe and analyze the basic steps for ensuring the platform connectivity: addressing and routing Describe and analyze the basic steps for ensuring the platform connectivity: addressing and routing
Line 201: Line 201:
 </code> </code>
  
-==== -iperf tool ====+==== - iperf tool ====
  
 Let us start with the application iperf. In the following, we present a short tutorial on the main functions of the perf tool. Let us start with the application iperf. In the following, we present a short tutorial on the main functions of the perf tool.
Line 227: Line 227:
 Here we are sending two flows for one minute (60 seconds). We note that the average rate for the two flows can be different. However, this is not a fairness issue: we only need to extend the transmit time in order to have similar throughput for the two flows. Here we are sending two flows for one minute (60 seconds). We note that the average rate for the two flows can be different. However, this is not a fairness issue: we only need to extend the transmit time in order to have similar throughput for the two flows.
  
-==== -Flent Tool ====+==== - Flent Tool ====
  
 Let us now analyze [[ https://flent.org/index.html | Flent]] application. Flent is a network benchmarking tools which allows to easily run network tests. Let us now analyze [[ https://flent.org/index.html | Flent]] application. Flent is a network benchmarking tools which allows to easily run network tests.
Line 237: Line 237:
      * On the Client side:  ''flent tcp_12up -p totals -l 60 -H 192.168.200.192 -t title3 -o test3.png''      * On the Client side:  ''flent tcp_12up -p totals -l 60 -H 192.168.200.192 -t title3 -o test3.png''
  
-==== -.VLC Tool ====+==== - VLC Tool ====
  
 Let us now analyze the VLC application. VLC media player is a a highly portable multimedia player for various audio, video, streaming protocol.  Let us now analyze the VLC application. VLC media player is a a highly portable multimedia player for various audio, video, streaming protocol. 
Line 243: Line 243:
   * On the Server side: we open VLC media player : Go to media - stream - we add the desired video - Stream - Next - for the new destination we choose UDP legacy then we click on add - we add the destination IP address 192.168.100.111 (client) and the port number 1234 - next - we uncheck the active transcoding - next  stream.   * On the Server side: we open VLC media player : Go to media - stream - we add the desired video - Stream - Next - for the new destination we choose UDP legacy then we click on add - we add the destination IP address 192.168.100.111 (client) and the port number 1234 - next - we uncheck the active transcoding - next  stream.
   * On the client side: we open VLC and then we click on play, go to network and specify the network url: ''udp:\\@:1234'' and finally we click on play.    * On the client side: we open VLC and then we click on play, go to network and specify the network url: ''udp:\\@:1234'' and finally we click on play. 
-===== -[CO3] Shaping the Traffic  =====+===== - [CO3] Shaping the Traffic  =====
    
 We first tried to limit the bandwidth using the following command ''cbq'' but it didn't work since cbq is not installed on the HP-PC: We first tried to limit the bandwidth using the following command ''cbq'' but it didn't work since cbq is not installed on the HP-PC:
Line 267: Line 267:
 We run flent with VLC and we noticed that the video wasn't affected because flent uses TCP. We run flent with VLC and we noticed that the video wasn't affected because flent uses TCP.
  
-===== -[PO2] Implementing QoS  =====+===== - [PO2] Implementing QoS  =====
 The QoS will be implemented on the outgoing interface (Wan) of the router TP-Link. The QoS will be implemented on the outgoing interface (Wan) of the router TP-Link.
 First, we have to check the existing configuration, on the router by typing the following command :  First, we have to check the existing configuration, on the router by typing the following command : 
Line 284: Line 284:
 Supposing we have two types of traffic: Video UDP associated with class 1:40 running on destination port 1234, and iperf UDP with class 1:50 running on destination port 5201. In the first case, the dedicated bandwidth is ((87/100)*8000)= 6960 Kbit and in the second case it's 1040 Kbit. Supposing we have two types of traffic: Video UDP associated with class 1:40 running on destination port 1234, and iperf UDP with class 1:50 running on destination port 5201. In the first case, the dedicated bandwidth is ((87/100)*8000)= 6960 Kbit and in the second case it's 1040 Kbit.
 The following commands are used: The following commands are used:
-<code bash> tc class add dev eth1 parent 1:1 classid 1:40 hfsc ls rate 6960kbit ul rate 6960kbit </code> +<code bash> tc class add dev eth1 parent 1:1 classid 1:40 hfsc ls rate 6960kbit ul rate 8000kbit </code> 
-<code bash> tc class add dev eth1 parent 1:1 classid 1:50 hfsc ls rate 1040kbit ul rate 1040kbit </code> +<code bash> tc class add dev eth1 parent 1:1 classid 1:50 hfsc ls rate 1040kbit ul rate 8000kbit </code> 
-<code bash> iptables -t mangle -A -POSTROUTING -o eth1 -p udp --dport 1234 -j CLASSIFY --set-class 1:40 </code> +<code bash> iptables -t mangle -A POSTROUTING -o eth1 -p udp --dport 1234 -j CLASSIFY --set-class 1:40 </code> 
-<code bash> iptables -t mangle -A -POSTROUTING -o eth1 -p udp --dport 5201 -j CLASSIFY --set-class 1:50 </code>+<code bash> iptables -t mangle -A POSTROUTING -o eth1 -p udp --dport 5201 -j CLASSIFY --set-class 1:50 </code>
      
 +To see the iptables commands excecuted on the router we can use:
  
- +<code bash> iptables -t mangle -L </code> 
 + 
 +===== - [PO3] Analyzing QoS  ===== 
 + In this section, we have to consider different congestion scenarios: The link between the two routers will have a bandwidth of 16 Mb/s, 8 Mb/s and 5 Mb/s.For each case, we will be considering both the implementation and the absence of QoS. 
 + 
 +__**1. 16Mb/s**__ 
 + 
 +- __Without QoS:__ 
 + 
 +We have to create two different classes with exactly the same bandwidth allocated for each as if no QoS is applied. The following commands are used: 
 +<code bash> tc class add dev eth1 parent 1:1 classid 1:10 hfsc ls rate 16000kbit ul rate 16000kbit </code> 
 +<code bash> tc class add dev eth1 parent 1:1 classid 1:20 hfsc ls rate 16000kbit ul rate 16000kbit </code> 
 +<code bash> iptables -t mangle -A POSTROUTING -o eth1 -p udp --dport 1234 -j CLASSIFY --set-class 1:10 </code> 
 +<code bash> iptables -t mangle -A POSTROUTING -o eth1 -p udp --dport 5201 -j CLASSIFY --set-class 1:10 </code> 
 +<code bash> iptables -t mangle -A POSTROUTING -o eth1 -p tcp --dport 5202 -j CLASSIFY --set-class 1:20 </code> 
 + 
 +- __With QoS:__ 
 + 
 +First, we have to create a common class 1:1 for all types of traffic, as before. 
 +Then, the following commands are executed in order to create two classes: 1:20 for video udp traffic with a bandwidth of ((87*16000)/100) and 1:30 for iperf tcp and udp traffic with a bandwidth of ((13*16000)/100). 
 +<code bash> tc class add dev eth1 parent 1:1 classid 1:20 hfsc ls rate 13920kbit ul rate 16000kbit </code> 
 +<code bash> tc class add dev eth1 parent 1:1 classid 1:30 hfsc ls rate 2080kbit ul rate 16000kbit </code> 
 +<code bash> iptables -t mangle -A POSTROUTING -o eth1 -p udp --dport 1234 -j CLASSIFY --set-class 1:20 </code> 
 +<code bash> iptables -t mangle -A POSTROUTING -o eth1 -p udp --dport 5201 -j CLASSIFY --set-class 1:30 </code> 
 +<code bash> iptables -t mangle -A POSTROUTING -o eth1 -p tcp --dport 5202 -j CLASSIFY --set-class 1:30 </code> 
 +We will be running three types of traffic:  
 + 
 +  * VLC video udp 
 +  * iperf udp traffic on destination port 5201 
 +**On the client side:** 
 +<code bash> iperf3 -c 192.168.100.111 -u -b 50M -P 3 -t 80 -p 5201 </code> 
 +  * iperf tcp traffic on destination port 5202, using the following commands: 
 + 
 +**On the server side:** 
 +<code bash> iperf3 -s -p 5202 </code> 
 +**On the client side:** 
 +<code bash> iperf3 -c 192.168.100.111 -P 3 -p 5202 -t 75 </code> 
 +The same commands found above are applied when configuring the link with a bandwidth of 4Mb/s and 8Mb/s.
qos_project.1513242564.txt.gz · Last modified: 2017/12/14 10:09 by carine