Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
babeld
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
babeld
Commits
f8a954e1
Commit
f8a954e1
authored
Aug 25, 2007
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Compute jitter dynamically, on a per-interface basis.
parent
1b0c2bf8
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
12 deletions
+26
-12
babel.c
babel.c
+17
-3
babel.h
babel.h
+3
-0
message.c
message.c
+6
-7
message.h
message.h
+0
-2
No files found.
babel.c
View file @
f8a954e1
...
...
@@ -210,9 +210,6 @@ main(int argc, char **argv)
if
(
seqno_interval
<=
0
)
seqno_interval
=
MAX
(
wireless_hello_interval
-
1
,
2
);
jitter
=
MIN
(
wireless_hello_interval
*
1000
/
4
,
2000
);
update_jitter
=
2
*
jitter
;
rc
=
parse_address
(
*
arg
,
myid
);
if
(
rc
<
0
)
goto
syntax
;
...
...
@@ -775,3 +772,20 @@ update_hello_interval(struct network *net)
return
rc
;
}
/* This should be no more than half the hello interval, so that hellos
aren't sent late. The result is in milliseconds. */
unsigned
int
jitter
(
struct
network
*
net
)
{
unsigned
interval
=
net
->
hello_interval
*
1000
;
return
(
interval
/
2
+
random
()
%
interval
)
/
4
;
}
unsigned
int
update_jitter
(
struct
network
*
net
)
{
unsigned
interval
=
net
->
hello_interval
*
1000
;
return
(
interval
/
2
+
random
()
%
interval
);
}
babel.h
View file @
f8a954e1
...
...
@@ -101,3 +101,6 @@ extern int max_request_hopcount;
int
network_idle
(
struct
network
*
net
);
int
update_hello_interval
(
struct
network
*
net
);
unsigned
int
jitter
(
struct
network
*
net
);
unsigned
int
update_jitter
(
struct
network
*
net
);
message.c
View file @
f8a954e1
...
...
@@ -40,8 +40,6 @@ struct timeval update_flush_time = {0, 0};
const
unsigned
char
packet_header
[
8
]
=
{
42
,
1
};
unsigned
int
jitter
;
unsigned
int
update_jitter
;
int
add_cost
=
0
;
int
parasitic
=
0
;
int
silent_time
=
30
;
...
...
@@ -268,7 +266,7 @@ flushbuf(struct network *net)
static
void
schedule_flush
(
struct
network
*
net
)
{
int
msecs
=
jitter
/
2
+
random
()
%
jitter
;
int
msecs
=
jitter
(
net
)
;
if
(
net
->
flush_time
.
tv_sec
!=
0
&&
timeval_minus_msec
(
&
net
->
flush_time
,
&
now
)
<
msecs
)
return
;
...
...
@@ -522,9 +520,10 @@ flushupdates(void)
}
static
void
schedule_update_flush
(
void
)
schedule_update_flush
(
struct
network
*
net
)
{
int
msecs
=
update_jitter
/
2
+
random
()
%
update_jitter
;
int
msecs
;
msecs
=
update_jitter
(
net
);
if
(
update_flush_time
.
tv_sec
!=
0
&&
timeval_minus_msec
(
&
update_flush_time
,
&
now
)
<
msecs
)
return
;
...
...
@@ -599,7 +598,7 @@ send_update(struct network *net,
buffer_update
(
net
,
routes
[
i
].
src
->
prefix
,
routes
[
i
].
src
->
plen
);
net
->
update_time
=
now
.
tv_sec
;
}
schedule_update_flush
();
schedule_update_flush
(
net
);
}
void
...
...
@@ -625,7 +624,7 @@ send_self_update(struct network *net, int force_seqno)
if
(
xroutes
[
i
].
exported
)
send_update
(
net
,
xroutes
[
i
].
prefix
,
xroutes
[
i
].
plen
);
}
schedule_update_flush
();
schedule_update_flush
(
net
);
}
void
...
...
message.h
View file @
f8a954e1
...
...
@@ -26,8 +26,6 @@ extern unsigned short myseqno;
extern
int
seqno_time
;
extern
int
seqno_interval
;
extern
unsigned
int
jitter
;
extern
unsigned
int
update_jitter
;
extern
int
add_cost
;
extern
int
parasitic
;
extern
int
silent_time
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment