<?xml version="1.0" encoding="utf-8" ?>

<rss version="2.0" 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   >
<channel>
    
    <title>Raymond P. Burkholder - Things I Do - OpenFlow</title>
    <link>https://blog.raymond.burkholder.net/</link>
    <description>In And Around Technology and The Arts</description>
    <dc:language>en</dc:language>
    <generator>Serendipity 1.7.2 - http://www.s9y.org/</generator>
    <pubDate>Thu, 10 Dec 2020 05:23:53 GMT</pubDate>

    <image>
        <url>https://blog.raymond.burkholder.net/templates/bulletproof/img/s9y_banner_small.png</url>
        <title>RSS: Raymond P. Burkholder - Things I Do - OpenFlow - In And Around Technology and The Arts</title>
        <link>https://blog.raymond.burkholder.net/</link>
        <width>100</width>
        <height>21</height>
    </image>

<item>
    <title>Using Quilt to Patch a Debian Package - hostapd</title>
    <link>https://blog.raymond.burkholder.net/index.php?/archives/762-Using-Quilt-to-Patch-a-Debian-Package-hostapd.html</link>
            <category>OpenFlow</category>
            <category>Open vSwitch</category>
            <category>Wireless</category>
    
    <comments>https://blog.raymond.burkholder.net/index.php?/archives/762-Using-Quilt-to-Patch-a-Debian-Package-hostapd.html#comments</comments>
    <wfw:comment>https://blog.raymond.burkholder.net/wfwcomment.php?cid=762</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>https://blog.raymond.burkholder.net/rss.php?version=2.0&amp;type=comments&amp;cid=762</wfw:commentRss>
    

    <author>nospam@example.com (Raymond P. Burkholder)</author>
    <content:encoded>
    &lt;p&gt;It took a little while to determine the root cause, but, ... 

&lt;p&gt;I am rebuilding an old windows workstation into a Linux based router/firewall/access-point using 
&lt;a href=&quot;https://w1.fi/hostapd/&quot; target=_blank&gt;hostapd&lt;/a&gt; to provide wireless interfaces.  Normally, this is a straight-forward
configuration.  The twist in this case is that I am using 
&lt;a href=&quot;http://openvswitch.org/&quot; target=_blank&gt;Open vSwitch&lt;/a&gt; to handle layer 2 functions.  The box has an existing  
&lt;a href=&quot;https://wikidevi.com/wiki/Atheros_AR5B22&quot; target=_blank&gt;Atheros AR5B22&lt;/a&gt; based PCIe 1  card with two antenna connections on the rear face.  Which translates into a Qualcomm Atheros AR9462 chipset.

&lt;p&gt;I added the wireless interface to OVS on vlan 10 with a command like:

&lt;blockquote&gt;&lt;pre&gt;
ovs-vsctl add-port ovsbr0 wlp4s0 tag=10
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;I used a simple hosted configuration file like:

&lt;blockquote&gt;&lt;pre&gt;
# cat /etc/hostapd/hostapd.conf
interface=wlp4s0
driver=nl80211
ssid=test
auth_algs=1
wpa=1
#wpa_psk_file=/etc/hostapd/hostapd.psk
wpa_passphrase=testtest
wpa_key_mgmt=WPA-PSK
wpa_pairwise=CCMP TKIP
rsn_pairwise=CCMP
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;When running in debug mode:

&lt;blockquote&gt;&lt;pre&gt;
hostapd -d -K -t /etc/hostapd/hostapd.conf
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;I was seeing EAPoL (Extensible Authentication Protocol over LAN) based retries.  It took some research to come across the interaction about &lt;a href=&quot;http://hostap.shmoo.narkive.com/r7vfMqR6/openvswitch-and-hostap&quot; target=_blank&gt;openvswitch and hostapd&lt;/a&gt;.  Bottom line, is that hostapd uses a control channel to control the wireless device.  EAPoL is a packet based function.  AS such, hostapd needs to monitor the packets to pick out the EAPoL packets.  A mechanism is built in for working with regular Linux bridged networking.  That code does not work with Open vSwitch.  Someone created a 
&lt;a href=&quot;https://github.com/hschaa/hostapd/commit/c89daaeca4ee90c8bc158e37acb1b679c823d7ab&quot; target=_blank&gt;patch&lt;/a&gt; to work around the issue.

&lt;p&gt;This patch isn&#039;t found in mainline hostapd, nor as a patch in the Debian repository.  So... I need to apply it manually.  I used the documentation found at &lt;a href=&quot;https://wiki.debian.org/BuildingTutorial&quot; target=_blank&gt;Debian Building Tutorial&lt;/a&gt; as a starting point.  The divergence is that the documentation uses a non-functional, deprecated tool called dpatch.  I used 
&lt;a href=&quot;https://packages.debian.org/quilt&quot; target=_blank&gt;quilt&lt;/a&gt; to handle patching.

