Dummy IP address for a node

185 views
Skip to first unread message

Chinmay Naugaria

unread,
Apr 15, 2015, 5:59:38 AM4/15/15
to ns-3-...@googlegroups.com
Is it possible to assign a dummy IP address to a node which I can use as destination in OnOffHelper?

Konstantinos

unread,
Apr 15, 2015, 6:14:19 AM4/15/15
to ns-3-...@googlegroups.com
Hi,

What do you mean by dummy IP? All nodes are assigned with an IP address that can be used in OnOffHelper.
You can assign an extra IP (manually) to a node if you want. See the example in /examples/routing/static-routing-slash32.cc

Regards,
K.

Tommaso Pecorella

unread,
Apr 15, 2015, 6:14:31 AM4/15/15
to ns-3-...@googlegroups.com
dummy ?

If you can use as a destination, it's not dummy. Please refine your ideas.

T.

Chinmay Naugaria

unread,
Apr 15, 2015, 5:19:32 PM4/15/15
to ns-3-...@googlegroups.com
I wanted to add an extra IP address to the node without having to install the node on p2p,wifi etc.
Thanks, I will go through the code you mentioned.

--
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/enFERAHRwDg/unsubscribe.
To unsubscribe from this group and all its topics, 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.



--
Chinmay Naugaria
Final Year
Dual Degree
Electrical Engineering
IIT Madras
"It is the hottest fire, that forges the hardest steel"

Abraham Prabhakaran

unread,
Apr 22, 2015, 11:49:13 PM4/22/15
to ns-3-...@googlegroups.com
In IPv4 you can assign only one ip per interface and if u try to assign one more ip it will overwritten by interface.....but in IPv6 u can assign multiple ip per interface, u can try in ipv6.....



--
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.

Tommaso Pecorella

unread,
Apr 23, 2015, 3:04:50 AM4/23/15
to ns-3-...@googlegroups.com
Thanks for trying to clarify one point, but... 
You can assign as many IP address as you want, even with IPv4.

The manual shows how to add an arbitrary IPv6 address to an interface, but you can do the same with IPv4.

Just change IPv6 in IPv4 in the code below.  
Ptr<Node> n0 = CreateObject<Node> ();
NodeContainer net (n0);
CsmaHelper csma;
NetDeviceContainer ndc = csma.Install (net);


NS_LOG_INFO
("Specifically Assign an IPv6 Address.");
Ipv6AddressHelper ipv6;
Ptr<NetDevice> device = ndc.Get (0);
Ptr<Node> node = device->GetNode ();
Ptr<Ipv6> ipv6proto = node->GetObject<Ipv6> ();
int32_t ifIndex
= 0;
ifIndex
= ipv6proto->GetInterfaceForDevice (device);
Ipv6InterfaceAddress ipv6Addr = Ipv6InterfaceAddress (Ipv6Address ("2001:db8:f00d:cafe::42"), Ipv6Prefix (64));
ipv6proto
->AddAddress (ifIndex, ipv6Addr);


Cheers,

T.
Reply all
Reply to author
Forward
0 new messages