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
c1d1be51
Commit
c1d1be51
authored
May 22, 2014
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename rtt-exponential-decay to rtt-decay.
parent
c589c129
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
11 additions
and
11 deletions
+11
-11
babeld.man
babeld.man
+1
-1
configuration.c
configuration.c
+3
-3
interface.c
interface.c
+3
-3
interface.h
interface.h
+2
-2
message.c
message.c
+2
-2
No files found.
babeld.man
View file @
c1d1be51
...
...
@@ -340,7 +340,7 @@ is non-zero (see below), and
.B false
otherwise.
.TP
.BI rtt\-
exponential\-
decay " decay"
.BI rtt\-decay " decay"
This specifies the decay factor for the exponential moving average of
RTT samples, in units of 1/256. Must be between 1 and 256, inclusive.
Higher values discard old samples faster. The default is
...
...
configuration.c
View file @
c1d1be51
...
...
@@ -470,12 +470,12 @@ parse_anonymous_ifconf(int c, gnc_t gnc, void *closure,
if
(
c
<
-
1
)
goto
error
;
if_conf
->
enable_timestamps
=
v
;
}
else
if
(
strcmp
(
token
,
"rtt-
exponential-
decay"
)
==
0
)
{
}
else
if
(
strcmp
(
token
,
"rtt-decay"
)
==
0
)
{
int
decay
;
c
=
getint
(
c
,
&
decay
,
gnc
,
closure
);
if
(
c
<
-
1
||
decay
<=
0
||
decay
>
256
)
goto
error
;
if_conf
->
rtt_
exponential_
decay
=
decay
;
if_conf
->
rtt_decay
=
decay
;
}
else
if
(
strcmp
(
token
,
"rtt-min"
)
==
0
)
{
int
rtt
;
c
=
getthousands
(
c
,
&
rtt
,
gnc
,
closure
);
...
...
@@ -575,7 +575,7 @@ merge_ifconf(struct interface_conf *dest,
MERGE
(
faraway
);
MERGE
(
channel
);
MERGE
(
enable_timestamps
);
MERGE
(
rtt_
exponential_
decay
);
MERGE
(
rtt_decay
);
MERGE
(
rtt_min
);
MERGE
(
rtt_max
);
MERGE
(
max_rtt_penalty
);
...
...
interface.c
View file @
c1d1be51
...
...
@@ -305,9 +305,9 @@ interface_up(struct interface *ifp, int up)
IF_CONF
(
ifp
,
update_interval
)
:
ifp
->
hello_interval
*
4
;
ifp
->
rtt_
exponential_
decay
=
IF_CONF
(
ifp
,
rtt_
exponential_
decay
)
>
0
?
IF_CONF
(
ifp
,
rtt_
exponential_
decay
)
:
42
;
ifp
->
rtt_decay
=
IF_CONF
(
ifp
,
rtt_decay
)
>
0
?
IF_CONF
(
ifp
,
rtt_decay
)
:
42
;
ifp
->
rtt_min
=
IF_CONF
(
ifp
,
rtt_min
)
>
0
?
...
...
interface.h
View file @
c1d1be51
...
...
@@ -38,7 +38,7 @@ struct interface_conf {
char
faraway
;
int
channel
;
int
enable_timestamps
;
unsigned
int
rtt_
exponential_
decay
;
unsigned
int
rtt_decay
;
unsigned
int
rtt_min
;
unsigned
int
rtt_max
;
unsigned
int
max_rtt_penalty
;
...
...
@@ -99,7 +99,7 @@ struct interface {
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
;
unsigned
int
rtt_decay
;
/* Parameters for computing the cost associated to RTT. */
unsigned
int
rtt_min
;
unsigned
int
rtt_max
;
...
...
message.c
View file @
c1d1be51
...
...
@@ -618,8 +618,8 @@ parse_packet(const unsigned char *from, struct interface *ifp,
old_rttcost
=
neighbour_rttcost
(
neigh
);
if
(
valid_rtt
(
neigh
))
{
/* Running exponential average. */
smoothed_rtt
=
(
ifp
->
rtt_
exponential_decay
*
rtt
+
(
256
-
ifp
->
rtt_exponential
_decay
)
*
neigh
->
rtt
);
smoothed_rtt
=
(
ifp
->
rtt_
decay
*
rtt
+
(
256
-
ifp
->
rtt
_decay
)
*
neigh
->
rtt
);
/* Rounding (up or down) to get closer to the sample. */
neigh
->
rtt
=
(
neigh
->
rtt
>=
rtt
)
?
smoothed_rtt
/
256
:
(
smoothed_rtt
+
255
)
/
256
;
...
...
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