&lt;p&gt;As a sidebar, this server I am building uses LXC containers to segregate functionality, compartmentalise security, and to make it easier to keep the main install minimal.  As patching and rebuilding the package requires a bunch of build tools, the tools can be easily installed, and then the whole build environment deleted when complete.

&lt;p&gt;The annotated series of steps.  I have a number of commented-out entries which I plan to play with later, once I understand more the nuances.  One thing, there appears to be a lock out of 5gig frequencies when acting as a host.

&lt;blockquote&gt;&lt;pre&gt;
apt update
apt install build-essential fakeroot devscripts # install tools
apt-get source hostapd  #obtain source

# review the source directory, then
apt-get build-dep wpa  # install the build dependencies
cd wpa-2.4/
debuild -b -uc -us  # build with existing source
dpkg -i ../hostapd_2.4-1_amd64.deb  # install the package as a test
apt install quilt  # install patch manager
quilt top  # inspect the current latest patch
ls -alt debian/patches/  # most patches kept here
ls -alt patches/  # some are here as well

quilt new rpb_hostapd_openvswitch  # create a new patch
# in the following edit, I removed the content, and pasted the source from
# https://github.com/helmut-jacob/hostapd/blob/master/src/drivers/linux_ioctl.c
quilt edit src/drivers/linux_ioctl.c  # source file to change, leave function linux_master_get in place
quilt refresh  # refresh
quilt top  # my new patch is at the top
cat debian/patches/rpb_hostapd_openvswitch |less  # this is my patch
quilt diff  # show the diff colorized
quilt push  # add the patch to the list of patches
dch -n   # update the changelog and version

debuild -b -uc -us  # build with the new patch

# the patch can then be applied and tested (direct from the lxc container):
dpkg -i /var/lib/lxc/apd/rootfs/usr/src/hostapd_2.4-1.1_amd64.deb
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;With the patch, clients can now successfully associate and authenticate with hostapd when the wireless port is connected to an Open vSwitch bridge.

&lt;p&gt;hostapd sample configurations:

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://wiki.gentoo.org/wiki/Hostapd&quot; target=_blank&gt;Hostapd&lt;/a&gt;: from a Gentoo perspective, with an intro to multiple AP and some references to 802.11ac with DFS
  &lt;li&gt;&lt;a href=&quot;https://wireless.wiki.kernel.org/en/developers/Regulatory/CRDA&quot; target=_blank&gt;CRDA Regulatory Code&lt;/a&gt; - getting hostapd to run in the 5g bands
  &lt;li&gt;&lt;a href=&quot;https://communities.intel.com/thread/57515&quot; target=_blank&gt;Edison AP mode in 5GHz&lt;/a&gt; - putting two and two together
  &lt;li&gt;&lt;a href=&quot;http://w1.fi/cgit/hostap/plain/hostapd/hostapd.conf&quot; target=_blank&gt;w1.fi hostapd.conf example&lt;/a&gt;
  &lt;li&gt;&lt;a href=&quot;http://linuxwireless.org/en/users/Documentation/hostapd/&quot; target=_blank&gt;hostapd docs&lt;/a&gt; which include some 802.1x suggestions and for running with segregated plans.  freeradius is also needed when running 802.1x style configurations as the radius protocol is used for communicating the configurations to end devices.
  &lt;li&gt;&lt;a href=&quot;https://android.googlesource.com/platform/external/wpa_supplicant_8/+/brillo-m9-dev/hostapd/wired.conf&quot; target=_blank&gt;simple hostapd/radius config&lt;/a&gt;
  &lt;li&gt;&lt;a href=&quot;https://forum.openwrt.org/viewtopic.php?id=59129&quot; target=_blank&gt;openwrt / openvswitch&lt;/a&gt;: background information on the hostapd / openvswitch issue
  &lt;li&gt;&lt;a href=&quot;https://wiki.helsinki.fi/display/WiFiSDN/Software-Defined+Wi-Fi+Networks+with+Wireless+Isolation&quot; target=_blank&gt;OpenFlow Isolation&lt;/a&gt;: use openflow / openvswitch to isolate wifi networks and users, which is an improvement on the psk per user and 802.1x per user vlan.  with ovs-ofctl examples
  &lt;li&gt;&lt;a href=&quot;https://wiki.archlinux.org/index.php/MAC_address_spoofing&quot; target=_blank&gt;MAC address spoofing&lt;/a&gt;, and since the pre-shared key in a previous step might be MAC based, here is a way to get around the limitation.
  &lt;li&gt;&lt;a href=&quot;https://nims11.wordpress.com/2012/04/27/hostapd-the-linux-way-to-create-virtual-wifi-access-point/&quot; target=_blank&gt;hostapd and dhcp&lt;/a&gt;: simple wifi config
  &lt;li&gt;&lt;a href=&quot;https://www.net.in.tum.de/pub/itg/itg522+524_2016/itg522+524_2016_hauser+schmidt+menth_slides.pdf&quot; target=_blank&gt;SDN&lt;/a&gt;: Establishing a Session Database for SDN Using 802.1X and Multiple Authentication Resources  -- interesting presentation on open flow, 802.1x, sdn, radius, ...
  &lt;li&gt;&lt;a href=&quot;https://wikidevi.com/wiki/Ath9k&quot;target=_blank&gt;Ath9k Chipsets&lt;/a&gt;
  &lt;/ul&gt;

