aboutsummaryrefslogtreecommitdiffstats
path: root/router/README.md
blob: 8527bd046955c54dfbe9faeb611330bc77dd0c79 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# A plugin to help accelerate IPv4 routing

This repository provides a plugin to hook up data plane interfaces, via
tap interfaces, to a host operating system. The host operating system
can run a route daemon referencing the tap interface(s) as if they were
the data plane interfaces. IPv4 packet forwarding decisions are taken
in the data path, while control traffic is sent to and handled by the host.

More information can be found on the wiki page:
- http://wiki.fd.io/view/VPP_Sandbox/router

## Build/Install

The router is implemented as a plugin to inject, e.g. arp, icmp4, traffic
from data plane devices. To use it, you must build the plugin and put it
in VPPs runtime plugin directory. The plugin depends on vpp and the netlink
repository from the vppsb project. This README assumes familiarity with the
build environment for both projects.

Build vpp, netlink, and router all at once by creating symbolic links in the
top level vpp directory to the netlink and router directories as well as
symbolic links to the respective .mk files in 'build-data/packages'.

```
$ cd /git/vpp
$ ln -sf /git/vppsb/netlink
$ ln -sf /git/vppsb/router
$ ln -sf ../../netlink/netlink.mk build-data/packages/
$ ln -sf ../../router/router.mk build-data/packages/
```

Now build everything and create a link to the plugin in vpp's plugin path.

```
$ cd build-root
$ ./bootstrap.sh
$ make V=0 PLATFORM=vpp TAG=vpp_debug netlink-install router-install
$ ln -sf /git/vpp/build-root/install-vpp_debug-native/router/lib64/router.so.0.0.0 \
         /usr/lib/vpp_plugins/router.so
```

Once VPP is running and the plugin is loaded, data plane interfaces can
be tapped.

```
$ vppctl enable tap-inject
```

The host operating system should see a tap named 'vpp0' with the same hardware
address as 'TenGigabitEthernet2/0/0'. Adding an IPv4 interface address to 'vpp0'
should cause the address to be added to the data plane interface as well. If
the address is a network address, a route should be added to the data
plane's default fib.

## Administrative

### Current status

Currently the router plugin handles ARP, locally destined ICMPv4 and OSPF
traffic. It supports the classifier directing packets from an ip4-table to
the 'tap-inject-neighbor' node (for handling multicast OSPF and IGMP).

### Objective

The objective of this project is to continue to build out better integration
with host operating system and for providing a basis to enable completely
or partially unmodified applications to take advantage of a fast datapath.

### MPLS related enhancement to router plugin

Some changes made to router plugin enable it to support mpls label encapsulation.

To test this feature, first install router plugin using instructions
in section "Build/Install", and then run following commands

$vppctl enable tap-inject
$ifconfig vpp0 <IP> up
$ip route add <IP> encap mpls <LABELS> via <IP> dev vpp0
$vppctl show ip fib

You should see labels in ip fib table.

you can also run following commands

$vppctl enable tap-inject
$vppctl mpls table add 0
$vppctl set int mpls <INTERFACE> enable
$ip -f mpls route add 333 dev vpp0
$vppctl show mpls fib

You should see dst label and interface in mpls table.

### Selinux

Router plugin needs those rules to work under selinux enforcing mode:

```
allow vpp_t self:netlink_route_socket nlmsg_read;
```

### Main contributors

Jeff Shaw - LF-ID:jbshaw, Chad Chengwei Wang - LF-ID:flinter (MPLS)