Skip to content

Add LISP (Locator/ID Separation Protocol) elements - #513

Open
franck-messaoudi wants to merge 11 commits into
kohler:masterfrom
franck-messaoudi:lisp-contribution
Open

franck-messaoudi wants to merge 11 commits into
kohler:masterfrom
franck-messaoudi:lisp-contribution

Conversation

@franck-messaoudi

Copy link
Copy Markdown

This adds an element group, elements/lisp, that implements the IPv4 parts of
LISP (RFC 9300 data plane,
RFC 9301 control plane), plus a
Follow Me Cloud extension that moves virtual machines between data centers
and updates the LISP mappings so their traffic follows them.

LISP splits an IP address into an endpoint identifier (EID), which stays the
same when a host moves, and a routing locator (RLOC), the address of the site
router. Tunnel routers (xTRs) encapsulate traffic between sites and learn
EID-to-RLOC mappings from a Map-Server / Map-Resolver.

The group is off by default (--enable-lisp, or --enable-all-elements) and
touches nothing outside elements/lisp/, include/clicknet/lisp.h,
conf/lisp/, test/lisp/, configure.in/configure, .gitignore and
AUTHORS.

Elements

Role Elements
Data plane LISPEncap, LISPDecap
Classification LISPClassifierxTR, LISPClassifierMS, LISPClassifierFMCC
ITR LISPMapCache, LISPMapRequester
ETR LISPEtrDatabase, LISPMapReplier, LISPMapRegistrar
Map-Server / Map-Resolver LISPMappingDB, LISPMapServer, LISPMapResolver
Follow Me Cloud FMCCDatabase, FMCCManager, FMCCMigrator, LISPMigrationUpdater, LISPVMCounter

Wire formats are in include/clicknet/lisp.h (plain C, byte-exact, network
byte order).

What is covered

  • Data plane: LISP/UDP/IP encapsulation with nonce, locator-status-bits,
    instance ID, map-versions, and a flow-hash UDP source port.
  • Control plane: Map-Request (plain or in an Encapsulated Control Message),
    Map-Reply, Negative Map-Reply, Map-Register and Map-Notify with
    HMAC-SHA-256-128 authentication, Solicit-Map-Request, per-site
    authorization on the Map-Server, registration expiry.
  • Map-cache with longest-prefix match and locator sets chosen by priority,
    then weight per flow.
  • Follow Me Cloud: a Map-Migrate message, carried as an RFC 8113 shared
    extension message (type 15, provisional sub-type), optionally
    HMAC-authenticated.

Not supported yet: IPv6 EIDs and RLOCs, PITR/PETR, RLOC-probing, LISP-SEC,
and the Linux kernel module (the elements are tested at userlevel only).

Testing

./configure --disable-linuxmodule --enable-lisp
make -j"$(nproc)"
make check            # includes the 11 tests in test/lisp/
  • make check: 183 successes, 0 failures (gcc 12.3, Ubuntu 22.04).
  • Builds without warnings in the LISP files with gcc 12.3 and with clang 14
    (--enable-all-elements -std=gnu++11, as in CI), single-threaded and with
    --enable-user-multithread (4-thread stress test).
  • AddressSanitizer clean on the test configurations.
  • Every message the elements send decodes in Wireshark with no malformed
    field (test/lisp/LISPWire-01.clicktest, run when tshark is installed).
  • Each commit builds on its own.
  • GitHub CI: all 6 jobs (gcc and clang; vanilla, DPDK and netmap) pass on
    this branch together with the CI fix in GitHub CI: Use a Python version available on current runners #512 (the current workflow fails
    at "Set up Python" on every branch, including master, because Python 3.7
    is no longer available on the runners):
    https://github.com/franck-messaoudi/click/actions/runs/39845537158

conf/lisp/xtr1_xtr2_fmcc.click runs two xTRs, a Map-Server/Map-Resolver and
the FMCC controller in one process; elements/lisp/LISP_GUIDE.md has a quick
start for it.

Notes for review

  • Commits follow the build order: wire formats, shared code, data plane, ITR,
    ETR, Map-Server/Map-Resolver, Follow Me Cloud, tests, documentation,
    configure, AUTHORS.
  • configure was updated with only the hunks that the new
    ELEMENTS_ARG_ENABLE(lisp, ...) line generates, so the diff stays at 13
    lines; regenerating it with your usual Autoconf gives the same option.
  • Every element has an =c/=s/=d/=h documentation comment; the
    internal API also has Doxygen comments (doxygen elements/lisp/Doxyfile).
  • The Map-Migrate sub-type (0xFC0) is a placeholder until a value is
    registered with IANA.

Add include/clicknet/lisp.h: byte-exact C structures and constants for the
LISP data and control planes (RFC 9300, RFC 9301): the data header,
Map-Request, Map-Reply, Map-Register, Map-Notify, EID records and
locators, the Encapsulated Control Message, and the Follow Me Cloud
Map-Migrate message (RFC 8113 shared extension).
lispcommon.{cc,hh} provides the outer IP/UDP header builder, EID prefix
tables with longest-prefix match, locator choice by priority and weight,
HMAC-SHA-256-128 authentication (RFC 9301 section 5.6), record helpers
and the locking used by the database elements.
LISPEncap and LISPDecap implement the LISP data plane (RFC 9300):
LISP/UDP/IP encapsulation with nonce, locator-status-bits, instance ID
and flow-hash source port, and decapsulation.  LISPClassifierxTR,
LISPClassifierMS and LISPClassifierFMCC sort packets by LISP message
type for xTRs, Map-Servers/Map-Resolvers and the FMCC controller.
LISPMapCache holds the mappings learnt from Map-Replies and the pending
Map-Requests.  LISPMapRequester looks up data packets, sends Map-Requests
(plain or in an Encapsulated Control Message), validates Map-Replies and
Negative Map-Replies, and handles Solicit-Map-Requests.
…pRegistrar

LISPEtrDatabase holds the EID prefixes of the site, LISPMapReplier answers
Map-Requests, and LISPMapRegistrar sends authenticated Map-Registers and
checks the Map-Notify replies.
LISPMappingDB stores registrations with expiry, LISPMapServer accepts
authenticated Map-Registers per site and sends Map-Notify, and
LISPMapResolver answers Map-Requests (plain or ECM) from the database,
with Negative Map-Replies for unknown EIDs.
FMCCDatabase, FMCCManager and FMCCMigrator form a Follow Me Cloud
controller that decides when a virtual machine moves between data
centers and sends a Map-Migrate order.  On the xTRs,
LISPMigrationUpdater applies it (ETR database, Map-Register, SMRs to the
ITRs) and LISPVMCounter delivers and counts traffic per VM.
test/lisp/ has 11 clicktests (encapsulation, classification, map
resolution, registration and notification with authentication, SMR,
map-cache, Map-Server, FMCC migration, and a Wireshark decode check run
when tshark is available).  conf/lisp/ has a two-xTR, MS/MR and FMCC
demo.
README.md describes the element group, LISP_GUIDE.md explains LISP, how
the elements map to it and how to run the demo.  Doxyfile builds the
API reference from the Doxygen comments, and .clang-format records the
coding style.
The LISP element group is off by default, like ipsec and wifi;
--enable-lisp or --enable-all-elements builds it.
LISP and Follow Me Cloud elements.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant