Mapping OF port numbers to interface names with default OVS image

238 views
Skip to first unread message

Tim Upthegrove

unread,
Nov 21, 2014, 3:27:55 PM11/21/14
to geni-...@googlegroups.com
Hi folks,

I am trying to write some scripts that I can run to configure a setup I want within the Jacks default OVS image (urn:publicid:IDN+emulab.net+image+emulab-ops:Ubuntu12-64-OVS).  It appears that this image includes ovs 1.9.3.

Part of what I want to do is install some static flows that patch two ports in a vswitch together.  The problem I currently have is that I don't know of how to determine which port names map to which OpenFlow port numbers at run time.  I can look this up with ovs-ofctl, but I am hoping to do something more programmatic that doesn't require parsing of the ovs-ofctl output.

I saw that there is a command to request a specific OF number be assigned to an interface:
sudo ovs-vsctl set interface $INTERFACE ofport_request=$OFPORT

But when I run that command, I get the following error:
ovs-vsctl: Interface does not contain a column whose name matches "ofport_request"

I am assuming this just has to do with the ovs version being somewhat old.

Is there a standard way that people do this kind of thing with the default OVS image in GENI today?

Thanks,
--
 
Tim Upthegrove

Tim Upthegrove

unread,
Nov 25, 2014, 10:39:10 AM11/25/14
to geni-...@googlegroups.com
Hi folks,

On Fri, Nov 21, 2014 at 3:27 PM, Tim Upthegrove <tim.upt...@gmail.com> wrote:
Is there a standard way that people do this kind of thing with the default OVS image in GENI today?

Just to follow up on this, what I ended up doing was doing a release upgrade of the existing Ubuntu 12.04 OVS image to Ubuntu 14.04, and I then followed the omni instructions at http://groups.geni.net/geni/wiki/HowTo/ManageCustomImagesInstaGENI and created a custom image from that (urn:publicid:IDN+instageni.nysernet.org+image+ch-geni-net:Ubuntu14OVS2).  I have not extensively tested that image, but it does give me what I need, which is a later OVS version (2.0.2 to be exact).  After the upgrade I was able to request that specific port numbers be associated with specific interfaces.

Thanks,
--
 
Tim Upthegrove

Nicholas Bastin

unread,
Nov 25, 2014, 12:59:37 PM11/25/14
to geni-...@googlegroups.com
FWIW this information necessary to make this mapping on any datapath at runtime is given to the controller in the ofp_phy_port structure (the `name` and `port_no` are both members of that structure) in OpenFlow 1.0, or the `ofp_port` structure in later versions.  OVS also exposes this information via OVSDB and Netconf.

--
Nick 
Reply all
Reply to author
Forward
0 new messages