From f85addabe66c4644b6e6b9a48b7b5dc855fe1cc3 Mon Sep 17 00:00:00 2001 From: Shakib Ahmed Date: Mon, 7 Nov 2016 16:53:03 -0800 Subject: [PATCH] Add ONE/VPP tutorial for simple overlay Change-Id: Ic5e1cf8694be03fc3b69469b74b7b0e966ba7c7d Signed-off-by: Shakib Ahmed (cherry picked from commit 87bce655d83ac1df92a55a125e66df5521adf03c) --- .../images/one_ODL_architecture.png | Bin 0 -> 7688 bytes .../lisp-flow-mapping-user-guide.rst | 312 +++++++++++++++++- 2 files changed, 301 insertions(+), 11 deletions(-) create mode 100644 docs/user-guide/images/one_ODL_architecture.png diff --git a/docs/user-guide/images/one_ODL_architecture.png b/docs/user-guide/images/one_ODL_architecture.png new file mode 100644 index 0000000000000000000000000000000000000000..9b843edd660b8be9240ab6d3706a516716915ef1 GIT binary patch literal 7688 zcmeHMXIPWjwoVX66cuI=5HAqa5ev;q2~BhmaYhgc0YZylDB@6r5C|9|ii|;l5g`f$ z1jPU$NK<-Iz>GwK2!ugtQYDcZ0wEA`KkAI9|YP~yYvIod@?VAK#C-@ABo~alm%WlwjFKcEl!LCKvqhPng8I4H^sb^={OZGTY>Gz=C+lz8*s=6*j90S23kf zo&1~EjQQ3Kx;wBdDD%|#(v;)I!$%%5OSScgGD^84D^m`j_Tk5eK1R4;ZMLEJkHVX-;5e&hXDxWcS0d0p78p9ks+dF^qarLqO{DMZS6U zI|j;Z_}Tl?EgmDCNhJE^b~?6O3yqcCU^zU-`|^TNDA`lt-vN6%pTlj(@FM~>qM%{- z0Nc+)RiD2$ZYp39zn4r(y>?2O)v3%ah?0An#nv8o&`Odw@><;b;`K{u`c)DgzwhQ& z8O3%8fv%jpDViF44WKC!m`vwiqdNH5@i5K5n=dG;tc8qq`MK zqHiWW%<}K}9?s7J)szp+Jw3h+N*qkF)v8_|e0o>k4>WFM-;rOu!u$EB{2tQDP-3G` zM$=|cp6K68{`t!_{4U61CX~%<0O7m3r1Eg{7Dic-dy(Lp**5a_CU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~~~~~~~ +Both have different approaches to create the overlay but ultimately do the +same job. Details of both approaches have been explained below. + +Creating a LISP overlay with OOR +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This section provides instructions to set up a LISP network of three nodes (one "client" node and two "server" nodes) using OOR as data @@ -362,21 +371,23 @@ Prerequisites - **OpenDaylight Boron** +.. _instructions: + - **The Postman Chrome App**: the most convenient way to follow along - this tutorial is to use the `Postman Chrome - App `__ + this tutorial is to use the `Postman + App `__ to edit and send the requests. The project git repository hosts a collection of the requests that are used in this tutorial in the - ``resources/tutorial/Beryllium_Tutorial.json.postman_collection`` + ``resources/tutorial/OOR/Beryllium_Tutorial.json.postman_collection`` file. You can import this file to Postman by clicking *Import* at the top, choosing *Download from link* and then entering the following URL: - ``https://git.opendaylight.org/gerrit/gitweb?p=lispflowmapping.git;a=blob_plain;f=resources/tutorial/Beryllium_Tutorial.json.postman_collection;hb=refs/heads/stable/boron``. + ``__. Alternatively, you can save the file on your machine, or if you have the repository checked out, you can import from there. You will need to create a new Postman Environment and define some variables within: ``controllerHost`` set to the hostname or IP address of the machine - running the ODL instance, and ``restconfPort`` to 8181, if you didn’t + running the OpenDaylight instance, and ``restconfPort`` to 8181, if you didn’t modify the default controller settings. - **OOR version 1.0 or later** The README.md lists the dependencies needed @@ -473,10 +484,10 @@ URLs and body content on the page. .. note:: - The ``resources/tutorial`` directory in the *stable/boron* + The ``resources/tutorial/OOR`` directory in the *stable/boron* branch of the project git repository has the files used in the tutorial `checked - in `__, + in `__, so you can just copy the files to ``/etc/oor.conf`` on the respective VMs. You will also find the JSON files referenced below in the same directory. @@ -558,7 +569,7 @@ URLs and body content on the page. curl -u "admin":"admin" -H "Content-type: application/json" -X GET \ http://localhost:8181/restconf/config/odl-mappingservice:mapping-database/virtual-network-identifier/0/mapping/ipv4:1.1.1.1%2f32/southbound/ - An alternative way for retrieving mappings from ODL using the + An alternative way for retrieving mappings from OpenDaylight using the southbound interface is using the ```lig`` `__ open source tool. @@ -762,6 +773,285 @@ URLs and body content on the page. which should restore connectivity. + +Creating a simple LISP overlay with FD.io +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +In this section, we use the Overlay Network Engine (ONE) project in FD.io +to facilitate fully scripted setup and testing of a LISP/VXLAN-GPE network. +Overlay Network Engine (ONE) is a `FD.io `__ project that enables programmable +dynamic software defined overlays. Details about this project can be +found in `ONE wiki `__. + +The steps shown below will demonstrate setting up a LISP network between +a client and a server using VPP. We demonstrate how to use VPP lite to +build a IP4 LISP overlay on an Ubuntu host using namespaces and af_packet +interfaces. All configuration files used in the tutorials can be found +`here `__. + +Prerequisites +^^^^^^^^^^^^^ + +- **OpenDaylight Boron** + +- **The Postman Chrome App**: Please follow the instructions_ and import + postman collection from the following URL: ``__. + +- **Vagrant** (optional): Download it from `Vagrant website `__ + and follow the setup instructions. + +Target Environment +^^^^^^^^^^^^^^^^^^ + +Unlike the case with OOR, we use network namespace functionality of Linux +to create the overlay in this case. The following table contains ip addresses +of nodes in the overlay topology used in the tutorial. Our objective will be to +create this topology and be able to ping from client to server through an +intermediary hop, **service node**, which is a ``rtr node`` providing the +service of re-encapsulation. So, all the packets from client to server +will be through this **service node**. + ++--------------------------+--------------------------+--------------------------+ +| Node | Node Type | IP Address | ++==========================+==========================+==========================+ +| **controller** | OpenDaylight | 6.0.3.100 | ++--------------------------+--------------------------+--------------------------+ +| **client** | VPP | 6.0.2.2 | ++--------------------------+--------------------------+--------------------------+ +| **server** | VPP | 6.0.4.4 | ++--------------------------+--------------------------+--------------------------+ +| **service node** | VPP | 6.0.3.3 | ++--------------------------+--------------------------+--------------------------+ + +Table: Nodes in the tutorial + +The figure below gives a sketch of network topology that will be used in the tutorial. + +.. figure:: ./images/one_ODL_architecture.png + :alt: Network architecture of the tutorial for FD.io + +Instructions +^^^^^^^^^^^^ + +Follow the instructions below sequentially. + +1. Pull the VPP code anonymously using: + :: + + git clone https://gerrit.fd.io/r/vpp + +2. Then, use the vagrant file from repository to build virtual machine + with proper environment. + :: + + cd vpp/build-root/vagrant/ + vagrant up + vagrant ssh + +3. In case there is any error from ``vagrant up``, try ``vargant ssh``. if + it works, no worries. If it still doesn't work, you can try any Ubuntu virtual + machine. Or sometimes there is an issue with the Vagrant properly copying + the VPP repo code from the host VM after the first installation. In that + case ``/vpp`` doesn't exist. In both cases, follow the instructions + from below. + + 1. Clone the code in ``/`` directory. So, the codes will be in ``/vpp``. + + 2. Run the following commands: + :: + + cd /vpp/build-root + make distclean + ./bootstrap.sh + make V=0 PLATFORM=vpp TAG=vpp install-deb + sudo dpkg -i /vpp/build-root/*.deb + + Alternative and more detailed build instructions can be found in + `VPP's wiki `__ +4. By now, you should have a Ubuntu VM with VPP repository in ``/vpp`` + with ``sudo`` access. Now, we need VPP Lite build. The following commands + builds VPP Lite. + :: + + cd /vpp + export PLATFORM=vpp_lite + make build + + Successful build create the binary in ``/vpp/build-root/install-vpp_lite_debug-native/vpp/bin`` + +5. Install bridge-utils and ethtool if needed by using following commands: + :: + + sudo apt-get install bridge-utils ethtool + +6. Now, install and run OpenDaylight Boron release on the VM. Please + follow the general OpenDaylight Boron Installation Guide for this + step from :ref:`install_odl`. Before running OpenDaylight, we need + to change the configuration for RTR to work. Update ``etc/custom.properties`` + with the ``lisp.elpPolicy`` to be replace. + :: + + lisp.elpPolicy = replace + + Then, run OpenDaylight. For details regarding configuring LISP + Flow Mapping, please take a look at :ref:`lfm_config`. + Once the OpenDaylight controller is running install the *odl-lispflowmapping-msmr* + feature from the Karaf CLI: + + :: + + feature:install odl-lispflowmapping-msmr + + It may take quite a while to load and initialize all features and their + dependencies. It’s worth running the command ``log:tail`` in the + Karaf console to see when the log output is winding down, and + continue with the tutorial after that. + +7. For setting up VPP, get the files from ``resources/tutorial/FD_io`` + folder of the lispflowmapping repo. The files can also be found `here + `__. + Copy the ``vpp1.config``, ``vpp2.config`` and ``rtr.config`` files in + ``/etc/vpp/lite/``. + +8. In this example, VPP doesn't make any southbound map registers to OpenDaylight. + So, we add the mappings directly from northbound. For that, we need + to add the mappings to OpenDaylight via RESTCONF API. + + Register EID-to-RLOC mapping of the Client EID 6.0.2.0/24. + :: + + curl -u "admin":"admin" -H "Content-type: application/json" -X PUT \ + http://localhost:8181/restconf/config/odl-mappingservice:mapping-database/virtual-network-identifier/0/mapping/ipv4:6.0.2.0%2f24/northbound/ \ + --data @epl1.json + + Content of epl1.json: + + .. code:: json + + { + "mapping": { + "eid-uri": "ipv4:6.0.2.0/24", + "origin": "northbound", + "mapping-record": { + "recordTtl": 1440, + "action": "NoAction", + "authoritative": true, + "eid": { + "address-type": "ietf-lisp-address-types:ipv4-prefix-afi", + "ipv4-prefix": "6.0.2.0/24" + }, + "LocatorRecord": [ + { + "locator-id": "ELP", + "priority": 1, + "weight": 1, + "multicastPriority": 255, + "multicastWeight": 0, + "localLocator": true, + "rlocProbed": false, + "routed": false, + "rloc": { + "address-type": "ietf-lisp-address-types:explicit-locator-path-lcaf", + "explicit-locator-path": { + "hop": [ + { + "hop-id": "Hop 1", + "address": "6.0.3.3", + "lrs-bits": "lookup rloc-probe strict" + }, + { + "hop-id": "Hop 2", + "address": "6.0.3.1", + "lrs-bits": "lookup strict" + } + ] + } + } + } + ] + } + } + } + + + Similarly add EID-to-RLOC mapping of the Server EID 6.0.4.0/24. + :: + + curl -u "admin":"admin" -H "Content-type: application/json" -X PUT \ + http://localhost:8181/restconf/config/odl-mappingservice:mapping-database/virtual-network-identifier/0/mapping/ipv4:6.0.4.0%2f24/northbound/ \ + --data @epl2.json + + Content of elp2.json: + + .. code:: json + + { + "mapping": { + "eid-uri": "ipv4:6.0.4.0/24", + "origin": "northbound", + "mapping-record": { + "recordTtl": 1440, + "action": "NoAction", + "authoritative": true, + "eid": { + "address-type": "ietf-lisp-address-types:ipv4-prefix-afi", + "ipv4-prefix": "6.0.4.0/24" + }, + "LocatorRecord": [ + { + "locator-id": "ELP", + "priority": 1, + "weight": 1, + "multicastPriority": 255, + "multicastWeight": 0, + "localLocator": true, + "rlocProbed": false, + "routed": false, + "rloc": { + "address-type": "ietf-lisp-address-types:explicit-locator-path-lcaf", + "explicit-locator-path": { + "hop": [ + { + "hop-id": "Hop 1", + "address": "6.0.3.3", + "lrs-bits": "lookup rloc-probe strict" + }, + { + "hop-id": "Hop 2", + "address": "6.0.3.2", + "lrs-bits": "lookup strict" + } + ] + } + } + } + ] + } + } + } + + The JSON files regarding these can be found in `here + `__. + Even though there is no southbound registration for mapping to OpenDaylight, using + northbound policy we can specify mappings, when Client requests for + the Server eid, Client gets a reply from OpenDaylight. + +9. Assuming all files have been created and OpenDaylight has been configured as + explained above, execute the host script you've created or the ``topology_setup.sh`` + script from `here `__. + +10. If all goes well, you can now test connectivity between the namespaces with: + :: + + sudo ip netns exec vpp-ns1 ping 6.0.4.4 + +11. Traffic and control plane message exchanges can be checked with a wireshark + listening on the odl interface. +12. .. important:: Delete the topology by running the ``topology_setup.sh`` with ``clean`` argument. + :: + + sudo ./topology_setup.sh clean + LISP Flow Mapping Support ------------------------- -- 2.36.6