Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

Example: Enabling OpenFlow on EX9200 Switches

OpenFlow is an open standard that enables you to control traffic paths in a network by creating, deleting, and modifying flows in each device, including EX9200 switches that have an OpenFlow software package installed, along a path. This example shows how to configure OpenFlow support on an EX9200 switch.

Requirements

This example uses the following hardware and software components:

  • An EX9200 switch running Junos OS Release 13.3 or a later release.

  • An OpenFlow software package is installed on the switch, and the software package release matches the Junos OS release running on the switch.

  • The switch has a TCP connection to an OpenFlow controller, which needs to access the data plane of the switch.

  • The switch is connected to the management network through the me0 interface and is reachable from the OpenFlow controller IP address.

Overview and Topology

In this example, you configure support for OpenFlow on an EX9200 switch. The switch has three interfaces that are dedicated to handling OpenFlow traffic: ge-1/0/0.0, ge-1/1/0.0, and xe-0/0/0.0.

EX9200 switches require a separate routing instance for a virtual switch. This routing instance isolates the experimental OpenFlow traffic from the normal network traffic. In this example, you configure a routing instance for the virtual switch, OF-ri, by using the instance type virtual-switch at the [edit routing-instances] hierarchy level. The routing instance OF-ri includes all of the logical interfaces participating in OpenFlow.

The virtual switch, OFswitch1, connects to the OpenFlow controller over a TCP connection at the IP address 198.51.100.174. The virtual switch configuration must include all of the logical interfaces participating in OpenFlow, and the OpenFlow traffic only either enters or exits these interfaces.

A flow entry consists of a match condition against which packets entering an OpenFlow interface are compared, and the action that is applied to packets that match the condition. Each OpenFlow interface can have one or more flow entries. The default-action statement in the OpenFlow configuration indicates the action the switch applies for packets that do not have a matching flow entry. If you do not explicitly configure the default-action statement, the default action is packet-in, which indicates that packets that have no matching flow entry are sent to the OpenFlow controller for processing. In this example, you explicitly configure packet-in as the default action for packets that do not have a matching flow entry.

In this example, you configure OpenFlow traceoptions also. When traceoptions are configured with the flag all statement, all OpenFlow events are captured and logged. In this example, a specific filename is not configured for the log file. Therefore, OpenFlow events are logged in the default OpenFlow log file at /var/log/ofd.

Configuration

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.

Procedure

Step-by-Step Procedure

To configure support for OpenFlow:

  1. Configure the OpenFlow interfaces as Layer 2 interfaces:

  2. Configure the virtual switch routing instance:

  3. Configure the OpenFlow controller IP address and the connection protocol:

  4. Configure the logical interfaces participating in OpenFlow under this virtual switch instance:

  5. Configure the default action for packets that do not have a matching flow entry:

  6. Configure OpenFlow traceoptions:

  7. Commit the configuration:

Results

From operational mode, display the results of your configuration by entering the show configuration interfaces, show configuration protocols openflow, and show configuration routing-instances commands. If the output does not display the specified configuration, repeat the instructions in this example to correct the configuration.

Verification

Confirm that the configuration is working properly.

Verifying the OpenFlow Controller Connection

Purpose

Verify that the OpenFlow controller connection is up.

Action

Issue the show openflow controller operational mode command to verify that the controller connection state is up. Because the virtual switch configuration has only a single controller, the virtual switch automatically initiates a connection to the controller after you commit the configuration.

Meaning

The output shows that the connection state of the OpenFlow controller is up, in addition to other information about the controller.

Verifying the OpenFlow Interfaces

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.

Meaning

The output shows that the state of each OpenFlow interface is Up, in addition to other information about the interfaces.