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
aa3517f0
Commit
aa3517f0
authored
Jun 10, 2007
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use the txcost as the cost of wired interfaces.
parent
474c11f8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
5 deletions
+14
-5
neighbour.c
neighbour.c
+14
-5
No files found.
neighbour.c
View file @
aa3517f0
...
...
@@ -218,10 +218,6 @@ int
neighbour_cost
(
struct
neighbour
*
neigh
)
{
int
c
;
/* (1/(alpha * beta) + 1/beta) / 2, which is half the expected
number of transmissions, in both directions.
ETX uses 1/(alpha * beta), which is the expected number of
transmissions in the forward direction. */
if
(
neigh
->
txcost
>=
INFINITY
)
return
INFINITY
;
...
...
@@ -230,5 +226,18 @@ neighbour_cost(struct neighbour *neigh)
if
(
c
>=
INFINITY
)
return
INFINITY
;
if
(
neigh
->
network
->
wired
)
{
/* On a wired interface, only the txcost is significant.
However, a low txcost with a large rxcost probably indicates
a malfunctioning interface, so penalise it. This doesn't
matter much, as we usually don't perform link quality estimation
on wired interfaces. */
return
MIN
(
INFINITY
,
MAX
(
neigh
->
txcost
,
c
/
4
));
}
else
{
/* (1/(alpha * beta) + 1/beta) / 2, which is half the expected
number of transmissions, in both directions.
ETX uses 1/(alpha * beta), which is the expected number of
transmissions in the forward direction. */
return
(
c
+
((
c
*
neigh
->
txcost
+
128
)
>>
8
)
+
1
)
/
2
;
}
}
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