diff --git a/include/sync-logic.h b/include/sync-logic.h
index 551cb06..5e32918 100644
--- a/include/sync-logic.h
+++ b/include/sync-logic.h
@@ -101,7 +101,7 @@
    * @param name the data name
    * @param dataBuffer the sync data
    */
-  void respondSyncData (const std::string &name, const std::string &dataBuffer);
+  void respondSyncData (const std::string &name, const char *wireData, size_t len);
 
   /**
    * @brief remove a participant's subtree from the sync tree
@@ -133,7 +133,7 @@
 
   void
   processSyncData (const std::string &name,
-                   DigestConstPtr digest, const std::string &dataBuffer);
+                   DigestConstPtr digest, const char *wireData, size_t len);
   
   void
   processSyncRecoveryInterest (const std::string &name,
diff --git a/include/sync-state.h b/include/sync-state.h
index c96160e..84c2400 100644
--- a/include/sync-state.h
+++ b/include/sync-state.h
@@ -93,7 +93,7 @@
  * @returns SyncStateMsg msg
  */
 SyncStateMsg &
-operator >> (SyncStateMsg &issm, const State &state);
+operator >> (SyncStateMsg &issm, State &state);
 
 namespace Error {
 /**
diff --git a/model/sync-logic.cc b/model/sync-logic.cc
index 943126b..b72a061 100644
--- a/model/sync-logic.cc
+++ b/model/sync-logic.cc
@@ -29,6 +29,7 @@
 #include "sync-diff-leaf.h"
 #include "sync-full-leaf.h"
 #include "sync-log.h"
+#include "sync-state.h"
 
 #include <boost/make_shared.hpp>
 #include <boost/foreach.hpp>
@@ -278,10 +279,10 @@
 
       DiffState diff;
       SyncStateMsg msg;
-      if (!msg.parseFromArray(wireData, len) || !msg.IsInitialized()) 
+      if (!msg.ParseFromArray(wireData, len) || !msg.IsInitialized()) 
       {
         //Throw
-        BOOST_THROW_EXCEPTION (SyncStateMsgDecodingFailure () << info_str ("Can not decode data"));
+        BOOST_THROW_EXCEPTION (Error::SyncStateMsgDecodingFailure () );
       }
       msg >> diff;
 
@@ -526,11 +527,12 @@
   // sending
   SyncStateMsg ssm;
   ssm << (*state);
-  char *wireData = new char[ssm.size()];
-  ssm.SerializedToArray(wireData, ssm.size());
+  int size = ssm.ByteSize();
+  char *wireData = new char[size];
+  ssm.SerializeToArray(wireData, size);
   m_ccnxHandle->publishRawData (name,
                              wireData,
-                             ssm.size(),
+                             size,
                              m_syncResponseFreshness); // in NS-3 it doesn't have any effect... yet
   delete wireData;
 
diff --git a/model/sync-state.cc b/model/sync-state.cc
index 45a7ab7..137e8b0 100644
--- a/model/sync-state.cc
+++ b/model/sync-state.cc
@@ -74,9 +74,9 @@
 {
   BOOST_FOREACH (shared_ptr<const Leaf> leaf, state.getLeaves ().get<ordered> ())
   {
-    SyncState *oss = ossm->add_ss();
+    SyncState *oss = ossm.add_ss();
     shared_ptr<const DiffLeaf> diffLeaf = dynamic_pointer_cast<const DiffLeaf> (leaf);
-    if (diffLeaf != 0 && diffLeaf->getOperation != UPDATE)
+    if (diffLeaf != 0 && diffLeaf->getOperation() != UPDATE)
     {
       oss->set_type(SyncState::DELETE);
     }
@@ -91,10 +91,9 @@
 
     if (diffLeaf == 0 || (diffLeaf != 0 && diffLeaf->getOperation () == UPDATE))
     {
-      SyncState::SeqNo seqNo;
-      seqNo->set_session(leaf->getSeq()->getSession());
-      seqNo->set_seq(leaf->getSeq()->getSeq());
-      oss->set_seqNo(seqNo);
+      SyncState::SeqNo *seqNo = oss->mutable_seqno();
+      seqNo->set_session(leaf->getSeq().getSession());
+      seqNo->set_seq(leaf->getSeq().getSeq());
     }
   }
   return ossm;
@@ -150,7 +149,7 @@
 */
 
 SyncStateMsg &
-operator >> (SyncStateMsg &issm, const State &state)
+operator >> (SyncStateMsg &issm, State &state)
 {
   int n = issm.ss_size();
   for (int i = 0; i < n; i++)
@@ -159,10 +158,10 @@
     NameInfoConstPtr info = StdNameInfo::FindOrCreate (ss.name());
     if (ss.type() == SyncState::UPDATE)
     {
-      state.update(info, SeqNo(
-                                lexical_cast<uint32_t> (ss.seqNo().session()),
-                                lexical_cast<uint32_t> (ss.seqNo().seq()),
-                                ));
+      uint32_t session = lexical_cast<uint32_t>(ss.seqno().session());
+      uint32_t seq = lexical_cast<uint32_t>(ss.seqno().seq());
+      SeqNo seqNo(session, seq);
+      state.update(info, seqNo);
     }
     else
     {
diff --git a/proto/sync-state.proto b/sync-state.proto
similarity index 91%
rename from proto/sync-state.proto
rename to sync-state.proto
index 71bd1e7..18892fb 100644
--- a/proto/sync-state.proto
+++ b/sync-state.proto
@@ -15,7 +15,7 @@
     required uint32 seq = 1;
     required uint32 session = 2;
   }
-  optional SeqNo seqNo = 3;
+  optional SeqNo seqno = 3;
 }
 
 message SyncStateMsg
diff --git a/test/test_state.cc b/test/test_state.cc.outdated
similarity index 100%
rename from test/test_state.cc
rename to test/test_state.cc.outdated
diff --git a/waf-tools/protobuf.py b/waf-tools/protobuf.py
new file mode 100644
index 0000000..71d8bdf
--- /dev/null
+++ b/waf-tools/protobuf.py
@@ -0,0 +1,76 @@
+#! /usr/bin/env python
+# encoding: utf-8
+
+'''
+
+When using this tool, the wscript will look like:
+
+	def options(opt):
+	        opt.tool_options('protobuf', tooldir=["waf-tools"])
+
+	def configure(conf):
+		conf.load('compiler_cxx protobuf')
+
+	def build(bld):
+		bld(source='main.cpp', target='app', use='PROTOBUF')
+
+Options are generated, in order to specify the location of protobuf includes/libraries.
+
+
+'''
+import sys
+import re
+from waflib import Utils,Logs,Errors
+from waflib.Configure import conf
+PROTOBUF_DIR=['/usr','/usr/local','/opt/local','/sw']
+PROTOBUF_VERSION_FILE='google/protobuf/stubs/common.h'
+PROTOBUF_VERSION_CODE='''
+#include <iostream>
+#include <google/protobuf/stubs/common.h>
+int main() { std::cout << GOOGLE_PROTOBUF_VERSION ;}
+'''
+
+def options(opt):
+	opt.add_option('--protobuf',type='string',default='',dest='protobuf_dir',help='''path to where protobuf is installed, e.g. /usr/local''')
+@conf
+def __protobuf_get_version_file(self,dir):
+	try:
+		return self.root.find_dir(dir).find_node('%s/%s' % ('include', PROTOBUF_VERSION_FILE))
+	except:
+		return None
+@conf
+def protobuf_get_version(self,dir):
+	val=self.check_cxx(fragment=PROTOBUF_VERSION_CODE,includes=['%s/%s' % (dir, 'include')], execute=True, define_ret = True, mandatory=True)
+	return val
+@conf
+def protobuf_get_root(self,*k,**kw):
+	root=k and k[0]or kw.get('path',None)
+	# Logs.pprint ('RED', '   %s' %root)
+	if root and self.__protobuf_get_version_file(root):
+		return root
+	for dir in PROTOBUF_DIR:
+		if self.__protobuf_get_version_file(dir):
+			return dir
+	if root:
+		self.fatal('Protobuf not found in %s'%root)
+	else:
+		self.fatal('Protobuf not found, please provide a --protobuf argument (see help)')
+@conf
+def check_protobuf(self,*k,**kw):
+	if not self.env['CXX']:
+		self.fatal('load a c++ compiler first, conf.load("compiler_cxx")')
+
+	var=kw.get('uselib_store','PROTOBUF')
+	self.start_msg('Checking Protocol Buffer')
+	root = self.protobuf_get_root(*k,**kw);
+	self.env.PROTOBUF_VERSION=self.protobuf_get_version(root)
+
+	self.env['INCLUDES_%s'%var]= '%s/%s' % (root, "include");
+	self.env['LIB_%s'%var] = "protobuf"
+	self.env['LIBPATH_%s'%var] = '%s/%s' % (root, "lib")
+
+	self.end_msg(self.env.PROTOBUF_VERSION)
+	if Logs.verbose:
+		Logs.pprint('CYAN','	Protocol Buffer include : %s'%self.env['INCLUDES_%s'%var])
+		Logs.pprint('CYAN','	Protocol Buffer lib     : %s'%self.env['LIB_%s'%var])
+		Logs.pprint('CYAN','	Protocol Buffer libpath : %s'%self.env['LIBPATH_%s'%var])
diff --git a/waf-tools/tinyxml.py b/waf-tools/tinyxml.py
deleted file mode 100644
index 3908b38..0000000
--- a/waf-tools/tinyxml.py
+++ /dev/null
@@ -1,76 +0,0 @@
-#! /usr/bin/env python
-# encoding: utf-8
-
-'''
-
-When using this tool, the wscript will look like:
-
-	def options(opt):
-	        opt.tool_options('tinyxml', tooldir=["waf-tools"])
-
-	def configure(conf):
-		conf.load('compiler_cxx tiny')
-
-	def build(bld):
-		bld(source='main.cpp', target='app', use='TINYXML')
-
-Options are generated, in order to specify the location of tinyxml includes/libraries.
-
-
-'''
-import sys
-import re
-from waflib import Utils,Logs,Errors
-from waflib.Configure import conf
-TINYXML_DIR=['/usr','/usr/local','/opt/local','/sw']
-TINYXML_VERSION_FILE='tinyxml.h'
-TINYXML_VERSION_CODE='''
-#include <iostream>
-#include <tinyxml.h>
-int main() { std::cout << TIXML_MAJOR_VERSION << "." << TIXML_MINOR_VERSION << "." << TIXML_PATCH_VERSION; }
-'''
-
-def options(opt):
-	opt.add_option('--tinyxml',type='string',default='',dest='tinyxml_dir',help='''path to where TinyXML is installed, e.g. /usr/local''')
-@conf
-def __tinyxml_get_version_file(self,dir):
-	try:
-		return self.root.find_dir(dir).find_node('%s/%s' % ('include', TINYXML_VERSION_FILE))
-	except:
-		return None
-@conf
-def tinyxml_get_version(self,dir):
-	val=self.check_cxx(fragment=TINYXML_VERSION_CODE,includes=['%s/%s' % (dir, 'include')], execute=True, define_ret = True, mandatory=True)
-	return val
-@conf
-def tinyxml_get_root(self,*k,**kw):
-	root=k and k[0]or kw.get('path',None)
-	# Logs.pprint ('RED', '   %s' %root)
-	if root and self.__tinyxml_get_version_file(root):
-		return root
-	for dir in TINYXML_DIR:
-		if self.__tinyxml_get_version_file(dir):
-			return dir
-	if root:
-		self.fatal('TinyXML not found in %s'%root)
-	else:
-		self.fatal('TinyXML not found, please provide a --tinyxml argument (see help)')
-@conf
-def check_tinyxml(self,*k,**kw):
-	if not self.env['CXX']:
-		self.fatal('load a c++ compiler first, conf.load("compiler_cxx")')
-
-	var=kw.get('uselib_store','TINYXML')
-	self.start_msg('Checking TinyXML')
-	root = self.tinyxml_get_root(*k,**kw);
-	self.env.TINYXML_VERSION=self.tinyxml_get_version(root)
-
-	self.env['INCLUDES_%s'%var]= '%s/%s' % (root, "include");
-	self.env['LIB_%s'%var] = "tinyxml"
-	self.env['LIBPATH_%s'%var] = '%s/%s' % (root, "lib")
-
-	self.end_msg(self.env.TINYXML_VERSION)
-	if Logs.verbose:
-		Logs.pprint('CYAN','	TinyXML include : %s'%self.env['INCLUDES_%s'%var])
-		Logs.pprint('CYAN','	TinyXML lib     : %s'%self.env['LIB_%s'%var])
-		Logs.pprint('CYAN','	TinyXML libpath : %s'%self.env['LIBPATH_%s'%var])
diff --git a/wscript b/wscript
index df97940..c87bf89 100644
--- a/wscript
+++ b/wscript
@@ -13,7 +13,7 @@
     opt.load('compiler_cxx')
     opt.load('boost')
     opt.load('doxygen')
-    opt.load('ccnx tinyxml ns3', tooldir=["waf-tools"])
+    opt.load('ccnx protobuf ns3', tooldir=["waf-tools"])
 
 def configure(conf):
     conf.load("compiler_cxx")
@@ -61,10 +61,18 @@
     except:
         pass
 
-    conf.load('tinyxml')
-    conf.check_tinyxml ()
+    conf.load('protobuf')
+    conf.check_protobuf (path=conf.options.protobuf_dir)
                    
+
+def pre(bld):
+  bld.exec_command('protoc --cpp_out=. sync-state.proto')
+  bld.exec_command('mv sync-state.pb.h include/')
+  bld.exec_command('mv sync-state.pb.cc model/')
+
 def build (bld):
+    bld.add_pre_fun(pre)
+
     if bld.get_define ("NS3_MODULE"):
         sync_ns3 = bld.shlib (
             target = "sync-ns3",
@@ -91,8 +99,9 @@
                 'model/sync-seq-no.cc',
                 'model/sync-state.cc',
                 'model/sync-std-name-info.cc',
+                'model/sync-state.pb.cc',
                 ],
-            use = 'BOOST BOOST_IOSTREAMS SSL TINYXML ' + ' '.join (['ns3_'+dep for dep in ['core', 'network', 'internet', 'NDNabstraction']]).upper (),
+            use = 'BOOST BOOST_IOSTREAMS SSL PROTOBUF ' + ' '.join (['ns3_'+dep for dep in ['core', 'network', 'internet', 'NDNabstraction']]).upper (),
             includes = ['include', 'include/ns3', 'helper'],
             )
 
@@ -139,8 +148,9 @@
                 'model/sync-seq-no.cc',
                 'model/sync-state.cc',
                 'model/sync-std-name-info.cc',
+                'model/sync-state.pb.cc',
                 ],
-            use = 'BOOST BOOST_IOSTREAMS BOOST_THREAD SSL TINYXML CCNX',
+            use = 'BOOST BOOST_IOSTREAMS BOOST_THREAD SSL PROTOBUF CCNX',
             includes = ['include', 'helper'],
             )
         
