1

My goal is to send to a specific interface all ethernet traffic with a special ethertype. I have thus a virtual switch with OpenVSwitch on my interface eth0, and I use tap interfaces to retrieve specific frames in order to process them. The normal flow is sent to tap1, while the special flow is sent to tap0. Here is the OpenVSwitch configuration:

# ovs-vsctl show
44c95237-25bd-45fd-bb97-d596aecf5f46
Bridge brLan
    Port "tap0"
        Interface "tap0"
    Port "tap1"
        Interface "tap1"
    Port eth0
        Interface eth0
    Port brLan
        Interface brLan
            type: internal
ovs_version: "2.5.0"

On the bridge brLan, with 3 ports (eth0, tap0, and tap1), I'd like to switch all frames with ethertype = 0x88B5 to tap0, while all other frames are going though tap1.

I made thus these OpenFlow rules:

# ovs-ofctl add-flow brLan "idle_timeout=0,priority=33100,in_port=1,dl_type=0x88b5,actions=output:6"
# ovs-ofctl add-flow brLan "idle_timeout=0,priority=33100,in_port=1,actions=output:7"

where 6 is the ID of tap0 and 7 is the ID of tap1, displayed with # ovs-ofctl show brLan

Now, if I send the frames to this interface eth0 with the ethertype 0x88B5, they aren't switched to tap0, as shows the command:

# ovs-ofctl dump-flows brLan
NXST_FLOW reply (xid=0x4):
cookie=0x0, duration=54229.821s, table=0, n_packets=27269, n_bytes=1636190, idle_age=0, priority=33100,in_port=1 actions=output:7
cookie=0x0, duration=54229.790s, table=0, n_packets=0, n_bytes=0, idle_age=54229, priority=33100,in_port=1,dl_type=0x88b5 actions=output:6

The first flow is the normal flow of usual ethernet frames, and I see it's OK, well switched to tap1. But about the flow to output:6, no frames arrive, even though I can display them using WireShark!

Any ideas on how to solve this, to make the switching of frames with ether_type = 0x88B5 arrive to tap0?

5
  • Do I have to install a custom classifier on openvswitch ? These machines are on a completety separated network.
    – 3isenHeim
    Commented Apr 27, 2016 at 8:43
  • just curious, why are you doing this? Openflow/SDN I mean? What is the application? Commented May 27, 2016 at 17:47
  • To bind specific programs to thses taps, in order to handles specific pakets ;)
    – 3isenHeim
    Commented May 28, 2016 at 12:18
  • I ask because I am curious what consumers are using SDN for. I understand it's application in OEM's / manufacturers of networking products, but not by end users. In fact, I have no idea what a tap is! As I understand it, programs/applications can be bound/configured to use to protocols and ports such as TCP port 25 (SMTP). I've never heard of taps. Commented May 28, 2016 at 20:02
  • I'm not an end user ;) I'm designing networking products. And if the products don't fully rely on an IP stack, you can't use TCP ports. Besides, using Raw sockets are a mess.
    – 3isenHeim
    Commented May 30, 2016 at 7:28

1 Answer 1

0

The problem was with the priorities given to the flows.

As the 2 flows look into the same port (eth0), they have to have different priorities.

Setting the first flow to :

# ovs-ofctl add-flow brLan "idle_timeout=0,priority=44100,in_port=1,dl_type=0x88b5,actions=output:6" 

This solved the problem

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.