TWiki
>
CS450 Web
>
Homework1
>
Homeworks
>
Homework8
(2013-04-18, Main.ckanich)
(raw view)
E
dit
A
ttach
<div class="markdown-body"> <h2> <a name="introduction" class="anchor" href="#introduction"><span class="mini-icon mini-icon-link"></span></a>Introduction</h2> <p>In this exercise we will study the dynamics of TCP in home networks. Take a look at the figure below which shows a “typical” home network with a Home Router connected to an end host. The Home Router is connected via Cable or DSL to a Headend router at the Internet access provider’s office. We are going to study what happens when we download data from a remote server to the End Host in this home network.</p> <p><img src="https://github.com/mininet/mininet/wiki/images/Bufferbloat.png" alt="Bufferbloat"></p> <p>In a real network it’s hard to measure cwnd (because it’s private to the Server) and the buffer occupancy (because it’s private to the router). To make our measurement job easier, we are going to emulate the network in Mininet (See <a class="internal present" href="/mininet/mininet/wiki/Environment-Setup">Environment Setup</a> for setting up the environment).</p> <p>The goals of the exercise are to:</p> <ul> <li>Learn first-hand the dynamics of cwnd and buffer occupancy in a “real” network.</li> <li>Learn why large router buffers can lead to poor performance in home networks. This problem is often called “Buffer Bloat.”</li> <li>Learn how to use Mininet so you can repeat or extend the experiments in your own time.</li> </ul><h2> <a name="part-1-get-mininet-up-and-running" class="anchor" href="#part-1-get-mininet-up-and-running"><span class="mini-icon mini-icon-link"></span></a>Part 1: Get Mininet up and running</h2> <p><img src="https://github.com/mininet/mininet/wiki/images/Bufferbloat_topo.png" alt="Topology for Bufferbloat"></p> <h3> <a name="get-the-bufferbloat-topology" class="anchor" href="#get-the-bufferbloat-topology"><span class="mini-icon mini-icon-link"></span></a>Get the Bufferbloat Topology</h3> <p>The bufferbloat topology is in svn under the hw8 directory. </p> <h3> <a name="run-the-mininet-emulator" class="anchor" href="#run-the-mininet-emulator"><span class="mini-icon mini-icon-link"></span></a>Run the Mininet Emulator</h3> <pre><code>> cd cs144_bufferbloat/ > sudo ./run.sh </code></pre> <h3> <a name="measure-the-delay-between-the-two-hosts" class="anchor" href="#measure-the-delay-between-the-two-hosts"><span class="mini-icon mini-icon-link"></span></a>Measure the Delay Between the Two Hosts</h3> <p>After Mininet is running, you can measure the delay from H1 to H2 with the command: mininet> h1 ping -c 10 h2</p> <h2> <a name="part-2-web-page-download---sketch-the-tcp-cwnd" class="anchor" href="#part-2-web-page-download---sketch-the-tcp-cwnd"><span class="mini-icon mini-icon-link"></span></a>Part 2: Web page download - Sketch the TCP CWND</h2> <h3> <a name="measure-how-long-it-takes-to-download-a-web-page-from-h1" class="anchor" href="#measure-how-long-it-takes-to-download-a-web-page-from-h1"><span class="mini-icon mini-icon-link"></span></a>Measure how long it takes to download a web page from H1</h3> <pre><code>mininet> h2 wget http://10.0.0.1</code></pre> Answer: _________________ seconds <h3> <a name="sketch-how-you-think-cwnd-evolves-over-time-at-h1--mark-multiples-of-rtt-on-the-x-axis" class="anchor" href="#sketch-how-you-think-cwnd-evolves-over-time-at-h1--mark-multiples-of-rtt-on-the-x-axis"><span class="mini-icon mini-icon-link"></span></a>Sketch how you think cwnd evolves over time at H1. Mark multiples of RTT on the x-axis.</h3> <p><img src="https://github.com/mininet/mininet/wiki/images/Bufferbloat_axes.png" alt="TCP AXES"></p> <h2> <a name="part-3-streaming-video---sketch-the-tcp-cwnd-and-buffer-occupancy" class="anchor" href="#part-3-streaming-video---sketch-the-tcp-cwnd-and-buffer-occupancy"><span class="mini-icon mini-icon-link"></span></a>Part 3: “Streaming video” - Sketch the TCP CWND and Buffer Occupancy.</h2> <h3> <a name="create-the-video-flow" class="anchor" href="#create-the-video-flow"><span class="mini-icon mini-icon-link"></span></a>Create the Video Flow</h3> <p>To see how the dynamics of a long flow (which enters the AIMD phase) differs from a short flow (which never leaves slow-start), we are going to repeat Part 2 for a “streaming video flow”. Instead of actually watching videos on your machine, we are going to set up a long-lived high speed TCP connection instead, to emulate a long-lived video flow. You can generate long flows using the <em>iperf</em> command, and we have wrapped it in a script which you can run as follows: </p><pre><code>mininet> h1 ./iperf.sh </code></pre> <p>You can see the throughput of TCP flow from H1 to H2 by running: </p><pre><code>mininet> h2 tail -f ./iperf-recv.txt </code></pre> You can quit viewing throughput by pressing CTRL-C. <h3> <a name="the-tcp-cwnd-of-the-video-flow" class="anchor" href="#the-tcp-cwnd-of-the-video-flow"><span class="mini-icon mini-icon-link"></span></a>The TCP CWND of the Video Flow</h3> <p>Sketch how you think cwnd evolves over time at H1. You might find it useful to use ping to measure how the delay evolves over time, after the iperf has started: </p><pre><code>mininet> h1 ping -c 100 h2</code></pre> <img src="https://github.com/mininet/mininet/wiki/images/Bufferbloat_axes.png" alt="TCP AXES"><h3> <a name="the-impact-on-the-short-flow" class="anchor" href="#the-impact-on-the-short-flow"><span class="mini-icon mini-icon-link"></span></a>The Impact on the Short Flow</h3> <p>To see how our long-lived iperf flow affects our web page download, download the webpage again - while iperf is running. Write down how long it takes. </p><pre><code>mininet> h2 wget http://10.0.0.1</code></pre> Answer: _________________ seconds <h3> <a name="why-does-the-web-page-take-so-much-longer-to-download" class="anchor" href="#why-does-the-web-page-take-so-much-longer-to-download"><span class="mini-icon mini-icon-link"></span></a>Why does the web page take so much longer to download?</h3> <p>Please write your explanation below. Answer: </p> <h2> <a name="part-4-measuring-the-real-cwnd-and-buffer-occupancy-values" class="anchor" href="#part-4-measuring-the-real-cwnd-and-buffer-occupancy-values"><span class="mini-icon mini-icon-link"></span></a>Part 4: Measuring the real cwnd and buffer occupancy values.</h2> <p>It turns out that Mininet lets you measure cwnd and buffer occupancy values. A script is provided to dump the values of cwnd and buffer occupancy into files. We’re going to re-run a couple of the experiments and plot the real values.</p> <h3> <a name="restart-mininet" class="anchor" href="#restart-mininet"><span class="mini-icon mini-icon-link"></span></a>Restart Mininet</h3> <p>Stop and restart Mininet and the monitor script, then re-run the above experiment as follows. </p><pre><code>mininet> exit bash# sudo ./run.sh</code></pre> <h3> <a name="monitor-tcp-cwnd-and-buffer-occupancy-in-mininet" class="anchor" href="#monitor-tcp-cwnd-and-buffer-occupancy-in-mininet"><span class="mini-icon mini-icon-link"></span></a>Monitor TCP CWND and Buffer Occupancy in Mininet</h3> <p>In another bash terminal, go to cs144_bufferbloat directory and type the following giving a name for your experiment. </p><pre><code>bash# ./monitor.sh <EXP_NAME></code></pre> Don’t worry if you see “ERROR: Module tcp_probe does not exist in /proc/modules”, it just means this module is not previously loaded. <pre><code>mininet> h1 ./iperf.sh </code></pre> (wait for 70 seconds …) <pre><code>mininet> h2 wget http://10.0.0.1</code></pre> <p>Wait for the wget to complete, then stop the python monitor script followed by the instructions on the screen. The cwnd values are saved in: </p> <p><em>_tcpprobe.txt</em> and the buffer occupancy in <em>_sw0-qlen.txt</em>.</p> <h3> <a name="plot-cwnd-and-queue-occupancy" class="anchor" href="#plot-cwnd-and-queue-occupancy"><span class="mini-icon mini-icon-link"></span></a>Plot CWND and Queue Occupancy</h3> <p>Plot the TCP cwnd and queue occupancy from the output file </p><pre><code>bash# ./plot_figures.sh <EXP_NAME></code></pre> Adjust command line parameters to generate the figure you want. <p>The script will also host a webserver on the machine and you can use the url the script provided to access to your figures if it is a remote machine w/ public IP. <a href="http://www.stanford.edu/%7Ehuangty/cs144/">Sample figures</a>. If you are unable to see the cwnd, ensure you run wget <em>after</em> you started the monitor.sh script.</p> <p>By now you will have realized that the buffer in the Headend router is so large that when it fills up with iperf packets, it delays the short wget flow. Next we’ll look at two ways to reduce the problem.</p> <h2> <a name="part-5--make-the-router-buffer-smaller-reduce-it-from-100-packets-to-20-packets" class="anchor" href="#part-5--make-the-router-buffer-smaller-reduce-it-from-100-packets-to-20-packets"><span class="mini-icon mini-icon-link"></span></a>Part 5: Make the router buffer smaller. Reduce it from 100 packets to 20 packets.</h2> <h3> <a name="restart-mininet-with-small-buffer" class="anchor" href="#restart-mininet-with-small-buffer"><span class="mini-icon mini-icon-link"></span></a>Restart Mininet with small buffer</h3> <p>Stop any running Mininet and start Mininet again, but this time we will make the buffers 20 packets long instead: </p><pre><code>prompt> sudo ./run-minq.sh </code></pre> Let’s also run the monitor script on the side: <pre><code>prompt> sudo ./monitor.sh <EXP_NAME></code></pre> <h3> <a name="repeat-the-steps-in-parts-2-and-3" class="anchor" href="#repeat-the-steps-in-parts-2-and-3"><span class="mini-icon mini-icon-link"></span></a>Repeat the steps in Parts 2 and 3:</h3> <pre><code>mininet> h2 wget http://10.0.0.1 mininet> h1 ping -c 10 h2 mininet> h1 ./iperf.sh mininet> h1 ping -c 30 h2 mininet> h2 wget http://10.0.0.1</code></pre> <h3> <a name="what-do-you-think-the-cwnd-and-queue-occupancy-will-be-like-in-this-case" class="anchor" href="#what-do-you-think-the-cwnd-and-queue-occupancy-will-be-like-in-this-case"><span class="mini-icon mini-icon-link"></span></a>What do you think the cwnd and queue occupancy will be like in this case?</h3> <p><img src="https://github.com/mininet/mininet/wiki/images/Bufferbloat_axes2.png" alt="AXES"></p> <h3> <a name="plot-cwnd-and-queue-occupancy-1" class="anchor" href="#plot-cwnd-and-queue-occupancy-1"><span class="mini-icon mini-icon-link"></span></a>Plot CWND and Queue Occupancy</h3> <p>Plot the figure for cwnd and queue occupancy, this time using the script “./plot_figures_minq.sh” </p><pre><code>prompt> ./plot_figures_minq.sh</code></pre> <p>Then again, use the url to see your figures.<a href="http://www.stanford.edu/%7Ehuangty/cs144/minq.html">Sample figures</a></p> <h3> <a name="why-does-reducing-the-queue-size-reduce-the-download-time-for-wget" class="anchor" href="#why-does-reducing-the-queue-size-reduce-the-download-time-for-wget"><span class="mini-icon mini-icon-link"></span></a>Why does reducing the queue size reduce the download time for wget?</h3> <p>Please put your explanation below. Answer:</p> <h2> <a name="different-queues" class="anchor" href="#different-queues"><span class="mini-icon mini-icon-link"></span></a>Different queues</h2> <p>The problem seems to be that packets from the short flow are stuck behind a lot of packets from the long flow. What if we maintain a separate queue for each flow and then put <em>iperf</em> and <em>wget</em> traffic into different queues?</p> <p>For this experiment, we put the iperf and wget/ping packets into separate queues in the Headend router. The scheduler implements fair queueing so that when both queues are busy, each flow will receive half of the bottleneck link rate. <img src="https://github.com/mininet/mininet/wiki/images/Bufferbloat_queue.png" alt="Queue"></p> <h3> <a name="restart-mininet-1" class="anchor" href="#restart-mininet-1"><span class="mini-icon mini-icon-link"></span></a>Restart Mininet</h3> <p>Start Mininet again, but this time we will create two queues, one for each type of traffic. </p><pre><code>prompt> sudo ./run-diff.sh</code></pre> <h3> <a name="repeat-the-steps-in-parts-2-and-3-1" class="anchor" href="#repeat-the-steps-in-parts-2-and-3-1"><span class="mini-icon mini-icon-link"></span></a>Repeat the steps in Parts 2 and 3</h3> <pre><code>mininet> h2 wget http://10.0.0.1 mininet> h1 ping -c 10 h2 mininet> h1 ./iperf.sh mininet> h1 ping -c 30 h2 mininet> h2 wget http://10.0.0.1</code></pre> You should see the ping delay (and the wget download time) doesn’t change much before and after we start the iperf. </div>
E
dit
|
A
ttach
|
P
rint version
|
H
istory
: r1
|
B
acklinks
|
V
iew topic
|
Ra
w
edit
|
M
ore topic actions
Topic revision: r1 - 2013-04-18 - 16:33:26 - Main.ckanich
CS450
CS450 Home
Syllabus
Homeworks
-
Using Subversion
Discussion Forum
Lecture Notes
Log In
CS450 Web
Create New Topic
Index
Search
Changes
Notifications
RSS Feed
Statistics
Preferences
ABOUT US
Our Department
Recent News
Contact Us
ACADEMICS
Prospective Students
Undergraduate
CS Minor
Graduate
Courses
RESEARCH
Overview
By Faculty
Labs
PEOPLE
Faculty
Adjuncts
Staff
Students
Alumni
Copyright 2016 The Board of Trustees
of the University of Illinois.
webmaster@cs.uic.edu
WISEST
Helping Women Faculty Advance
Funded by NSF