diff --git a/examples/ccnx-test.cc b/examples/ccnx-test.cc
index 4f4205c..626a2f5 100644
--- a/examples/ccnx-test.cc
+++ b/examples/ccnx-test.cc
@@ -14,6 +14,8 @@
 int 
 main (int argc, char *argv[])
 {
+  LogComponentEnable ("CcnxTest", LOG_ALL);
+  
   Config::SetDefault ("ns3::OnOffApplication::PacketSize", UintegerValue (210));
   Config::SetDefault ("ns3::OnOffApplication::DataRate", StringValue ("448kb/s"));
   
@@ -31,24 +33,27 @@
   // Ipv4ListRoutingHelper list;
   // list.Add (staticRouting, 1);
 
+  NS_LOG_INFO ("Create channels.");
+  PointToPointHelper p2p;
+  p2p.SetDeviceAttribute ("DataRate", StringValue ("10Mbps"));
+  p2p.SetChannelAttribute ("Delay", StringValue ("1ms"));
+  NetDeviceContainer nd = p2p.Install (n);
+
+  NS_LOG_INFO ("Installing NDN stack");
   CcnxStackHelper ccnx;
-  ccnx.Install (c);
+
+  // ? set up forwarding
+  
+  //  ccnx.Install (c);
   
   //Add static routing
   // InternetStackHelper internet;
   // internet.SetRoutingHelper (list); // has effect on the next Install ()
   // internet.Install (c);
   
-  // We create the channels first without any IP addressing information
-  // NS_LOG_INFO ("Create channels.");
-  // PointToPointHelper p2p;
-  // p2p.SetDeviceAttribute ("DataRate", StringValue ("10Mbps"));
-  // p2p.SetChannelAttribute ("Delay", StringValue ("1ms"));
-  // NetDeviceContainer nd = p2p.Install (n);
-  
   // Create the OnOff application to send UDP datagrams of size
   // 210 bytes at a rate of 448 Kb/s from n0 to n4
-  NS_LOG_INFO ("Create Applications.");
+  // NS_LOG_INFO ("Create Applications.");
   
   // std::string sendsizeattr = "SendSize";
   // //flow2 7-->2
@@ -70,5 +75,5 @@
   Simulator::Destroy ();
   NS_LOG_INFO ("Done.");
   
-	return 0;
+  return 0;
 }
