Usage¶
In this section, it is assumed that Virtual Accelerator has been properly installed and configured. See Getting Started for more details.
Managing GRE interfaces from the fast path¶
The fp-cli
commands below allow you to manage GRE interfaces.
To start
fp-cli
, enter:$ fp-cli
Displaying GRE interfaces¶
Synopsis
gre [name IFNAME]
IFNAME
Name of the GRE interface.
Example
<fp-0> gre
gre1-vr0 linked to eth1-vr0 link vrfid: 0
mode IP
local: 2.0.0.1 remote: 2.0.0.5
ttl: 64 tos: 0x02
iflags: csum key oflags: csum key
ikey: 0x00000001 (1)
okey: 0x00000001 (1)
Displaying GRE statistics¶
Synopsis
gre-stats [percore] [all]
Parameters
- percore
Display all statistics per core running the fast path.
- all
Display all statistics (even those that are null).
Example
<fp-0> gre-stats all
GREDroppedParseIPv4HeaderFailure:0
GREDroppedParseIPv6HeaderFailure:0
GREDroppedPullupIPv4HeaderFailure:0
GREDroppedMissingChecksum:0
GREDroppedUnexpectedChecksum:0
GREDroppedWrongChecksum:0
GREDroppedInitGreIPv4HeaderFailure:0
GREDroppedInitIPv4HeaderFailure:0
GREDroppedPullupIPv6HeaderFailure:0
GREDroppedInitGreIPv6HeaderFailure:0
GREDroppedInitIPv6HeaderFailure:0
GREExceptionInputUnsupportedProtocol:0
GREExceptionOutputUnsupportedProtocol:0
GREExceptionUnsupportedEtherType:0
GREExceptionUnknownIface:0
GREExceptionIPv4Route:0
GREExceptionIPv6Route:0
GREExceptionIPv4SourceSelectFailed:0
GREInvalidHeader:0
GREProtocolNotSupported:0
The output is available in JSON format as well.
Synopsis
gre-stats-son
<fp-0> gre-stats-json
{
"GREDroppedParseIPv4HeaderFailure": 0,
"GREDroppedParseIPv6HeaderFailure": 0,
"GREDroppedPullupIPv4HeaderFailure": 0,
"GREDroppedPullupIPv6HeaderFailure": 0,
"GREExceptionUnknownIface": 0,
"GREDroppedUnexpectedChecksum": 0,
"GREDroppedWrongChecksum": 0,
"GREDroppedMissingChecksum": 0,
"GREExceptionUnsupportedEtherType": 0,
"GREDroppedInitGreIPv4HeaderFailure": 0,
"GREDroppedInitIPv4HeaderFailure": 0,
"GREDroppedInitGreIPv6HeaderFailure": 0,
"GREDroppedInitIPv6HeaderFailure": 0,
"GREExceptionInputUnsupportedProtocol": 0,
"GREExceptionOutputUnsupportedProtocol": 0,
"GREExceptionIPv4Route": 0,
"GREInvalidHeader": 0,
"GREProtocolNotSupported": 0,
"GREExceptionIPv6Route": 0,
"GREExceptionIPv4SourceSelectFailed": 0,
}
Simple GRE L3 tunnel¶
We will assume the network topology is the following:
+---------------+ +---------------+
| Remote | | Gateway with |
| Gateway | | fast path |
| |2.0.0.5 | |
<-<---------|-ethY /-ethX-|================|-eth1-\ eth2-|--------->->
100.2.2.1 | greZ | 2.0.0.1| gre1 | 110.2.2.1
| 10.10.10.2 | | 10.10.10.1 |
| | | |
+---------------+ +---------------+
Configure IP addresses and routes:
# ip link set eth1 up # ip addr add 2.0.0.1/24 dev eth1 # ip link set eth2 up # ip addr add 110.2.2.1/24 dev eth2
Create a new GRE interface:
# ip tunnel add gre1 mode gre local 2.0.0.1 remote 2.0.0.5 dev eth1 key 1 csum # ip link set gre1 up # ip addr add 10.10.10.1 peer 10.10.10.2/24 dev gre1
Create a new route:
# ip route add 100.2.2.1 via 10.10.10.2
Display the characteristics of GRE interfaces on the fast path:
$ fp-cli
<fp-0> gre gre1-vr0 linked to eth1-vr0 link vrfid: 0 mode IP local: 2.0.0.1 remote: 2.0.0.5 ttl: inherit tos: 0x00 iflags: csum key oflags: csum key ikey: 0x00000001 (1) okey: 0x00000001 (1)
Simple GRE L2 tunnel¶
We will assume the network topology is the following:
+---------------+ +---------------+
| Remote | | Gateway with |
| Gateway | | fast path |
| |2.0.0.5 | |
<-<---------|-ethY /-ethX-|================|-eth1-\ eth2-|--------->->
100.2.2.1 | gretapZ | 2.0.0.1| gretap1 | 110.2.2.1
| 10.10.10.2 | | 10.10.10.1 |
| | | |
+---------------+ +---------------+
Configure IP addresses and routes:
# ip link set eth1 up # ip addr add 2.0.0.1/24 dev eth1 # ip link set eth2 up # ip addr add 110.2.2.1/24 dev eth2
Create a new GRE interface:
# ip link add name gretap1 type gretap local 2.0.0.1 remote 2.0.0.5 dev eth1 key 1 csum # ip link set gretap1 up # ip addr add 10.10.10.1/24 dev gretap1
Create a new route:
# ip route add 100.2.2.1 via 10.10.10.2
Display the characteristics of GRE interfaces on the fast path:
$ fp-cli
<fp-0> gre gre1-vr0 linked to eth1-vr0 link vrfid: 0 mode Ether local: 2.0.0.1 remote: 2.0.0.5 ttl: inherit tos: 0x00 iflags: csum key oflags: csum key ikey: 0x00000001 (1) okey: 0x00000001 (1) gre_sys-vr0 linked to ifid0-vr0 link vrfid: 0 master: ovs mode Ether local: any remote: any ttl: inherit tos: 0x00 iflags: oflags:
Note
GRE interfaces displaying ‘master: ovs’ will be managed by the Fast Path OVS Acceleration module. With kernel >= 4.4, a GRE interface will be created to represent Open vSwitch GRE ports.
Simple cross-vrf GRE tunnel¶
We will assume the network topology is the following:
+---------------+ +----------------+
| Remote | | Gateway with |
| Gateway | | fast path |
| | | |
| | |---------+ |
| | | vrf1 | |
| |2.0.0.5 | | |
<-<---------|-ethY //=ethX-|================|-eth1=\\ | eth2-|--------->->
100.2.2.1 | || | 2.0.0.1| || | | 110.2.2.1
| || | |------||-+ |
| greZ | | gre1 |
| 10.10.10.2 | | 10.10.10.1 |
| | | |
+---------------+ +----------------+
The gre1
interface will use 2 VRs:
The interface
link-vr
, i.e. the VR of encapsulated GRE packetsThe interface
vr
, i.e. the VR of plaintext packets
We will create the GRE interface in the link-vr
interface, then move it
to its own VR.
Create the
vrf1
network namespace:# vrfctl add 1 linux-fp-sync-vrf.sh
Configure IP addresses and routes:
# ip link set eth1 netns vrf1 # ip netns exec vrf1 ip link set eth1 up # ip netns exec vrf1 ip addr add 2.0.0.1/24 dev eth1 # ip netns exec vrf0 ip link set eth2 up # ip netns exec vrf0 ip addr add 110.2.2.1/24 dev eth2
Create a new GRE interface:
# ip netns exec vrf1 ip link add gre1 type gre local 2.0.0.1 remote 2.0.0.5 # ip netns exec vrf1 ip link set gre1 netns vrf0 # ip netns exec vrf0 ip link set gre1 up # ip netns exec vrf0 ip addr add 10.10.10.1 peer 10.10.10.2/24 dev gre1
Create a new route:
# ip netns exec vrf0 ip route add 100.2.2.1 via 10.10.10.2
Display the characteristics of GRE interfaces on the fast path:
$ fp-cli
<fp-0> gre gre1-vr0 linked to ifid0-vr0 link vrfid: 1 mode IP local: 2.0.0.1 remote: 2.0.0.5 ttl: inherit tos: 0x00 iflags: oflags:
Providing options¶
Some capabilities can be tuned for this module.
- --ifaces¶
Maximum number of GRE interfaces. This GRE interface can be a tunnel or a L2 tunnel over IPv4 or IPv6 (i.e. link type can be gre, gretap, ip6gre or ip6gretap)
- Default value
255
- Memory footprint per GRE interfaces
100 B
- Range
0 .. 5000
Example
FP_OPTIONS="--mod-opt=gre:--ifaces=512"
Then fast path can manage up to 512 GRE interfaces.
- --hash-order-ipv4¶
Size order of GRE interfaces for tunnel (L3 or L2) over IPv4 hash table. Value automatically updated if
--ifaces
is changed.- Default value
4
- Range
1 .. 31
Example
FP_OPTIONS="--mod-opt=gre:--hash-order-ipv4=10"
- --hash-order-ipv6¶
Size order of GRE interfaces for tunnel (L3 or L2) over IPv6 hash table. Value automatically updated if
--ifaces
is changed.- Default value
4
- Range
1 .. 31
Example
FP_OPTIONS="--mod-opt=gre:--hash-order-ipv6=10"
Tip
To get optimal performance, apply the following ratios to the three parameters:
Parameter |
Value |
---|---|
–hash-order-ipv4 |
|
–hash-order-ipv6 |
|
–ifaces |
|
Note
See Fast Path Capabilities documentation for impact of the available memory on the default value of configurable capabilities