[Ns-bugs] [Bug 742] Implementation of SO_BINDTODEVICE
code at nsnam.ece.gatech.edu
Tue Nov 17 22:51:57 PST 2009
--- Comment #2 from Tom Henderson <tomh at tomh.org> 2009-11-18 01:51:56 EDT ---
(In reply to comment #0)
> Created an attachment (id=657)
--> (http://www.nsnam.org/bugzilla/attachment.cgi?id=657) [details]
> Patch to allow bindsockopts
> As per discussion at
> Here's first draft version of getting SO_BINDTODEVICE to work. It currently
> works only on UDP sockets, and only on sending side.
> TODO: Receiving side
do you have any sense of whether the receiving side will be easily achieved
(since input processing may not have visibility of this socket option at the IP
layer, or the routing protocol processing "RouteInput" may not know)?
> TCP sockets
> RAW sockets
> However, while patch is not that complicated, it affects lots of files, as it
> changes the so far pretty unused uint32_t oif in RouteOutput to Ptr<NetDevice>
> instead - and as a consequence, every inherited routing protocol and all
> methods that have called RouteOutput in it's previous format.
> For now, Static and Global Routing protocols actually utilize the new oif
> information. Thus, the provided example works, but right now socket doesn't
> check if arrived packet came in on right interface. As it stands, the patch
> shouldn't BREAK anything, it's just that the added functionality isn't yet
> quite complete...
> Since there's a lot of changes throughout the tree (node, internet-stack and
> routing), I'm hoping that this can be merged relatively quickly so I don't have
> to keep recreating the diffs against newer snapshots of ns-3-dev...
> The beef is in socket.cc where two methods have been added for binding a device
> and checking the value. You can release the binding by binding to zero. Example
> illustrates the workings quite well.
> CCing Tom due to him participating in the thread on mailing list.
I support adding the function and the new socket API, and would support merging
what you have now while leaving the bug open to complete the functionality.
You hit all of the points I was looking for in the review (v6 support,
doxygen-- although note that you could add the point about releasing the
binding to the doxygen). I do have the concern about how to support on the
An alternative to changing RouteOutput would be to start assigning ip interface
indexes from 1 instead of zero, but I think it is probably better to change
RouteOutput to take a NetDevice pointer since protocols in general will need to
add support for this (most have ignored this parameter), and it will not cause
soft failures for users.
Configure bugmail: http://www.nsnam.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the Ns-bugs