Project

General

Profile

FaceMgmt » History » Version 9

Junxiao Shi, 02/09/2014 08:21 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
                               ChannelName?
30 1 Junxiao Shi
    
31
    FaceId               ::= FACEID-TYPE TLV-LENGTH
32 2 Alex Afanasyev
                               nonNegativeInteger
33 9 Junxiao Shi
    
34
    Uri                  ::= URI-TYPE TLV-LENGTH
35
                               UTF-8 string
36
    
37
    ChannelName          ::= CHANNEL-NAME-TYPE TLV-LENGTH
38
                               UTF-8 string
39 1 Junxiao Shi
40
### Response
41
42 9 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
The response has StatusCode 200 if the command succeeds.
45
46 9 Junxiao Shi
Any other status code (4xx, 5xx, [?]) means error.
47
Description of the error can be present in `StatusText` field of `ControlResponse` command.
48 1 Junxiao Shi
49 9 Junxiao Shi
## URI
50 1 Junxiao Shi
51 9 Junxiao Shi
The underlying protocol and underlying address of a Face is expressed as a URI.
52 2 Alex Afanasyev
53 9 Junxiao Shi
### UDP unicast
54 2 Alex Afanasyev
55 9 Junxiao Shi
`udp[4|6]://<remote-IP-or-host>[:<remote-port>]`
56 1 Junxiao Shi
57 9 Junxiao Shi
Examples:
58 1 Junxiao Shi
59 9 Junxiao Shi
* `udp://192.0.2.1:6363` (canonical form)
60
* `udp://192.0.2.1` (remote-port defaults to 6363)
61
* `udp://[2001:db8::1]:6363` (canonical form)
62
* `udp://example.net:6363`
63
* `udp4://example.net:6363` (resolve hostname to IPv4 address only)
64
* `udp6://example.net:6363` (resolve hostname to IPv6 address only)
65 1 Junxiao Shi
66 9 Junxiao Shi
### UDP multicast
67 1 Junxiao Shi
68 9 Junxiao Shi
`udp-mcast://<multicast-IP>:<multicast-port>`
69 1 Junxiao Shi
70 9 Junxiao Shi
Examples:
71 1 Junxiao Shi
72 9 Junxiao Shi
* `udp://224.0.23.170:56363`
73 1 Junxiao Shi
74 9 Junxiao Shi
### TCP
75 1 Junxiao Shi
76 9 Junxiao Shi
`tcp[4|6]://<remote-IP-or-host>[:<remote-port>]`
77
78
Examples:
79
80
* `tcp://192.0.2.1:6363` (canonical form)
81
* `tcp://192.0.2.1` (remote-port defaults to 6363)
82
* `tcp://[2001:db8::1]:6363` (canonical form)
83
* `tcp://example.net:6363`
84
* `tcp4://example.net:6363` (resolve hostname to IPv4 address only)
85
* `tcp6://example.net:6363` (resolve hostname to IPv6 address only)
86
87
### UNIX stream
88
89
`unix://<path>`
90
91
Examples:
92
93
* `unix:///var/run/nfd.sock` (note there are three forward-slashes after 'unix')
94
95
URI is available for the channel only.
96
Accepted UNIX stream faces do not have URI.
97
98
### Ethernet unicast
99
100
`ether://<remote-MAC>`
101
102
Examples:
103
104
* `ether://08:00:27:01:01:01`
105
106
### Ethernet multicast
107
108
`ether-mcast://<multicast-MAC>`
109
110
Examples:
111
112
* `ether-mcast://33:33:01:01:01:01`
113
114
## Operations
115
116
**Face management protocol** protocol supports two operations:
117
118
* create a face (command-verb: `create`)
119
* destroy a face (command-verb: `destroy`)
120
121
### Create a face
122
123
**command-verb:** `create`
124
125
Required fields in `FaceManagementOptions` block:
126
127
* `Uri`
128
129
Optional fields in `FaceManagementOptions` block:
130
131
* `ChannelName`
132
133
The `ChannelName` field chooses a channel to create the new face within. Channel names are defined in [[ConfigFileFormat|configuration file]].
134
If this field is omitted, NFD can create the face under any channel of a compatible underlying protocol.
135
136
This command allows creation of UDP unicast and TCP faces only.
137
138
If the command succeeds, the `ControlResponse` block in the response contains a `FaceManagementOptions` block, which contains:
139
140
* `FaceId`
141
* `Uri`, the canonical resolved URI
142
* `ChannelName`
143
144
### Destroy a face
145
146
**command-verb:** `destroy`
147
148
Required fields in `FaceManagementOptions` block:
149
150
* `FaceId`
151
152
If the specified face does not exist, this command does nothing, but is still considered successful.
153
154 2 Alex Afanasyev
## TLV-TYPE assignments
155
156
Type                                        | Assigned value    | Assigned value (hex)
157
------------------------------------------- | ----------------- | --------------------
158 4 Alex Afanasyev
FaceManagementOptions                       | 108               | 0x6c
159 2 Alex Afanasyev
FaceId                                      | 105               | 0x69
160 9 Junxiao Shi
Uri                                         |                   | 
161
ChannelName                                 |                   |