Ask Your Question
0

how to find the mapping between vxlan vni and openvswitch internal tag

asked 2017-06-07 09:00:21 -0600

rw gravatar image

For example, i have the following ovs-vsctl show output on my network node. Is there anyway to know what is the openvswitch internal vlan tag is associated to each vxlan VNI?

If my understanding is correct, when a packet received from vxlan tunnel, ovs br-tun will remove the vlan header and add internal vlan tag before sending to br-int. And also, since internal vlan tag is uniq per host, internal vlan tag for the same packet in compute node could be different from assigned internal vlan tag when the packet reaches network node.

7b14d048-c73e-4c8a-af43-cf568cf79d6d
Manager "ptcp:6640:127.0.0.1"                                                                                               
    is_connected: true                                                                                                      
Bridge br-ex                                                                                                                
    Controller "tcp:127.0.0.1:6633"                                                                                         
        is_connected: true                                                                                                  
    fail_mode: secure                                                                                                       
    Port br-ex                                                                                                              
        Interface br-ex                                                                                                     
            type: internal                                                                                                  
    Port phy-br-ex                                                                                                          
        Interface phy-br-ex                                                                                                 
            type: patch                                                                                                     
            options: {peer=int-br-ex}                                                                                       
Bridge br-int                                                                                                               
    Controller "tcp:127.0.0.1:6633"                                                                                         
        is_connected: true                                                                                                  
    fail_mode: secure                                                                                                       
    Port "tap2b56c518-fb"                                                                                                   
        tag: 1                                                                                                              
        Interface "tap2b56c518-fb"                                                                                          
            type: internal                                                                                                  
    Port "tap3775bfe7-6e"                                                                                                   
        tag: 3                                                                                                              
        Interface "tap3775bfe7-6e"                                                                                          
            type: internal                                                                                                  
    Port "qg-421b407a-81"                                                                                                   
        tag: 4                                                                                                              
        Interface "qg-421b407a-81"                                                                                          
            type: internal                                                                                                  
    Port "qg-ede3b53d-da"                                                                                                   
        tag: 4                                                                                                              
        Interface "qg-ede3b53d-da"                     
            type: internal                                                                                                  
    Port int-br-ex                                                                                                          
        Interface int-br-ex                                                                                                 
            type: patch                                                                                                     
            options: {peer=phy-br-ex}                                                                                       
    Port "qg-a1b3323f-35"                                                                                                   
        tag: 4                                                                                                              
        Interface "qg-a1b3323f-35"                                                                                          
            type: internal                                                                                                  
    Port "qr-2c628d36-76"                                                                                                   
        tag: 3                                                                                                              
        Interface "qr-2c628d36-76"                                                                                          
            type: internal                                                                                                  
    Port "qr-b9a4d300-68"                                                                                                   
        tag: 2                                                                                                              
        Interface "qr-b9a4d300-68"                                                                                          
            type: internal                                                                                                  
    Port "tap80ac2f6b-87"                                                                                                   
        tag: 2                                                                                                              
        Interface "tap80ac2f6b-87"                                                                                          
            type: internal                                                                                                  
    Port br-int                                                                                                             
        Interface br-int                                                                                                    
            type: internal                                                                                                  
    Port "qr-f80a6a75-e6"                                                                                                   
        tag: 1                                                                                                              
        Interface "qr-f80a6a75-e6"                                                                                          
            type: internal                                                                                                  
    Port patch-tun                                                                                                          
        Interface patch-tun                                                                                                 
            type: patch                                                                                                     
            options: {peer=patch-int}
Bridge br-tun
    Controller "tcp:127.0.0.1:6633"
        is_connected: true                                                                                                  
    fail_mode: secure                                                                                                       
    Port br-tun                                                                                                             
        Interface br-tun                                                                                                    
            type: internal                                                                                                  
    Port "vxlan-c0a8010d"                                                                                                   
        Interface "vxlan-c0a8010d"                                                                                          
            type: vxlan                                                                                                     
            options: {df_default="true", in_key=flow, local_ip="192.168.1.12", out_key=flow, remote_ip="192.168.1.13"}      
    Port patch-int                                                                                                          
        Interface patch-int                                                                                                 
            type: patch                                                                                                     
            options: {peer=patch-tun}
edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2017-06-07 10:04:35 -0600

Hi,

Vlan translation can be found in br-tun flows.

In example: Having a VXLAN ID (1388) coming from tun_id=0x1388 and a local ovs vlan id 1.

You can see that there are some flows that strip/append the vlan into the flow.

In this example, tun_id=0x1388 is translated into mod_vlan_vid:1 when traffic is coming from a tunnel (br-tun)

[root@kolla ~]# ovs-ofctl dump-flows br-tun
 cookie=0x0, duration=182103.664s, table=2, n_packets=5982, n_bytes=1479916, idle_age=52, hard_age=65534, priority=1,tun_id=0x1388 actions=mod_vlan_vid:1,resubmit(,10)
 cookie=0x0, duration=182103.777s, table=21, n_packets=10235, n_bytes=3109310, idle_age=5, hard_age=65534, priority=1,dl_vlan=1 actions=strip_vlan,set_tunnel:0x1388,output:3,output:2

Maybe there is an easy way to find this info, at this moment cannot recall in one.

Regards

edit flag offensive delete link more

Comments

Thanks! i found it.

# ovs-ofctl dump-flows br-tun | grep 0x5a

cookie=0xb5b1b0a3b000ddbe, duration=79173.938s, table=4, n_packets=125, n_bytes=11703, idle_age=106, hard_ag e=65534, priority=1,tun_id=0x5a actions=mod_vlan_vid:3,resubmit(,10) cookie=0xb5b1b0a3b000d

rw gravatar imagerw ( 2017-06-07 11:26:58 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2017-06-07 09:00:21 -0600

Seen: 1,102 times

Last updated: Jun 07 '17