Project

General

Profile

LocalControlHeader » History » Version 25

Junxiao Shi, 10/19/2014 01:46 PM

1 18 Alex Afanasyev
# NFD Local Control Header
2 3 Alex Afanasyev
3 24 Junxiao Shi
NFD LocalControlHeader is used between application and local forwarding daemon to exchange various NFD-specific local information that is not part of Interest and Data packet.  
4
For example, LocalControlHeader allows applications to specify FaceId to which the Interest should be forwarded.
5 1 Junxiao Shi
6 24 Junxiao Shi
## Enabling and disabling LocalControlHeader
7 1 Junxiao Shi
8 24 Junxiao Shi
LocalControlHeader is not enabled initially.  
9
Application can invoke [[FaceMgmt#Enable a LocalControlHeader feature|faces/enable-local-control]] command to enable a LocalControlHeader feature,
10
and invoke [[FaceMgmt#Disable a LocalControlHeader feature|faces/disable-local-control]] command to disable a LocalControlHeader feature,
11 1 Junxiao Shi
12 24 Junxiao Shi
NFD MUST NOT deliver packets with LocalControlHeader to an application unless the application has enabled at least one LocalControlHeader feature.
13
NFD SHOULD ignore a LocalControlHeader field if the corresponding feature is not enabled.  
14
An enable or disable command MAY NOT take effect immediately.
15
Packets scheduled for transmission before processing the enable or disable command could be delivered or processed in the old state.
16 16 Junxiao Shi
17 24 Junxiao Shi
## LocalControlHeader structure
18 16 Junxiao Shi
19 8 Alex Afanasyev
    LocalControlHeader ::= LOCAL-CONTROL-HEADER-TYPE TLV-LENGTH
20 16 Junxiao Shi
                             IncomingFaceId?
21 8 Alex Afanasyev
                             NextHopFaceId?
22 25 Junxiao Shi
                             CachingPolicy?
23 1 Junxiao Shi
                             ...?
24 12 Alex Afanasyev
                             (Interest | Data)
25 3 Alex Afanasyev
26
    IncomingFaceId     ::= INCOMING-FACE-ID-TYPE TLV-LENGTH
27
                              nonNegativeInteger
28 15 Alex Afanasyev
29 1 Junxiao Shi
    NextHopFaceId      ::= NEXT-HOP-FACE-ID-TYPE TLV-LENGTH
30 3 Alex Afanasyev
                              nonNegativeInteger
31 1 Junxiao Shi
32 24 Junxiao Shi
Although all fields before `(Interest | Data)` in LocalControlHeader are marked optional, at least one of them must be present.
33 1 Junxiao Shi
34 24 Junxiao Shi
## IncomingFaceId feature
35
36
This feature allows application to learn the incoming face of each Interest and Data packet.
37
38
If this feature is enabled,
39
when an incoming Interest or Data is delivered to application,
40
the packet is encapsulated in LocalControlHeader, with IncomingFaceId field is set to the incoming FaceId.  
41
However, Datas from the ContentStore won't have a IncomingFaceId field.
42
43
## NextHopFaceId feature
44
45
This feature allows application to pick a nexthop for its Interest.
46
47
If this feature is enabled,
48
application can encapsulate an Interest in LocalControlHeader, and set NextHopFaceId field to the desired nexthop.
49
50
**ClientControl strategy** SHOULD be [[StrategyChoice|chosen]] as the effective strategy on the Interest's namespace.
51
It will honor NextHopFaceId field, and forward Interest to the desired nexthop.  
52
If other strategy is being used, NextHopFaceId has no effect.
53 21 Alex Afanasyev
54 25 Junxiao Shi
## CachingPolicy feature
55
56
This feature allows application to give ContentStore an instruction about whether/how to cache the Data packet.
57
58
If this feature is enabled,
59
application MAY attach a CachingPolicy field on a Data packet to NFD,
60
which has the following structure:
61
62
    CachingPolicy ::= CACHING-POLICY-TYPE TLV-LENGTH
63
                        NoCache
64
    
65
    NoCache       ::= NO-CACHE-TYPE TLV-LENGTH(=0)
66
67
The CachingPolicy field contains exactly one sub-TLV as the instruction.
68
69
Currently only one instruction TLV is defined:
70
71
* NoCache: ContentStore SHOULD NOT cache the Data packet.
72
  This instruction TLV has no parameter and therefore is empty.
73
74
Instruction TLVs defined in the future MAY need have parameter as its TLV-VALUE.
75
76
Caching field MUST NOT be attached to a packet from NFD to application, or to a non-Data packet.
77
78 1 Junxiao Shi
## TLV-TYPE assignments
79
80
Type                                        | Assigned value    | Assigned value (hex)
81
------------------------------------------- | ----------------- | --------------------
82 23 Alex Afanasyev
LocalControlHeader                          | 80                | 0x50
83
IncomingFaceId                              | 81                | 0x51
84
NextHopFaceId                               | 82                | 0x52
85 25 Junxiao Shi
CachingPolicy                               | 83                | 0x53
86
NoCache                                     | 96                | 0x60