diff --git a/helper/ccnx-coding-helper.cc b/helper/ccnx-coding-helper.cc
deleted file mode 100644
index 6899543..0000000
--- a/helper/ccnx-coding-helper.cc
+++ /dev/null
@@ -1,223 +0,0 @@
-/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
-/*
- * Copyright (c) 2011 University of California, Los Angeles
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation;
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
- * Author: 
- */
-
-#include "ccnx-coding-helper.h"
-
-#include "ns3/name-components.h"
-#include "ns3/ccnx-interest-header.h"
-#include "ns3/ccnx-content-object-header.h"
-
-#include <sstream>
-
-namespace ns3 {
-
-#define CCN_TT_BITS 3
-#define CCN_TT_MASK ((1 << CCN_TT_BITS) - 1)
-#define CCN_MAX_TINY ((1 << (7-CCN_TT_BITS)) - 1)
-#define CCN_TT_HBIT ((unsigned char)(1 << 7))
-
-size_t
-CcnxCodingHelper::AppendBlockHeader (Buffer::Iterator start, size_t val, enum ccn_tt tt)
-{
-  unsigned char buf[1+8*((sizeof(val)+6)/7)];
-  unsigned char *p = &(buf[sizeof(buf)-1]);
-  size_t n = 1;
-  p[0] = (CCN_TT_HBIT & ~CCN_CLOSE) |
-  ((val & CCN_MAX_TINY) << CCN_TT_BITS) |
-  (CCN_TT_MASK & tt);
-  val >>= (7-CCN_TT_BITS);
-  while (val != 0) {
-    (--p)[0] = (((unsigned char)val) & ~CCN_TT_HBIT) | CCN_CLOSE;
-    n++;
-    val >>= 7;
-  }
-  start.Write (p,n);
-  return n;
-}
-
-size_t
-CcnxCodingHelper::AppendNumber (Buffer::Iterator start, uint32_t number)
-{
-  std::ostringstream os;
-  os << number;
-
-  size_t written = 0;
-  written += AppendBlockHeader (start, os.str().size(), CCN_UDATA);
-  written += os.str().size();
-  start.Write (reinterpret_cast<const unsigned char*>(os.str().c_str()), os.str().size());
-
-  return written;
-}
-
-  
-size_t
-CcnxCodingHelper::CcnxCodingHelper::AppendCloser (Buffer::Iterator start)
-{
-  start.WriteU8 (CCN_CLOSE);
-  return 1;
-}
-
-size_t
-CcnxCodingHelper::AppendName (Buffer::Iterator start, const Name::Components &name)
-{
-  return 0;
-}
-
-size_t
-CcnxCodingHelper::AppendTimestampBlob (Buffer::Iterator start, Time time)
-{
-  // the original function implements Markers... thought not sure what are these markers for...
-
-  // Determine miminal number of bytes required to store the timestamp
-  int required_bytes = 2; // 12 bits for fractions of a second, 4 bits left for seconds. Sometimes it is enough
-  intmax_t ts = time.ToInteger (Time::S) >> 4;
-  for (;  required_bytes < 7 && ts != 0; ts >>= 8) // not more than 6 bytes?
-     required_bytes++;
-  
-  size_t len = AppendBlockHeader(start, required_bytes, CCN_BLOB);
-
-  // write part with seconds
-  ts = time.ToInteger (Time::S) >> 4;
-  for (int i = 0; i < required_bytes - 2; i++)
-    start.WriteU8 ( ts >> (8 * (required_bytes - 3 - i)) );
-
-  /* arithmetic contortions are to avoid overflowing 31 bits */
-  ts = ((time.ToInteger (Time::S) & 15) << 12) + ((time.ToInteger (Time::NS) / 5 * 8 + 195312) / 390625);
-  for (int i = required_bytes - 2; i < required_bytes; i++)
-    start.WriteU8 ( ts >> (8 * (required_bytes - 1 - i)) );
-  
-  return len + required_bytes;
-}
-
-size_t
-CcnxCodingHelper::AppendTaggedBlob (Buffer::Iterator start, ccn_dtag dtag,
-                  const uint8_t *data, size_t size)
-{
-  size_t written = AppendBlockHeader (start, dtag, CCN_DTAG);
-  if (size>0)
-    {
-      written += AppendBlockHeader (start, size, CCN_BLOB);
-      start.Write (data, size);
-      written += size;
-    }
-  written += AppendCloser (start);
-
-  return written;
-}
-
-
-size_t
-CcnxCodingHelper::Serialize (Buffer::Iterator start, const CcnxInterestHeader &interest)
-{
-  size_t written = 0;
-  written += AppendBlockHeader (start, CCN_DTAG_Interest, CCN_DTAG); // <Interest>
-  
-  written += AppendBlockHeader (start, CCN_DTAG_Name, CCN_DTAG); // <Name>
-  written += AppendName (start, interest.GetName());                // <Component>...</Component>...
-  written += AppendCloser (start);                               // </Name>
-
-  if (interest.GetMinSuffixComponents() >= 0)
-    {
-      written += AppendBlockHeader (start, CCN_DTAG_MinSuffixComponents, CCN_DTAG);
-      written += AppendNumber (start, interest.GetMinSuffixComponents ());
-      written += AppendCloser (start);
-    }
-  if (interest.GetMaxSuffixComponents() >= 0)
-    {
-      written += AppendBlockHeader (start, CCN_DTAG_MaxSuffixComponents, CCN_DTAG);
-      written += AppendNumber (start, interest.GetMaxSuffixComponents ());
-      written += AppendCloser (start);
-    }
-  if (interest.GetExclude().size() > 0)
-    {
-      written += AppendBlockHeader (start, CCN_DTAG_Exclude, CCN_DTAG); // <Exclude>
-      written += AppendName (start, interest.GetExclude());                // <Component>...</Component>...
-      written += AppendCloser (start);                                  // </Exclude>
-    }
-  if (interest.IsEnabledChildSelector())
-    {
-      written += AppendBlockHeader (start, CCN_DTAG_ChildSelector, CCN_DTAG);
-      written += AppendNumber (start, 1);
-      written += AppendCloser (start);
-    }
-  if (interest.IsEnabledAnswerOriginKind())
-    {
-      written += AppendBlockHeader (start, CCN_DTAG_AnswerOriginKind, CCN_DTAG);
-      written += AppendNumber (start, 1);
-      written += AppendCloser (start);
-    }
-  if (interest.GetScope() >= 0)
-    {
-      written += AppendBlockHeader (start, CCN_DTAG_Scope, CCN_DTAG);
-      written += AppendNumber (start, interest.GetScope ());
-      written += AppendCloser (start);
-    }
-  if (!interest.GetInterestLifetime().IsZero())
-    {
-      written += AppendBlockHeader (start, CCN_DTAG_InterestLifetime, CCN_DTAG);
-      written += AppendTimestampBlob (start, interest.GetInterestLifetime());
-      written += AppendCloser (start);
-    }
-  if (interest.GetNonce()>0)
-    {
-      uint32_t nonce = interest.GetNonce();
-      written += AppendTaggedBlob (start, CCN_DTAG_Nonce,
-                                   reinterpret_cast<const uint8_t*>(&nonce),
-                                   sizeof(nonce));
-    }
-  written += AppendCloser (start); // </Interest>
-
-  return written;
-}
-
-size_t
-CcnxCodingHelper::Serialize (Buffer::Iterator start, const CcnxContentObjectHeader &contentObject)
-{
-  size_t written = 0;
-  written += AppendBlockHeader (start, CCN_DTAG_ContentObject, CCN_DTAG); // <ContentObject>
-
-  // fake signature
-  written += AppendBlockHeader (start, CCN_DTAG_Signature, CCN_DTAG); // <Signature>
-  // Signature ::= DigestAlgorithm? 
-  //               Witness?         
-  //               SignatureBits   
-  written += AppendTaggedBlob (start, CCN_DTAG_SignatureBits, 0, 0);      // <SignatureBits />
-  written += AppendCloser (start);                                    // </Signature>  
-
-  written += AppendName (start, contentObject.GetName()); // <Name><Component>...</Component>...</Name>
-
-  // fake signature
-  written += AppendBlockHeader (start, CCN_DTAG_SignedInfo, CCN_DTAG); // <SignedInfo>
-  // SignedInfo ::= PublisherPublicKeyDigest
-  //                Timestamp
-  //                Type?
-  //                FreshnessSeconds?
-  //                FinalBlockID?
-  //                KeyLocator?
-  written += AppendTaggedBlob (start, CCN_DTAG_PublisherPublicKeyDigest, 0, 0); // <PublisherPublicKeyDigest />
-  written += AppendCloser (start);                                     // </SignedInfo>
-
-  written += AppendBlockHeader (start, CCN_DTAG_Content, CCN_DTAG); // <Content>
-
-  // there is no closing tag !!!
-  return written;
-}
-
-} // namespace ns3
diff --git a/helper/ccnx-coding-helper.h b/helper/ccnx-coding-helper.h
deleted file mode 100644
index 3cafcbc..0000000
--- a/helper/ccnx-coding-helper.h
+++ /dev/null
@@ -1,245 +0,0 @@
-/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
-/*
- * Copyright (c) 2011 University of California, Los Angeles
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation;
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
- * Author: Ilya Moiseenko <iliamo@cs.ucla.edu>
- */
-
-#ifndef _CCNX_CODING_HELPER_H_
-#define _CCNX_CODING_HELPER_H_
-
-#include <sys/types.h>
-#include "ns3/ptr.h"
-#include "ns3/nstime.h"
-#include "ns3/buffer.h"
-
-namespace ns3 {
-
-namespace Name{ class Components; }
-
-class CcnxInterestHeader;
-class CcnxContentObjectHeader;
-  
-/**
- * Helper to encode/decode ccnb formatted CCNx message
- *
- */
-class CcnxCodingHelper
-{
-public:
-  static size_t
-  Serialize (Buffer::Iterator start, const CcnxInterestHeader &interest);
-
-  static size_t
-  Serialize (Buffer::Iterator start, const CcnxContentObjectHeader &contentObject);
-
-private:
-  /**
-   * Type tag for a ccnb start marker.
-   *
-   * \see http://www.ccnx.org/releases/latest/doc/technical/DTAG.html
-   */
-  enum ccn_tt {
-    CCN_EXT,        /**< starts composite extension - numval is subtype */
-    CCN_TAG,        /**< starts composite - numval is tagnamelen-1 */ 
-    CCN_DTAG,       /**< starts composite - numval is tagdict index (enum ccn_dtag) */
-    CCN_ATTR,       /**< attribute - numval is attrnamelen-1, value follows */
-    CCN_DATTR,      /**< attribute numval is attrdict index */
-    CCN_BLOB,       /**< opaque binary data - numval is byte count */
-    CCN_UDATA,      /**< UTF-8 encoded character data - numval is byte count */
-    CCN_NO_TOKEN    /**< should not occur in encoding */
-  };
-
-  /** CCN_CLOSE terminates composites */
-  enum {CCN_CLOSE = 0};
-
-  // enum ccn_ext_subtype {
-  //   /* skip smallest values for now */
-  //   CCN_PROCESSING_INSTRUCTIONS = 16 /* <?name:U value:U?> */
-  // };
-
-  /**
-   * DTAG identifies ccnb-encoded elements.
-   *
-   * \see http://www.ccnx.org/releases/latest/doc/technical/DTAG.html
-   */
-  enum ccn_dtag {
-    CCN_DTAG_Any = 13,
-    CCN_DTAG_Name = 14,
-    CCN_DTAG_Component = 15,
-    CCN_DTAG_Certificate = 16,
-    CCN_DTAG_Collection = 17,
-    CCN_DTAG_CompleteName = 18,
-    CCN_DTAG_Content = 19,
-    CCN_DTAG_SignedInfo = 20,
-    CCN_DTAG_ContentDigest = 21,
-    CCN_DTAG_ContentHash = 22,
-    CCN_DTAG_Count = 24,
-    CCN_DTAG_Header = 25,
-    CCN_DTAG_Interest = 26,	/* 20090915 */
-    CCN_DTAG_Key = 27,
-    CCN_DTAG_KeyLocator = 28,
-    CCN_DTAG_KeyName = 29,
-    CCN_DTAG_Length = 30,
-    CCN_DTAG_Link = 31,
-    CCN_DTAG_LinkAuthenticator = 32,
-    CCN_DTAG_NameComponentCount = 33,	/* DeprecatedInInterest */
-    CCN_DTAG_RootDigest = 36,
-    CCN_DTAG_Signature = 37,
-    CCN_DTAG_Start = 38,
-    CCN_DTAG_Timestamp = 39,
-    CCN_DTAG_Type = 40,
-    CCN_DTAG_Nonce = 41,
-    CCN_DTAG_Scope = 42,
-    CCN_DTAG_Exclude = 43,
-    CCN_DTAG_Bloom = 44,
-    CCN_DTAG_BloomSeed = 45,
-    CCN_DTAG_AnswerOriginKind = 47,
-    CCN_DTAG_InterestLifetime = 48,
-    CCN_DTAG_Witness = 53,
-    CCN_DTAG_SignatureBits = 54,
-    CCN_DTAG_DigestAlgorithm = 55,
-    CCN_DTAG_BlockSize = 56,
-    CCN_DTAG_FreshnessSeconds = 58,
-    CCN_DTAG_FinalBlockID = 59,
-    CCN_DTAG_PublisherPublicKeyDigest = 60,
-    CCN_DTAG_PublisherCertificateDigest = 61,
-    CCN_DTAG_PublisherIssuerKeyDigest = 62,
-    CCN_DTAG_PublisherIssuerCertificateDigest = 63,
-    CCN_DTAG_ContentObject = 64,	/* 20090915 */
-    CCN_DTAG_WrappedKey = 65,
-    CCN_DTAG_WrappingKeyIdentifier = 66,
-    CCN_DTAG_WrapAlgorithm = 67,
-    CCN_DTAG_KeyAlgorithm = 68,
-    CCN_DTAG_Label = 69,
-    CCN_DTAG_EncryptedKey = 70,
-    CCN_DTAG_EncryptedNonceKey = 71,
-    CCN_DTAG_WrappingKeyName = 72,
-    CCN_DTAG_Action = 73,
-    CCN_DTAG_FaceID = 74,
-    CCN_DTAG_IPProto = 75,
-    CCN_DTAG_Host = 76,
-    CCN_DTAG_Port = 77,
-    CCN_DTAG_MulticastInterface = 78,
-    CCN_DTAG_ForwardingFlags = 79,
-    CCN_DTAG_FaceInstance = 80,
-    CCN_DTAG_ForwardingEntry = 81,
-    CCN_DTAG_MulticastTTL = 82,
-    CCN_DTAG_MinSuffixComponents = 83,
-    CCN_DTAG_MaxSuffixComponents = 84,
-    CCN_DTAG_ChildSelector = 85,
-    CCN_DTAG_RepositoryInfo = 86,
-    CCN_DTAG_Version = 87,
-    CCN_DTAG_RepositoryVersion = 88,
-    CCN_DTAG_GlobalPrefix = 89,
-    CCN_DTAG_LocalName = 90,
-    CCN_DTAG_Policy = 91,
-    CCN_DTAG_Namespace = 92,
-    CCN_DTAG_GlobalPrefixName = 93,
-    CCN_DTAG_PolicyVersion = 94,
-    CCN_DTAG_KeyValueSet = 95,
-    CCN_DTAG_KeyValuePair = 96,
-    CCN_DTAG_IntegerValue = 97,
-    CCN_DTAG_DecimalValue = 98,
-    CCN_DTAG_StringValue = 99,
-    CCN_DTAG_BinaryValue = 100,
-    CCN_DTAG_NameValue = 101,
-    CCN_DTAG_Entry = 102,
-    CCN_DTAG_ACL = 103,
-    CCN_DTAG_ParameterizedName = 104,
-    CCN_DTAG_Prefix = 105,
-    CCN_DTAG_Suffix = 106,
-    CCN_DTAG_Root = 107,
-    CCN_DTAG_ProfileName = 108,
-    CCN_DTAG_Parameters = 109,
-    CCN_DTAG_InfoString = 110,
-    CCN_DTAG_StatusResponse = 112,
-    CCN_DTAG_StatusCode = 113,
-    CCN_DTAG_StatusText = 114,
-    CCN_DTAG_SequenceNumber = 256,
-    CCN_DTAG_CCNProtocolDataUnit = 17702112
-  };
-
-  /**
-   * The decoder state is one of these, possibly with some
-   * additional bits set for internal use.  A complete parse
-   * ends up in state 0 or an error state.  Not all possible
-   * error states are listed here.
-   */
-  enum ccn_decoder_state {
-    CCN_DSTATE_INITIAL = 0,
-    CCN_DSTATE_NEWTOKEN,
-    CCN_DSTATE_NUMVAL,
-    CCN_DSTATE_UDATA,
-    CCN_DSTATE_TAGNAME,
-    CCN_DSTATE_ATTRNAME,
-    CCN_DSTATE_BLOB,
-    /* All error states are negative */
-    CCN_DSTATE_ERR_OVERFLOW = -1,
-    CCN_DSTATE_ERR_ATTR     = -2,       
-    CCN_DSTATE_ERR_CODING   = -3,
-    CCN_DSTATE_ERR_NEST     = -4, 
-    CCN_DSTATE_ERR_BUG      = -5
-  };
-
-
-private:
-  static size_t
-  AppendBlockHeader (Buffer::Iterator start, size_t value, ccn_tt block_type);
-
-  static size_t
-  AppendNumber (Buffer::Iterator start, uint32_t number);
-
-  static size_t
-  AppendCloser (Buffer::Iterator start);
-
-  static size_t
-  AppendName (Buffer::Iterator start, const Name::Components &name);
-
-  /**
-   * Append a binary timestamp as a BLOB using the ccn binary
-   * Timestamp representation (12-bit fraction).
-   *
-   * @param start start iterator of  the buffer to append to.
-   * @param time - Time object
-   *
-   * @returns written length
-   */
-  static size_t
-  AppendTimestampBlob (Buffer::Iterator start, Time time);
-
-  /**
-   * Append a tagged BLOB
-   *
-   * This is a ccnb-encoded element with containing the BLOB as content
-   *
-   * @param start start iterator of  the buffer to append to.
-   * @param dtag is the element's dtab
-   * @param data points to the binary data
-   * @param size is the size of the data, in bytes
-   *
-   * @returns written length
-   */
-  static size_t
-  AppendTaggedBlob (Buffer::Iterator start, ccn_dtag dtag,
-                    const uint8_t *data, size_t size);
-  
-};
-
-} // namespace ns3
-
-#endif // _CCNX_CODING_HELPER_H_
-
diff --git a/helper/ccnx-decoding-helper.cc b/helper/ccnx-decoding-helper.cc
new file mode 100644
index 0000000..0dabb66
--- /dev/null
+++ b/helper/ccnx-decoding-helper.cc
@@ -0,0 +1,667 @@
+/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
+/*
+ * Copyright (c) 2011 University of California, Los Angeles
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Author: 
+ */
+
+#include "ccnx-decoding-helper.h"
+
+#include "ns3/ccnx.h"
+#include "ns3/name-components.h"
+#include "ns3/ccnx-interest-header.h"
+#include "ns3/ccnx-content-object-header.h"
+
+#include <sstream>
+#include <boost/foreach.hpp>
+
+namespace ns3 {
+
+CcnxParser::InterestVisitor CcnxDecodingHelper::m_interestVisitor;
+CcnxParser::ContentObjectVisitor CcnxDecodingHelper::m_contentObjectVisitor;
+
+size_t
+CcnxDecodingHelper::Deserialize (Buffer::Iterator start, const CcnxInterestHeader &interest)
+{
+  Buffer::Iterator i = start;
+  Ptr<CcnxParser::Block> root = CcnxParser::Block::ParseBlock (i);
+  root->accept (m_interestVisitor, interest);
+
+  return i.GetDistanceFrom (start);
+}
+
+size_t
+CcnxDecodingHelper::Deserialize (Buffer::Iterator start, const CcnxContentObjectHeader &contentObject)
+{
+  Buffer::Iterator i = start;
+  Ptr<CcnxParser::Block> root = CcnxParser::Block::ParseBlock (i);
+  root->accept (m_contentObjectVisitor, contentObject);
+
+  return i.GetDistanceFrom (start);
+}
+
+
+//////////////////////////////////////////////////////////////////////
+
+const uint8_t CCN_TT_BITS = 3;
+const uint8_t CCN_TT_MASK = ((1 << CCN_TT_BITS) - 1);
+const uint8_t CCN_MAX_TINY= ((1 << (7-CCN_TT_BITS)) - 1);
+const uint8_t CCN_TT_HBIT = ((uint8_t)(1 << 7));
+
+namespace CcnxParser {
+
+Ptr<Block> Block::ParseBlock (Buffer::Iterator &start)
+{
+  uint32_t value = 0;
+
+  // We will have problems if length field is more than 32 bits. Though it's really impossible
+  uint8_t byte = 0;
+  while (!(byte & CCN_TT_HBIT))
+    {
+      value <<= 8;
+      value += byte;
+      byte = start.ReadU8 ();
+    }
+  value <<= 4;
+  value += ( (byte&(~CCN_TT_HBIT)) >> 3);
+
+  switch (byte & CCN_TT_MASK)
+    {
+    case Ccnx::CCN_BLOB:
+      return Create<Blob> (start, value);
+    case Ccnx::CCN_UDATA:
+      return Create<Udata> (start, value);
+    case Ccnx::CCN_TAG:
+      return Create<Tag> (start, value);
+    case Ccnx::CCN_ATTR:
+      return Create<Attr> (start, value);
+    case Ccnx::CCN_DTAG:
+      return Create<Dtag> (start, value);
+    case Ccnx::CCN_DATTR:
+      return Create<Dattr> (start, value);
+    case Ccnx::CCN_EXT:
+      return Create<Ext> (start, value);
+    default:
+      throw CcnxDecodingException ();
+    }
+}
+
+Blob::Blob (Buffer::Iterator &start, uint32_t length)
+{
+  start.Read (m_blob.Begin (), length);
+}
+
+Udata::Udata (Buffer::Iterator &start, uint32_t length)
+{
+  // Ideally, the code should look like this. Unfortunately, we don't have normal compatible iterators
+  // Buffer::Iterator realStart = start;
+  // start.Next (length); // advancing forward
+  // m_udata.assign (realStart, start/*actually, it is the end*/);
+
+  m_udata.reserve (length+1); //just in case we will need \0 at the end later
+  // this is actually the way Read method is implemented in network/src/buffer.cc
+  for (uint32_t i = 0; i < length; i++)
+    {
+      m_udata.push_back (start.ReadU8 ());
+    }
+}
+
+// length length in octets of UTF-8 encoding of tag name - 1 (minimum tag name length is 1) 
+Tag::Tag (Buffer::Iterator &start, uint32_t length)
+{
+  m_tag.reserve (length+2); // extra byte for potential \0 at the end
+  for (uint32_t i = 0; i < (length+1); i++)
+    {
+      m_tag.push_back (start.ReadU8 ());
+    }
+  
+  while (!start.IsEnd () && start.PeekU8 ()!=Ccnx::CCN_CLOSE)
+    {
+      m_nestedBlocks.push_back (Block::ParseBlock (start));
+    }
+  if (start.IsEnd ())
+      throw CcnxDecodingException ();
+
+  start.ReadU8 (); // read CCN_CLOSE
+}
+
+// length length in octets of UTF-8 encoding of tag name - 1 (minimum tag name length is 1) 
+Attr::Attr (Buffer::Iterator &start, uint32_t length)
+{
+  m_attr.reserve (length+2); // extra byte for potential \0 at the end
+  for (uint32_t i = 0; i < (length+1); i++)
+    {
+      m_attr.push_back (start.ReadU8 ());
+    }
+  m_value = DynamicCast<Udata> (Block::ParseBlock (start));
+  if (m_value == 0)
+    throw CcnxDecodingException (); // "ATTR must be followed by UDATA field"
+}
+
+Dtag::Dtag (Buffer::Iterator &start, uint32_t dtag)
+{
+  m_dtag = dtag;
+
+  /**
+   * Hack
+   *
+   * Stop processing after encountering <Content> dtag.  Actual
+   * content (including virtual payload) will be stored in Packet
+   * buffer
+   */
+  if (dtag == Ccnx::CCN_DTAG_Content)
+    return; // hack #1. Do not process nesting block for <Content>
+  
+  while (!start.IsEnd () && start.PeekU8 ()!=Ccnx::CCN_CLOSE)
+    {
+      m_nestedBlocks.push_back (Block::ParseBlock (start));
+
+      // hack #2. Stop processing nested blocks if last block was <Content>
+      if (m_dtag == Ccnx::CCN_DTAG_ContentObject && // we are in <ContentObject>
+          DynamicCast<Dtag> (m_nestedBlocks.back())!=0 && // last block is DTAG
+          DynamicCast<Dtag> (m_nestedBlocks.back())->m_dtag == Ccnx::CCN_DTAG_Content) 
+        {
+          return; 
+        }
+    }
+  if (start.IsEnd ())
+      throw CcnxDecodingException ();
+
+  start.ReadU8 (); // read CCN_CLOSE
+}
+
+// dictionary attributes are not used (yet?) in CCNx 
+Dattr::Dattr (Buffer::Iterator &start, uint32_t dattr)
+{
+  m_dattr = dattr;
+  m_value = DynamicCast<Udata> (Block::ParseBlock (start));
+  if (m_value == 0)
+    throw CcnxDecodingException (); // "ATTR must be followed by UDATA field"
+}
+
+Ext::Ext (Buffer::Iterator &start, uint32_t extSubtype)
+{
+  m_extSubtype = extSubtype;
+}
+
+void
+DepthFirstVisitor::visit (Blob &n)
+{
+  // Buffer n.m_blob;
+}
+ 
+void
+DepthFirstVisitor::visit (Udata &n)
+{
+  // std::string n.m_udata;
+}
+ 
+void
+DepthFirstVisitor::visit (Tag &n)
+{
+  // std::string n.m_tag;
+  // std::list<Ptr<Block> > n.m_nestedBlocks;
+  BOOST_FOREACH (Ptr<Block> block, n.m_nestedBlocks)
+    {
+      block->accept (*this);
+    }
+}
+ 
+void
+DepthFirstVisitor::visit (Attr &n)
+{
+  // std::string n.m_attr;
+  // Ptr<Udata> n.m_value;
+}
+ 
+void
+DepthFirstVisitor::visit (Dtag &n)
+{
+  // uint32_t n.m_dtag;
+  // std::list<Ptr<Block> > n.m_nestedBlocks;
+  BOOST_FOREACH (Ptr<Block> block, n.m_nestedBlocks)
+    {
+      block->accept (*this);
+    }
+}
+ 
+void
+DepthFirstVisitor::visit (Dattr &n)
+{
+  // uint32_t n.m_dattr;
+  // Ptr<Udata> n.m_value;
+}
+ 
+void
+DepthFirstVisitor::visit (Ext &n)
+{
+  // uint64_t n.m_extSubtype;
+}
+
+//////////////////////////////////////////////////////////////////////
+ 
+boost::any
+GJNoArguDepthFirstVisitor::visit (Blob &n)
+{
+  // Buffer n.m_blob;
+  return n.m_blob;
+}
+ 
+boost::any
+GJNoArguDepthFirstVisitor::visit (Udata &n)
+{
+  // std::string n.m_udata;
+  return n.m_udata;
+}
+ 
+boost::any
+GJNoArguDepthFirstVisitor::visit (Tag &n)
+{
+  // std::string n.m_tag;
+  // std::list<Ptr<Block> > n.m_nestedBlocks;
+  BOOST_FOREACH (Ptr<Block> block, n.m_nestedBlocks)
+    {
+      block->accept (*this);
+    }
+  return boost::any();
+}
+ 
+boost::any
+GJNoArguDepthFirstVisitor::visit (Attr &n)
+{
+  // std::string n.m_attr;
+  // Ptr<Udata> n.m_value;
+  return boost::any(
+                    std::pair<std::string,std::string> (
+                                                        n.m_attr,
+                                                        boost::any_cast<std::string> (n.m_value->accept (*this))
+                                                        ));
+}
+ 
+boost::any
+GJNoArguDepthFirstVisitor::visit (Dtag &n)
+{
+  // uint32_t n.m_dtag;
+  // std::list<Ptr<Block> > n.m_nestedBlocks;
+  BOOST_FOREACH (Ptr<Block> block, n.m_nestedBlocks)
+    {
+      block->accept (*this);
+    }
+  return boost::any();
+}
+ 
+boost::any
+GJNoArguDepthFirstVisitor::visit (Dattr &n)
+{
+  // uint32_t n.m_dattr;
+  // Ptr<Udata> n.m_value;
+  return boost::any(
+                    std::pair<uint32_t,std::string> (
+                                                     n.m_dattr,
+                                                     boost::any_cast<std::string> (n.m_value->accept (*this))
+                                                     ));
+}
+ 
+boost::any
+GJNoArguDepthFirstVisitor::visit (Ext &n)
+{
+  // uint64_t n.m_extSubtype;
+  return n.m_extSubtype;
+}
+
+//////////////////////////////////////////////////////////////////////
+
+void
+GJVoidDepthFirstVisitor::visit (Blob &n, boost::any param)
+{
+  // Buffer n.m_blob;
+}
+ 
+void
+GJVoidDepthFirstVisitor::visit (Udata &n, boost::any param)
+{
+  // std::string n.m_udata;
+}
+ 
+void
+GJVoidDepthFirstVisitor::visit (Tag &n, boost::any param)
+{
+  // std::string n.m_tag;
+  // std::list<Ptr<Block> > n.m_nestedBlocks;
+  BOOST_FOREACH (Ptr<Block> block, n.m_nestedBlocks)
+    {
+      block->accept (*this, param);
+    }
+}
+ 
+void
+GJVoidDepthFirstVisitor::visit (Attr &n, boost::any param)
+{
+  // std::string n.m_attr;
+  // Ptr<Udata> n.m_value;
+}
+ 
+void
+GJVoidDepthFirstVisitor::visit (Dtag &n, boost::any param)
+{
+  // uint32_t n.m_dtag;
+  // std::list<Ptr<Block> > n.m_nestedBlocks;
+  BOOST_FOREACH (Ptr<Block> block, n.m_nestedBlocks)
+    {
+      block->accept (*this, param);
+    }
+}
+ 
+void
+GJVoidDepthFirstVisitor::visit (Dattr &n, boost::any param)
+{
+  // uint32_t n.m_dattr;
+  // Ptr<Udata> n.m_value;
+}
+ 
+void
+GJVoidDepthFirstVisitor::visit (Ext &n, boost::any param)
+{
+  // uint64_t n.m_extSubtype;
+}
+
+//////////////////////////////////////////////////////////////////////
+ 
+boost::any
+GJDepthFirstVisitor::visit (Blob &n, boost::any param)
+{
+  // Buffer n.m_blob;
+  return n.m_blob;
+}
+ 
+boost::any
+GJDepthFirstVisitor::visit (Udata &n, boost::any param)
+{
+  // std::string n.m_udata;
+  return n.m_udata;
+}
+ 
+boost::any
+GJDepthFirstVisitor::visit (Tag &n, boost::any param)
+{
+  // std::string n.m_tag;
+  // std::list<Ptr<Block> > n.m_nestedBlocks;
+  BOOST_FOREACH (Ptr<Block> block, n.m_nestedBlocks)
+    {
+      block->accept (*this, param);
+    }
+  return boost::any();
+}
+ 
+boost::any
+GJDepthFirstVisitor::visit (Attr &n, boost::any param)
+{
+  // std::string n.m_attr;
+  // Ptr<Udata> n.m_value;
+  return boost::any(
+                    std::pair<std::string,std::string> (
+                                                        n.m_attr,
+                                                        boost::any_cast<std::string> (n.m_value->accept (*this,param))
+                                                        ));
+}
+ 
+boost::any
+GJDepthFirstVisitor::visit (Dtag &n, boost::any param)
+{
+  // uint32_t n.m_dtag;
+  // std::list<Ptr<Block> > n.m_nestedBlocks;
+  BOOST_FOREACH (Ptr<Block> block, n.m_nestedBlocks)
+    {
+      block->accept (*this, param);
+    }
+  return boost::any();
+}
+ 
+boost::any
+GJDepthFirstVisitor::visit (Dattr &n, boost::any param)
+{
+  // uint32_t n.m_dattr;
+  // Ptr<Udata> n.m_value;
+  return boost::any(
+                    std::pair<uint32_t,std::string> (
+                                                     n.m_dattr,
+                                                     boost::any_cast<std::string> (n.m_value->accept (*this,param))
+                                                     ));
+}
+ 
+boost::any
+GJDepthFirstVisitor::visit (Ext &n, boost::any param)
+{
+  // uint64_t n.m_extSubtype;
+  return n.m_extSubtype;
+}
+
+//////////////////////////////////////////////////////////////////////
+
+boost::any
+NonNegativeIntegerVisitor::visit (Blob &n) //to throw parsing error
+{
+  // Buffer n.m_blob;
+  throw CcnxDecodingException ();
+}
+
+boost::any
+NonNegativeIntegerVisitor::visit (Udata &n)
+{
+  // std::string n.m_udata;
+  std::istringstream is (n.m_udata);
+  int32_t value;
+  is >> value;
+  if (value<0) // value should be non-negative
+    throw CcnxDecodingException ();
+
+  return static_cast<uint32_t> (value);
+}
+
+
+//////////////////////////////////////////////////////////////////////
+
+boost::any
+StringVisitor::visit (Blob &n) //to throw parsing error
+{
+  // Buffer n.m_blob;
+  throw CcnxDecodingException ();
+}
+
+boost::any
+StringVisitor::visit (Udata &n)
+{
+  // std::string n.m_udata;
+  return n.m_udata;
+}
+
+//////////////////////////////////////////////////////////////////////
+
+StringVisitor NameComponentsVisitor::m_stringVisitor; 
+
+void
+NameComponentsVisitor::visit (Dtag &n, boost::any param/*should be Name::Components&*/)
+{
+  // uint32_t n.m_dtag;
+  // std::list<Ptr<Block> > n.m_nestedBlocks;
+  Name::Components &components = boost::any_cast<Name::Components&> (param);
+
+  switch (n.m_dtag)
+    {
+    case Ccnx::CCN_DTAG_Component:
+      if (n.m_nestedBlocks.size()!=1) // should be exactly one UDATA inside this tag
+        throw CcnxDecodingException ();
+      components.Add (
+                      boost::any_cast<std::string> ((*n.m_nestedBlocks.begin())->accept(
+                                                                                        m_stringVisitor
+                                                                                        )));
+      break;
+    default:
+      // ignore any other components
+      // when parsing Exclude, there could be <Any /> and <Bloom /> tags
+      break;
+    }
+}
+ 
+//////////////////////////////////////////////////////////////////////
+
+NonNegativeIntegerVisitor InterestVisitor::m_nonNegativeIntegerVisitor;
+NameComponentsVisitor     InterestVisitor::m_nameComponentsVisitor;
+
+// We don't really care about any other fields
+void
+InterestVisitor::visit (Dtag &n, boost::any param/*should be CcnxInterestHeader&*/)
+{
+  // uint32_t n.m_dtag;
+  // std::list<Ptr<Block> > n.m_nestedBlocks;
+  CcnxInterestHeader &interest = boost::any_cast<CcnxInterestHeader&> (param);
+  
+  switch (n.m_dtag)
+    {
+    case Ccnx::CCN_DTAG_Interest:
+      // process nested blocks
+      BOOST_FOREACH (Ptr<Block> block, n.m_nestedBlocks)
+        {
+          block->accept (*this, param);
+        }
+      break;
+    case Ccnx::CCN_DTAG_Name:
+      {
+        // process name components
+        Ptr<Name::Components> name = Create<Name::Components> ();
+        
+        BOOST_FOREACH (Ptr<Block> block, n.m_nestedBlocks)
+          {
+            block->accept (m_nameComponentsVisitor, *name);
+          }
+        interest.SetName (name);
+        break;
+      }
+    case Ccnx::CCN_DTAG_MinSuffixComponents:
+      if (n.m_nestedBlocks.size()!=1) // should be exactly one UDATA inside this tag
+        throw CcnxDecodingException ();
+      interest.SetMinSuffixComponents (
+               boost::any_cast<uint32_t> (
+                                          (*n.m_nestedBlocks.begin())->accept(
+                                                                           m_nonNegativeIntegerVisitor
+                                                                           )));
+      break;
+    case Ccnx::CCN_DTAG_MaxSuffixComponents:
+      if (n.m_nestedBlocks.size()!=1) // should be exactly one UDATA inside this tag
+        throw CcnxDecodingException ();
+      interest.SetMaxSuffixComponents (
+               boost::any_cast<uint32_t> (
+                                          (*n.m_nestedBlocks.begin())->accept(
+                                                                           m_nonNegativeIntegerVisitor
+                                                                           )));
+      break;
+    case Ccnx::CCN_DTAG_Exclude:
+      {
+        // process exclude components
+        Ptr<Name::Components> exclude = Create<Name::Components> ();
+        
+        BOOST_FOREACH (Ptr<Block> block, n.m_nestedBlocks)
+          {
+            block->accept (m_nameComponentsVisitor, *exclude);
+          }
+        interest.SetExclude (exclude);
+        break;
+      }
+    case Ccnx::CCN_DTAG_ChildSelector:
+      if (n.m_nestedBlocks.size()!=1) // should be exactly one UDATA inside this tag
+        throw CcnxDecodingException ();
+
+      interest.SetChildSelector (
+               1 == boost::any_cast<uint32_t> (
+                                          (*n.m_nestedBlocks.begin())->accept(
+                                                                           m_nonNegativeIntegerVisitor
+                                                                           )));
+      break;
+    case Ccnx::CCN_DTAG_AnswerOriginKind:
+      if (n.m_nestedBlocks.size()!=1) // should be exactly one UDATA inside this tag
+        throw CcnxDecodingException ();
+      interest.SetAnswerOriginKind (
+               1 == boost::any_cast<uint32_t> (
+                                          (*n.m_nestedBlocks.begin())->accept(
+                                                                           m_nonNegativeIntegerVisitor
+                                                                           )));
+      break;
+    case Ccnx::CCN_DTAG_Scope: 
+      if (n.m_nestedBlocks.size()!=1) // should be exactly one UDATA inside this tag
+        throw CcnxDecodingException ();
+      interest.SetScope (
+               boost::any_cast<uint32_t> (
+                                          (*n.m_nestedBlocks.begin())->accept(
+                                                                           m_nonNegativeIntegerVisitor
+                                                                           )));
+      break;
+    case Ccnx::CCN_DTAG_InterestLifetime:
+      if (n.m_nestedBlocks.size()!=1) // should be exactly one UDATA inside this tag
+        throw CcnxDecodingException ();
+      break;
+    case Ccnx::CCN_DTAG_Nonce:
+      if (n.m_nestedBlocks.size()!=1) // should be exactly one UDATA inside this tag
+        throw CcnxDecodingException ();
+      break;
+    }
+}
+
+//////////////////////////////////////////////////////////////////////
+
+NameComponentsVisitor ContentObjectVisitor::m_nameComponentsVisitor;
+
+// We don't really care about any other fields
+void
+ContentObjectVisitor::visit (Dtag &n, boost::any param/*should be CcnxContentObjectHeader&*/)
+{
+  // uint32_t n.m_dtag;
+  // std::list<Ptr<Block> > n.m_nestedBlocks;
+  CcnxContentObjectHeader &contentObject = boost::any_cast<CcnxContentObjectHeader&> (param);
+  
+  switch (n.m_dtag)
+    {
+    case Ccnx::CCN_DTAG_ContentObject:
+      // process nested blocks
+      BOOST_FOREACH (Ptr<Block> block, n.m_nestedBlocks)
+        {
+          block->accept (*this, param);
+        }
+      break;
+    case Ccnx::CCN_DTAG_Name:
+      {
+        // process name components
+        Ptr<Name::Components> name = Create<Name::Components> ();
+        
+        BOOST_FOREACH (Ptr<Block> block, n.m_nestedBlocks)
+          {
+            block->accept (m_nameComponentsVisitor, *name);
+          }
+        contentObject.SetName (name);
+        break;
+      }
+    case Ccnx::CCN_DTAG_Signature: // ignoring
+      break;
+    case Ccnx::CCN_DTAG_SignedInfo: // ignoring
+      break;
+    case Ccnx::CCN_DTAG_Content: // !!! HACK
+      // This hack was necessary for memory optimizations (i.e., content is virtual payload)
+      NS_ASSERT_MSG (n.m_nestedBlocks.size() == 0, "Parser should have stopped just after processing <Content> tag");
+      break;
+    }
+}
+
+} // namespace CcnxParser
+} // namespace ns3
diff --git a/helper/ccnx-decoding-helper.h b/helper/ccnx-decoding-helper.h
new file mode 100644
index 0000000..e89766c
--- /dev/null
+++ b/helper/ccnx-decoding-helper.h
@@ -0,0 +1,332 @@
+/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
+/*
+ * Copyright (c) 2011 University of California, Los Angeles
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Author: 
+ */
+
+#ifndef _CCNX_DECODING_HELPER_H_
+#define _CCNX_DECODING_HELPER_H_
+
+#include <sys/types.h>
+#include <boost/any.hpp>
+#include <list>
+
+#include "ns3/ptr.h"
+#include "ns3/nstime.h"
+#include "ns3/buffer.h"
+#include "ns3/simple-ref-count.h"
+
+
+namespace ns3 {
+
+namespace Name{ class Components; }
+
+class CcnxInterestHeader;
+class CcnxContentObjectHeader;
+
+namespace CcnxParser {
+class InterestVisitor;
+class ContentObjectVisitor;
+}
+
+/**
+ * Helper to encode/decode ccnb formatted CCNx message
+ *
+ */
+class CcnxDecodingHelper
+{
+public:
+  static size_t
+  Deserialize (Buffer::Iterator start, const CcnxInterestHeader &interest);
+
+  static size_t
+  Deserialize (Buffer::Iterator start, const CcnxContentObjectHeader &contentObject);
+  
+private:
+  static CcnxParser::InterestVisitor m_interestVisitor;
+  static CcnxParser::ContentObjectVisitor m_contentObjectVisitor;
+};
+
+namespace CcnxParser {
+
+class Block;
+class Blob;
+class Udata;
+class Tag;
+class Attr;
+class Dtag;
+class Dattr;
+class Ext;
+
+class Visitor
+{
+public:
+  virtual void visit (Blob& )=0;
+  virtual void visit (Udata&)=0;
+  virtual void visit (Tag&  )=0;
+  virtual void visit (Attr& )=0;
+  virtual void visit (Dtag& )=0;
+  virtual void visit (Dattr&)=0;
+  virtual void visit (Ext&  )=0;
+};
+  
+class GJVisitor
+{
+public:
+  virtual boost::any visit (Blob&,  boost::any)=0;
+  virtual boost::any visit (Udata&, boost::any)=0;
+  virtual boost::any visit (Tag&,   boost::any)=0;
+  virtual boost::any visit (Attr&,  boost::any)=0;
+  virtual boost::any visit (Dtag&,  boost::any)=0;
+  virtual boost::any visit (Dattr&, boost::any)=0;
+  virtual boost::any visit (Ext&,   boost::any)=0;
+};
+  
+class GJNoArguVisitor
+{
+public:
+  virtual boost::any visit (Blob& )=0;
+  virtual boost::any visit (Udata&)=0;
+  virtual boost::any visit (Tag&  )=0;
+  virtual boost::any visit (Attr& )=0;
+  virtual boost::any visit (Dtag& )=0;
+  virtual boost::any visit (Dattr&)=0;
+  virtual boost::any visit (Ext&  )=0;
+};
+
+class GJVoidVisitor
+{
+public:
+  virtual void visit (Blob&,  boost::any)=0;
+  virtual void visit (Udata&, boost::any)=0;
+  virtual void visit (Tag&,   boost::any)=0;
+  virtual void visit (Attr&,  boost::any)=0;
+  virtual void visit (Dtag&,  boost::any)=0;
+  virtual void visit (Dattr&, boost::any)=0;
+  virtual void visit (Ext&,   boost::any)=0;
+};
+
+class Block : public SimpleRefCount<Block>
+{
+public:
+  /**
+   * Parsing block header and creating an appropriate object
+   */
+  static Ptr<Block>
+  ParseBlock (Buffer::Iterator &start);
+  
+  virtual void accept( Visitor &v )                           =0;
+  virtual void accept (GJVoidVisitor &v, boost::any param)    =0;
+  virtual boost::any accept( GJNoArguVisitor &v )             =0;
+  virtual boost::any accept( GJVisitor &v, boost::any param ) =0;
+};
+
+class Blob : public Block
+{
+public:
+  Blob (Buffer::Iterator &start, uint32_t length);
+  
+  virtual void accept( Visitor &v )                           { v.visit( *this ); }
+  virtual void accept( GJVoidVisitor &v, boost::any param )   { v.visit( *this, param ); }
+  virtual boost::any accept( GJNoArguVisitor &v )             { return v.visit( *this ); }
+  virtual boost::any accept( GJVisitor &v, boost::any param ) { return v.visit( *this, param ); }
+
+  Buffer m_blob;
+};
+
+class Udata : public Block
+{
+public:
+  Udata (Buffer::Iterator &start, uint32_t length);
+  
+  virtual void accept( Visitor &v )                           { v.visit( *this ); }
+  virtual void accept( GJVoidVisitor &v, boost::any param )   { v.visit( *this, param ); }
+  virtual boost::any accept( GJNoArguVisitor &v )             { return v.visit( *this ); }
+  virtual boost::any accept( GJVisitor &v, boost::any param ) { return v.visit( *this, param ); }
+
+  std::string m_udata;
+};
+
+class Tag : public Block
+{
+public:
+  Tag (Buffer::Iterator &start, uint32_t length);
+
+  virtual void accept( Visitor &v )                           { v.visit( *this ); }
+  virtual void accept( GJVoidVisitor &v, boost::any param )   { v.visit( *this, param ); }
+  virtual boost::any accept( GJNoArguVisitor &v )             { return v.visit( *this ); }
+  virtual boost::any accept( GJVisitor &v, boost::any param ) { return v.visit( *this, param ); }
+
+  std::string m_tag;
+  std::list<Ptr<Block> > m_nestedBlocks;
+};
+
+class Attr : public Block
+{
+public:
+  Attr (Buffer::Iterator &start, uint32_t length);
+  
+  virtual void accept( Visitor &v )                           { v.visit( *this ); }
+  virtual void accept( GJVoidVisitor &v, boost::any param )   { v.visit( *this, param ); }
+  virtual boost::any accept( GJNoArguVisitor &v )             { return v.visit( *this ); }
+  virtual boost::any accept( GJVisitor &v, boost::any param ) { return v.visit( *this, param ); }
+
+  std::string m_attr;
+  Ptr<Udata> m_value;
+};
+
+class Dtag : public Block
+{
+public:
+  Dtag (Buffer::Iterator &start, uint32_t dtag);
+
+  virtual void accept( Visitor &v )                           { v.visit( *this ); }
+  virtual void accept( GJVoidVisitor &v, boost::any param )   { v.visit( *this, param ); }
+  virtual boost::any accept( GJNoArguVisitor &v )             { return v.visit( *this ); }
+  virtual boost::any accept( GJVisitor &v, boost::any param ) { return v.visit( *this, param ); }
+
+  uint32_t m_dtag;
+  std::list<Ptr<Block> > m_nestedBlocks;
+};
+
+class Dattr : public Block
+{
+public:
+  Dattr (Buffer::Iterator &start, uint32_t dattr);
+
+  virtual void accept( Visitor &v )                           { v.visit( *this ); }
+  virtual void accept( GJVoidVisitor &v, boost::any param )   { v.visit( *this, param ); }
+  virtual boost::any accept( GJNoArguVisitor &v )             { return v.visit( *this ); }
+  virtual boost::any accept( GJVisitor &v, boost::any param ) { return v.visit( *this, param ); }
+
+  uint32_t m_dattr;
+  Ptr<Udata> m_value;
+};
+
+class Ext : public Block
+{
+public:
+  Ext (Buffer::Iterator &start, uint32_t extSubtype);
+
+  virtual void accept( Visitor &v )                           { v.visit( *this ); }
+  virtual void accept( GJVoidVisitor &v, boost::any param )   { v.visit( *this, param ); }
+  virtual boost::any accept( GJNoArguVisitor &v )             { return v.visit( *this ); }
+  virtual boost::any accept( GJVisitor &v, boost::any param ) { return v.visit( *this, param ); }
+
+  uint64_t m_extSubtype;
+};
+
+class DepthFirstVisitor : public Visitor
+{
+public:
+  virtual void visit (Blob& );
+  virtual void visit (Udata&);
+  virtual void visit (Tag&  );
+  virtual void visit (Attr& );
+  virtual void visit (Dtag& );
+  virtual void visit (Dattr&);
+  virtual void visit (Ext&  );
+};
+
+class GJDepthFirstVisitor : public GJVisitor
+{
+public:
+  virtual boost::any visit (Blob&,  boost::any);
+  virtual boost::any visit (Udata&, boost::any);
+  virtual boost::any visit (Tag&,   boost::any);
+  virtual boost::any visit (Attr&,  boost::any);
+  virtual boost::any visit (Dtag&,  boost::any);
+  virtual boost::any visit (Dattr&, boost::any);
+  virtual boost::any visit (Ext&,   boost::any);
+};
+
+class GJNoArguDepthFirstVisitor : public GJNoArguVisitor
+{
+public:
+  virtual boost::any visit (Blob& );
+  virtual boost::any visit (Udata&);
+  virtual boost::any visit (Tag&  );
+  virtual boost::any visit (Attr& );
+  virtual boost::any visit (Dtag& );
+  virtual boost::any visit (Dattr&);
+  virtual boost::any visit (Ext&  );
+};
+
+class GJVoidDepthFirstVisitor : public GJVoidVisitor
+{
+public:
+  virtual void visit (Blob&,  boost::any);
+  virtual void visit (Udata&, boost::any);
+  virtual void visit (Tag&,   boost::any);
+  virtual void visit (Attr&,  boost::any);
+  virtual void visit (Dtag&,  boost::any);
+  virtual void visit (Dattr&, boost::any);
+  virtual void visit (Ext&,   boost::any);
+};
+
+// class NameComponentsVisitor : public 
+
+class NonNegativeIntegerVisitor : public GJNoArguDepthFirstVisitor
+{
+public:
+  virtual boost::any visit (Blob &n); //to throw parsing error
+  virtual boost::any visit (Udata &n);
+};
+
+class StringVisitor : public GJNoArguDepthFirstVisitor
+{
+public:
+  virtual boost::any visit (Blob &n); //to throw parsing error
+  virtual boost::any visit (Udata &n);
+};
+
+class NameComponentsVisitor : public GJVoidDepthFirstVisitor
+{
+public:
+  virtual void visit (Dtag &n, boost::any param/*should be Name::Components*/);
+private:
+  static StringVisitor m_stringVisitor; 
+};
+
+class InterestVisitor : public GJVoidDepthFirstVisitor
+{
+public:
+  virtual void visit (Dtag &n, boost::any param/*should be CcnxInterestHeader&*/);
+  
+private:
+  static NonNegativeIntegerVisitor m_nonNegativeIntegerVisitor;
+  static NameComponentsVisitor     m_nameComponentsVisitor;
+};
+
+class ContentObjectVisitor : public GJVoidDepthFirstVisitor
+{
+public:
+  virtual void visit (Dtag &n, boost::any param/*should be CcnxContentObjectHeader&*/);
+  
+private:
+  static NameComponentsVisitor     m_nameComponentsVisitor;
+};
+
+
+class CcnxDecodingException {};
+
+} // namespace CcnxParser
+
+} // namespace ns3
+
+#endif // _CCNX_DECODING_HELPER_H_
+
diff --git a/helper/ccnx-encoding-helper.cc b/helper/ccnx-encoding-helper.cc
new file mode 100644
index 0000000..21ca9ae
--- /dev/null
+++ b/helper/ccnx-encoding-helper.cc
@@ -0,0 +1,232 @@
+/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
+/*
+ * Copyright (c) 2011 University of California, Los Angeles
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Author: 
+ */
+
+#include "ccnx-encoding-helper.h"
+
+#include "ns3/name-components.h"
+#include "ns3/ccnx-interest-header.h"
+#include "ns3/ccnx-content-object-header.h"
+
+#include <sstream>
+#include <boost/foreach.hpp>
+
+namespace ns3 {
+
+#define CCN_TT_BITS 3
+#define CCN_TT_MASK ((1 << CCN_TT_BITS) - 1)
+#define CCN_MAX_TINY ((1 << (7-CCN_TT_BITS)) - 1)
+#define CCN_TT_HBIT ((unsigned char)(1 << 7))
+
+size_t
+CcnxEncodingHelper::AppendBlockHeader (Buffer::Iterator start, size_t val, Ccnx::ccn_tt tt)
+{
+  unsigned char buf[1+8*((sizeof(val)+6)/7)];
+  unsigned char *p = &(buf[sizeof(buf)-1]);
+  size_t n = 1;
+  p[0] = (CCN_TT_HBIT & ~Ccnx::CCN_CLOSE) |
+  ((val & CCN_MAX_TINY) << CCN_TT_BITS) |
+  (CCN_TT_MASK & tt);
+  val >>= (7-CCN_TT_BITS);
+  while (val != 0) {
+    (--p)[0] = (((unsigned char)val) & ~CCN_TT_HBIT) | Ccnx::CCN_CLOSE;
+    n++;
+    val >>= 7;
+  }
+  start.Write (p,n);
+  return n;
+}
+
+size_t
+CcnxEncodingHelper::AppendNumber (Buffer::Iterator start, uint32_t number)
+{
+  std::ostringstream os;
+  os << number;
+
+  size_t written = 0;
+  written += AppendBlockHeader (start, os.str().size(), Ccnx::CCN_UDATA);
+  written += os.str().size();
+  start.Write (reinterpret_cast<const unsigned char*>(os.str().c_str()), os.str().size());
+
+  return written;
+}
+
+  
+size_t
+CcnxEncodingHelper::CcnxEncodingHelper::AppendCloser (Buffer::Iterator start)
+{
+  start.WriteU8 (Ccnx::CCN_CLOSE);
+  return 1;
+}
+
+size_t
+CcnxEncodingHelper::AppendNameComponents (Buffer::Iterator start, const Name::Components &name)
+{
+  size_t written = 0;
+  BOOST_FOREACH (const std::string &component, name.GetComponents())
+    {
+      written += AppendTaggedBlob (start, Ccnx::CCN_DTAG_Component,
+                                   reinterpret_cast<const uint8_t*>(component.c_str()), component.size());
+    }
+  return written;
+}
+
+size_t
+CcnxEncodingHelper::AppendTimestampBlob (Buffer::Iterator start, Time time)
+{
+  // the original function implements Markers... thought not sure what are these markers for...
+
+  // Determine miminal number of bytes required to store the timestamp
+  int required_bytes = 2; // 12 bits for fractions of a second, 4 bits left for seconds. Sometimes it is enough
+  intmax_t ts = time.ToInteger (Time::S) >> 4;
+  for (;  required_bytes < 7 && ts != 0; ts >>= 8) // not more than 6 bytes?
+     required_bytes++;
+  
+  size_t len = AppendBlockHeader(start, required_bytes, Ccnx::CCN_BLOB);
+
+  // write part with seconds
+  ts = time.ToInteger (Time::S) >> 4;
+  for (int i = 0; i < required_bytes - 2; i++)
+    start.WriteU8 ( ts >> (8 * (required_bytes - 3 - i)) );
+
+  /* arithmetic contortions are to avoid overflowing 31 bits */
+  ts = ((time.ToInteger (Time::S) & 15) << 12) + ((time.ToInteger (Time::NS) / 5 * 8 + 195312) / 390625);
+  for (int i = required_bytes - 2; i < required_bytes; i++)
+    start.WriteU8 ( ts >> (8 * (required_bytes - 1 - i)) );
+  
+  return len + required_bytes;
+}
+
+size_t
+CcnxEncodingHelper::AppendTaggedBlob (Buffer::Iterator start, Ccnx::ccn_dtag dtag,
+                  const uint8_t *data, size_t size)
+{
+  size_t written = AppendBlockHeader (start, dtag, Ccnx::CCN_DTAG);
+  if (size>0)
+    {
+      written += AppendBlockHeader (start, size, Ccnx::CCN_BLOB);
+      start.Write (data, size);
+      written += size;
+    }
+  written += AppendCloser (start);
+
+  return written;
+}
+
+
+size_t
+CcnxEncodingHelper::Serialize (Buffer::Iterator start, const CcnxInterestHeader &interest)
+{
+  size_t written = 0;
+  written += AppendBlockHeader (start, Ccnx::CCN_DTAG_Interest, Ccnx::CCN_DTAG); // <Interest>
+  
+  written += AppendBlockHeader (start, Ccnx::CCN_DTAG_Name, Ccnx::CCN_DTAG); // <Name>
+  written += AppendNameComponents (start, interest.GetName());                // <Component>...</Component>...
+  written += AppendCloser (start);                               // </Name>
+
+  if (interest.GetMinSuffixComponents() >= 0)
+    {
+      written += AppendBlockHeader (start, Ccnx::CCN_DTAG_MinSuffixComponents, Ccnx::CCN_DTAG);
+      written += AppendNumber (start, interest.GetMinSuffixComponents ());
+      written += AppendCloser (start);
+    }
+  if (interest.GetMaxSuffixComponents() >= 0)
+    {
+      written += AppendBlockHeader (start, Ccnx::CCN_DTAG_MaxSuffixComponents, Ccnx::CCN_DTAG);
+      written += AppendNumber (start, interest.GetMaxSuffixComponents ());
+      written += AppendCloser (start);
+    }
+  if (interest.GetExclude().size() > 0)
+    {
+      written += AppendBlockHeader (start, Ccnx::CCN_DTAG_Exclude, Ccnx::CCN_DTAG); // <Exclude>
+      written += AppendNameComponents (start, interest.GetExclude());                // <Component>...</Component>...
+      written += AppendCloser (start);                                  // </Exclude>
+    }
+  if (interest.IsEnabledChildSelector())
+    {
+      written += AppendBlockHeader (start, Ccnx::CCN_DTAG_ChildSelector, Ccnx::CCN_DTAG);
+      written += AppendNumber (start, 1);
+      written += AppendCloser (start);
+    }
+  if (interest.IsEnabledAnswerOriginKind())
+    {
+      written += AppendBlockHeader (start, Ccnx::CCN_DTAG_AnswerOriginKind, Ccnx::CCN_DTAG);
+      written += AppendNumber (start, 1);
+      written += AppendCloser (start);
+    }
+  if (interest.GetScope() >= 0)
+    {
+      written += AppendBlockHeader (start, Ccnx::CCN_DTAG_Scope, Ccnx::CCN_DTAG);
+      written += AppendNumber (start, interest.GetScope ());
+      written += AppendCloser (start);
+    }
+  if (!interest.GetInterestLifetime().IsZero())
+    {
+      written += AppendBlockHeader (start, Ccnx::CCN_DTAG_InterestLifetime, Ccnx::CCN_DTAG);
+      written += AppendTimestampBlob (start, interest.GetInterestLifetime());
+      written += AppendCloser (start);
+    }
+  if (interest.GetNonce()>0)
+    {
+      uint32_t nonce = interest.GetNonce();
+      written += AppendTaggedBlob (start, Ccnx::CCN_DTAG_Nonce,
+                                   reinterpret_cast<const uint8_t*>(&nonce),
+                                   sizeof(nonce));
+    }
+  written += AppendCloser (start); // </Interest>
+
+  return written;
+}
+
+size_t
+CcnxEncodingHelper::Serialize (Buffer::Iterator start, const CcnxContentObjectHeader &contentObject)
+{
+  size_t written = 0;
+  written += AppendBlockHeader (start, Ccnx::CCN_DTAG_ContentObject, Ccnx::CCN_DTAG); // <ContentObject>
+
+  // fake signature
+  written += AppendBlockHeader (start, Ccnx::CCN_DTAG_Signature, Ccnx::CCN_DTAG); // <Signature>
+  // Signature ::= DigestAlgorithm? 
+  //               Witness?         
+  //               SignatureBits   
+  written += AppendTaggedBlob (start, Ccnx::CCN_DTAG_SignatureBits, 0, 0);      // <SignatureBits />
+  written += AppendCloser (start);                                    // </Signature>  
+
+  written += AppendBlockHeader (start, Ccnx::CCN_DTAG_Name, Ccnx::CCN_DTAG);    // <Name>
+  written += AppendNameComponents (start, contentObject.GetName()); //   <Component>...</Component>...
+  written += AppendCloser (start);                                  // </Name>  
+
+  // fake signature
+  written += AppendBlockHeader (start, Ccnx::CCN_DTAG_SignedInfo, Ccnx::CCN_DTAG); // <SignedInfo>
+  // SignedInfo ::= PublisherPublicKeyDigest
+  //                Timestamp
+  //                Type?
+  //                FreshnessSeconds?
+  //                FinalBlockID?
+  //                KeyLocator?
+  written += AppendTaggedBlob (start, Ccnx::CCN_DTAG_PublisherPublicKeyDigest, 0, 0); // <PublisherPublicKeyDigest />
+  written += AppendCloser (start);                                     // </SignedInfo>
+
+  written += AppendBlockHeader (start, Ccnx::CCN_DTAG_Content, Ccnx::CCN_DTAG); // <Content>
+
+  // there is no closing tag !!!
+  return written;
+}
+
+} // namespace ns3
diff --git a/helper/ccnx-encoding-helper.h b/helper/ccnx-encoding-helper.h
new file mode 100644
index 0000000..90fad22
--- /dev/null
+++ b/helper/ccnx-encoding-helper.h
@@ -0,0 +1,97 @@
+/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
+/*
+ * Copyright (c) 2011 University of California, Los Angeles
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Author: 
+ */
+
+#ifndef _CCNX_ENCODING_HELPER_H_
+#define _CCNX_ENCODING_HELPER_H_
+
+#include <sys/types.h>
+
+#include "ns3/ccnx.h"
+#include "ns3/ptr.h"
+#include "ns3/nstime.h"
+#include "ns3/buffer.h"
+
+namespace ns3 {
+
+namespace Name{ class Components; }
+
+class CcnxInterestHeader;
+class CcnxContentObjectHeader;
+  
+/**
+ * Helper to encode/decode ccnb formatted CCNx message
+ *
+ */
+class CcnxEncodingHelper
+{
+public:
+  static size_t
+  Serialize (Buffer::Iterator start, const CcnxInterestHeader &interest);
+
+  static size_t
+  Serialize (Buffer::Iterator start, const CcnxContentObjectHeader &contentObject);
+
+private:
+  static size_t
+  AppendBlockHeader (Buffer::Iterator start, size_t value, Ccnx::ccn_tt block_type);
+
+  static size_t
+  AppendNumber (Buffer::Iterator start, uint32_t number);
+
+  static size_t
+  AppendCloser (Buffer::Iterator start);
+
+  static size_t
+  AppendNameComponents (Buffer::Iterator start, const Name::Components &name);
+
+  /**
+   * Append a binary timestamp as a BLOB using the ccn binary
+   * Timestamp representation (12-bit fraction).
+   *
+   * @param start start iterator of  the buffer to append to.
+   * @param time - Time object
+   *
+   * @returns written length
+   */
+  static size_t
+  AppendTimestampBlob (Buffer::Iterator start, Time time);
+
+  /**
+   * Append a tagged BLOB
+   *
+   * This is a ccnb-encoded element with containing the BLOB as content
+   *
+   * @param start start iterator of  the buffer to append to.
+   * @param dtag is the element's dtab
+   * @param data points to the binary data
+   * @param size is the size of the data, in bytes
+   *
+   * @returns written length
+   */
+  static size_t
+  AppendTaggedBlob (Buffer::Iterator start, Ccnx::ccn_dtag dtag,
+                    const uint8_t *data, size_t size);
+  
+};
+
+} // namespace ns3
+
+#endif // _CCNX_ENCODING_HELPER_H_
+
diff --git a/helper/ccnx-face-container.cc b/helper/ccnx-face-container.cc
index f25ea5e..956614d 100644
--- a/helper/ccnx-face-container.cc
+++ b/helper/ccnx-face-container.cc
@@ -1,8 +1,29 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
+/*
+ * Copyright (c) 2011 University of California, Los Angeles
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
+ */
 
 #include "ccnx-face-container.h"
-#include "ns3/node-list.h"
-#include "ns3/names.h"
+// #include "ns3/node-list.h"
+// #include "ns3/names.h"
+#include <algorithm>
+
+#include "ns3/ccnx-face.h"
 
 namespace ns3 {
 
@@ -10,13 +31,26 @@
 {
 }
 
-void
-CcnxFaceContainer::Add (CcnxFaceContainer other)
+CcnxFaceContainer::CcnxFaceContainer (const CcnxFaceContainer &other)
 {
-  for (FaceVector::const_iterator i = other.m_faces.begin (); i != other.m_faces.end (); i++)
-    {
-      m_faces.push_back (*i);
-    }
+  AddAll (other);
+}
+
+CcnxFaceContainer&
+CcnxFaceContainer::operator= (const CcnxFaceContainer &other)
+{
+  m_faces.clear ();
+  AddAll (other);
+
+  return *this;
+}
+
+  
+void
+CcnxFaceContainer::AddAll (const CcnxFaceContainer &other)
+{
+  m_faces.insert (m_faces.end (),
+                  other.m_faces.begin (), other.m_faces.end ());
 }
 
 CcnxFaceContainer::Iterator
@@ -37,44 +71,27 @@
   return m_faces.size ();
 }
 
-// CcnxAddress
-// CcnxFaceContainer::GetAddress (uint32_t i, uint32_t j) const
-// {
-//   Ptr<Ccnx> ccnx = m_faces[i].first;
-//   uint32_t face = m_faces[i].second;
-//   return ccnx->GetAddress (face, j).GetLocal ();
-// }
-
 void 