&lt;p&gt;2018/09/16 Other configs (for 5ghz):

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://blog.kylemanna.com/linux/wifi-hostapd/&quot; target=_blank&gt;My Wi-Fi access point revisited &lt;/a&gt;
  &lt;li&gt;&lt;a href=&quot;https://bbs.archlinux.org/viewtopic.php?id=200161&quot; target=_blank&gt;ArchLinux - [AR9390][ath9k][hostapd] No SSID in the air&lt;/a&gt;
  &lt;li&gt;&lt;a href=&quot;https://askubuntu.com/questions/789119/hostapd-much-slower-than-expected&quot; target=_blank&gt;Hostapd much slower than expected&lt;/a&gt;
  &lt;li&gt;
  &lt;/ul&gt;

&lt;p&gt;2020/08/21 From the mailing list:

&lt;blockquote&gt;
For &quot;normal&quot; wifi you can&#039;t simply bridge the wlan interface of the client. 
You can bridge it on the AP.
This is, because in wifi you don&#039;t have a source-MAC and a
destination-MAC, but also a transmitter-MAC and a receiver-MAC.
As an optimisation, in ap2sta direction the destination and the receiver
are a single field.
In sta2ap direction, the source and the transmitter are a single field

&lt;p&gt;Take a look at 4addr mode which solves the issue by having actually all
4 fields.
This is a linux specific implementation and may not be available on all
types of cards.

&lt;p&gt;An alternative would be to have a routed connection between the two
devices and bridge your ovs-instances via GRETAP.

&lt;/blockquote&gt;

&lt;p&gt;2020/12/09 - some additional settings and notes - on Debian hostapd gets installed with out a configuration file.  Once the configuration file is in place, run the following to auto-start hostapd:

&lt;blockquote&gt;
&lt;ul&gt;
  &lt;li&gt;sudo systemctl unmask hostapd
  &lt;li&gt;sudo systemctl enable hostapd
  &lt;li&gt;sudo systemctl start hostapd
  &lt;/ul&gt;
&lt;/blockquote&gt;

&lt;p&gt;The commands are from: &lt;a href=&quot;https://github.com/raspberrypi/documentation/issues/1018&quot; target=_blank&gt;Failed to start hostapd.service: Unit hostapd.service is masked. #1018&lt;/a&gt;

&lt;p&gt;Another note:  many/most/all Intel adapters are designed for client side operations.  Use an  ath5k/ath9k/ath10k adapters for server/host side operations.  The key aspect here is that the channel=0 entry in the configuration file will result in errors and exit of hostapd as it cannot find survey data when mapping the channels.  The channel parameter needs to be set to 1, 7, or 11 (non overlapping channels).  For example:

&lt;blockquote&gt;&lt;pre&gt;
ACS: Unable to collect survey data
ACS: All study options have failed
Interface initialization failed
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;Some interesting points from &lt;a href=&quot;https://vincent.bernat.ch/en/blog/2014-intel-7260-access-point&quot; target=_blank&gt;Intel Wireless 7260 as an access point&lt;/a&gt;:

&lt;ul&gt;
  &lt;li&gt;First, the card is said “dual-band” but you can only uses one band at a time because there is only one radio. Almost all wireless cards have this limitation. If you want to use both the 2.4 GHz band and the less crowded 5 GHz band, two cards are usually needed.
  &lt;/ul&gt; 
    </content:encoded>

    <pubDate>Sat, 27 May 2017 05:46:12 +0000</pubDate>
    <guid isPermaLink="false">https://blog.raymond.burkholder.net/index.php?/archives/762-guid.html</guid>
    
