Meki Cherkaoui | b7d8eb0 | 2012-04-22 16:25:27 -0700 | [diff] [blame] | 1 | First native version of the NDN protocol written in Javascript ( Also refereed to as CCN ) |
Meki Cherkaoui | f2e96ed | 2012-04-22 16:21:27 -0700 | [diff] [blame] | 2 | |
Jeff Thompson | 9e6dff0 | 2012-11-04 09:20:47 -0800 | [diff] [blame] | 3 | The goal of this project is to improve the current implementation of the NDN-JS API that allows users to create applications running on top of the NDN network. The goal is to have a lightweight version of the protocol, which can run on browsers. The main intent is to enable browser-based applications to use NDN directly without requiring a binary build of the CCNx code. In particular, the goal is to have an AJAX-style dynamic data access. The goal is also to have a lighter version of the protocol, which would be better suited for embedded systems. Furthermore, the goal is that NDN-JS communicates with CCNx nodes (routers). |
Meki Cherkaoui | f2e96ed | 2012-04-22 16:21:27 -0700 | [diff] [blame] | 4 | |
Jeff Thompson | 9e6dff0 | 2012-11-04 09:20:47 -0800 | [diff] [blame] | 5 | The current status of NDN-JS allows for JavaScript applications running on browsers to send interest packets and retrieve data packets. This includes encoding and decoding data packets. |
Meki Cherkaoui | f2e96ed | 2012-04-22 16:21:27 -0700 | [diff] [blame] | 6 | |
| 7 | This is currently done in the following way: |
| 8 | |
Jeff Thompson | 9e6dff0 | 2012-11-04 09:20:47 -0800 | [diff] [blame] | 9 | var ndn = new NDN(); |
| 10 | var contentObject = ndn.get('/ndn/ucla.edu/apps/hydra/mainvideo'); |
| 11 | console.log(contentObject.content); |
| 12 | |
| 13 | * Firefox extension for ccnx protocol |
| 14 | |
| 15 | NDN-JS also includes a Firefox extension for the ccnx protocol. To install in Firefox, open |
| 16 | Tools > Add-ons. In the "gear" or "wrench" menu, click Install Add-on From File and open |
| 17 | js/ccnxProtocol.xpi in this distribution. Restart Firefox. |
| 18 | |
| 19 | Firefox uses the extension to load any URI starting with ccnx, for example |
| 20 | ccnx:/ndn/ucla.edu/apps/lwndn-test/trig-table |
| 21 | |
| 22 | When the page is loaded, the extension updates address bar with the full matched name from the |
| 23 | retrieved content object including the version, but without the implicit digest or segment number |
| 24 | (see below). |
| 25 | |
| 26 | A URI for content with multiple segments is handled as follows. |
| 27 | If the URI has a segment number, just retrieve that segment and return the content to the browser. |
| 28 | |
| 29 | Otherwise look at the name in the returned ContentObject. If the returned name has no segment number, |
| 30 | just return the content to the browser. If the name has a segment number which isn't 0, store it |
| 31 | and express an interest for segment 0. Read segments in order and return each content to the browser |
| 32 | as we go until we get the segment for FinalBlockID. |
| 33 | |