MuxDemux ODL application

Here, I will cover a simple ODL application that does multiplexing and demultiplexing of packet based on incoming vlan.

Use case for the application:

Test generator ports are always a premium because of the high cost associated with it. In our lab, we connect test generator to a switch and the switch is connected to all DUT. The advantage with this scheme is we can use low speed testgen ports(1G test ports are lot cheaper than 10G, 40G) and there is less need for recabling. There is a need to reprogram the switch based on which DUT we need the testgen port to be connected to and this application is a first step towards automating that process.

I have written this application in both Python and Java.

Test setup:

Create following topology with Mininet.

muxdemux_top

Python script for the custom topology can be found here. Here node1 is used as traffic generator and hosts h1-h4 are DUT. Use “packeth” to generate vlan traffic on the nodeconnector between node1 and node2. To verify that demux works fine, check packet statistics from Mininet or by capturing packet in Wireshark.

Python App:

To demux, use vlan as incoming key and the result is outgoing port. For mux, use vlan and incoming port as incoming key and the result is outgoing port.

Demux:
newFlow = build_flow(nodeid=nodeid1, flowname=fname, outnodeconn=nodeconnector, vlan=vlanid)

Mux:
newFlow = build_flow(nodeid=nodeid1, flowname=fname, innodeconn=nodeconnector, vlan=vlanid,
outnodeconn=in_node_conn)

Complete python application code can be found here.

Results:

When program is executed, user is prompted for the vlan associated with individual hosts. Following flows gets added after the program execution.

{u'node': {u'type': u'OF', u'id': u'00:00:00:00:00:00:00:02'}, u'installInHw': u'true', u'name': u'flow0', u'actions': [u'OUTPUT=4', u''], u'priority': u'500', u'vlanId': u'54'}
{u'node': {u'type': u'OF', u'id': u'00:00:00:00:00:00:00:02'}, u'installInHw': u'true', u'name': u'flowx0', u'vlanId': u'54', u'priority': u'500', u'ingressPort': u'4', u'actions': [u'OUTPUT=1', u'']}
{u'node': {u'type': u'OF', u'id': u'00:00:00:00:00:00:00:02'}, u'installInHw': u'true', u'name': u'flow1', u'actions': [u'OUTPUT=1', u''], u'priority': u'500', u'vlanId': u'51'}
{u'node': {u'type': u'OF', u'id': u'00:00:00:00:00:00:00:02'}, u'installInHw': u'true', u'name': u'flowx1', u'vlanId': u'51', u'priority': u'500', u'ingressPort': u'1', u'actions': [u'OUTPUT=1', u'']}
{u'node': {u'type': u'OF', u'id': u'00:00:00:00:00:00:00:02'}, u'installInHw': u'true', u'name': u'flow2', u'actions': [u'OUTPUT=2', u''], u'priority': u'500', u'vlanId': u'52'}
{u'node': {u'type': u'OF', u'id': u'00:00:00:00:00:00:00:02'}, u'installInHw': u'true', u'name': u'flowx2', u'vlanId': u'52', u'priority': u'500', u'ingressPort': u'2', u'actions': [u'OUTPUT=1', u'']}
{u'node': {u'type': u'OF', u'id': u'00:00:00:00:00:00:00:02'}, u'installInHw': u'true', u'name': u'flow3', u'actions': [u'OUTPUT=3', u''], u'priority': u'500', u'vlanId': u'53'}
{u'node': {u'type': u'OF', u'id': u'00:00:00:00:00:00:00:02'}, u'installInHw': u'true', u'name': u'flowx3', u'vlanId': u'53', u'priority': u'500', u'ingressPort': u'3', u'actions': [u'OUTPUT=1', u'']}

For every host, the first flow above for demux and the second flow is for mux. vlan 51-54 are user entered.

Java application:

I used Simpleforwarding application that is present in Opendaylight as a sample and created another osgi bundle called MuxdemuxApp. I modified “receiveDataPacket” function to implement Demux logic. I have done some hardcoding in the Java application to send vlan 10 packets to host with ip address “10.0.0.1” and vlan 20 packets to host with ip address “10.0.0.2”. By default incoming packets from node1 is sent to host with ip address “10.0.0.1”.

Complete Java code can be found here.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s