Project

General

Profile

FaceMgmt » History » Version 39

Junxiao Shi, 08/18/2014 03:26 PM

1 20 Junxiao Shi
# Face Management
2 1 Junxiao Shi
3 38 Alex Afanasyev
{{toc}}
4
5 20 Junxiao Shi
**Face Management** is a module of [[Management|NFD Management protocol]].
6
It provides:
7 1 Junxiao Shi
8 20 Junxiao Shi
* commands to create and destroy faces
9
* commands to enable and disable [[LocalControlHeader]] features on a face
10
* a dataset of description of all active faces and their counters
11 33 Junxiao Shi
* a dataset of description of all active channels
12 20 Junxiao Shi
* a notification stream for face creating and destroying events
13 1 Junxiao Shi
14 20 Junxiao Shi
Face Management commands, datasets, and notifications are published in namespace `ndn:/localhost/nfd/faces`.
15 12 Alex Afanasyev
16
17 20 Junxiao Shi
## FaceUri
18 1 Junxiao Shi
19 27 Junxiao Shi
A FaceUri represents the underlying protocol and address used by a Face.  
20
Every Face has two FaceUris: one for local endpoint, and the other for remote endpoint.
21 1 Junxiao Shi
22 27 Junxiao Shi
### UDP
23 9 Junxiao Shi
24 30 Junxiao Shi
`udp[4|6]://<IP-or-host>[:<port>]`  
25 2 Alex Afanasyev
26 9 Junxiao Shi
Examples:
27 1 Junxiao Shi
28 20 Junxiao Shi
* `udp4://192.0.2.1:6363` (canonical form)
29
* `udp6://[2001:db8::1]:6363` (canonical form)
30 1 Junxiao Shi
* `udp://192.0.2.1` (remote-port defaults to 6363)
31
* `udp://example.net:6363`
32
* `udp4://example.net:6363` (resolve hostname to IPv4 address only)
33 9 Junxiao Shi
* `udp6://example.net:6363` (resolve hostname to IPv6 address only)
34 27 Junxiao Shi
* `udp4://224.0.23.170:56363` (multicast, canonical form)
35 1 Junxiao Shi
36
### TCP
37
38 30 Junxiao Shi
`tcp[4|6]://<IP-or-host>[:<port>]`
39 1 Junxiao Shi
40
Examples:
41
42 20 Junxiao Shi
* `tcp4://192.0.2.1:6363` (canonical form)
43
* `tcp6://[2001:db8::1]:6363` (canonical form)
44 1 Junxiao Shi
* `tcp://192.0.2.1` (remote-port defaults to 6363)
45
* `tcp://example.net:6363`
46 9 Junxiao Shi
* `tcp4://example.net:6363` (resolve hostname to IPv4 address only)
47 1 Junxiao Shi
* `tcp6://example.net:6363` (resolve hostname to IPv6 address only)
48
49
### UNIX stream
50 9 Junxiao Shi
51 1 Junxiao Shi
`unix://<path>`
52 9 Junxiao Shi
53 1 Junxiao Shi
Examples:
54
55
* `unix:///var/run/nfd.sock` (note there are three forward-slashes after 'unix')
56
57 30 Junxiao Shi
### File Descriptor
58
59
`fd://<file-descriptor>`
60
61
Examples:
62
63
* `fd://6`
64
65 1 Junxiao Shi
### Ethernet
66 27 Junxiao Shi
67 39 Junxiao Shi
`ether://<MAC>`
68 1 Junxiao Shi
69
Examples:
70
71
* `ether://08:00:27:01:01:01`
72
* `ether://33:33:01:01:01:01` (multicast)
73
74 30 Junxiao Shi
### Network Device
75 1 Junxiao Shi
76 30 Junxiao Shi
`dev://<ifname>`
77
78
Examples:
79
80
* `dev://eth0`
81
82
### Underlying protocol and FaceUri scheme
83
84
Underlying protocol | remote FaceUri scheme            | local FaceUri scheme
85
------------------- | -------------------------------- | --------------------------
86
IPv4 UDP unicast    | udp4                             | udp4
87
IPv6 UDP unicast    | udp6                             | udp6
88
IPv4 UDP multicast  | udp4 (multicast IP)              | udp4 (local IP, same port)
89
IPv4 TCP            | tcp4                             | tcp4
90
IPv6 TCP            | tcp6                             | tcp6
91
UNIX stream         | fd (file descriptor on NFD side) | unix (socket path)
92
Ethernet multicast  | ether                            | dev
93
94 20 Junxiao Shi
## Control Commands
95
96 1 Junxiao Shi
[[ControlCommand]] **management-module**: `faces`
97
98
### Create a face
99 20 Junxiao Shi
100 1 Junxiao Shi
**command-verb**: `create`
101
102 20 Junxiao Shi
ControlParameters fields:
103 1 Junxiao Shi
104 30 Junxiao Shi
* Uri (required): a UDP unicast or TCP FaceUri
105 1 Junxiao Shi
106 20 Junxiao Shi
This command allows creation of UDP unicast and TCP faces only.  
107 30 Junxiao Shi
If another face with same underlying protocol and remote address exists, the command is considered successful, and FaceId of that face is returned.
108 1 Junxiao Shi
109 20 Junxiao Shi
If the command succeeds, \<Body> in ControlResponse block contains updated ControlParameters:
110 1 Junxiao Shi
111 20 Junxiao Shi
* FaceId
112
* Uri: FaceUri in canonical form - hostname is substituted with IP address, scheme name indicates either IPv4 or IPv6
113 1 Junxiao Shi
114
### Destroy a face
115
116
**command-verb:** `destroy`
117
118 20 Junxiao Shi
ControlParameters fields:
119 1 Junxiao Shi
120 20 Junxiao Shi
* FaceId (required)
121 1 Junxiao Shi
122
If the specified face does not exist, this command does nothing, but is still considered successful.
123 20 Junxiao Shi
124
### Enable a LocalControlHeader feature
125
126
**command-verb**: `enable-local-control`
127
128
ControlParameters fields:
129
130
* LocalControlFeature (required): 1=IncomingFaceId, 2=NextHopFaceId
131 26 Junxiao Shi
132 20 Junxiao Shi
This command can only operate on the requesting face.
133
134
### Disable a LocalControlHeader feature
135
136 1 Junxiao Shi
**command-verb**: `disable-local-control`
137 20 Junxiao Shi
138
ControlParameters fields:
139
140
* LocalControlFeature (required): 1=IncomingFaceId, 2=NextHopFaceId
141 26 Junxiao Shi
142 20 Junxiao Shi
This command can only operate on the requesting face.
143
144 1 Junxiao Shi
## Face Dataset
145
146 20 Junxiao Shi
Description and counters of all active faces are published as a [[StatusDataset|Status Dataset]] at `ndn:/localhost/nfd/faces/list`.
147 1 Junxiao Shi
148 32 Junxiao Shi
Each face is represented by a **FaceStatus** block:
149 1 Junxiao Shi
150 39 Junxiao Shi
    FaceStatus      ::= FACE-STATUS-TYPE TLV-LENGTH
151
                          FaceId
152
                          Uri (remote FaceUri)
153
                          LocalUri
154
                          ExpirationPeriod?
155
                          ScopePolicy
156
                          CreationReason
157
                          ChannelCategory
158
                          NInInterests
159
                          NInDatas
160
                          NOutInterests
161
                          NOutDatas
162
                          NInBytes
163
                          NOutBytes
164 1 Junxiao Shi
    
165 39 Junxiao Shi
    LocalUri        ::= LOCAL-URI-TYPE TLV-LENGTH
166
                          RFC3986 URI in UTF-8 encoding
167 1 Junxiao Shi
    
168 39 Junxiao Shi
    ScopePolicy     ::= SCOPE-POLICY-TYPE TLV-LENGTH
169
                          nonNegativeInteger
170 1 Junxiao Shi
    
171 39 Junxiao Shi
    CreationReason  ::= CREATION-REASON-TYPE TLV-LENGTH
172
                          nonNegativeInteger
173 1 Junxiao Shi
    
174 39 Junxiao Shi
    ChannelCategory ::= CHANNEL-CATEGORY-TYPE TLV-LENGTH
175
                          nonNegativeInteger
176 20 Junxiao Shi
    
177 39 Junxiao Shi
    NInInterests    ::= N-IN-INTERESTS-TYPE TLV-LENGTH
178
                          nonNegativeInteger
179 1 Junxiao Shi
    
180 39 Junxiao Shi
    NInDatas        ::= N-IN-DATAS-TYPE TLV-LENGTH
181
                          nonNegativeInteger
182 1 Junxiao Shi
    
183 39 Junxiao Shi
    NOutInterests   ::= N-OUT-INTERESTS-TYPE TLV-LENGTH
184
                          nonNegativeInteger
185 37 Junxiao Shi
    
186 39 Junxiao Shi
    NOutDatas       ::= N-OUT-DATAS-TYPE TLV-LENGTH
187
                          nonNegativeInteger
188
    
189
    NInBytes        ::= N-IN-BYTES-TYPE TLV-LENGTH
190
                          nonNegativeInteger
191
    
192
    NOutBytes       ::= N-OUT-BYTES-TYPE TLV-LENGTH
193
                          nonNegativeInteger
194 1 Junxiao Shi
195
* **Uri** is a FaceUri representing remote endpoint.
196
* **LocalUri** is a FaceUri representing local endpoint.
197
* **ExpirationPeriod** is the remaining lifetime of this face.
198
  If this field is omitted, the face has infinite lifetime.
199
  Currently, this is applicable to on-demand datagram faces only.
200 39 Junxiao Shi
* **ScopePolicy** indicates whether the face is local for [[ScopeControl|scope control]] purposes.
201
    * non-local(=0)
202
    * local(=1)
203
* **CreationReason** indicates why the face is created.
204
    * initiated(=0), created by `faces/create` command
205
    * on-demand(=1), accepted incoming connection
206
* **ChannelCategory** indicates the category of communication channel
207
    * point-to-point(=0), communicate with one peer
208
    * multi-access(=1), communicate with zero or more peers
209 1 Junxiao Shi
* **NInInterests** is the total number of incoming Interests since the face is established.
210 37 Junxiao Shi
* **NInDatas** is the total number of incoming Datas since the face is established.
211
* **NOutInterests** is the total number of outgoing Interests since the face is established.
212
* **NOutDatas** is the total number of outgoing Datas since the face is established.
213
* **NInBytes** counts the number of bytes of link layer packets received via this face.
214 1 Junxiao Shi
  This counter is initialized to zero when the face is established, and can wrap around after overflowing unsigned 64-bit integer range.
215 37 Junxiao Shi
* **NOutBytes** counts the number of bytes of link layer packets sent via this face.
216
  This counter is initialized to zero when the face is established, and can wrap around after overflowing unsigned 64-bit integer range.
217
218
### Query Operation
219
220
The query operation allows one to retrieve a subset of face dataset that contains faces satisfying a filter.
221
222
To run a query, the consumer should express an Interest with Name: `ndn:/localhost/nfd/faces/query/<filter>`, where `<filter>` is a **FaceQueryFilter** block that specifies zero or more conditions.
223
224
    FaceQueryFilter ::= FACE-QUERY-FILTER-TYPE TLV-LENGTH
225
                          FaceId?
226
                          UriScheme?
227
                          Uri?
228
                          LocalUri?
229 39 Junxiao Shi
                          ScopePolicy?
230
                          CreationReason?
231
                          ChannelCategory?
232 37 Junxiao Shi
    
233
    UriScheme       ::= URI-SCHEME-TYPE TLV-LENGTH
234
                          string in UTF-8
