diff --git a/helper/ccnx-coding-helper.h b/helper/ccnx-coding-helper.h
deleted file mode 100644
index 2d46a14..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
-  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, 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..e853c7d
--- /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.append (reinterpret_cast<const char*>(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.append (reinterpret_cast<const char*>(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.append (reinterpret_cast<const char*>(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-coding-helper.cc b/helper/ccnx-encoding-helper.cc
similarity index 66%
rename from helper/ccnx-coding-helper.cc
rename to helper/ccnx-encoding-helper.cc
index 7cab398..21ca9ae 100644
--- a/helper/ccnx-coding-helper.cc
+++ b/helper/ccnx-encoding-helper.cc
@@ -18,7 +18,7 @@
  * Author: 
  */
 
-#include "ccnx-coding-helper.h"
+#include "ccnx-encoding-helper.h"
 
 #include "ns3/name-components.h"
 #include "ns3/ccnx-interest-header.h"
@@ -35,17 +35,17 @@
 #define CCN_TT_HBIT ((unsigned char)(1 << 7))
 
 size_t
-CcnxCodingHelper::AppendBlockHeader (Buffer::Iterator start, size_t val, enum ccn_tt tt)
+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 & ~CCN_CLOSE) |
+  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) | CCN_CLOSE;
+    (--p)[0] = (((unsigned char)val) & ~CCN_TT_HBIT) | Ccnx::CCN_CLOSE;
     n++;
     val >>= 7;
   }
@@ -54,13 +54,13 @@
 }
 
 size_t
-CcnxCodingHelper::AppendNumber (Buffer::Iterator start, uint32_t number)
+CcnxEncodingHelper::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 += 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());
 
@@ -69,26 +69,26 @@
 
   
 size_t
-CcnxCodingHelper::CcnxCodingHelper::AppendCloser (Buffer::Iterator start)
+CcnxEncodingHelper::CcnxEncodingHelper::AppendCloser (Buffer::Iterator start)
 {
-  start.WriteU8 (CCN_CLOSE);
+  start.WriteU8 (Ccnx::CCN_CLOSE);
   return 1;
 }
 
 size_t
-CcnxCodingHelper::AppendNameComponents (Buffer::Iterator start, const Name::Components &name)
+CcnxEncodingHelper::AppendNameComponents (Buffer::Iterator start, const Name::Components &name)
 {
   size_t written = 0;
   BOOST_FOREACH (const std::string &component, name.GetComponents())
     {
-      written += AppendTaggedBlob (start, CCN_DTAG_Component,
+      written += AppendTaggedBlob (start, Ccnx::CCN_DTAG_Component,
                                    reinterpret_cast<const uint8_t*>(component.c_str()), component.size());
     }
   return written;
 }
 
 size_t
-CcnxCodingHelper::AppendTimestampBlob (Buffer::Iterator start, Time time)
+CcnxEncodingHelper::AppendTimestampBlob (Buffer::Iterator start, Time time)
 {
   // the original function implements Markers... thought not sure what are these markers for...
 
@@ -98,7 +98,7 @@
   for (;  required_bytes < 7 && ts != 0; ts >>= 8) // not more than 6 bytes?
      required_bytes++;
   
-  size_t len = AppendBlockHeader(start, required_bytes, CCN_BLOB);
+  size_t len = AppendBlockHeader(start, required_bytes, Ccnx::CCN_BLOB);
 
   // write part with seconds
   ts = time.ToInteger (Time::S) >> 4;
@@ -114,13 +114,13 @@
 }
 
 size_t
-CcnxCodingHelper::AppendTaggedBlob (Buffer::Iterator start, ccn_dtag dtag,
+CcnxEncodingHelper::AppendTaggedBlob (Buffer::Iterator start, Ccnx::ccn_dtag dtag,
                   const uint8_t *data, size_t size)
 {
-  size_t written = AppendBlockHeader (start, dtag, CCN_DTAG);
+  size_t written = AppendBlockHeader (start, dtag, Ccnx::CCN_DTAG);
   if (size>0)
     {
-      written += AppendBlockHeader (start, size, CCN_BLOB);
+      written += AppendBlockHeader (start, size, Ccnx::CCN_BLOB);
       start.Write (data, size);
       written += size;
     }
@@ -131,61 +131,61 @@
 
 
 size_t
-CcnxCodingHelper::Serialize (Buffer::Iterator start, const CcnxInterestHeader &interest)
+CcnxEncodingHelper::Serialize (Buffer::Iterator start, const CcnxInterestHeader &interest)
 {
   size_t written = 0;
-  written += AppendBlockHeader (start, CCN_DTAG_Interest, CCN_DTAG); // <Interest>
+  written += AppendBlockHeader (start, Ccnx::CCN_DTAG_Interest, Ccnx::CCN_DTAG); // <Interest>
   
-  written += AppendBlockHeader (start, CCN_DTAG_Name, CCN_DTAG); // <Name>
+  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, CCN_DTAG_MinSuffixComponents, CCN_DTAG);
+      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, CCN_DTAG_MaxSuffixComponents, CCN_DTAG);
+      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, CCN_DTAG_Exclude, CCN_DTAG); // <Exclude>
+      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, CCN_DTAG_ChildSelector, CCN_DTAG);
+      written += AppendBlockHeader (start, Ccnx::CCN_DTAG_ChildSelector, Ccnx::CCN_DTAG);
       written += AppendNumber (start, 1);
       written += AppendCloser (start);
     }
   if (interest.IsEnabledAnswerOriginKind())
     {
-      written += AppendBlockHeader (start, CCN_DTAG_AnswerOriginKind, CCN_DTAG);
+      written += AppendBlockHeader (start, Ccnx::CCN_DTAG_AnswerOriginKind, Ccnx::CCN_DTAG);
       written += AppendNumber (start, 1);
       written += AppendCloser (start);
     }
   if (interest.GetScope() >= 0)
     {
-      written += AppendBlockHeader (start, CCN_DTAG_Scope, CCN_DTAG);
+      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, CCN_DTAG_InterestLifetime, CCN_DTAG);
+      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, CCN_DTAG_Nonce,
+      written += AppendTaggedBlob (start, Ccnx::CCN_DTAG_Nonce,
                                    reinterpret_cast<const uint8_t*>(&nonce),
                                    sizeof(nonce));
     }
@@ -195,35 +195,35 @@
 }
 
 size_t
-CcnxCodingHelper::Serialize (Buffer::Iterator start, const CcnxContentObjectHeader &contentObject)
+CcnxEncodingHelper::Serialize (Buffer::Iterator start, const CcnxContentObjectHeader &contentObject)
 {
   size_t written = 0;
-  written += AppendBlockHeader (start, CCN_DTAG_ContentObject, CCN_DTAG); // <ContentObject>
+  written += AppendBlockHeader (start, Ccnx::CCN_DTAG_ContentObject, Ccnx::CCN_DTAG); // <ContentObject>
 
   // fake signature
-  written += AppendBlockHeader (start, CCN_DTAG_Signature, CCN_DTAG); // <Signature>
+  written += AppendBlockHeader (start, Ccnx::CCN_DTAG_Signature, Ccnx::CCN_DTAG); // <Signature>
   // Signature ::= DigestAlgorithm? 
   //               Witness?         
   //               SignatureBits   
-  written += AppendTaggedBlob (start, CCN_DTAG_SignatureBits, 0, 0);      // <SignatureBits />
+  written += AppendTaggedBlob (start, Ccnx::CCN_DTAG_SignatureBits, 0, 0);      // <SignatureBits />
   written += AppendCloser (start);                                    // </Signature>  
 
-  written += AppendBlockHeader (start, CCN_DTAG_Name, CCN_DTAG);    // <Name>
+  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, CCN_DTAG_SignedInfo, CCN_DTAG); // <SignedInfo>
+  written += AppendBlockHeader (start, Ccnx::CCN_DTAG_SignedInfo, Ccnx::CCN_DTAG); // <SignedInfo>
   // SignedInfo ::= PublisherPublicKeyDigest
   //                Timestamp
   //                Type?
   //                FreshnessSeconds?
   //                FinalBlockID?
   //                KeyLocator?
-  written += AppendTaggedBlob (start, CCN_DTAG_PublisherPublicKeyDigest, 0, 0); // <PublisherPublicKeyDigest />
+  written += AppendTaggedBlob (start, Ccnx::CCN_DTAG_PublisherPublicKeyDigest, 0, 0); // <PublisherPublicKeyDigest />
   written += AppendCloser (start);                                     // </SignedInfo>
 
