Bugzilla – Bug 1480
RouteOutput() header source address is always 102.102.102.102
Last modified: 2012-09-14 17:02:49 EDT
I am trying to develop an epidemic routing. I need to know the source address when a packet reaches RouteOutput()function. However, the header source address is always 102.102.102.102. I checked other routing protocols and they all have the same issue.
(In reply to comment #0) > I am trying to develop an epidemic routing. I need to know the source address > when a packet reaches RouteOutput()function. However, the header source address > is always 102.102.102.102. I checked other routing protocols and they all have > the same issue. All Ipv4Address objects are initialized to that value in the constructor: Ipv4Address::Ipv4Address () : m_address (0x66666666) { } so when you see this value appear in the program, you know that the Ipv4Address hasn't been provided a valid value yet. Now, regarding your problem, if you are trying to know the source address of the Ipv4Header passed into the RouteOutput() function, it will be uninitialized (i.e. it is "102.102.102.102"). Only the destination address will be set at this point in the code, and only the destination address should be used by the routing protocol (perhaps this should be made clearer in the Doxygen). Can your epidemic routing protocol determine the source address from the destination address that is passed in to RouteOutput (embedded in the Ipv4Header)?
First I would like to ask why the source address is not initialized at this point and the destination address is? Is ns-3 trying to follow the Linux functionality in this regard? For your question "Can your epidemic routing protocol determine the source address from the destination address that is passed in to RouteOutput (embedded in the Ipv4Header)?" I can not determine the source address from the destination address.
(In reply to comment #2) > First I would like to ask why the source address is not initialized at this > point and the destination address is? Is ns-3 trying to follow the Linux > functionality in this regard? Yes, this is similar to Linux's ip_route_output(). The source address is set once you have a route to the destination, based on the next hop for the packet corresponding to the route. > > > For your question "Can your epidemic routing protocol determine the source > address from the > destination address that is passed in to RouteOutput (embedded in the > Ipv4Header)?" > > I can not determine the source address from the destination address. What I mean here is whether you can find a route at this point in the code, just based on having a valid destination address. Once you have a route, you presumably have a next hop and can determine the matching source address. I'm not sure how your routing protocol works, but if it has to discover routes, it either needs to make an assumption about the outbound interface at this point in the code, or else defer this until a route is found (similar to how AODV works).
So, is there a way to determine that the packet is generated from the current node at the route output function?
(In reply to comment #4) > So, is there a way to determine that the packet is generated from the current > node at the route output function? The assumption is that the packet is generated from the current node; these functions are typically called from the transport protocols when sending data out.
Fair enough. Thank you for your responses. I have read the ns-3 manual routing section http://www.nsnam.org/docs/release/3.10/manual/html/routing.html I did not grasp how the routing is done. Do you have any recommendations to read to understand how routing works in more details? a paper or a book I am not talking about routing in general. I am talking about the references, which ns-3 implementation is based on. again Thank you very much
(In reply to comment #6) > Fair enough. > Thank you for your responses. I have read the ns-3 manual routing section > http://www.nsnam.org/docs/release/3.10/manual/html/routing.html > > I did not grasp how the routing is done. Do you have any recommendations to > read to understand how routing works in more details? a paper or a book > I am not talking about routing in general. I am talking about the references, > which ns-3 implementation is based on. > > again > Thank you very much Sorry, I did not see this question until now. One of the better references I've found is Linux Networking Architecture by Wehrle et al. I will mark this bug as "Resolved Invalid" resolution unless you would like to propose some change. I did update the doxygen of RouteOutput() to try to clarify this.