Bug 1734743

Summary: [OVN]controller_even doesn't record the UDP packets of lb_backends
Product: Red Hat Enterprise Linux Fast Datapath Reporter: haidong li <haili>
Component: OVNAssignee: lorenzo bianconi <lorenzo.bianconi>
Status: CLOSED ERRATA QA Contact: haidong li <haili>
Severity: medium Docs Contact:
Priority: unspecified    
Version: FDP 19.ECC: ctrautma, fleitner, kfida, lorenzo.bianconi, yinxu
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: ovn2.11-2.11.0-31.el7fdn Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-10-01 07:21:33 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description haidong li 2019-07-31 11:02:46 UTC
Description of problem:
controller_even doesn't record the UDP packets of lb_backends

Version-Release number of selected component (if applicable):
[root@dell-per730-19 opt]# rpm -qa | grep openvswitch
openvswitch-selinux-extra-policy-1.0-13.el7fdp.noarch
openvswitch2.11-2.11.0-18.el7fdp.x86_64
[root@dell-per730-19 opt]# rpm -qa | grep ovn
ovn2.11-central-2.11.0-26.el7fdp.x86_64
ovn2.11-2.11.0-26.el7fdp.x86_64
ovn2.11-host-2.11.0-26.el7fdp.x86_64
[root@dell-per730-19 opt]# 

How reproducible:
everytime

Steps to Reproduce:
1.add logical switch and add no back-end load balancer to it
2.send UDP packet to VIP,no record in controller_even.

Actual results:

[root@dell-per730-19 opt]# ovn-nbctl show s2
switch f756a292-7afe-4c7d-b366-85ea80d88096 (s2)
    port hv1_vm00_vnet1
        addresses: ["00:de:ad:01:00:01 172.16.102.11"]
    port hv1_vm01_vnet1
        addresses: ["00:de:ad:01:01:01 172.16.102.12"]
    port s2_r1
        type: router
        addresses: ["00:de:ad:ff:01:02 172.16.102.1"]
        router-port: r1_s2
[root@dell-per730-19 opt]# 
[root@dell-per730-19 opt]# ovn-nbctl list load_balancer
_uuid               : 0d3a7dcc-a162-4f9c-a2cd-8a1eec113ee0
external_ids        : {}
name                : "lb0"
protocol            : tcp
vips                : {"172.16.13.100"="", "172.16.13.100:80"="", "172.16.13.200"="", "172.16.13.200:80"=""}

_uuid               : e7534669-9004-4fcb-b133-035b5227e335
external_ids        : {}
name                : ""
protocol            : []
vips                : {"30.0.0.1"="172.16.103.11,172.16.103.12"}

_uuid               : 5f74f3ee-2819-4c36-ae38-9d5d758d92d5
external_ids        : {}
name                : "lb1"
protocol            : tcp
vips                : {"50.0.0.1"="172.16.103.11,172.16.103.12", "50.0.0.1:80"="172.16.103.11:80,172.16.103.12:80"}
[root@dell-per730-19 opt]# 

then send udp packet,only tcp record:
[root@localhost ~]# nc 172.16.13.100 80 -u  < 1.txt
[root@localhost ~]# nc 172.16.13.100 80   < 1.txt

check the event:
[root@dell-per730-19 opt]# ovn-sbctl list controller_even
_uuid               : 6b340d64-ff44-4b44-a8ca-53721bc59db8
chassis             : []
event_info          : {load_balancer="db75bf6a-3a99-44ac-9c73-95a8ff3cbd73", protocol=tcp, vip="172.16.13.100:80"}
event_type          : empty_lb_backends
seq_num             : 1

_uuid               : 0a2f21e0-caab-48eb-8715-9abb58514cb9
chassis             : 2a8a2e31-a530-4f2a-b628-fb10b448644e
event_info          : {load_balancer="db75bf6a-3a99-44ac-9c73-95a8ff3cbd73", protocol=tcp, vip="172.16.13.100:80"}
event_type          : empty_lb_backends
seq_num             : 1

_uuid               : 33ac71b1-e71d-40fc-8b21-823f09de40a2
chassis             : 2a8a2e31-a530-4f2a-b628-fb10b448644e
event_info          : {load_balancer="0d3a7dcc-a162-4f9c-a2cd-8a1eec113ee0", protocol=tcp, vip="172.16.13.200:80"}
event_type          : empty_lb_backends
seq_num             : 23

_uuid               : 56a735a1-017c-425f-bad5-8425fd28b962
chassis             : 2a8a2e31-a530-4f2a-b628-fb10b448644e
event_info          : {load_balancer="0d3a7dcc-a162-4f9c-a2cd-8a1eec113ee0", protocol=tcp, vip="172.16.13.100:80"}
event_type          : empty_lb_backends
seq_num             : 2
[root@dell-per730-19 opt]# 