-CcnxFaceContainer::SetMetric (uint32_t i, uint16_t metric)
+CcnxFaceContainer::SetMetricToAll (uint16_t metric)
 {
-  Ptr<Ccnx> ccnx = m_faces[i].first;
-  uint32_t face = m_faces[i].second;
-  ccnx->SetMetric (face, metric);
+  for (FaceContainer::iterator it=m_faces.begin ();
+       it != m_faces.end ();
+       it++)
+    {
+      (*it)->SetMetric (metric);
+    }
 }
 
 void 
-CcnxFaceContainer::Add (Ptr<Ccnx> ccnx, uint32_t face)
+CcnxFaceContainer::Add (const Ptr<CcnxFace> &face)
 {
-  m_faces.push_back (std::make_pair (ccnx, face));
+  m_faces.push_back (face);
 }
 
-void CcnxFaceContainer::Add (std::pair<Ptr<Ccnx>, uint32_t> a)
+Ptr<CcnxFace>
+CcnxFaceContainer::Get (CcnxFaceContainer::Iterator i) const
 {
-  Add (a.first, a.second);
-}
-
-void 
-CcnxFaceContainer::Add (std::string ccnxName, uint32_t face)
-{
-  Ptr<Ccnx> ccnx = Names::Find<Ccnx> (ccnxName);
-  m_faces.push_back (std::make_pair (ccnx, face));
-}
-
-std::pair<Ptr<Ccnx>, uint32_t>
-CcnxFaceContainer::Get (uint32_t i) const
-{
-  return m_faces[i];
+  return *i;
 }
 
 
