Table-miss Flow Entry

  четверг 09 апреля
      58

OpenFlow: Flow entry/rule 40 Reactive.First packet of flow triggers controller to insert flow entries.Efficient use of flow table.Every flow incurs small additional flow setup time.If control connection lost, switch has limited utility Proactive.Controller pre-populates flow table in switch.Zero additional flow. The table-miss flow entry specifies how to process packets unmatched by other flow entries in the flow table (see 5.1), and may, for example, send packets to the.

Q: What versions of OpenFlow does Open vSwitch support?

A: The following table lists the versions of OpenFlow supported by eachversion of Open vSwitch:

Open vSwitchOF1.0OF1.1OF1.2OF1.3OF1.4OF1.5
1.9 and earlieryes
1.10, 1.11yes(*)(*)
2.0, 2.1yes(*)(*)(*)
2.2yes(*)(*)(*)(%)(*)
2.3, 2.4yesyesyesyes(*)(*)
2.5, 2.6, 2.7yesyesyesyes(*)(*)
2.8, 2.9, 2.10, 2.11yesyesyesyesyes(*)
2.12yesyesyesyesyesyes

—Not supported.yes Supported and enabled by default(*) Supported, but missing features, and must be enabled by user.(%) Experimental, unsafe implementation.

In any case, the user may override the default:

  • To enable OpenFlow 1.0, 1.1, 1.2, and 1.3 on bridge br0:

  • To enable OpenFlow 1.0, 1.1, 1.2, 1.3, 1.4, and 1.5 on bridge br0:

  • To enable only OpenFlow 1.0 on bridge br0:

All current versions of ovs-ofctl enable only OpenFlow 1.0 by default. Usethe -O option to enable support for later versions of OpenFlow inovs-ofctl. For example:

(Open vSwitch 2.2 had an experimental implementation of OpenFlow 1.4 thatcould cause crashes. We don’t recommend enabling it.)

OpenFlow Support in Open vSwitch tracks support for OpenFlow 1.1 and later features.

Q: Does Open vSwitch support MPLS?

A: Before version 1.11, Open vSwitch did not support MPLS. That is, theseversions can match on MPLS Ethernet types, but they cannot match, push, orpop MPLS labels, nor can they look past MPLS labels into the encapsulatedpacket.

Open vSwitch versions 1.11, 2.0, and 2.1 have very minimal support forMPLS. With the userspace datapath only, these versions can match, push, orpop a single MPLS label, but they still cannot look past MPLS labels (evenafter popping them) into the encapsulated packet. Kernel datapath supportis unchanged from earlier versions.

Open vSwitch version 2.3 can match, push, or pop a single MPLS label andlook past the MPLS label into the encapsulated packet. Both userspace andkernel datapaths will be supported, but MPLS processing always happens inuserspace either way, so kernel datapath performance will be disappointing.

Open vSwitch version 2.4 can match, push, or pop up to 3 MPLS labels andlook past the MPLS label into the encapsulated packet. It will have kernelsupport for MPLS, yielding improved performance.

Q: I’m getting “error type 45250 code 0”. What’s that?

A: This is a Open vSwitch extension to OpenFlow error codes. Open vSwitchuses this extension when it must report an error to an OpenFlow controllerbut no standard OpenFlow error code is suitable.

Komoda font for mac

Open vSwitch logs the errors that it sends to controllers, so the easiestthing to do is probably to look at the ovs-vswitchd log to find out whatthe error was.

If you want to dissect the extended error message yourself, the format isdocumented in include/openflow/nicira-ext.h in the Open vSwitch sourcedistribution. The extended error codes are documented ininclude/openvswitch/ofp-errors.h.

Q: Some of the traffic that I’d expect my OpenFlow controller to see doesn’tactually appear through the OpenFlow connection, even though I know that it’sgoing through.

A: By default, Open vSwitch assumes that OpenFlow controllers are connected“in-band”, that is, that the controllers are actually part of the networkthat is being controlled. In in-band mode, Open vSwitch sets up special“hidden” flows to make sure that traffic can make it back and forth betweenOVS and the controllers. These hidden flows are higher priority than anyflows that can be set up through OpenFlow, and they are not visible throughnormal OpenFlow flow table dumps.

Usually, the hidden flows are desirable and helpful, but occasionally theycan cause unexpected behavior. You can view the full OpenFlow flow table,including hidden flows, on bridge br0 with the command:

to help you debug. The hidden flows are those with prioritiesgreater than 65535 (the maximum priority that can be set withOpenFlow).

The Documentation/topics/design doc describes the in-band model indetail.

If your controllers are not actually in-band (e.g. they are onlocalhost via 127.0.0.1, or on a separate network), then you shouldconfigure your controllers in “out-of-band” mode. If you have onecontroller on bridge br0, then you can configure out-of-band modeon it with:

Q: Some of the OpenFlow flows that my controller sets up don’t seem to apply tocertain traffic, especially traffic between OVS and the controller itself.

A: See above.

Q: I configured all my controllers for out-of-band control mode but “ovs-appctlbridge/dump-flows” still shows some hidden flows.

A: You probably have a remote manager configured (e.g. with “ovs-vsctlset-manager”). By default, Open vSwitch assumes that managers need in-bandrules set up on every bridge. You can disable these rules on bridge br0with:

This actually disables in-band control entirely for the bridge, as if allthe bridge’s controllers were configured for out-of-band control.

Q: My OpenFlow controller doesn’t see the VLANs that I expect.

A: See answer under “VLANs”, above.

Q: I ran ovs-ofctladd-flowbr0nw_dst=192.168.0.1,actions=drop but I got afunny message like this:

and when I ran ovs-ofctldump-flowsbr0 I saw that my nw_dst match haddisappeared, so that the flow ends up matching every packet.

A: The term “normalization” in the log message means that a flow cannotmatch on an L3 field without saying what L3 protocol is in use. The“ovs-ofctl” command above didn’t specify an L3 protocol, so the L3 fieldmatch was dropped.

In this case, the L3 protocol could be IP or ARP. A correct command foreach possibility is, respectively:

and:

Similarly, a flow cannot match on an L4 field without saying what L4protocol is in use. For example, the flow match tp_src=1234 is, byitself, meaningless and will be ignored. Instead, to match TCP source port1234, write tcp,tp_src=1234, or to match UDP source port 1234, writeudp,tp_src=1234.

Q: How can I figure out the OpenFlow port number for a given port?

A: The OFPT_FEATURES_REQUEST message requests an OpenFlow switch torespond with an OFPT_FEATURES_REPLY that, among other information,includes a mapping between OpenFlow port names and numbers. From a commandprompt, ovs-ofctlshowbr0 makes such a request and prints the responsefor switch br0.

The Interface table in the Open vSwitch database also maps OpenFlow portnames to numbers. To print the OpenFlow port number associated withinterface eth0, run:

You can print the entire mapping with:

but the output mixes together interfaces from all bridges in the database,so it may be confusing if more than one bridge exists.

In the Open vSwitch database, ofport value -1 means that the interfacecould not be created due to an error. (The Open vSwitch log shouldindicate the reason.) ofport value [] (the empty set) means that theinterface hasn’t been created yet. The latter is normally an intermittentcondition (unless ovs-vswitchd is not running).

Q: I added some flows with my controller or with ovs-ofctl, but when I run“ovs-dpctl dump-flows” I don’t see them.

A: ovs-dpctl queries a kernel datapath, not an OpenFlow switch. It won’tdisplay the information that you want. You want to use ovs-ofctldump-flows instead.

Q: It looks like each of the interfaces in my bonded port shows up as anindividual OpenFlow port. Is that right?

A: Yes, Open vSwitch makes individual bond interfaces visible as OpenFlowports, rather than the bond as a whole. The interfaces are treatedtogether as a bond for only a few purposes:

  • Sending a packet to the OFPP_NORMAL port. (When an OpenFlow controlleris not configured, this happens implicitly to every packet.)
  • Mirrors configured for output to a bonded port.

It would make a lot of sense for Open vSwitch to present a bond as a singleOpenFlow port. If you want to contribute an implementation of such afeature, please bring it up on the Open vSwitch development mailing list atdev@openvswitch.org.

