Multiple IPs on Node question

145 views
Skip to first unread message

Teodora Cucu

unread,
Jun 10, 2014, 1:52:21 AM6/10/14
to ns-3-...@googlegroups.com
Hello,

I am currently modifying an existing TCP variant to suit a particular protocol in NS-3, and while i have come to about 50% understanding of NS-3, i find myself confused on a matter. It is probably a nub question, but i have searched the documentation and did not find an answer. 

If i have a Node with multiple IPv4 addresses allocated on an interface, can i get the secondary addresses of that Node at the transport layer, without passing all the addresses when creating a connected oriented socket ? If so, how?

Tommaso Pecorella

unread,
Jun 10, 2014, 2:58:02 AM6/10/14
to ns-3-...@googlegroups.com
Hi,

no, you can't. The actual address used for a TCP socket is the "best" one. The "best" is chosen trying to use a local network first, then the routing tables.
As a result, if you want to forcefully use a particular outgoing interface and IpP address, you have to bind the socket manually.

Note that this is also the "normal" computer behaviour.

Hope this helps,

T.

Teodora Cucu

unread,
Jun 10, 2014, 3:24:15 AM6/10/14
to ns-3-...@googlegroups.com
Hmmm well let's say i am modifying the socket API completely, so it's not a TCP socket anymore. Basically i want to initially "bind" a socket to a known ip address of a peer Node, but after that at some point in the transport protocol i want to have access to the other ips that the initial Node currently has, without the application knowing about it, and manage those at the transport layer. 

To be more specific, the question sounds something like "Can i access those other ip addresses assigned to the Node at the transport layer, without the one that i used to bind the socket (which of course i know i can)? Do i have to pass them like the IP i used to bind the socket, or there is a way to simply get them at the transport layer?"


--
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/2-lzBlHyFTg/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.

Tommaso Pecorella

unread,
Jun 10, 2014, 4:24:38 PM6/10/14
to ns-3-...@googlegroups.com
I love when stuff is being made complex to hide the true question. Just say it, it's easier than you think.
MP-TCP, you're trying to do something similar.

Yes, you can. Tcp can access the IP object and inspect the IP addresses assigned to each interface.
Check the methods provided by Ipv4L3Protocol


T.

Teodora Cucu

unread,
Jun 10, 2014, 6:47:10 PM6/10/14
to ns-3-...@googlegroups.com
Actually it's SCTP :) And thanks! Helps a lot

Konstantinos

unread,
Jun 11, 2014, 4:26:17 AM6/11/14
to ns-3-...@googlegroups.com
I think that you have to define a new type of endpoint. Even in SCTP, when you start the association (connection) you should identify which IP/Ports will be used as primary/secondary. So SCTP knows them beforehand, it does not use some random (at least the default implementation).
To unsubscribe from this group and all its topics, send an email to ns-3-users+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages