frenetic-lang/frenetic — pull request #338 by seliopou (2014-08-28 21:48:08+00:00)
Title: learn_all: learn all unknown src addresses

The learning application as previously written would not always learn all mac addesses on the network, as it was sending packets to the controller with an unknown destination rather than an unknown source. Rather than checking for an unknown destination, the learning application now checks for unknown sources to send to the controller.

This change alone would break broadcast traffic, as the check on unknown destinations was what the application relied on to properly forward broadcast traffic from the controller. An additional check that the destination is a broadcast address fixes this issue while leaving the rest of the code untouched.

With this change the typical flowtable size will increase greatly relative to their sizes before this commit. Regardless of the cause, the troubling behavior is convergence time of a pingall test. I ran some experiments and tested possible solutions related to compiler latency. Below is a table of the results. They were collected by running an controller with learning enabled, and the `policy-queue-size` set to the left column of the table. The topology `tree,2,3` was used for the experiment. Unfortunately, a pingall test has not been successfully run to completion on `topo,3,3`, nor has any significant connectivity been achieved. I ran the following command for each method; the results are summarized in the table below (n=5):

```bash
for i in 1 2 3 4 5; do sudo mn --controller=remote --topo=tree,2,3 --mac --test=pingall; done
```

queue size / method | original | simple | in_thread | in_thread.parallel
----------------|-----|-----|-----|------
0 | avg=6.7188, stddev=0.444847 |avg=29.8226, stddev=5.74127 | avg=31.9486, stddev=7.76569 | avg=32.572, stddev=5.07551
5 | avg=6.1918, stddev=0.185418 | avg=25.1258, stddev=3.73466 | avg=31.2264, stddev=7.91472 | avg=31.8508, stddev=11.9568
20 | avg=6.1498, stddev=0.220599 | avg=32.2768, stddev=5.15219 | avg=47.0266, stddev=11.5019 | avg=36.268, stddev=8.54778

Here's an explanation of the methods:

* **original** is the controller as it exists right now on master (7d6373b96463a80155cf790d887d1a75924d3873);
* **simple** is the simple fix included in this pull request;
* **in_thread** is just like **simple**, but with the `NetKAT_LocalCompiler` running in a separate thread on each invocation; and
* **in_thread.parallel** is just like **in_thread**, but with switch updates running in parallel rather than sequentially.

Unfortunately these experiments do not confirm the hypothesis that `NetKAT_LocalCompiler` is responsible for the change in performance, but instead suggest another, unknown cause.