diff --git a/helper/ccnx-face-container.h b/helper/ccnx-face-container.h
index 8bbbbc3..4426449 100644
--- a/helper/ccnx-face-container.h
+++ b/helper/ccnx-face-container.h
@@ -1,4 +1,22 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
+/*
+ * Copyright (c) 2011 University of California, Los Angeles
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
+ */
 
 #ifndef CCNX_FACE_CONTAINER_H
 #define CCNX_FACE_CONTAINER_H
@@ -10,170 +28,101 @@
 namespace ns3 {
 
 /**
- * \brief holds a vector of std::pair of Ptr<Ccnx> and face index.
+ * \ingroup ccnx
+ * \brief A pool for CCNx faces
+ * 
+ * Provides tools to perform basic manipulation on faces, such as
+ * setting metrics and states on faces
  *
- * Typically ns-3 CcnxFaces are installed on devices using an Ccnx address
- * helper.  The helper's Assign() method takes a NetDeviceContainer which holds 
- * some number of Ptr<NetDevice>.  For each of the NetDevices in the 
- * NetDeviceContainer the helper will find the associated Ptr<Node> and
- * Ptr<Ccnx>.  It makes sure that an face exists on the node for the 
- * device and then adds an CcnxAddress according to the address helper settings
- * (incrementing the CcnxAddress somehow as it goes).  The helper then converts
- * the Ptr<Ccnx> and the face index to a std::pair and adds them to a 
- * container -- a container of this type.
- *
- * The point is then to be able to implicitly associate an index into the 
- * original NetDeviceContainer (that identifies a particular net device) with
- * an identical index into the CcnxFaceContainer that has a std::pair with
- * the Ptr<Ccnx> and face index you need to play with the face.
- *
- * @see CcnxAddressHelper
- * @see Ccnx
+ * \see Ccnx
  */
 class CcnxFaceContainer
 {
+private:
+  typedef std::vector<Ptr<CcnxFace> > FaceContainer;
 public:
-  typedef std::vector<std::pair<Ptr<Ccnx>, uint32_t> >::const_iterator Iterator;
+  typedef FaceContainer::const_iterator Iterator; ///< \brief Iterator over CcnxFaceContainer
 
   /**
-   * Create an empty CcnxFaceContainer.
+   * \brief Create an empty CcnxFaceContainer.
    */
   CcnxFaceContainer ();
 
   /**
-   * Concatenate the entries in the other container with ours.
-   * \param other container
+   * \brief Copy constructor for CcnxFaceContainer. Calls AddAll method
+   *
+   * \see CcnxFaceContainer::AddAll
    */
-  void Add (CcnxFaceContainer other);
+  CcnxFaceContainer (const CcnxFaceContainer &other);
 
   /**
-   * \brief Get an iterator which refers to the first pair in the 
+   * \brief Copy operator for CcnxFaceContainer. Empties vector and calls AddAll method
+   *
+   * All previously obtained iterators (Begin() and End()) will be invalidated
+   *
+   * \see CcnxFaceContainer::AddAll
+   */
+  CcnxFaceContainer& operator= (const CcnxFaceContainer &other);
+  
+  /**
+   * \brief Add all entries from other container
+   *
+   * \param other container
+   */
+  void AddAll (const CcnxFaceContainer &other);
+
+  /**
+   * \brief Get an iterator which refers to the first pair in the
    * container.
    *
-   * Pairs can be retrieved from the container in two ways.  First,
-   * directly by an index into the container, and second, using an iterator.
-   * This method is used in the iterator method and is typically used in a 
-   * for-loop to run through the pairs
-   *
-   * \code
-   *   ccnxFaceContainer::Iterator i;
-   *   for (i = container.Begin (); i != container.End (); ++i)
-   *     {
-   *       std::pair<Ptr<Ccnx>, uint32_t> pair = *i;
-   *       method (pair.first, pair.second);  // use the pair
-   *     }
-   * \endcode
-   *
    * \returns an iterator which refers to the first pair in the container.
    */
-  Iterator Begin (void) const;
+  Iterator Begin () const;
 
   /**
    * \brief Get an iterator which indicates past-the-last Node in the 
    * container.
    *
-   * Nodes can be retrieved from the container in two ways.  First,
-   * directly by an index into the container, and second, using an iterator.
-   * This method is used in the iterator method and is typically used in a 
-   * for-loop to run through the Nodes
-   *
-   * \code
-   *   NodeContainer::Iterator i;
-   *   for (i = container.Begin (); i != container.End (); ++i)
-   *     {
-   *       std::pair<Ptr<Ccnx>, uint32_t> pair = *i;
-   *       method (pair.first, pair.second);  // use the pair
-   *     }
-   * \endcode
-   *
    * \returns an iterator which indicates an ending condition for a loop.
    */
-  Iterator End (void) const;
+  Iterator End () const;
 
   /**
-   * \returns the number of Ptr<Ccnx> and face pairs stored in this 
-   * ccnxFaceContainer.
+   * \brief Get the number of faces stored in this container
    *
-   * Pairs can be retrieved from the container in two ways.  First,
-   * directly by an index into the container, and second, using an iterator.
-   * This method is used in the direct method and is typically used to
-   * define an ending condition in a for-loop that runs through the stored
-   * Nodes
-   *
-   * \code
-   *   uint32_t nNodes = container.GetN ();
-   *   for (uint32_t i = 0 i < nNodes; ++i)
-   *     {
-   *       std::pair<Ptr<Ccnx>, uint32_t> pair = container.Get (i);
-   *       method (pair.first, pair.second);  // use the pair
-   *     }
-   * \endcode
-   *
-   * \returns the number of Ptr<Node> stored in this container.
+   * \returns the number of faces stored in this container
    */
-  uint32_t GetN (void) const;
+  uint32_t GetN () const;
 
   /**
-   * \param i index of ipfacePair in container
-   * \param j face address index (if face has multiple addresses)
-   * \returns the ccnx address of the j'th address of the face
-   *  corresponding to index i.
-   * 
-   * If the second parameter is omitted, the zeroth indexed address of 
-   * the face is returned.  Unless IP aliasing is being used on
-   * the face, the second parameter may typically be omitted.
+   * \brief Set a metric for all faces in the container
+   *
+   * \param metric value of metric to assign to all faces in the container
    */
-  // ccnxAddress GetAddress (uint32_t i, uint32_t j = 0) const;
-
-  void SetMetric (uint32_t i, uint16_t metric);
+  void SetMetricToAll (uint16_t metric);
 
   /**
-   * Manually add an entry to the container consisting of the individual parts
-   * of an entry std::pair.
+   * Add an entry to the container
    *
-   * \param ccnx pointer to ccnx object
-   * \param face face index of the ccnxface to add to the container
+   * \param face a smart pointer to a CcnxFace-derived object
    *
-   * @see ccnxfaceContainer
+   * @see CcnxFace
    */
-  void Add (Ptr<Ccnx> ccnx, uint32_t face);
+  void Add (const Ptr<CcnxFace> &face);
 
   /**
-   * Manually add an entry to the container consisting of a previously composed 
-   * entry std::pair.
+   * Get a smart pointer to CcnxFace-derived object stored in the container
    *
-   * \param ipfacePair the pair of a pointer to ccnx object and face index of the ccnxface to add to the container
+   * \param i the iterator corresponding to the requested object
    *
-   * @see ccnxfaceContainer
+   * This method is redundant and simple dereferencing of the iterator should be used instead
+   *
+   * @see CcnxFace
    */
-  void Add (std::pair<Ptr<Ccnx>, uint32_t> ipFacePair);
-
-  /**
-   * Manually add an entry to the container consisting of the individual parts
-   * of an entry std::pair.
-   *
-   * \param ccnxName std:string referring to the saved name of an ccnx Object that
-   *        has been previously named using the Object Name Service.
-   * \param face face index of the ccnxface to add to the container
-   *
-   * @see ccnxfaceContainer
-   */
-  void Add (std::string ccnxName, uint32_t face);
-
-  /**
-   * Get the std::pair of an Ptr<Ccnx> and face stored at the location 
-   * specified by the index.
-   *
-   * \param i the index of the entery to retrieve.
-   *
-   * @see ccnxfaceContainer
-   */
-  std::pair<Ptr<Ccnx>, uint32_t> Get (uint32_t i) const;
+  Ptr<CcnxFace> Get (Iterator i) const;
 
 private:
-
-  typedef std::vector<std::pair<Ptr<Ccnx>,uint32_t> > FaceVector;
-  FaceVector m_faces;
+  FaceContainer m_faces;
 };
 
 } // namespace ns3
diff --git a/model/ccn/README b/in-progress/ccn/README
similarity index 100%
rename from model/ccn/README
rename to in-progress/ccn/README
diff --git a/model/ccn/ccn.h b/in-progress/ccn/ccn.h
similarity index 100%
rename from model/ccn/ccn.h
rename to in-progress/ccn/ccn.h
diff --git a/model/ccn/ccn_buf_decoder.cc b/in-progress/ccn/ccn_buf_decoder.cc
similarity index 100%
rename from model/ccn/ccn_buf_decoder.cc
rename to in-progress/ccn/ccn_buf_decoder.cc
diff --git a/model/ccn/ccn_buf_encoder.cc b/in-progress/ccn/ccn_buf_encoder.cc
similarity index 100%
rename from model/ccn/ccn_buf_encoder.cc
rename to in-progress/ccn/ccn_buf_encoder.cc
diff --git a/model/ccn/ccn_charbuf.cc b/in-progress/ccn/ccn_charbuf.cc
similarity index 100%
rename from model/ccn/ccn_charbuf.cc
rename to in-progress/ccn/ccn_charbuf.cc
diff --git a/model/ccn/ccn_charbuf.h b/in-progress/ccn/ccn_charbuf.h
similarity index 100%
rename from model/ccn/ccn_charbuf.h
rename to in-progress/ccn/ccn_charbuf.h
diff --git a/model/ccn/ccn_indexbuf.cc b/in-progress/ccn/ccn_indexbuf.cc
similarity index 100%
rename from model/ccn/ccn_indexbuf.cc
rename to in-progress/ccn/ccn_indexbuf.cc
diff --git a/model/ccn/ccn_indexbuf.h b/in-progress/ccn/ccn_indexbuf.h
similarity index 100%
rename from model/ccn/ccn_indexbuf.h
rename to in-progress/ccn/ccn_indexbuf.h
diff --git a/model/ccn/ccn_name_util.cc b/in-progress/ccn/ccn_name_util.cc
similarity index 100%
rename from model/ccn/ccn_name_util.cc
rename to in-progress/ccn/ccn_name_util.cc
diff --git a/model/ccn/ccn_name_util.h b/in-progress/ccn/ccn_name_util.h
similarity index 100%
rename from model/ccn/ccn_name_util.h
rename to in-progress/ccn/ccn_name_util.h
diff --git a/model/ccn/ccn_random.cc b/in-progress/ccn/ccn_random.cc
similarity index 100%
rename from model/ccn/ccn_random.cc
rename to in-progress/ccn/ccn_random.cc
diff --git a/model/ccn/ccn_random.h b/in-progress/ccn/ccn_random.h
similarity index 100%
rename from model/ccn/ccn_random.h
rename to in-progress/ccn/ccn_random.h
diff --git a/model/ccnx-content-object-header.cc b/model/ccnx-content-object-header.cc
index 8da3b84..e567207 100644
--- a/model/ccnx-content-object-header.cc
+++ b/model/ccnx-content-object-header.cc
@@ -22,6 +22,8 @@
 #include "ccnx-content-object-header.h"
 
 #include "ns3/log.h"
+#include "ns3/ccnx-encoding-helper.h"
+#include "ns3/ccnx-decoding-helper.h"
 
 NS_LOG_COMPONENT_DEFINE ("CcnxContentObjectHeader");
 
@@ -60,19 +62,22 @@
 uint32_t
 CcnxContentObjectHeader::GetSerializedSize (void) const
 {
-  return 0;
+  // Unfortunately, two serializations are required, unless we can pre-calculate header length... which is not trivial
+  Buffer tmp;
+  
+  return CcnxEncodingHelper::Serialize (tmp.Begin(), *this);
 }
     
 void
 CcnxContentObjectHeader::Serialize (Buffer::Iterator start) const
 {
-  return;
+  CcnxEncodingHelper::Serialize (start, *this);
 }
 
 uint32_t
 CcnxContentObjectHeader::Deserialize (Buffer::Iterator start)
 {
-  return 0;
+  return CcnxDecodingHelper::Deserialize (start, *this); // \todo Debugging is necessary
 }
   
 TypeId
@@ -135,10 +140,10 @@
 {
   Buffer::Iterator i = start;
   uint8_t __attribute__ ((unused)) closing_tag_content = i.ReadU8 ();
-  NS_ASSERT_MSG (closing_tag_content==0, "Should be closing tag </Content> (0x00)");
+  NS_ASSERT_MSG (closing_tag_content==0, "Should be a closing tag </Content> (0x00)");
 
   uint8_t __attribute__ ((unused)) closing_tag_content_object = i.ReadU8 ();
-  NS_ASSERT_MSG (closing_tag_content_object==0, "Should be closing tag </ContentObject> (0x00)");
+  NS_ASSERT_MSG (closing_tag_content_object==0, "Should be a closing tag </ContentObject> (0x00)");
 
   return 2;
 }
diff --git a/model/ccnx-face.cc b/model/ccnx-face.cc
index 15ddb84..6ce6b92 100644
--- a/model/ccnx-face.cc
+++ b/model/ccnx-face.cc
@@ -151,7 +151,7 @@
     }
 
   m_device->Send (packet, m_device->GetBroadcast (), 
-                  CcnxL3Protocol::PROT_NUMBER);
+                  CcnxL3Protocol::ETHERNET_FRAME_TYPE);
 }
 
 std::ostream& operator<< (std::ostream& os, CcnxFace const& face)
diff --git a/model/ccnx-interest-header.cc b/model/ccnx-interest-header.cc
index 627946c..02ad9af 100644
--- a/model/ccnx-interest-header.cc
+++ b/model/ccnx-interest-header.cc
@@ -26,6 +26,8 @@
 #include "ccnx-interest-header.h"
 
 #include "ns3/log.h"
+#include "ns3/ccnx-encoding-helper.h"
+#include "ns3/ccnx-decoding-helper.h"
 
 NS_LOG_COMPONENT_DEFINE ("CcnxInterestHeader");
 
@@ -167,19 +169,22 @@
 uint32_t
 CcnxInterestHeader::GetSerializedSize (void) const
 {
-  return 0;
+  // unfortunately, 2 serialization required...
+  Buffer tmp;
+  
+  return CcnxEncodingHelper::Serialize (tmp.Begin(), *this);
 }
     
 void
 CcnxInterestHeader::Serialize (Buffer::Iterator start) const
 {
-  return;
+  CcnxEncodingHelper::Serialize (start, *this);
 }
 
 uint32_t
 CcnxInterestHeader::Deserialize (Buffer::Iterator start)
 {
-  return 0;
+  return CcnxDecodingHelper::Deserialize (start, *this); // \todo Debugging is necessary
 }
 
 TypeId
@@ -191,7 +196,23 @@
 void
 CcnxInterestHeader::Print (std::ostream &os) const
 {
-  os << "Interest: " << *m_name;
+  os << "<Interest><Name>" << *m_name << "</Name>";
+  if (m_minSuffixComponents>=0)
+    os << "<MinSuffixComponents>" << m_minSuffixComponents << "</MinSuffixComponents>";
+  if (m_maxSuffixComponents>=0)
+    os << "<MaxSuffixComponents>" << m_maxSuffixComponents << "</MaxSuffixComponents>";
+  if (m_exclude->size()>0)
+    os << "<Exclude>" << *m_exclude << "</Exclude>";
+  if (m_childSelector)
+    os << "<ChildSelector />";
+  if (m_answerOriginKind)
+    os << "<AnswerOriginKind />";
+  if (m_scope>=0)
+    os << "<Scope>" << m_scope << "</Scope>";
+  if (!m_interestLifetime.IsZero())
+    os << "<InterestLifetime>" << m_interestLifetime << "</InterestLifetime>";
+  if (m_nonce>0)
+    os << "<Nonce>" << m_nonce << "</Nonce>";
 }
 
 }
diff --git a/model/ccnx-l3-protocol.cc b/model/ccnx-l3-protocol.cc
index 2ea1414..2a13f4c 100644
--- a/model/ccnx-l3-protocol.cc
+++ b/model/ccnx-l3-protocol.cc
@@ -43,7 +43,7 @@
 
 namespace ns3 {
 
-const uint16_t CcnxL3Protocol::PROT_NUMBER = 0x7777;
+const uint16_t CcnxL3Protocol::ETHERNET_FRAME_TYPE = 0x7777;
 
 NS_OBJECT_ENSURE_REGISTERED (CcnxL3Protocol);
 
@@ -53,19 +53,19 @@
   static TypeId tid = TypeId ("ns3::CcnxL3Protocol")
     .SetParent<Ccnx> ()
     .AddConstructor<CcnxL3Protocol> ()
-    .AddTraceSource ("Tx", "Send ccnx packet to outgoing interface.",
-                     MakeTraceSourceAccessor (&CcnxL3Protocol::m_txTrace))
-    .AddTraceSource ("Rx", "Receive ccnx packet from incoming interface.",
-                     MakeTraceSourceAccessor (&CcnxL3Protocol::m_rxTrace))
-    .AddTraceSource ("Drop", "Drop ccnx packet",
-                     MakeTraceSourceAccessor (&CcnxL3Protocol::m_dropTrace))
+    // .AddTraceSource ("Tx", "Send ccnx packet to outgoing interface.",
+    //                  MakeTraceSourceAccessor (&CcnxL3Protocol::m_txTrace))
+    // .AddTraceSource ("Rx", "Receive ccnx packet from incoming interface.",
+    //                  MakeTraceSourceAccessor (&CcnxL3Protocol::m_rxTrace))
+    // .AddTraceSource ("Drop", "Drop ccnx packet",
+    //                  MakeTraceSourceAccessor (&CcnxL3Protocol::m_dropTrace))
     .AddAttribute ("InterfaceList", "The set of Ccnx interfaces associated to this Ccnx stack.",
                    ObjectVectorValue (),
                    MakeObjectVectorAccessor (&CcnxL3Protocol::m_faces),
                    MakeObjectVectorChecker<CcnxFace> ())
 
-    .AddTraceSource ("SendOutgoing", "A newly-generated packet by this node is about to be queued for transmission",
-                     MakeTraceSourceAccessor (&CcnxL3Protocol::m_sendOutgoingTrace))
+    // .AddTraceSource ("SendOutgoing", "A newly-generated packet by this node is about to be queued for transmission",
+    //                  MakeTraceSourceAccessor (&CcnxL3Protocol::m_sendOutgoingTrace))
 
   ;
   return tid;
@@ -137,7 +137,7 @@
 }
 
 uint32_t 
