I notice that in ndnSIM2.7, source code ndn-stack-helper.cpp, the implementation of Install() is different from that of ndnSIM2.6.<br><br>In ndnSIM2.7, a DoInstall() is called by Simulator::SchedulerWithContext(),  which does the same thing as Install() function in ndnSIM2.6. And ProcessWarmupEvents() runs Simulator::Run(). What's the difference between here and the example file's Simulator::Run()?<br><br>Since Simulator::Run() in function ProcessWarmupEvents() invokes Node::DoInitialize(), I wonder if that might be the reason traffic-control-layer cannot be initialized correctly, because it's aggregated to a node after the node's DoInitialize() is called.<p>At2019-04-21 10:42:33,<a href="mailto:yao930@mail.ustc.edu.cn">yao930@mail.ustc.edu.cn</a>wrote:</p><blockquote name="replyContent" style="padding-left: 1ex;margin: 0 0 0 0.8ex;border-left: 1px solid #ccc;"><div><span style="color: rgb(34, 34, 34); font-family: Arial, Helvetica, sans-serif; font-size: 13px;">Hello all,</span><div style="margin: 0px; padding: 0px; border: 0px; color: rgb(34, 34, 34); font-family: Arial, Helvetica, sans-serif; font-size: 13px;"><br></div><div style="margin: 0px; padding: 0px; border: 0px; color: rgb(34, 34, 34); font-family: Arial, Helvetica, sans-serif; font-size: 13px;">I am doing experiment with ndnSIM2.7, and I want to use traffic control model in ns-3 to help realize queue scheduling. </div><div style="margin: 0px; padding: 0px; border: 0px; color: rgb(34, 34, 34); font-family: Arial, Helvetica, sans-serif; font-size: 13px;"><br></div><span style="color: rgb(34, 34, 34); font-family: Arial, Helvetica, sans-serif; font-size: 13px;">I tried to aggregate a traffic-control-layer model on a node by modifying </span><i style="color: rgb(34, 34, 34); font-family: Arial, Helvetica, sans-serif; font-size: 13px;">ndn-stack-helper.cc DoInstall()</i><span style="color: rgb(34, 34, 34); font-family: Arial, Helvetica, sans-serif; font-size: 13px;"> like this:</span><br><div style="margin: 0px; padding: 0px; border: 0px; color: rgb(34, 34, 34); font-family: Arial, Helvetica, sans-serif; font-size: 13px;"><p class="p1">  ObjectFactory<span class="s1"> factory;</span></p></div><div style="margin: 0px; padding: 0px; border: 0px; color: rgb(34, 34, 34); font-family: Arial, Helvetica, sans-serif; font-size: 13px;">




<style type="text/css">
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; color: #005032}
p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; color: #2a00ff}
p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo}
span.s1 {color: #000000}
span.s2 {color: #005032}
</style>



<p class="p2"><span class="s1"><span class="Apple-converted-space">  </span>factory.SetTypeId (</span>"ns3::TrafficControlLayer"<span class="s1">);</span></p>
<p class="p3"><span class="Apple-converted-space">  </span><span class="s2">Ptr</span><<span class="s2">Object</span>> protocol = factory.Create <<span class="s2">Object</span>> ();</p>
<p class="p3"><span class="Apple-converted-space">  </span>node->AggregateObject (protocol);</p></div><div style="margin: 0px; padding: 0px; border: 0px; color: rgb(34, 34, 34); font-family: Arial, Helvetica, sans-serif; font-size: 13px;">which is similar to add a L3Protocol like this: <span style="color: rgb(0, 80, 50); font-family: Menlo; font-size: 12px;">node->AggregateObject(ndn)</span></div><div style="margin: 0px; padding: 0px; border: 0px; color: rgb(34, 34, 34); font-family: Arial, Helvetica, sans-serif; font-size: 13px;"><span style="color: rgb(0, 80, 50); font-family: Menlo; font-size: 12px;"><br></span></div>




<style type="text/css">
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo}
</style>


<div style="margin: 0px; padding: 0px; border: 0px; color: rgb(34, 34, 34); font-family: Arial, Helvetica, sans-serif; font-size: 13px;">But the traffic-control cannot start correctly, and later a SIGSEV error appeared.</div><div style="margin: 0px; padding: 0px; border: 0px; color: rgb(34, 34, 34); font-family: Arial, Helvetica, sans-serif; font-size: 13px;"><br></div><div style="margin: 0px; padding: 0px; border: 0px; color: rgb(34, 34, 34); font-family: Arial, Helvetica, sans-serif; font-size: 13px;">From logs I can't see traffic-control-layer's DoInitialize() being called, so I think that might be the reason of the error.</div><div style="margin: 0px; padding: 0px; border: 0px; color: rgb(34, 34, 34); font-family: Arial, Helvetica, sans-serif; font-size: 13px;"><br></div><div style="margin: 0px; padding: 0px; border: 0px; color: rgb(34, 34, 34); font-family: Arial, Helvetica, sans-serif; font-size: 13px;">After reading some documents and source code, now I understand the relationship between the function Initialize() and DoInitialize(), and Object and it's subclasses. Since ndnSIM simply starts the simulation like: <b>Simulator::Run(), </b>I am confused<b> </b>about when is all those Initialize work being done before starting simulation?</div><div style="margin: 0px; padding: 0px; border: 0px; color: rgb(34, 34, 34); font-family: Arial, Helvetica, sans-serif; font-size: 13px;"><br></div><div style="margin: 0px; padding: 0px; border: 0px; color: rgb(34, 34, 34); font-family: Arial, Helvetica, sans-serif; font-size: 13px;">Any hints would be really appreciated!</div><div style="margin: 0px; padding: 0px; border: 0px; color: rgb(34, 34, 34); font-family: Arial, Helvetica, sans-serif; font-size: 13px;"><br></div><div style="margin: 0px; padding: 0px; border: 0px; color: rgb(34, 34, 34); font-family: Arial, Helvetica, sans-serif; font-size: 13px;">Thanks advance~</div><div style="margin: 0px; padding: 0px; border: 0px; color: rgb(34, 34, 34); font-family: Arial, Helvetica, sans-serif; font-size: 13px;"><br></div><div style="margin: 0px; padding: 0px; border: 0px; color: rgb(34, 34, 34); font-family: Arial, Helvetica, sans-serif; font-size: 13px;">Sincerely,</div><div style="margin: 0px; padding: 0px; border: 0px; color: rgb(34, 34, 34); font-family: Arial, Helvetica, sans-serif; font-size: 13px;">Chris Chen</div></div></blockquote>