</item>
<item>
    <title>c++ libraries useful for openflow</title>
    <link>https://blog.raymond.burkholder.net/index.php?/archives/757-c++-libraries-useful-for-openflow.html</link>
            <category>OpenFlow</category>
    
    <comments>https://blog.raymond.burkholder.net/index.php?/archives/757-c++-libraries-useful-for-openflow.html#comments</comments>
    <wfw:comment>https://blog.raymond.burkholder.net/wfwcomment.php?cid=757</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>https://blog.raymond.burkholder.net/rss.php?version=2.0&amp;type=comments&amp;cid=757</wfw:commentRss>
    

    <author>nospam@example.com (Raymond P. Burkholder)</author>
    <content:encoded>
    &lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;http://benpfaff.org/ofh/&quot; target=_blank&gt;OpenFlow Header Files&lt;/a&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/bisdn/rofl-common&quot; target=_blank&gt;Revised OpenFlow Library (ROFL)&lt;/a&gt; - this looked like an excellent library, but I have problems trying to make the controller and the ethswitchd examples function with out crashing or not reacting as expected.  And it uses and integrates it&#039;s own packet send/receive functions.
  &lt;li&gt;&lt;a href=&quot;http://libtins.github.io&quot; target=_blank&gt;libtins&lt;/a&gt; - packet crafting and sniffing.  It would be interesting if the crafting portion was removed from the send/receive portion, which make a good open flow packet encoder/decoder.
  &lt;li&gt;&lt;a href=&quot;http://www.boost.org/doc/libs/1_64_0/libs/graph/doc/table_of_contents.html&quot; target=_blank&gt;boost graph&lt;/a&gt; - max flow/min cut algorithms
  &lt;li&gt;&lt;a href=&quot;http://stackoverflow.com/questions/35746487/min-cost-max-flow-with-boostsuccessive-shortest-path-nonnegative-weights?rq=1&quot; target=_blank&gt;min cost max flow with negative weights&lt;/a&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/amedama41&quot; target=_blank&gt;amedama&#039;s github&lt;/a&gt; for open flow, with graph code
  &lt;li&gt;&lt;a href=&quot;http://arccn.github.io/runos/&quot; target=_blank&gt;runos&lt;/a&gt; - another controller, but with lots of other bits added
  &lt;li&gt;&lt;a href=&quot;https://github.com/logcabin/logcabin&quot; target=_blank&gt;logcabin&lt;/a&gt; - Raft protocol library
  &lt;li&gt;&lt;a href=&quot;https://www.opennetworking.org/images/stories/downloads/sdn-resources/onf-specifications/openflow/openflow-switch-v1.4.1.pdf&quot; target=_blank&gt;OpenFlow 1.4.1 spec&lt;/a&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.opennetworking.org/images/stories/downloads/sdn-resources/onf-specifications/openflow/openflow-switch-v1.5.1.pdf&quot; target=_blank&gt;OpenFlow 1.5.1 spec&lt;/a&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/kandoo/beehive-netctrl&quot; target=_blank&gt;beehive&lt;/a&gt; - Distributed SDN controller built on top of beehive.  Open flow packet definitions base upon:
  &lt;li&gt;&lt;a href=&quot;https://github.com/packet/packet&quot; target=_blank&gt;Packet&lt;/a&gt; - &quot;protocol buffer&quot; for network protocol
  &lt;/ul&gt;

&lt;p&gt;Know of any c++ based packet serializers, coders/decoders, to process/build open flow packets?

&lt;p&gt;Raft:

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;http://container-solutions.com/raft-explained-part-1-the-consenus-problem/&quot; target=_blank&gt;consensus explained&lt;/a&gt;
  &lt;li&gt;&lt;a href=&quot;https://raft.github.io&quot; target=_blank&gt;raft consensus algorithm&lt;/a&gt;
  &lt;/ul&gt;

&lt;p&gt;SDN Papers:

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://jisajournal.springeropen.com/articles/10.1186/s13174-016-0043-y&quot; target=_blank&gt;Automatic belief network modeling via policy inference for SDN fault localisation&lt;/a&gt;: Springer Open Access paper on -  Modeling via Policy Inference (called MPI) is a highly scalable, effective and flexible modeling approach to tackle fault localization challenges in a highly dynamic and agile SDN network.
  &lt;/ul&gt;

&lt;p&gt;Other openflow stuff:

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/trema/trema&quot; target=_blank&gt;OpenFlow controller programming framework&lt;/a&gt; that provides everything needed to create OpenFlow controllers in Ruby
  &lt;li&gt;&lt;a href=&quot;https://www.opennetworking.org/images/stories/downloads/sdn-resources/technical-reports/openflow-tr-2011-1-openwifi.pdf&quot; target=_blank&gt;Case Study with OpenWifi&lt;/a&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/CPqD/ofsoftswitch13/wiki/OpenFlow-1.3-for-OpenWRT&quot; target=_blank&gt;OpenFlow 1.3 for OpenWRT&lt;/a&gt;
  &lt;/ul&gt;

