OpenFlow: Introduction

What is OpenFlow?

If we tried to explain what OpenFlow is, a possible definition would be: OpenFlow is a protocol for controlling and interacting with forwarding behaviors of switches. It allows us to dynamically control  the behavior of the switches in our network. Many SDN (software defined network) and Open Source projects use OpenFlow or support it as a plugin, such as OpenStack Neutron and OpenDaylight.

But It’s hard to grasp what it is, what it solves and how it works only using this brief description. In order to truly understand what is OpenFlow, we need to start from the beginning, before SDN era.

Continue reading “OpenFlow: Introduction”

Open vSwitch: Introduction – Part 1

This post turned out to be much longer than I planned. So I decided to split it into two posts.

This part covers:

  • Overview
  • Installation
  • Simple scenario walkthrough (connecting a virtual machine through ovs bridge to the internet)
  • Basic commands ( add/delete bridge, add/delete ports, show configuration, etc)

The second part covers:

  • Components (ovsdb-server, ovs-vswitch, ovs kernel module)
  • Utilities (ovs-vsctl, ovs-ofctl, ovs-appctl, etc)
  • Modes (normal & flow)

What is Open vSwitch?

Open vSwitch is a multilayer software/virtual switch used to interconnect virtual machines in the same host and between different hosts.

Continue reading “Open vSwitch: Introduction – Part 1”

Linux: Network Namespace

What is a Network Namespace?

Network namespaces allow you to have isolated network environments on a single host.

Each namespace has its own interfaces and routing table, separated from other namespaces. In addition, processes on your system can be associated with a specific network namespace.

Network namespace used in a variety of projects such as OpenStack, Docker and Mininet. To deep dive into these projects, you’ll have to be familiar with namespaces and know how to work with them.

Continue reading “Linux: Network Namespace”

Linux: Ulimit And Maximum Number Of Open Files

Note: this is an old post from my previous blog

 

In this post, I’m going to show you how to raise the limit on the number of open files in your system. I assume in this post that you are using CentOS operating system.

List the limits

Apparently, CentOS has a default of 4096 number of open files limit. For some applications, this is simply not enough and you may want to raise this number.
You can check what is the current limit with the ulimit command Continue reading “Linux: Ulimit And Maximum Number Of Open Files”

Tests: How to convert Subnit stream to junitXML

Subunit is a streaming protocol for test results. It is a binary encoding generated while you are running tests. It is also widely used in the Openstack project.

Subunit comes with a lot of useful filters. Some of them are:

  • subunit2gtk
  • subunit2pyunit
  • tap2subunit

I will focus on subunit2junitxml which converts a Subunit stream into a junitXML representation. I recently had to use it for CI as the Jenkins plugin I’m using doesn’t support publishing tests results using pure subunit stream.

First let’s start with installing the needed packages.

For RHEL/CentOS/Fedora:

yum install -y subunit-filters python-junitxml

Now take your subunit stream ( if you don’t know where it is, look in “Q&A” section ) and run the following command:

cat my_subunit_stream | subunit2junitxml > tests_results.xml

This command will use the subunit filters to convert the stream into junitXML.

In order to verify it worked, read the file and see if it’s in the desired format.

You can also simply run:  grep “<testcase classname=”  tests_results.xml

If it didn’t work, you may need first to convert the stream into the newer protocol version 2.  In such case simply run:

cat my_subunit_stream | subunit-1to2 > my_subunit_stream_v2
cat my_subunit_stream_v2 | subunit2junitxml > tests_results.xml

That’s it. Now you have it in junitXML format and if you are using jenkins, you can also use it to publish your tests results.


Q&A

Q: Where can I find the subunit stream files?

A: It may depend on how you run the tests. If you are using ‘tox’ you could find the files in .testrepository directory. The name of the files would be numbered. Those numbers are actually the tests run order. 1 for example, would be the second time you ran the tests.

Q: In jenkins, How do you publish tests results in Junit format?

A: I’ve installed the Junit plugin and in ‘Post-build Actions’ I’m using ‘Publish Junit test result report’