Assign IP Address

51 views
Skip to first unread message

Adnan Salahuddin

unread,
Jun 14, 2021, 11:40:18 AM6/14/21
to ns-3-users
Hi folks,

We have created two nodes and I want to assign two ip addresses. 

Node1 is 104.44.224.48 
Node2 is 104.44.224.49

Any idea?

Thanks in advance. 

Parth Pratim Chatterjee

unread,
Jun 17, 2021, 2:25:50 PM6/17/21
to ns-3-users
Hello,

As, far as I understand(please correct me if I'm wrong), technically a node doesn't have an ip address, it's the network device installed on the node which has properties like an ip address or a MAC address. So, you would have to create a NetDevice instance of the type of net device(there a lot a options, P2P, Csma, Wifi, etc.) you would want to install on the Node and then choose the type of address you would want to assign(I see it's IPv4 in your case), and then set it all in there. Lastly, assign the address to the netdevice, which would indirectly get assigned to your Node. 

Please have a loot at these two documents : 


Also, you could possibly aggregate an Ipv4(just an example) stack to a Node pointer.

Please check this document the manual too :

Thank You,
Parth Pratim Chatterjee

Tom Henderson

unread,
Jun 17, 2021, 2:52:14 PM6/17/21
to ns-3-...@googlegroups.com
--
Posting to this group should follow these guidelines https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
---
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 view this discussion on the web visit https://groups.google.com/d/msgid/ns-3-users/bfedef16-be87-45c5-a667-4495b88791abn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages