problems with netanim

1,040 views
Skip to first unread message

hison...@gmail.com

unread,
Jan 12, 2015, 3:12:31 AM1/12/15
to ns-3-...@googlegroups.com
Have anybody meet the problems of "segment fault(core dump)" when use netanim to open a xml file?I use the ns-3.21.
I am sure that the program is ok.Does the netanim has some bug with ns-3.21?
Thx for anybody's answer.

John Abraham

unread,
Jan 12, 2015, 8:41:46 AM1/12/15
to ns-3-...@googlegroups.com
can you paste the xml file you used?
Further are you using the latest edition of NetAnim


--
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ns-3-users+...@googlegroups.com.
To post to this group, send email to ns-3-...@googlegroups.com.
Visit this group at http://groups.google.com/group/ns-3-users.
For more options, visit https://groups.google.com/d/optout.

L Lemon

unread,
Jan 12, 2015, 9:14:37 AM1/12/15
to ns-3-...@googlegroups.com
OK,I use the netanim-3.105.I know someone else use ns-3.18 and it is ok but I have try to use it.

--
You received this message because you are subscribed to a topic in the Google Groups "ns-3-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ns-3-users/cWwz-zK8MLs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ns-3-users+...@googlegroups.com.
wifi-wired-bridged4.xml

John Abraham

unread,
Jan 12, 2015, 11:12:49 AM1/12/15
to ns-3-...@googlegroups.com
thats interesting the xml is missing the header information about nodes

Typically it starts with something like

<anim ver="netanim-3.105" >

<node id="0" sysId="0" locX="0" locY="0" >

<node id="1" sysId="0" locX="20" locY="0" >

<node id="2" sysId="0" locX="0" locY="5" >

<node id="3" sysId="0" locX="0" locY="10" >

<node id="4" sysId="0" locX="20" locY="5" >

<node id="5" sysId="0" locX="20" locY="10" >

<nu p="c" t="0" id="0" r="255" g="0" b="0" >

<nu p="c" t="0" id="1" r="255" g="0" b="0" >

<nu p="c" t="0" id="2" r="255" g="0" b="0" >

<nu p="c" t="0" id="3" r="255" g="0" b="0" >

<nu p="c" t="0" id="4" r="255" g="0" b="0" >

<nu p="c" t="0" id="5" r="255" g="0" b="0" >


but yours starts directly with node update with declaring the nodes.

<anim ver="netanim-3.105" >

<ncs ncId="0" n="RemainingEnergy" t="DOUBLE" >

<nu p="d" t="0" id="0" descr="h1-0" >

<nu p="c" t="0" id="0" r="255" g="0" b="0" >

<nu p="d" t="0" id="1" descr="h2-1" >

<nu p="c" t="0" id="1" r="255" g="0" b="0" >

<nu p="d" t="0" id="2" descr="s1-2" >

<nu p="c" t="0" id="2" r="0" g="0" b="255" >

<nu p="d" t="0" id="3" descr="s2-3" >

<nu p="c" t="0" id="3" r="0" g="0" b="255" >

<nu p="d" t="0" id="4" descr="s3-4" >

<nu p="c" t="0" id="4" r="0" g="0" b="255" >



Did you edit the xml directly?

L Lemon

unread,
Jan 12, 2015, 8:07:33 PM1/12/15
to ns-3-...@googlegroups.com
Thank you for your reply,but I'm not familiar with xml,I did not edit the xml.
I just use "    anim = ns.netanim.AnimationInterface("/tmp/xml/wifi-wired-bridged4.xml")
    anim.EnablePacketMetadata (True)" to generate the xml file and update the nodes and color.
some of the code like follows:
    rv = os.path.isdir("/tmp/xml")
    if rv is False:
        os.mkdir("/tmp/xml")    
    anim = ns.netanim.AnimationInterface("/tmp/xml/wifi-wired-bridged4.xml")
    anim.EnablePacketMetadata (True)
    
    for n in nodes:
        nodename = n.get('name', None)
        nodetype = n.get('type', None)
        nodemob = n.get('mobility', None)
        nodepos = n.get('position', None)
        nodevel = n.get('velocity', None)
        nodeip = n.get('ip', None)
        if nodetype is 'host':
            addfunc = net.addHost
            color = (255, 0, 0)
        elif nodetype is 'switch':
            addfunc = net.addSwitch
            color = (0, 0, 255)
        else:
            addfunc = None
        if nodename is None or addfunc is None: 
            continue
        node = addfunc (nodename, ip=nodeip)
        mininet.ns3.setMobilityModel (node, nodemob)
        if nodepos is not None:
            mininet.ns3.setPosition (node, nodepos[0], nodepos[1], nodepos[2])
        if nodevel is not None:
            mininet.ns3.setVelocity (node, nodevel[0], nodevel[1], nodevel[2])
        wifinodes.append (node)
        anim.UpdateNodeDescription (node.nsNode, nodename+'-'+str(node.nsNode.GetId()))
        anim.UpdateNodeColor (node.nsNode, color[0], color[1], color[2])
It seems the update procedure is inconsistent.

John Abraham

unread,
Jan 12, 2015, 10:01:47 PM1/12/15
to ns-3-...@googlegroups.com
another way this might happen is that the nodes are created after the AnimationInterface object is created
usually AnimationInterface is created as close as possible to Simulator::Run()


L Lemon

unread,
Jan 13, 2015, 3:07:01 AM1/13/15
to ns-3-...@googlegroups.com
It really is the case!I add the AnimationInterface after the creating of nodes and it runs OK now.The same case is the pcap files.Both of them should be created as close as possible to the Simulator::Run().
Thank you very much for your help!
Reply all
Reply to author
Forward
0 new messages