How to set packet color in NetAnim inside ns3

168 Views Asked by At
AnimationInterface anim("DDoSim.xml");

ns3::AnimationInterface::SetConstantPosition(nodes.Get(0), 0, 0);
ns3::AnimationInterface::SetConstantPosition(nodes.Get(1), 10, 10);
ns3::AnimationInterface::SetConstantPosition(nodes.Get(2), 23, 10);
anim.UpdateNodeColor(nodes.Get(0), 0, 0, 255);

uint32_t x_pos = 0;
for (int l = 0; l < NUMBER_OF_BOTS; ++l)
{
    ns3::AnimationInterface::SetConstantPosition(botNodes.Get(l), x_pos++, 30);
}

Simulation image

By default all the packets in the simulation are shown in blue color. I want the packet originating from node 0 in the simulation to be shown with different color than originating from botnodes, show that it can be easily seen which packets are from node0 and which are from botNodes.

Is there any way I can achieve this?

1

There are 1 best solutions below

1
Vishal Sinha On

There is no way you can do so. You can only change the color of nodes, but not packets.