Ferry Huberts | 6 Dec 2011 10:15
Gravatar

[PATCH 4/4] smart gateway: remove useless code in smartgw_tunnel_monitor

From: Ferry Huberts <f.huberts <at> mindef.nl>

Signed-off-by: Ferry Huberts <f.huberts <at> mindef.nl>
---
 src/gateway.c |   19 +------------------
 1 files changed, 1 insertions(+), 18 deletions(-)

diff --git a/src/gateway.c b/src/gateway.c
index 31a63ab..e3c4a56 100644
--- a/src/gateway.c
+++ b/src/gateway.c
 <at>  <at>  -82,24 +82,7  <at>  <at>  serialize_gw_speed(uint32_t speed) {
  */
 static void smartgw_tunnel_monitor (int if_index,
     struct interface *ifh __attribute__ ((unused)), enum olsr_ifchg_flag flag) {
-  if (current_ipv4_gw != NULL && if_index == v4gw_tunnel->if_index && flag == IFCHG_IF_ADD) {
-	/* v4 tunnel up again, set route */
-    /* no need to setup tunnel route, already setup by olsr_set_inet_gateway.
-	olsr_os_inetgw_tunnel_route(v4gw_tunnel->if_index, true, true); */
-
-    /* and ip */
-	/* no need to setup ip, already setup by olsr_os_add_ipip_tunnel.
-    olsr_os_ifip(v4gw_tunnel->if_index, &olsr_cnf->main_addr, true); */
-  }
-  if (current_ipv6_gw != NULL && if_index == v6gw_tunnel->if_index && flag == IFCHG_IF_ADD) {
-	/* v6 status changed, set route */
-    /* no need to setup tunnel route, already setup by olsr_set_inet_gateway.
-	olsr_os_inetgw_tunnel_route(v6gw_tunnel->if_index, false, true); */
-
-    /* and ip */
(Continue reading)

Ferry Huberts | 6 Dec 2011 10:14
Gravatar

[PATCH 1/4] smart gateway: fix spelling of 'lazy'

From: Ferry Huberts <ferry.huberts <at> pelagic.nl>

Signed-off-by: Ferry Huberts <ferry.huberts <at> pelagic.nl>
---
 src/gateway_default_handler.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/gateway_default_handler.c b/src/gateway_default_handler.c
index d484d73..a18dba8 100644
--- a/src/gateway_default_handler.c
+++ b/src/gateway_default_handler.c
 <at>  <at>  -84,7 +84,7  <at>  <at>  static void gw_default_choose_gateway(void) {
   }
 }

-/* timer for laze gateway selection */
+/* timer for lazy gateway selection */
 static void gw_default_timer(void *unused __attribute__ ((unused))) {
   /* accept a 10% increase without trigger a stablecount reset */
   if (tc_tree.count * 10 <= gw_def_nodecount * 11) {
-- 
1.7.7.3

--

-- 
Olsr-dev mailing list
Olsr-dev <at> lists.olsr.org
https://lists.olsr.org/mailman/listinfo/olsr-dev

Ferry Huberts | 6 Dec 2011 10:14
Gravatar

[PATCH 3/4] smart gateway: remove duplicated calls

From: Ferry Huberts <f.huberts <at> mindef.nl>

Signed-off-by: Ferry Huberts <ferry.huberts <at> pelagic.nl>
---
 src/gateway.c |   16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/src/gateway.c b/src/gateway.c
index eab8785..31a63ab 100644
--- a/src/gateway.c
+++ b/src/gateway.c
 <at>  <at>  -83,18 +83,22  <at>  <at>  serialize_gw_speed(uint32_t speed) {
 static void smartgw_tunnel_monitor (int if_index,
     struct interface *ifh __attribute__ ((unused)), enum olsr_ifchg_flag flag) {
   if (current_ipv4_gw != NULL && if_index == v4gw_tunnel->if_index && flag == IFCHG_IF_ADD) {
-    /* v4 tunnel up again, set route */
-    olsr_os_inetgw_tunnel_route(v4gw_tunnel->if_index, true, true);
+	/* v4 tunnel up again, set route */
+    /* no need to setup tunnel route, already setup by olsr_set_inet_gateway.
+	olsr_os_inetgw_tunnel_route(v4gw_tunnel->if_index, true, true); */

     /* and ip */
-    olsr_os_ifip(v4gw_tunnel->if_index, &olsr_cnf->main_addr, true);
+	/* no need to setup ip, already setup by olsr_os_add_ipip_tunnel.
+    olsr_os_ifip(v4gw_tunnel->if_index, &olsr_cnf->main_addr, true); */
   }
   if (current_ipv6_gw != NULL && if_index == v6gw_tunnel->if_index && flag == IFCHG_IF_ADD) {
-    /* v6 status changed, set route */
-    olsr_os_inetgw_tunnel_route(v6gw_tunnel->if_index, false, true);
+	/* v6 status changed, set route */
(Continue reading)

Ferry Huberts | 6 Dec 2011 10:14
Gravatar

[PATCH 2/4] smart gateway: do not stop choosing a new (better) gateway

From: Ferry Huberts <ferry.huberts <at> pelagic.nl>

Signed-off-by: Ferry Huberts <ferry.huberts <at> pelagic.nl>
---
 src/gateway_default_handler.c |    6 ------
 1 files changed, 0 insertions(+), 6 deletions(-)

diff --git a/src/gateway_default_handler.c b/src/gateway_default_handler.c
index a18dba8..50986b3 100644
--- a/src/gateway_default_handler.c
+++ b/src/gateway_default_handler.c
 <at>  <at>  -76,12 +76,6  <at>  <at>  static void gw_default_choose_gateway(void) {
   if (inet_ipv6 && !dual) {
     olsr_set_inet_gateway(&inet_ipv6->originator, false, true, false);
   }
-
-  /* finished ? */
-  if (gw_def_finished_ipv4 && gw_def_finished_ipv6) {
-    olsr_stop_timer(gw_def_timer);
-    gw_def_timer = NULL;
-  }
 }

 /* timer for lazy gateway selection */
-- 
1.7.7.3

--

-- 
Olsr-dev mailing list
Olsr-dev <at> lists.olsr.org
(Continue reading)

Ferry Huberts | 6 Dec 2011 10:14
Gravatar

[PATCH 0/4] SmartGateway fixes

From: Ferry Huberts <f.huberts <at> mindef.nl>

This patch series aims to fix some smart gateway issues we're experiencing.

Please review carefully; we have too little insight into the smart gateway
code and its design decisions to know for sure whether our changes are 100%
right, especially patch 3/4.

Ferry Huberts (4):
  smart gateway: fix spelling of 'lazy'
  smart gateway: do not stop choosing a new (better) gateway
  smart gateway: remove duplicated calls
  smart gateway: remove useless code in smartgw_tunnel_monitor

 src/gateway.c                 |   15 +--------------
 src/gateway_default_handler.c |    8 +-------
 2 files changed, 2 insertions(+), 21 deletions(-)

-- 
1.7.7.3

--

-- 
Olsr-dev mailing list
Olsr-dev <at> lists.olsr.org
https://lists.olsr.org/mailman/listinfo/olsr-dev

Henning Rogge | 8 Dec 2011 08:20
Picon
Favicon

Re: [PATCH 2/4] smart gateway: do not stop choosing a new (better) gateway

On 12/06/2011 10:14 AM, Ferry Huberts wrote:
> From: Ferry Huberts<ferry.huberts <at> pelagic.nl>
>
> Signed-off-by: Ferry Huberts<ferry.huberts <at> pelagic.nl>
> ---
>   src/gateway_default_handler.c |    6 ------
>   1 files changed, 0 insertions(+), 6 deletions(-)
>
> diff --git a/src/gateway_default_handler.c b/src/gateway_default_handler.c
> index a18dba8..50986b3 100644
> --- a/src/gateway_default_handler.c
> +++ b/src/gateway_default_handler.c
>  <at>  <at>  -76,12 +76,6  <at>  <at>  static void gw_default_choose_gateway(void) {
>     if (inet_ipv6&&  !dual) {
>       olsr_set_inet_gateway(&inet_ipv6->originator, false, true, false);
>     }
> -
> -  /* finished ? */
> -  if (gw_def_finished_ipv4&&  gw_def_finished_ipv6) {
> -    olsr_stop_timer(gw_def_timer);
> -    gw_def_timer = NULL;
> -  }
>   }
>
>   /* timer for lazy gateway selection */

Have to look at this more closely. The idea behind the "default" gateway 
selector is to select a gateway and stick with it until its gone. Maybe 
"gone" is a bit too late, but if we start choosing another gateway too 
early, we might get gateway-flapping again.
(Continue reading)

Ferry Huberts | 8 Dec 2011 08:44
Gravatar

Re: [PATCH 2/4] smart gateway: do not stop choosing a new (better) gateway

On 12/08/2011 08:20 AM, Henning Rogge wrote:
> On 12/06/2011 10:14 AM, Ferry Huberts wrote:
>> From: Ferry Huberts<ferry.huberts <at> pelagic.nl>
>>
>> Signed-off-by: Ferry Huberts<ferry.huberts <at> pelagic.nl>
>> ---
>>   src/gateway_default_handler.c |    6 ------
>>   1 files changed, 0 insertions(+), 6 deletions(-)
>>
>> diff --git a/src/gateway_default_handler.c
>> b/src/gateway_default_handler.c
>> index a18dba8..50986b3 100644
>> --- a/src/gateway_default_handler.c
>> +++ b/src/gateway_default_handler.c
>>  <at>  <at>  -76,12 +76,6  <at>  <at>  static void gw_default_choose_gateway(void) {
>>     if (inet_ipv6&&  !dual) {
>>       olsr_set_inet_gateway(&inet_ipv6->originator, false, true, false);
>>     }
>> -
>> -  /* finished ? */
>> -  if (gw_def_finished_ipv4&&  gw_def_finished_ipv6) {
>> -    olsr_stop_timer(gw_def_timer);
>> -    gw_def_timer = NULL;
>> -  }
>>   }
>>
>>   /* timer for lazy gateway selection */
> 
> Have to look at this more closely. The idea behind the "default" gateway
> selector is to select a gateway and stick with it until its gone. Maybe
(Continue reading)

Henning Rogge | 8 Dec 2011 08:51
Picon
Favicon

Re: [PATCH 2/4] smart gateway: do not stop choosing a new (better) gateway

On 12/08/2011 08:44 AM, Ferry Huberts wrote:
>> Have to look at this more closely. The idea behind the "default" gateway
>> selector is to select a gateway and stick with it until its gone. Maybe
>> "gone" is a bit too late, but if we start choosing another gateway too
>> early, we might get gateway-flapping again.
>>
>
> Agree.
>
> However, in our highly mobile networks we have to do something.
> This is a short term solution to make it work, and sending out the
> patches was also meant to start a discussion on the best solution ;-)
>
> The usual solution is to use some form of hysteresis. We might do
> something like 'if there is a better gateway for at least x seconds,
> then switch to it'.
>
> What do you think?
I think there should be some API calls to overwrite the gateway selector 
from a plugin, so maybe we could put your selector into one so users can 
choose between them.

At least that was the plan when I designed the code, I don't think 
anyone has ever wrote a Smart-GW plugin.

Henning

--

-- 
Diplom-Informatiker Henning Rogge , Fraunhofer-Institut für
Kommunikation, Informationsverarbeitung und Ergonomie FKIE
(Continue reading)

Ferry Huberts | 8 Dec 2011 13:50
Gravatar

Re: [PATCH 2/4] smart gateway: do not stop choosing a new (better) gateway

On 12/08/2011 08:51 AM, Henning Rogge wrote:
> On 12/08/2011 08:44 AM, Ferry Huberts wrote:
>>> Have to look at this more closely. The idea behind the "default" gateway
>>> selector is to select a gateway and stick with it until its gone. Maybe
>>> "gone" is a bit too late, but if we start choosing another gateway too
>>> early, we might get gateway-flapping again.
>>>
>>
>> Agree.
>>
>> However, in our highly mobile networks we have to do something.
>> This is a short term solution to make it work, and sending out the
>> patches was also meant to start a discussion on the best solution ;-)
>>
>> The usual solution is to use some form of hysteresis. We might do
>> something like 'if there is a better gateway for at least x seconds,
>> then switch to it'.
>>
>> What do you think?
> I think there should be some API calls to overwrite the gateway selector
> from a plugin, so maybe we could put your selector into one so users can
> choose between them.
> 
> At least that was the plan when I designed the code, I don't think
> anyone has ever wrote a Smart-GW plugin.
> 

so how do you propose we continue this?

--

-- 
(Continue reading)

Teco Boot | 8 Dec 2011 14:12
Picon

Re: [PATCH 2/4] smart gateway: do not stop choosing a new (better) gateway

I saw a "bug" in old behavior. When first selected SGW was lost, no new SGW was selected. The patch in default
SGW code should check current tunnel, and set up new one if it was lost.

A more advanced SGW would switch when a far better SGW is available, e.g. < 70% of current SGW costs (70% would
be a parameter, similar to NAT-Threshold). < 0% would disable switchover, this could be the default.

Even more advanced: set up multiple SGW tunnels, use best SGW for new connections and keep using these for
those connections. How to do this needs more thoughts.

Thanks, Teco

Op 8 dec. 2011, om 13:50 heeft Ferry Huberts het volgende geschreven:

> On 12/08/2011 08:51 AM, Henning Rogge wrote:
>> On 12/08/2011 08:44 AM, Ferry Huberts wrote:
>>>> Have to look at this more closely. The idea behind the "default" gateway
>>>> selector is to select a gateway and stick with it until its gone. Maybe
>>>> "gone" is a bit too late, but if we start choosing another gateway too
>>>> early, we might get gateway-flapping again.
>>>> 
>>> 
>>> Agree.
>>> 
>>> However, in our highly mobile networks we have to do something.
>>> This is a short term solution to make it work, and sending out the
>>> patches was also meant to start a discussion on the best solution ;-)
>>> 
>>> The usual solution is to use some form of hysteresis. We might do
>>> something like 'if there is a better gateway for at least x seconds,
>>> then switch to it'.
(Continue reading)


Gmane