&lt;p&gt;Other not relevant C++ oriented stuff encountered:

 &lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;http://rapidjson.org&quot; target=_blank&gt;RapidJSON&lt;/a&gt;
  &lt;li&gt;&lt;a href=&quot;http://wiki.optitrack.com&quot; target=_blank&gt;optitrack&lt;/a&gt; - natural point motion capture streaming library
  &lt;li&gt;&lt;a href=&quot;http://wiki.optitrack.com/index.php?title=NatNet_SDK&quot; target=_blank&gt;NatNet&lt;/a&gt; - the SDK
  &lt;li&gt;&lt;a href=&quot;https://networkit.iti.kit.edu&quot; target=_blank&gt;NetworKit&lt;/a&gt; - social graph analysis
  &lt;li&gt;&lt;a href=&quot;https://mirror.wormhole.eu/cppreference.com/en/cpp/links/libs.html&quot; target=_blank&gt;list of cpp libraries&lt;/a&gt;
  &lt;li&gt;&lt;a href=&quot;http://jerasure.org&quot; target=_blank&gt;Erasure Coding&lt;/a&gt; for storage devices with a 
        &lt;a href=&quot;https://web.eecs.utk.edu/~plank/plank/papers/CS-08-627.pdf&quot; target=_blank&gt;paper&lt;/a&gt;.  More about erasure codes via &lt;a href=&quot;https://news.ycombinator.com/item?id=18702843&quot; target=_blank&gt;Hacker News&lt;/a&gt; to an article called
        &lt;a href=&quot;https://www.akalin.com/intro-erasure-codes&quot; target=_blank&gt;A Gentle Introduction to Erasure Codes&lt;/a&gt;
  &lt;li&gt;&lt;a href=&quot;http://objectcomputing.github.io/mFAST/&quot; target=_blank&gt;mFAST&lt;/a&gt; - A FAST (FIX Adapted for STreaming) encoder/decoder)
  &lt;/ul&gt;

&lt;p&gt;Algebra, Graphs, ...

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;eigen.tuxfamily.or&quot; target=_blank&gt;Eigen&lt;/a&gt; is a C++ template library for linear algebra: matrices, vectors, numerical solvers, and related algorithms
  &lt;/ul&gt;
 
    </content:encoded>

    <pubDate>Thu, 11 May 2017 13:05:21 +0000</pubDate>
    <guid isPermaLink="false">https://blog.raymond.burkholder.net/index.php?/archives/757-guid.html</guid>
    
</item>
<item>
    <title>Network Simulators</title>
    <link>https://blog.raymond.burkholder.net/index.php?/archives/740-Network-Simulators.html</link>
            <category>OpenFlow</category>
    
    <comments>https://blog.raymond.burkholder.net/index.php?/archives/740-Network-Simulators.html#comments</comments>
    <wfw:comment>https://blog.raymond.burkholder.net/wfwcomment.php?cid=740</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>https://blog.raymond.burkholder.net/rss.php?version=2.0&amp;type=comments&amp;cid=740</wfw:commentRss>
    

    <author>nospam@example.com (Raymond P. Burkholder)</author>
    <content:encoded>
    &lt;p&gt;In looking for open source routing and open flow solutions, I came across Brian Linkletter&#039;s site called
&lt;a href=&quot;http://www.brianlinkletter.com&quot; target=_blank&gt;Open-Source Routing and Network Simulation&lt;/a&gt;.  I never realised
 that there were so many network simulators out there.  His site specializes in evaluating many of them.

&lt;p&gt;Two reviews stand out.  The first is 
&lt;a href=&quot;http://www.brianlinkletter.com/dns-and-bind-demonstration-using-the-cloonix-network-emulator/&quot; target=_blank&gt;DNS and BIND demonstration using the Cloonix network emulator&lt;/a&gt; which  provides a mechanism for experimenting with the DNS protocol and the various open-source implementations of DNS including BIND.

&lt;p&gt;The second interesting network emulator is the 
&lt;a href=&quot;http://www.brianlinkletter.com/ofnet-a-new-sdn-network-emulator/&quot; target=_blank&gt;
OFNet SDN network emulator&lt;/a&gt;.  it comes prepackaged as an .ova file.  The article indicates that it comes with the 
Floodlight and Beacon controllers.  I wonder if Ryu could be used?  Anyway, based upon the article,
the emulator has visual tools for watching OpenFlow messages, evaluating topologies, and show traffic patterns.  Further into the article, the author installs OpenDaylight, so it does look like other controllers can be trialled. 
    </content:encoded>

    <pubDate>Mon, 27 Mar 2017 19:27:14 +0000</pubDate>
    <guid isPermaLink="false">https://blog.raymond.burkholder.net/index.php?/archives/740-guid.html</guid>
    
