ARP issues in cross-host namespace interaction based on ovs_openflow

I’m trying to build connectivity between linux namespaces on different hosts. Here’s my network topology.
topo
Here’s the scripts to build this topo.
hostA:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>ovs-vsctl add-br ovs1
ifconfig ovs1 up
ip netns add ns1
ip link add veth1 type veth peer veth2
ip link set veth2 netns ns1
ip netns exec ns1 ifconfig veth2 10.1.1.1/24 up
ifconfig veth1 up
ovs-vsctl add-port ovs1 vxlan0 -- set interface vxlan0 type=vxlan options:key=flow options:remote_ip=flow
ip netns exec ns1 ifconfig lo up
</code>
<code>ovs-vsctl add-br ovs1 ifconfig ovs1 up ip netns add ns1 ip link add veth1 type veth peer veth2 ip link set veth2 netns ns1 ip netns exec ns1 ifconfig veth2 10.1.1.1/24 up ifconfig veth1 up ovs-vsctl add-port ovs1 vxlan0 -- set interface vxlan0 type=vxlan options:key=flow options:remote_ip=flow ip netns exec ns1 ifconfig lo up </code>
ovs-vsctl add-br ovs1
ifconfig ovs1 up
ip netns add ns1
ip link add veth1 type veth peer veth2
ip link set veth2 netns ns1
ip netns exec ns1 ifconfig veth2 10.1.1.1/24 up
ifconfig veth1 up
ovs-vsctl add-port ovs1 vxlan0 -- set interface vxlan0 type=vxlan options:key=flow options:remote_ip=flow
ip netns exec ns1 ifconfig lo up

hostB:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>ovs-vsctl add-br ovs1
ifconfig ovs1 up
ip netns add ns1
ip link add veth1 type veth peer veth2
ip link set veth2 netns ns1
ip netns exec ns1 ifconfig veth2 10.1.1.2/24 up
ifconfig veth1 up
ovs-vsctl add-port ovs1 vxlan0 -- set interface vxlan0 type=vxlan options:key=flow options:remote_ip=flow
ip netns exec ns1 ifconfig lo up
</code>
<code>ovs-vsctl add-br ovs1 ifconfig ovs1 up ip netns add ns1 ip link add veth1 type veth peer veth2 ip link set veth2 netns ns1 ip netns exec ns1 ifconfig veth2 10.1.1.2/24 up ifconfig veth1 up ovs-vsctl add-port ovs1 vxlan0 -- set interface vxlan0 type=vxlan options:key=flow options:remote_ip=flow ip netns exec ns1 ifconfig lo up </code>
ovs-vsctl add-br ovs1
ifconfig ovs1 up
ip netns add ns1
ip link add veth1 type veth peer veth2
ip link set veth2 netns ns1
ip netns exec ns1 ifconfig veth2 10.1.1.2/24 up
ifconfig veth1 up
ovs-vsctl add-port ovs1 vxlan0 -- set interface vxlan0 type=vxlan options:key=flow options:remote_ip=flow
ip netns exec ns1 ifconfig lo up

I want to use openflow to realize the VXLAN. Here’s the openflow settings.
hostA, remember to change the tun_dst ip address to you machine’s ip address:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>ovs-ofctl add-flow ovs1 "table=0, priority=100,ip,nw_dst=10.1.1.2/32, actions=set_field:192.168.31.182->tun_dst,normal"
</code>
<code>ovs-ofctl add-flow ovs1 "table=0, priority=100,ip,nw_dst=10.1.1.2/32, actions=set_field:192.168.31.182->tun_dst,normal" </code>
ovs-ofctl add-flow ovs1 "table=0, priority=100,ip,nw_dst=10.1.1.2/32, actions=set_field:192.168.31.182->tun_dst,normal"

hostB:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>ovs-ofctl add-flow ovs1 "table=0, priority=100,ip,nw_src=10.1.1.1/32, actions=set_field:192.168.31.181->tun_dst,normal"
</code>
<code>ovs-ofctl add-flow ovs1 "table=0, priority=100,ip,nw_src=10.1.1.1/32, actions=set_field:192.168.31.181->tun_dst,normal" </code>
ovs-ofctl add-flow ovs1 "table=0, priority=100,ip,nw_src=10.1.1.1/32, actions=set_field:192.168.31.181->tun_dst,normal"

But the two ns can’t ping each other because the arp request can’t reach to each other. So I make the arp request in the vxlan packet.
hostA:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>ovs-ofctl add-flow ovs1 "table=0, priority=200, arp, arp_op=1, actions=set_field:192.168.31.182->tun_dst,normal"
ovs-ofctl add-flow ovs1 "table=0, priority=200, arp, arp_op=2, actions=set_field:192.168.31.182->tun_dst,normal"
</code>
<code>ovs-ofctl add-flow ovs1 "table=0, priority=200, arp, arp_op=1, actions=set_field:192.168.31.182->tun_dst,normal" ovs-ofctl add-flow ovs1 "table=0, priority=200, arp, arp_op=2, actions=set_field:192.168.31.182->tun_dst,normal" </code>
ovs-ofctl add-flow ovs1 "table=0, priority=200, arp, arp_op=1, actions=set_field:192.168.31.182->tun_dst,normal"
ovs-ofctl add-flow ovs1 "table=0, priority=200, arp, arp_op=2, actions=set_field:192.168.31.182->tun_dst,normal"

hostB:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>ovs-ofctl add-flow ovs1 "table=0, priority=200, arp, arp_op=1, actions=set_field:192.168.31.181->tun_dst,normal"
ovs-ofctl add-flow ovs1 "table=0, priority=200, arp, arp_op=2, actions=set_field:192.168.31.181->tun_dst,normal"
</code>
<code>ovs-ofctl add-flow ovs1 "table=0, priority=200, arp, arp_op=1, actions=set_field:192.168.31.181->tun_dst,normal" ovs-ofctl add-flow ovs1 "table=0, priority=200, arp, arp_op=2, actions=set_field:192.168.31.181->tun_dst,normal" </code>
ovs-ofctl add-flow ovs1 "table=0, priority=200, arp, arp_op=1, actions=set_field:192.168.31.181->tun_dst,normal"
ovs-ofctl add-flow ovs1 "table=0, priority=200, arp, arp_op=2, actions=set_field:192.168.31.181->tun_dst,normal"

Then on hostA ip netns exec ns1 ping 10.1.1.2 works.

But my question is why this works properly? I think the openflow rules which matches arp may result in something like a cycle. When arp request arrives in hostB, B’s openflow rule will pack the arp request in a VXLAN packet and then send back to hostA. The circle will not stop? But I use tshark to capture the packets and didn’t see anything like this. How to explain it?
And I also wonder, to solve the arp problems, is there any other solution?

New contributor

light_rain is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật