Project

General

Profile

FibMgmt » History » Version 17

Alex Afanasyev, 01/30/2014 05:16 PM

1 2 Junxiao Shi
# NFD FIB Management Protocol
2 1 Junxiao Shi
3 2 Junxiao Shi
The **FIB management protocol** allows an entity to manipulate the FIB entry.
4 1 Junxiao Shi
5 12 Alex Afanasyev
The FIB management protocol uses [[Signed Interests]]-Data exchange.
6
The command request and response follows the [[ControlCommand|NFD Control Command specification]]
7 10 Junxiao Shi
8 12 Alex Afanasyev
## Command format
9 1 Junxiao Shi
10 12 Alex Afanasyev
### Request
11 1 Junxiao Shi
12 12 Alex Afanasyev
Request is a signed Interest with the following name:
13 1 Junxiao Shi
14 12 Alex Afanasyev
    /localhost/nfd/fib/<command-verb>/<command-options>/<timestamp>/<SignatureInfo>/<SignatureValue>
15 1 Junxiao Shi
16 12 Alex Afanasyev
    \                / \                              / \                                          /
17
     -------  -------   -------------  ---------------   --------------------  --------------------
18
            \/                       \/                                      \/
19
    NFD Control Command       FibManager command             Signed Interest related information
20
    to FibManager             and command options
21 1 Junxiao Shi
22
23 12 Alex Afanasyev
Command options is defined as a TLV-encoded ``FibManagementOptions`` block.
24
Each individual command defines a subset of required and optional elements in the ``FibManagementOptions`` block.
25 1 Junxiao Shi
26 12 Alex Afanasyev
    FibManagementOptions ::= FIB-MANAGEMENT-OPTIONS-TYPE TLV-LENGTH
27
                               Name?
28
                               FaceId?
29
                               Cost?
30
                               Strategy?
31
    
32
    // Name defined in NDN-TLV spec
33 10 Junxiao Shi
34 12 Alex Afanasyev
    FaceId               ::= FACEID-TYPE TLV-LENGTH
35
                               nonNegativeInteger
36
    
37
    Cost                 ::= COST-TYPE TLV-LENGTH
38
                               nonNegativeInteger
39 1 Junxiao Shi
40 12 Alex Afanasyev
    Strategy             ::= STRATEGY-TYPE TLV-LENGTH
41
                               Name
42 1 Junxiao Shi
43 12 Alex Afanasyev
### Response
44
45
Command response is a Data packet that contains TLV-encoded ``ControlResponse`` block, defined in [[ControlCommand|NFD Control Command specification]].
46
47 10 Junxiao Shi
The response has StatusCode 200 if the command succeeds.
48 1 Junxiao Shi
49 12 Alex Afanasyev
<!-- Alex: Should positive responses contain TLV-Encoded ``FibManagementOptions`` block related to the command (after StatusText)? -->
50 1 Junxiao Shi
51 12 Alex Afanasyev
Any other status code (4xx, 5xx, [?]) mean error.
52
Description of the error can be present in ``StatusText`` field of ``ControlResponse`` command.
53 1 Junxiao Shi
54 12 Alex Afanasyev
### Operations
55 1 Junxiao Shi
56 12 Alex Afanasyev
**FIB management protocol** protocol supports five operations:
57 1 Junxiao Shi
58 12 Alex Afanasyev
* insert a FIB entry (command-verb: ``insert``)
59
* delete a FIB entry (command-verb: ``delete``)
60
* add a nexthop to a FIB entry (command-verb: ``add-nexthop``)
61
* remove a nexthop from a FIB entry (command-verb: ``remove-nexthop``)
62
* set the forwarding strategy for a namespace (command-verb: ``set-strategy``)
63 1 Junxiao Shi
64 12 Alex Afanasyev
## Insert a FIB entry
65 1 Junxiao Shi
66 12 Alex Afanasyev
**command-verb:** ``insert``
67 1 Junxiao Shi
68 12 Alex Afanasyev
Required fields in ``FibManagementOptions`` block:
69 10 Junxiao Shi
70 12 Alex Afanasyev
* ``Name``
71 10 Junxiao Shi
72 12 Alex Afanasyev
If a FIB entry for Name already exists, this command does nothing, but is still considered successful.
73 1 Junxiao Shi
74 12 Alex Afanasyev
## Delete a FIB entry
75
76
**command-verb:** ``delete``
77
78
Required fields in ``FibManagementOptions`` block:
79
80
* ``Name``
81
82
If a FIB entry for Name does not exist, this command does nothing, but is still considered successful.
83
84 1 Junxiao Shi
## Add a nexthop
85
86 12 Alex Afanasyev
**command-verb:** ``add-nexthop``
87 1 Junxiao Shi
88 12 Alex Afanasyev
This command adds a nexthop to an existing FIB entry.
89 1 Junxiao Shi
90 12 Alex Afanasyev
Required fields in ``FibManagementOptions`` block:
91 10 Junxiao Shi
92 12 Alex Afanasyev
* ``Name``
93
* ``FaceId``
94
* ``Cost``
95 1 Junxiao Shi
96 12 Alex Afanasyev
If a nexthop of same ``FaceId`` exists on the FIB entry, its cost is updated.
97 1 Junxiao Shi
98 13 Junxiao Shi
**FaceId** is the FaceId returned in [[FaceMgmt|NFD Face Management protocol]].
99 10 Junxiao Shi
100 12 Alex Afanasyev
If **FaceId** is set to zero, it is implied as the face of the entity sending this command.
101
102 1 Junxiao Shi
If the FIB entry does not exist, the response has StatusCode 404.
103 10 Junxiao Shi
104
## Remove a nexthop
105
106 12 Alex Afanasyev
**command-verb**: ``remove-nexthop``
107
108
This command removes a nexthop from a FIB entry.
109 10 Junxiao Shi
Removing the last nexthop in a FIB entry will not automatically delete the FIB entry.
110 1 Junxiao Shi
111 12 Alex Afanasyev
Required fields in ``FibManagementOptions`` block:
112 1 Junxiao Shi
113 12 Alex Afanasyev
* ``Name``
114
* ``FaceId``
115 1 Junxiao Shi
116 10 Junxiao Shi
**FaceId** is the FaceId returned in *NFD Face Management protocol*.
117 1 Junxiao Shi
If **FaceId** is set to zero, it is implied as the face of the entity sending this command.
118
119
120
If the FIB entry does not exist, the response has StatusCode 404.
121
122
If the specified nexthop does not exist on the FIB entry, this command does nothing,
123
but is still considered successful.
124
125 10 Junxiao Shi
126
## Set strategy
127
128 12 Alex Afanasyev
This command sets a forwarding strategy for a namespace.
129 1 Junxiao Shi
130
The format of this command will be defined in a later version of this spec.
131
132 12 Alex Afanasyev
Required fields in ``FibManagementOptions`` block:
133 1 Junxiao Shi
134 12 Alex Afanasyev
* ``Name``
135
* ``Strategy``
136
137 1 Junxiao Shi
## TLV-TYPE assignments
138
139
Type                                        | Assigned value    | Assigned value (hex)
140
------------------------------------------- | ----------------- | --------------------
141 15 Alex Afanasyev
FibManagementOptions                        | 104               | 0x68
142
FaceId                                      | 105               | 0x69
143 17 Alex Afanasyev
Cost                                        | 106               | 0x6a
144
Strategy                                    | 107               | 0x6b