wg-multicast - Re: Huge multicast spike just now?
Subject: All things related to multicast
List archive
- From: Bruce Rodger <>
- To:
- Cc: Michael Fortier <>,
- Subject: Re: Huge multicast spike just now?
- Date: Wed, 3 Sep 2008 12:24:17 +0100 (BST)
On Thu, 26 Jun 2008,
wrote:
miniSAPserver in its current (buggy) form has been around
for ages....and yet thee storms have only just started to
occur. is it, perhaps, that some 'config example' which
is out there i the one causing this issue
I've just managed to unintentionally reproduce the problem. Fortunately, it
was noticed quickly, and hopefully was only local :)
miniSAPserver version 0.3.4
on Ubuntu 7.10
The default config contains:
# Number of seconds between announces. 5 is default. Internet announces
better use 30.
sap_delay=5
If you use this default, all is OK. If you add the "-s" flag to the
command, it prints a "." every time it sends out a sap. And as
expected, we get a "." appearing every 5 seconds.
However, if we make the suggested change and increase the value of
sap_delay to 30 (in fact to any value greater than 15!) we get our
SAP storm - thousands of SAPs (and thousands of dots on the screen)
appearing per second.
The problem appears to be an integer overflow in sapserver.cpp
unsigned n = config.Programs.size() ?: 1;
div_t d = div ((1000000000 / n) * config.GetDelay(), 1000000000);
struct timespec delay;
delay.tv_sec = d.quot;
delay.tv_nsec = d.rem;
(snip)
while(!should_exit)
{
for( unsigned int i = 0; i< announces.size() ; i ++ )
{
(snip - send the SAP here)
nanosleep( &delay, NULL );
}
}
So it appears that when config.GetDelay is >15, 1000000000*config.GetDelay
overflows, the arguments to nanosleep are negative.... it doesn't
sleep.... we get a storm.
A quick workaround is to remove the "div" line, and just have
delay.tv_sec = config.GetDelay();
delay.tv_nsec = 0;
I will leave development of a "proper" solution to someone else. But I will
log it on the videolan forum...
Bruce.
--
Bruce Rodger
|
Network Manager, IT Services
|http://www.strath.ac.uk/IT/People/bruce.html
The University of Strathclyde | +44 (0)141 548 3300
Glasgow G4 0LN, Scotland. | Fax 553 4100
"The University of Strathclyde is a charitable body, registered in
Scotland, number SC015263."
- Re: Huge multicast spike just now?, Bruce Rodger, 09/03/2008
- Re: Huge multicast spike just now?, Frank Fulchiero, 09/03/2008
- Re: Huge multicast spike just now?, Frank Fulchiero, 09/03/2008
- Re: Huge multicast spike just now?, Alan Crosswell, 09/03/2008
- Re: Huge multicast spike just now?, Marc Manthey, 09/03/2008
- Re: Huge multicast spike just now?, Hitoshi Asaeda, 09/03/2008
- Re: Huge multicast spike just now?, Alan Crosswell, 09/04/2008
- Re: Huge multicast spike just now?, Hitoshi Asaeda, 09/03/2008
- Re: Huge multicast spike just now?, Marc Manthey, 09/03/2008
- Re: Huge multicast spike just now?, Bruce Rodger, 09/03/2008
- Re: Huge multicast spike just now?, Zenon Mousmoulas, 09/03/2008
- Re: Huge multicast spike just now?, Marshall Eubanks, 09/03/2008
- Re: Huge multicast spike just now?, Bruce Rodger, 09/03/2008
- Re: Huge multicast spike just now?, Zenon Mousmoulas, 09/03/2008
- Re: Huge multicast spike just now?, Alan Crosswell, 09/03/2008
Archive powered by MHonArc 2.6.16.