From patchwork Fri Feb 24 11:04:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Felix Huettner X-Patchwork-Id: 1747416 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=2605:bc80:3010::138; helo=smtp1.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=mail.schwarz header.i=@mail.schwarz header.a=rsa-sha256 header.s=selector1 header.b=uWLjGuLw; dkim-atps=neutral Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PNRq73bwrz2461 for ; Fri, 24 Feb 2023 22:04:19 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id A9B8381313; Fri, 24 Feb 2023 11:04:17 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org A9B8381313 Authentication-Results: smtp1.osuosl.org; dkim=fail reason="signature verification failed" (2048-bit key, unprotected) header.d=mail.schwarz header.i=@mail.schwarz header.a=rsa-sha256 header.s=selector1 header.b=uWLjGuLw X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MC-JSZpmyxA8; Fri, 24 Feb 2023 11:04:16 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp1.osuosl.org (Postfix) with ESMTPS id AC0FB8126B; Fri, 24 Feb 2023 11:04:15 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org AC0FB8126B Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 7B864C0070; Fri, 24 Feb 2023 11:04:15 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists.linuxfoundation.org (Postfix) with ESMTP id 21268C002B for ; Fri, 24 Feb 2023 11:04:14 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id E3C9840603 for ; Fri, 24 Feb 2023 11:04:13 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org E3C9840603 Authentication-Results: smtp2.osuosl.org; dkim=pass (2048-bit key, unprotected) header.d=mail.schwarz header.i=@mail.schwarz header.a=rsa-sha256 header.s=selector1 header.b=uWLjGuLw X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id fpa_MzmrZpC8 for ; Fri, 24 Feb 2023 11:04:12 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 46F7B405F3 Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on20702.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe1a::702]) by smtp2.osuosl.org (Postfix) with ESMTPS id 46F7B405F3 for ; Fri, 24 Feb 2023 11:04:12 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Zlimz6bxBaTLTd4gTH3cf0OXvzgFWgP1+EEHkgp5EKh1N4GVF5rTFA/jAxxmbNPenBfWNqdXAHdhsIfSzMZQ9PYX9GhINybJjRQ6DRF1N3e7tLf81XQTRIUVuMgPl7aAJV0jRKsHP8z61l061EsKxMlwc3lR171bYO7PXPAoIMq+FXry9ce54dAiKaVe+ENNsQ2df8HTCy4D1thtV/acsMxH2hNCukdfojrVZRI2+0gKpuU4hdtW6kjMazzH9FJxaiQPizJeJljJ49bsKn60Qm4OS0s2cvu82e3bhm8UQ7WluqlDvYY/bmt9sy2zqHc4E9XLzETETCT7PMVV+JKxpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=x/NsQTeZbqCY+rabHhKW6OyYvDWeys8vgvAa9p1ISO0=; b=KCMsNFW2GgddovdUjt26ySiXXZ5Cr84iVRxjiNQmH3yYKPL3reA75SI0/0DZ6LKwf5JkoCrRvHmd8c3a/WTb34MFFJ5/Lzvra9fofYTguKiw+OL+OJ6D2ntY+w+O6rrQIWMLsJn4uZ+OzqN5UlkL2fOOOxtILenSzxYuG1FyS0plFdf5nYxNC+XB1qi3kP8GAqM0goKWafnjCmXaCFR1acBTAEZVuR0GvlAT9r9iIy+DZGBhQ5Cl/Axw4njiRhHxdzq0GmYZXEoQt0GkBR1DR6hSaXDrO/PcUeIa3nQHTxrsSnCfci5ohqfaU3TtZe4xaAZmwqoT2VhrSIRThOUBeA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mail.schwarz; dmarc=pass action=none header.from=mail.schwarz; dkim=pass header.d=mail.schwarz; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mail.schwarz; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=x/NsQTeZbqCY+rabHhKW6OyYvDWeys8vgvAa9p1ISO0=; b=uWLjGuLwHerioolv0yXU/ssRU8Ez840tbYCgDPaqigl+ZZGdtDIEOXw2yIf9R9zaqTAI/SgqSPs6GoBv5yoOX8978OaWL+lcR3jNRP9GHYWx7x6d9vZ8hVk4heDKhF/tI6k3tW30nwap9+9+Yiy03sMvcp2edkIV39x+4GGn/qFGt5sO5cSACXWvBPAz6wuT5BWIJjVq0EMUDsC2g8wdi/k8xa65JHqWnrJz99ZtXBvJw0KhIz/quc43FzSpOcJAkfuBAk3nHZHvtyGLdjVd6/9Ex2DqbSVq7MUjvADylsGA+Kq6E2KMrwu5yl2BeMLvVEuWSa6aRpV6UqaxOxn1WA== Received: from DU0PR10MB5244.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:10:34c::22) by DB8PR10MB3737.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:10:119::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.24; Fri, 24 Feb 2023 11:04:09 +0000 Received: from DU0PR10MB5244.EURPRD10.PROD.OUTLOOK.COM ([fe80::5eaa:450a:b695:ad4a]) by DU0PR10MB5244.EURPRD10.PROD.OUTLOOK.COM ([fe80::5eaa:450a:b695:ad4a%5]) with mapi id 15.20.6134.024; Fri, 24 Feb 2023 11:04:09 +0000 To: "dev@openvswitch.org" Thread-Topic: [PATCH ovn] northd: add router broadcast option to logical switch Thread-Index: AdlIP3K25v5WDGDHQf63ooXlgaetYQ== Date: Fri, 24 Feb 2023 11:04:09 +0000 Message-ID: Accept-Language: de-DE, en-US Content-Language: de-DE X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=mail.schwarz; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DU0PR10MB5244:EE_|DB8PR10MB3737:EE_ x-ms-office365-filtering-correlation-id: ee37cc71-fc80-49f9-1ddd-08db1656dacf x-mp-schwarz-dsgvo2: 1 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: OeGMfQLVqWqDhLcIfrweYvt1r1Uhr+geJzYgedNwK95D84wRk6xq6ggF0boWxYxFX3vX8qebbkfspBmdjOMVaijmDRNJPb2UjLmF6k7kVmRDPmK2AnAfpzKjbTjV0r7Na+Y4bc1+mJWkYT6QwyB6d1R8IW/kzF7dBF7ji1+MzvoKa3ykQ5lQf7MRAK2h+3iYglL/1FVCfvfoL0Ixvo+p+3s/ZNv30IgsOtTQqKCaajK8VpZPTz4guoftnLE3quVNQAIKGB9r/TN5uHtxaqhlSH1ip/rLmJMezMJw8n+6kpK2sJ18KsglcqQcHAh/ow0fwKwq5AlvUtxgL4pZ7QKK6fUgFg9IZbpdQ/Nj1a1iujCynq+CWYgWpvmZQsvv3XH32/bA3udMStVCQvcQKKyF04HXeLJhaH9dcmpsy0pc6L76dJerlP77ToqRCKh4+ZrKSvJ0pCuE4CKn40s/pYwJIPO9/UthRs+iDm9uom3mLFgFkiNVvK+dcLFNt9m2Tt8soZEjCyUKA2vbWmRFn+Dyhe4wkcHRftwwNcVKJfPwEixoWL932arE1GbRQzJsRpfee7YLs74FWLVgqDSaoFhYEG+uh58spV6Gvls+AZDpX/LXUzRtS40Y47jB3z3d7Pcz0sd8BtBYKXe9eD/emE5fh4avICtoF48HKo3154o1NDNZtIJbQvr1q36Yc9Gn7V/lH2G5Nl5WP4UrqEGDVdRTTMDk5uJYj7yXeYHkbYecawk= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DU0PR10MB5244.EURPRD10.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(13230025)(4636009)(376002)(136003)(39860400002)(396003)(366004)(346002)(451199018)(83380400001)(66574015)(33656002)(38070700005)(122000001)(316002)(82960400001)(9686003)(186003)(71200400001)(6506007)(7696005)(41300700001)(478600001)(38100700002)(8936002)(2906002)(52536014)(5660300002)(55016003)(86362001)(8676002)(76116006)(6916009)(64756008)(66946007)(66446008)(66476007)(66556008)(46492015); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?csnMTT83e/iqEvf5AXt1kSJ?= =?iso-8859-1?q?qgDemx4E0BMdsAGe88PvyPcajAmsHG2NDw/erLB39M+WvIv+k7fSHSHdSRz6?= =?iso-8859-1?q?0+mZH0JEhmbWIJMVoqpWmxC2VNcR+ZnteIiYSw9uaSkVW9t2zWiaqlb7MNPy?= =?iso-8859-1?q?WvmSCoIjVt1wef7pLfLPQfMe6E8BPzoB46JDUfo2jauQwqxffd3vf0MnJkpd?= =?iso-8859-1?q?mCLTh9vMXrXJ9ECPyBcvACHWkm4E9x9WRUoGunqHGWyyHifbjeBNF1xk7RZW?= =?iso-8859-1?q?SzF1OzWyU4XFAsP0sO9FbIfBN9O+pa8nYdPrRVWHWhaV0AbdlvTsf7i5USCv?= =?iso-8859-1?q?CgCSJvUukYcHatm1oz5qrZ6jLTjvEZqxYqHpbmV9fD2xcOsVFgKYaTuhX9YW?= =?iso-8859-1?q?XRi5KWDsr1wnbR4bNSaJ9ezMc8cgPe3d1/7QjZj+Jy4SV4K+4oc+6T7Z/fyX?= =?iso-8859-1?q?7p63zYf//jN8uT5Z7wPODk6K94tmYFRljbeaNtmF/VVkSx+zETrOiTHSuC3b?= =?iso-8859-1?q?hc02scenRyJ3bW0ai+lotPo+in139Mg8YqabNj3vyRBBahx6erxa7JHWjMeO?= =?iso-8859-1?q?fucuQMtFRU3RXVUUJrrF1dEOVOVMtBKZtCBrJQcPJ01GHcI3AOdaYsnUJZPg?= =?iso-8859-1?q?eetxy1djwrjvIHLsGx+Z6+4LMK1FU+iXLoEZpUHzVMUQOq0hNJZ05g4ZZTb4?= =?iso-8859-1?q?uOLjgs3YhhwcgZCSyMkawAYCC0SAlUMsvj5FjqDv48XGNlatE4HHnUitd32d?= =?iso-8859-1?q?hEHv13aj/7GMSfIFaeSeby13b38hHa00Aow3mNC6iqmBXkzp1qpdY3CtNlp8?= =?iso-8859-1?q?nDKNyLQpXV5hv0nzULR7Ei89DTFUXCGekAgD6iPOlxkPeBsd5jQ7hqORJ6xB?= =?iso-8859-1?q?pUqmO+anpkCjLypw+LoinEgvV65OcZ1o2+PpeBTAWYTKm0Lte6b8VAO8ki+s?= =?iso-8859-1?q?akiyHX8CCQnjtVSnSGB5NFs1s9wzT0RnvMx86P9c7GBOyjUCZDkJ31MyALaJ?= =?iso-8859-1?q?njcxJ7EEWsCMg+E4oFCgrGbFyfNu5ptWtNmyLzlbFKg65ob1trVgt71Y2FlM?= =?iso-8859-1?q?uIqSc33Sop5Kj5Jd48r3YzxbwrlrzOp+QtjwN4qu160Bve+fdZ2d4+niXz/X?= =?iso-8859-1?q?gUVLCHETgq7EIgxoQnz9i2NhKQZkWQsw/ICD6U1+NM5ZThmxg3J/EI8ZpfbF?= =?iso-8859-1?q?QCl45/BhxhyIenWXdtbbzhjwIB/KY+h+axlV1iQ42FFLF+uTxM9hoT5QoYyX?= =?iso-8859-1?q?oiRV9KU6982ysUotHkSHd29nxEPAEWwpw2kLUFmp61l9ZNql5S4oH1oII0Yz?= =?iso-8859-1?q?QXdH3u7tIySV++mle0/7Pf6aJqvP+mtwC3J8PvfmgFMy+030E3yvYgbq1/rp?= =?iso-8859-1?q?qOuBhlBiYfcgLRIwNjnKIMucaNvbY4RczV7C/GKaugj+XTvPwb5F4fdOemGy?= =?iso-8859-1?q?kQb7C7UB8SJM8EGJz2cu9j/tkYOl02xEpMg9+I1Co0YgVXmDxoADEQQZQFGl?= =?iso-8859-1?q?nu6u/XkBE557MnPO47A+UeLva1MoYGYxJ5EV8VFW6eVnJseTULy2djQSXYku?= =?iso-8859-1?q?dnUrXdhAnP6wvJ8tns03J94uWYdZCdMO9vDMM6dMU4vUEbZZb2Iy68htcoMv?= =?iso-8859-1?q?ZxxrkrMqP1HQRA2ApeYa6DI8uxd4VvQoGsCr5zltMAnQUZzEZhVyW8bJ/ODG?= =?iso-8859-1?q?65UrgtfGKa2qpx34P04UJDLsvSSQINeZd+OCcsZePgg=3D=3D?= MIME-Version: 1.0 X-OriginatorOrg: mail.schwarz X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DU0PR10MB5244.EURPRD10.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-Network-Message-Id: ee37cc71-fc80-49f9-1ddd-08db1656dacf X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Feb 2023 11:04:09.6426 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: d04f4717-5a6e-4b98-b3f9-6918e0385f4c X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: F1N0F9FHF6tCYqXn89/rkN+Pc6UhL2djy5ZuzcaSNuQso6x9t8gzhQ1NnpGPrMQBfd9xky/H7j5Oul8GVJFRABQycvC6DJ5BHfyAgJkOhJU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR10MB3737 Subject: [ovs-dev] [PATCH ovn] northd: add router broadcast option to logical switch X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: =?iso-8859-1?q?Felix_H=FCttner?= via dev From: Felix Huettner Reply-To: =?iso-8859-1?q?Felix_H=FCttner?= Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" Assume the following setup: +----------------+ | Logical Router | | lr001 +-+ +----------------+ | | +----------------+ | | Logical Router | | +----------------+ +------------------+ | lr002 +-+-+ Logical Switch +-+ Phyiscal Network | +----------------+ | | ls-ext | | | | +----------------+ +------------------+ ... | | +----------------+ | | Logical Router | | | lr300 +-+ +----------------+ If a arp request for the ip of lr001 on ls-ext is now received it is only forwarded to that individual logical router. If we however now receive a arp request for an ip not used by any of lr001-lr300 we try to flood the arp request to all logical ports on ls-ext. With around 300 routers this causes the arp request to be dropped after some routers as we hit the 4096 resubmit limit. In the most cases forwarding the arp requests to the logical routers is pointless as we already know all of their ip addresses and they will therefor not be able to answer the arp requests anyway. Only if someone sends garps this is not the case. Then the request would need to be flooded to all logical routers. We can therefor not generally send these arp requests to MC_FLOOD_L2 as this would break garps. As we can also not detect garps we need to leave the solution to our users. To do this we introduce the other_config `broadcast-arps-to-all-routers` on logical switches (which is per default true). If set to false we add a logical flow that forwards arp requests where we do not know a specific target logical switch port to MC_FLOOD_L2, thereby bypassing all logical routers. Note that the testcase is quite flaky in the ci (as it takes verry long) but runs well locally. I'm unsure how to best proceed there. Signed-off-by: Felix Huettner --- northd/northd.c | 7 +++ northd/ovn-northd.8.xml | 7 +++ ovn-nb.xml | 12 +++++ tests/ovn.at | 114 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 140 insertions(+) -- 2.39.1 Diese E Mail enthält möglicherweise vertrauliche Inhalte und ist nur für die Verwertung durch den vorgesehenen Empfänger bestimmt. Sollten Sie nicht der vorgesehene Empfänger sein, setzen Sie den Absender bitte unverzüglich in Kenntnis und löschen diese E Mail. Hinweise zum Datenschutz finden Sie hier. diff --git a/northd/northd.c b/northd/northd.c index c366b545e..6aff04cc5 100644 --- a/northd/northd.c +++ b/northd/northd.c @@ -8964,6 +8964,13 @@ build_lswitch_destination_lookup_bmcast(struct ovn_datapath *od, } } + + if (!smap_get_bool(&od->nbs->other_config, "broadcast-arps-to-all-routers", true)) { + ovn_lflow_add(lflows, od, S_SWITCH_IN_L2_LKUP, 72, + "eth.mcast && (arp.op == 1 || nd_ns)", + "outport = \""MC_FLOOD_L2"\"; output;"); + } + ovn_lflow_add(lflows, od, S_SWITCH_IN_L2_LKUP, 70, "eth.mcast", "outport = \""MC_FLOOD"\"; output;"); } diff --git a/northd/ovn-northd.8.xml b/northd/ovn-northd.8.xml index 2eab2c4ae..033841383 100644 --- a/northd/ovn-northd.8.xml +++ b/northd/ovn-northd.8.xml @@ -1873,6 +1873,13 @@ output; non-router logical ports. +
  • + A priority-72 flow that outputs all ARP requests and ND packets with + an Ethernet broadcast or multicast eth.dst to the + MC_FLOOD_L2 multicast group if + other_config:broadcast-arps-to-all-routers=true. +
  • +
  • A priority-70 flow that outputs all packets with an Ethernet broadcast or multicast eth.dst to the MC_FLOOD diff --git a/ovn-nb.xml b/ovn-nb.xml index 8d56d0c6e..a41d5b11f 100644 --- a/ovn-nb.xml +++ b/ovn-nb.xml @@ -729,6 +729,18 @@ localnet ports, fabric traffic that belongs to other tagged networks may be passed through such a port. + + + Determines whether arp requests and ipv6 neighbor solicitations should + be send to all routers and other switchports (default) or if it should + only be send to switchports where the ip/mac address is unknown. + Setting this to false can significantly reduce the load if the logical + switch can receive arp requests for ips it does not know about. + However setting this to false also means that garps are no longer + forwarded to all routers and therefor the mac bindings of the routers + are no longer updated. + diff --git a/tests/ovn.at b/tests/ovn.at index dc5c5df3f..dfef5dacc 100644 --- a/tests/ovn.at +++ b/tests/ovn.at @@ -5048,6 +5048,120 @@ OVN_CLEANUP([hv1], [hv2], [hv3]) AT_CLEANUP ]) +# 1 hypervisor, 1 logical switch with 1 logical port, 300 logical router +OVN_FOR_EACH_NORTHD([ +AT_SETUP([1 HVs, 1 LS, 2 lports/LS, 300 LR]) +AT_KEYWORDS([slowtest]) +ovn_start + +# Logical network: +# +# One logical switch ls1. +# 300 logical routers lr001 - lr299. All connected to ls1 +# with one subnet: +# lrp001 on ls1 for subnet 192.168.0.1/20 +# lrp002 on ls1 for subnet 192.168.0.2/20 +# ... +# lrp101 on ls1 for subnet 192.168.1.1/20 +# ... +# lrp299 on ls1 for subnet 192.168.2.99/20 +# +# also 2 VIF on the first hypervisor. +# lp-vif1 on ls1 for subnet 192.168.3.1/20 +# lp-vif2 on ls1 without ip +ovn-nbctl \ + -- ls-add ls1 \ + -- lsp-add ls1 lp-vif1 \ + -- lsp-set-addresses lp-vif1 \ + "f0:00:00:00:00:01 192.168.3.1" \ + -- lsp-add ls1 lp-vif2 \ + -- lsp-set-addresses lp-vif2 \ + "f0:00:00:00:00:02 unknown" + +for i in 0 1 2; do + for j in `seq 1 99`; do + hex=$(printf '%02x' $j) + ovn-nbctl \ + -- lr-add lr$i$j \ + -- lrp-add lr$i$j lrp$i$j 00:00:00:00:f$i:$hex 192.168.$i.$j/20 \ + -- lsp-add ls1 lrp$i$j-attachment \ + -- set Logical_Switch_Port lrp$i$j-attachment type=router \ + options:router-port=lrp$i$j \ + addresses='"00:00:00:00:f'$i':'$hex'"' + done +done + +# Physical network: +# +# One hypervisors hv1. +# lp-vif1 on hv1. +# lp-vif2 on hv1. + +net_add n1 +sim_add hv1 +as hv1 +ovs-vsctl add-br br-phys +ovn_attach n1 br-phys 192.168.255.1 +ovs-vsctl \ + -- add-port br-int vif1 \ + -- set Interface vif1 \ + external-ids:iface-id=lp-vif1 \ + options:tx_pcap=hv1/vif1-tx.pcap \ + options:rxq_pcap=hv1/vif1-rx.pcap \ + ofport-request=1 \ + -- add-port br-int vif2 \ + -- set Interface vif2 \ + external-ids:iface-id=lp-vif2 \ + options:tx_pcap=hv1/vif2-tx.pcap \ + options:rxq_pcap=hv1/vif2-rx.pcap \ + ofport-request=2 + +ovs-vsctl show +ovs-vsctl list Interface + +# This might take longer than normally +export OVS_CTL_TIMEOUT=120 +wait_for_ports_up +check ovn-nbctl --wait=hv --timeout=$OVS_CTL_TIMEOUT sync + +# now back to normal timeouts +export OVS_CTL_TIMEOUT=30 + +# Pre-populate the hypervisors' ARP tables so that we don't lose any +# packets for ARP resolution (native tunneling doesn't queue packets +# for ARP resolution). +OVN_POPULATE_ARP + +send_arp() { + ovs-appctl ofproto/trace br-int \ + arp,in_port=1,vlan_tci=0x0000,dl_src=f0:00:00:00:00:01,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.3.1,arp_tpa=1.2.3.4,arp_op=1,arp_sha=f0:00:00:00:00:01,arp_tha=ff:ff:ff:ff:ff:ff +} + +is_arp_dropped_on_recirc() { + send_arp | grep "Too many resubmits" +} + +is_arp_received_by_vif2() { + send_arp | grep "output:2" +} + +# we now send a test arp request that the routers can not answer. +# without the later setting this will die because of the recirc limit + +OVS_WAIT_UNTIL(is_arp_dropped_on_recirc) + +# now we reconfigure the logical switch to not forward these arp packets to +# the routers +ovn-nbctl set Logical_Switch ls1 other_config:broadcast-arps-to-all-routers=false + +OVS_WAIT_UNTIL(is_arp_received_by_vif2) + +# Gracefully terminate daemons +OVN_CLEANUP([hv1]) + +AT_CLEANUP +]) + OVN_FOR_EACH_NORTHD([ AT_SETUP([IP relocation using GARP request]) ovn_start