Compiling Wireshark to Install the OpenFlow Dissector on a MAC

OpenFlow from Package PPA

For those looking to learn or begin some development work with OpenFlow your trusty friend is the OpenFlow Wireshark dissector. Unfortunately it is still not available as a built in plugin packaged with the Wireshark binary yet. So in the meantime it requires compiling wireshark to get the C header files to generate the shared object file to drop into the Wireshark plugin directory. First install MacPorts, then compile Wireshark with MacPorts and lastly compiling the OpenFlow Dissector.

For the impatient, quick install: Wireshark OpenFlow on a MAC


#Install MacPorts
sudo port install wireshark-devel
sudo port install scons
sudo port install mercurial
hg clone https://bitbucket.org/barnstorm/ng-of-dissector
export WIRESHARK=/opt/local/include/wireshark/
cd of-dissector/src
apt-get install scons
alias sudo='sudo env WIRESHARK=/usr/include/wireshark/'
sudo scons install
#This creates a shared object (so) named openflow.so.
#Move openflow.so to the Wireshark plugin directory.
sudo mv ~/.wireshark/plugins/openflow.so /usr/lib/wireshark/libwireshark1/plugins/

Download and Install MacPorts

First download and install MacPorts. My buddy Murphy McCauley has a tutorial using HomeBrew here. I had some dependency issues particularly around GTK+ 2.12 since Wireshark needs >= GTK+ 2.40.


First download MacPorts. I am using MacPorts becuase they have Wireshark in their repository. Download and Install MAC Ports


Compile Wireshark using MACPorts

Once ports is installed, build the following packages.
MacPorts will download and do most of the heavy lifting for you. Compiling from source is fairly painful to get the right combination of deps.
sudo port install wireshark
sudo port install scons
sudo port install mercurial

Download and Install the Wireshark Dissector

Next pull down the of-dissector that Nick Bastin forked from the original Stanford one. CPqD also has some from v1.0-v1.3. Keep in mind that to capture OpenFlow v1.0 you need an OpenFlow v1.0 dissector and so on. The specs are pretty different with regard to error codes, messages and data structures so one size fits all is not a small task.

Using mercurial (hg) pull the dissector. Next you need to export the wireshark directory that contains the C header files that MacPorts installs to /opt/local/include/wireshark/. If the scons build complains, try searching for packet.h in a Wireshark directory.

hg clone https://bitbucket.org/barnstorm/ng-of-dissector
export WIRESHARK=/opt/local/include/wireshark/
alias sudo='sudo env WIRESHARK=/opt/local/include/wireshark/'
cd ng-of-dissector/src/
sudo scons install
#This creates a shared object (so) named openflow.so.
#Move openflow.so to the Wireshark plugin directory.
sudo mv ~/.wireshark/plugins/openflow.so /usr/lib/wireshark/libwireshark1/plugins/

If you have never installed Wireshark the libwireshark1 above will just be libwireshark. Scons will drop a file named openflow.so into your home directory. You just need to move openflow.so to your Wireshark plugin directory.

I had to hack around for a while to get this working so I cant guarantee these are all of the exact steps and there isn’t another dependency needed but Im pretty sure it pretty close.

Running Wireshark With The OpenFlow Dissector


Next run the application w/sudo.
sudo /opt/local/bin/wireshark

Then in the filter box type “of” and hit enter or apply. Fire up your controller and point a network element at it and off you go.

OpenFlow Packet Capture Wireshark

You can then drill down into the OF encapsulated packet, to view the OpenFlow messages.

OpenFlow Wireshark Dissector Mac

Thanks for stopping by. I can try and assist anyone having issues but keep in mind don’t have another Mac that I could replicate any issues on so its may be tricky. Thanks to Murphy and Nick for putting up docs and code for this. Cheers.