Expected results:


Additional info:

Comment 1 haidong li 2019-08-01 07:39:10 UTC
I have tested it again,and give some other information about it:

1.The UDP can be recorded when the load balancer is configured like this:
ovn-nbctl lb-add lb2 172.16.13.10:80 "" udp
[root@dell-per730-19 opt]# ovn-nbctl list load_balancer
_uuid               : 73da9ef9-54d4-4558-80d1-ee999c7dc1dc
external_ids        : {}
name                : "lb2"
protocol            : udp
vips                : {"172.16.13.10:80"=""}
[root@dell-per730-19 opt]# ovn-nbctl lb-list lb2
UUID                                    LB                  PROTO      VIP                IPs
73da9ef9-54d4-4558-80d1-ee999c7dc1dc    lb2                 udp        172.16.13.10:80    

[root@dell-per730-19 opt]# ovn-sbctl list controller_even
_uuid               : 8a30b077-1cc4-46c0-983d-707044faec94
chassis             : f704b2a1-0435-4627-9119-062cd3a5bba9
event_info          : {load_balancer="73da9ef9-54d4-4558-80d1-ee999c7dc1dc", protocol=udp, vip="172.16.13.10:80"}
event_type          : empty_lb_backends
seq_num             : 4

2.But if I configured like below without port number and protocol,as reported in the bug,udp can't be recorded,only tcp can be recorded:
ovn-nbctl lb-add lb6 172.16.13.60 ""
[root@dell-per730-19 opt]# ovn-nbctl lb-list lb6
UUID                                    LB                  PROTO      VIP             IPs
97725ad1-dea5-4d90-8119-881bce38c740    lb6                 tcp/udp    172.16.13.60    

send packets:
[root@localhost ~]# nc 172.16.13.60 80 -u  < 2.txt
[root@localhost ~]# nc 172.16.13.60 80   < 2.txt

check:
[root@dell-per730-19 opt]# ovn-sbctl list controller_even
_uuid               : 0871ad89-acee-43ea-90d8-84e8dcf37901
chassis             : f704b2a1-0435-4627-9119-062cd3a5bba9
event_info          : {load_balancer="97725ad1-dea5-4d90-8119-881bce38c740", protocol=tcp, vip="172.16.13.60"}
event_type          : empty_lb_backends
seq_num             : 5

3.The configuration of load-balancer without port and protocol is supported in ovn,and support both tcp and udp:
 [root@dell-per730-19 opt]# ovn-nbctl lb-add lb7 172.16.13.70 "172.16.103.11,172.16.103.12"
[root@dell-per730-19 opt]# ovn-nbctl ls-lb-add s2 lb7
[root@dell-per730-19 opt]# ovn-nbctl lb-list lb7
UUID                                    LB                  PROTO      VIP             IPs
bdd7d296-eb56-46b4-8e65-e2106f8a4b08    lb7                 tcp/udp    172.16.13.70    172.16.103.11,172.16.103.12
[root@dell-per730-19 opt]# ovn-nbctl ls-lb-list s2
UUID                                    LB                  PROTO      VIP                 IPs
73da9ef9-54d4-4558-80d1-ee999c7dc1dc    lb2                 udp        172.16.13.10:80            
97725ad1-dea5-4d90-8119-881bce38c740    lb6                 tcp/udp    172.16.13.60        
bdd7d296-eb56-46b4-8e65-e2106f8a4b08    lb7                 tcp/udp    172.16.13.70        172.16.103.11,172.16.103.12
[root@dell-per730-19 opt]#

