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
4b5b319f
Commit
4b5b319f
authored
Jun 18, 2013
by
Baptiste Jonglez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make 'rtt_exponential_decay' relative to an interface
parent
9b2ff477
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
9 deletions
+9
-9
babeld.c
babeld.c
+0
-4
babeld.h
babeld.h
+0
-1
interface.h
interface.h
+3
-0
message.c
message.c
+6
-4
No files found.
babeld.c
View file @
4b5b319f
...
@@ -58,10 +58,6 @@ struct timeval now;
...
@@ -58,10 +58,6 @@ struct timeval now;
unsigned
char
myid
[
8
];
unsigned
char
myid
[
8
];
int
debug
=
0
;
int
debug
=
0
;
/* A higher value means we forget old RTT samples faster. Must be
between 1 and 256, inclusive. */
unsigned
int
rtt_exponential_decay
=
42
;
int
link_detect
=
0
;
int
link_detect
=
0
;
int
all_wireless
=
0
;
int
all_wireless
=
0
;
int
default_wireless_hello_interval
=
-
1
;
int
default_wireless_hello_interval
=
-
1
;
...
...
babeld.h
View file @
4b5b319f
...
@@ -90,7 +90,6 @@ extern int do_daemonise;
...
@@ -90,7 +90,6 @@ extern int do_daemonise;
extern
const
char
*
logfile
,
*
pidfile
,
*
state_file
;
extern
const
char
*
logfile
,
*
pidfile
,
*
state_file
;
extern
int
link_detect
;
extern
int
link_detect
;
extern
int
all_wireless
;
extern
int
all_wireless
;
extern
unsigned
int
rtt_exponential_decay
;
extern
unsigned
char
myid
[
8
];
extern
unsigned
char
myid
[
8
];
...
...
interface.h
View file @
4b5b319f
...
@@ -91,6 +91,9 @@ struct interface {
...
@@ -91,6 +91,9 @@ struct interface {
unsigned
short
hello_seqno
;
unsigned
short
hello_seqno
;
unsigned
hello_interval
;
unsigned
hello_interval
;
unsigned
update_interval
;
unsigned
update_interval
;
/* A higher value means we forget old RTT samples faster. Must be
between 1 and 256, inclusive. */
unsigned
int
rtt_exponential_decay
;
/* Parameters for computing the cost associated to RTT. */
/* Parameters for computing the cost associated to RTT. */
unsigned
int
rtt_min
;
unsigned
int
rtt_min
;
unsigned
int
rtt_max
;
unsigned
int
rtt_max
;
...
...
message.c
View file @
4b5b319f
...
@@ -611,14 +611,16 @@ parse_packet(const unsigned char *from, struct interface *ifp,
...
@@ -611,14 +611,16 @@ parse_packet(const unsigned char *from, struct interface *ifp,
debugf
(
"RTT to %s on %s sample result: %d us.
\n
"
,
debugf
(
"RTT to %s on %s sample result: %d us.
\n
"
,
format_address
(
from
),
ifp
->
name
,
rtt
);
format_address
(
from
),
ifp
->
name
,
rtt
);
if
(
valid_rtt
(
neigh
))
if
(
valid_rtt
(
neigh
))
{
/* Running exponential average. */
/* Running exponential average. */
neigh
->
rtt
=
(
rtt_exponential_decay
*
MAX
(
rtt
,
0
)
neigh
->
rtt
=
(
ifp
->
rtt_exponential_decay
*
MAX
(
rtt
,
0
)
+
(
256
-
rtt_exponential_decay
)
*
neigh
->
rtt
)
/
256
;
+
(
256
-
ifp
->
rtt_exponential_decay
)
*
neigh
->
rtt
);
else
neigh
->
rtt
/=
256
;
}
else
{
/* We prefer to be conservative with new neighbours
/* We prefer to be conservative with new neighbours
(higher RTT) */
(higher RTT) */
neigh
->
rtt
=
MAX
(
2
*
rtt
,
0
);
neigh
->
rtt
=
MAX
(
2
*
rtt
,
0
);
}
neigh
->
rtt_time
=
now
;
neigh
->
rtt_time
=
now
;
}
}
return
;
return
;
...
...
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