Q: I have a sophisticated network setup involving Open vSwitch, VMs or multiplehosts, and other components. The behavior isn’t what I expect. Help!

A: To debug network behavior problems, trace the path of a packet,hop-by-hop, from its origin in one host to a remote host. If that’scorrect, then trace the path of the response packet back to the origin.

The open source tool called plotnetcfg can help to understand therelationship between the networking devices on a single host.

Usually a simple ICMP echo request and reply (ping) packet is goodenough. Start by initiating an ongoing ping from the origin host to aremote host. If you are tracking down a connectivity problem, the “ping”will not display any successful output, but packets are still being sent.(In this case the packets being sent are likely ARP rather than ICMP.)

Tools available for tracing include the following:

  • tcpdump and wireshark for observing hops across network devices,such as Open vSwitch internal devices and physical wires.

  • ovs-appctldpif/dump-flows<br> in Open vSwitch 1.10 and later orovs-dpctldump-flows<br> in earlier versions. These tools allow oneto observe the actions being taken on packets in ongoing flows.

    See ovs-vswitchd(8) for ovs-appctldpif/dump-flows documentation,ovs-dpctl(8) for ovs-dpctldump-flows documentation, and “Why arethere so many different ways to dump flows?” above for some background.

  • ovs-appctlofproto/trace to observe the logic behind how ovs-vswitchdtreats packets. See ovs-vswitchd(8) for documentation. You can out moredetails about a given flow that ovs-dpctldump-flows displays, bycutting and pasting a flow from the output into an ovs-appctlofproto/trace command.

  • SPAN, RSPAN, and ERSPAN features of physical switches, to observe whatgoes on at these physical hops.

Starting at the origin of a given packet, observe the packet at each hop inturn. For example, in one plausible scenario, you might:

  1. tcpdump the eth interface through which an ARP egresses a VM,from inside the VM.
  2. tcpdump the vif or tap interface through which the ARPingresses the host machine.
  3. Use ovs-dpctldump-flows to spot the ARP flow and observe the hostinterface through which the ARP egresses the physical machine. You mayneed to use ovs-dpctlshow to interpret the port numbers. If theoutput seems surprising, you can use ovs-appctlofproto/trace toobserve details of how ovs-vswitchd determined the actions in theovs-dpctldump-flows output.
  4. tcpdump the eth interface through which the ARP egresses thephysical machine.
  5. tcpdump the eth interface through which the ARP ingresses thephysical machine, at the remote host that receives the ARP.
  6. Use ovs-dpctldump-flows to spot the ARP flow on the remote hostremote host that receives the ARP and observe the VM vif or tapinterface to which the flow is directed. Again, ovs-dpctlshow andovs-appctlofproto/trace might help.
  7. tcpdump the vif or tap interface to which the ARP isdirected.
  8. tcpdump the eth interface through which the ARP ingresses a VM,from inside the VM.

It is likely that during one of these steps you will figure out theproblem. If not, then follow the ARP reply back to the origin, in reverse.

Q: How do I make a flow drop packets?

A: To drop a packet is to receive it without forwarding it. OpenFlowexplicitly specifies forwarding actions. Thus, a flow with an empty set ofactions does not forward packets anywhere, causing them to be dropped. Youcan specify an empty set of actions with actions= on the ovs-ofctlcommand line. For example:

would cause every packet entering switch br0 to be dropped.

You can write “drop” explicitly if you like. The effect is the same.Thus, the following command also causes every packet entering switch br0 tobe dropped:

drop is not an action, either in OpenFlow or Open vSwitch. Rather, itis only a way to say that there are no actions.

Q: I added a flow to send packets out the ingress port, like this:

but OVS drops the packets instead.

A: Yes, OpenFlow requires a switch to ignore attempts to send a packet outits ingress port. The rationale is that dropping these packets makes itharder to loop the network. Sometimes this behavior can even beconvenient, e.g. it is often the desired behavior in a flow that forwards apacket to several ports (“floods” the packet).

Sometimes one really needs to send a packet out its ingress port(“hairpin”). In this case, output to OFPP_IN_PORT, which in ovs-ofctlsyntax is expressed as just in_port, e.g.:

This also works in some circumstances where the flow doesn’t match on theinput port. For example, if you know that your switch has five portsnumbered 2 through 6, then the following will send every received packetout every port, even its ingress port:

or, equivalently:

Sometimes, in complicated flow tables with multiple levels of resubmitactions, a flow needs to output to a particular port that may or may not bethe ingress port. It’s difficult to take advantage of OFPP_IN_PORT inthis situation. To help, Open vSwitch provides, as an OpenFlow extension,the ability to modify the in_port field. Whatever value is currently inthe in_port field is the port to which outputs will be dropped, as well asthe destination for OFPP_IN_PORT. This means that the following willreliably output to port 2 or to ports 2 through 6, respectively:

If the input port is important, then one may save and restore it on thestack:

Q: My bridge br0 has host 192.168.0.1 on port 1 and host 192.168.0.2 on port 2.I set up flows to forward only traffic destined to the other host and dropother traffic, like this:

But it doesn’t work–I don’t get any connectivity when I do this. Why?

A: These flows drop the ARP packets that IP hosts use to establish IPconnectivity over Ethernet. To solve the problem, add flows to allow ARPto pass between the hosts:

This issue can manifest other ways, too. The following flows that match onEthernet addresses instead of IP addresses will also drop ARP packets,because ARP requests are broadcast instead of being directed to a specifichost:

The solution already described above will also work in this case. It maybe better to add flows to allow all multicast and broadcast traffic:

Q: My bridge disconnects from my controller on add-port/del-port.

A: Reconfiguring your bridge can change your bridge’s datapath-id becauseOpen vSwitch generates datapath-id from the MAC address of one of itsports. In that case, Open vSwitch disconnects from controllers becausethere’s no graceful way to notify controllers about the change ofdatapath-id.

To avoid the behaviour, you can configure datapath-id manually.:

Q: My controller complains that OVS is not buffering packets.What’s going on?

A: “Packet buffering” is an optional OpenFlow feature, and controllersshould detect how many “buffers” an OpenFlow switch implements. It wasrecently noticed that OVS implementation of the buffering feature was notcompliant to OpenFlow specifications. Rather than fix it and riskcontroller incompatibility, the buffering feature is removed as of OVS 2.7.Controllers are already expected to work properly in cases where the switchcan not buffer packets, but sends full packets in “packet-in” messagesinstead, so this change should not affect existing users. After the changeOVS always sends the buffer_id as 0xffffffff in “packet-in”messages and will send an error response if any other value of this fieldis included in a “packet-out” or a “flow mod” sent by a controller.

Packet buffers have limited usefulness in any case. Table-miss packet-inmessages most commonly pass the first packet in a microflow to the OpenFlowcontroller, which then sets up an OpenFlow flow that handles remainingtraffic in the microflow without further controller intervention. In sucha case, the packet that initiates the microflow is in practice usuallysmall (certainly for TCP), which means that the switch sends the entirepacket to the controller and the buffer only saves a small number of bytesin the reverse direction.

Q: How does OVS divide flows among buckets in an OpenFlow “select” group?

A: In Open vSwitch 2.3 and earlier, Open vSwitch used the destinationEthernet address to choose a bucket in a select group.

Open vSwitch 2.4 and later by default hashes the source and destinationEthernet address, VLAN ID, Ethernet type, IPv4/v6 source and destinationaddress and protocol, and for TCP and SCTP only, the source and destinationports. The hash is “symmetric”, meaning that exchanging source anddestination addresses does not change the bucket selection.

Select groups in Open vSwitch 2.4 and later can be configured to use adifferent hash function, using a Netronome extension to the OpenFlow 1.5+group_mod message. For more information, seeDocumentation/group-selection-method-property.txt in the Open vSwitchsource tree.

Q: An OpenFlow “select” group isn’t dividing packets evenly among the buckets.

