Hi Jinlei,
It seems that you run LB feature in bridge domain, which is unexpected.
VPP LB is a Layer 3/Layer 4 LB, which will first pass through
ip4-input-no-checksum and ip4-lookup.
Here is the packet trace for your reference:
Packet 1
00:03:33:529453: dpdk-input
TenGigabitEthernet5/0/0 rx queue 0
buffer 0x4e03: current data 0, length 60, free-list 0, clone-count 0,
totlen-nifb 0, trace 0x0
ext-hdr-valid
l4-cksum-computed l4-cksum-correct
PKT MBUF: port 0, nb_segs 1, pkt_len 60
buf_len 2176, data_len 60, ol_flags 0x180, data_off 128, phys_addr
0x6e138140
packet_type 0x211 l2_len 0 l3_len 0 outer_l2_len 0 outer_l3_len 0
rss 0x0 fdir.hi 0x0 fdir.lo 0x0
Packet Offload Flags
PKT_RX_IP_CKSUM_GOOD (0x0080) IP cksum of RX pkt. is valid
PKT_RX_L4_CKSUM_GOOD (0x0100) L4 cksum of RX pkt. is valid
Packet Types
RTE_PTYPE_L2_ETHER (0x0001) Ethernet packet
RTE_PTYPE_L3_IPV4 (0x0010) IPv4 packet without extension headers
RTE_PTYPE_L4_UDP (0x0200) UDP packet
IP4: 90:e2:ba:48:7a:70 -> 90:e2:ba:48:7a:80
UDP: 192.168.50.71 -> 90.1.2.1
tos 0x00, ttl 64, length 46, checksum 0x2bce
fragment id 0x
UDP: 63 -> 2
length 26, checksum 0x1a18
00:03:33:529492: ethernet-input
frame: flags 0x3, hw-if-index 1, sw-if-index 1
IP4: 90:e2:ba:48:7a:70 -> 90:e2:ba:48:7a:80
00:03:33:529508: ip4-input-no-checksum
UDP: 192.168.50.71 -> 90.1.2.1
tos 0x00, ttl 64, length 46, checksum 0x2bce
fragment id 0x
UDP: 63 -> 2
length 26, checksum 0x1a18
00:03:33:529521: ip4-lookup
fib 0 dpo-idx 0 flow hash: 0x
UDP: 192.168.50.71 -> 90.1.2.1
tos 0x00, ttl 64, length 46, checksum 0x2bce
fragment id 0x
UDP: 63 -> 2
length 26, checksum 0x1a18
00:03:33:529535: lb4-nat4-port
lb vip[1]: ip4-nat4 90.1.2.1/32 new_size:1024 #as:2 protocol:17 port:2
type:clusterip port:3307 target_port:3307
lb as[1]: 192.168.60.74 used
00:03:33:529579: ip4-load-balance
fib 0 dpo-idx 3 flow hash: 0x
UDP: 192.168.50.71 -> 192.168.60.74
tos 0x00, ttl 64, length 46, checksum 0x8add
fragment id 0x
UDP: 63 -> 3307
length 26, checksum 0x7927
00:03:33:529582: ip4-rewrite
Thanks,
Hongjun
From: vpp-dev@lists.fd.io On Behalf Of Jinlei Li
Sent: Sunday, March 22, 2020 7:06 PM
To: vpp-dev@lists.fd.io
Subject: [vpp-dev] #lb vpp lb does not works with my configuration
Hi,
I am trying to test vpp load balance for my scenario. I create two pairs of
veth on host linux, and connect vpp and two Nginx containers by them. A
physical NIC is used by VPP as eth0 , and I create a loopback interface
(loop0), finally I add the two host-interfaces and the loopback interface in
the same bridge domain. the network toplogic is just like this picture. I can
ping vpp eth0 within container. I hope the traffic from external can reach the
nginx containers.
Then I would like to enable the vpp load balance feature, the configuration is
like this:
set interface state eth0 up
set interface mtu 1500 eth0
set interface ip address eth0 10.161.30.5/24
ip route add 0.0.0.0/0 via 10.161.30.1
create host-interface name vpp1host
create host-interface name vpp2host
set interface state host-vpp1host up
set interface state host-vpp2host up
create loopback interface
set interface state loop0 up
set interface mtu 1500 host-vpp1host
set interface mtu 1500 host-vpp2host
set interface mtu 1500 loop0
create bridge-domain 1
set interface l2 bridge host-vpp1host 1
set interface l2 bridge host-vpp2host 1
set interface l2 bridge loop0 1 bvi
set interface ip address loop0 2.2.2.1/24
lb conf ip4-src-address 2.2.2.1
lb vip 10.161.30.5/32 protocol tcp port 80 encap nat4 type clusterip
target_port 80
lb as 10.161.30.5/32 protocol tcp port 80 2.2.2.10 2.2.2.20
lb set interface nat4 in loop0 (after I add this configuration, the loop0
interface can not reach container).
DBGvpp# show lb vips verbose
ip4-nat4 [1] 10.161.30.5/32
new_size:1024
protocol:6 port:80
type:clusterip port:20480 target_port:80 counters:
packet from existing sessions: 0
first session packet: 0
untracked packet: 0
no server configured: 0
#as:2
2.2.2.20 512 buckets 0 flows dpo:18 used
2.2.2.10 512 buckets 0 flows dpo:17 used
---
By the way,I also tried nat44 static mapping, and it works.
nat44 add address 10.161.30.5
set interface nat44 in loop0 out eth0
nat44 add load-balancing static mapping protocol tcp external 10.161.30.5:80
local 2.2.2.10:80 probability 50 local 2.2.2.20:80 probability 50
So , can any one check where is the problem?
[cid:image001.jpg@01D601F4.D4457CA0]
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#15847): https://lists.fd.io/g/vpp-dev/messag