FaceMgmt » History » Version 10
Junxiao Shi, 02/09/2014 09:29 PM
| 1 | 1 | Junxiao Shi | # NFD Face Management protocol |
|---|---|---|---|
| 2 | |||
| 3 | 9 | Junxiao Shi | The **Face Management protocol** allows an entity to request NFD daemon create and destroy faces. |
| 4 | 2 | Alex Afanasyev | |
| 5 | 9 | Junxiao Shi | The Face Management protocol uses [[Signed Interests]]-Data exchange. |
| 6 | 2 | Alex Afanasyev | The command request and response follows the [[ControlCommand|NFD Control Command specification]] |
| 7 | |||
| 8 | ## Command format |
||
| 9 | |||
| 10 | ### Request |
||
| 11 | |||
| 12 | Request is a signed Interest with the following name: |
||
| 13 | |||
| 14 | /localhost/nfd/faces/<command-verb>/<command-options>/<timestamp>/<SignatureInfo>/<SignatureValue> |
||
| 15 | |||
| 16 | \ / \ / \ / |
||
| 17 | -------- -------- ------------- --------------- -------------------- -------------------- |
||
| 18 | \/ \/ \/ |
||
| 19 | NFD Control Command FaceManager command Signed Interest related information |
||
| 20 | to FaceManager and command options |
||
| 21 | |||
| 22 | |||
| 23 | 9 | Junxiao Shi | Command options is defined as a TLV-encoded `FaceManagementOptions` block. |
| 24 | Each individual command defines a subset of required and optional elements in the `FaceManagementOptions` block. |
||
| 25 | 2 | Alex Afanasyev | |
| 26 | 1 | Junxiao Shi | FaceManagementOptions ::= FACE-MANAGEMENT-OPTIONS-TYPE TLV-LENGTH |
| 27 | FaceId? |
||
| 28 | 9 | Junxiao Shi | Uri? |
| 29 | 1 | Junxiao Shi | |
| 30 | FaceId ::= FACEID-TYPE TLV-LENGTH |
||
| 31 | 2 | Alex Afanasyev | nonNegativeInteger |
| 32 | 9 | Junxiao Shi | |
| 33 | Uri ::= URI-TYPE TLV-LENGTH |
||
| 34 | UTF-8 string |
||
| 35 | 1 | Junxiao Shi | |
| 36 | ### Response |
||
| 37 | |||
| 38 | 9 | Junxiao Shi | Command response is a Data packet that contains TLV-encoded `ControlResponse` block, defined in [[ControlCommand|NFD Control Command specification]]. |
| 39 | 1 | Junxiao Shi | |
| 40 | The response has StatusCode 200 if the command succeeds. |
||
| 41 | |||
| 42 | 9 | Junxiao Shi | Any other status code (4xx, 5xx, [?]) means error. |
| 43 | Description of the error can be present in `StatusText` field of `ControlResponse` command. |
||
| 44 | 1 | Junxiao Shi | |
| 45 | 9 | Junxiao Shi | ## URI |
| 46 | 1 | Junxiao Shi | |
| 47 | 9 | Junxiao Shi | The underlying protocol and underlying address of a Face is expressed as a URI. |
| 48 | 2 | Alex Afanasyev | |
| 49 | 9 | Junxiao Shi | ### UDP unicast |
| 50 | 2 | Alex Afanasyev | |
| 51 | 9 | Junxiao Shi | `udp[4|6]://<remote-IP-or-host>[:<remote-port>]` |
| 52 | 1 | Junxiao Shi | |
| 53 | 9 | Junxiao Shi | Examples: |
| 54 | 1 | Junxiao Shi | |
| 55 | 9 | Junxiao Shi | * `udp://192.0.2.1:6363` (canonical form) |
| 56 | * `udp://192.0.2.1` (remote-port defaults to 6363) |
||
| 57 | * `udp://[2001:db8::1]:6363` (canonical form) |
||
| 58 | * `udp://example.net:6363` |
||
| 59 | * `udp4://example.net:6363` (resolve hostname to IPv4 address only) |
||
| 60 | * `udp6://example.net:6363` (resolve hostname to IPv6 address only) |
||
| 61 | 1 | Junxiao Shi | |
| 62 | 9 | Junxiao Shi | ### UDP multicast |
| 63 | 1 | Junxiao Shi | |
| 64 | 9 | Junxiao Shi | `udp-mcast://<multicast-IP>:<multicast-port>` |
| 65 | 1 | Junxiao Shi | |
| 66 | 9 | Junxiao Shi | Examples: |
| 67 | 1 | Junxiao Shi | |
| 68 | 9 | Junxiao Shi | * `udp://224.0.23.170:56363` |
| 69 | 1 | Junxiao Shi | |
| 70 | 9 | Junxiao Shi | ### TCP |
| 71 | 1 | Junxiao Shi | |
| 72 | 9 | Junxiao Shi | `tcp[4|6]://<remote-IP-or-host>[:<remote-port>]` |
| 73 | |||
| 74 | Examples: |
||
| 75 | |||
| 76 | * `tcp://192.0.2.1:6363` (canonical form) |
||
| 77 | * `tcp://192.0.2.1` (remote-port defaults to 6363) |
||
| 78 | * `tcp://[2001:db8::1]:6363` (canonical form) |
||
| 79 | * `tcp://example.net:6363` |
||
| 80 | * `tcp4://example.net:6363` (resolve hostname to IPv4 address only) |
||
| 81 | * `tcp6://example.net:6363` (resolve hostname to IPv6 address only) |
||
| 82 | |||
| 83 | ### UNIX stream |
||
| 84 | |||
| 85 | `unix://<path>` |
||
| 86 | |||
| 87 | Examples: |
||
| 88 | |||
| 89 | * `unix:///var/run/nfd.sock` (note there are three forward-slashes after 'unix') |
||
| 90 | |||
| 91 | URI is available for the channel only. |
||
| 92 | Accepted UNIX stream faces do not have URI. |
||
| 93 | |||
| 94 | ### Ethernet unicast |
||
| 95 | |||
| 96 | `ether://<remote-MAC>` |
||
| 97 | |||
| 98 | Examples: |
||
| 99 | |||
| 100 | * `ether://08:00:27:01:01:01` |
||
| 101 | |||
| 102 | ### Ethernet multicast |
||
| 103 | |||
| 104 | `ether-mcast://<multicast-MAC>` |
||
| 105 | |||
| 106 | Examples: |
||
| 107 | |||
| 108 | * `ether-mcast://33:33:01:01:01:01` |
||
| 109 | |||
| 110 | ## Operations |
||
| 111 | |||
| 112 | **Face management protocol** protocol supports two operations: |
||
| 113 | |||
| 114 | * create a face (command-verb: `create`) |
||
| 115 | * destroy a face (command-verb: `destroy`) |
||
| 116 | |||
| 117 | ### Create a face |
||
| 118 | |||
| 119 | **command-verb:** `create` |
||
| 120 | |||
| 121 | Required fields in `FaceManagementOptions` block: |
||
| 122 | |||
| 123 | * `Uri` |
||
| 124 | |||
| 125 | This command allows creation of UDP unicast and TCP faces only. |
||
| 126 | |||
| 127 | If the command succeeds, the `ControlResponse` block in the response contains a `FaceManagementOptions` block, which contains: |
||
| 128 | |||
| 129 | * `FaceId` |
||
| 130 | 10 | Junxiao Shi | * `Uri`, the canonical URI |
| 131 | 9 | Junxiao Shi | |
| 132 | 10 | Junxiao Shi | If another face exists for the same underlying protocol and address, the command is considered successful, and that face is returned. |
| 133 | |||
| 134 | 9 | Junxiao Shi | ### Destroy a face |
| 135 | |||
| 136 | **command-verb:** `destroy` |
||
| 137 | |||
| 138 | Required fields in `FaceManagementOptions` block: |
||
| 139 | |||
| 140 | * `FaceId` |
||
| 141 | |||
| 142 | If the specified face does not exist, this command does nothing, but is still considered successful. |
||
| 143 | |||
| 144 | 2 | Alex Afanasyev | ## TLV-TYPE assignments |
| 145 | |||
| 146 | Type | Assigned value | Assigned value (hex) |
||
| 147 | ------------------------------------------- | ----------------- | -------------------- |
||
| 148 | FaceManagementOptions | 108 | 0x6c |
||
| 149 | 9 | Junxiao Shi | FaceId | 105 | 0x69 |
| 150 | Uri | | |