Skip to content

V2 Routing

Dan Barrett edited this page Jan 9, 2018 · 5 revisions

Table of Contents

Overview

The v2-routing branch contains new simple SDN style routing daemons for use with XIA. This code improves on the older routing code by adding support for multiple routers per AD as well as additional logic that only lets trusted routers join an AD and will only connect to trusted peer ADs.

New Features

  • ADs can contain multiple routers
  • Each AD has a SDN controller that generates routes for all of the routers in the domain, and talks to the SDN in other ADs. The controller can also act as a router, so simple ADs don't need to allocate nodes for a router and a controller if only a single combined router/controller will suffice.
  • Controllers will only talk to controllers in neighbor domains that they trust. Unknown ADs can’t join the network.
  • Controllers will trust ADs that are trusted by ADs that they trust. So this means you only have to trust your direct neighbors, and will automatically trust any ADs that they trust.
  • There is a new daemon called xhostd that runs on each host node. It simply sends keep alive messages to the router it is connected to. When the keep-alives stop because the host has left the network for any reason, the router will notice and will remove the host from its routing table.
  • Routers in previous branches were very noisy, the number of messages sent has been drastically reduced which seems to have a positive effect on the core click engine.
  • Controllers have a file named trusted.conf that lists the DAGs for controllers in the neighboring domains that it wants to talk to. Controllers only need to trust directly connected ADs. They will automatically trust the chain of ADs trusted by the neighbor. This file can be managed by hand, but it is easier to use the addtopeer utility to add entries to the file.
  • Routers use a file named RHID.cred to know which AD to join. It contains a hash of the AD XID and is used to validate the controller. This prevents edge routers from joining neighboring ADs. It also prevents untrusted routers from being added to the network. This file can be distributed on the network by running the addrouter command on the controller.

Configuring The Network

Example Network

AD0
AD0 contains a controller, edge router, and endhost. In a simple network, the host could also have been directly connected to the controller.
AD1
AD1 consists of a standalone controller that acts as both a controller and an edge router.
Although it can live on any controller in the network, for this example, the nameserver will be run on Controller1. In the current XIA implementation there is only a single global nameserver.
AD2
AD2 consists of a controller, 1 edge router, 2 core routers, and a host (server2).
Routers can be connected in a loop and the shortest paths will be calculated for the routing tables on each router.

Configuration

All nodes in an XIA network are configured using the xia-config utility. Configuration usually only needs to be done once per node unless the hardware configuration has changed. The addtopeer and addrouter commands will need to be run on an AD's controller whenever new neighboring ADs are added to the network or if new routers are added to the AD.

Common configuration options

If a node has a control interface on a network shared by all of the nodes it will need to be hidden from XIA. Use the -i iface [iface...] switch to ignore the interface. Multiple space separated interfaces may be specified.

By default, nodes have up to 4 interfaces. Adding the -p 8 allows a node to have up to 8 interfaces.

Create the controller configuration files

Run xia-config controller on controller0, controller1, and controller2. Add the --nameserver switch to controller1 to tell it to run the global nameserver.

controller1

  xia-config controller -i eth0 --nameserver

controller0

  xia-config controller -i eth0

controller2

  xia-config controller

Configure the controllers to trust the other ADs using the addtopeer command. use the -h flag to see available options. Note: addtopeer uses ssh and scp and makes several assumptions. If they aren't all true, trusted.conf will need to be updated by hand.

  • All nodes in the network are are visible over TCP/IP to other nodes in the network
  • The administrator has an account with ssh keys on each node
controller0
  addtopeer controller1

controller1

  addtopeer controller0 controller2

controller2

  addtopeer controller1

IP addresses or hostnames may be used as well.

To manually copy configuration info to other controllers:

  • copy etc/controller.conf to the other controller and save it as etc/peer.tmp
  • run addtopeer -l
  • copy etc/resolv.conf from the controller running the nameserver to the etc directory on each controller in the network.

Create the router config files

All of the routers are configured similarly. The addrouter command has same requirements as the addtopeer command in the controller section.

  xia-config router -i eth0

controller0

  addrouter router1

controller2

  addrouter router20 router21 router22

To manually install RHID.cred to routers in the AD, copy etc/RHID.cred from the controller of the AD and save it in the same location on each router.

Create the host/server config files

Hosts and servers are configured similarly.

  xia-config host -i eth0

(Optional) Create hosts.xia

