docs: better docs, mv doxygen to sphinx
[vpp.git] / docs / developer / corefeatures / fib / debugging.rst
1 .. _debugging:
2
3 Debugging
4 ---------
5
6 the anatomy of a route:
7
8 .. code-block:: console
9
10   BGvpp# sh ip fib 1.1.1.3/32
11   ipv4-VRF:0, fib_index:0, flow hash:[src dst sport dport proto ] epoch:0 flags:none locks:[adjacency:1, recursive-resolution:4, default-route:1, ]
12   1.1.1.0/24 fib:0 index:9 locks:2
13     CLI refs:1 src-flags:added,contributing,active,
14       path-list:[24] locks:4 flags:shared, uPRF-list:11 len:1 itfs:[1, ]
15         path:[26] pl-index:24 ip4 weight=1 pref=0 attached-nexthop:  oper-flags:resolved,
16           10.0.0.1 loop0
17         [@0]: arp-ipv4: via 10.0.0.1 loop0
18
19    forwarding:   unicast-ip4-chain
20     [@0]: dpo-load-balance: [proto:ip4 index:11 buckets:1 uRPF:11 to:[0:0]]
21       [0] [@3]: arp-ipv4: via 10.0.0.1 loop0
22
23 let's go line by line.
24
25 .. code-block:: console
26
27      ipv4-VRF:0, fib_index:0, flow hash:[src dst sport dport proto ] epoch:0 flags:none locks:[adjacency:1, recursive-resolution:4, default-route:1, ]
28
29 Each field in turn:
30
31 - ipv4-VRF:0: the name of the table (as given by the user, or
32   automatically generated by VPP).
33 - fib-index:0; in the VPP pool of FIB objects, this is index 0
34 - flow hash:[src dst sport dport proto ]: When calculating the flow
35   hash to use for load-balancing, these are the fields in the packet
36   that are used. There is an API to change this per-table.
37 - epoch:0; Used during mark-n-sweep.
38 - flags:none; use the force, to find the per-table flags.
39 - locks: per-source reference counting, a table can only be deleted
40   when all sources no longer reference it.
41
42 next line:
43
44 .. code-block:: console
45
46    1.1.1.0/24 fib:0 index:9 locks:2
47
48 this shows the route that matched the show request. note that it is not
49 an exact match, it's an LPM. The route is in FIB index 0, its index
50 (in the VPP pool of fib_entry_t objects) is nine and there are two
51 references to the entry.
52 You'll get the same output if you type "sh fib entry 9"
53
54 next line:
55
56 .. code-block:: console
57
58     CLI refs:1 src-flags:added,contributing,active,
59
60 the 'CLI' has sourced this route (it was added via CLI). This source
61 has been added (well duh) it is 'active', meaning it is the best
62 source, and it is contributing a forwarding object. There are some
63 scenarios where sources other than the active source contribute,
64 namely interpose sources.
65
66 next line:
67
68 .. code-block:: console
69
70       path-list:[24] locks:4 flags:shared, uPRF-list:11 len:1 itfs:[1, ]
71
72 This is path-list inex 24 (see "sh fib path-list 24" this will also
73 show the  children), it is 'shared',
74 meaning that if other prefixes were to use the same set of paths,
75 then they would also use this path-list object. It has uRPF list 11 of
76 length 1 containing interface index 1 (which is loop0, see "sh int").
77
78 next line:
79
80 .. code-block:: console
81
82         path:[26] pl-index:24 ip4 weight=1 pref=0 attached-nexthop:  oper-flags:resolved,
83           10.0.0.1 loop0
84         [@0]: arp-ipv4: via 10.0.0.1 loop0
85
86 This is path 26 (see "sh fib path 26"). It's a member of
87 path-list 24. It's ip4 has a weight of 1 and a preference of 0. It's
88 of type 'attached-nexthop' and currently resolved - woohoo.
89 It is a path 'via 10.0.0.1 loop0'. It is contributing an incomplete adjacency.
90
91 next line:
92
93 .. code-block:: console
94
95   forwarding:   unicast-ip4-chain
96     [@0]: dpo-load-balance: [proto:ip4 index:11 buckets:1 uRPF:11 to:[0:0]]
97       [0] [@3]: arp-ipv4: via 10.0.0.1 loop0
98
99 This section describes how packets of type 'unicast-ip4' will be
100 forwarded. It is the result of processing the path information from
101 above.
102 Here we see load-balance object 11, which has 1 bucket/choice. It is
103 also linked to uRPF instance 11 (which it got from path-list 24).
104 In bucket 0 there is the incomplete adjacency that was contributed by
105 path 26.
106