Project

General

Profile

FaceMgmt » History » Version 30

Junxiao Shi, 03/28/2014 11:26 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
* a notification stream for face creating and destroying events
10 1 Junxiao Shi
11 20 Junxiao Shi
Face Management commands, datasets, and notifications are published in namespace `ndn:/localhost/nfd/faces`.
12 12 Alex Afanasyev
13
14 20 Junxiao Shi
## FaceUri
15 1 Junxiao Shi
16 27 Junxiao Shi
A FaceUri represents the underlying protocol and address used by a Face.  
17
Every Face has two FaceUris: one for local endpoint, and the other for remote endpoint.
18 1 Junxiao Shi
19 27 Junxiao Shi
### UDP
20 9 Junxiao Shi
21 30 Junxiao Shi
`udp[4|6]://<IP-or-host>[:<port>]`  
22 2 Alex Afanasyev
23 9 Junxiao Shi
Examples:
24 1 Junxiao Shi
25 20 Junxiao Shi
* `udp4://192.0.2.1:6363` (canonical form)
26
* `udp6://[2001:db8::1]:6363` (canonical form)
27 1 Junxiao Shi
* `udp://192.0.2.1` (remote-port defaults to 6363)
28
* `udp://example.net:6363`
29
* `udp4://example.net:6363` (resolve hostname to IPv4 address only)
30 9 Junxiao Shi
* `udp6://example.net:6363` (resolve hostname to IPv6 address only)
31 27 Junxiao Shi
* `udp4://224.0.23.170:56363` (multicast, canonical form)
32 1 Junxiao Shi
33
### TCP
34
35 30 Junxiao Shi
`tcp[4|6]://<IP-or-host>[:<port>]`
36 1 Junxiao Shi
37
Examples:
38
39 20 Junxiao Shi
* `tcp4://192.0.2.1:6363` (canonical form)
40
* `tcp6://[2001:db8::1]:6363` (canonical form)
41 1 Junxiao Shi
* `tcp://192.0.2.1` (remote-port defaults to 6363)
42
* `tcp://example.net:6363`
43 9 Junxiao Shi
* `tcp4://example.net:6363` (resolve hostname to IPv4 address only)
44 1 Junxiao Shi
* `tcp6://example.net:6363` (resolve hostname to IPv6 address only)
45
46
### UNIX stream
47 9 Junxiao Shi
48 1 Junxiao Shi
`unix://<path>`
49 9 Junxiao Shi
50 1 Junxiao Shi
Examples:
51
52
* `unix:///var/run/nfd.sock` (note there are three forward-slashes after 'unix')
53
54 30 Junxiao Shi
### File Descriptor
55
56
`fd://<file-descriptor>`
57
58
Examples:
59
60
* `fd://6`
61
62 1 Junxiao Shi
### Ethernet
63 27 Junxiao Shi
64 30 Junxiao Shi
`ether://<MAC>`  
65 1 Junxiao Shi
66
Examples:
67
68
* `ether://08:00:27:01:01:01`
69
* `ether://33:33:01:01:01:01` (multicast)
70
71 30 Junxiao Shi
### Network Device
72 1 Junxiao Shi
73 30 Junxiao Shi
`dev://<ifname>`
74
75
Examples:
76
77
* `dev://eth0`
78
79
### Underlying protocol and FaceUri scheme
80
81
Underlying protocol | remote FaceUri scheme            | local FaceUri scheme
82
------------------- | -------------------------------- | --------------------------
83
IPv4 UDP unicast    | udp4                             | udp4
84
IPv6 UDP unicast    | udp6                             | udp6
85
IPv4 UDP multicast  | udp4 (multicast IP)              | udp4 (local IP, same port)
86
IPv4 TCP            | tcp4                             | tcp4
87
IPv6 TCP            | tcp6                             | tcp6
88
UNIX stream         | fd (file descriptor on NFD side) | unix (socket path)
89
Ethernet multicast  | ether                            | dev
90
91 20 Junxiao Shi
## Control Commands
92
93 1 Junxiao Shi
[[ControlCommand]] **management-module**: `faces`
94
95
### Create a face
96 20 Junxiao Shi
97 1 Junxiao Shi
**command-verb**: `create`
98
99 20 Junxiao Shi
ControlParameters fields:
100 1 Junxiao Shi
101 30 Junxiao Shi
* Uri (required): a UDP unicast or TCP FaceUri
102 1 Junxiao Shi
103 20 Junxiao Shi
This command allows creation of UDP unicast and TCP faces only.  
104 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.
105 1 Junxiao Shi
106 20 Junxiao Shi
If the command succeeds, \<Body> in ControlResponse block contains updated ControlParameters:
107 1 Junxiao Shi
108 20 Junxiao Shi
* FaceId
109
* Uri: FaceUri in canonical form - hostname is substituted with IP address, scheme name indicates either IPv4 or IPv6
110 1 Junxiao Shi
111
### Destroy a face
112
113
**command-verb:** `destroy`
114
115 20 Junxiao Shi
ControlParameters fields:
116 1 Junxiao Shi
117 20 Junxiao Shi
* FaceId (required)
118 1 Junxiao Shi
119
If the specified face does not exist, this command does nothing, but is still considered successful.
120 20 Junxiao Shi
121
### Enable a LocalControlHeader feature
122
123
**command-verb**: `enable-local-control`
124
125
ControlParameters fields:
126
127
* LocalControlFeature (required): 1=IncomingFaceId, 2=NextHopFaceId
128 26 Junxiao Shi
129 20 Junxiao Shi
This command can only operate on the requesting face.
130
131
### Disable a LocalControlHeader feature
132
133 1 Junxiao Shi
**command-verb**: `disable-local-control`
134 20 Junxiao Shi
135
ControlParameters fields:
136
137
* LocalControlFeature (required): 1=IncomingFaceId, 2=NextHopFaceId
138 26 Junxiao Shi
139 20 Junxiao Shi
This command can only operate on the requesting face.
140
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
146
Each face is represented by a **FaceStatus** blocks:
147
148
    FaceStatus    := FACE-STATUS-TYPE TLV-LENGTH
