HOW-TO SEND PUSH MESSAGES on CCNx 0.7.1

Managed Replication and Opportunistic Caching are two different approaches to fill caches. In the CCNx prototype, they have decided to use oppportunistic caches as the standard way to fill the caches while content replication was chosen by other future internet projects such as NetInf and FP7 PURSUIT.

Even when opportunistic caching has given important and attractive results, we propose a hack for the CCNX prototype to include support for content replication techniques. This hack has been coded in the version 0.7.1.

We aim at distributing certain content in a CCN network, we wish to copy our content around a determined path. In order to accomplish, we propose to send a fake interest that hides the real interest to demand. Once our node has received the fake interest, it immediatly decodes the hidden real name. Thus, it can issue an interest message for the real content and following the normal CCN behavior the desired get cached through the path.

We begin by downloading the source code of CCNx 0.7.1:

# wget http://www.ccnx.org/releases/ccnx-0.7.1.tar.gz

We extract, configure and compile the files:


# tar -xvzf ccnx-0.7.1.tar.gz
# cd ccnx-0.7.1
# ./configure
# make

If everything has worked correctly, we apply our patch:


-------------------------------------------------------------------------------
--- ccnpoke_original.c	2013-01-31 18:51:00.000000000 +0100
+++ ccnpoke.c	2013-06-17 17:08:38.000000000 +0200
@@ -87,6 +87,13 @@
                     1, NULL,
                     info->interest_ccnb, info->pi->offset[CCN_PI_E],
                     info->pi)) {
+
+                fwrite(info->interest_ccnb + info->pi->offset[CCN_PI_B_Exclude],
+                    1,
+                    info->pi->offset[CCN_PI_E_Exclude] - info->pi->offset[CCN_PI_B_Exclude] +1,
+                    stdout
+                    );
+                
                 res = ccn_put(info->h, cob->buf, cob->length);
                 if (res >= 0) {
                     selfp->intdata = 1;
-------------------------------------------------------------------------------

We recompile and install CCNx 0.7.1:

# make
# make install

And we start the ccnd daemon:

# ccndstart

Example


  /---\      /---\      /---\
  | A |------| B |------| C |
  \___/      \___/      \___/
    |          |          |
   TTT        TTT        TTT
Suppose, we have 3 different machines and we want A to decide which content to replicate in his way through node C (i.e. B, C). In our example, the content we want to push is /tmp/prueba. We are going to hide this name (/tmp/prueba) into a normal interest request from A to C. In the node A, we produce the content we are going to cache through the B, C path. Thus, we execute the command:
echo 'content' | ccnpoke /tmp/prueba
In the node C, we are going to listen for interest that hides information. We have registered the name /test/name/C for this subject.
echo "hello" | ./bin/ccnpoke -x 1 /test/name/C | ccnpeek `ccnbx -d - Component`
In this command, we receive the answer for the content /test/name/C. Our patch of ccnpoke prints the hidden value in the interest message which we pass through a pipe as standard input of ccnpeek which is going to decode it. Our patch prints in the standard input the encoded xml information send into a XML message. Now, everytime we want to cache something from Node A to Node C. In node A, we execute:
# ccn_xmltoccnb -w /tmp/test.xml && ccndsmoketest test.ccnb recv
where /tmp/test.xml is:


<Interest>
  <Name>
    <Component ccnbencoding="text">test<</Component>
    <Component ccnbencoding="text">name</Component>
    <Component ccnbencoding="text">C</Component>
  </Name>
  <Exclude>
    L3RtcC9wcnVlYmE=</Component>
  </Exclude>
</Interest>

And:

L3RtcC9wcnVlYmE= is /tmp/prueba encoded in Base64.

It's important to remark that we create an interest message from a XML file and we immediatly send it through the CCN network.

Once the command is executed, the node C receives the interest with hidden information, it decrypts it and generate an interest for /tmp/prueba content. Following normal CCN behavior, the content gets cached through the path.

Go back to main page

Last Updated on June 1, 2012 Valid XHTML 1.0 Transitional