</item>
<item>
    <title>OpenFlow References</title>
    <link>https://blog.raymond.burkholder.net/index.php?/archives/709-OpenFlow-References.html</link>
            <category>OpenFlow</category>
    
    <comments>https://blog.raymond.burkholder.net/index.php?/archives/709-OpenFlow-References.html#comments</comments>
    <wfw:comment>https://blog.raymond.burkholder.net/wfwcomment.php?cid=709</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>https://blog.raymond.burkholder.net/rss.php?version=2.0&amp;type=comments&amp;cid=709</wfw:commentRss>
    

    <author>nospam@example.com (Raymond P. Burkholder)</author>
    <content:encoded>
    &lt;ul&gt;
 &lt;li&gt;&lt;a href=&quot;https://www.opennetworking.org/images/stories/downloads/sdn-resources/technical-reports/TR-523_Intent_Definition_Principles.pdf&quot; target=_blank&gt;Intent Based Networking&lt;/a&gt;: published by ONF as a higher layer abstraction to network configuration
  &lt;li&gt;&lt;a href=&quot;https://www.opennetworking.org/sdn-resources/technical-library&quot; target=_blank&gt;ONF Technical Library&lt;/a&gt;: with technical specifications for the various versions of OpenFlow.  Follow the &#039;SDN Resources&#039; button on the upper right for more resources.
  &lt;li&gt;&lt;a href=&quot;https://github.com/skydive-project/skydive&quot; target=_blank&gt;Skydive&lt;/a&gt;: open source real-time network topology and protocols analyzer. It aims to provide a comprehensive way of understanding what is happening in the network infrastructure. Skydive is SDN-agnostic but provides SDN drivers in order to enhance the topology and flows informations.
  &lt;li&gt;&lt;a href=&quot;https://github.com/REANNZ/faucet&quot; target=_blank&gt;Faucet&lt;/a&gt;: OpenFlow controller for a layer 2 switch based on Waikato University&#039;s Valve. It handles MAC learning and supports VLANs and ACLs. It is developed as an application for the Ryu OpenFlow Controller .  Examples make use of the 
&lt;a href=&quot;https://northboundnetworks.com/products/zodiac-fx&quot; target=_blank&gt;Northbound Networks Zodiac FX OpenFlow Switch&lt;/a&gt; at $AUD 99.  It doesn&#039;t do much, if anything with encapsulations (like MPLS or VXLAN or GENEVE) -- various references indicate &#039;on the to-do list&#039;.  Also, in the main faucet github page, they mentioned that Table-Type-Patterns weren&#039;t used, which I am starting to think are important for larger, more complicated configurations.  
  &lt;li&gt;&lt;a href=&quot;https://inside-openflow.com/&quot; target=_blank&gt;Inside OpenFlow&lt;/a&gt;: is dedicated to providing a broad array of code examples showing how networking task are implemented with OpenFlow technology. 
  &lt;li&gt;&lt;a href=&quot;https://atom.io/&quot; target=_blank&gt;ATOM&lt;/a&gt;: hackable open source text editor, useful for Python coding, has auto-completion
  &lt;li&gt;&lt;a href=&quot;https://www.getpostman.com/&quot; target=_blank&gt;Postman&lt;/a&gt;: Create and send any HTTP request using the awesome Postman request builder. Write your own test cases to validate response data, response times, and more!  Good for testing and working with REST interfaces.
  &lt;li&gt;&lt;a href=&quot;https://www.opennetworking.org/images/stories/downloads/sdn-resources/technical-reports/TR_Multiple_Flow_Tables_and_TTPs.pdf&quot; target=_blank&gt;The Benefits of Multiple Flow Tables and TTPs&lt;/a&gt; where VRFs and VLAN defined by OpenFlow multiple tables are described.
  &lt;li&gt;&lt;a href=&quot;https://www.alliedtelesis.com/products/x930-series&quot; target=_blank&gt;Allied Telesis x510 and x930 series&lt;/a&gt; openflow capable switches.
  &lt;li&gt;&lt;a href=&quot;http://noviflow.com/products/noviswitch&quot; target=_blank&gt;NoviFlow switches&lt;/a&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.netronome.com/products/agilio-cx/&quot; target=_blank&gt;Netronome PCIe cards with off-load&lt;/a&gt;: Agilio CX cards
  &lt;li&gt;&lt;a href=&quot;http://www.colfaxdirect.com&quot; target=_blank&gt;Colfax Direct&lt;/a&gt;: HPC and Data Center Gear
  &lt;li&gt;&lt;a href=&quot;http://open-nfp.org/&quot; target=_blank&gt;OpenNFP&lt;/a&gt;: collaborative research in the area of network function processing in server networking hardware
  &lt;/ul&gt;

&lt;p&gt;A very detailed and useful paper:  &lt;a href=&quot;https://arxiv.org/pdf/1406.0440&quot; target=_blank&gt;Sofware-Defined Networking: A Comprehensive Survey&lt;/a&gt; 
    </content:encoded>

    <pubDate>Mon, 14 Nov 2016 02:29:15 +0000</pubDate>
    <guid isPermaLink="false">https://blog.raymond.burkholder.net/index.php?/archives/709-guid.html</guid>
    
</item>
<item>
    <title>OpenFlow Thinkings</title>
    <link>https://blog.raymond.burkholder.net/index.php?/archives/705-OpenFlow-Thinkings.html</link>
            <category>OpenFlow</category>
    
    <comments>https://blog.raymond.burkholder.net/index.php?/archives/705-OpenFlow-Thinkings.html#comments</comments>
    <wfw:comment>https://blog.raymond.burkholder.net/wfwcomment.php?cid=705</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>https://blog.raymond.burkholder.net/rss.php?version=2.0&amp;type=comments&amp;cid=705</wfw:commentRss>
    

    <author>nospam@example.com (Raymond P. Burkholder)</author>
    <content:encoded>
    &lt;p&gt;t has taken a while, but I think I understand how some flavours of SDN
work.

&lt;p&gt;In CiscoLand, at the hardware level, CEF is a flow based forwarding
mechanism.  All the higher layer routing protocols like bgp, ospf, rip,
etc, are used to build that flow table.  I think Cisco&#039;s ACI is designed
to manipulate those flow tables directly through some set of off-box oob
controllers.  These flows are monitored through Netflow, sFlow, OpenFlow telemetry commands, and the like.  So
flows are integral to how networks work.  How they are controlled is the
question.

&lt;p&gt;I used to be of the mentality that this central control created points of
failure in the network.  But if boxes can maintain state during a
controller failure  or outage, then it isn&#039;t so bad.  In addition, many
initial talking points mention that flow tables needed to be dynamically
populated, which requires punting packets to the controller, which really
slows things down. 

&lt;p&gt;But many networks have a reasonably static topology.  This enables flow
bundles to be pre-populated and thus hardware forwarding can be used for
the majority of the traffic, if the flow rules are general enough.  From a
high level perspective, then the issues arise when network failures occur.
How does the network heal itself around those failures points? Some
answers I am still looking into.

&lt;p&gt;In the open source world, Linux, in the kernel forwarding plane, also
maintains a flow table.  sFlow can be used to monitor flows.  There are
netflow add-ons to monitor those flows.  Static routes and things like
Quagga are used to define the rules for how flows are setup.

&lt;p&gt;So, enters the concept of OpenFlow, which is a set of rules used to manage
those flow tables directly.  Either locally, or through some off-box
controller.  (I have been looking into Ryu at the moment).

&lt;p&gt;When using layer 3 network protocols like bgp, et.al., the flow rules are
typically defined based upon destination ip address.

&lt;p&gt;With OpenFlow, flows can be specified on a number of different
combinations of addresses, ports, mac addresses, encapsulations, ...  

&lt;p&gt;Now take that concept, and make the realization that you can create a
distributed firewall, because the network itself can provide firewall and
associated security features.  Rather than creating flow rules based upon
destination address, ... with the added granularity, flow rules can be
specified that only specific types of traffic (eg port 80, or esp, or ...)
go through various parts of the network, and traffic not matching those
flow rules go somewhere else, say like a honey-pot or something.  

&lt;p&gt;And with various forms of encapsulation from edge to edge, various forms
of vrf/vpn/segmentation are inherently supplied.

&lt;p&gt;So, it is conceivable that the
central points of congestion like big central firewalls can be eliminated, and the
security and privacy can be distributed throughout the network.   Kind of
like MPLS/VPLS on steroids.

&lt;p&gt;From the open source perspective, I have just started going through the
examples for OpenVSwitch (OVS) and its companion product Open Virtual
Networking OVN at  
&lt;a href=&quot;http://blog.spinhirne.com/p/blog-series.html&quot; target=_blank&gt;Spinhirne&#039;s Blog&lt;/a&gt;
.  The
examples show some single points of failures, but I think I know how to
make those better.  It is looking promising based upon what I&#039;ve seen so
far, but have more under-the-hood looking to do.

 
    </content:encoded>

    <pubDate>Sun, 13 Nov 2016 20:20:33 +0000</pubDate>
    <guid isPermaLink="false">https://blog.raymond.burkholder.net/index.php?/archives/705-guid.html</guid>
    
</item>
<item>
    <title>OpenFlow on Debian Stretch with OpenVSwitch, RYU, and Mininet</title>
    <link>https://blog.raymond.burkholder.net/index.php?/archives/697-OpenFlow-on-Debian-Stretch-with-OpenVSwitch,-RYU,-and-Mininet.html</link>
            <category>OpenFlow</category>
    
    <comments>https://blog.raymond.burkholder.net/index.php?/archives/697-OpenFlow-on-Debian-Stretch-with-OpenVSwitch,-RYU,-and-Mininet.html#comments</comments>
    <wfw:comment>https://blog.raymond.burkholder.net/wfwcomment.php?cid=697</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>https://blog.raymond.burkholder.net/rss.php?version=2.0&amp;type=comments&amp;cid=697</wfw:commentRss>
    

    <author>nospam@example.com (Raymond P. Burkholder)</author>
    <content:encoded>
    &lt;p&gt;The most succinct demonstration of OpenFlow on OpenVSwitch is the 
