Routing in lwIP.

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

Routing in lwIP.

rnjn.sinha (Bugzilla)
Hi,

I was wondering about how lwIP decides routes. I have gone through the
available documentation and source code as well and to me it seems
that routing is implemented in a very simple way; One interface is
marked as default and we match the destination addresses with
interface addresses keeping netmask in mind.

Has anybody implemented more complex routing scenarios? For example,
assigning metrics and seting up a routing table.

--
Best Regards,
Ranjan


_______________________________________________
lwip-users mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: Routing in lwIP.

Alain Mouette

Ranjan Sinha escreveu:

> Hi,
>
> I was wondering about how lwIP decides routes. I have gone through the
> available documentation and source code as well and to me it seems
> that routing is implemented in a very simple way; One interface is
> marked as default and we match the destination addresses with
> interface addresses keeping netmask in mind.
>
> Has anybody implemented more complex routing scenarios? For example,
> assigning metrics and seting up a routing table.
>
One simple thing that comes to my mind and that can solve most problems
is to select the interface for each connection.

It would certainly be faster then searching a routing table and as an
optional feature the interface selected could be a pointer to the actual
interface.

This should work in reduced environments as things don't usualy change
so much and it would still be light wheight as in LWip :)

Alain


_______________________________________________
lwip-users mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: Routing in lwIP.

Jonathan Larmour
Alain M. wrote:

>
> Ranjan Sinha escreveu:
>> Hi,
>>
>> I was wondering about how lwIP decides routes. I have gone through the
>> available documentation and source code as well and to me it seems
>> that routing is implemented in a very simple way; One interface is
>> marked as default and we match the destination addresses with
>> interface addresses keeping netmask in mind.
>>
>> Has anybody implemented more complex routing scenarios? For example,
>> assigning metrics and seting up a routing table.
>>
> One simple thing that comes to my mind and that can solve most problems
> is to select the interface for each connection.
>
> It would certainly be faster then searching a routing table and as an
> optional feature the interface selected could be a pointer to the actual
> interface.
>
> This should work in reduced environments as things don't usualy change
> so much and it would still be light wheight as in LWip :)

The current ip_route is just a simple linear search anyway, so with only
one netif, it would take a trivial amount of time in any case. If you had
some sort of route cache, you'd have to be able to know when to invalidate
it, which would add complexity, thus reducing any difference.

So I think any focus on creating an (optional) routing table should be more
focussed on features than performance per se.

Jifl
--
eCosCentric Limited      http://www.eCosCentric.com/     The eCos experts
Barnwell House, Barnwell Drive, Cambridge, UK.       Tel: +44 1223 245571
Registered in England and Wales: Reg No 4422071.
------["Si fractum non sit, noli id reficere"]------       Opinions==mine


_______________________________________________
lwip-users mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: Routing in lwIP.

Alain Mouette

Jonathan Larmour escreveu:

> Alain M. wrote:
>> Ranjan Sinha escreveu:
>>> Hi,
>>>
>>> I was wondering about how lwIP decides routes. I have gone through the
>>> available documentation and source code as well and to me it seems
>>> that routing is implemented in a very simple way; One interface is
>>> marked as default and we match the destination addresses with
>>> interface addresses keeping netmask in mind.
>>>
>>> Has anybody implemented more complex routing scenarios? For example,
>>> assigning metrics and seting up a routing table.
>>>
>> One simple thing that comes to my mind and that can solve most problems
>> is to select the interface for each connection.
>>
>> It would certainly be faster then searching a routing table and as an
>> optional feature the interface selected could be a pointer to the actual
>> interface.
>>
>> This should work in reduced environments as things don't usualy change
>> so much and it would still be light wheight as in LWip :)
>
> The current ip_route is just a simple linear search anyway, so with only
> one netif, it would take a trivial amount of time in any case. If you had
> some sort of route cache, you'd have to be able to know when to invalidate
> it, which would add complexity, thus reducing any difference.

I don't understand why you would want a routing table with a single
netif. I was thinking only of the situation with more interfaces (I will
have ethernet+ppp/gprs). I am new to lwip, so I would appreciate a lot
if you nad give me some extra explanations, or pointers to further study.

> So I think any focus on creating an (optional) routing table should be more
> focussed on features than performance per se.

FWIW, I agree (I am new here, so it may not be worth a lot :)

Alain
>
> Jifl



_______________________________________________
lwip-users mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: Routing in lwIP.

Jonathan Larmour
Alain M. wrote:

>
> Jonathan Larmour escreveu:
>
>> Alain M. wrote:
>>
>>> Ranjan Sinha escreveu:
>>>
>>>> Hi,
>>>>
>>>> I was wondering about how lwIP decides routes. I have gone through the
>>>> available documentation and source code as well and to me it seems
>>>> that routing is implemented in a very simple way; One interface is
>>>> marked as default and we match the destination addresses with
>>>> interface addresses keeping netmask in mind.
>>>>
>>>> Has anybody implemented more complex routing scenarios? For example,
>>>> assigning metrics and seting up a routing table.
>>>>
>>> One simple thing that comes to my mind and that can solve most problems
>>> is to select the interface for each connection.
>>>
>>> It would certainly be faster then searching a routing table and as an
>>> optional feature the interface selected could be a pointer to the actual
>>> interface.
>>>
>>> This should work in reduced environments as things don't usualy change
>>> so much and it would still be light wheight as in LWip :)
>>
>>
>> The current ip_route is just a simple linear search anyway, so with only
>> one netif, it would take a trivial amount of time in any case. If you had
>> some sort of route cache, you'd have to be able to know when to
>> invalidate
>> it, which would add complexity, thus reducing any difference.
>
>
> I don't understand why you would want a routing table with a single
> netif.

I assumed that that was what you meant in your last paragraph.... I didn't
understand why you'd want to cache the interface for each connection if
there's only one netif :-).

If there are several interfaces, I can believe that a concept of a cache
could work. So the PCBs could have a struct netif *cached_route, used for
PCBs which have an associated connection (which also applies to UDP PCBs
in lwIP). The cache is used all the time, but as soon as a netif changes
(e.g. with netif_set_up, netif_set_down, netif_set_default) then the cache
in all PCBs gets wiped out, which in most systems won't happen often.

But I think the original pointer is interested in more complicated
routing, possibly even dynamic routing. I think that would require a fair
bit of new code in lwIP.

Jifl
--
eCosCentric Limited      http://www.eCosCentric.com/     The eCos experts
Barnwell House, Barnwell Drive, Cambridge, UK.       Tel: +44 1223 245571
Registered in England and Wales: Reg No 4422071.
------["The best things in life aren't things."]------      Opinions==mine


_______________________________________________
lwip-users mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: Routing in lwIP.

Fabian Koch-2

Hey guys,

lwip-users-bounces+fabian.koch=[hidden email] wrote on 30.01.2009 02:53:21:
> But I think the original pointer is interested in more complicated
> routing, possibly even dynamic routing. I think that would require a fair
> bit of new code in lwIP.

I think the project shouldn't get carried away from it's original idea.
And that is _embedded_ _devices_.

The first one meaning we talk about minimal ressources and optimal usage of them.
The second point is, LwIP is aimed at devices. It's not gonna be a complex router, shooting millions of packets a sec. (Thats what you buy the expensive Ciscos or Junipers for)
Thats just not what it is intended for and all code that would be added in that direction will bind developers to stuff that does not hit the target audience.

just my humble opinion though.

regards,
Fabian
_______________________________________________
lwip-users mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/lwip-users