Change in the RouteOutput signature of Ipv4RoutingProtocol

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Change in the RouteOutput signature of Ipv4RoutingProtocol

Igor Ribeiro
Hi everyone,

I am currently working on a project that requires the routing protocol to be able to change the destination address of the IP header passed as argument to the RouteOutput method. The problem is the header parameter is passed as a const reference, so I cannot change it’s destination address. To overcome this problem I had to change the definition of RouteOutput in the class Ipv4RoutingProtocol  and, consequently, in all derived classes. So far I compiled the code and no errors were reported but it still lack some tests. The reason I am writing this message is that in the future I would like to push my project to the ns3 repository and, therefore, I would like to know if this modification could potentially prevent me to do so.

Thank you in advance.

Best Regards,

Igor.

signature.asc (507 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Change in the RouteOutput signature of Ipv4RoutingProtocol

Tom Henderson-2
On 04/10/2017 10:19 PM, Igor Ribeiro wrote:
> Hi everyone,
>
> I am currently working on a project that requires the routing protocol to be able to change the destination address of the IP header passed as argument to the RouteOutput method. The problem is the header parameter is passed as a const reference, so I cannot change it’s destination address. To overcome this problem I had to change the definition of RouteOutput in the class Ipv4RoutingProtocol  and, consequently, in all derived classes. So far I compiled the code and no errors were reported but it still lack some tests. The reason I am writing this message is that in the future I would like to push my project to the ns3 repository and, therefore, I would like to know if this modification could potentially prevent me to do so.
>
> Thank you in advance.
>
> Best Regards,
>
> Igor.
I think we will need to discuss the tradeoffs further.  On the one hand,
removing the const reference might be the quickest fix but we might
prefer to be more explicit about returning a modified destination and
have the transport protocols handle this explicitly.  However, we can
probably find a solution to this.

- Tom

Reply | Threaded
Open this post in threaded view
|

Re: Change in the RouteOutput signature of Ipv4RoutingProtocol

Tommaso Pecorella
Hi Igor,

the RouteOutput signature (better, its use) is not perfect right now, and I'm totally open to discussing it.

However, from my personal experience changing the IP destination (or source) addresses after the IP layer is a bad idea: it breaks all the crypto protocols computing also the IP headers (yes, NAT too is a nightmare).
In these cases the workaround is to encapsulate the original datagram in another IP packet (IP over IP).

Anyway, as I said I'm open to discussions.

Cheers,

T.


> On 11 Apr 2017, at 22:04, Tom Henderson <[hidden email]> wrote:
>
> On 04/10/2017 10:19 PM, Igor Ribeiro wrote:
>> Hi everyone,
>>
>> I am currently working on a project that requires the routing protocol to be able to change the destination address of the IP header passed as argument to the RouteOutput method. The problem is the header parameter is passed as a const reference, so I cannot change it’s destination address. To overcome this problem I had to change the definition of RouteOutput in the class Ipv4RoutingProtocol  and, consequently, in all derived classes. So far I compiled the code and no errors were reported but it still lack some tests. The reason I am writing this message is that in the future I would like to push my project to the ns3 repository and, therefore, I would like to know if this modification could potentially prevent me to do so.
>>
>> Thank you in advance.
>>
>> Best Regards,
>>
>> Igor.
> I think we will need to discuss the tradeoffs further.  On the one hand, removing the const reference might be the quickest fix but we might prefer to be more explicit about returning a modified destination and have the transport protocols handle this explicitly.  However, we can probably find a solution to this.
>
> - Tom
>
--------------------------------------------------------------

``Build a man a fire, and he'll be warm for a day.
  Set a man on fire, and he'll be warm for the rest of his life.''
-- Terry Pratchett

--------------------------------------------------------------

Tommaso Pecorella - Ph.D.

Assistant professor
Dpt. Ingegneria dell'Informazione
Università di Firenze

CNIT - Università di Firenze Unit

via di S. Marta 3
50139, Firenze
ITALY

email: [hidden email]
       [hidden email]

phone : +39-055-2758540
mobile: +39-320-4379803
fax   : +39-055-2758570







signature.asc (817 bytes) Download Attachment