ScopeControl » History » Version 2
Junxiao Shi, 09/02/2015 09:56 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 | ## localhost Scope |
||
| 6 | |||
| 7 | The localhost scope limits propagation to the applications on the originating host. |
||
| 8 | |||
| 9 | Interest and Data packets under prefix `ndn:/localhost` are restricted by these rules: |
||
| 10 | |||
| 11 | 2 | Junxiao Shi | * Interest can come from and go to local faces only. |
| 12 | * Data can come from and go to local faces only. |
||
| 13 | 1 | Junxiao Shi | |
| 14 | ### local face |
||
| 15 | |||
| 16 | Whether a face is considered "local" for scope control purpose is determined by the face implementation. |
||
| 17 | 2 | Junxiao Shi | [[FaceMgmt#Static-Face-Attributes|FaceScope]] attribute indicates whether a face is local or non-local. |
| 18 | 1 | Junxiao Shi | |
| 19 | Generally, the following faces are local: |
||
| 20 | |||
| 21 | 2 | Junxiao Shi | * internal face for NFD [[Management]] |
| 22 | 1 | Junxiao Shi | * UNIX-domain socket face |
| 23 | * TCP face whose remote address is a loopback address |
||
| 24 | * WebSocket face whose remote address is a loopback address |
||
| 25 | |||
| 26 | 2 | Junxiao Shi | A local process may connect as non-local by establishing a TCP or WebSocket connection to the IP address of a non-loopback NIC of the local machine. |
| 27 | 1 | Junxiao Shi | Since this IP address is not a loopback address, the face would be non-local. |
| 28 | This is desirable in scenarios such as a protocol translator. |
||
| 29 | |||
| 30 | ## localhop Scope |
||
| 31 | |||
| 32 | The localhop scope limits propagation to no further than the next node. |
||
| 33 | |||
| 34 | Interest packets under prefix `ndn:/localhop` are restricted by these rules: |
||
| 35 | |||
| 36 | * Interest can come from a local face or a non-local face. |
||
| 37 | * If PIT entry has at least one InRecord from a local face, it can be forwarded to local faces and non-local faces. |
||
| 38 | * If PIT entry has all InRecords from non-local faces, it can only be forwarded to local faces. |
||
| 39 | * PIT entry can be satisfied by Data from any source. |
||
| 40 | |||
| 41 | Data packets under prefix `ndn:/localhop` are unrestricted. |
||
| 42 | |||
| 43 | 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. |
||
| 44 | 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. |
||
| 45 | 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. |