Project

General

Profile

FaceMgmt » History » Version 32

Junxiao Shi, 03/29/2014 09:06 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 1 Junxiao Shi
## Face Dataset
142
143 20 Junxiao Shi
Description and counters of all active faces are published as a [[StatusDataset|Status Dataset]] at `ndn:/localhost/nfd/faces/list`.
144 1 Junxiao Shi
145 32 Junxiao Shi
Each face is represented by a **FaceStatus** block:
146 20 Junxiao Shi
147
    FaceStatus    := FACE-STATUS-TYPE TLV-LENGTH
148 1 Junxiao Shi
                       FaceId
149
                       Uri (remote FaceUri)
150 30 Junxiao Shi
                       LocalUri
151 32 Junxiao Shi
                       FaceFlags
152 20 Junxiao Shi
                       NInInterests
153
                       NInDatas
154
                       NOutInterests
155
                       NOutDatas
156 1 Junxiao Shi
    
157 32 Junxiao Shi
    LocalUri      := LOCAL-URI-TYPE TLV-LENGTH
158 1 Junxiao Shi
                       RFC3986 URI in UTF-8 encoding
159 32 Junxiao Shi
160
    FaceFlags     := FACE-FLAGS-TYPE TLV-LENGTH
161
                       nonNegativeInteger
162 30 Junxiao Shi
    
163 20 Junxiao Shi
    NInInterests  := N-IN-INTERESTS-TYPE TLV-LENGTH
164
                       nonNegativeInteger
165
    
166
    NInDatas      := N-IN-DATAS-TYPE TLV-LENGTH
167 1 Junxiao Shi
                       nonNegativeInteger
168
    
169
    NOutInterests := N-OUT-INTERESTS-TYPE TLV-LENGTH
170
                       nonNegativeInteger
171
    
172
    NOutDatas     := N-OUT-DATAS-TYPE TLV-LENGTH
173
                       nonNegativeInteger
174
175 32 Junxiao Shi
* **Uri** is a FaceUri representing remote endpoint.
176
* **LocalUri** is a FaceUri representing local endpoint.
177
* **FaceFlags** is a bitset providing additional information about the face. The following bits are currently defined:
178
    * **1**: face is local
179
    * **2**: face is on demand - accepted incoming connection, instead of initiated outgoing connection
180
* **NInInterests** is the total number of incoming Interests since the face is established.
181
* **NInDatas** is the total number of incoming Datas since the face is established.
182
* **NOutInterests** is the total number of outgoing Interests since the face is established.
183
* **NOutDatas** is the total number of outgoing Datas since the face is established.
184 20 Junxiao Shi
185
## Face Status Change Notification
186
187
Face status change events are published as a [[Notification|Notification Stream]] at `ndn:/localhost/nfd/faces/events`.
188 21 Alex Afanasyev
Notifications of all faces are sent into the same notification stream.
189 20 Junxiao Shi
190 21 Alex Afanasyev
The Content of each notification Data packet is a `FaceEventNotification` block:
191
192 25 Junxiao Shi
    FaceEventNotification := FACE-EVENT-NOTIFICATION-TYPE TLV-LENGTH
193 20 Junxiao Shi
                               FaceEventKind
194 25 Junxiao Shi
                               FaceId
195
                               Uri
196 1 Junxiao Shi
                               LocalUri
197 23 Alex Afanasyev
                               FaceFlags
198 20 Junxiao Shi
    
199
    FaceEventKind         := FACE-EVENT-KIND-TYPE TLV-LENGTH
200 25 Junxiao Shi
                               nonNegativeInteger
201
202 23 Alex Afanasyev
**FaceEventKind** indicates the kind of event. Its possible values are:
203 25 Junxiao Shi
204 23 Alex Afanasyev
* **1**: face is created
205
* **2**: face is destroyed
206 25 Junxiao Shi
207 23 Alex Afanasyev
## TLV-TYPE assignments
208 9 Junxiao Shi
209
Type                                        | Assigned value    | Assigned value (hex)
210
------------------------------------------- | ----------------- | --------------------
211 2 Alex Afanasyev
FaceStatus                                  | 128               | 0x80
212 30 Junxiao Shi
LocalUri                                    | 129               | 0x81
213 32 Junxiao Shi
FaceFlags                                   | 194               | 0xc2
214 20 Junxiao Shi
NInInterests                                | 144               | 0x90
215
NInDatas                                    | 145               | 0x91
216
NOutInterests                               | 146               | 0x92
217 22 Alex Afanasyev
NOutDatas                                   | 147               | 0x93
218 1 Junxiao Shi
FaceEventNotification                       | 192               | 0xc0
219 24 Alex Afanasyev
FaceEventKind                               | 193               | 0xc1