235
236
* **FaceId** permits a face if its FaceId equals the value
237
* **UriScheme** permits a face if the scheme part of its local FaceUri or remote FaceUri equals the value
238
* **Uri** permits a face if its remote FaceUri equals the value
239
* **LocalUri** permits a face if its local FaceUri equals the value
240 39 Junxiao Shi
* **ScopePolicy** permits a face if its *ScopePolicy* attribute equals the value
241
* **CreationReason** permits a face if its *CreationReason* attribute equals the value
242
* **ChannelCategory** permits a face if its *ChannelCategory* attribute equals the value
243 1 Junxiao Shi
244
A face must satisfy ALL conditions to satisfy the filter.
245 39 Junxiao Shi
Faces that satisfy the filter are represented by **FaceStatus** blocks, and published as a [[StatusDataset]] under the Interest Name (a Data packet's Name would be `ndn:/localhost/nfd/faces/query/<filter>/<version>/<segment>`).
246 37 Junxiao Shi
247
Examples of filters:
248
249
* a specific face: FaceId=260
250
* a specific TCP tunnel: Uri=tcp4://192.0.2.1:6363  
251
  note: FaceUri must precisely match what would appear in face dataset: use either "tcp4" or "tcp6" instead of "tcp", use IP address instead of DNS name, include port number
252
* all TCP tunnels: UriScheme=tcp  
253 33 Junxiao Shi
  note: "tcp" permits both "tcp4" and "tcp6", "udp" permits both "udp4" and "udp6"
254 39 Junxiao Shi
* all UDP multicast faces: UriScheme=udp & ChannelCategory=multi-access
255 33 Junxiao Shi
* all Ethernet faces: UriScheme=ether
256
  note: UriScheme matches on both local and remote FaceUri, "dev" also works
257
* all faces: no condition  
258
  note: this is equivalent to face dataset, and face dataset should be preferred for this purpose
259
260 1 Junxiao Shi
## Channel Dataset
261
262
Description of all active channels is published as a [[StatusDataset|Status Dataset]] at `ndn:/localhost/nfd/faces/channels`.
263 33 Junxiao Shi
264
Each channel is represented by a **ChannelStatus** block:
265
266 20 Junxiao Shi
    ChannelStatus    := CHANNEL-STATUS-TYPE TLV-LENGTH
267 1 Junxiao Shi
                          LocalUri
268
269 20 Junxiao Shi
* **LocalUri** is a FaceUri representing local endpoint.
270
271 21 Alex Afanasyev
## Face Status Change Notification
272 20 Junxiao Shi
273 1 Junxiao Shi
Face status change events are published as a [[Notification|Notification Stream]] at `ndn:/localhost/nfd/faces/events`.
274 21 Alex Afanasyev
Notifications of all faces are sent into the same notification stream.
275 37 Junxiao Shi
276
The Content of each notification Data packet is a `FaceEventNotification` block:
277
278
    FaceEventNotification ::= FACE-EVENT-NOTIFICATION-TYPE TLV-LENGTH
279
                                FaceEventKind
280
                                FaceId
281 23 Alex Afanasyev
                                Uri
282 37 Junxiao Shi
                                LocalUri
283 39 Junxiao Shi
                                ScopePolicy
284
                                CreationReason
285
                                ChannelCategory
286 23 Alex Afanasyev
    
287 25 Junxiao Shi
    FaceEventKind         ::= FACE-EVENT-KIND-TYPE TLV-LENGTH
288 23 Alex Afanasyev
                                nonNegativeInteger
289
290 25 Junxiao Shi
**FaceEventKind** indicates the kind of event. Its possible values are:
291 23 Alex Afanasyev
292 9 Junxiao Shi
* **1**: face is created
293
* **2**: face is destroyed
294
295 1 Junxiao Shi
## TLV-TYPE assignments
296 34 Junxiao Shi
297 33 Junxiao Shi
Type                                        | Assigned value    | Assigned value (hex)
298 32 Junxiao Shi
------------------------------------------- | ----------------- | --------------------
299 20 Junxiao Shi
FaceStatus                                  | 128               | 0x80
300
LocalUri                                    | 129               | 0x81
301
ChannelStatus                               | 130               | 0x82
302 39 Junxiao Shi
ScopePolicy                                 | 132               | 0x84
303
CreationReason                              | 133               | 0x85
304
ChannelCategory                             | 134               | 0x86
305 37 Junxiao Shi
NInInterests                                | 144               | 0x90
306 24 Alex Afanasyev
NInDatas                                    | 145               | 0x91
307 1 Junxiao Shi
NOutInterests                               | 146               | 0x92
308
NOutDatas                                   | 147               | 0x93
309
NInBytes                                    | 148               | 0x94
310
NOutBytes                                   | 149               | 0x95
311
UriScheme                                   | 131               | 0x83
312
IsMultiAccess                               | 132               | 0x84
313
FaceEventNotification                       | 192               | 0xc0
314
FaceEventKind                               | 193               | 0xc1
315 39 Junxiao Shi
(reserved, formerly FaceFlags)              | 194               | 0xc2