I want to use "ip rule" features in ns-3. Is there any library supported?

40 views
Skip to first unread message

Byoungheon Shin

unread,
Jan 2, 2017, 1:42:10 PM1/2/17
to ns-3-users
Hello,
I want to simulate a flow-based routing protocol which matches a flow (Src IP, Src Port, Dst IP, Dst Port).
To achieve this, I need to use Linux features like "ip rule" and "ip route" together. I think it is also the same as using iptables.

Because I am still a beginner of ns-3, I don't know what kind of libraries I can achieve above purposes.
Is there any library similar to "ip rule"?
So far, I can manually add routes using Ipv4StaticRouting pointer, but it cannot distinguish "source IP, source port, and destination port".
For example, I want to make routing table like this:

Src           SrcPort       Dst       DstPort    nextHop      ifIdx
------------------------------------------------------------------------------------------
10.1.1.1     *            10.1.2.3       22         10.1.1.6       0
10.1.1.1     *            10.1.2.3       80         10.1.2.5       1

Assuming that 10.1.1.1 has neighbors 10.1.1.6 and 10.1.2.5, and the source can differentiate routing paths based on any condition (usually flow) even if its destination is the same.

Any advise will be highly appreciated.
Best Regards,

-- Byoungheon Shin

Tommaso Pecorella

unread,
Jan 3, 2017, 4:39:16 PM1/3/17
to ns-3-users
Hi,

at the moment there's no routing protocol supporting the choice of route based on the destination (or source) ports.
In theory it could be possible to write one, but there's an enhancement to do before: the UDP and TCP ports should be passed to the routing protocol, and right now this is not done.

Cheers,

T.
Reply all
Reply to author
Forward
0 new messages