Add a idle_echo_timeout configuration option.
Determines the minumum number of up to date slaves required before the
master will drop routes (default: 1).
</LI>
Determines the minumum number of up to date slaves required before the
master will drop routes (default: 1).
</LI>
+
+<LI><B>echo_timeout</B> (int)<BR>
+Time between last packet sent and LCP ECHO generation
+(default: 10 (seconds)).
+</LI>
+
+<LI><B>idle_echo_timeout</B> (int)<BR>
+Drop sessions who have not responded within idle_echo_timeout seconds
+(default: 240 (seconds))
+</LI>
+
</UL>
<P>BGP routing configuration is entered by the command:
</UL>
<P>BGP routing configuration is entered by the command:
+l2tpns (2.2.1-2fdn1.4) unstable; urgency=low
+
+ * Add a echo_timeout configuration option.
+ * Add a idle_echo_timeout configuration option.
+
+ -- Fernando Alves <fernando.alves@sameswireless.fr> Mon, 20 Feb 2012 20:47:52 +0100
+
l2tpns (2.2.1-2fdn1.3) unstable; urgency=low
* Fix: Sends small packets in the MPPPP frame (for reorder).
l2tpns (2.2.1-2fdn1.3) unstable; urgency=low
* Fix: Sends small packets in the MPPPP frame (for reorder).
#set nexthop 10.0.1.1
#set nexthop6 2001:db8::1
#set nexthop 10.0.1.1
#set nexthop6 2001:db8::1
+# Time between last packet sent and LCP ECHO generation (default 10 seconds)
+#set echo_timeout 10
+# Drop sessions who have not responded within idle_echo_timeout seconds (default 240 seconds)
+#set idle_echo_timeout 240
+
# Drop/kill sessions
#load plugin "sessionctl"
# Drop/kill sessions
#load plugin "sessionctl"
CONFIG("hostname", hostname, STRING),
CONFIG("nexthop_address", nexthop_address, IPv4),
CONFIG("nexthop6_address", nexthop6_address, IPv6),
CONFIG("hostname", hostname, STRING),
CONFIG("nexthop_address", nexthop_address, IPv4),
CONFIG("nexthop6_address", nexthop6_address, IPv6),
+ CONFIG("echo_timeout", echo_timeout, INT),
+ CONFIG("idle_echo_timeout", idle_echo_timeout, INT),
// Time in milliseconds
time_now_ms = (t.tv_sec * 1000) + (t.tv_usec/1000);
// Time in milliseconds
time_now_ms = (t.tv_sec * 1000) + (t.tv_usec/1000);
return (t.tv_sec - basetime) * 10 + t.tv_usec / 100000 + 1;
}
return (t.tv_sec - basetime) * 10 + t.tv_usec / 100000 + 1;
}
t = session[s].tunnel;
sp = &session[s];
LOG(4, s, t, "MPPP: (1)Session number becomes: %d\n", s);
t = session[s].tunnel;
sp = &session[s];
LOG(4, s, t, "MPPP: (1)Session number becomes: %d\n", s);
if (num_of_links > 1)
{
if(len > MINFRAGLEN)
if (num_of_links > 1)
{
if(len > MINFRAGLEN)
remain -= fraglen;
while (remain > last_fraglen)
remain -= fraglen;
while (remain > last_fraglen)
b->current_ses = (b->current_ses + 1) % num_of_links;
s = members[b->current_ses];
t = session[s].tunnel;
b->current_ses = (b->current_ses + 1) % num_of_links;
s = members[b->current_ses];
t = session[s].tunnel;
- // Drop sessions who have not responded within IDLE_TIMEOUT seconds
- if (session[s].last_packet && (time_now - session[s].last_packet >= IDLE_TIMEOUT))
+ // Drop sessions who have not responded within IDLE_ECHO_TIMEOUT seconds
+ if (session[s].last_packet && (time_now - session[s].last_packet >= config->idle_echo_timeout))
{
sessionshutdown(s, "No response to LCP ECHO requests.", CDN_ADMIN_DISC, TERM_LOST_SERVICE);
STAT(session_timeout);
{
sessionshutdown(s, "No response to LCP ECHO requests.", CDN_ADMIN_DISC, TERM_LOST_SERVICE);
STAT(session_timeout);
}
// No data in ECHO_TIMEOUT seconds, send LCP ECHO
}
// No data in ECHO_TIMEOUT seconds, send LCP ECHO
- if (session[s].ppp.phase >= Establish && (time_now - session[s].last_packet >= ECHO_TIMEOUT) &&
+ if (session[s].ppp.phase >= Establish && (time_now - session[s].last_packet >= config->echo_timeout) &&
(time_now - sess_local[s].last_echo >= ECHO_TIMEOUT))
{
uint8_t b[MAXETHER];
(time_now - sess_local[s].last_echo >= ECHO_TIMEOUT))
{
uint8_t b[MAXETHER];
config->ppp_max_failure = 5;
config->kill_timedout_sessions = 1;
strcpy(config->random_device, RANDOMDEVICE);
config->ppp_max_failure = 5;
config->kill_timedout_sessions = 1;
strcpy(config->random_device, RANDOMDEVICE);
+ // Set default value echo_timeout and idle_echo_timeout
+ config->echo_timeout = ECHO_TIMEOUT;
+ config->idle_echo_timeout = IDLE_ECHO_TIMEOUT;
#define RINGBUFFER_SIZE 10000 // Number of ringbuffer entries to allocate
#define MAX_LOG_LENGTH 512 // Maximum size of log message
#define ECHO_TIMEOUT 10 // Time between last packet sent and LCP ECHO generation
#define RINGBUFFER_SIZE 10000 // Number of ringbuffer entries to allocate
#define MAX_LOG_LENGTH 512 // Maximum size of log message
#define ECHO_TIMEOUT 10 // Time between last packet sent and LCP ECHO generation
-#define IDLE_TIMEOUT 240 // Time between last packet seen and session shutdown
+#define IDLE_ECHO_TIMEOUT 240 // Time between last packet seen and session shutdown
#define BUSY_WAIT_TIME 3000 // 5 minutes in 1/10th seconds to wait for radius to cleanup on shutdown
#define MP_BEGIN 0x80 // This value is used when (b)egin bit is set in MP header
#define BUSY_WAIT_TIME 3000 // 5 minutes in 1/10th seconds to wait for radius to cleanup on shutdown
#define MP_BEGIN 0x80 // This value is used when (b)egin bit is set in MP header
in_addr_t nexthop_address;
struct in6_addr nexthop6_address;
#endif
in_addr_t nexthop_address;
struct in6_addr nexthop6_address;
#endif
+
+ int echo_timeout; // Time between last packet sent and LCP ECHO generation
+ int idle_echo_timeout; // Time between last packet seen and
+ // Drop sessions who have not responded within IDLE_ECHO_TIMEOUT seconds
} configt;
enum config_typet { INT, STRING, UNSIGNED_LONG, SHORT, BOOL, IPv4, IPv6 };
} configt;
enum config_typet { INT, STRING, UNSIGNED_LONG, SHORT, BOOL, IPv4, IPv6 };
// calculate the jitter average
uint32_t ljitter = time_now_ms - sess_local[s].prev_time;
// calculate the jitter average
uint32_t ljitter = time_now_ms - sess_local[s].prev_time;
- sess_local[s].jitteravg = (sess_local[s].jitteravg + ljitter)>>1;
- sess_local[s].prev_time = time_now_ms;
-
+ if (ljitter > 0)
+ {
+ sess_local[s].jitteravg = (sess_local[s].jitteravg + ljitter)>>1;
+ sess_local[s].prev_time = time_now_ms;
+ }
+
uint32_t Mmin;
if (seq_num < this_fragmentation->M)
uint32_t Mmin;
if (seq_num < this_fragmentation->M)
- // try to assemble the frame that has the received fragment as a member
+ // try to assemble the frame that has the received fragment as a member
// get the beginning of this frame
begin_index = end_index = this_fragmentation->start_index;
if (this_fragmentation->fragment[begin_index].length)
// get the beginning of this frame
begin_index = end_index = this_fragmentation->start_index;
if (this_fragmentation->fragment[begin_index].length)