&lt;a href=&quot;http://sdnhub.org/tutorials/openflow-1-3/&quot; target=_blank&gt;Openflow version 1.3 tutorial on SDN Hub&lt;/a&gt;.

&lt;p&gt;They make use of a pre-packaged VM for their demo.  Which is easy enough to do with basic packages:

&lt;blockquote&gt;&lt;pre&gt;
$ apt-get update
$ apt-get install openvswitch-switch python-openvswitch  ryu-bin python-ryu mininet tshark
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;The openvswitch installation will install and start up the openvswitch service.  OpenVSwitch does regular switching and can also act as an OpenFlow agent.  For the purposes of the demonstration, 
openvswitch should be set for OpenFlow version 1.3.  

&lt;blockquote&gt;&lt;pre&gt;
$ ovs-vsctl set bridge s1 protocols=OpenFlow13
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;An OpenFlow agent needs to be controlled by an OpenFlow controller.  A large number of them are available.  OpenSource.
ClosedSource.  or in between.

&lt;p&gt;I use SaltStack for provisioning, automation and orchestration.  It is a Python based tool.  To stay with the theme of Python,
I have selected RYU as a controller, which is developed in Python.  The RYU install comes with a number of example scripts.
A simple switch controller can be started with:

&lt;blockquote&gt;&lt;pre&gt;
$ ryu-manager --verbose  /usr/lib/python2.7/dist-packages/ryu/app/simple_switch_13.py
&lt;/pre&gt;&lt;/blockquote&gt;  

&lt;p&gt;It listens on port 6653 and 6633:

&lt;blockquote&gt;&lt;pre&gt;
t# netstat -ln
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 0.0.0.0:6653            0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:6633            0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN
tcp6       0      0 :::22                   :::*                    LISTEN
udp        0      0 0.0.0.0:68              0.0.0.0:*
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;Mininet is a nice little utility which makes use of Linux&#039; namespace and cgroups to setup emulated hosts and uses openvswitch to handle switching.  This example makes use of a simple switch with three hosts.  When starting up, it initializes the topology, and then provides a prompt for running commands.

&lt;blockquote&gt;&lt;pre&gt;
$ mn --topo single,3 --mac --controller remote --switch ovsk,protocols=OpenFlow13
*** Creating network
*** Adding controller
*** Adding hosts:
h1 h2 h3
*** Adding switches:
s1
*** Adding links:
(h1, s1) (h2, s1) (h3, s1)
*** Configuring hosts
h1 h2 h3
*** Starting controller
c0
*** Starting 1 switches
s1 ...
*** Starting CLI:
mininet&gt; h1 ping h2
PING 10.0.0.2 (10.0.0.2) 56(84) bytes of data.
64 bytes from 10.0.0.2: icmp_seq=1 ttl=64 time=19.2 ms
64 bytes from 10.0.0.2: icmp_seq=2 ttl=64 time=0.312 ms
64 bytes from 10.0.0.2: icmp_seq=3 ttl=64 time=0.082 ms
^C
--- 10.0.0.2 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2028ms
rtt min/avg/max/mdev = 0.082/6.534/19.209/8.963 ms
mininet&gt;
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;Additional ports for communicating:

&lt;blockquote&gt;&lt;pre&gt;
$ netstat -ln
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 0.0.0.0:6653            0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:6633            0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:6634            0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN
tcp6       0      0 :::22                   :::*                    LISTEN
udp        0      0 0.0.0.0:68              0.0.0.0:*
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;Dumping flows of the resulting actions:

&lt;blockquote&gt;&lt;pre&gt;
# ovs-ofctl dump-flows s1 -O OpenFlow13
OFPST_FLOW reply (OF1.3) (xid=0x2):
 cookie=0x0, duration=185.861s, table=0, n_packets=24, n_bytes=1856, priority=0 actions=CONTROLLER:65535
 cookie=0x0, duration=180.186s, table=0, n_packets=5, n_bytes=378, priority=1,in_port=2,dl_dst=00:00:00:00:00:01 actions=output:1
 cookie=0x0, duration=180.181s, table=0, n_packets=4, n_bytes=336, priority=1,in_port=1,dl_dst=00:00:00:00:00:02 actions=output:2
&lt;/pre&gt;&lt;/blockquote&gt;

 &lt;br /&gt;&lt;a href=&quot;https://blog.raymond.burkholder.net/index.php?/archives/697-OpenFlow-on-Debian-Stretch-with-OpenVSwitch,-RYU,-and-Mininet.html#extended&quot;&gt;Continue reading &quot;OpenFlow on Debian Stretch with OpenVSwitch, RYU, and Mininet&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Mon, 31 Oct 2016 00:54:03 +0000</pubDate>
    <guid isPermaLink="false">https://blog.raymond.burkholder.net/index.php?/archives/697-guid.html</guid>
    
</item>

</channel>
</rss>
