LocalControlHeader » History » Revision 24
Revision 23 (Alex Afanasyev, 02/17/2014 08:42 PM) → Revision 24/26 (Junxiao Shi, 03/22/2014 03:29 PM)
# NFD Local Control Header NFD LocalControlHeader local control header is used between application and local forwarding daemon to exchange various NFD-specific local information that is not part of Interest and Data packet. For example, LocalControlHeader local control header allows applications to specify FaceId to which the Interest should be forwarded. ## Enabling and disabling LocalControlHeader local control header LocalControlHeader NFD local control header is not enabled initially. Application can invoke [[FaceMgmt#Enable a LocalControlHeader feature|faces/enable-local-control]] command to enable a LocalControlHeader feature, by default and invoke [[FaceMgmt#Disable a LocalControlHeader feature|faces/disable-local-control]] command requires explicit request from the client to disable a LocalControlHeader feature, enable. NFD MUST NOT deliver packets with LocalControlHeader to an application unless the application has enabled at least one LocalControlHeader feature. control module. This request to enable/disable local control header is in form of [[Command_Interests|Signed Command Interest]] and have the following structure: /localhost/nfd/control-header/<control-module>/<command-verb>/................... \ / \ / \ / ------------ ------------ ------------ -------------- ------- -------- \/ \/ \/ NFD SHOULD ignore a LocalControlHeader field if the corresponding feature is not enabled. Control Command "in-faceid" "enable" or Command Interest "nexthop-faceid" "disable" related information An enable or disable enable/disable command MAY NOT take effect immediately. Packets scheduled for transmission before processing the enable or disable enable/disable command successfully could be delivered or processed in the old state. ## Control modules ### in-faceid This control module allows application to receive information about incoming FaceId for each received Interest and Data packet. When enabled, packets will be encapsulated in LocalControlHeader, as defined below. ### nexthop-faceid This control module allows application to specify nexthop FaceId in outgoing Interests. When enabled, NFD will accept incoming Interests encapsulated in LocalControlHeader structure that specifies nexthop FaceId to forward this Interest. The specified `NextHopFaceId` is effective only if the Interest is under a namespace managed by `ClientControl` strategy. If the namespace uses any other strategy, `NextHopFaceId` will be ignored. <!-- * ``sniffer`` Enable/disable sniffing on all or specific Faces. The format of this command is actually is a little bit different and requires one more option: ``<face-id>``: /localhost/nfd/control-header/sniffer/(enable|disable)/<face-id>/<timestamp>/<SignatureInfo>/<SignatureValue> To snif on all faces, ``<face-id>`` should be 0. --> ## LocalControlHeader The LocalControlHeader is defined as follows: LocalControlHeader ::= LOCAL-CONTROL-HEADER-TYPE TLV-LENGTH IncomingFaceId? NextHopFaceId? ...? (Interest | Data) IncomingFaceId ::= INCOMING-FACE-ID-TYPE TLV-LENGTH nonNegativeInteger NextHopFaceId ::= NEXT-HOP-FACE-ID-TYPE TLV-LENGTH nonNegativeInteger Although <!-- SnifferInfo) SnifferInfo ::= SNIFFER-INFO-TYPE TLV-LENGTH ... (TBD) --> Note that although that all fields items before `(Interest ``(Interest | Data)` Data)`` in LocalControlHeader are marked optional, at least one of them the items must be present. ## IncomingFaceId feature This feature allows application to learn the incoming face of each Interest and Data packet. If this feature is enabled, when an incoming Interest or Data is delivered to application, the packet is encapsulated in LocalControlHeader, with IncomingFaceId field is set to the incoming FaceId. However, Datas from the ContentStore won't have a IncomingFaceId field. ## NextHopFaceId feature This feature allows application to pick a nexthop for its Interest. If this feature is enabled, application can encapsulate an Interest in LocalControlHeader, and set NextHopFaceId field to the desired nexthop. **ClientControl strategy** SHOULD be [[StrategyChoice|chosen]] as the effective strategy on the Interest's namespace. It will honor NextHopFaceId field, and forward Interest to the desired nexthop. If other strategy is being used, NextHopFaceId has no effect. ## TLV-TYPE assignments Type | Assigned value | Assigned value (hex) ------------------------------------------- | ----------------- | -------------------- LocalControlHeader | 80 | 0x50 IncomingFaceId | 81 | 0x51 NextHopFaceId | 82 | 0x52