title: NS3 Custom Node and Packet Header
body: <p>In NS3, is it possible to create custom network Nodes and packet header? I need to implement some new nodes for my simulation (new kind of switches, SDN Controller, cloud controller, etc.) and also modify the network packet header to include some additional information. I am new to NS3 but I am familiar with C++. </p>
  
  <p>As for how to customize the network packet, I don't have any idea at all, and I am confuse where to start. But for creating custom nodes, I have read the tutorial book that all node are essentially derived from <code>Node</code> class (correct me if I'm wrong), so initially I imagined that I can just create my <code>CustomNode</code> class inheriting NS3's <code>Node</code> class like:</p>
  
  <pre><code>class CustomNode : Node { ... }
  </code></pre>
  
  <p>However, when I looked at the sample code, they provide many examples using <code>NodeContainer</code> helper used like:</p>
  
  <pre><code>NodeContainer container;
  container.Create (1);
  </code></pre>
  
  <p>As we can see in the code, there is only one argument in the function <code>create()</code> which is related to the total number of nodes to be created and no other argument nor template to specify the type of the Node. I wish I could do something like:</p>
  
  <pre><code>container.Create&lt;CustomNode&gt;(1);
  </code></pre>
  
  <p>or something like that. Could anyone please give me some hints in how to achieve my goals?</p>