Re: [ovs-dev] [PATCH ovn] test: add more tests to IP-buffering unit-test
On Wed, Jun 3, 2020 at 2:18 PM Lorenzo Bianconi wrote: > On Jun 03, Ankur Sharma wrote: > > Hi Lorenzo, > > > > Please find my comments inline. > > > > Regards, > > Ankur > > > > > > From: dev on behalf of Ankur Sharma < > ankur.sha...@nutanix.com> > > Sent: Monday, June 1, 2020 9:05 PM > > To: Lorenzo Bianconi ; > ovs-dev@openvswitch.org > > Subject: Re: [ovs-dev] [PATCH ovn] test: add more tests to IP-buffering > unit-test > > > > Hi Lorenzo, > > > > Thanks a lot for the patch. > > I will get back on this by EOD PST tomorrow. > > > > Regards, > > Ankur > > > > From: Lorenzo Bianconi > > Sent: Friday, May 29, 2020 7:01 AM > > To: ovs-dev@openvswitch.org > > Cc: Ankur Sharma ; num...@ovn.org < > num...@ovn.org>; dce...@redhat.com > > Subject: [PATCH ovn] test: add more tests to IP-buffering unit-test > > > > Check the hv is sending the ICMP request using the FIP as src IP in > > a DVR scenario. Update previous tests introducing source NAT for > > distributed traffic cases > > > > Signed-off-by: Lorenzo Bianconi > Thanks Lorenzo and Ankur. I applied this patch to master. Numan > > --- > > tests/ovn.at | 21 ++--- > > 1 file changed, 14 insertions(+), 7 deletions(-) > > > > diff --git a/tests/ovn.at b/tests/ovn.at > > index 15b40ca1e..57f632c4e 100644 > > --- a/tests/ovn.at > > +++ b/tests/ovn.at > > @@ -14873,7 +14873,7 @@ ovn_start > > # Physical network: > > # Tw0 hypervisors hv[12]. > > # hv1 hosts vif sw0-p0. > > -# hv1 hosts vif sw1-p0. > > +# hv2 hosts vif sw1-p0 and sw0-p1 > > > > send_icmp_packet() { > > local inport=$1 hv=$2 eth_src=$3 eth_dst=$4 ipv4_src=$5 ipv4_dst=$6 > ip_chksum=$7 data=$8 > > @@ -14973,6 +14973,9 @@ ovn-nbctl lsp-add sw0 sw0-p1 \ > > [...] > > > > > # Create FIP on sw0-p0, add a route on logical router pipeline and > > # ARP request for a unkwon destination is sent using FIP MAC/IP > > +ovn-nbctl lr-nat-del lr0 snat > > ovn-nbctl lr-nat-add lr0 dnat_and_snat 172.16.1.2 192.168.1.3 sw0-p1 > f0:00:00:01:02:04 > > ovn-nbctl lr-route-add lr0 172.16.2.0/24 172.16.1.11 > > > > dst_ip=$(ip_to_hex 172 16 2 10) > > fip_ip=$(ip_to_hex 172 16 1 2) > > src_ip=$(ip_to_hex 192 168 1 3) > > -gw_router=$(ip_to_hex 172 16 1 11) > > -send_icmp_packet 2 2 f0110203 $router_mac0 $src_ip $dst_ip > $data > > -echo $(get_arp_req f0010204 $fip_ip $gw_router) >> expected > > +gw_router_ip=$(ip_to_hex 172 16 1 11) > > +gw_router_mac=f0010a0a > > +send_icmp_packet 2 2 f0110203 $router_mac0 $src_ip $dst_ip 0c1b > $data > > [ANKUR]: Confused by above line, ofport 2 on hv2 is sw1-p0, whereas i > believe we wanted port to use sw0-p1, i.e ofport3 > > Hi Ankur, > > we are using hv2-vif2 here, so sw0-p1 > > > +echo $(get_arp_req f0010204 $fip_ip $gw_router_ip) >> expected > > +send_arp_reply 2 1 $gw_router_mac f0010204 $gw_router_ip $fip_ip > > +echo > "${gw_router_mac}f00102040800451c4000fe0121b4${fip_ip}${dst_ip}${data}" > >> expected > > > > OVN_CHECK_PACKETS([hv2/vif1-tx.pcap], [expected]) > > > > [ANKUR]: May be i am missing something, but how are we validating > buffering here. We should be validating the pcap on some external endpoint > right, > > For example, generate a icmp packet from internal port to an external > endpoint, simulate an ARP reply and then look at tx pcap on destination. > > this is what I am currently doing since: > - we are sending an ICMP request from an internal port(sw0-p1 -- hv2-vif2) > for the external destination 172.16.2.10 > - the logical router buffers the outgoing ICMP request and generates > an ARP request using FIP IP/mac as src addresses ( > 172.16.1.2/f0:00:00:01:02:04) > for the external gw (172.16.1.11) > - we simulate an ARP reply from 172.16.1.11 > - we checks in hv2/vif1-tx.pcap (hv2-vif1 is associated with the external > interface) we have: > - ARP request > - ARP reply > - ICMP request with L2 destination address resolved > > is it what you are referring to? > > Regards, > Lorenzo > > > > > > > > -- > > 2.26.2 > > > > ___ > > dev mailing list > > d...@openvswitch.org > > > https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.openvswitch.org_mailman_listinfo_ovs-2Ddev=DwICAg=s883GpUCOChKOHiocYtGcg=mZwX9gFQgeJHzTg-68aCJgsODyUEVsHGFOfL90J6MJY=WlGoK4pEkybzFr5FvyLYn_x3hZuLSfQcHJVgmPbU548=UJvQpPo9180SVm6LdvHiFtsdKo6eGyatkCN8NxS4z4I= > ___ > dev mailing list > d...@openvswitch.org > https://mail.openvswitch.org/mailman/listinfo/ovs-dev > > ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Re: [ovs-dev] [PATCH ovn] test: add more tests to IP-buffering unit-test
> Hi Lorenzo, > > Thanks for the explanation. > Just need one more clarification, please find the same inline. > > Regards, > Ankur > > > From: Lorenzo Bianconi > Sent: Wednesday, June 3, 2020 1:47 AM > To: Ankur Sharma > Cc: ovs-dev@openvswitch.org > Subject: Re: [ovs-dev] [PATCH ovn] test: add more tests to IP-buffering > unit-test > > On Jun 03, Ankur Sharma wrote: > > Hi Lorenzo, > > > > Please find my comments inline. > > > > Regards, > > Ankur > > > > > > From: dev on behalf of Ankur Sharma > > > > Sent: Monday, June 1, 2020 9:05 PM > > To: Lorenzo Bianconi ; ovs-dev@openvswitch.org > > > > Subject: Re: [ovs-dev] [PATCH ovn] test: add more tests to IP-buffering > > unit-test > > > > Hi Lorenzo, > > > > Thanks a lot for the patch. > > I will get back on this by EOD PST tomorrow. > > > > Regards, > > Ankur > > > > From: Lorenzo Bianconi > > Sent: Friday, May 29, 2020 7:01 AM > > To: ovs-dev@openvswitch.org > > Cc: Ankur Sharma ; num...@ovn.org > > ; dce...@redhat.com > > Subject: [PATCH ovn] test: add more tests to IP-buffering unit-test > > > > Check the hv is sending the ICMP request using the FIP as src IP in > > a DVR scenario. Update previous tests introducing source NAT for > > distributed traffic cases > > > > Signed-off-by: Lorenzo Bianconi > > --- > > tests/ovn.at | 21 ++--- > > 1 file changed, 14 insertions(+), 7 deletions(-) > > > > diff --git a/tests/ovn.at b/tests/ovn.at > > index 15b40ca1e..57f632c4e 100644 > > --- a/tests/ovn.at > > +++ b/tests/ovn.at > > @@ -14873,7 +14873,7 @@ ovn_start > > # Physical network: > > # Tw0 hypervisors hv[12]. > > # hv1 hosts vif sw0-p0. > > -# hv1 hosts vif sw1-p0. > > +# hv2 hosts vif sw1-p0 and sw0-p1 > > > > send_icmp_packet() { > > local inport=$1 hv=$2 eth_src=$3 eth_dst=$4 ipv4_src=$5 ipv4_dst=$6 > > ip_chksum=$7 data=$8 > > @@ -14973,6 +14973,9 @@ ovn-nbctl lsp-add sw0 sw0-p1 \ > > [...] > > > > > # Create FIP on sw0-p0, add a route on logical router pipeline and > > # ARP request for a unkwon destination is sent using FIP MAC/IP > > +ovn-nbctl lr-nat-del lr0 snat > > ovn-nbctl lr-nat-add lr0 dnat_and_snat 172.16.1.2 192.168.1.3 sw0-p1 > > f0:00:00:01:02:04 > > ovn-nbctl lr-route-add lr0 172.16.2.0/24 172.16.1.11 > > > > dst_ip=$(ip_to_hex 172 16 2 10) > > fip_ip=$(ip_to_hex 172 16 1 2) > > src_ip=$(ip_to_hex 192 168 1 3) > > -gw_router=$(ip_to_hex 172 16 1 11) > > -send_icmp_packet 2 2 f0110203 $router_mac0 $src_ip $dst_ip $data > > -echo $(get_arp_req f0010204 $fip_ip $gw_router) >> expected > > +gw_router_ip=$(ip_to_hex 172 16 1 11) > > +gw_router_mac=f0010a0a > > +send_icmp_packet 2 2 f0110203 $router_mac0 $src_ip $dst_ip 0c1b $data > > [ANKUR]: Confused by above line, ofport 2 on hv2 is sw1-p0, whereas i > > believe we wanted port to use sw0-p1, i.e ofport3 > > Hi Ankur, > > we are using hv2-vif2 here, so sw0-p1 > > [ANKUR]: > I am still confused here, yes desired source port should be sw0-p1, i.e > hv2-vif2. > However, ofport for same is 3, where as we are using 2 here. Hi Ankur, IIUC your question, ofport-request=3 is just a 'suggestion' for ofport id to ovs, the value is arbitrary. Regards, Lorenzo > > ovs-vsctl -- add-port br-int hv2-vif2 -- \ > set interface hv2-vif2 external-ids:iface-id=sw0-p1 \ > options:tx_pcap=hv2/vif2-tx.pcap \ > options:rxq_pcap=hv2/vif2-rx.pcap \ > ofport-request=3 > > > > +echo $(get_arp_req f0010204 $fip_ip $gw_router_ip) >> expected > > +send_arp_reply 2 1 $gw_router_mac f0010204 $gw_router_ip $fip_ip > > +echo > > "${gw_router_mac}f00102040800451c4000fe0121b4${fip_ip}${dst_ip}${data}" > > >> expected > > > > OVN_CHECK_PACKETS([hv2/vif1-tx.pcap], [expected]) > > > > [ANKUR]: May be i am missing something, but how are we validating buffering > > here. We should be validating the pcap on some external endpoint right, > > For example, generate a icmp packet from internal port to an external > > endpoint, simulate an ARP reply and then look at tx pcap on destination. > > this is what I am currently doing since: > - we are sending an ICMP request from an internal port(sw0-p1 -- hv2-vif2) > for
Re: [ovs-dev] [PATCH ovn] test: add more tests to IP-buffering unit-test
Hi Lorenzo, Thanks for the explanation. Just need one more clarification, please find the same inline. Regards, Ankur From: Lorenzo Bianconi Sent: Wednesday, June 3, 2020 1:47 AM To: Ankur Sharma Cc: ovs-dev@openvswitch.org Subject: Re: [ovs-dev] [PATCH ovn] test: add more tests to IP-buffering unit-test On Jun 03, Ankur Sharma wrote: > Hi Lorenzo, > > Please find my comments inline. > > Regards, > Ankur > > > From: dev on behalf of Ankur Sharma > > Sent: Monday, June 1, 2020 9:05 PM > To: Lorenzo Bianconi ; ovs-dev@openvswitch.org > > Subject: Re: [ovs-dev] [PATCH ovn] test: add more tests to IP-buffering > unit-test > > Hi Lorenzo, > > Thanks a lot for the patch. > I will get back on this by EOD PST tomorrow. > > Regards, > Ankur > > From: Lorenzo Bianconi > Sent: Friday, May 29, 2020 7:01 AM > To: ovs-dev@openvswitch.org > Cc: Ankur Sharma ; num...@ovn.org ; > dce...@redhat.com > Subject: [PATCH ovn] test: add more tests to IP-buffering unit-test > > Check the hv is sending the ICMP request using the FIP as src IP in > a DVR scenario. Update previous tests introducing source NAT for > distributed traffic cases > > Signed-off-by: Lorenzo Bianconi > --- > tests/ovn.at | 21 ++--- > 1 file changed, 14 insertions(+), 7 deletions(-) > > diff --git a/tests/ovn.at b/tests/ovn.at > index 15b40ca1e..57f632c4e 100644 > --- a/tests/ovn.at > +++ b/tests/ovn.at > @@ -14873,7 +14873,7 @@ ovn_start > # Physical network: > # Tw0 hypervisors hv[12]. > # hv1 hosts vif sw0-p0. > -# hv1 hosts vif sw1-p0. > +# hv2 hosts vif sw1-p0 and sw0-p1 > > send_icmp_packet() { > local inport=$1 hv=$2 eth_src=$3 eth_dst=$4 ipv4_src=$5 ipv4_dst=$6 > ip_chksum=$7 data=$8 > @@ -14973,6 +14973,9 @@ ovn-nbctl lsp-add sw0 sw0-p1 \ [...] > > # Create FIP on sw0-p0, add a route on logical router pipeline and > # ARP request for a unkwon destination is sent using FIP MAC/IP > +ovn-nbctl lr-nat-del lr0 snat > ovn-nbctl lr-nat-add lr0 dnat_and_snat 172.16.1.2 192.168.1.3 sw0-p1 > f0:00:00:01:02:04 > ovn-nbctl lr-route-add lr0 172.16.2.0/24 172.16.1.11 > > dst_ip=$(ip_to_hex 172 16 2 10) > fip_ip=$(ip_to_hex 172 16 1 2) > src_ip=$(ip_to_hex 192 168 1 3) > -gw_router=$(ip_to_hex 172 16 1 11) > -send_icmp_packet 2 2 f0110203 $router_mac0 $src_ip $dst_ip $data > -echo $(get_arp_req f0010204 $fip_ip $gw_router) >> expected > +gw_router_ip=$(ip_to_hex 172 16 1 11) > +gw_router_mac=f0010a0a > +send_icmp_packet 2 2 f0110203 $router_mac0 $src_ip $dst_ip 0c1b $data > [ANKUR]: Confused by above line, ofport 2 on hv2 is sw1-p0, whereas i believe > we wanted port to use sw0-p1, i.e ofport3 Hi Ankur, we are using hv2-vif2 here, so sw0-p1 [ANKUR]: I am still confused here, yes desired source port should be sw0-p1, i.e hv2-vif2. However, ofport for same is 3, where as we are using 2 here. ovs-vsctl -- add-port br-int hv2-vif2 -- \ set interface hv2-vif2 external-ids:iface-id=sw0-p1 \ options:tx_pcap=hv2/vif2-tx.pcap \ options:rxq_pcap=hv2/vif2-rx.pcap \ ofport-request=3 > +echo $(get_arp_req f0010204 $fip_ip $gw_router_ip) >> expected > +send_arp_reply 2 1 $gw_router_mac f0010204 $gw_router_ip $fip_ip > +echo > "${gw_router_mac}f00102040800451c4000fe0121b4${fip_ip}${dst_ip}${data}" > >> expected > > OVN_CHECK_PACKETS([hv2/vif1-tx.pcap], [expected]) > > [ANKUR]: May be i am missing something, but how are we validating buffering > here. We should be validating the pcap on some external endpoint right, > For example, generate a icmp packet from internal port to an external > endpoint, simulate an ARP reply and then look at tx pcap on destination. this is what I am currently doing since: - we are sending an ICMP request from an internal port(sw0-p1 -- hv2-vif2) for the external destination 172.16.2.10 - the logical router buffers the outgoing ICMP request and generates an ARP request using FIP IP/mac as src addresses (172.16.1.2/f0:00:00:01:02:04) for the external gw (172.16.1.11) - we simulate an ARP reply from 172.16.1.11 - we checks in hv2/vif1-tx.pcap (hv2-vif1 is associated with the external interface) we have: - ARP request - ARP reply - ICMP request with L2 destination address resolved is it what you are referring to? Regards, Lorenzo [ANKUR] Got it now, we are simulating sw1-p0 as the gateway. Makes sense, this part is clear to me. > > > -- > 2.26.2 > > ___ > dev mailing list > d...@openvswitch.org > https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.openvsw
Re: [ovs-dev] [PATCH ovn] test: add more tests to IP-buffering unit-test
On Jun 03, Ankur Sharma wrote: > Hi Lorenzo, > > Please find my comments inline. > > Regards, > Ankur > > > From: dev on behalf of Ankur Sharma > > Sent: Monday, June 1, 2020 9:05 PM > To: Lorenzo Bianconi ; ovs-dev@openvswitch.org > > Subject: Re: [ovs-dev] [PATCH ovn] test: add more tests to IP-buffering > unit-test > > Hi Lorenzo, > > Thanks a lot for the patch. > I will get back on this by EOD PST tomorrow. > > Regards, > Ankur > > From: Lorenzo Bianconi > Sent: Friday, May 29, 2020 7:01 AM > To: ovs-dev@openvswitch.org > Cc: Ankur Sharma ; num...@ovn.org ; > dce...@redhat.com > Subject: [PATCH ovn] test: add more tests to IP-buffering unit-test > > Check the hv is sending the ICMP request using the FIP as src IP in > a DVR scenario. Update previous tests introducing source NAT for > distributed traffic cases > > Signed-off-by: Lorenzo Bianconi > --- > tests/ovn.at | 21 ++--- > 1 file changed, 14 insertions(+), 7 deletions(-) > > diff --git a/tests/ovn.at b/tests/ovn.at > index 15b40ca1e..57f632c4e 100644 > --- a/tests/ovn.at > +++ b/tests/ovn.at > @@ -14873,7 +14873,7 @@ ovn_start > # Physical network: > # Tw0 hypervisors hv[12]. > # hv1 hosts vif sw0-p0. > -# hv1 hosts vif sw1-p0. > +# hv2 hosts vif sw1-p0 and sw0-p1 > > send_icmp_packet() { > local inport=$1 hv=$2 eth_src=$3 eth_dst=$4 ipv4_src=$5 ipv4_dst=$6 > ip_chksum=$7 data=$8 > @@ -14973,6 +14973,9 @@ ovn-nbctl lsp-add sw0 sw0-p1 \ [...] > > # Create FIP on sw0-p0, add a route on logical router pipeline and > # ARP request for a unkwon destination is sent using FIP MAC/IP > +ovn-nbctl lr-nat-del lr0 snat > ovn-nbctl lr-nat-add lr0 dnat_and_snat 172.16.1.2 192.168.1.3 sw0-p1 > f0:00:00:01:02:04 > ovn-nbctl lr-route-add lr0 172.16.2.0/24 172.16.1.11 > > dst_ip=$(ip_to_hex 172 16 2 10) > fip_ip=$(ip_to_hex 172 16 1 2) > src_ip=$(ip_to_hex 192 168 1 3) > -gw_router=$(ip_to_hex 172 16 1 11) > -send_icmp_packet 2 2 f0110203 $router_mac0 $src_ip $dst_ip $data > -echo $(get_arp_req f0010204 $fip_ip $gw_router) >> expected > +gw_router_ip=$(ip_to_hex 172 16 1 11) > +gw_router_mac=f0010a0a > +send_icmp_packet 2 2 f0110203 $router_mac0 $src_ip $dst_ip 0c1b $data > [ANKUR]: Confused by above line, ofport 2 on hv2 is sw1-p0, whereas i believe > we wanted port to use sw0-p1, i.e ofport3 Hi Ankur, we are using hv2-vif2 here, so sw0-p1 > +echo $(get_arp_req f0010204 $fip_ip $gw_router_ip) >> expected > +send_arp_reply 2 1 $gw_router_mac f0010204 $gw_router_ip $fip_ip > +echo > "${gw_router_mac}f00102040800451c4000fe0121b4${fip_ip}${dst_ip}${data}" > >> expected > > OVN_CHECK_PACKETS([hv2/vif1-tx.pcap], [expected]) > > [ANKUR]: May be i am missing something, but how are we validating buffering > here. We should be validating the pcap on some external endpoint right, > For example, generate a icmp packet from internal port to an external > endpoint, simulate an ARP reply and then look at tx pcap on destination. this is what I am currently doing since: - we are sending an ICMP request from an internal port(sw0-p1 -- hv2-vif2) for the external destination 172.16.2.10 - the logical router buffers the outgoing ICMP request and generates an ARP request using FIP IP/mac as src addresses (172.16.1.2/f0:00:00:01:02:04) for the external gw (172.16.1.11) - we simulate an ARP reply from 172.16.1.11 - we checks in hv2/vif1-tx.pcap (hv2-vif1 is associated with the external interface) we have: - ARP request - ARP reply - ICMP request with L2 destination address resolved is it what you are referring to? Regards, Lorenzo > > > -- > 2.26.2 > > ___ > dev mailing list > d...@openvswitch.org > https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.openvswitch.org_mailman_listinfo_ovs-2Ddev=DwICAg=s883GpUCOChKOHiocYtGcg=mZwX9gFQgeJHzTg-68aCJgsODyUEVsHGFOfL90J6MJY=WlGoK4pEkybzFr5FvyLYn_x3hZuLSfQcHJVgmPbU548=UJvQpPo9180SVm6LdvHiFtsdKo6eGyatkCN8NxS4z4I= ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Re: [ovs-dev] [PATCH ovn] test: add more tests to IP-buffering unit-test
Hi Lorenzo, Please find my comments inline. Regards, Ankur From: dev on behalf of Ankur Sharma Sent: Monday, June 1, 2020 9:05 PM To: Lorenzo Bianconi ; ovs-dev@openvswitch.org Subject: Re: [ovs-dev] [PATCH ovn] test: add more tests to IP-buffering unit-test Hi Lorenzo, Thanks a lot for the patch. I will get back on this by EOD PST tomorrow. Regards, Ankur From: Lorenzo Bianconi Sent: Friday, May 29, 2020 7:01 AM To: ovs-dev@openvswitch.org Cc: Ankur Sharma ; num...@ovn.org ; dce...@redhat.com Subject: [PATCH ovn] test: add more tests to IP-buffering unit-test Check the hv is sending the ICMP request using the FIP as src IP in a DVR scenario. Update previous tests introducing source NAT for distributed traffic cases Signed-off-by: Lorenzo Bianconi --- tests/ovn.at | 21 ++--- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/tests/ovn.at b/tests/ovn.at index 15b40ca1e..57f632c4e 100644 --- a/tests/ovn.at +++ b/tests/ovn.at @@ -14873,7 +14873,7 @@ ovn_start # Physical network: # Tw0 hypervisors hv[12]. # hv1 hosts vif sw0-p0. -# hv1 hosts vif sw1-p0. +# hv2 hosts vif sw1-p0 and sw0-p1 send_icmp_packet() { local inport=$1 hv=$2 eth_src=$3 eth_dst=$4 ipv4_src=$5 ipv4_dst=$6 ip_chksum=$7 data=$8 @@ -14973,6 +14973,9 @@ ovn-nbctl lsp-add sw0 sw0-p1 \ ovn-nbctl lsp-add sw1 sw1-p0 \ -- lsp-set-addresses sw1-p0 unknown +ovn-nbctl lr-nat-add lr0 snat 172.16.1.1 192.168.1.0/24 +ovn-nbctl lr-nat-add lr0 snat 2002::1 2001::/64 + OVN_POPULATE_ARP ovn-nbctl --wait=hv sync @@ -14997,15 +15000,15 @@ dst_ip6=20020010 data=0800bee4391a0001 -send_icmp_packet 1 1 $src_mac $router_mac0 $src_ip $dst_ip $data +send_icmp_packet 1 1 $src_mac $router_mac0 $src_ip $dst_ip 0d1c $data send_arp_reply 2 1 $dst_mac $router_mac1 $dst_ip $router_ip echo $(get_arp_req $router_mac1 $router_ip $dst_ip) > expected -echo "${dst_mac}${router_mac1}0800451c4000fe010100${src_ip}${dst_ip}${data}" >> expected +echo "${dst_mac}${router_mac1}0800451c4000fe0122b5${router_ip}${dst_ip}${data}" >> expected OVN_CHECK_PACKETS([hv2/vif1-tx.pcap], [expected]) nd_ip=ff020001ff10 -ip6_hdr=60083afe${src_ip6}${dst_ip6} +ip6_hdr=60083afe${router_ip6}${dst_ip6} send_icmp6_packet 1 1 $src_mac $router_mac0 $src_ip6 $dst_ip6 echo $(get_nd $router_mac1 $nd_src_ip6 $nd_ip $dst_ip6) >> expected @@ -15016,15 +15019,19 @@ OVN_CHECK_PACKETS([hv2/vif1-tx.pcap], [expected]) # Create FIP on sw0-p0, add a route on logical router pipeline and # ARP request for a unkwon destination is sent using FIP MAC/IP +ovn-nbctl lr-nat-del lr0 snat ovn-nbctl lr-nat-add lr0 dnat_and_snat 172.16.1.2 192.168.1.3 sw0-p1 f0:00:00:01:02:04 ovn-nbctl lr-route-add lr0 172.16.2.0/24 172.16.1.11 dst_ip=$(ip_to_hex 172 16 2 10) fip_ip=$(ip_to_hex 172 16 1 2) src_ip=$(ip_to_hex 192 168 1 3) -gw_router=$(ip_to_hex 172 16 1 11) -send_icmp_packet 2 2 f0110203 $router_mac0 $src_ip $dst_ip $data -echo $(get_arp_req f0010204 $fip_ip $gw_router) >> expected +gw_router_ip=$(ip_to_hex 172 16 1 11) +gw_router_mac=f0010a0a +send_icmp_packet 2 2 f0110203 $router_mac0 $src_ip $dst_ip 0c1b $data [ANKUR]: Confused by above line, ofport 2 on hv2 is sw1-p0, whereas i believe we wanted port to use sw0-p1, i.e ofport3 +echo $(get_arp_req f0010204 $fip_ip $gw_router_ip) >> expected +send_arp_reply 2 1 $gw_router_mac f0010204 $gw_router_ip $fip_ip +echo "${gw_router_mac}f00102040800451c4000fe0121b4${fip_ip}${dst_ip}${data}" >> expected OVN_CHECK_PACKETS([hv2/vif1-tx.pcap], [expected]) [ANKUR]: May be i am missing something, but how are we validating buffering here. We should be validating the pcap on some external endpoint right, For example, generate a icmp packet from internal port to an external endpoint, simulate an ARP reply and then look at tx pcap on destination. -- 2.26.2 ___ dev mailing list d...@openvswitch.org https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.openvswitch.org_mailman_listinfo_ovs-2Ddev=DwICAg=s883GpUCOChKOHiocYtGcg=mZwX9gFQgeJHzTg-68aCJgsODyUEVsHGFOfL90J6MJY=WlGoK4pEkybzFr5FvyLYn_x3hZuLSfQcHJVgmPbU548=UJvQpPo9180SVm6LdvHiFtsdKo6eGyatkCN8NxS4z4I= ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Re: [ovs-dev] [PATCH ovn] test: add more tests to IP-buffering unit-test
Hi Lorenzo, Thanks a lot for the patch. I will get back on this by EOD PST tomorrow. Regards, Ankur From: Lorenzo Bianconi Sent: Friday, May 29, 2020 7:01 AM To: ovs-dev@openvswitch.org Cc: Ankur Sharma ; num...@ovn.org ; dce...@redhat.com Subject: [PATCH ovn] test: add more tests to IP-buffering unit-test Check the hv is sending the ICMP request using the FIP as src IP in a DVR scenario. Update previous tests introducing source NAT for distributed traffic cases Signed-off-by: Lorenzo Bianconi --- tests/ovn.at | 21 ++--- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/tests/ovn.at b/tests/ovn.at index 15b40ca1e..57f632c4e 100644 --- a/tests/ovn.at +++ b/tests/ovn.at @@ -14873,7 +14873,7 @@ ovn_start # Physical network: # Tw0 hypervisors hv[12]. # hv1 hosts vif sw0-p0. -# hv1 hosts vif sw1-p0. +# hv2 hosts vif sw1-p0 and sw0-p1 send_icmp_packet() { local inport=$1 hv=$2 eth_src=$3 eth_dst=$4 ipv4_src=$5 ipv4_dst=$6 ip_chksum=$7 data=$8 @@ -14973,6 +14973,9 @@ ovn-nbctl lsp-add sw0 sw0-p1 \ ovn-nbctl lsp-add sw1 sw1-p0 \ -- lsp-set-addresses sw1-p0 unknown +ovn-nbctl lr-nat-add lr0 snat 172.16.1.1 192.168.1.0/24 +ovn-nbctl lr-nat-add lr0 snat 2002::1 2001::/64 + OVN_POPULATE_ARP ovn-nbctl --wait=hv sync @@ -14997,15 +15000,15 @@ dst_ip6=20020010 data=0800bee4391a0001 -send_icmp_packet 1 1 $src_mac $router_mac0 $src_ip $dst_ip $data +send_icmp_packet 1 1 $src_mac $router_mac0 $src_ip $dst_ip 0d1c $data send_arp_reply 2 1 $dst_mac $router_mac1 $dst_ip $router_ip echo $(get_arp_req $router_mac1 $router_ip $dst_ip) > expected -echo "${dst_mac}${router_mac1}0800451c4000fe010100${src_ip}${dst_ip}${data}" >> expected +echo "${dst_mac}${router_mac1}0800451c4000fe0122b5${router_ip}${dst_ip}${data}" >> expected OVN_CHECK_PACKETS([hv2/vif1-tx.pcap], [expected]) nd_ip=ff020001ff10 -ip6_hdr=60083afe${src_ip6}${dst_ip6} +ip6_hdr=60083afe${router_ip6}${dst_ip6} send_icmp6_packet 1 1 $src_mac $router_mac0 $src_ip6 $dst_ip6 echo $(get_nd $router_mac1 $nd_src_ip6 $nd_ip $dst_ip6) >> expected @@ -15016,15 +15019,19 @@ OVN_CHECK_PACKETS([hv2/vif1-tx.pcap], [expected]) # Create FIP on sw0-p0, add a route on logical router pipeline and # ARP request for a unkwon destination is sent using FIP MAC/IP +ovn-nbctl lr-nat-del lr0 snat ovn-nbctl lr-nat-add lr0 dnat_and_snat 172.16.1.2 192.168.1.3 sw0-p1 f0:00:00:01:02:04 ovn-nbctl lr-route-add lr0 172.16.2.0/24 172.16.1.11 dst_ip=$(ip_to_hex 172 16 2 10) fip_ip=$(ip_to_hex 172 16 1 2) src_ip=$(ip_to_hex 192 168 1 3) -gw_router=$(ip_to_hex 172 16 1 11) -send_icmp_packet 2 2 f0110203 $router_mac0 $src_ip $dst_ip $data -echo $(get_arp_req f0010204 $fip_ip $gw_router) >> expected +gw_router_ip=$(ip_to_hex 172 16 1 11) +gw_router_mac=f0010a0a +send_icmp_packet 2 2 f0110203 $router_mac0 $src_ip $dst_ip 0c1b $data +echo $(get_arp_req f0010204 $fip_ip $gw_router_ip) >> expected +send_arp_reply 2 1 $gw_router_mac f0010204 $gw_router_ip $fip_ip +echo "${gw_router_mac}f00102040800451c4000fe0121b4${fip_ip}${dst_ip}${data}" >> expected OVN_CHECK_PACKETS([hv2/vif1-tx.pcap], [expected]) -- 2.26.2 ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
[ovs-dev] [PATCH ovn] test: add more tests to IP-buffering unit-test
Check the hv is sending the ICMP request using the FIP as src IP in a DVR scenario. Update previous tests introducing source NAT for distributed traffic cases Signed-off-by: Lorenzo Bianconi --- tests/ovn.at | 21 ++--- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/tests/ovn.at b/tests/ovn.at index 15b40ca1e..57f632c4e 100644 --- a/tests/ovn.at +++ b/tests/ovn.at @@ -14873,7 +14873,7 @@ ovn_start # Physical network: # Tw0 hypervisors hv[12]. # hv1 hosts vif sw0-p0. -# hv1 hosts vif sw1-p0. +# hv2 hosts vif sw1-p0 and sw0-p1 send_icmp_packet() { local inport=$1 hv=$2 eth_src=$3 eth_dst=$4 ipv4_src=$5 ipv4_dst=$6 ip_chksum=$7 data=$8 @@ -14973,6 +14973,9 @@ ovn-nbctl lsp-add sw0 sw0-p1 \ ovn-nbctl lsp-add sw1 sw1-p0 \ -- lsp-set-addresses sw1-p0 unknown +ovn-nbctl lr-nat-add lr0 snat 172.16.1.1 192.168.1.0/24 +ovn-nbctl lr-nat-add lr0 snat 2002::1 2001::/64 + OVN_POPULATE_ARP ovn-nbctl --wait=hv sync @@ -14997,15 +15000,15 @@ dst_ip6=20020010 data=0800bee4391a0001 -send_icmp_packet 1 1 $src_mac $router_mac0 $src_ip $dst_ip $data +send_icmp_packet 1 1 $src_mac $router_mac0 $src_ip $dst_ip 0d1c $data send_arp_reply 2 1 $dst_mac $router_mac1 $dst_ip $router_ip echo $(get_arp_req $router_mac1 $router_ip $dst_ip) > expected -echo "${dst_mac}${router_mac1}0800451c4000fe010100${src_ip}${dst_ip}${data}" >> expected +echo "${dst_mac}${router_mac1}0800451c4000fe0122b5${router_ip}${dst_ip}${data}" >> expected OVN_CHECK_PACKETS([hv2/vif1-tx.pcap], [expected]) nd_ip=ff020001ff10 -ip6_hdr=60083afe${src_ip6}${dst_ip6} +ip6_hdr=60083afe${router_ip6}${dst_ip6} send_icmp6_packet 1 1 $src_mac $router_mac0 $src_ip6 $dst_ip6 echo $(get_nd $router_mac1 $nd_src_ip6 $nd_ip $dst_ip6) >> expected @@ -15016,15 +15019,19 @@ OVN_CHECK_PACKETS([hv2/vif1-tx.pcap], [expected]) # Create FIP on sw0-p0, add a route on logical router pipeline and # ARP request for a unkwon destination is sent using FIP MAC/IP +ovn-nbctl lr-nat-del lr0 snat ovn-nbctl lr-nat-add lr0 dnat_and_snat 172.16.1.2 192.168.1.3 sw0-p1 f0:00:00:01:02:04 ovn-nbctl lr-route-add lr0 172.16.2.0/24 172.16.1.11 dst_ip=$(ip_to_hex 172 16 2 10) fip_ip=$(ip_to_hex 172 16 1 2) src_ip=$(ip_to_hex 192 168 1 3) -gw_router=$(ip_to_hex 172 16 1 11) -send_icmp_packet 2 2 f0110203 $router_mac0 $src_ip $dst_ip $data -echo $(get_arp_req f0010204 $fip_ip $gw_router) >> expected +gw_router_ip=$(ip_to_hex 172 16 1 11) +gw_router_mac=f0010a0a +send_icmp_packet 2 2 f0110203 $router_mac0 $src_ip $dst_ip 0c1b $data +echo $(get_arp_req f0010204 $fip_ip $gw_router_ip) >> expected +send_arp_reply 2 1 $gw_router_mac f0010204 $gw_router_ip $fip_ip +echo "${gw_router_mac}f00102040800451c4000fe0121b4${fip_ip}${dst_ip}${data}" >> expected OVN_CHECK_PACKETS([hv2/vif1-tx.pcap], [expected]) -- 2.26.2 ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev