FibMgmt » History » Version 27
Junxiao Shi, 03/06/2014 09:42 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 | |||
| 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 | ### Response |
| 41 | |||
| 42 | 24 | Junxiao Shi | Command response is a Data packet that contains TLV-encoded `ControlResponse` block, defined in [[ControlCommand|NFD Control Command specification]]. |
| 43 | 1 | Junxiao Shi | |
| 44 | 24 | Junxiao Shi | Content of `ControlResponse` on success: |
| 45 | 1 | Junxiao Shi | |
| 46 | 24 | Junxiao Shi | Field in `ControlResponse` block | Value |
| 47 | -------------------------------- | ----- |
||
| 48 | `StatusCode` | 200 |
||
| 49 | `StatusText` | "Success" |
||
| 50 | `<StatusBody>` | `FibManagementOptions` block, either echoed or with updated `FaceId` field |
||
| 51 | 1 | Junxiao Shi | |
| 52 | 24 | Junxiao Shi | Content of `ControlResponse` on error: |
| 53 | 19 | Alex Afanasyev | |
| 54 | 24 | Junxiao Shi | Field in `ControlResponse` block | Value |
| 55 | -------------------------------- | ----- |
||
| 56 | `StatusCode` | 4xx, 5xx, or other error codes based on RFC2616 |
||
| 57 | `StatusText` | Human-readable description of the error |
||
| 58 | `<StatusBody>` | Not present |
||
| 59 | 1 | Junxiao Shi | |
| 60 | 19 | Alex Afanasyev | |
| 61 | 12 | Alex Afanasyev | ### Operations |
| 62 | 1 | Junxiao Shi | |
| 63 | 27 | Junxiao Shi | **FIB management protocol** supports two operations: |
| 64 | 23 | Alex Afanasyev | |
| 65 | 1 | Junxiao Shi | * **add-nexthop**: add a nexthop to a FIB entry |
| 66 | 23 | Alex Afanasyev | * **remove-nexthop**: remove a nexthop from a FIB entry |
| 67 | 24 | Junxiao Shi | |
| 68 | 1 | Junxiao Shi | ## Add a nexthop |
| 69 | |||
| 70 | **command-verb:** `add-nexthop` |
||
| 71 | 12 | Alex Afanasyev | |
| 72 | 27 | Junxiao Shi | This command adds a nexthop to a FIB entry. |
| 73 | If the FIB entry does not exist, it is inserted automatically. |
||
| 74 | 10 | Junxiao Shi | |
| 75 | 12 | Alex Afanasyev | Required fields in `FibManagementOptions` block: |
| 76 | 24 | Junxiao Shi | |
| 77 | 1 | Junxiao Shi | * `Name` |
| 78 | 24 | Junxiao Shi | * `FaceId` |
| 79 | * `Cost` |
||
| 80 | |||
| 81 | 1 | Junxiao Shi | **FaceId** is the FaceId returned in [[FaceMgmt|NFD Face Management protocol]]. |
| 82 | If **FaceId** is set to zero, it is implied as the face of the entity sending this command. |
||
| 83 | |||
| 84 | If a nexthop of same `FaceId` exists on the FIB entry, its cost is updated. |
||
| 85 | 24 | Junxiao Shi | |
| 86 | ## Remove a nexthop |
||
| 87 | 12 | Alex Afanasyev | |
| 88 | 24 | Junxiao Shi | **command-verb**: `remove-nexthop` |
| 89 | 10 | Junxiao Shi | |
| 90 | 12 | Alex Afanasyev | This command removes a nexthop from a FIB entry. |
| 91 | 27 | Junxiao Shi | If the last nexthop record in a FIB entry is removed, the FIB entry is also deleted. |
| 92 | 1 | Junxiao Shi | |
| 93 | 24 | Junxiao Shi | Required fields in `FibManagementOptions` block: |
| 94 | 10 | Junxiao Shi | |
| 95 | 24 | Junxiao Shi | * `Name` |
| 96 | * `FaceId` |
||
| 97 | 12 | Alex Afanasyev | |
| 98 | 24 | Junxiao Shi | **FaceId** is the FaceId returned in [[FaceMgmt|NFD Face Management protocol]]. |
| 99 | 10 | Junxiao Shi | If **FaceId** is set to zero, it is implied as the face of the entity sending this command. |
| 100 | 1 | Junxiao Shi | |
| 101 | 12 | Alex Afanasyev | If the FIB entry does not exist, the response has StatusCode 404. |
| 102 | 24 | Junxiao Shi | |
| 103 | If the specified nexthop does not exist on the FIB entry, this command does nothing, |
||
| 104 | 25 | Junxiao Shi | but is still considered successful. |
| 105 | 1 | Junxiao Shi | |
| 106 | ## TLV-TYPE assignments |
||
| 107 | |||
| 108 | Type | Assigned value | Assigned value (hex) |
||
| 109 | 15 | Alex Afanasyev | ------------------------------------------- | ----------------- | -------------------- |
| 110 | 17 | Alex Afanasyev | FibManagementOptions | 104 | 0x68 |
| 111 | FaceId | 105 | 0x69 |
||
| 112 | 1 | Junxiao Shi | Cost | 106 | 0x6a |