[ovs-discuss] add-tlv-map not working with flow

Yan Xiu yanmlist at gmail.com
Fri May 31 23:20:49 UTC 2019


Hello folks,

I have a project to handle packets with Geneve header and TLV options.
The goal is to detect ingress packet from interface ens192 with specific
value in Geneve TLV option, then forward to interface ens224.
But following setup does not seem to work. No packets meet the criteria.
If I remove tun_metadata0 from the flow, all packets passed.
Please help!

1. OVS setup

===========
  sudo ovs-vsctl add-br br0

  sudo ovs-vsctl  add-port br0 ens192
  sudo ovs-vsctl  add-port br0 ens224

  sudo ovs-ofctl add-tlv-map br0
"{class=0x0104,type=0x26,len=24}->tun_metadata0"
  sudo ovs-ofctl add-flow br0
in_port=ens192,tun_metadata0=0x00860103000034011000000000505695157b004080000035/0x00000000000000FF18000000000000000000FFC000000000,actions=ens224

2. Ingress packet to ens192 captured by wireshark.
======================================
Frame 4: 1074 bytes on wire (8592 bits), 1074 bytes captured (8592 bits)
Ethernet II, Src: Vmware_95:15:7b (00:50:56:95:15:7b), Dst: Vmware_95:15:7b
(00:50:56:95:15:7b)
Internet Protocol Version 4, Src: 10.0.0.1, Dst: 10.0.0.2
User Datagram Protocol, Src Port: 6081, Dst Port: 6081
Generic Network Virtualization Encapsulation, VNI: 0x000000
    Version: 0
    Length: 28 bytes
    Flags: 0x00
    Protocol Type: Transparent Ethernet bridging (0x6558)
    Virtual Network Identifier (VNI): 0x000000
    Options: (28 bytes)
        Unknown, Class: VMware (0x0104) Type: 0x26 (Non-critical)
            Class: VMware (0x0104)
            Type: 0x26 (Non-critical)
            Length: 28 bytes           (it's 0x06 in packet)
            Option Data: 00860103 00003401 10000000 00505695 157b0040
80000035
Ethernet II, Src: Vmware_95:c2:6c (00:50:56:95:c2:6c), Dst: Vmware_95:a9:26
(00:50:56:95:a9:26)
Internet Protocol Version 4, Src: 10.100.1.11, Dst: 10.100.1.10
User Datagram Protocol, Src Port: 1024, Dst Port: 1024
Data (954 bytes)
    Data: 000000000000000000000000000000000000000000000000…
    [Length: 954]

3. Flow status
===========
ubuntu at yan-svm-ubuntu:~$ sudo ovs-ofctl dump-tlv-map br0
NXT_TLV_TABLE_REPLY (xid=0x2):
 max option space=256 max fields=64
 allocated option space=24

 mapping table:
 class  type    length  match field
 -----  ----    ------  -----------
 0x104  0x26    24      tun_metadata0
ubuntu at yan-svm-ubuntu:~$
ubuntu at yan-svm-ubuntu:~$ sudo ovs-ofctl dump-flows br0
 cookie=0x0, duration=11.974s, table=0, n_packets=0, n_bytes=0,
tun_metadata0=0x110000000000000000000004000000000/0xff18000000000000000000ffc000000000,in_port=ens192
actions=output:ens224
ubuntu at yan-svm-ubuntu:~$

4. Remove tun_metadata0 from flow
============================
ubuntu at yan-svm-ubuntu:~$ sudo ovs-ofctl del-flows br0
ubuntu at yan-svm-ubuntu:~$ sudo ovs-ofctl add-flow br0
in_port=ens192,actions=ens224
ubuntu at yan-svm-ubuntu:~$ sudo ovs-ofctl dump-tlv-map br0
NXT_TLV_TABLE_REPLY (xid=0x2):
 max option space=256 max fields=64
 allocated option space=24

 mapping table:
 class  type    length  match field
 -----  ----    ------  -----------
 0x104  0x26    24      tun_metadata0
ubuntu at yan-svm-ubuntu:~$
ubuntu at yan-svm-ubuntu:~$ sudo ovs-ofctl dump-flows br0
 cookie=0x0, duration=17.224s, table=0, n_packets=2952, n_bytes=2469636,
in_port=ens192 actions=output:ens224
ubuntu at yan-svm-ubuntu:~

Thank you,
Yan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openvswitch.org/pipermail/ovs-discuss/attachments/20190531/bbd287af/attachment.html>


More information about the discuss mailing list