qos_project
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
qos_project [2017/11/29 10:57] – [6. [CO2] Implementing the Applications and Tools] enwan | qos_project [2017/12/15 11:40] – [8. [PO3] Analyzing QoS] carine | ||
---|---|---|---|
Line 12: | Line 12: | ||
- | [{{ :tp-link.jpg? | + | [{{ :glinet.jpg? |
- | [{{ : | ||
===== -. 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: | ||
- | Install and compile netperf: | + | * Install and compile netperf: |
<code bash> | <code bash> | ||
wget https:// | wget https:// | ||
Line 29: | Line 28: | ||
</ | </ | ||
- | Install matplotlib and fping | + | * Install matplotlib and fping |
<code bash> | <code bash> | ||
Line 42: | Line 41: | ||
</ | </ | ||
- | Install VLC as in this | + | * Install VLC as in this [[https:// |
- | [[https:// | + | |
===== -. Addressing ===== | ===== -. Addressing ===== | ||
- | the addressing plan of the platform is shown in Fig. 2. 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. |
- | [{{ : | + | [{{ : |
===== -. Access and Configuration ===== | ===== -. Access and Configuration ===== | ||
Line 158: | Line 156: | ||
</ | </ | ||
- | ===== -. [CO2] Implementing the Applications and Tools ===== | ||
- | In order to describe and analyze the basic steps for installing and using the tools and client/ | ||
- | Let's start with the application iperf: | + | The two routers allocate IP addresses using DHCP. In order to facilitate the usage of the platform, fixed allocations are configured for the end hosts. This is configured in ''/ |
- | * To activate iperf3: | ||
- | * Ordered List Item On the server side: <code bash> iperf3 -s </ | ||
- | * On the client side: <code bash> iperf3 -c 192.168.200.192 </ | ||
- | |||
- | * To visualize UDP trafic with a specific bandwidth: | ||
- | * On the client side: <code bash> iperf3 -c 192.168.200.192 -u -b 2M </ | ||
- | Here we set the bandwidth with UDP to 2Mbit/s. | ||
- | Note that by default ,UDP sets the bandwidth to 1Mbit/s | ||
- | |||
- | * To extend the transmission time(second) as well as the number packets sent: | ||
- | * On the Client side: <code bash> iperf3 -c 192.168.200.192 -t 15 </ | ||
- | Note that by default, iperf3 sets the time to 10 seconds | ||
- | |||
- | * To reverse mode(server sends, client receives): | ||
- | * On the Client side: <code bash> iper3 -c 192.168.200.192 -R </ | ||
- | * To send multiple flows: | ||
- | * On the client side: <code bash> iper3 -c 192.168.200.192 -P 2 -t 60 </ | ||
- | Here we are sending 2 flows in 1 min(60 seconds) | ||
- | Note that we need to extend more the tx time in order to have similar throughput for the 2 flows so that we don't consider it as a fairness issue. | ||
- | |||
- | |||
- | ===== Extracts ===== | ||
- | #On TPlink router | ||
<file / | <file / | ||
- | config dnsmasq | ||
- | option domainneeded ' | ||
- | option boguspriv ' | ||
- | option filterwin2k ' | ||
- | option localise_queries ' | ||
- | option rebind_protection ' | ||
- | option rebind_localhost ' | ||
- | option local '/ | ||
- | option domain ' | ||
- | option expandhosts ' | ||
- | option nonegcache ' | ||
- | option authoritative ' | ||
- | option readethers ' | ||
- | option leasefile '/ | ||
- | option resolvfile '/ | ||
- | option localservice ' | ||
- | |||
config dhcp ' | config dhcp ' | ||
option interface ' | option interface ' | ||
Line 211: | Line 167: | ||
option dhcpv6 ' | option dhcpv6 ' | ||
option ra ' | option ra ' | ||
- | |||
- | config dhcp ' | ||
- | option interface ' | ||
- | option ignore ' | ||
- | |||
- | config odhcpd ' | ||
- | option maindhcp ' | ||
- | option leasefile '/ | ||
- | option leasetrigger '/ | ||
config host | config host | ||
Line 230: | Line 177: | ||
option mac ' | option mac ' | ||
option ip ' | option ip ' | ||
- | </ | ||
- | # DHCP configuration on router GL-iNet: | ||
- | <file / | ||
- | config dnsmasq | ||
- | option domainneeded ' | ||
- | option boguspriv ' | ||
- | option localise_queries ' | ||
- | option rebind_protection ' | ||
- | option rebind_localhost ' | ||
- | option local '/ | ||
- | option domain ' | ||
- | option expandhosts ' | ||
- | option authoritative ' | ||
- | option readethers ' | ||
- | option leasefile '/ | ||
- | option resolvfile '/ | ||
- | |||
- | config dhcp ' | ||
- | option interface ' | ||
- | option start ' | ||
- | option limit ' | ||
- | option leasetime ' | ||
- | option dhcpv6 ' | ||
- | option ra ' | ||
- | option ra_management ' | ||
- | |||
- | config dhcp ' | ||
- | option interface ' | ||
- | option ignore ' | ||
- | |||
- | config odhcpd ' | ||
- | option maindhcp ' | ||
- | option leasefile '/ | ||
- | option leasetrigger '/ | ||
- | |||
- | config dhcp | ||
- | option start ' | ||
- | option leasetime ' | ||
- | option limit ' | ||
- | option interface ' | ||
- | |||
- | config domain ' | ||
- | option name ' | ||
- | option ip ' | ||
</ | </ | ||
- | # | + | Finally, we verify the routing and addressing |
<code bash> | <code bash> | ||
Line 290: | Line 193: | ||
collisions: | collisions: | ||
RX bytes: | RX bytes: | ||
- | |||
- | lo Link encap:Local Loopback | ||
- | inet addr: | ||
- | inet6 addr: ::1/128 Scope:Host | ||
- | UP LOOPBACK RUNNING | ||
- | RX packets:221 errors:0 dropped:0 overruns:0 frame:0 | ||
- | TX packets:221 errors:0 dropped:0 overruns:0 carrier:0 | ||
- | collisions: | ||
- | RX bytes:20606 (20.1 KiB) TX bytes:20606 (20.1 KiB) | ||
- | |||
- | |||
</ | </ | ||
- | #ifconfig on raspberry pi3 | ||
- | |||
- | <code bash> | ||
- | pi@raspberrypi: | ||
- | eth0 Link encap: | ||
- | inet addr: | ||
- | inet6 addr: fe80:: | ||
- | inet6 addr: fdd5: | ||
- | inet6 addr: fdd5: | ||
- | UP BROADCAST RUNNING MULTICAST | ||
- | RX packets:745 errors:0 dropped:3 overruns:0 frame:0 | ||
- | TX packets:394 errors:0 dropped:0 overruns:0 carrier:0 | ||
- | collisions: | ||
- | RX bytes:66979 (65.4 KiB) TX bytes:48816 (47.6 KiB) | ||
- | |||
- | lo Link encap:Local Loopback | ||
- | inet addr: | ||
- | inet6 addr: ::1/128 Scope:Host | ||
- | UP LOOPBACK RUNNING | ||
- | RX packets:256 errors:0 dropped:0 overruns:0 frame:0 | ||
- | TX packets:256 errors:0 dropped:0 overruns:0 carrier:0 | ||
- | collisions: | ||
- | RX bytes:20736 (20.2 KiB) TX bytes:20736 (20.2 KiB) | ||
- | </ | ||
- | #ip route on raspberry pi2 | ||
<code bash> | <code bash> | ||
Line 333: | Line 200: | ||
192.168.200.0/ | 192.168.200.0/ | ||
</ | </ | ||
- | #ip route on raspberry pi3 | ||
- | <code bash> | + | ==== -. iperf tool ==== |
- | pi@raspberrypi:~ $ ip route | + | |
- | default | + | Let us start with the application iperf. In the following, we present a short tutorial on the main functions of the perf tool. |
- | 192.168.200.0/24 dev eth0 proto kernel | + | |
- | </ | + | * To launch iperf3: |
+ | * On the server side: '' | ||
+ | * On the client side: '' | ||
+ | |||
+ | * By default, the trafic sent by iperf uses TCP. In order to send UDP trafic with a specific bandwidth: | ||
+ | * On the client side: iperf3 -c 192.168.200.192 -u -b 2M | ||
+ | |||
+ | Here we set the bandwidth with UDP to 2Mbit/s. Note that by default, UDP sets the bandwidth to 1Mbit/s. | ||
+ | |||
+ | * To extend the transmission time(second) as well as the number packets sent: | ||
+ | * On the Client side: '' | ||
+ | |||
+ | Note that by default, iperf3 sets the time to 10 seconds. | ||
+ | |||
+ | * To use reverse mode (server sends the trafic and client receives): | ||
+ | * On the Client side: '' | ||
+ | |||
+ | * To send multiple flows: | ||
+ | * On the Client side: '' | ||
+ | |||
+ | 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 ==== | ||
+ | |||
+ | Let us now analyze [[ https:// | ||
+ | |||
+ | * On the Server side: '' | ||
+ | * To sent one TCP stream from the client to the server: | ||
+ | * On the Client side: '' | ||
+ | * To send 12 TCP streams: | ||
+ | * On the Client side: '' | ||
+ | |||
+ | ==== -.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. | ||
+ | |||
+ | * 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: '' | ||
+ | ===== -. [CO3] Shaping the Traffic | ||
+ | |||
+ | We first tried to limit the bandwidth using the following command '' | ||
+ | <code bash> tc qdisc add dev eth1 root handle 1: cbq avpkt 1000 bandwidth 8mbit </ | ||
+ | |||
+ | On the Wan interface '' | ||
+ | <code bash> tc qdisc add dev eth0 root tbf rate 8000kbit burst 10kb latency 50ms </ | ||
+ | |||
+ | To verify the result of the configuration we used : | ||
+ | <code bash> tc qdisc ls </ | ||
+ | |||
+ | After streaming VLC traffic and iperf UDP traffic with 6mbps to visualize the impact of the used command we noticed that the offered bandwidth is still the same 100 Mbps, therefore the same configuration should be done on the router TP-Link : | ||
+ | <code bash> tc qdisc add dev eth1 root tbf rate 8000kbit burst 10kb latency 50ms </ | ||
+ | |||
+ | Now the link between the two routers has a bandwidth of 8 Mbps for both the incoming and outgoing traffic on them. | ||
+ | In order to visualize the impact on the VLC video streamed from pi3 we generated UDP traffic from pi2 with 6mbps. The VLC video is affected giving that images of the video are pixelized. | ||
+ | |||
+ | If we want to apply this feature in one direction we have to remove the limitation of the bandwidth on one of the routers(in our case we applied it on GL-iNet router): | ||
+ | <code bash> tc qdisc del dev eth0 root </ | ||
+ | |||
+ | Exceeded : | ||
+ | |||
+ | We run flent with VLC and we noticed that the video wasn't affected because flent uses TCP. | ||
+ | |||
+ | ===== -. [PO2] Implementing QoS ===== | ||
+ | The QoS will be implemented on the outgoing interface (Wan) of the router TP-Link. | ||
+ | First, we have to check the existing configuration, | ||
+ | |||
+ | <code bash> tc qdisc ls </ | ||
+ | |||
+ | To delete the previous configurations we can use : | ||
+ | |||
+ | <code bash> tc qdisc del dev eth1 root </ | ||
+ | __** | ||
+ | Traffic classification and scheduling :**__ | ||
+ | The scheduler we will be using is the Hierarchical fair-service curve (HFSC). | ||
+ | We start by creating a common class for all types of traffic. The used commands for this are: | ||
+ | <code bash> tc qdisc add dev eth1 root handle 1: hfsc default 20 </ | ||
+ | <code bash> tc class add dev eth1 parent 1: classid 1:1 hfsc sc rate 8000kbit ul rate 8000kbit </ | ||
+ | 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/ | ||
+ | The following commands are used: | ||
+ | <code bash> tc class add dev eth1 parent 1:1 classid 1:40 hfsc ls rate 6960kbit ul rate 8000kbit </ | ||
+ | <code bash> tc class add dev eth1 parent 1:1 classid 1:50 hfsc ls rate 1040kbit ul rate 8000kbit </ | ||
+ | <code bash> iptables -t mangle -A POSTROUTING -o eth1 -p udp --dport 1234 -j CLASSIFY --set-class 1:40 </ | ||
+ | <code bash> iptables -t mangle -A POSTROUTING -o eth1 -p udp --dport 5201 -j CLASSIFY --set-class 1:50 </ | ||
+ | |||
+ | To see the iptables commands excecuted on the router we can use: | ||
+ | |||
+ | <code bash> iptables -t mangle -L </ | ||
+ | |||
+ | ===== -. [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. | ||
+ | |||
+ | __**1. 16Mb/ | ||
+ | |||
+ | 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)/ | ||
+ | <code bash> tc class add dev eth1 parent 1:1 classid 1:20 hfsc ls rate 13920kbit ul rate 16000kbit </ | ||
+ | <code bash> tc class add dev eth1 parent 1:1 classid 1:30 hfsc ls rate 2080kbit ul rate 16000kbit </ | ||
+ | <code bash> iptables -t mangle -A POSTROUTING -o eth1 -p udp --dport 1234 -j CLASSIFY --set-class 1:20 </ | ||
+ | <code bash> iptables -t mangle -A POSTROUTING -o eth1 -p udp --dport 5201 -j CLASSIFY --set-class 1:30 </ | ||
+ | <code bash> iptables -t mangle -A POSTROUTING -o eth1 -p tcp --dport 5202 -j CLASSIFY --set-class 1:30 </ | ||
+ | We will be running three types of traffic: | ||
+ | * VLC video udp | ||
+ | * iperf udp traffic on destination port 5201 | ||
+ | * iperf tcp traffic on destination port 5202, using the following commands: | ||
+ | **On the server side:** | ||
+ | <code bash> iperf3 -s -p 5202 </ | ||
+ | **On the client side:** | ||
+ | <code bash> iperf3 -c 192.168.100.111 -P 3 -p 5202 -t 75 </ |
qos_project.txt · Last modified: 2021/08/28 09:58 by samer