Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The events generated by RouteService are handled by Route Server application. When new event is handled, the Route Server may install a Flow, which is constructed based on BGP Route object and translated into XMPP Event Notification (Message stanza). The Flow installation request is handled by XMPP Flow Provider, which generates XMPP Message stanza based on the Flow object and sends it to the appropriate devices.

Key implementation pieces of code

The code implementing XMPP protocol is located in Protocols and Providers layers. The source code of XMPP Core controller is already integrated with ONOS master branch. The source code of XMPP PubSub Controller, EVPN Provider and Route Server is available at : https://github.com/osinstom/onos/tree/xmpp-1bgpvpn.0.

The XMPP implementation follows ONOS code convention. The folder structure of Protocols layer's modules includes “api” subfolder  containing interface definitions and “ctl” containing implementation classes. The implementation uses also several external libraries:

  • Tinder, which provides XMPP abstractions. It is also used in open source XMPP server implementations such as Openfire.
  • Aalto-XML, which provides asynchronous, non-blocking XML parsing mechanism
  • Netty, which provides multi-threaded and efficient TCP Java-based server

...

  • XmppController.java interface implemented by XmppControllerImpl.java tracks all connected XMPP devices, provides interface to obtain XMPP device and register/unregister listeners.

  • XmppDevice.java interface implemented by AbstractXmppDevice.java represents underlaying XMPP devices and allows to perform operations on them. With each XmppDevice.java object there is a Netty channel associated.

  • XmppDeviceId.java class implements identifier representation based on XMPP JID address.

  • The XmppDeviceProvider.java manages any XMPP device and its interactions with the ONOS core. It notifies ONOS Device Subsystem about already connected/disconnected devices.

  • The XmppDeviceListener.java notifies the provider in ONOS core that XMPP device is connected/disconnected.

  • XmppServer.java and XmppChannelInitializer.java implements Netty TCP server listening on XMPP connection on TCP 5269 port and configures Netty channel pipeline.

  • XMPP encoding and decoding is implemented by several classes in order to provide efficient XML stream parsing. XmlStreamDecoder.java class reads asynchronously incoming XML data using Aalto-XML library. XmlMerger.java class accumulates incoming XML events from XmlStreamDecoder.java and creates XML document. The XmppDecoder.java class translates XML document into XMPP stanzas. The XmppEncoder.java class translates Tinder objects into bytes ready to send over a network socket.

  • The XmppChannelHandler.java class implements XMPP protocol state machine.

  • The XmppPubSubProvider XmppPubSubController.java interface implemented by XmppPubSubControllerImpl.java implements provides XMPP Publish/Subscribe mechanism for parsing XMPP PubSub messages and sending XMPP Event Notifications.
  • The XmppMessageListener.java, XmppIqListener.java and XmppPresenceListener.java interfaces informs providers in the ONOS core other modules of ONOS about incoming XMPP stanzas. Currently, only the XmppIqListener is implemented by InternalXmppIqListener.java in XmppPubSubProvider XmppPubSubControllerImpl.java, because XMPP Publish/Subscribe does not operate on the other XMPP stanzas.

  • The XmppDeviceProviderXmppRouteProvider.java manages any XMPP device and its interactions with the ONOS core. It notifies ONOS Device Subsystem about already connected/disconnected devices.
  • The XmppDeviceListener.java notifies the provider in ONOS core that XMPP device is connected/disconnected.

...

  • class implements the Route Provider. It listens to XMPP PubSub messages and translates the XML payload into BGP configuration.
  • The XmppPublishEventsListener.java and XmppSubscribeEventsListener.java interfaces are used to inform other modules of ONOS about new events related to XMPP publication and subscription. These interfaces are implemented by InternalXmppPubSubEventListener.java internal class contained in XmppRouteProvider.java.
  • The XmppFlowProvider.java class implements the Flow Provider. It is invoked by Apps layer's modules. When Flow installation request is generated, the XmppFlowProvider translates FlowRule objects into XML message and sends a Message stanza (XMPP Event Notification) to underlaying devices.

Setting up Virtual Lab

As the main use case for XMPP implementation in ONOS, the XMPP-based BGP-signaled End-System IP/VPNs architecture has been implemented. This architecture in general consists of centralized control plane entity called End-System Route Server and distributed vRouters (or VPN Forwarders). For the experiments purposes the XMPP-enabled vRouter emulator (based on Mininet and Open vSwitch) has been implemented (https://github.com/osinstom/vrouter-client-py). It provides basic functionalities of VPN Forwarder such as XMPP communication with server and VXLAN encapsulation.  There was   We have also developed the Proof-of-Concept Route Server application for ONOS providing VPN membership management and BGP route distribution logic, which is are the basic functionality of End-System Route Server.

...

  • Download vRouter emulator. Note that it is a prototype version.

    Code Block
    git clone https://github.com/osinstom/vrouter-client-py.git


  • Configure vRouter.

    Code Block
    cd vrouter-client-py
    nano config.ini

    You should configure jid, vrouter.ip and controller.ip parameters. The jid parameter identifies XMPP client and should be unique for compute node. The vrouter.ip is an IP address of data network interface. The controller.ip parameter is an IP address of ONOS controller. Sample config:

    Code Block
    [general]
    jid=agent2@vnsw.contrailsystems.com
    vrouter.ip=192.168.121.3
    controller.ip=192.168.10.2


  • Run vRouter console.

    Code Block
    sudo python vrouter.py
  • The vRouter emulator should establish XMPP stream with controller. You can choose the action to perform from command-line menu. Note that it is prototype (work in progress) application so far and not all function may work properly. Actually, the code from Gerrit patch handles only the device-related operations. As a result of above command you should see new device registered in the ONOS core.

Demo and Results

...

Widget Connector
urlhttps://www.youtube.com/watch?v=FDswSlhkWwU

Gerrit

...

reviews:

https://gerrit.onosproject.org/#/c/16781/

...