Ask Your Question

ODL as simple router between two hosts

asked 2015-09-30 14:42:58 -0700

Paul gravatar image

updated 2015-09-30 17:27:58 -0700

Can ODL function as a router? Setup is - One openFlow switch, two hosts with static IPs/Gateways in two different subnets.

                    [ODL CONTROLLER]

Can ODL act as gateway and facilitate communication between these hosts? Is there a document I can refer to on this?

edit retag flag offensive close merge delete


Hi, Paul. Have you worked out this problem?

kghch ( 2016-08-23 19:34:12 -0700 )edit

Hello, I wondering about this as well, have you worked out?

ikhmer1 ( 2017-02-19 02:33:39 -0700 )edit

6 answers

Sort by ยป oldest newest most voted

answered 2015-10-05 11:14:25 -0700

jamoluhrsen gravatar image


as far as I know, there is currently no app that is delivered with ODL that will do dynamic routing.
The L2-Switch app is there which will remove any l2 loops, learn hosts (via arp) and allow those hosts to communicate. It does this by programming flows in to the switches and listening for arps and lldp (to learn links).

To create a routing app, you can do internally with a java app that you bundle/start from karaf. I am not an expert in that area, but maybe this tutorial would be helpful. It was presented at the ODL Summit in July 2015.

You could also write an external app that could interact via REST API to program the flows and monitor the state of the underlying network. There are also ways to register via websocket for notifications (e.g. notification when a switch connects to the controller). Two videos on youtube here and here I've watched in the past that helped me understand this idea of an external application better.

If you are just doing a proof of concept and want to show that you can forward traffic from one subnet to another subnet, then you can program the flows manually like it's been noted above.

edit flag offensive delete publish link more

answered 2015-10-01 00:03:06 -0700

g_trelos gravatar image

updated 2015-10-01 23:39:42 -0700

ODL as any other controller, takes the control plane away from the forwarding.So, when you have the switches you have the forwarding part.The controller is the control plane.ODL can push flow entries inside the connected switches so that when they receive packets,they match some packets fileds to the fields of the entries.If they match there are instsructions and actions that define what to do next to the packet. So, ODL can "route" packets in the sense of being the "mind" of the topology. You can refer to ODL specification(opendaylight web site) to understand it better. Or you can even look up, the SDN architecture.



ODL controller has flows, that match incoming packets.These flows can be inserted automatically with specific features, or manually through RESTCONF. I will link some pages for more info about the flows and the features. plugin Inventory

edit flag offensive delete publish link more


OK, great! how do I get this to work? h1 and h2 will send ARP requests to their configured gateway which OF switch will send to ODL controller. Now, what do I install in ODL controller to accept such gateway ARP requests and send ARP Replies? I am looking for instructions that outline in implementing this. ODL User guide/Dev guide did not help so far. I found a page here - that kind of details the steps but the CLI commands and document itself looks outdated or it is referring something totally different than what I have which is Helium SR3. Thanks for your help.

Paul ( 2015-10-01 10:32:37 -0700 )edit

this is the right answer from g_trelos. you need to program the flows on the switch to match the traffic as you see fit and forward as you see fit. for routing, match on subnet for h1 and output for port destined for h2, and vice versa. The "EndToEndFlows" link above explains how to create flows

jamoluhrsen ( 2015-10-02 10:04:43 -0700 )edit

I am pasting clickable links here: After going through the links what I understand is I need to configure flows and get them pushed to OF switch that in essence do the routing. I am still not clear who/how ARP replies are sent. All in all while this may be possible to do, I see a lot of manual configuring to get simple routing functionality out of ODL. I am coming from a practical perspective to have ODL do what a router does in this scenario. g_trelos.. I am interested in exploring features that do this automatically you pointed earlier "These flows can be inserted automatically with specific features" Please note I am new totally new to ODL/SDN concepts and I am not a developer. Thanks for helping.

Paul ( 2015-10-02 13:06:17 -0700 )edit

ok, you can search the l2switch feature.Search it and u will see a way that does this automatically.U mentioned ARP requests-replies, l2switch has an app called arphandler, so you can imagine that this is what you are searching for.Dig into it and have fun :)

g_trelos ( 2015-10-04 23:40:59 -0700 )edit

answered 2015-09-30 22:00:58 -0700

Yes, ODL can add flow on OF-Switch by which h1 packet can reach till h2 . You are just suppose to basic networking on h1 h2 side. ie. add default route otherwise H2 will not ping response.

edit flag offensive delete publish link more



answered 2015-09-30 22:19:03 -0700

Mandeep gravatar image

updated 2015-09-30 22:20:41 -0700

As per my understanding:

router = switching + control plane
       = OF-Switch + ODL Controller

So, ODL can decide and add flows into switches to direct packets flow. But not switching functionality.

If you are looking something like,

H1 ------ ODL ------ H2

Then, I feel not possible. I have never seen host connected to ODL directly.

If you have multiple switches (in most cases), then all switches to be connected to ODL, so ODL can only provide control functionality.

edit flag offensive delete publish link more


The setup is as I put in the diagram i.e. there is OF switch and ODL controller. Now that its clear that it is possible, I am interested in how to do it. Please point any reference how-to's or documents you may have.

Paul ( 2015-10-01 10:28:30 -0700 )edit

answered 2016-12-14 01:52:53 -0700

xuwei gravatar image

Did you solve this problem, I also encountered the same needs, how do you solve?

edit flag offensive delete publish link more

answered 2017-01-18 00:55:17 -0700

In mininet, I use hx route add -net default hx-eth0

Where hx is host (h1 route add -net default h1-eth0)

edit flag offensive delete publish link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

[hide preview]

Question Tools

1 follower


Asked: 2015-09-30 14:42:58 -0700

Seen: 1,231 times

Last updated: Jan 18