Comment 2 lorenzo bianconi 2019-08-01 17:11:09 UTC
(In reply to haidong li from comment #1)
> I have tested it again,and give some other information about it:
> 
> 1.The UDP can be recorded when the load balancer is configured like this:
> ovn-nbctl lb-add lb2 172.16.13.10:80 "" udp
> [root@dell-per730-19 opt]# ovn-nbctl list load_balancer
> _uuid               : 73da9ef9-54d4-4558-80d1-ee999c7dc1dc
> external_ids        : {}
> name                : "lb2"
> protocol            : udp
> vips                : {"172.16.13.10:80"=""}
> [root@dell-per730-19 opt]# ovn-nbctl lb-list lb2
> UUID                                    LB                  PROTO      VIP  
> IPs
> 73da9ef9-54d4-4558-80d1-ee999c7dc1dc    lb2                 udp       
> 172.16.13.10:80    
> 
> [root@dell-per730-19 opt]# ovn-sbctl list controller_even
> _uuid               : 8a30b077-1cc4-46c0-983d-707044faec94
> chassis             : f704b2a1-0435-4627-9119-062cd3a5bba9
> event_info          : {load_balancer="73da9ef9-54d4-4558-80d1-ee999c7dc1dc",
> protocol=udp, vip="172.16.13.10:80"}
> event_type          : empty_lb_backends
> seq_num             : 4
> 
> 2.But if I configured like below without port number and protocol,as
> reported in the bug,udp can't be recorded,only tcp can be recorded:
> ovn-nbctl lb-add lb6 172.16.13.60 ""
> [root@dell-per730-19 opt]# ovn-nbctl lb-list lb6
> UUID                                    LB                  PROTO      VIP  
> IPs
> 97725ad1-dea5-4d90-8119-881bce38c740    lb6                 tcp/udp   
> 172.16.13.60    
> 
> send packets:
> [root@localhost ~]# nc 172.16.13.60 80 -u  < 2.txt
> [root@localhost ~]# nc 172.16.13.60 80   < 2.txt
> 
> check:
> [root@dell-per730-19 opt]# ovn-sbctl list controller_even
> _uuid               : 0871ad89-acee-43ea-90d8-84e8dcf37901
> chassis             : f704b2a1-0435-4627-9119-062cd3a5bba9
> event_info          : {load_balancer="97725ad1-dea5-4d90-8119-881bce38c740",
> protocol=tcp, vip="172.16.13.60"}
> event_type          : empty_lb_backends
> seq_num             : 5
> 
> 3.The configuration of load-balancer without port and protocol is supported
> in ovn,and support both tcp and udp:
>  [root@dell-per730-19 opt]# ovn-nbctl lb-add lb7 172.16.13.70
> "172.16.103.11,172.16.103.12"
> [root@dell-per730-19 opt]# ovn-nbctl ls-lb-add s2 lb7
> [root@dell-per730-19 opt]# ovn-nbctl lb-list lb7
> UUID                                    LB                  PROTO      VIP  
> IPs
> bdd7d296-eb56-46b4-8e65-e2106f8a4b08    lb7                 tcp/udp   
> 172.16.13.70    172.16.103.11,172.16.103.12
> [root@dell-per730-19 opt]# ovn-nbctl ls-lb-list s2
> UUID                                    LB                  PROTO      VIP  
> IPs
> 73da9ef9-54d4-4558-80d1-ee999c7dc1dc    lb2                 udp       
> 172.16.13.10:80            
> 97725ad1-dea5-4d90-8119-881bce38c740    lb6                 tcp/udp   
> 172.16.13.60        
> bdd7d296-eb56-46b4-8e65-e2106f8a4b08    lb7                 tcp/udp   
> 172.16.13.70        172.16.103.11,172.16.103.12
> [root@dell-per730-19 opt]#

If no specific L4 protocol is provided, tcp is selected as default one (as it is indicated dumping the lb table content). There is just a trivial bug in ovn-nbctl lb-list command. I will post a patch to fix it. Thanks

Comment 4 haidong li 2019-08-30 03:04:01 UTC
The issue is verified on the latest version:
[root@dell-per740-05 ~]# uname -a
Linux dell-per740-05.rhts.eng.pek2.redhat.com 3.10.0-1062.el7.x86_64 #1 SMP Thu Jul 18 20:25:13 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
[root@dell-per740-05 ~]# rpm -qa | grep openvswitch
openvswitch2.11-2.11.0-21.el7fdp.x86_64
openvswitch-selinux-extra-policy-1.0-13.el7fdp.noarch
kernel-kernel-networking-openvswitch-ovn_ha-1.0-41.noarch
[root@dell-per740-05 ~]# rpm -qa | grep ovn
ovn2.11-2.11.0-36.el7fdp.x86_64
ovn2.11-host-2.11.0-36.el7fdp.x86_64
kernel-kernel-networking-openvswitch-ovn_ha-1.0-41.noarch
ovn2.11-central-2.11.0-36.el7fdp.x86_64
[root@dell-per740-05 ~]# 
[root@dell-per740-05 ~]# ovn-nbctl ls-add s2
[root@dell-per740-05 ~]# ovn-nbctl lb-add lb7 172.16.13.70 ""
[root@dell-per740-05 ~]# ovn-nbctl lb-list
UUID                                    LB                  PROTO      VIP             IPs
f7af77e9-6cac-4e48-8020-23da35bafc65    lb7                 tcp        172.16.13.70    
[root@dell-per740-05 ~]# 
[root@dell-per740-05 ~]# ovn-nbctl ls-lb-add s2 lb7
[root@dell-per740-05 ~]# ovn-nbctl ls-lb-list s2
UUID                                    LB                  PROTO      VIP             IPs
f7af77e9-6cac-4e48-8020-23da35bafc65    lb7                 tcp        172.16.13.70    
[root@dell-per740-05 ~]#

Comment 6 errata-xmlrpc 2019-10-01 07:21:33 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2019:2943