-  written += AppendBlockHeader (start, CCN_DTAG_Content, CCN_DTAG); // <Content>
+  written += AppendBlockHeader (start, Ccnx::CCN_DTAG_Content, Ccnx::CCN_DTAG); // <Content>
 
   // there is no closing tag !!!
   return written;
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/model/ccnx-content-object-header.cc b/model/ccnx-content-object-header.cc
index a3852a2..e567207 100644
--- a/model/ccnx-content-object-header.cc
+++ b/model/ccnx-content-object-header.cc
@@ -22,7 +22,8 @@
 #include "ccnx-content-object-header.h"
 
 #include "ns3/log.h"
-#include "ns3/ccnx-coding-helper.h"
+#include "ns3/ccnx-encoding-helper.h"
+#include "ns3/ccnx-decoding-helper.h"
 
 NS_LOG_COMPONENT_DEFINE ("CcnxContentObjectHeader");
 
@@ -64,19 +65,19 @@
   // Unfortunately, two serializations are required, unless we can pre-calculate header length... which is not trivial
   Buffer tmp;
   
-  return CcnxCodingHelper::Serialize (tmp.Begin(), *this);
+  return CcnxEncodingHelper::Serialize (tmp.Begin(), *this);
 }
     
 void
 CcnxContentObjectHeader::Serialize (Buffer::Iterator start) const
 {
-  CcnxCodingHelper::Serialize (start, *this);
+  CcnxEncodingHelper::Serialize (start, *this);
 }
 
 uint32_t
 CcnxContentObjectHeader::Deserialize (Buffer::Iterator start)
 {
-  return 0; // the most complicated part is here
+  return CcnxDecodingHelper::Deserialize (start, *this); // \todo Debugging is necessary
 }
   
 TypeId
@@ -101,7 +102,7 @@
 TypeId
 CcnxContentObjectTail::GetTypeId (void)
 {
-  static TypeId tid = TypeId ("ns3::CcnxContentObjectHeader")
+  static TypeId tid = TypeId ("ns3::CcnxContentObjectTail")
     .SetParent<Header> ()
     .AddConstructor<CcnxContentObjectHeader> ()
     ;
@@ -139,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-interest-header.cc b/model/ccnx-interest-header.cc
index cab33ea..02ad9af 100644
--- a/model/ccnx-interest-header.cc
+++ b/model/ccnx-interest-header.cc
@@ -26,7 +26,8 @@
 #include "ccnx-interest-header.h"
 
 #include "ns3/log.h"
-#include "ns3/ccnx-coding-helper.h"
+#include "ns3/ccnx-encoding-helper.h"
+#include "ns3/ccnx-decoding-helper.h"
 
 NS_LOG_COMPONENT_DEFINE ("CcnxInterestHeader");
 
@@ -171,19 +172,19 @@
   // unfortunately, 2 serialization required...
   Buffer tmp;
   
-  return CcnxCodingHelper::Serialize (tmp.Begin(), *this);
+  return CcnxEncodingHelper::Serialize (tmp.Begin(), *this);
 }
     
 void
 CcnxInterestHeader::Serialize (Buffer::Iterator start) const
 {
-  CcnxCodingHelper::Serialize (start, *this);
+  CcnxEncodingHelper::Serialize (start, *this);
 }
 
 uint32_t
 CcnxInterestHeader::Deserialize (Buffer::Iterator start)
 {
-  return 0; // the most complicated part is here
+  return CcnxDecodingHelper::Deserialize (start, *this); // \todo Debugging is necessary
 }
 
 TypeId
diff --git a/model/ccnx.h b/model/ccnx.h
index 12c45d2..1e1aa0b 100644
--- a/model/ccnx.h
+++ b/model/ccnx.h
@@ -161,6 +161,155 @@
    * ignored during Ccnx forwarding.
    */
   virtual void SetDown (uint32_t face) = 0;
+
+public:
+    /**
+   * 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
+  };
 };
 
 } // namespace ns3 
diff --git a/model/name-components.h b/model/name-components.h
index d9b3f0a..0ea4821 100644
--- a/model/name-components.h
+++ b/model/name-components.h
@@ -36,7 +36,11 @@
   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;
@@ -70,6 +74,12 @@
   return m_prefix.size ();
 }
   
+void
+Components::Add (const std::string &s)
+{
+  (*this) (s);
+}
+  
   
 } // Namespace Name
 } // namespace ns3
