libremesh / lime-packages

LibreMesh packages configuring OpenWrt for wireless mesh networking
https://libremesh.org/
GNU Affero General Public License v3.0
277 stars 96 forks source link

links information according to batman protocol #1055

Closed javierbrk closed 6 months ago

javierbrk commented 1 year ago

This module provides per interface links information associated with batman protocol basically using batclt nj command as source. The output is similar to the wifi_links_info to make data parsing easy.

This module depends on batctl-default witch is in use by kmod-batman-adv and batman-adv-auto-gw-mode.

This is a sample output of the command shared-state-async get bat_links_info run in one of two librerouters.

{
    "lrprimero": [
        {
            "dst_mac": "02:29:0f:1f:73:aa",
            "last_seen_msecs": 770,
            "tq": 238,
            "src_mac": "02:29:0f:1f:72:3a",
            "iface": "eth1-2_250"
        },
        {
            "dst_mac": "02:db:d6:fc:3a:bd",
            "last_seen_msecs": 510,
            "tq": 155,
            "src_mac": "02:29:0f:1f:72:3a",
            "iface": "eth1-2_250"
        }
    ],
    "lrsegundo": [
        {
            "dst_mac": "02:db:d6:fc:3a:bd",
            "last_seen_msecs": 480,
            "tq": 255,
            "src_mac": "02:29:0f:1f:73:aa",
            "iface": "eth1-2_250"
        },
        {
            "dst_mac": "02:29:0f:1f:72:3a",
            "last_seen_msecs": 750,
            "tq": 254,
            "src_mac": "02:29:0f:1f:73:aa",
            "iface": "eth1-2_250"
        }
    ]
}
codecov-commenter commented 1 year ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 79.68%. Comparing base (6992335) to head (1c099ca).

:exclamation: Current head 1c099ca differs from pull request most recent head 1e1f379. Consider uploading reports for the commit 1e1f379 to get more accurate results

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1055 +/- ## ========================================== + Coverage 79.54% 79.68% +0.14% ========================================== Files 53 53 Lines 4566 4574 +8 ========================================== + Hits 3632 3645 +13 + Misses 934 929 -5 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

ilario commented 1 year ago

Great!

Just one comment:

$RANDOM will not be available in the upcoming LibreMesh releases. See https://github.com/libremesh/lime-packages/issues/800 and https://github.com/libremesh/lime-packages/pull/991 (this means that the makefile should include a dependency from the replacement package and the uci-default package should include the random-numgen command instead of the $RANDOM)

javierbrk commented 12 months ago

The last push includes the tq parameter for every neighbor

G10h4ck commented 7 months ago

should be ported to shared-state-async before merging

ilario commented 7 months ago

At some point in the future, when we will have BATMAN_V working (the possibility to select it was introduced in https://github.com/libremesh/lime-packages/pull/1004 as @lindnermarek said it is better than BATMAN_IV. But the first tests failed, as reported on https://github.com/libremesh/lime-packages/issues/1059 . The progress on this is being tracked here: https://github.com/libremesh/lime-packages/issues/1009 ), we should check if this works also for BATMAN_V.

-- Inviato dal mio smartstone

javierbrk commented 7 months ago

At some point in the future, when we will have BATMAN_V working (the possibility to select it was introduced in #1004 as @lindnermarek said it is better than BATMAN_IV. But the first tests failed, as reported on #1059 . The progress on this is being tracked here: #1009 ), we should check if this works also for BATMAN_V. -- Inviato dal mio smartstone

Nice ! this package gets info from batctl, I made a small poc and saw that if the network uses batmanV the json changes to this, instead of "tq" you get "throughput" and the information is directly in the originators table.

{
    "lrprimero": [
        {
            "last_seen_msecs": 430,
            "src_mac": "02:29:0f:1f:72:3a",
            "throughput": 1000000,
            "dst_mac": "02:29:0f:1f:73:aa",
            "iface": "eth1-2_250"
        }
    ],
    "lrsegundo": [
        {
            "last_seen_msecs": 310,
            "src_mac": "02:29:0f:1f:73:aa",
            "throughput": 1000000,
            "dst_mac": "02:29:0f:1f:72:3a",
            "iface": "eth1-2_250"
        }
    ]
}