FBOSS is a Thrift API controlled forwarding agent from Facebook. In March of 2015, Facebook announced their first hardware switch, called the Wedge, and the network agent that ran on it, called FBOSS. On bringing up, FBOSS is configured statically. A Thrift-based API is used to add/modify/delete routes:
In the preceding diagram, you can see that an FBOSS switch is very similar to a FlexSwitch-enabled one and the one based on OpenFlow. In general, all switch network operating systems will have the same flow:
- A configuration interface
- A forwarding stack
- SDK integration
FBOSS includes a Python script called fboss_route.py, which is used to configure the FBOSS agent directly. Our examples will use this:
fboss_route.py
usage: fboss_route.py [-h] [--port PORT] [--client CLIENT] [--host HOST]
{flush,add,delete,list_intf,list_routes,list_optics,list_ports,list_vlans,list_arps,list_ndps,enable_port,disable_port}
...
fboss_route.py: error: too few arguments
Here is the help information from the fboss_route.py script; you can see that you have options to:
- Add/delete/flush route entries
- List interfaces
- List routes
- List optics
- List ports
- List VLANs
- List ARPs
- List NDPs
- Enable and disable ports
If we run the list_vlans command, we get the following:
# fboss_route.py list_vlans
===== Vlan 1000 ====
169.254.0.10
2001:00db:1111:1150:0000:0000:0000:000a
===== Vlan 1001 ====
172.31.1.1
===== Vlan 1002 ====
172.31.2.1
===== Vlan 1003 ====
172.31.3.1
===== Vlan 1004 ====
172.31.4.1
===== Vlan 1005 ====
172.31.5.1
===== Vlan 1006 ====
172.31.6.1
===== Vlan 3001 ====
10.11.0.111
2001:00db:3333:0e01:1000:0000:0000:00aa
===== Vlan 3002 ====
10.11.8.111
2001:00db:3334:0e01:1000:0000:0000:00aa
===== Vlan 3003 ====
10.11.16.111
2001:00db:3335:0e01:1000:0000:0000:00aa
===== Vlan 3004 ====
10.11.24.111
2001:00db:3336:0e01:1000:0000:0000:00aa
Running the list interface commands gives similar data, showing the L3 interface (VLAN) with the IP address you see in the preceding code:
# fboss_route.py list_intf
L3 Interface 1000: 169.254.0.10/16, 2001:db:1111:1150::a/64 (2e:60:0c:59:ab:4e)
L3 Interface 1001: 172.31.1.1/24 (2e:60:0c:59:ab:4e)
L3 Interface 1002: 172.31.2.1/24 (2e:60:0c:59:ab:4e)
L3 Interface 1003: 172.31.3.1/24 (2e:60:0c:59:ab:4e)
L3 Interface 1004: 172.31.4.1/24 (2e:60:0c:59:ab:4e)
L3 Interface 1005: 172.31.5.1/24 (2e:60:0c:59:ab:4e)
L3 Interface 1006: 172.31.6.1/24 (2e:60:0c:59:ab:4e)
L3 Interface 3001: 10.11.0.111/31, 2001:db:3333:e01:1000::aa/127 (2e:60:0c:59:ab:4e)
L3 Interface 3002: 10.11.8.111/31, 2001:db:3334:e01:1000::aa/127 (2e:60:0c:59:ab:4e)
L3 Interface 3003: 10.11.16.111/31, 2001:db:3335:e01:1000::aa/127 (2e:60:0c:59:ab:4e)
L3 Interface 3004: 10.11.24.111/31, 2001:db:3336:e01:1000::aa/127 (2e:60:0c:59:ab:4e)
If we list the ports, we can manipulate them:
# fboss_route.py list_ports
Port 1: [enabled=True, up=False, present=False]
Port 2: [enabled=True, up=False, present=False]
Port 3: [enabled=True, up=False, present=False]
Port 4: [enabled=True, up=False, present=False]
Port 5: [enabled=True, up=False, present=False]
To disable a port, simply send:
# fboss_route.py disable_port 1
Port 1 disabled
The system says port 1 is disabled; let's check:
# fboss_route.py list_ports
Port 1: [enabled=False, up=False, present=False]
Port 2: [enabled=True, up=False, present=False]
Port 3: [enabled=True, up=False, present=False]
Port 4: [enabled=True, up=False, present=False]
Port 5: [enabled=True, up=False, present=False]
If we want to add a route, we can do so using this:
# fboss_route.py list_routes
Route 10.11.0.110/31 --> 10.11.0.111
Route 10.11.8.110/31 --> 10.11.8.111
Route 10.11.16.110/31 --> 10.11.16.111
Route 10.11.24.110/31 --> 10.11.24.111
Route 169.254.0.0/16 --> 169.254.0.10
# fboss_route.py add 10.12.13.0/24 10.11.0.111
# fboss_route.py list_routes
Route 10.11.0.110/31 --> 10.11.0.111
Route 10.11.8.110/31 --> 10.11.8.111
Route 10.11.16.110/31 --> 10.11.16.111
Route 10.11.24.110/31 --> 10.11.24.111
Route 10.12.13.0/24 --> 10.11.0.111
Route 169.254.0.0/16 --> 169.254.0.10
To remove the route, do the same with delete instead of add:
# fboss_route.py delete 10.12.13.0/24
# fboss_route.py list_routes
Route 10.11.0.110/31 --> 10.11.0.111
Route 10.11.8.110/31 --> 10.11.8.111
Route 10.11.16.110/31 --> 10.11.16.111
Route 10.11.24.110/31 --> 10.11.24.111
Route 169.254.0.0/16 --> 169.254.0.10
You can also use the fboss_route.py script remotely by sending a host command:
# fboss_route.py --host 10.6.100.231 add 10.12.13.0/24 10.11.0.1
This tutorial is a chapter excerpt from "Building Modern Networks" by Steven Noble. Through Packt's limited-time offer, buy it now for just $5, or get it as part of the Modern Networks eBook bundle for just $15.