Usage¶
In this section, it is assumed that Virtual Accelerator has been properly installed and configured. See Getting Started for more details.
Example
# echo 1 > /proc/sys/net/ipv4/conf/all/forwarding
# ip addr add 192.168.1.1/24 dev eth1
# ip link set up dev eth1
# ip route add default gateway 192.168.1.254 dev eth1
# fp-cli
<fp-0> route4
# - Preferred, * - Active, > - selected
0.0.0.0/0 [05] ROUTE gw 192.168.1.254 via eth1-vr0 (8)
<fp-0> iface
1:lo [VR-0] ifid=1 (virtual) <UP|RUNNING|FWD4|FWD6> (0x63)
type=loop mac=00:00:00:00:00:00 mtu=16436 tcp4mss=0 tcp6mss=0
blade=1
IPv4 routes=0 IPv6 routes=0
if_ops: rx_dev=none tx_dev=none ip_output=none
7:eth3 [VR-0] ifid=7 (port 2) <FWD4|FWD6> (0x60)
type=ether mac=00:1b:21:c5:7f:76 mtu=1500 tcp4mss=0 tcp6mss=0
blade=1
IPv4 routes=0 IPv6 routes=0
if_ops: rx_dev=none tx_dev=none ip_output=none
8:eth2 [VR-0] ifid=8 (port 1) <UP|RUNNING|FWD4|FWD6> (0x63)
type=ether mac=00:1b:21:c5:7f:75 mtu=1500 tcp4mss=0 tcp6mss=0
blade=1
IPv4 routes=0 IPv6 routes=0
if_ops: rx_dev=none tx_dev=none ip_output=none
9:eth1 [VR-0] ifid=9 (port 0) <UP|RUNNING|FWD4|FWD6> (0x63)
type=ether mac=00:1b:21:c5:7f:74 mtu=1500 tcp4mss=0 tcp6mss=0
blade=1
IPv4 routes=2 IPv6 routes=0
if_ops: rx_dev=none tx_dev=none ip_output=none
10:eth0 [VR-0] ifid=10 (virtual) <FWD4|FWD6> (0x60)
type=ether mac=00:21:85:c1:82:58 mtu=1500 tcp4mss=0 tcp6mss=0
blade=1
IPv4 routes=0 IPv6 routes=0
if_ops: rx_dev=none tx_dev=none ip_output=none
11:eth4 [VR-0] ifid=11 (port 3) <FWD4|FWD6> (0x60)
type=ether mac=00:1b:21:c5:7f:77 mtu=1500 tcp4mss=0 tcp6mss=0
blade=1
IPv4 routes=0 IPv6 routes=0
if_ops: rx_dev=none tx_dev=none ip_output=none
12:fpn0 [VR-0] ifid=12 (virtual) <UP|RUNNING|FWD4|FWD6> (0x63)
type=ether mac=00:00:46:50:4e:00 mtu=1500 tcp4mss=0 tcp6mss=0
blade=1
IPv4 routes=0 IPv6 routes=0
if_ops: rx_dev=none tx_dev=none ip_output=none
ECMP routes¶
Synopsis
An ECMP route is a single route to a destination, with several next hops. The traffic matching this route is dispatched among the specified next hops based on a hash of the packet source and destination IP addresses. That way, packets of a same flow follow the same path.
IPv4 ECMP routes are configured in one step: the route is created with its list of next hops.
Example
Enable IPv4 forwarding and configure eth1
and eth2
:
# echo 1 > /proc/sys/net/ipv4/conf/all/forwarding
# ip addr add 192.168.1.1/24 dev eth1
# ip link set up dev eth1
# ip addr add 192.168.2.1/24 dev eth2
# ip link set up dev eth2
Add an ECMP route to 10.0.0.0/8
via gateways 192.168.1.2
and 192.168.2.5
:
# ip route add 10.0.0.0/8 nexthop via 192.168.1.2 nexthop via 192.168.2.5
Display Linux IPv4 routes:
# ip route
10.0.0.0/8
nexthop via 192.168.1.2 dev eth1 weight 1
nexthop via 192.168.2.5 dev eth2 weight 1
192.168.1.0/24 dev eth1 proto kernel scope link src 192.168.1.1
192.168.2.0/24 dev eth2 proto kernel scope link src 192.168.2.1
Display fast path IPv4 routes:
<fp-0> route4
# - Preferred, * - Active, > - selected
(254) 10.0.0.0/8 Multipath Entry (14)
[10] # (p=001) ROUTE gw 192.168.2.5 via eth2-vr0
[09] # (p=001) ROUTE gw 192.168.1.2 via eth1-vr0
Deleting an IPv4 ECMP is atomic. Even if a next hop was specified in the delete command, the route is entirely deleted.
Example
Delete the ECMP route to 10.0.0.0/8
:
# ip route del 10.0.0.0/8
Display Linux IPv4 routes:
# ip route
192.168.1.0/24 dev eth1 proto kernel scope link src 192.168.1.1
192.168.2.0/24 dev eth2 proto kernel scope link src 192.168.2.1
Display fast path IPv4 routes:
<fp-0> route4
# - Preferred, * - Active, > - selected
ECMP algorithm¶
The default fast path algorithm to select nexthops of IPv4 ECMP routes is different from the one used by linux. The fast path algorithm is more efficient. However, in some cases, this algorithm should be the same than linux.
To define the IPv4 ECMP algorithm use the route4-ecmp-algo
and
route4-ecmp-algo-set
commands. It is valid only for linux version between
4.4 and 4.11 (both included).
Displaying IPv4 ECMP algorithm¶
Synopsis
route4-ecmp-algo
Parameters
Example
<fp-0> route4-ecmp-algo
IPv4 ECMP algo is fp
Defining IPv4 ECMP algorithm¶
The default IPv4 ECMP algorithm is an optimized one. It is possible to switch to the ‘linux’ algorithm only if the routing table doesn’t contain IPv4 ECMP routes.
Synopsis
route4-ecmp-algo-set linux|fp
Parameters
- fp or linux
- fp: optimized algorithm, different from linux.
Example
<fp-0> route4-ecmp-algo
IPv4 ECMP algo is fp
<fp-0> route4-ecmp-algo-set linux
IPv4 ECMP algo is linux
Route metric¶
Synopsis
The fast path supports several IPv4 routes to the same destination with different metrics (a.k.a. priority or preference). Unlike an ECMP route, packets can only match the route with the lowest metric.
Example
Enable forwarding and configure eth1
and eth2
:
# echo 1 > /proc/sys/net/ipv4/conf/all/forwarding
# ip addr add 192.168.1.1/24 dev eth1
# ip link set up dev eth1
# ip addr add 192.168.2.1/24 dev eth2
# ip link set up dev eth2
Add 2 routes to 10.0.0.0/8
, with different metrics:
# ip route add 10.0.0.0/8 metric 200 via 192.168.1.2
# ip route add 10.0.0.0/8 metric 100 via 192.168.2.5
Display Linux IPv4 routes:
root@dut-vm:~# ip route
10.0.0.0/8 via 192.168.2.5 dev eth2 metric 100
10.0.0.0/8 via 192.168.1.2 dev eth1 metric 200
192.168.1.0/24 dev eth1 proto kernel scope link src 192.168.1.1
192.168.2.0/24 dev eth2 proto kernel scope link src 192.168.2.1
Display fast path IPv4 routes:
<fp-0> route4
# - Preferred, * - Active, > - selected
(254) 10.0.0.0/8 metric 100 [16] ROUTE gw 192.168.2.5 via eth2-vr0 (15)
(254) 10.0.0.0/8 metric 200 [15] ROUTE gw 192.168.1.2 via eth1-vr0 (14)
Each of these routes may itself be an ECMP route. Change route with metric 100 to an ECMP route:
# ip route change 10.0.0.0/8 metric 100 nexthop via 192.168.1.10 nexthop via 192.168.2.11
Display Linux IPv4 routes:
root@dut-vm:~# ip route
10.0.0.0/8 metric 100
nexthop via 192.168.1.10 dev eth1 weight 1
nexthop via 192.168.2.11 dev eth2 weight 1
10.0.0.0/8 via 192.168.1.2 dev eth1 metric 200
192.168.1.0/24 dev eth1 proto kernel scope link src 192.168.1.1
192.168.2.0/24 dev eth2 proto kernel scope link src 192.168.2.1
Display fast path IPv4 routes:
<fp-0> route4
# - Preferred, * - Active, > - selected
(254) 10.0.0.0/8 metric 100 Multipath Entry (15)
[20] # (p=001) ROUTE gw 192.168.2.11 via eth2-vr0
[19] # (p=001) ROUTE gw 192.168.1.10 via eth1-vr0
(254) 10.0.0.0/8 metric 200 [15] ROUTE gw 192.168.1.2 via eth1-vr0 (14)
Neighbors management¶
neigh4¶
Description
Display neighbors table.
Synopsis
neigh4 [<rt index>]
- <rt index>
- Index of the wanted RT.
Example
<fp-0> neigh4
R[000006] GW/NEIGH 10.23.4.204 00:1b:21:cc:0d:97 via eth3_0-vr0 REACHABLE (nh:6)
arp-hitflags-set¶
Description
Set interface ARP hitflags.
Synopsis
arp-hitflags-set <period in seconds> <max scanned> <max sent>
Parameters
- <period in seconds>
- Period in seconds of connection track checking.
- <max scanned>
- Maximum number of ARP to scan on a given period of time.
- <max sent>
- Maximum number of refresh messages to send over a given period of time.
Example
<fp-0> arp-hitflags-set 8 600 800
Displaying ARP/CT hitflags parameters¶
Description
Synopsis
hitflags [all]
hitflags [all|arp|conntrack|...]
Parameters
- No parameter
- Display parameters for all categories.
- all
- Same as wit no parameters.
- arp
- Display only ARP category.
- conntrack
- Display only IPv4 conntrack category.
Example
<fp-0> hitflags arp
arp hitflags
period_in_seconds:8
max_scanned:600
max_sent:800
Addresses management¶
addr4¶
Description
Display IPv4 addresses of a given interface.
Synopsis
addr4 <iface>
Parameters
- <iface>
- Name of the interface.
Examples
<fp-0> addr4 eth0
number of ip address: 1
10.0.2.15 [0]
Routes management¶
rt4¶
Description
Display the rt_entry
table.
Synopsis
rt4 [<rt index>]
Parameters
- No parameter
- Display whole
rt_entry
table. - <rt index>
- Index to display specifically in
rt_table
.
Example
<fp-0> rt4
R[000001] GW/ADDRESS 0.0.0.0 00:00:00:00:00:00 via eth1-vr0 NONE (nh:1)
R[000002] IFACE/CONNECTED src 10.22.4.104 via eth1-vr0 (nh:2)
R[000003] GW/ADDRESS 0.0.0.0 00:00:00:00:00:00 via eth3-vr0 NONE (nh:3)
R[000004] IFACE/CONNECTED src 10.23.4.104 via eth3-vr0 (nh:4)
R[000005] GW/NEIGH 10.23.4.204 00:1b:21:cc:0d:97 via eth3-vr0 REACHABLE (nh:5)
R[000006] GW/NEIGH 10.22.4.118 00:15:17:34:2a:d8 via eth1-vr0 REACHABLE (nh:6)
R[000007] GW/NEIGH 10.23.4.204 00:1b:21:cc:0d:97 via eth3-vr0 REACHABLE (nh:5)
nh4¶
Description
Dump the Next-Hop table.
Synopsis
nh4 [<nh index>]
Parameters
- No parameter
- Display whole next hop table.
- <nh index>
- Index to display specifically in next hop table.
Example
<fp-0> nh4
N4[0001]GW/ADDRESS 0.0.0.0 00:00:00:00:00:00 via eth1-vr0 NONE refcnt=1
N4[0002]IFACE/CONNECTED src 10.22.4.104 via eth1-vr0 refcnt=1
N4[0003]GW/ADDRESS 0.0.0.0 00:00:00:00:00:00 via eth3-vr0 NONE refcnt=1
N4[0004]IFACE/CONNECTED src 10.23.4.104 via eth3-vr0 refcnt=1
N4[0005]GW/NEIGH 10.23.4.204 00:1b:21:cc:0d:97 via eth3-vr0 REACHABLE refcnt=2
N4[0006]GW/NEIGH 10.22.4.118 00:15:17:34:2a:d8 via eth1-vr0 REACHABLE refcnt=1
Displaying IPv4 routes¶
Description
Display the user routing entries.
Synopsis
route4 [dst <addr dst>|<addr dst/prefix> [src <addr src>]]|[type TYPE]
Parameters
- No parameter
- Display only routes configured by user.
- dst <addr dst>|<addr dst/prefix>
- Search a route by destination address with or without prefix.
- src <addr src>
- Reduce search to a specific source address.
- type TYPE
Display routes with a specific type:
Type description all Display all kind of routes. fpm Display routes configured via fpm
.local Display local routes, ones to hosts on directly connected networks. neigh Display routes to neighbor hosts. connected Display routes to connected hosts. black Display black hole routes.
Example
<fp-0> route4
# - Preferred, * - Active, > - selected
0.0.0.0/0 [03] NEIGH gw 10.0.2.2 via eth0-vr0 (8)
10.200.0.0/24 [11] NEIGH gw 10.125.0.2 via ntfp2-vr0 (16)
<fp-0> route4 type fpm
# - Preferred, * - Active, > - selected
0.0.0.0/32 [5001] LOCAL (1)
224.0.0.0/4 [5001] LOCAL (3)
255.255.255.255/32 [5001] LOCAL (2)
<fp-0> route4 type local
0.0.0.0/32 [5001] LOCAL (1)
224.0.0.0/4 [5001] LOCAL (3)
255.255.255.255/32 [5001] LOCAL (2)
<fp-0> route4 type neigh
# - Preferred, * - Active, > - selected
10.0.2.2/32 [03] NEIGH gw 10.0.2.2 (N) via eth0-vr0 (7)
10.0.2.3/32 [02] NEIGH gw 10.0.2.3 (N) via eth0-vr0 (6)
10.100.0.1/32 [12] NEIGH gw 10.100.0.1 (N) via ntfp1-vr0 (17)
10.125.0.2/32 [11] NEIGH gw 10.125.0.2 (N) via ntfp2-vr0 (18)
<fp-0> route4 type connected
# - Preferred, * - Active, > - selected
10.0.2.0/24 [04] CONNECTED via eth0-vr0 (9)
10.100.0.0/24 [06] CONNECTED via ntfp1-vr0 (11)
10.125.0.0/24 [08] CONNECTED via ntfp2-vr0 (13)
10.175.0.0/24 [10] CONNECTED via ntfp3-vr0 (15)
<fp-0> route4 type black
# - Preferred, * - Active, > - selected
127.0.0.0/8 [5002] BLACKHOLE (4)
<fp-0> route4 type all
# - Preferred, * - Active, > - selected
0.0.0.0/32 [5001] LOCAL (1)
0.0.0.0/0 [03] NEIGH gw 10.0.2.2 via eth0-vr0 (8)
10.0.2.0/24 [04] CONNECTED via eth0-vr0 (9)
10.0.2.2/32 [03] NEIGH gw 10.0.2.2 (N) via eth0-vr0 (7)
10.0.2.3/32 [02] NEIGH gw 10.0.2.3 (N) via eth0-vr0 (6)
10.0.2.15/32 [01] ADDRESS via eth0-vr0 (5)
10.100.0.0/24 [06] CONNECTED via ntfp1-vr0 (11)
10.100.0.1/32 [12] NEIGH gw 10.100.0.1 (N) via ntfp1-vr0 (17)
10.100.0.2/32 [05] ADDRESS via ntfp1-vr0 (10)
10.125.0.0/24 [08] CONNECTED via ntfp2-vr0 (13)
10.125.0.1/32 [07] ADDRESS via ntfp2-vr0 (12)
10.125.0.2/32 [11] NEIGH gw 10.125.0.2 (N) via ntfp2-vr0 (18)
10.175.0.0/24 [10] CONNECTED via ntfp3-vr0 (15)
10.175.0.1/32 [09] ADDRESS via ntfp3-vr0 (14)
10.200.0.0/24 [11] NEIGH gw 10.125.0.2 via ntfp2-vr0 (16)
127.0.0.0/8 [5002] BLACKHOLE (4)
224.0.0.0/4 [5001] LOCAL (3)
Displaying the filling of each IPv4 table in memory¶
Synopsis
route4-filling
Example
<fp-0> route4-filling
IPv4 tables filling:
fp_8_table_shared: 14/11000 (0.127273%) IPv4:6
fp_8_entries_shared: 1544/2816000 (0.054830%)
fp_rt4_table: 9/50001 (0.018000%)
fp_nh4_table: 4/5001 (0.079984%)
iface-preference-set¶
Description
Set interface preference, when routing ECMP, give higher priority when selecting next hop for this interface.
Synopsis
iface-preference-set <iface> on|off
Parameters
- <iface>
- Name of the interface.
- on or off
- Enable or not preference flag on interface.
Example
<fp-0> iface-preference-set eth1 on
VRF support¶
Some commands (like route4
) are executed in the current VRF, you can use
vrf-exec
or vrf-set
to execute these commands in another or all VRF.
Example
<fp-0> route4
# - Preferred, * - Active, > - selected
100.0.0.0/16 [01] ROUTE gw 192.168.0.1 via eth0_0-vr0 (5)
<fp-0> vrf-set 1
New reference for VRF: 1
<fp-1> route4
# - Preferred, * - Active, > - selected
<fp-1> vrf-exec all route4
vrf0:
# - Preferred, * - Active, > - selected
0.0.0.0/0 [02] NEIGH gw 10.0.2.2 via eth0-vr0 (8)
vrf1:
# - Preferred, * - Active, > - selected
<fp-1>
RPF check¶
RPF check action is managed on a per interface basis. This
behavior is synchronized from Linux. It is however possible to force
RPF check at fast path level whatever the Linux configuration is,
using the rpf4-set
command.
Displaying IPv4 RPF flag status¶
Synopsis
rpf4 <iface>
Parameters
- <iface>
- Name of the interface.
Example
<fp-0> rpf4 eth3
eth3: IPv4 RPF is off
Setting IPv4 RPF flag¶
Synopsis
rpf4-set <iface> on|off|linux-sync
Parameters
- <iface>
- Name of the interface.
- on, off or linux-sync
- “on” means : always perform RPF, “off” means: don’t perform RPF at all. “linux-sync” means perfrom RPF based on the config synced from the linux kernel. If this argument is omitted, only the status of the RPF check is displayed.
Example
<fp-0> rpf4-set eth3 on
eth3: IPv4 RPF is on
<fp-0> rpf4-set eth3 linux-sync
eth3: IPv4 RPF is linux-sync (current : on)
<fp-0> iface
9:eth3 [VR-0] ifid=9 (port 2) <UP|RUNNING|FWD4|FWD6|RPF4> (0x463)
type=ether mac=00:1b:21:c5:7f:76 mtu=1500 tcp4mss=0 tcp6mss=0
IPv4 routes=0 IPv6 routes=0
if_ops: rx_dev=none tx_dev=none ip_output=none
note that the RPF flag displayed by the iface
command reflects the
operating status for RPF, no matter whether coming from Linux synchronization
or fast path enforcement.
TCP MSS clamping¶
TCP MSS (Maximum Segment Size) clamping can be configured by interface.
tcpmss4-set¶
Description
Change default value of MSS. 0 means no change is made in packet.
Synopsis
tcpmss4-set <iface> <mss4>
Parameters
- <iface>
- Name of the interface.
- <mss4>
- MSS, default is 0 (disabled).
Example
<fp-0> tcpmss4-set eth0 1400
Statistics¶
ip4-stats¶
Description
Display IPv4 statistics.
Synopsis
ip4-stats [percore] [non-zero]
Parameters
- percore
- Display all statistics per core running the fast path.
- non-zero
- Display only statistics that are not null.
Example
<fp-0> ip4-stats
IpForwDatagrams:682
IpInReceives:682
IpInDelivers:447
IpInHdrErrors:0
IpInTruncatedPkts:0
IpInAddrErrors:0
IpDroppedNoArp:0
IpDroppedNoMemory:0
IpDroppedForwarding:0
IpDroppedIPsec:0
IpDroppedBlackhole:0
IpDroppedInvalidInterface:0
IpDroppedNetfilter:0
IpDroppedRouteException:0
IpReasmReqds:0
IpReasmOKs:0
IpReasmFails:0
IpReasmExceptions:0
IpFragOKs:0
IpFragFails:0
IpReasmTimeout:0
IpFragCreates:0
IpCsumErrors:0
IpReasmErrorPacketTooShort:0
IpReasmErrorTooManySegments:0
IpReasmErrorHeaderEncap:0
IpReasmErrorQueueFull:0
IpReasmErrorIPOptionUnsupported:0
IpReasmErrorSizeExceed:0
IpReasmErrorLastAlreadyReceived:0
IpReasmErrorSizeOverflow:0
IpReasmErrorOverlapPrevious:0
IpReasmErrorOverlapNext:0
IpReasmErrorQueueAlloc:0
IpReasmErrorOffsetTooLarge:0
IpReasmDroppedSessionComplete:0
IpReasmDroppedSessionAlreadyFull:0
IpReasmDroppedDuplicate:0
Transparent IP options support¶
The default handling of IP packets using a non-default header length is to send these packets to control plane, where the kernel will have a specific management (for example, add its IP address when a header requires “Record route”).
This option is used to ignore the non-default header length of the packets and forward the packets containing options as if they had a default header.
To enable or disable check of IPv4 options use the ip4-options
and
ip4-options-set
commands. If the options checking is disabled IP packets
with non-default header length are transparently forwarded.
Displaying fast path processing of IPv4 packets with options in header¶
Synopsis
ip4-options
Parameters
Example
<fp-0> ip4-options
IPv4 options are checked
Defining fast path processing of IPv4 packets with options in header¶
The default behavior of the fast path is to send IP packets with non-default header length to the control plane as exception packets.
Synopsis
ip4-options-set ignore|check
Parameters
- ignore or check
- Check: packets with extended option are sent as exception to the control plane.
Example
<fp-0> ip4-options
IPv4 options are checked
<fp-0> ip4-options-set ignore
IPv4 options are ignored