Project

General

Profile

FibMgmt » History » Version 25

Junxiao Shi, 02/24/2014 08:25 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 20 Junxiao Shi
The FIB management protocol uses [[Command Interests]]-Data exchange.
6 12 Alex Afanasyev
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 21 Alex Afanasyev
Request is a [[Command Interests|Signed Command Interest]] with the following name:
13 1 Junxiao Shi
14 21 Alex Afanasyev
    /localhost/nfd/fib/<command-verb>/<command-options>/............................
15 1 Junxiao Shi
16 21 Alex Afanasyev
    \                / \                              / \                          /
17
     -------  -------   -------------  ---------------   ------------  ------------
18
            \/                       \/                              \/
19
    NFD Control Command       FibManager command              Command Interest
20
    to FibManager             and command options            related information
21 1 Junxiao Shi
22
23 24 Junxiao Shi
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
Note that `Name` field is required for `FibManagementOptions` block.
26 1 Junxiao Shi
27
    FibManagementOptions ::= FIB-MANAGEMENT-OPTIONS-TYPE TLV-LENGTH
28 18 Alex Afanasyev
                               Name
29 12 Alex Afanasyev
                               FaceId?
30
                               Cost?
31
                               Strategy?
32
    
33
    // Name defined in NDN-TLV spec
34 10 Junxiao Shi
35 12 Alex Afanasyev
    FaceId               ::= FACEID-TYPE TLV-LENGTH
36
                               nonNegativeInteger
37
    
38
    Cost                 ::= COST-TYPE TLV-LENGTH
39
                               nonNegativeInteger
40 1 Junxiao Shi
41 12 Alex Afanasyev
    Strategy             ::= STRATEGY-TYPE TLV-LENGTH
42 1 Junxiao Shi
                               Name
43 18 Alex Afanasyev
44 12 Alex Afanasyev
### Response
45
46 24 Junxiao Shi
Command response is a Data packet that contains TLV-encoded `ControlResponse` block, defined in [[ControlCommand|NFD Control Command specification]].
47 1 Junxiao Shi
48 24 Junxiao Shi
Content of `ControlResponse` on success:
49 1 Junxiao Shi
50 24 Junxiao Shi
Field in `ControlResponse` block | Value
51
-------------------------------- | -----
52
`StatusCode`                     | 200
53
`StatusText`                     | "Success"
54
`<StatusBody>`                   | `FibManagementOptions` block, either echoed or with updated `FaceId` field
55 1 Junxiao Shi
56 24 Junxiao Shi
Content of `ControlResponse` on error:
57 19 Alex Afanasyev
58 24 Junxiao Shi
Field in `ControlResponse` block | Value
59
-------------------------------- | -----
60
`StatusCode`                     | 4xx, 5xx, or other error codes based on RFC2616
61
`StatusText`                     | Human-readable description of the error
62
`<StatusBody>`                   | Not present
63 19 Alex Afanasyev
64 12 Alex Afanasyev
65 1 Junxiao Shi
### Operations
66 12 Alex Afanasyev
67 22 Alex Afanasyev
**FIB management protocol** supports five operations:
68 12 Alex Afanasyev
69 23 Alex Afanasyev
* **insert**: insert a FIB entry
70
* **delete**: delete a FIB entry
71
* **add-nexthop**: add a nexthop to a FIB entry
72
* **remove-nexthop**: remove a nexthop from a FIB entry
73
* **set-strategy**: set the forwarding strategy for a namespace
74 12 Alex Afanasyev
75 1 Junxiao Shi
## Insert a FIB entry
76 12 Alex Afanasyev
77 24 Junxiao Shi
**command-verb:** `insert`
78 12 Alex Afanasyev
79 24 Junxiao Shi
Required fields in `FibManagementOptions` block:
80 12 Alex Afanasyev
81 24 Junxiao Shi
* `Name`
82 1 Junxiao Shi
83
If a FIB entry for Name already exists, this command does nothing, but is still considered successful.
84 12 Alex Afanasyev
85
## Delete a FIB entry
86 1 Junxiao Shi
87 24 Junxiao Shi
**command-verb:** `delete`
88 12 Alex Afanasyev
89 24 Junxiao Shi
Required fields in `FibManagementOptions` block:
90 1 Junxiao Shi
91 24 Junxiao Shi
* `Name`
92 1 Junxiao Shi
93
If a FIB entry for Name does not exist, this command does nothing, but is still considered successful.
94
95
## Add a nexthop
96 12 Alex Afanasyev
97 24 Junxiao Shi
**command-verb:** `add-nexthop`
98 12 Alex Afanasyev
99 10 Junxiao Shi
This command adds a nexthop to an existing FIB entry.
100 12 Alex Afanasyev
101 24 Junxiao Shi
Required fields in `FibManagementOptions` block:
102 1 Junxiao Shi
103 24 Junxiao Shi
* `Name`
104
* `FaceId`
105
* `Cost`
106 1 Junxiao Shi
107
**FaceId** is the FaceId returned in [[FaceMgmt|NFD Face Management protocol]].
108
If **FaceId** is set to zero, it is implied as the face of the entity sending this command.
109
110
If the FIB entry does not exist, the response has StatusCode 404.
111
112 24 Junxiao Shi
If a nexthop of same `FaceId` exists on the FIB entry, its cost is updated.
113
114 12 Alex Afanasyev
## Remove a nexthop
115 1 Junxiao Shi
116 24 Junxiao Shi
**command-verb**: `remove-nexthop`
117 10 Junxiao Shi
118 12 Alex Afanasyev
This command removes a nexthop from a FIB entry.
119
Removing the last nexthop in a FIB entry will not automatically delete the FIB entry.
120 1 Junxiao Shi
121 24 Junxiao Shi
Required fields in `FibManagementOptions` block:
122 10 Junxiao Shi
123 24 Junxiao Shi
* `Name`
124
* `FaceId`
125 12 Alex Afanasyev
126 24 Junxiao Shi
**FaceId** is the FaceId returned in [[FaceMgmt|NFD Face Management protocol]].
127 10 Junxiao Shi
If **FaceId** is set to zero, it is implied as the face of the entity sending this command.
128 1 Junxiao Shi
129 12 Alex Afanasyev
If the FIB entry does not exist, the response has StatusCode 404.
130 1 Junxiao Shi
131 12 Alex Afanasyev
If the specified nexthop does not exist on the FIB entry, this command does nothing,
132
but is still considered successful.
133 1 Junxiao Shi
134 10 Junxiao Shi
## Set strategy
135 1 Junxiao Shi
136 24 Junxiao Shi
**command-verb**: `set-strategy`
137 1 Junxiao Shi
138 24 Junxiao Shi
This command sets the forwarding strategy for a namespace.
139 1 Junxiao Shi
140 24 Junxiao Shi
Required fields in `FibManagementOptions` block:
141 1 Junxiao Shi
142 24 Junxiao Shi
* `Name`
143
* `Strategy`
144
145
**Strategy** must be a `Name` that represents a builtin strategy:
146
147
* ndn:/localhost/nfd/strategy/best-route
148
* ndn:/localhost/nfd/strategy/broadcast
149
* ndn:/localhost/nfd/strategy/ncc
150
151
If the FIB entry does not exist, the response has StatusCode 404.
152
153 25 Junxiao Shi
If the Strategy does not match any builtin strategy, the response has StatusCode 405.
154 1 Junxiao Shi
155
## TLV-TYPE assignments
156
157
Type                                        | Assigned value    | Assigned value (hex)
158 15 Alex Afanasyev
------------------------------------------- | ----------------- | --------------------
159
FibManagementOptions                        | 104               | 0x68
160 17 Alex Afanasyev
FaceId                                      | 105               | 0x69
161
Cost                                        | 106               | 0x6a
162 1 Junxiao Shi
Strategy                                    | 107               | 0x6b