Query regarding NeST TopologyMap

52 views
Skip to first unread message

Abhinaba Rakshit

unread,
Mar 8, 2022, 10:04:11 AM3/8/22
to NeST users
Hello, 

While creating the topology we make use of the TopologyMap class, to store the Topology. In the Node() constructor call, we add the namespaces to the TopologyMap (node.py... line 70 and 71).
However, how the interfaces are added in the TopologyMap, and orphan_interfaces are created, I could not find. If you can help me with this? 
Below I attached the function which is used to add the interfaces to the topology, However, I could not find any function call to it?
Screenshot from 2022-03-08 20-02-21.png

Shanthanu Rai

unread,
Mar 8, 2022, 11:34:51 AM3/8/22
to Abhinaba Rakshit, NeST users
Hey Abhinaba, interfaces are added in files device.py, ifb.py and veth_end.py files in nest/topology folder.

Let me know in case you can't find them, I can point to the exact line numbers. 

PS: I recommend using Ctrl+Shift+F shortcut in vs code. Using this, you can find all places "add_interface" function is used. 

--
You received this message because you are subscribed to the Google Groups "NeST users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nest-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nest-users/b46ee97f-dc79-4ded-8cb6-2d1b628336f1n%40googlegroups.com.

Abhinaba Rakshit

unread,
Mar 14, 2022, 12:45:44 PM3/14/22
to NeST users
Thank you, 

I, found the calls to .add_interface in of the TopologyMap,

However, on looking further, I tried to figure out how the map is created, especially how the interfaces are added into the TopologyMap,

I observed [connect -> Interface(initializer) -> VethEnd(initializer) -> Device(initializer) -> (if node_id is not None)add_interface]

However, in my case "node_id is set to None"

I, tried checking the number of orphan_interfaces created after function call 'connect' in a test program(attached below).

It outputs as 2  (attached below).

However, I didn't find any possible function call, to add_interface which sets orphan_interface to 2

If, you can help in the how its is initialised to 2,?That would really help.
Thank you
Abhinaba
query2.png

Shanthanu Rai

unread,
Mar 15, 2022, 2:33:19 AM3/15/22
to Abhinaba Rakshit, NeST users
Hey, the `orphan_interfaces` variable is being incremented in add_interface function itself: https://gitlab.com/nitk-nest/nest/blob/master/nest/topology_map.py#L123



--
Regards,
Shanthanu S Rai
Reply all
Reply to author
Forward
0 new messages