ON THIS PAGE
Example: Configuring OpenFlow Hybrid Interfaces on MX Series Routers
On MX series routers that support OpenFlow, you can configure physical interfaces that support multiple logical interfaces as hybrid interfaces. A hybrid interface concurrently supports both OpenFlow logical interfaces and non-OpenFlow logical interfaces, thus allowing OpenFlow and non-OpenFlow traffic to traverse the same interface.
Hybrid interfaces enable you to use your physical interfaces more efficiently, especially in a situation where port density is an issue.
This example shows how to configure an MX Series router with OpenFlow hybrid interfaces.
Requirements
This example uses the following hardware and software components:
MX240 router running Junos OS Release 13.3 or a later release
OpenFlow software package with a software package release that matches the Junos OS release of the device on which it is installed
TCP connection between the router and an OpenFlow controller
Connection between the fxp0 management interface of the router and the management network, which is reachable from the OpenFlow controller IP address
Overview
In this example, you configure an MX240 router with a hybrid interface, ge-1/0/1, an OpenFlow interface, ge-1/0/2, and a non-OpenFlow interface, ge-1/0/3. On the hybrid interface, logical interface ge-1/0/1.0 participates in OpenFlow, and logical interfaces ge-1/0/1.1 and ge-1/0/1.2 do not participate in OpenFlow.
When using OpenFlow hybrid interfaces, you use VLANs to distinguish
the OpenFlow traffic from the normal traffic. Thus, you must enable
VLAN tagging on all interfaces, and traffic entering the interfaces
must be vlan-tagged. Untagged traffic entering the hybrid interface
is dropped. In this example, you configure the hybrid interface using flexible-vlan-tagging
, which enables VLAN tagging and supports
both 802.1Q VLAN single-tag and dual-tag frames for all traffic on
the interface. You configure interfaces ge-1/0/2 and ge-1/0/3 using vlan-tagging
.
You configure the hybrid interface encapsulation as flexible Ethernet services. Note that for interfaces with this encapsulation, all VLAN IDs are valid. VLAN IDs from 1 through 511 are no longer reserved for normal VLANs. In this example, VLANs 1 through 100 are used for OpenFlow traffic, and VLANs 101 through 200 and VLAN 300 are used for normal traffic.
All logical interfaces except ge-1/0/1.2 are configured as Layer
2 trunk interfaces using family bridge
and interface mode trunk
. Logical interfaces ge-1/0/1.0 and ge-1/0/2.0 participate
in OpenFlow and receive and forward traffic with OpenFlow VLAN IDs
1 through 100. Logical interfaces ge-1/0/1.1 and ge-1/0/3.0 do not
participate in OpenFlow and receive and forward traffic with non-OpenFlow
VLAN IDs 101 through 200.
ge-1/0/1.2 is a Layer 3 logical interface with IP address 198.51.100.10/24 that performs Layer 3 routing. This interface does not participate in OpenFlow and routes traffic with VLAN ID 300.
Table 1 summarizes the logical interfaces, traffic type, and associated VLAN IDs.
Logical Interface |
Traffic Type |
VLANs |
---|---|---|
ge-1/0/1.0 |
OpenFlow |
1 through 100 |
ge-1/0/1.1 |
non-OpenFlow |
101 through 200 |
ge-1/0/1.2 |
non-OpenFlow |
300 |
ge-1/0/2.0 |
OpenFlow |
1 through 100 |
ge-1/0/3.0 |
non-OpenFlow |
101 through 200 |
You configure the OpenFlow virtual switch and OpenFlow protocol
statements at the [edit protocols openflow]
hierarchy level.
The virtual switch, OFswitch2, connects to the controller over a TCP
connection at IP address 172.16.1.1. The virtual switch configuration
must include all of the logical interfaces participating in OpenFlow,
which includes ge-1/0/1.0 and ge-1/0/2.0.
When configuring OpenFlow on MX Series routers, you must configure a virtual switch routing instance for the OpenFlow traffic that isolates it from the normal network traffic. Additionally, when using hybrid interfaces, you configure both a virtual switch routing instance for the OpenFlow traffic and also a separate virtual switch routing instance for the normal traffic. In this example, you configure routing instance rt1 for the OpenFlow traffic and routing instance rt2 for the normal traffic.
Routing instance rt1 includes the interfaces participating in OpenFlow, ge-1/0/1.0 and ge-1/0/2.0. Within the routing instance you configure the bridge domain to include all OpenFlow VLANs 1 through 100. Routing instance rt2 includes the Layer 2 interfaces that do not participate in OpenFlow, ge-1/0/1.1 and ge-1/0/3.0. Within the routing instance you configure the bridge domain to include the non-OpenFlow VLANs 101 through 200.
In order to direct OpenFlow traffic, the OpenFlow controller must install flow entries that select the appropriate traffic and forward it to the correct OpenFlow interface.
Configuration
- CLI Quick Configuration
- Configuring the Interfaces
- Configuring OpenFlow
- Configuring the Virtual Switch Routing Instances
- Results
CLI Quick Configuration
To quickly configure this example, copy the following
commands, paste them into a text file, remove any line breaks, change
any details necessary to match your network configuration, copy and
paste the commands into the CLI at the [edit]
hierarchy
level, and then enter commit
from configuration mode.
set interfaces ge-1/0/1 flexible-vlan-tagging set interfaces ge-1/0/1 encapsulation flexible-ethernet-services set interfaces ge-1/0/1 unit 0 family bridge interface-mode trunk set interfaces ge-1/0/1 unit 0 family bridge vlan-id-list 1-100 set interfaces ge-1/0/1 unit 1 family bridge interface-mode trunk set interfaces ge-1/0/1 unit 1 family bridge vlan-id-list 101-200 set interfaces ge-1/0/1 unit 2 vlan-id 300 set interfaces ge-1/0/1 unit 2 family inet address 198.51.100.10/24 set interfaces ge-1/0/2 vlan-tagging set interfaces ge-1/0/2 unit 0 family bridge interface-mode trunk set interfaces ge-1/0/2 unit 0 family bridge vlan-id-list 1-100 set interfaces ge-1/0/3 vlan-tagging set interfaces ge-1/0/3 unit 0 family bridge interface-mode trunk set interfaces ge-1/0/3 unit 0 family bridge vlan-id-list 101-200 set protocols openflow switch OFswitch2 controller address 172.16.1.1 set protocols openflow switch OFswitch2 controller protocol tcp port 6633 set protocols openflow switch OFswitch2 interfaces ge-1/0/1.0 set protocols openflow switch OFswitch2 interfaces ge-1/0/2.0 set routing-instances rt1 instance-type virtual-switch set routing-instances rt1 interface ge-1/0/1.0 set routing-instances rt1 interface ge-1/0/2.0 set routing-instances rt1 bridge-domains bd-of vlan-id-list 1-100 set routing-instances rt2 instance-type virtual-switch set routing-instances rt2 interface ge-1/0/1.1 set routing-instances rt2 interface ge-1/0/3.0 set routing-instances rt2 bridge-domains bd-nonof vlan-id-list 101-200
Configuring the Interfaces
Step-by-Step Procedure
To configure the interfaces:
On the hybrid physical interface, enable VLAN tagging and configure the encapsulation.
[edit interfaces ge-1/0/1] user@host# set flexible-vlan-tagging user@host# set encapsulation flexible-ethernet-services
Configure OpenFlow logical interface ge-1/0/1.0 as a Layer 2 trunk that supports VLANs 1-100.
[edit interfaces ge-1/0/1] user@host# set unit 0 family bridge interface-mode trunk user@host# set unit 0 family bridge vlan-id-list 1-100
Configure non-OpenFlow logical interface ge-1/0/1.1 as a Layer 2 trunk that supports VLANs 101-200.
[edit interfaces ge-1/0/1] user@host# set unit 1 family bridge interface-mode trunk user@host# set unit 1 family bridge vlan-id-list 101-200
Configure non-OpenFlow logical interface ge-1/0/1.2 as a Layer 3 subinterface.
[edit interfaces ge-1/0/1] user@host# set unit 2 vlan-id 300 user@host# set unit 2 family inet address 198.51.100.10/24
On ge-1/0/2, enable VLAN tagging, and configure the logical interface as a Layer 2 trunk that supports VLANs 1-100.
[edit interfaces ge-1/0/2] user@host# set vlan-tagging user@host# set unit 0 family bridge interface-mode trunk user@host# set unit 0 family bridge vlan-id-list 1-100
On ge-1/0/3, enable VLAN tagging, and configure the logical interface as a Layer 2 trunk that supports VLANs 101-200:
[edit interfaces ge-1/0/3] user@host# set vlan-tagging user@host# set unit 0 family bridge interface-mode trunk user@host# set unit 0 family bridge vlan-id-list 101-200
Configuring OpenFlow
Step-by-Step Procedure
To configure OpenFlow:
Configure the OpenFlow controller IP address and the connection protocol.
[edit protocols openflow switch OFswitch2] user@host# set controller address 172.16.1.1 user@host# set controller protocol tcp port 6633
Specify the logical interfaces participating in OpenFlow under this virtual switch instance.
[edit protocols openflow switch OFswitch2] user@host# set interfaces ge-1/0/1.0 user@host# set interfaces ge-1/0/2.0
Configuring the Virtual Switch Routing Instances
Step-by-Step Procedure
To configure the virtual switch routing instances:
Configure the virtual switch routing instance for the OpenFlow traffic.
[edit] user@host# set routing-instances rt1 instance-type virtual-switch user@host# set routing-instances rt1 interface ge-1/0/1.0 user@host# set routing-instances rt1 interface ge-1/0/2.0 user@host# set routing-instances rt1 bridge-domains bd-of vlan-id-list 1-100
Configure the virtual switch routing instance for the non-OpenFlow traffic.
[edit] user@host# set routing-instances rt2 instance-type virtual-switch user@host# set routing-instances rt2 interface ge-1/0/1.1 user@host# set routing-instances rt2 interface ge-1/0/3.0 user@host# set routing-instances rt2 bridge-domains bd-nonof vlan-id-list 101-200
Commit the configuration.
[edit] user@host# commit
Results
From configuration mode, confirm your configuration
by entering the show interfaces
, show protocols openflow
, and show routing-instances
commands. If the output does
not display the intended configuration, repeat the configuration instructions
in this example to correct the configuration.
user@host# show interfaces ge-1/0/1 { flexible-vlan-tagging; encapsulation flexible-ethernet-services; unit 0 { family bridge { interface-mode trunk; vlan-id-list 1-100; } } unit 1 { family bridge { interface-mode trunk; vlan-id-list 101-200; } } unit 2 { vlan-id 300; family inet { address 198.51.100.10/24; } } } ge-1/0/2 { vlan-tagging; unit 0 { family bridge { interface-mode trunk; vlan-id-list 1-100; } } ge-1/0/3 { vlan-tagging; unit 0 { family bridge { interface-mode trunk; vlan-id-list 101-200; } }
user@host# show protocols openflow switch OFswitch2 { interfaces { ge-1/0/1.0; ge-1/0/2.0; } controller { protocol tcp { port 6633; } address 172.16.1.1; } }
user@host# show routing-instances rt1 { instance-type virtual-switch; interface ge-1/0/1.0; interface ge-1/0/2.0; bridge-domains { bd-of { vlan-id-list 1-100; } } } rt2 { instance-type virtual-switch; interface ge-1/0/1.1; interface ge-1/0/3.0; bridge-domains { bd-nonof { vlan-id-list 101-200; } } }
Verification
Confirm that the configuration is working properly.
- Verifying that the OpenFlow Controller Connection is Up
- Verifying that the OpenFlow Interfaces Are Up
Verifying that the OpenFlow Controller Connection is Up
Purpose
Verify that the OpenFlow controller connection is up.
Action
Issue the show openflow controller
operational
mode command, and verify that the controller connection state is up
. Because the virtual switch configuration has
only a single controller, the virtual switch should automatically
initiate a connection to the controller after you commit the configuration.
user@host> show openflow controller Openflowd controller information: Controller socket: 11 Controller IP address: 172.16.1.1 Controller protocol: tcp Controller port: 6633 Controller connection state: up Number of connection attempt: 1 Controller role: equal
Meaning
The output shows that the connection state of the OpenFlow
controller is up
, in addition to other
information about the controller.
Verifying that the OpenFlow Interfaces Are Up
Purpose
Verify that the OpenFlow interfaces are up.
Action
Issue the show openflow interfaces
operational
mode command, and verify that the state of each OpenFlow interface
is Up
.
user@host> show openflow interfaces Switch name: OFswitch2 Interface Name: ge-1/0/1.0 Interface port number: 41500 Interface Hardware Address: 00:00:5e:00:53:a1 Interface speed: 1Gb Full-duplex Interface Auto-Negotiation: Disabled Interface media type: Fiber Interface state: Up Switch name: OFswitch2 Interface Name: ge-1/0/2.0 Interface port number: 41501 Interface Hardware Address: 00:00:5e:00:53:00 Interface speed: 1Gb Full-duplex Interface Auto-Negotiation: Disabled Interface media type: Fiber Interface state: Up
Meaning
The output shows that the state of each OpenFlow interface
is Up
, in addition to other information
about the interfaces.