From patchwork Fri Sep 27 22:34:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Han Zhou X-Patchwork-Id: 1168748 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="IU6hmBRu"; dkim-atps=neutral Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46g66b158nz9sN1 for ; Sat, 28 Sep 2019 08:34:30 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 9A46111A1; Fri, 27 Sep 2019 22:34:26 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id ECAE1114B for ; Fri, 27 Sep 2019 22:34:25 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-ed1-f68.google.com (mail-ed1-f68.google.com [209.85.208.68]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 229158BD for ; Fri, 27 Sep 2019 22:34:25 +0000 (UTC) Received: by mail-ed1-f68.google.com with SMTP id t3so3612330edw.13 for ; Fri, 27 Sep 2019 15:34:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=MZZW/zPTVhFGq8N72iPEaubQHxW0RuF+r1bC+wmlRdk=; b=IU6hmBRuReJiOk/+Nnol414Taix+wmJazeQjnwc5uW7LNR5UJEgiNn9zwsymxTfXo5 16st6c4x7N36o/l7pnz6rtPpkQu4iaVy9lZqNbKWw00doRSe1Q7RhU97Kg3mMwqqZDJD aJfpQAixFmnyVFQvR44W6fLaGYbw8B6v7r7CjNGQro+AIGL0ACo9ua4Np6tiJMsUr1Bp VL9gbJ1m/ynvOy83fv1X1k1bBVYNTf/gpDDE1flaxtOkbO+qVdawlIvTHY9g1/3Gi+YD Gf4WvSBPRVxr+v08Xyfqb6KfLpLRyZM1WLV4iTIQa5v1nmgSOQsDK2lsdX8pzskiR/FR yYDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=MZZW/zPTVhFGq8N72iPEaubQHxW0RuF+r1bC+wmlRdk=; b=iG/cdxmLbaQ5FnRdS7uOaiNHHq2F++nOZSAKrifI3o93e5pCykw2Vo46TBrBWs7fgI 2vgil4wgORkFCycn0Xs/KpQwVfqFDJIaU8iLANH0qFqnmq34/4Ojy4cN8Y+K33pTMvCS 62tIgSD973ybrrHf7xk3E/R4sSM1ofnkpREn8GXHr6QDoUNg80+fxwlANIWA0rEMnNw7 TQwiCwhmD4XCbKIt/zQ1wbSdAsFHqLrvzWCcrnj3rxq3/1fnosWtBjtR/rzLx5Gp5pzI cnE9SKolmb6HNMyOEgfpzjKvnEWT6w6WFMLcsLnZuiXs1Kb+ODx1UpzaOLzI62lpwpj9 TL0w== X-Gm-Message-State: APjAAAUYVgElZkODMU97gzT+LbQ3q9AtE6VRdVV6YQhqXNaa67V7+lin cSG9q9NCMZaF+oZD9/hFRc42TG7M X-Google-Smtp-Source: APXvYqx+cCRI+J0NkwuS1HAEhWaD9/XzGdha6gnoGQ/isctbhwuX9QaUEZZJYdRACpF1g4RBP5Xj3w== X-Received: by 2002:a17:906:3110:: with SMTP id 16mr9782521ejx.306.1569623663228; Fri, 27 Sep 2019 15:34:23 -0700 (PDT) Received: from localhost.localdomain.localdomain ([216.113.160.77]) by smtp.gmail.com with ESMTPSA id ng5sm715794ejb.9.2019.09.27.15.34.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Sep 2019 15:34:22 -0700 (PDT) From: Han Zhou X-Google-Original-From: Han Zhou To: dev@openvswitch.org Date: Fri, 27 Sep 2019 15:34:15 -0700 Message-Id: <1569623665-77390-1-git-send-email-hzhou8@ebay.com> X-Mailer: git-send-email 2.1.0 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [ovs-dev] [RFC PATCH ovn 00/10] OVN Interconnection X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org The series supports interconnecting multiple OVN deployments (e.g. located at multiple data centers) through logical routers connected with tansit logical switches with overlay tunnels, managed through OVN control plane. See the ovn-architecture document updates for more details. The series is now RFC to get feedback only. Here are the major TODOs before sending as formal patch: - CLI improvements. Now there are only basic database commands supported. More commands will be supported and documentation will be added. - Test cases. Although it is manually tested with multiple OVN setups with basic senarios, test cases will need to be added and more cases covered. - Sandbox support. - Documentation improvements. - Code optimizations. Below are the steps to try/test: 1. Precondition: two or more independent OVN environments are up and running with this patch, each with its own logical switches/routers and workloads. 2. Create the global IC-NB and IC-SB DBs on any node: ovsdb-tool create inb.db ../../ovn-inb.ovsschema ovsdb-tool create isb.db ../../ovn-isb.ovsschema ovsdb-server --detach --no-chdir --pidfile=icdb.pid -vconsole:off \ --log-file=icdb.log -vsyslog:off \ --unixctl=icdb \ --remote=ptcp:6649:0.0.0.0 \ --remote=punix:icdb.ovsdb inb.db isb.db 3. On central node of each OVN, start ovn-ic daemon: export OVN_INB_DB=tcp::6649 export OVN_ISB_DB=tcp::6649 # Specify NB/SB DB if not using default connection URL. ovn-ic --detach --no-chdir --pidfile=ovn-ic.pid -vconsole:off \ --log-file=ovn-ic.log -vsyslog:off 4. For each OVN, set AZ name in NB: e.g. ovn-nbctl set nb . name="az1" 5. Create a transit switch in global IC-NB: ovn-inbctl create transit_switch name=ts1 6. For each OVN, specify one or more chassis as gateway node(s) for interconnection by running below command on the chassis: ovs-vsctl set open . external_ids:is-interconn=true 7. For each OVN, create distributed gateway port(s) and its peer on transit switch, e.g.: # In OVN az1: ovn-nbctl lrp-add lr1 lrp-lr1-ts1 aa:aa:aa:00:00:01 169.254.100.1/24 ovn-nbctl lrp-set-gateway-chassis lrp-lr1-ts1 gw1 ovn-nbctl lsp-add ts1 lsp-ts1-lr1 ovn-nbctl lsp-set-addresses lsp-ts1-lr1 router ovn-nbctl lsp-set-type lsp-ts1-lr1 router ovn-nbctl lsp-set-options lsp-ts1-lr1 router-port=lrp-lr1-ts1 # In OVN az2: ovn-nbctl lrp-add lr2 lrp-lr2-ts1 aa:aa:aa:00:00:02 169.254.100.2/24 ovn-nbctl lrp-set-gateway-chassis lrp-lr2-ts1 gw2 ovn-nbctl lsp-add ts1 lsp-ts1-lr2 ovn-nbctl lsp-set-addresses lsp-ts1-lr2 router ovn-nbctl lsp-set-type lsp-ts1-lr2 router ovn-nbctl lsp-set-options lsp-ts1-lr2 router-port=lrp-lr2-ts1 8. For each OVN, create the static routes to route to remote workload subnets, e.g.: In OVN az1, there are workloads using 10.0.1.0/24 under lr1; in OVN az2, there are workloads using 10.0.2.0/24 under lr2. # In az1, add below route: ovn-nbctl lr-route-add lr1 10.0.2.0/24 169.254.100.2 # In az1, add below route: ovn-nbctl lr-route-add lr1 10.0.1.0/24 169.254.100.1 9. Try ping between the workloads in different OVNs. Han Zhou (10): ovn-northd.c: Fix datapath tunnel key allocation. ovn-architecture: Add documentation for OVN interconnection feature. ovn-inb: Interconnection northbound DB schema and CLI. ovn-isb: Interconnection southbound DB schema and CLI. ovn-ic: Interconnection controller with AZ registeration. ovn-northd.c: Refactor allocate_tnlid. ovn-ic: Transit switch controller. ovn-sb: Add columns is_interconn and is_remote to Chassis. ovn-ic: Interconnection gateway controller. ovn-ic: Interconnection port controller. .gitignore | 6 + Makefile.am | 1 + automake.mk | 75 ++++ controller/binding.c | 6 +- controller/chassis.c | 14 + debian/ovn-common.install | 2 + debian/ovn-common.manpages | 4 + ic/.gitignore | 2 + ic/automake.mk | 10 + ic/ovn-ic.8.xml | 111 ++++++ ic/ovn-ic.c | 942 +++++++++++++++++++++++++++++++++++++++++++++ lib/.gitignore | 6 + lib/automake.mk | 32 +- lib/ovn-inb-idl.ann | 9 + lib/ovn-isb-idl.ann | 9 + lib/ovn-util.c | 92 +++++ lib/ovn-util.h | 15 + northd/ovn-northd.c | 106 ++--- ovn-architecture.7.xml | 107 ++++- ovn-inb.ovsschema | 76 ++++ ovn-inb.xml | 377 ++++++++++++++++++ ovn-isb.ovsschema | 130 +++++++ ovn-isb.xml | 588 ++++++++++++++++++++++++++++ ovn-nb.ovsschema | 5 +- ovn-nb.xml | 18 +- ovn-sb.ovsschema | 8 +- ovn-sb.xml | 15 + tutorial/ovs-sandbox | 2 +- utilities/.gitignore | 4 + utilities/automake.mk | 10 + utilities/ovn-inbctl.c | 879 ++++++++++++++++++++++++++++++++++++++++++ utilities/ovn-isbctl.c | 890 ++++++++++++++++++++++++++++++++++++++++++ 32 files changed, 4460 insertions(+), 91 deletions(-) create mode 100644 ic/.gitignore create mode 100644 ic/automake.mk create mode 100644 ic/ovn-ic.8.xml create mode 100644 ic/ovn-ic.c create mode 100644 lib/ovn-inb-idl.ann create mode 100644 lib/ovn-isb-idl.ann create mode 100644 ovn-inb.ovsschema create mode 100644 ovn-inb.xml create mode 100644 ovn-isb.ovsschema create mode 100644 ovn-isb.xml create mode 100644 utilities/ovn-inbctl.c create mode 100644 utilities/ovn-isbctl.c