NLSR Management » History » Version 42
  Muktadir Chowdhury, 10/06/2017 11:22 AM 
  
| 1 | 1 | Muktadir Chowdhury | NLSR Management  | 
|---|---|---|---|
| 2 | ===============  | 
||
| 3 | 2 | Muktadir Chowdhury | |
| 4 | NLSR Management provides:  | 
||
| 5 | |||
| 6 | - command to add(advertise) routes to name prefix list  | 
||
| 7 | 21 | Muktadir Chowdhury | - command to remove(withdraw) routes from name prefix list  | 
| 8 | 2 | Muktadir Chowdhury | |
| 9 | 3 | Muktadir Chowdhury | ## 1. Control Commands  | 
| 10 | 2 | Muktadir Chowdhury | |
| 11 | 19 | Muktadir Chowdhury | ### 1.1 Add a name prefix  | 
| 12 | 10 | Muktadir Chowdhury | |
| 13 | 19 | Muktadir Chowdhury | #### command-verb: advertise  | 
| 14 | 10 | Muktadir Chowdhury | This command adds a name prefix to the name prefix list. This command can be accepted on ```ndn:/localhost/nlsr/prefix-update``` prefix.  | 
| 15 | 2 | Muktadir Chowdhury | |
| 16 | 19 | Muktadir Chowdhury | #### Control Parameters  | 
| 17 | 2 | Muktadir Chowdhury | - Name (required)  | 
| 18 | |||
| 19 | 19 | Muktadir Chowdhury | ### 1.2 Remove a name prefix  | 
| 20 | 11 | Muktadir Chowdhury | |
| 21 | 19 | Muktadir Chowdhury | #### command-verb: withdraw  | 
| 22 | 11 | Muktadir Chowdhury | This command removes a name prefix from the name prefix list. This command can be accepted on ```ndn:/localhost/nlsr/prefix-update``` prefix.  | 
| 23 | |||
| 24 | 19 | Muktadir Chowdhury | #### Control Parameters  | 
| 25 | 2 | Muktadir Chowdhury | - Name (required)  | 
| 26 | |||
| 27 | 3 | Muktadir Chowdhury | ## 2. Request format  | 
| 28 | 36 | Muktadir Chowdhury | NLSR control commands are command interests (https://redmine.named-data.net/projects/ndn-cxx/wiki/CommandInterest), whose name has the following form:  | 
| 29 | 1 | Muktadir Chowdhury | |
| 30 | 39 | Muktadir Chowdhury | /<prefix>/<management-module>/<command-verb>/<control-parameters>/<timestamp>/<random-value>/<SignatureInfo>/<SignatureValue>  | 
| 31 | 41 | Muktadir Chowdhury | |
| 32 | |||
| 33 | 13 | Muktadir Chowdhury | - ```<prefix>``` is ```/localhost/nlsr ```. Each individual command may specify additional prefixes under which that command could be accepted.  | 
| 34 | - ```<management-module> ```is the name of management module to which the command needs to be dispatched. For example, the name of the management module in this case would be ```prefix-update```.  | 
||
| 35 | 1 | Muktadir Chowdhury | - ```<command-verb>``` is the command to be executed. For this case this would be either ```withdraw``` or ```advertise```.  | 
| 36 | 35 | Muktadir Chowdhury | - ```<control-parameters>``` is a ControlParameters TLV block wrapped in a NameComponent.  | 
| 37 | 1 | Muktadir Chowdhury | - ```<timestamp>``` is interest's timestamp that is used to prevent replay attack.  | 
| 38 | 35 | Muktadir Chowdhury | - ```<random-value>``` aka Nonce that ensures the uniqueness of an interest.  | 
| 39 | 36 | Muktadir Chowdhury | - ```<SignatureInfo>``` and ```<SignatureValue>``` are additional components defined by [ndn-cxx:SignedInterest|Signed Interest] spec.  | 
| 40 | 42 | Muktadir Chowdhury | |
| 41 | So, putting everything together, the complete name of a command interest would be  | 
||
| 42 | |||
| 43 | /localhost/nlsr/prefix-update/advertise/<control-parameters>/<timestamp>/<random-value>/<SignatureInfo>/<SignatureValue>  | 
||
| 44 | or  | 
||
| 45 | |||
| 46 | /localhost/nlsr/prefix-update/withdraw/<control-parameters>/<timestamp>/<random-value>/<SignatureInfo>/<SignatureValue>  | 
||
| 47 | 2 | Muktadir Chowdhury | |
| 48 | 6 | Muktadir Chowdhury | ## 3. Response Format  | 
| 49 | 1 | Muktadir Chowdhury | |
| 50 | 2 | Muktadir Chowdhury | A response from the command interface is a Data that matches the request Interest. The payload of this Data is a ControlResponse block.  | 
| 51 | |||
| 52 | 1 | Muktadir Chowdhury | ### StatusCode  | 
| 53 | 32 | Ashlesh Gawande | StatusCode loosely follows the HTTP semantics described in RFC2616 section 10 ([RFC2616](https://www.ietf.org/rfc/rfc2616.txt))  | 
| 54 | 6 | Muktadir Chowdhury | |
| 55 | 3 | Muktadir Chowdhury | StatusCode | Description  | 
| 56 | ------------|------------------------------------  | 
||
| 57 | 2 | Muktadir Chowdhury | 200 | OK  | 
| 58 | 22 | Laqin Fan | 204 | Prefix is already advertised/withdrawn  | 
| 59 | 2 | Muktadir Chowdhury | 400 | ControlParameters is incorrect  | 
| 60 | 403 | Command Interest is not authorized  | 
||
| 61 | 501 | Module or verb is not supported  | 
||
| 62 | 1 | Muktadir Chowdhury | 503 | Feature is disabled  |