FaceMgmt » History » Version 89
Eric Newberry, 06/06/2018 11:33 PM
| 1 | 20 | Junxiao Shi | # Face Management |
|---|---|---|---|
| 2 | 1 | Junxiao Shi | |
| 3 | 82 | Davide Pesavento | {{>toc}} |
| 4 | 38 | Alex Afanasyev | |
| 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 | 45 | Junxiao Shi | Face Management commands, datasets, and notifications are available under 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 | 71 | Alex Afanasyev | * `udp6://[fe80::1068:dddb:fe26:fe3f%en0]:6363` (canonical form for link-local IPv6 addresses) |
| 31 | * `udp6://[fe80::1068:dddb:fe26:fe3f%25en0]:6363` (equivalent, but not canonical, version of the above FaceUri) |
||
| 32 | 1 | Junxiao Shi | * `udp://192.0.2.1` (remote-port defaults to 6363) |
| 33 | * `udp://example.net:6363` |
||
| 34 | * `udp4://example.net:6363` (resolve hostname to IPv4 address only) |
||
| 35 | 9 | Junxiao Shi | * `udp6://example.net:6363` (resolve hostname to IPv6 address only) |
| 36 | 27 | Junxiao Shi | * `udp4://224.0.23.170:56363` (multicast, canonical form) |
| 37 | 1 | Junxiao Shi | |
| 38 | 61 | Davide Pesavento | LocalUri of a NIC-associated UDP face has the form: |
| 39 | |||
| 40 | `udp[4|6]+dev://<NIC>:<port>` |
||
| 41 | |||
| 42 | 1 | Junxiao Shi | This is only used in face dataset. |
| 43 | 61 | Davide Pesavento | |
| 44 | 51 | Junxiao Shi | Examples: |
| 45 | |||
| 46 | 60 | Junxiao Shi | * `udp4+dev://eth1:6363` |
| 47 | * `udp6+dev://en0:6363` |
||
| 48 | 51 | Junxiao Shi | |
| 49 | 1 | Junxiao Shi | ### TCP |
| 50 | |||
| 51 | 30 | Junxiao Shi | `tcp[4|6]://<IP-or-host>[:<port>]` |
| 52 | 1 | Junxiao Shi | |
| 53 | Examples: |
||
| 54 | |||
| 55 | 20 | Junxiao Shi | * `tcp4://192.0.2.1:6363` (canonical form) |
| 56 | * `tcp6://[2001:db8::1]:6363` (canonical form) |
||
| 57 | 71 | Alex Afanasyev | * `tcp6://[fe80::1068:dddb:fe26:fe3f%en0]:6363` (canonical form for link-local IPv6 addresses) |
| 58 | * `tcp6://[fe80::1068:dddb:fe26:fe3f%25en0]:6363` (equivalent, but not canonical, version of the above FaceUri) |
||
| 59 | 1 | Junxiao Shi | * `tcp://192.0.2.1` (remote-port defaults to 6363) |
| 60 | * `tcp://example.net:6363` |
||
| 61 | 9 | Junxiao Shi | * `tcp4://example.net:6363` (resolve hostname to IPv4 address only) |
| 62 | 1 | Junxiao Shi | * `tcp6://example.net:6363` (resolve hostname to IPv6 address only) |
| 63 | |||
| 64 | ### UNIX stream |
||
| 65 | |||
| 66 | 9 | Junxiao Shi | `unix://<path>` |
| 67 | 1 | Junxiao Shi | |
| 68 | Examples: |
||
| 69 | |||
| 70 | 61 | Davide Pesavento | * `unix:///var/run/nfd.sock` (note that there are three forward-slashes after 'unix:') |
| 71 | 1 | Junxiao Shi | |
| 72 | 84 | Davide Pesavento | ### File descriptor |
| 73 | 30 | Junxiao Shi | |
| 74 | `fd://<file-descriptor>` |
||
| 75 | |||
| 76 | Examples: |
||
| 77 | |||
| 78 | * `fd://6` |
||
| 79 | |||
| 80 | 1 | Junxiao Shi | ### Ethernet |
| 81 | 27 | Junxiao Shi | |
| 82 | 42 | Junxiao Shi | `ether://[<MAC>]` |
| 83 | 1 | Junxiao Shi | |
| 84 | Examples: |
||
| 85 | 42 | Junxiao Shi | |
| 86 | * `ether://[08:00:27:01:01:01]` |
||
| 87 | 1 | Junxiao Shi | * `ether://[33:33:01:01:01:01]` (multicast) |
| 88 | |||
| 89 | 84 | Davide Pesavento | ### Network device |
| 90 | 1 | Junxiao Shi | |
| 91 | 61 | Davide Pesavento | `dev://<interface-name>` |
| 92 | 30 | Junxiao Shi | |
| 93 | Examples: |
||
| 94 | |||
| 95 | 1 | Junxiao Shi | * `dev://eth0` |
| 96 | |||
| 97 | ### Underlying protocol and FaceUri scheme |
||
| 98 | |||
| 99 | 67 | Junxiao Shi | Underlying protocol | Remote FaceUri scheme | Local FaceUri scheme |
| 100 | ----------------------- | -------------------------------- | -------------------------- |
||
| 101 | IPv4 UDP unicast | udp4 | udp4 |
||
| 102 | IPv6 UDP unicast | udp6 | udp6 |
||
| 103 | IPv4 UDP multicast | udp4 (multicast IP) | udp4 (local IP, same port) |
||
| 104 | IPv4 UDP NIC-associated | udp4 | udp4+dev |
||
| 105 | IPv6 UDP NIC-associated | udp6 | udp6+dev |
||
| 106 | IPv4 TCP | tcp4 | tcp4 |
||
| 107 | IPv6 TCP | tcp6 | tcp6 |
||
| 108 | UNIX stream | fd (file descriptor on NFD side) | unix (socket path) |
||
| 109 | Ethernet unicast | ether | dev |
||
| 110 | Ethernet multicast | ether | dev |
||
| 111 | WebSocket | wsclient | ws |
||
| 112 | 46 | Junxiao Shi | |
| 113 | ## Static Face Attributes |
||
| 114 | |||
| 115 | **FaceScope** indicates whether the face is local for [[ScopeControl|scope control]] purposes. |
||
| 116 | |||
| 117 | * non-local(=0) |
||
| 118 | * local(=1) |
||
| 119 | |||
| 120 | **FacePersistency** indicates whether the face is persistent. |
||
| 121 | |||
| 122 | * on-demand(=1), face closes if it remains idle for some time |
||
| 123 | * persistent(=0), face remains open until it's explicitly destroyed or there's a transport failure |
||
| 124 | * permanent(=2), face remains open until it's explicitly destroyed; transport failures will be recovered internally |
||
| 125 | |||
| 126 | **LinkType** indicates the type of communication link. |
||
| 127 | |||
| 128 | * point-to-point(=0), communication with one peer |
||
| 129 | * multi-access(=1), communication with a multicast group |
||
| 130 | 75 | Davide Pesavento | * ad-hoc(=2), communication over a wireless ad hoc network |
| 131 | 52 | Junxiao Shi | |
| 132 | **LocalFieldsEnabled** indicates whether the face allows [[NDNLPv2]] NextHopFaceId, CachePolicy, IncomingFaceId fields. |
||
| 133 | |||
| 134 | * yes(=1), allows these fields; this is valid only if FaceScope=local |
||
| 135 | * no(=0), disallows these fields |
||
| 136 | |||
| 137 | 74 | Eric Newberry | **LpReliabilityEnabled** indicates whether the face has the [[NDNLPv2]] reliability feature enabled. |
| 138 | 69 | Eric Newberry | |
| 139 | * yes(=1), enables this feature |
||
| 140 | * no(=0), disables this feature |
||
| 141 | 1 | Junxiao Shi | |
| 142 | 74 | Eric Newberry | **CongestionMarkingEnabled** indicates whether the face has congestion marking based upon send queue length enabled. |
| 143 | |||
| 144 | * yes(=1), enables this feature |
||
| 145 | * no(=0), disables this feature |
||
| 146 | |||
| 147 | 89 | Eric Newberry | **LpFragmentationEnabled** indicates whether the face has the [[NDNLPv2]] fragmentation feature enabled. |
| 148 | 88 | Eric Newberry | |
| 149 | 89 | Eric Newberry | * yes(=1), enables this feature |
| 150 | * no(=0), disables this feature |
||
| 151 | 88 | Eric Newberry | |
| 152 | 74 | Eric Newberry | **BaseCongestionMarkingInterval** indicates the base marking interval for congestion marking. |
| 153 | |||
| 154 | 77 | Eric Newberry | The value of this attribute is the base marking interval in nanoseconds, which is used to compute the interval at which congested packets will be marked. |
| 155 | 74 | Eric Newberry | |
| 156 | **DefaultCongestionThreshold** indicates the default congestion threshold if the face does not support retrieving the send queue capacity. |
||
| 157 | |||
| 158 | 76 | Davide Pesavento | The value of this attribute is the default congestion threshold in bytes. |
| 159 | 74 | Eric Newberry | |
| 160 | 85 | Eric Newberry | **Mtu** contains a user-specified MTU to override the automatic MTU of the transport. |
| 161 | |||
| 162 | 87 | Davide Pesavento | The value of this attribute is the MTU of the transport in bytes. A transport type may limit the acceptable range of this value or even ignore it altogether. |
| 163 | 85 | Eric Newberry | |
| 164 | 52 | Junxiao Shi | ### Flags and Mask |
| 165 | |||
| 166 | Some attributes are collected as inclusive OR into a **Flags** field in commands and datasets. |
||
| 167 | These attributes are: (bit 0 is the least significant bit) |
||
| 168 | |||
| 169 | * bit 0: LocalFieldsEnabled |
||
| 170 | 1 | Junxiao Shi | * bit 1: LpReliabilityEnabled |
| 171 | 74 | Eric Newberry | * bit 2: CongestionMarkingEnabled |
| 172 | 89 | Eric Newberry | * bit 3: LpFragmentationEnabled |
| 173 | 55 | Junxiao Shi | |
| 174 | 1 | Junxiao Shi | ## Control Commands |
| 175 | |||
| 176 | 20 | Junxiao Shi | [[ControlCommand]] **management-module**: `faces` |
| 177 | 41 | Junxiao Shi | |
| 178 | ### Create a face |
||
| 179 | 1 | Junxiao Shi | |
| 180 | **command-verb**: `create` |
||
| 181 | 46 | Junxiao Shi | |
| 182 | ControlParameters fields: |
||
| 183 | 1 | Junxiao Shi | |
| 184 | * **Uri** (required): canonical remote FaceUri of the face to create. |
||
| 185 | 72 | Davide Pesavento | * **LocalUri** (optional): canonical local FaceUri of the face to create; e.g., FaceUri of the local interface for an Ethernet unicast face. |
| 186 | 1 | Junxiao Shi | * **FacePersistency** (optional): either *persistent* or *permanent*; creating *on-demand* faces is not permitted. The default is *persistent*. See "static face attributes" for more information. |
| 187 | 74 | Eric Newberry | * **BaseCongestionMarkingInterval** (optional): see "static face attributes". |
| 188 | * **DefaultCongestionThreshold** (optional): see "static face attributes". |
||
| 189 | 85 | Eric Newberry | * **Mtu** (optional): see "static face attributes". |
| 190 | 72 | Davide Pesavento | * **Flags** (optional): see "static face attributes". |
| 191 | 83 | Davide Pesavento | * **Mask** (optional): MUST be specified if *Flags* is present, and omitted if *Flags* is omitted. |
| 192 | 1 | Junxiao Shi | |
| 193 | 65 | Davide Pesavento | This command allows the creation of UDP unicast, Ethernet unicast, and TCP faces only. |
| 194 | 50 | Junxiao Shi | If the command succeeds, the \<body> of the ControlResponse block contains the ControlParameters describing the current properties of the created face: |
| 195 | 1 | Junxiao Shi | |
| 196 | 64 | Alex Afanasyev | * **FaceId** |
| 197 | * **Uri** |
||
| 198 | 1 | Junxiao Shi | * **LocalUri** |
| 199 | 78 | Eric Newberry | * **FacePersistency** |
| 200 | * **BaseCongestionMarkingInterval** (optional) |
||
| 201 | 85 | Eric Newberry | * **DefaultCongestionThreshold** (optional) |
| 202 | 1 | Junxiao Shi | * **Mtu** (optional) |
| 203 | 89 | Eric Newberry | * **Flags**: contains effective values for the *LocalFieldsEnabled*, *LpReliabilityEnabled*, *CongestionMarkingEnabled*, and *LpFragmentationEnabled* bits. |
| 204 | 66 | Davide Pesavento | |
| 205 | 52 | Junxiao Shi | If this creation would conflict with an existing face (e.g., same underlying protocol and remote endpoint, or a NIC-associated permanent face), the command fails with StatusCode 409, and the \<body> of the ControlResponse block contains the ControlParameters describing the existing face, with the same fields as above. |
| 206 | |||
| 207 | 1 | Junxiao Shi | If the request attempts to create a face other than UDP unicast, Ethernet unicast, or TCP, or if a static property specified in the request is not acceptable, the command fails with StatusCode 406. |
| 208 | 79 | Eric Newberry | |
| 209 | 1 | Junxiao Shi | If face creation fails due to a socket error (e.g. TCP connection timeout), the command fails with StatusCode 504. |
| 210 | |||
| 211 | 88 | Eric Newberry | If *BaseCongestionMarkingInterval* or *DefaultCongestionThreshold* are omitted from the ControlParameters sent with the creation command, the omitted static properties are left at their implementation-defined default values. |
| 212 | 1 | Junxiao Shi | |
| 213 | 87 | Davide Pesavento | If *Mtu* is omitted from the ControlParameters sent with the creation command, the automatic MTU of the transport is used as the MTU of the face. In the response, the *Mtu* field in ControlParameters contains the effective MTU of the face (in bytes). If *Mtu* is omitted from the response, the face has an infinite MTU. |
| 214 | 85 | Eric Newberry | |
| 215 | 84 | Davide Pesavento | ### Update the static properties of a face |
| 216 | 1 | Junxiao Shi | |
| 217 | 52 | Junxiao Shi | **command-verb**: `update` |
| 218 | 1 | Junxiao Shi | |
| 219 | 64 | Alex Afanasyev | ControlParameters fields: |
| 220 | |||
| 221 | 81 | Davide Pesavento | * **FaceId** (optional) |
| 222 | 1 | Junxiao Shi | * **FacePersistency** (optional): one of *on-demand*, *persistent*, or *permanent*. See "static face attributes" for more information. |
| 223 | * **BaseCongestionMarkingInterval** (optional): see "static face attributes". |
||
| 224 | * **DefaultCongestionThreshold** (optional): see "static face attributes". |
||
| 225 | 89 | Eric Newberry | * **Flags** (optional): allows *LocalFieldsEnabled*, *LpReliabilityEnabled*, *CongestionMarkingEnabled*, and *LpFragmentationEnabled* only. See "static face attributes" for more information. |
| 226 | 81 | Davide Pesavento | * **Mask** (optional): MUST be specified if *Flags* is present, and omitted if *Flags* is omitted. |
| 227 | 52 | Junxiao Shi | |
| 228 | 81 | Davide Pesavento | *FaceId* is the FaceId returned in [[FaceMgmt|Face Management]]. |
| 229 | If *FaceId* is omitted or is set to zero, it is implied to be that of the requesting face (self updating). |
||
| 230 | If the face does not exist, this command fails with StatusCode 404. |
||
| 231 | 1 | Junxiao Shi | |
| 232 | 79 | Eric Newberry | Static properties of the face are updated. |
| 233 | 81 | Davide Pesavento | If an optional property field is omitted or a bitfield is zero in *Mask*, that static property remains unchanged. |
| 234 | 1 | Junxiao Shi | If no static properties are changed, this command does nothing, but is still considered successful. |
| 235 | 55 | Junxiao Shi | |
| 236 | 1 | Junxiao Shi | If the command succeeds, \<body> in ControlResponse block contains ControlParameters describing the current properties of the face: |
| 237 | |||
| 238 | * **FaceId** |
||
| 239 | * **FacePersistency** |
||
| 240 | 78 | Eric Newberry | * **BaseCongestionMarkingInterval** (optional) |
| 241 | * **DefaultCongestionThreshold** (optional) |
||
| 242 | 81 | Davide Pesavento | * **Flags**: contains effective values for *LocalFieldsEnabled*, *LpReliabilityEnabled*, and *CongestionMarkingEnabled* bits. |
| 243 | 1 | Junxiao Shi | |
| 244 | If any of the requested changes is invalid, none of the changes should be performed, and this command fails with StatusCode 409. |
||
| 245 | 81 | Davide Pesavento | The \<body> in ControlResponse block contains ControlParameters that includes only invalid fields; if some of the bit fields chosen in *Flags*+*Mask* is invalid, the \<body> block should also contain a *Mask* field indicating which bits are invalid, and echo back the original *Flags* field. |
| 246 | If the request had been sent without those fields (or bitfields in *Mask*), it would have been successful. |
||
| 247 | 20 | Junxiao Shi | |
| 248 | 1 | Junxiao Shi | ### Destroy a face |
| 249 | 20 | Junxiao Shi | |
| 250 | 26 | Junxiao Shi | **command-verb:** `destroy` |
| 251 | 20 | Junxiao Shi | |
| 252 | 39 | Junxiao Shi | ControlParameters fields: |
| 253 | 1 | Junxiao Shi | |
| 254 | 64 | Alex Afanasyev | * **FaceId** (required) |
| 255 | 39 | Junxiao Shi | |
| 256 | 1 | Junxiao Shi | If the specified face does not exist, this command does nothing, but is still considered successful. |
| 257 | |||
| 258 | 40 | Junxiao Shi | ## Face Dataset |
| 259 | 1 | Junxiao Shi | |
| 260 | Description and counters of all active faces are published as a [[StatusDataset|Status Dataset]] at `ndn:/localhost/nfd/faces/list`. |
||
| 261 | 39 | Junxiao Shi | |
| 262 | Each face is represented by a **FaceStatus** block: |
||
| 263 | 1 | Junxiao Shi | |
| 264 | 39 | Junxiao Shi | FaceStatus ::= FACE-STATUS-TYPE TLV-LENGTH |
| 265 | FaceId |
||
| 266 | 37 | Junxiao Shi | Uri (remote FaceUri) |
| 267 | 39 | Junxiao Shi | LocalUri |
| 268 | 1 | Junxiao Shi | ExpirationPeriod? |
| 269 | FaceScope |
||
| 270 | FacePersistency |
||
| 271 | LinkType |
||
| 272 | 78 | Eric Newberry | BaseCongestionMarkingInterval? |
| 273 | 1 | Junxiao Shi | DefaultCongestionThreshold? |
| 274 | 85 | Eric Newberry | Mtu? |
| 275 | 1 | Junxiao Shi | Flags |
| 276 | NInInterests |
||
| 277 | 67 | Junxiao Shi | NInData |
| 278 | 39 | Junxiao Shi | NInNacks |
| 279 | 67 | Junxiao Shi | NOutInterests |
| 280 | 49 | Junxiao Shi | NOutData |
| 281 | NOutNacks |
||
| 282 | 46 | Junxiao Shi | NInBytes |
| 283 | NOutBytes |
||
| 284 | |||
| 285 | Uri ::= URI-TYPE TLV-LENGTH |
||
| 286 | 39 | Junxiao Shi | FaceUri in UTF-8 encoding |
| 287 | 46 | Junxiao Shi | |
| 288 | 1 | Junxiao Shi | LocalUri ::= LOCAL-URI-TYPE TLV-LENGTH |
| 289 | 46 | Junxiao Shi | FaceUri in UTF-8 encoding |
| 290 | 1 | Junxiao Shi | |
| 291 | ; other TLVs have nonNegativeInteger as value |
||
| 292 | |||
| 293 | 40 | Junxiao Shi | * **Uri** is a FaceUri representing remote endpoint. |
| 294 | 39 | Junxiao Shi | * **LocalUri** is a FaceUri representing local endpoint. |
| 295 | 40 | Junxiao Shi | * **ExpirationPeriod** is the remaining lifetime of this face. |
| 296 | 46 | Junxiao Shi | If this field is omitted, the face has infinite lifetime. |
| 297 | 40 | Junxiao Shi | Currently, this is applicable to on-demand datagram faces only. |
| 298 | 46 | Junxiao Shi | * **FaceScope** indicates whether the face is local for [[ScopeControl|scope control]] purposes. |
| 299 | 1 | Junxiao Shi | See "static face attributes" for more information. |
| 300 | 40 | Junxiao Shi | * **FacePersistency** indicates whether the face is persistent. |
| 301 | 1 | Junxiao Shi | See "static face attributes" for more information. |
| 302 | 52 | Junxiao Shi | * **LinkType** indicates the type of communication link |
| 303 | 1 | Junxiao Shi | See "static face attributes" for more information. |
| 304 | 77 | Eric Newberry | * **BaseCongestionMarkingInterval** indicates the base interval used to compute the interval at which congested packets will be marked (in nanoseconds). |
| 305 | 1 | Junxiao Shi | See "static face attributes" for more information. |
| 306 | 76 | Davide Pesavento | * **DefaultCongestionThreshold** indicates the default threshold for congestion if the face does not support retrieving the send queue capacity (in bytes). |
| 307 | 1 | Junxiao Shi | See "static face attributes" for more information. |
| 308 | 86 | Eric Newberry | * **Mtu** contains the effective MTU of the face (in bytes). If omitted, the MTU of the face is infinite. |
| 309 | 85 | Eric Newberry | See "static face attributes" for more information. |
| 310 | 74 | Eric Newberry | * **Flags** contains these bitfields: *LocalFieldsEnabled*, *LpReliabilityEnabled*, *CongestionMarkingEnabled*. |
| 311 | See "static face attributes" for more information. |
||
| 312 | 46 | Junxiao Shi | * **NInInterests**: number of incoming Interest packets since the face is established. |
| 313 | 67 | Junxiao Shi | * **NInData** counts the number of incoming Data packets since the face is established. |
| 314 | 46 | Junxiao Shi | * **NInNacks** counts the number of incoming Nack packets since the face is established. |
| 315 | 1 | Junxiao Shi | * **NOutInterests** counts the number of outgoing Interest packets since the face is established. |
| 316 | 67 | Junxiao Shi | * **NOutData** counts the number of outgoing Data packets since the face is established. |
| 317 | 37 | Junxiao Shi | * **NOutNacks** counts the number of outgoing Nack packets since the face is established. |
| 318 | * **NInBytes** counts the number of bytes of link layer packets received via this face. |
||
| 319 | This counter is initialized to zero when the face is established, and can wrap around after overflowing unsigned 64-bit integer range. |
||
| 320 | * **NOutBytes** counts the number of bytes of link layer packets sent via this face. |
||
| 321 | This counter is initialized to zero when the face is established, and can wrap around after overflowing unsigned 64-bit integer range. |
||
| 322 | |||
| 323 | 84 | Davide Pesavento | ### Query operation |
| 324 | 1 | Junxiao Shi | |
| 325 | 37 | Junxiao Shi | The query operation allows one to retrieve a subset of face dataset that contains faces satisfying a filter. |
| 326 | |||
| 327 | 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. |
||
| 328 | |||
| 329 | FaceQueryFilter ::= FACE-QUERY-FILTER-TYPE TLV-LENGTH |
||
| 330 | 40 | Junxiao Shi | FaceId? |
| 331 | UriScheme? |
||
| 332 | Uri? |
||
| 333 | 37 | Junxiao Shi | LocalUri? |
| 334 | FaceScope? |
||
| 335 | 1 | Junxiao Shi | FacePersistency? |
| 336 | 37 | Junxiao Shi | LinkType? |
| 337 | |||
| 338 | UriScheme ::= URI-SCHEME-TYPE TLV-LENGTH |
||
| 339 | string in UTF-8 |
||
| 340 | |||
| 341 | 40 | Junxiao Shi | * **FaceId** permits a face if its FaceId equals the value |
| 342 | * **UriScheme** permits a face if the scheme part of its local FaceUri or remote FaceUri equals the value |
||
| 343 | * **Uri** permits a face if its remote FaceUri equals the value |
||
| 344 | 1 | Junxiao Shi | * **LocalUri** permits a face if its local FaceUri equals the value |
| 345 | * **FaceScope** permits a face if its *FaceScope* attribute equals the value |
||
| 346 | 39 | Junxiao Shi | * **FacePersistency** permits a face if its *FacePersistency* attribute equals the value |
| 347 | 37 | Junxiao Shi | * **LinkType** permits a face if its *LinkType* attribute equals the value |
| 348 | |||
| 349 | A face must satisfy ALL conditions to satisfy the filter. |
||
| 350 | 1 | 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>`). |
| 351 | 37 | Junxiao Shi | |
| 352 | 41 | Junxiao Shi | Examples of filters: |
| 353 | 1 | Junxiao Shi | |
| 354 | 75 | Davide Pesavento | * a specific face: `FaceId=260` |
| 355 | * a specific TCP tunnel: `Uri=tcp4://192.0.2.1:6363` |
||
| 356 | (note: FaceUri must precisely match the canonical form: use either "tcp4" or "tcp6" instead of "tcp", use IP address instead of domain name, include port number) |
||
| 357 | * all TCP tunnels: `UriScheme=tcp` |
||
| 358 | (note: "tcp" permits both "tcp4" and "tcp6", "udp" permits both "udp4" and "udp6") |
||
| 359 | * all UDP multi-access faces: `UriScheme=udp` && `LinkType=multi-access` |
||
| 360 | * all Ethernet faces: `UriScheme=ether` |
||
| 361 | (note: UriScheme matches against both local and remote FaceUri, "dev" also works) |
||
| 362 | 1 | Junxiao Shi | * all faces: no condition |
| 363 | 75 | Davide Pesavento | (note: this is equivalent to face dataset, and face dataset should be preferred for this purpose) |
| 364 | 33 | Junxiao Shi | |
| 365 | ## Channel Dataset |
||
| 366 | |||
| 367 | 20 | Junxiao Shi | Description of all active channels is published as a [[StatusDataset|Status Dataset]] at `ndn:/localhost/nfd/faces/channels`. |
| 368 | 1 | Junxiao Shi | |
| 369 | Each channel is represented by a **ChannelStatus** block: |
||
| 370 | 20 | Junxiao Shi | |
| 371 | ChannelStatus := CHANNEL-STATUS-TYPE TLV-LENGTH |
||
| 372 | 21 | Alex Afanasyev | LocalUri |
| 373 | 20 | Junxiao Shi | |
| 374 | 83 | Davide Pesavento | * **LocalUri** is a FaceUri representing the channel's local endpoint. |
| 375 | 21 | Alex Afanasyev | |
| 376 | 37 | Junxiao Shi | ## Face Status Change Notification |
| 377 | |||
| 378 | Face status change events are published as a [[Notification|Notification Stream]] at `ndn:/localhost/nfd/faces/events`. |
||
| 379 | 1 | Junxiao Shi | Notifications of all faces are sent into the same notification stream. |
| 380 | 37 | Junxiao Shi | |
| 381 | 83 | Davide Pesavento | The Content of each notification Data packet is a **FaceEventNotification** block: |
| 382 | 23 | Alex Afanasyev | |
| 383 | 37 | Junxiao Shi | FaceEventNotification ::= FACE-EVENT-NOTIFICATION-TYPE TLV-LENGTH |
| 384 | 40 | Junxiao Shi | FaceEventKind |
| 385 | FaceId |
||
| 386 | Uri |
||
| 387 | 25 | Junxiao Shi | LocalUri |
| 388 | 23 | Alex Afanasyev | FaceScope |
| 389 | FacePersistency |
||
| 390 | 58 | Eric Newberry | LinkType |
| 391 | 25 | Junxiao Shi | Flags |
| 392 | 23 | Alex Afanasyev | |
| 393 | 9 | Junxiao Shi | FaceEventKind ::= FACE-EVENT-KIND-TYPE TLV-LENGTH |
| 394 | nonNegativeInteger |
||
| 395 | |||
| 396 | 1 | Junxiao Shi | **FaceEventKind** indicates the kind of event. Its possible values are: |
| 397 | 34 | Junxiao Shi | |
| 398 | 83 | Davide Pesavento | * 1 = face is created |
| 399 | * 2 = face is destroyed |
||
| 400 | * 3 = face goes UP (from DOWN state) |
||
| 401 | * 4 = face goes DOWN (from UP state) |
||
| 402 | 32 | Junxiao Shi | |
| 403 | 20 | Junxiao Shi | ## TLV-TYPE assignments |
| 404 | |||
| 405 | Type | Assigned value | Assigned value (hex) |
||
| 406 | 39 | Junxiao Shi | ------------------------------------------- | ----------------- | -------------------- |
| 407 | 40 | Junxiao Shi | FaceStatus | 128 | 0x80 |
| 408 | LocalUri | 129 | 0x81 |
||
| 409 | ChannelStatus | 130 | 0x82 |
||
| 410 | 75 | Davide Pesavento | UriScheme | 131 | 0x83 |
| 411 | 1 | Junxiao Shi | FaceScope | 132 | 0x84 |
| 412 | FacePersistency | 133 | 0x85 |
||
| 413 | LinkType | 134 | 0x86 |
||
| 414 | 74 | Eric Newberry | BaseCongestionMarkingInterval | 135 | 0x87 |
| 415 | 1 | Junxiao Shi | DefaultCongestionThreshold | 136 | 0x88 |
| 416 | 85 | Eric Newberry | Mtu | 137 | 0x89 |
| 417 | 67 | Junxiao Shi | NInInterests | 144 | 0x90 |
| 418 | 48 | Junxiao Shi | NInData | 145 | 0x91 |
| 419 | 1 | Junxiao Shi | NInNacks | 151 | 0x97 |
| 420 | 67 | Junxiao Shi | NOutInterests | 146 | 0x92 |
| 421 | 1 | Junxiao Shi | NOutData | 147 | 0x93 |
| 422 | NOutNacks | 152 | 0x98 |
||
| 423 | NInBytes | 148 | 0x94 |
||
| 424 | 39 | Junxiao Shi | NOutBytes | 149 | 0x95 |
| 425 | 1 | Junxiao Shi | FaceQueryFilter | 150 | 0x96 |
| 426 | FaceEventNotification | 192 | 0xc0 |
||
| 427 | FaceEventKind | 193 | 0xc1 |
||
| 428 | (reserved, formerly FaceFlags) | 194 | 0xc2 |