> 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 <ovs-dev-boun...@openvswitch.org> on behalf of Ankur Sharma > > <ankur.sha...@nutanix.com> > > Sent: Monday, June 1, 2020 9:05 PM > > To: Lorenzo Bianconi <lorenzo.bianc...@redhat.com>; ovs-dev@openvswitch.org > > <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 <lorenzo.bianc...@redhat.com> > > Sent: Friday, May 29, 2020 7:01 AM > > To: ovs-dev@openvswitch.org <ovs-dev@openvswitch.org> > > Cc: Ankur Sharma <ankur.sha...@nutanix.com>; num...@ovn.org > > <num...@ovn.org>; dce...@redhat.com <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 <lorenzo.bianc...@redhat.com> > > --- > > 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 f00000110203 $router_mac0 $src_ip $dst_ip 0000 $data > > -echo $(get_arp_req f00000010204 $fip_ip $gw_router) >> expected > > +gw_router_ip=$(ip_to_hex 172 16 1 11) > > +gw_router_mac=f00000010a0a > > +send_icmp_packet 2 2 f00000110203 $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 f00000010204 $fip_ip $gw_router_ip) >> expected > > +send_arp_reply 2 1 $gw_router_mac f00000010204 $gw_router_ip $fip_ip > > +echo > > "${gw_router_mac}f0000001020408004500001c00004000fe0121b4${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.openvswitch.org_mailman_listinfo_ovs-2Ddev&d=DwICAg&c=s883GpUCOChKOHiocYtGcg&r=mZwX9gFQgeJHzTg-68aCJgsODyUEVsHGFOfL90J6MJY&m=WlGoK4pEkybzFr5FvyLYn_x3hZuLSfQcHJVgmPbU548&s=UJvQpPo9180SVm6LdvHiFtsdKo6eGyatkCN8NxS4z4I&e= _______________________________________________ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev