Project

General

Profile

FaceMgmt » History » Version 37

Junxiao Shi, 07/19/2014 08:32 PM

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