Project

General

Profile

ScopeControl » History » Version 1

Junxiao Shi, 06/26/2014 10:03 PM

1 1 Junxiao Shi
# Namespace-based Scope Control
2
3
NFD performs scope control of Interest and Data according to their namespace.
4
5
Namespace-based scope control is the only kind of scope control supported by NFD.
6
[Scope Guider](http://named-data.net/doc/ndn-tlv/interest.html#scope) in NDN-TLV Interest packet is not supported, and is ignored.
7
8
## localhost Scope
9
10
The localhost scope limits propagation to the applications on the originating host.
11
It is equivalent to [Scope=1](http://named-data.net/doc/ndn-tlv/interest.html#scope).
12
13
Interest and Data packets under prefix `ndn:/localhost` are restricted by these rules:
14
15
* Interest namespace can come from and go to local faces only.
16
* Data namespace can come from and go to local faces only.
17
18
### local face
19
20
Whether a face is considered "local" for scope control purpose is determined by the face implementation.
21
`Face::isLocal()` attribute returns true if a face is local for scope control purpose.
22
23
Generally, the following faces are local:
24
25
* the `InternalFace` (in NFD management module)
26
* UNIX-domain socket face
27
* TCP face whose remote address is a loopback address
28
* WebSocket face whose remote address is a loopback address
29
30
A local process may connect as non-local by establishing a TCP or WebSocket connection to the IP address on a physical NIC of the local machine.
31
Since this IP address is not a loopback address, the face would be non-local.
32
This is desirable in scenarios such as a protocol translator.
33
34
## localhop Scope
35
36
The localhop scope limits propagation to no further than the next node.
37
It is equivalent to [Scope=2](http://named-data.net/doc/ndn-tlv/interest.html#scope).
38
39
Interest packets under prefix `ndn:/localhop` are restricted by these rules:
40
41
* Interest can come from a local face or a non-local face.
42
* If PIT entry has at least one InRecord from a local face, it can be forwarded to local faces and non-local faces.
43
* If PIT entry has all InRecords from non-local faces, it can only be forwarded to local faces.
44
* PIT entry can be satisfied by Data from any source.
45
46
Data packets under prefix `ndn:/localhop` are unrestricted.
47
48
The localhop scope allows an Interest packet to travel only one hop from the consumer host, but a Data packet may travel multiple hops from the producer host.
49
Suppose we have three hosts A-B-C in a linear topology, B can retrieve a Data under /localhop namespace from C, and this Data is cached in B's ContentStore.
50
Later A sends an Interest to B; although B cannot forward this Interest to C, the cached Data can satisfy the Interest and would be returned to A.