149 1 Junxiao Shi
                       FaceId
150 30 Junxiao Shi
                       Uri (remote FaceUri)
151
                       LocalUri
152 20 Junxiao Shi
                       NInInterests
153
                       NInDatas
154
                       NOutInterests
155
                       NOutDatas
156
    
157 30 Junxiao Shi
    LocalUri     ::= LOCAL-URI-TYPE TLV-LENGTH
158
                       RFC3986 URI in UTF-8 encoding
159
    
160 20 Junxiao Shi
    NInInterests  := N-IN-INTERESTS-TYPE TLV-LENGTH
161
                       nonNegativeInteger
162
    
163
    NInDatas      := N-IN-DATAS-TYPE TLV-LENGTH
164 1 Junxiao Shi
                       nonNegativeInteger
165
    
166 20 Junxiao Shi
    NOutInterests := N-OUT-INTERESTS-TYPE TLV-LENGTH
167
                       nonNegativeInteger
168
    
169
    NOutDatas     := N-OUT-DATAS-TYPE TLV-LENGTH
170
                       nonNegativeInteger
171
172 30 Junxiao Shi
* Uri is a FaceUri representing remote endpoint.
173
* LocalUri is a FaceUri representing local endpoint.
174 20 Junxiao Shi
* NInInterests is the total number of incoming Interests since the face is established.
175
* NInDatas is the total number of incoming Datas since the face is established.
176
* NOutInterests is the total number of outgoing Interests since the face is established.
177
* NOutDatas is the total number of outgoing Datas since the face is established.
178
179
## Face Status Change Notification
180
181 1 Junxiao Shi
Face status change events are published as a [[Notification|Notification Stream]] at `ndn:/localhost/nfd/faces/events`.
182 30 Junxiao Shi
Notifications of all faces are sent into the same notification stream.
183 1 Junxiao Shi
184 20 Junxiao Shi
The Content of each notification Data packet is a `FaceEventNotification` block:
185 21 Alex Afanasyev
186 20 Junxiao Shi
    FaceEventNotification := FACE-EVENT-NOTIFICATION-TYPE TLV-LENGTH
187 21 Alex Afanasyev
                               FaceEventKind
188
                               FaceId
189
                               Uri
190 30 Junxiao Shi
                               LocalUri
191 23 Alex Afanasyev
                               FaceFlags
192 20 Junxiao Shi
    
193 25 Junxiao Shi
    FaceEventKind         := FACE-EVENT-KIND-TYPE TLV-LENGTH
194
                               nonNegativeInteger
195 20 Junxiao Shi
196 25 Junxiao Shi
    FaceFlags             := FACE-FLAGS-TYPE TLV-LENGTH
197
                               nonNegativeInteger
198 23 Alex Afanasyev
199 20 Junxiao Shi
**FaceEventKind** indicates the kind of event. Its possible values are:
200
201 25 Junxiao Shi
* **1**: face is created
202
* **2**: face is destroyed
203 23 Alex Afanasyev
204 25 Junxiao Shi
**FaceFlags** is a bitset, providing additional information about the face. The following bits are currently defined:
205 1 Junxiao Shi
206 23 Alex Afanasyev
* **1**: face is local
207
* **2**: face is on demand - accepted incoming connection, instead of initiated outgoing connection
208 25 Junxiao Shi
209 23 Alex Afanasyev
## TLV-TYPE assignments
210 9 Junxiao Shi
211
Type                                        | Assigned value    | Assigned value (hex)
212
------------------------------------------- | ----------------- | --------------------
213 2 Alex Afanasyev
FaceStatus                                  | 128               | 0x80
214 30 Junxiao Shi
LocalUri                                    | 129               | 0x81
215 20 Junxiao Shi
NInInterests                                | 144               | 0x90
216
NInDatas                                    | 145               | 0x91
217
NOutInterests                               | 146               | 0x92
218
NOutDatas                                   | 147               | 0x93
219 22 Alex Afanasyev
FaceEventNotification                       | 192               | 0xc0
220 1 Junxiao Shi
FaceEventKind                               | 193               | 0xc1
221 24 Alex Afanasyev
FaceFlags                                   | 194               | 0xc2