A: When a packet passes through a “select” group, Open vSwitch hashes asubset of the fields in the packet, then it maps the hash value to abucket. This means that packets whose hashed fields are the same willalways go to the same bucket[*]. More specifically, if you test with asingle traffic flow, only one bucket will receive any traffic[**].Furthermore, statistics and probability mean that testing with a smallnumber of flows may still yield an uneven distribution.

[*] Unless its bucket has a watch port or group whose liveness changesduring the test.

[**] Unless the hash includes fields that vary within a traffic flow, suchas tcp_flags.

Q: I added a flow to accept packets on VLAN 123 and output them on VLAN 456,like so:

but the packets are actually being output in VLAN 123. Why?

A: OpenFlow actions are executed in the order specified. Thus, the actionsabove first output the packet, then change its VLAN. Since the outputoccurs before changing the VLAN, the change in VLAN will have no visibleeffect.

To solve this and similar problems, order actions so that changes toheaders happen before output, e.g.:

See also the following question.

Q: I added a flow to a redirect packets for TCP port 80 to port 443,like so:

Controller allows the developer to manipulate the flow entries of single device

but the packets are getting dropped instead. Why?

A: This set of actions does change the TCP destination port to 443, butthen it does nothing more. It doesn’t, for example, say to continue toanother flow table or to output the packet. Therefore, the packet isdropped.

To solve the problem, add an action that does something with the modifiedpacket. For example:

See also the preceding question.

Q: When using the “ct” action with FTP connections, it doesn’t seem to matterif I set the “alg=ftp” parameter in the action. Is this required?

A: It is advisable to use this option. Some platforms may automaticallydetect and apply ALGs in the “ct” action regardless of the parameters youprovide, however this is not consistent across all implementations. Theovs-ofctl(8)man pages contain further details in the description of the ALG parameter.
  • Open vSwitch FAQ
  • Open vSwitch 2.13.90 documentation
    • Open vSwitch FAQ
      • Using OpenFlow

How are packet-ins handled when a message is generated through table-miss flow entry?¶

Faucet adds explicit rules for unmatched packets.

Are group actions supported in Faucet?¶

Yes, just not by default currently. Set the group_table option to True on a datapath to enable group output actions.

Does Faucet send any multi-part requests? If so, please provide sample use cases¶

Gauge uses multi-part messages for the stats collection (flow table stats and port stats).

Dumb and dumber 1994 movie Download Dumb and Dumber Full Movie Dual Audio (Hindi-English) in 480p, 720p Quality. This movie file size is 300MB, 1.1GB Google Drive Link.

Does Faucet clear all all switch table entries on connection?¶

Faucet gives all entries a specific cookie, and it clears all entries with that cookie. I.e., it clears entries added by itself but not anyone else.

Does Faucet install fresh set of table entries on connection and re-connection?¶

Yes.

Does Faucet installed flows support priority? How is this defined - who get higher priority than the other and why?¶

Yes, priority is necessary for a number of things. Example: there are higher priority rules for packets with a known source address, and lower ones to send those packets to the controller.

Should Faucet detect Management, OF controller ports and gateway ports on the switch or pure OF only ports where hosts are connected?¶

Out of scope for Faucet as it is currently.

If another controller is connected to the switch in addition to Faucet, what happens to Faucet?¶

Faucet identifies its own flows using a cookie value, if the other controller doesn’t use the same cookie value there shouldn’t be a problem (provided the rules don’t conflict in a problematic way)

If another controller connected to switch changes role (master, slave, equal) on the switch, what happens to Faucet?¶

Shouldn’t be an issue, if another controller is the master then my understanding is Faucet wouldnt be able to install any flows however?

Some switches always send VLAN info in packet_in messages and some don’t. How does Faucet handle this?¶

Packets should have VLANs pushed before being sent to the controller.

Is there a event handler registered to detect if flows on the switch change?¶

No.

Does Faucet support L2.5 (MPLS, etc.)?¶

No.

Stats - what does Faucet collect (flow count, etc)?¶

Gauge collects port stats and takes a full flow-table dump periodically.

How do I use Gauge?¶

Give Gauge a list of Faucet yaml config files and it will poll them for stats (as specified in the config file).