-CcnxL3Protocol::AddFace (Ptr<CcnxFace> face)
+CcnxL3Protocol::AddFace (const Ptr<CcnxFace> &face)
 {
   NS_LOG_FUNCTION (this << *face);
 
@@ -147,7 +147,7 @@
   if (face->GetDevice() != 0)
     {
       m_node->RegisterProtocolHandler (MakeCallback (&CcnxL3Protocol::ReceiveFromLower, this), 
-                                       CcnxL3Protocol::PROT_NUMBER, face->GetDevice(), true/*promiscuous mode*/);
+                                       CcnxL3Protocol::ETHERNET_FRAME_TYPE, face->GetDevice(), true/*promiscuous mode*/);
     }
 
   uint32_t index = m_faces.size ();
@@ -218,7 +218,7 @@
   if (incomingFace->IsUp ())
     {
       NS_LOG_LOGIC ("Dropping received packet -- interface is down");
-      m_dropTrace (packet, DROP_INTERFACE_DOWN, m_node->GetObject<Ccnx> (), incomingFace);
+      // m_dropTrace (packet, DROP_INTERFACE_DOWN, m_node->GetObject<Ccnx> (), incomingFace);
       return;
     }
 
@@ -242,7 +242,7 @@
   if (incomingFace->IsUp ())
     {
       NS_LOG_LOGIC ("Dropping received packet -- interface is down");
-      m_dropTrace (packet, DROP_INTERFACE_DOWN, m_node->GetObject<Ccnx> (), incomingFace);
+      // m_dropTrace (packet, DROP_INTERFACE_DOWN, m_node->GetObject<Ccnx> (), incomingFace);
       return;
     }
 
@@ -258,29 +258,29 @@
 
 
 void
-CcnxL3Protocol::Send (Ptr<Packet> packet, Ptr<CcnxRoute> route)
+CcnxL3Protocol::Send (Ptr<Packet> packet, const Ptr<CcnxFace> &face)
 {
-  NS_LOG_FUNCTION (this << "packet: " << packet << ", route: "<< route);
+  // NS_LOG_FUNCTION (this << "packet: " << packet << ", route: "<< route);
   
-  if (route == 0)
-    {
-      NS_LOG_WARN ("No route to host.  Drop.");
-      m_dropTrace (packet, DROP_NO_ROUTE, m_node->GetObject<Ccnx> (), 0);
-      return;
-    }
-  Ptr<CcnxFace> outFace = route->GetOutputFace ();
+  // if (route == 0)
+  //   {
+  //     NS_LOG_WARN ("No route to host.  Drop.");
+  //     // m_dropTrace (packet, DROP_NO_ROUTE, m_node->GetObject<Ccnx> (), 0);
+  //     return;
+  //   }
+  // Ptr<CcnxFace> outFace = route->GetOutputFace ();
 
-  if (outFace->IsUp ())
-    {
-      NS_LOG_LOGIC ("Sending via face " << *outFace);
-      m_txTrace (packet, m_node->GetObject<Ccnx> (), outFace);
-      outFace->Send (packet);
-    }
-  else
-    {
-      NS_LOG_LOGIC ("Dropping -- outgoing interface is down: " << *outFace);
-      m_dropTrace (packet, DROP_INTERFACE_DOWN, m_node->GetObject<Ccnx> (), outFace);
-    }
+  // if (outFace->IsUp ())
+  //   {
+  //     NS_LOG_LOGIC ("Sending via face " << *outFace);
+  //     // m_txTrace (packet, m_node->GetObject<Ccnx> (), outFace);
+  //     outFace->Send (packet);
+  //   }
+  // else
+  //   {
+  //     NS_LOG_LOGIC ("Dropping -- outgoing interface is down: " << *outFace);
+  //     // m_dropTrace (packet, DROP_INTERFACE_DOWN, m_node->GetObject<Ccnx> (), outFace);
+  //   }
 }
 
 
@@ -339,12 +339,4 @@
     }
 }
 
-void
-CcnxL3Protocol::RouteInputError (Ptr<Packet> p)//, Socket::SocketErrno sockErrno)
-{
-  // NS_LOG_FUNCTION (this << p << ipHeader << sockErrno);
-  // NS_LOG_LOGIC ("Route input failure-- dropping packet to " << ipHeader << " with errno " << sockErrno); 
-  m_dropTrace (p, DROP_ROUTE_ERROR, m_node->GetObject<Ccnx> (), 0);
-}
-
 } //namespace ns3
diff --git a/model/ccnx-l3-protocol.h b/model/ccnx-l3-protocol.h
index 32425c4..e8a0d22 100644
--- a/model/ccnx-l3-protocol.h
+++ b/model/ccnx-l3-protocol.h
@@ -1,22 +1,22 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
-//
-// Copyright (c) 2006 Georgia Tech Research Corporation
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2 as
-// published by the Free Software Foundation;
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-//
-// Author: 
-//
+/*
+ * Copyright (c) 2011 University of California, Los Angeles
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
+ */
 
 #ifndef CCNX_L3_PROTOCOL_H
 #define CCNX_L3_PROTOCOL_H
@@ -43,10 +43,10 @@
 class CcnxContentObjectHeader;
   
 /**
- * \brief Implement the Ccnx layer.
+ * \ingroup ccnx
+ * \brief Actual implementation of the Ccnx network layer
  * 
- * This is the actual implementation of IP.  It contains APIs to send and
- * receive packets at the IP layer, as well as APIs for IP routing.
+ * \todo This description is incorrect. Should be changed accordingly
  *
  * This class contains two distinct groups of trace sources.  The
  * trace sources 'Rx' and 'Tx' are called, respectively, immediately
@@ -61,9 +61,20 @@
 class CcnxL3Protocol : public Ccnx
 {
 public:
+  /**
+   * \brief Interface ID
+   *
+   * \return interface ID
+   */
   static TypeId GetTypeId (void);
-  static const uint16_t PROT_NUMBER;
 
+  static const uint16_t ETHERNET_FRAME_TYPE; ///< \brief Ethernet Frame Type of CCNx
+  static const uint16_t IP_PROTOCOL_TYPE;    ///< \brief IP protocol type of CCNx
+  static const uint16_t UDP_PORT;            ///< \brief UDP port of CCNx
+
+  /**
+   * \brief Default constructor. Creates an empty stack without forwarding strategy set
+   */
   CcnxL3Protocol();
   virtual ~CcnxL3Protocol ();
 
@@ -78,16 +89,35 @@
     DROP_CONGESTION, /**< Congestion detected */
     DROP_NO_ROUTE,   /**< No route to host */
     DROP_INTERFACE_DOWN,   /**< Interface is down so can not send packet */
-    DROP_ROUTE_ERROR,   /**< Route error */
   };
 
+  /**
+   * \brief Assigns node to the CCNx stack
+   *
+   * \param node Simulation node
+   */
   void SetNode (Ptr<Node> node);
 
+  ////////////////////////////////////////////////////////////////////
   // functions defined in base class Ccnx
   
   void SetForwardingStrategy (Ptr<CcnxForwardingStrategy> forwardingStrategy);
   Ptr<CcnxForwardingStrategy> GetForwardingStrategy (void) const;
 
+  virtual void Send (Ptr<Packet> packet, const Ptr<CcnxFace> &face);
+
+  virtual uint32_t AddFace (const Ptr<CcnxFace> &face);
+  virtual uint32_t GetNFaces (void) const;
+  virtual Ptr<CcnxFace> GetFace (uint32_t face) const;
+
+  virtual void SetMetric (uint32_t i, uint16_t metric);
+  virtual uint16_t GetMetric (uint32_t i) const;
+  virtual uint16_t GetMtu (uint32_t i) const;
+  virtual bool IsUp (uint32_t i) const;
+  virtual void SetUp (uint32_t i);
+  virtual void SetDown (uint32_t i);
+
+protected:
   /**
    * Lower layer calls this method after calling L3Demux::Lookup
    *
@@ -119,29 +149,10 @@
    */
   virtual void
   ReceiveAndProcess (Ptr<CcnxFace> face, Ptr<CcnxContentObjectHeader> header, Ptr<Packet> p);
-  
-  /**
-   * \param packet packet to send
-   * \param route route entry
-   *
-   * Higher-level layers call this method to send a packet
-   * down the stack to the MAC and PHY layers.
-   */
-  virtual void Send (Ptr<Packet> packet, Ptr<CcnxRoute> route);
-
-  virtual uint32_t AddFace (Ptr<CcnxFace> face);
-  virtual uint32_t GetNFaces (void) const;
-  virtual Ptr<CcnxFace> GetFace (uint32_t face) const;
-
-  virtual void SetMetric (uint32_t i, uint16_t metric);
-  virtual uint16_t GetMetric (uint32_t i) const;
-  virtual uint16_t GetMtu (uint32_t i) const;
-  virtual bool IsUp (uint32_t i) const;
-  virtual void SetUp (uint32_t i);
-  virtual void SetDown (uint32_t i);
 
 protected:
   virtual void DoDispose (void);
+
   /**
    * This function will notify other components connected to the node that a new stack member is now connected
    * This will be used to notify Layer 3 protocol of layer 4 protocol stack to connect them together.
@@ -149,20 +160,16 @@
   virtual void NotifyNewAggregate ();
 
 private:
-  // friend class CcnxL3ProtocolTestCase;
-  CcnxL3Protocol(const CcnxL3Protocol &);
-  CcnxL3Protocol &operator = (const CcnxL3Protocol &);
+  CcnxL3Protocol(const CcnxL3Protocol &); ///< copy constructor is disabled
+  CcnxL3Protocol &operator = (const CcnxL3Protocol &); ///< copy operator is disabled
 
   /**
    * Helper function to get CcnxFace from NetDevice
    */
   Ptr<CcnxFace> GetFaceForDevice (Ptr<const NetDevice> device) const;
-  
-  void RouteInputError (Ptr<Packet> p);
-                        //, Socket::SocketErrno sockErrno);
 
   /**
-   * false function. should never be called. Just to trick C++ to compile
+   * \brief Fake function. should never be called. Just to trick C++ to compile
    */
   virtual void
   ReceiveAndProcess (Ptr<CcnxFace> face, Ptr<Header> header, Ptr<Packet> p);
@@ -174,15 +181,15 @@
   Ptr<Node> m_node;
   Ptr<CcnxForwardingStrategy> m_forwardingStrategy;
 
-  TracedCallback<Ptr<const Packet>, Ptr<const CcnxFace> > m_sendOutgoingTrace;
-  TracedCallback<Ptr<const Packet>, Ptr<const CcnxFace> > m_unicastForwardTrace;
-  TracedCallback<Ptr<const Packet>, Ptr<const CcnxFace> > m_localDeliverTrace;
+  // TracedCallback<Ptr<const Packet>, Ptr<const CcnxFace> > m_sendOutgoingTrace;
+  // TracedCallback<Ptr<const Packet>, Ptr<const CcnxFace> > m_unicastForwardTrace;
+  // TracedCallback<Ptr<const Packet>, Ptr<const CcnxFace> > m_localDeliverTrace;
 
-  // The following two traces pass a packet with an IP header
-  TracedCallback<Ptr<const Packet>, Ptr<Ccnx>, Ptr<const CcnxFace> > m_txTrace;
-  TracedCallback<Ptr<const Packet>, Ptr<Ccnx>, Ptr<const CcnxFace> > m_rxTrace;
-  // <ip-header, payload, reason, ifindex> (ifindex not valid if reason is DROP_NO_ROUTE)
-  TracedCallback<Ptr<const Packet>, DropReason, Ptr<const Ccnx>, Ptr<const CcnxFace> > m_dropTrace;
+  // // The following two traces pass a packet with an IP header
+  // TracedCallback<Ptr<const Packet>, Ptr<Ccnx>, Ptr<const CcnxFace> > m_txTrace;
+  // TracedCallback<Ptr<const Packet>, Ptr<Ccnx>, Ptr<const CcnxFace> > m_rxTrace;
+  // // <ip-header, payload, reason, ifindex> (ifindex not valid if reason is DROP_NO_ROUTE)
+  // TracedCallback<Ptr<const Packet>, DropReason, Ptr<const Ccnx>, Ptr<const CcnxFace> > m_dropTrace;
 };
   
 } // Namespace ns3
diff --git a/model/ccnx.cc b/model/ccnx.cc
index 7716366..a940c36 100644
--- a/model/ccnx.cc
+++ b/model/ccnx.cc
@@ -37,12 +37,4 @@
   return tid;
 }
 
-Ccnx::Ccnx ()
-{
-}
-
-Ccnx::~Ccnx ()
-{
-}
-
 } // namespace ns3
diff --git a/model/ccnx.h b/model/ccnx.h
index 12c45d2..c7627ab 100644
--- a/model/ccnx.h
+++ b/model/ccnx.h
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
 /*
- * Copyright (c) 2007 INRIA
+ * Copyright (c) 2011 University of California, Los Angeles
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
@@ -15,17 +15,17 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
- * Author: 
+ * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
  */
-#ifndef CCNX_H
-#define CCNX_H
 
-#include <stdint.h>
+#ifndef _CCNX_H_
+#define _CCNX_H_
+
 #include "ns3/object.h"
 #include "ns3/socket.h"
 #include "ns3/callback.h"
 