To make it easier to use the xping and xtraceroute utilities, create etc/hosts.xia. The xmakehosts command may be run on any node in the network. It will overwrite the existing hosts.xia file on each machine with a new file containing DAGs for the specified hosts and the host the command was run on.

From controller1:

  xmakehosts controller0 router0 host0 controller2 router20 router21 router22 server2

The generated hosts file will resemble the following:

  controller0 RE AD:f41531f9657729e176a33b9681246c08106ab023 HID:08a15ad2b9f2354ee8a751e02057a158d7d1febd
  router0 RE AD:f41531f9657729e176a33b9681246c08106ab023 HID:3beb9a3abddd7205277a8a111795de14b0f1fe18
  host0 RE AD:b51a09588f637df886a45d53367757344ae53943 HID:e2c3384eb30178276d6731e4258a0b0defc7be7c
 ...

Entries may also be added by hand as long as the correct formatting is used.

Reset a node

  xia-config clean

View a node's configuration

  xia-config info
  Hostname:           controller0
  Node Type:          controller
  HID:                HID:08a15ad2b9f2354ee8a751e02057a158d7d1febd
  AD:                 AD:f41531f9657729e176a33b9681246c08106ab023
  Controller SID:     SID:902b9c4e6b5bd9fc5b5a57c39ea2f62bf6cab2e5
  Name Server SID:    SID:1110000000000000000000000000000000001113
  Rendezvous SID:     None
  Rendezvous ctl SID: None
  Number of ports:    4
  ignore interface:   eth0

Note: The XID's generated will be different than those above.

Control the network

The xia command is used to start and stop XIA nodes.

Start the network

In theory, nodes may be started in any order, but the network sets up quicker if nodes are started in the following order.

  • start the controllers
  • start the routers
  • start the hosts/servers
The startup command is the same regardless of node type.
  sudo xia start

optional flags:

  • -v to let click log to the console. Click and the daemons always log to /var/log/syslog at the current log level.
  • -vv to let click and the daemons log to the console
  • -l [0-7] to set the logging verbosity. Default is 3 (LOG_ERR)

Stop a node

  sudo xia stop

Check node status

  xia status
  XIA controller service status
  click        : running
  xnetjd       : running
  xcache       : running
  xcontrold    : running
  xnameservice : running
  xstats       : stopped
  statsserver  : stopped
  console logs : disabled
  log level    : LOG_ERR

View the routing table

See the XIA Routing section for information on the routing table contents.

  xroute
  TYPE  XID                                           PORT          FLAGS    NEXT HOP
  ------------------------------------------------------------------------------------------------------------------------
  AD    (default)                                     -7 (fallback) 11111111
  AD    AD:3c4bdbd74231d532badb2d5473f6457859164cdf    2            00000000 
  AD    AD:f41531f9657729e176a33b9681246c08106ab023   -2 (self)     00000000
  HID   (default)                                     -7 (fallback) 11111111
  HID   HID:08a15ad2b9f2354ee8a751e02057a158d7d1febd   0            00000008 HID:08a15ad2b9f2354ee8a751e02057a158d7d1febd
  HID   HID:3beb9a3abddd7205277a8a111795de14b0f1fe18  -2 (self)     00000000
  HID   HID:1d08e5328adaf22f1f32b46687dc1119ad88658d   1            00000001 HID:1d08e5328adaf22f1f32b46687dc1119ad88658d
  HID   HID:d29e7814ef06da99f18ecdaebc7095079a78741c   2            00000000
  FID   (default)                                     -4 (bcast)    00000000
  FID   FID:344eb41025569e915d58a1c23c0a7b9ef1085f9e  -2 (self)     00000000
  FID   FID:3beb9a3abddd7205277a8a111795de14b0f1fe18  -2 (self)     00000000
  SID   (default)                                     -7 (fallback) 11111111
  SID   SID:1110000000000000000000000000000000001112  -2 (self)     00000000
  SID   SID:b775bb21fa402124b8e28a4cd6e4a167ab083262  -2 (self)     00000000
  SID   SID:fc29df3866b604e8ff52194b5e02eea18ee54a3f  -2 (self)     00000000
  SID   SID:b56f22bc8ac9a9ed678a41d0b1663f69b2050ae0  -2 (self)     00000000
  CID   (default)                                     -7 (fallback) 00000000
  IP    (default)                                     -7 (fallback) 11111111
  NCID  (default)                                     -7 (fallback) 00000000