blob: ad9e4ba535a027a6689ed6a4afa989b613321d18 [file] [log] [blame]
Meki Cherkaouib7d8eb02012-04-22 16:25:27 -07001First native version of the NDN protocol written in Javascript ( Also refereed to as CCN )
Meki Cherkaouif2e96ed2012-04-22 16:21:27 -07002
Jeff Thompson9e6dff02012-11-04 09:20:47 -08003The 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 Cherkaouif2e96ed2012-04-22 16:21:27 -07004
Jeff Thompson9e6dff02012-11-04 09:20:47 -08005The 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 Cherkaouif2e96ed2012-04-22 16:21:27 -07006
7This is currently done in the following way:
8
Jeff Thompson9e6dff02012-11-04 09:20:47 -08009var ndn = new NDN();
10var contentObject = ndn.get('/ndn/ucla.edu/apps/hydra/mainvideo');
11console.log(contentObject.content);
12
13* Firefox extension for ccnx protocol
14
15NDN-JS also includes a Firefox extension for the ccnx protocol. To install in Firefox, open
16Tools > Add-ons. In the "gear" or "wrench" menu, click Install Add-on From File and open
17js/ccnxProtocol.xpi in this distribution. Restart Firefox.
18
19Firefox uses the extension to load any URI starting with ccnx, for example
20ccnx:/ndn/ucla.edu/apps/lwndn-test/trig-table
21
22When the page is loaded, the extension updates address bar with the full matched name from the
23retrieved content object including the version, but without the implicit digest or segment number
24(see below).
25
26A URI for content with multiple segments is handled as follows.
27If the URI has a segment number, just retrieve that segment and return the content to the browser.
28
29Otherwise look at the name in the returned ContentObject. If the returned name has no segment number,
30just return the content to the browser. If the name has a segment number which isn't 0, store it
31and express an interest for segment 0. Read segments in order and return each content to the browser
32as we go until we get the segment for FinalBlockID.
33