-#include "ccnx-route.h"
+#include "ccnx-face.h"
 
 namespace ns3 {
 
@@ -35,76 +35,87 @@
 class CcnxForwardingStrategy;
 
 /**
- * \ingroup internet
- * \defgroup ccnx Ccnx
+ * \defgroup ccnx NDN abstraction
+ *
+ * This is an abstract implementation of NDN protocol
  */
 /**
  * \ingroup ccnx
- * \brief Access to the Ccnx forwarding table, interfaces, and configuration
+ * \brief Interface to manage Ccnx stack
  *
  * This class defines the API to manipulate the following aspects of
- * the Ccnx implementation:
- * -# register a NetDevice for use by the Ccnx layer (basically, to
- * create Ccnx-related state such as addressing and neighbor cache that 
- * is associated with a NetDevice)
- * -# manipulate the status of the NetDevice from the Ccnx perspective, 
- * such as marking it as Up or Down, 
- // * -# adding, deleting, and getting addresses associated to the Ccnx 
- // * interfaces.
- * -# exporting Ccnx configuration attributes
+ * the Ccnx stack implementation:
+ * -# register a face (CcnxFace-derived object) for use by the Ccnx
+ *    layer
+ * -# register forwarding strategy (CcnxForwardingStrategy-derived
+ *    object) to use by Ccnx stack
+ * -# export Ccnx configuration attributes
  * 
- * Each NetDevice has conceptually a single Ccnx interface associated
- * with it.
+ * Each CcnxFace-derived object has conceptually a single Ccnx
+ * interface associated with it.
+ *
+ * In addition, this class defines CCNx packet coding constants
+ *
+ * \see CcnxFace, CcnxForwardingStrategy
  */
 class Ccnx : public Object
 {
 public:
-  static TypeId GetTypeId (void);
-  Ccnx ();
-  virtual ~Ccnx ();
+  /**
+   * \brief Interface ID
+   *
+   * \return interface ID
+   */
+  static TypeId GetTypeId ();
 
   /**
-   * \brief Register a new forwarding protocol to be used by this Ccnx stack
+   * \brief Register a new forwarding strategy to be used by this Ccnx
+   * stack
    *
-   * This call will replace any forwarding protocol that has been previously 
-   * registered.  If you want to add multiple forwarding protocols, you must
-   * add them to a CcnxListForwardingStrategy directly.
+   * This call will replace any forwarding strategy that has been
+   * previously registered.
    * 
-   * \param forwardingStrategy smart pointer to CcnxForwardingStrategy object
+   * \param forwardingStrategy smart pointer to CcnxForwardingStrategy
+   * object
    */
   virtual void SetForwardingStrategy (Ptr<CcnxForwardingStrategy> forwardingStrategy) = 0;
 
   /**
-   * \brief Get the forwarding protocol to be used by this Ccnx stack
+   * \brief Get the forwarding strategy being used by this Ccnx stack
    * 
-   * \returns smart pointer to CcnxForwardingStrategy object, or null pointer if none
+   * \returns smart pointer to CcnxForwardingStrategy object, or null
+   * pointer if none
    */
   virtual Ptr<CcnxForwardingStrategy> GetForwardingStrategy (void) const = 0;
 
   /**
-   * \param device device to add to the list of Ccnx interfaces
-   *        which can be used as output interfaces during packet forwarding.
-   * \returns the index of the Ccnx interface added.
+   * \brief Add face to CCNx stack
    *
-   * Once a device has been added, it can never be removed: if you want
-   * to disable it, you can invoke Ccnx::SetDown which will
-   * make sure that it is never used during packet forwarding.
+   * \param face smart pointer to CcnxFace-derived object
+   * (CcnxLocalFace, CcnxNetDeviceFace, CcnxUdpFace) \returns the
+   * index of the Ccnx interface added.
+   * 
+   * \see CcnxLocalFace, CcnxNetDeviceFace, CcnxUdpFace
    */
-  virtual uint32_t AddFace (Ptr<CcnxFace> face) = 0;
+  virtual uint32_t AddFace (const Ptr<CcnxFace> &face) = 0;
 
   /**
-   * \returns the number of interfaces added by the user.
+   * \brief Get current number of faces added to CCNx stack
+   *
+   * \returns the number of faces
    */
   virtual uint32_t GetNFaces (void) const = 0;
 
   /**
-   * \param packet packet to send
-   * \param route route entry
+   * \brief Send a packet to a specified face
    *
-   * Higher-level layers call this method to send a packet
-   * down the stack to the MAC and PHY layers.
+   * \param packet fully prepared CCNx packet to send
+   * \param face face where to send this packet
+   *
+   * Higher-level layers (forwarding strategy in particular) call this
+   * method to send a packet down the stack to the MAC and PHY layers.
    */
-  // virtual void Send (Ptr<Packet> packet, Ptr<CcnxRoute> route) = 0;
+  virtual void Send (Ptr<Packet> packet, const Ptr<CcnxFace> &face) = 0;
 
   /**
    * \param face The face number of an Ccnx interface.
@@ -112,57 +123,129 @@
    */
   virtual Ptr<CcnxFace> GetFace (uint32_t face) const = 0;
 
-  // /**
-  //  * \param face CcnxFace object pointer 
-  //  * \returns The interface number of an Ccnx face or -1 if not found.
-  //  */
-  // virtual int32_t GetFaceForDevice (Ptr<const CcnxFace> face) const = 0;
-
-  /**
-   * \param face The face number of an Ccnx face
-   * \param metric forwarding metric (cost) associated to the underlying 
-   *          Ccnx interface
-   */
-  virtual void SetMetric (uint32_t face, uint16_t metric) = 0;
-
-  /**
-   * \param face The interface number of an Ccnx interface
-   * \returns forwarding metric (cost) associated to the underlying 
-   *          Ccnx interface
-   */
-  virtual uint16_t GetMetric (uint32_t face) const = 0;
-
-  /**
-   * \param face Interface number of Ccnx interface
-   * \returns the Maximum Transmission Unit (in bytes) associated
-   *          to the underlying Ccnx interface
-   */
-  virtual uint16_t GetMtu (uint32_t face) const = 0;
-
-  /**
-   * \param face Interface number of Ccnx interface
-   * \returns true if the underlying interface is in the "up" state,
-   *          false otherwise.
-   */
-  virtual bool IsUp (uint32_t face) const = 0;
-
-  /**
-   * \param face Interface number of Ccnx interface
-   * 
-   * Set the interface into the "up" state. In this state, it is
-   * considered valid during Ccnx forwarding.
-   */
-  virtual void SetUp (uint32_t face) = 0;
-
-  /**
-   * \param face Interface number of Ccnx interface
+public:
+   /**
+   * \brief Type tag for a ccnb start marker.
    *
-   * Set the interface into the "down" state. In this state, it is
-   * ignored during Ccnx forwarding.
+   * \see http://www.ccnx.org/releases/latest/doc/technical/DTAG.html
    */
-  virtual void SetDown (uint32_t face) = 0;
+  enum ccn_tt {
+    CCN_EXT,        /**< starts composite extension - numval is subtype */
+    CCN_TAG,        /**< starts composite - numval is tagnamelen-1 */ 
+    CCN_DTAG,       /**< starts composite - numval is tagdict index (enum ccn_dtag) */
+    CCN_ATTR,       /**< attribute - numval is attrnamelen-1, value follows */
+    CCN_DATTR,      /**< attribute numval is attrdict index */
+    CCN_BLOB,       /**< opaque binary data - numval is byte count */
+    CCN_UDATA,      /**< UTF-8 encoded character data - numval is byte count */
+    CCN_NO_TOKEN    /**< should not occur in encoding */
+  };
+
+  /** \brief CCN_CLOSE terminates composites */
+  enum {CCN_CLOSE = 0};
+
+  /**
+   * \brief DTAG identifies ccnb-encoded elements.
+   *
+   * \see http://www.ccnx.org/releases/latest/doc/technical/DTAG.html
+   */
+  enum ccn_dtag {
+    CCN_DTAG_Any = 13,
+    CCN_DTAG_Name = 14,
+    CCN_DTAG_Component = 15,
+    CCN_DTAG_Certificate = 16,
+    CCN_DTAG_Collection = 17,
+    CCN_DTAG_CompleteName = 18,
+    CCN_DTAG_Content = 19,
+    CCN_DTAG_SignedInfo = 20,
+    CCN_DTAG_ContentDigest = 21,
+    CCN_DTAG_ContentHash = 22,
+    CCN_DTAG_Count = 24,
+    CCN_DTAG_Header = 25,
+    CCN_DTAG_Interest = 26,	/* 20090915 */
+    CCN_DTAG_Key = 27,
+    CCN_DTAG_KeyLocator = 28,
+    CCN_DTAG_KeyName = 29,
+    CCN_DTAG_Length = 30,
+    CCN_DTAG_Link = 31,
+    CCN_DTAG_LinkAuthenticator = 32,
+    CCN_DTAG_NameComponentCount = 33,	/* DeprecatedInInterest */
+    CCN_DTAG_RootDigest = 36,
+    CCN_DTAG_Signature = 37,
+    CCN_DTAG_Start = 38,
+    CCN_DTAG_Timestamp = 39,
+    CCN_DTAG_Type = 40,
+    CCN_DTAG_Nonce = 41,
+    CCN_DTAG_Scope = 42,
+    CCN_DTAG_Exclude = 43,
+    CCN_DTAG_Bloom = 44,
+    CCN_DTAG_BloomSeed = 45,
+    CCN_DTAG_AnswerOriginKind = 47,
+    CCN_DTAG_InterestLifetime = 48,
+    CCN_DTAG_Witness = 53,
+    CCN_DTAG_SignatureBits = 54,
+    CCN_DTAG_DigestAlgorithm = 55,
+    CCN_DTAG_BlockSize = 56,
+    CCN_DTAG_FreshnessSeconds = 58,
+    CCN_DTAG_FinalBlockID = 59,
+    CCN_DTAG_PublisherPublicKeyDigest = 60,
+    CCN_DTAG_PublisherCertificateDigest = 61,
+    CCN_DTAG_PublisherIssuerKeyDigest = 62,
+    CCN_DTAG_PublisherIssuerCertificateDigest = 63,
+    CCN_DTAG_ContentObject = 64,	/* 20090915 */
+    CCN_DTAG_WrappedKey = 65,
+    CCN_DTAG_WrappingKeyIdentifier = 66,
+    CCN_DTAG_WrapAlgorithm = 67,
+    CCN_DTAG_KeyAlgorithm = 68,
+    CCN_DTAG_Label = 69,
+    CCN_DTAG_EncryptedKey = 70,
+    CCN_DTAG_EncryptedNonceKey = 71,
+    CCN_DTAG_WrappingKeyName = 72,
+    CCN_DTAG_Action = 73,
+    CCN_DTAG_FaceID = 74,
+    CCN_DTAG_IPProto = 75,
+    CCN_DTAG_Host = 76,
+    CCN_DTAG_Port = 77,
+    CCN_DTAG_MulticastInterface = 78,
+    CCN_DTAG_ForwardingFlags = 79,
+    CCN_DTAG_FaceInstance = 80,
+    CCN_DTAG_ForwardingEntry = 81,
+    CCN_DTAG_MulticastTTL = 82,
+    CCN_DTAG_MinSuffixComponents = 83,
+    CCN_DTAG_MaxSuffixComponents = 84,
+    CCN_DTAG_ChildSelector = 85,
+    CCN_DTAG_RepositoryInfo = 86,
+    CCN_DTAG_Version = 87,
+    CCN_DTAG_RepositoryVersion = 88,
+    CCN_DTAG_GlobalPrefix = 89,
+    CCN_DTAG_LocalName = 90,
+    CCN_DTAG_Policy = 91,
+    CCN_DTAG_Namespace = 92,
+    CCN_DTAG_GlobalPrefixName = 93,
+    CCN_DTAG_PolicyVersion = 94,
+    CCN_DTAG_KeyValueSet = 95,
+    CCN_DTAG_KeyValuePair = 96,
+    CCN_DTAG_IntegerValue = 97,
+    CCN_DTAG_DecimalValue = 98,
+    CCN_DTAG_StringValue = 99,
+    CCN_DTAG_BinaryValue = 100,
+    CCN_DTAG_NameValue = 101,
+    CCN_DTAG_Entry = 102,
+    CCN_DTAG_ACL = 103,
+    CCN_DTAG_ParameterizedName = 104,
+    CCN_DTAG_Prefix = 105,
+    CCN_DTAG_Suffix = 106,
+    CCN_DTAG_Root = 107,
+    CCN_DTAG_ProfileName = 108,
+    CCN_DTAG_Parameters = 109,
+    CCN_DTAG_InfoString = 110,
+    CCN_DTAG_StatusResponse = 112,
+    CCN_DTAG_StatusCode = 113,
+    CCN_DTAG_StatusText = 114,
+    CCN_DTAG_SequenceNumber = 256,
+    CCN_DTAG_CCNProtocolDataUnit = 17702112
+  };
 };
 
 } // namespace ns3 
 
-#endif /* CCNX_H */
+#endif /* _CCNX_H_ */
diff --git a/model/name-components.cc b/model/name-components.cc
index 55e57c4..e1af1ee 100644
--- a/model/name-components.cc
+++ b/model/name-components.cc
@@ -20,9 +20,6 @@
 
 #include "name-components.h"
 
-#include "ns3/ccn.h"
-#include "ns3/ccn_charbuf.h"
-
 #include <iostream>
 
 using namespace std;
@@ -49,6 +46,13 @@
   // ccn_charbuf_destroy(&m_value);
 }
 
+const std::list<std::string> &
+Components::GetComponents () const
+{
+  return m_prefix;
+}
+
+  
 // const ccn_charbuf*
 // Components::GetName () const
 // {
diff --git a/model/name-components.h b/model/name-components.h
index 8c124f8..0ea4821 100644
--- a/model/name-components.h
+++ b/model/name-components.h
@@ -36,7 +36,14 @@
   Components (const std::string &s);
   ~Components ();
   
-  Components& operator () (const std::string &s);
+  inline void
+  Add (const std::string &s);
+       
+  Components&
+  operator () (const std::string &s);
+
+  const std::list<std::string> &
+  GetComponents () const;
   
   // virtual uint32_t
   // GetSerializedSize (void) const;
@@ -67,6 +74,12 @@
   return m_prefix.size ();
 }
   
+void
+Components::Add (const std::string &s)
+{
+  (*this) (s);
+}
+  
   
 } // Namespace Name
 } // namespace ns3
diff --git a/wscript b/wscript
index c67b81d..0142dc2 100644
--- a/wscript
+++ b/wscript
@@ -3,18 +3,39 @@
 import os
 import Logs
 import Utils
+import Options
+
+def set_options(opt):
+    opt.tool_options('boost')
+
+def configure(conf):
+    conf.check_tool('boost')
+    conf.env['BOOST'] = conf.check_boost(lib = '', # need only base
+                                         min_version='1.40.0' )
+    if not conf.env['BOOST']:
+        conf.report_optional_feature("ndn-abstract", "NDN abstraction", False,
+                                     "Required boost libraries not found")
+        conf.env['ENABLE_NDN_ABSTRACT']=False;
+        return
+    
+    conf.env['ENABLE_NDN_ABSTRACT']=True;
+
 
 def build(bld):
     module = bld.create_ns3_module ('NDNabstraction', ['applications', 'core', 'network', 'point-to-point','topology-read','visualizer'])
-    module.find_sources_in_dirs (['model', 'apps', 'helper'],[],['.cc']);
 
     tests = bld.create_ns3_module_test_library('NDNabstraction')
-    tests.find_sources_in_dirs( ['test'], [], ['.cc'] );
-
     headers = bld.new_task_gen('ns3header')
     headers.module = 'NDNabstraction'
+
+    if not bld.env['ENABLE_NDN_ABSTRACT']:
+        return
+   
+    module.find_sources_in_dirs (['model', 'apps', 'helper'],[],['.cc']);
+    tests.find_sources_in_dirs( ['test'], [], ['.cc'] );
     headers.find_sources_in_dirs( ['model', 'apps', 'helper'], [], ['.h'] );
 
+
     for path in ["examples"]:
         anode = bld.path.find_dir (path)
         if not anode or not anode.is_child_of(bld.srcnode):
