Project

General

Profile

FibMgmt » History » Version 22

Alex Afanasyev, 02/18/2014 01:08 AM

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 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 18 Alex Afanasyev
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
Command response is a Data packet that contains TLV-encoded ``ControlResponse`` block, defined in [[ControlCommand|NFD Control Command specification]].
47 1 Junxiao Shi
48 19 Alex Afanasyev
Content of ``ControlResponse`` on success:
49 1 Junxiao Shi
50 19 Alex Afanasyev
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 19 Alex Afanasyev
Content of ``ControlResponse`` on error:
57
58
Field in ``ControlResponse`` block | Value
59
---------------------------------- | -----
60
``StatusCode``                     | 4xx, 500x, or other error codes based on RFC2616
61
``StatusText``                     | Human-readable description of the error
62
``<StatusBody>``                   | Not present
63
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
* insert a FIB entry (command-verb: ``insert``)
70
* delete a FIB entry (command-verb: ``delete``)
71
* add a nexthop to a FIB entry (command-verb: ``add-nexthop``)
72
* remove a nexthop from a FIB entry (command-verb: ``remove-nexthop``)
73 1 Junxiao Shi
* set the forwarding strategy for a namespace (command-verb: ``set-strategy``)
74 12 Alex Afanasyev
75 1 Junxiao Shi
## Insert a FIB entry
76 12 Alex Afanasyev
77 1 Junxiao Shi
**command-verb:** ``insert``
78 12 Alex Afanasyev
79 10 Junxiao Shi
Required fields in ``FibManagementOptions`` block:
80 12 Alex Afanasyev
81 10 Junxiao Shi
* ``Name``
82 12 Alex Afanasyev
83 1 Junxiao Shi
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
87
**command-verb:** ``delete``
88
89
Required fields in ``FibManagementOptions`` block:
90
91
* ``Name``
92
93
If a FIB entry for Name does not exist, this command does nothing, but is still considered successful.
94 1 Junxiao Shi
95
## Add a nexthop
96 12 Alex Afanasyev
97 1 Junxiao Shi
**command-verb:** ``add-nexthop``
98 12 Alex Afanasyev
99 1 Junxiao Shi
This command adds a nexthop to an existing FIB entry.
100 12 Alex Afanasyev
101 10 Junxiao Shi
Required fields in ``FibManagementOptions`` block:
102 12 Alex Afanasyev
103
* ``Name``
104
* ``FaceId``
105 1 Junxiao Shi
* ``Cost``
106 12 Alex Afanasyev
107 1 Junxiao Shi
If a nexthop of same ``FaceId`` exists on the FIB entry, its cost is updated.
108 13 Junxiao Shi
109 10 Junxiao Shi
**FaceId** is the FaceId returned in [[FaceMgmt|NFD Face Management protocol]].
110 12 Alex Afanasyev
111
If **FaceId** is set to zero, it is implied as the face of the entity sending this command.
112 1 Junxiao Shi
113 10 Junxiao Shi
If the FIB entry does not exist, the response has StatusCode 404.
114
115
## Remove a nexthop
116 12 Alex Afanasyev
117
**command-verb**: ``remove-nexthop``
118
119 10 Junxiao Shi
This command removes a nexthop from a FIB entry.
120 1 Junxiao Shi
Removing the last nexthop in a FIB entry will not automatically delete the FIB entry.
121 12 Alex Afanasyev
122 1 Junxiao Shi
Required fields in ``FibManagementOptions`` block:
123 12 Alex Afanasyev
124
* ``Name``
125 1 Junxiao Shi
* ``FaceId``
126 10 Junxiao Shi
127 1 Junxiao Shi
**FaceId** is the FaceId returned in *NFD Face Management protocol*.
128
If **FaceId** is set to zero, it is implied as the face of the entity sending this command.
129
130
131
If the FIB entry does not exist, the response has StatusCode 404.
132
133
If the specified nexthop does not exist on the FIB entry, this command does nothing,
134
but is still considered successful.
135 10 Junxiao Shi
136
137
## Set strategy
138 12 Alex Afanasyev
139 1 Junxiao Shi
This command sets a forwarding strategy for a namespace.
140
141
The format of this command will be defined in a later version of this spec.
142 12 Alex Afanasyev
143 1 Junxiao Shi
Required fields in ``FibManagementOptions`` block:
144 12 Alex Afanasyev
145
* ``Name``
146
* ``Strategy``
147 1 Junxiao Shi
148
## TLV-TYPE assignments
149
150
Type                                        | Assigned value    | Assigned value (hex)
151 15 Alex Afanasyev
------------------------------------------- | ----------------- | --------------------
152
FibManagementOptions                        | 104               | 0x68
153 17 Alex Afanasyev
FaceId                                      | 105               | 0x69
154
Cost                                        | 106               | 0x6a
155 1 Junxiao Shi
Strategy                                    | 107               | 0x6b