[SOLVED] "Active Clients" vs "arp"

Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking
Author Message
puterboy2
DD-WRT User


Joined: 24 Feb 2019
Posts: 139

PostPosted: Mon Jul 18, 2022 18:44    Post subject: [SOLVED] "Active Clients" vs "arp" Reply with quote
Elsewhere in the forums, I read that the GUI "Active Client" list (under "Status->Lan") is generated by 'arp'

However, the "Active Client" list in the gui is significantly longer than the list generated by "arp -a".
The GUI also sometimes has multiple IP addresses for the same device/MAC -- possibly because it is caching old/stale connections.

Also, the number of arp connections tends to change minute to minute (without any devices being intentionally connected/disconnected) -- e.g., on my network it can go from 27 to 21 in a matter of seconds.
On the other hand, the GUI list is relatively stable.

So is there some caching going on in the GUI?

What Linux command/script is run to generate the GUI list?

Thanks

Note: I have a Netgear r6700 running DD-WRT v3.0-r47206 std (08/19/21)
Sponsor
puterboy2
DD-WRT User


Joined: 24 Feb 2019
Posts: 139

PostPosted: Mon Jul 18, 2022 18:50    Post subject: Reply with quote
Also interestingly, there are wireless clients that don't show up in either 'arp -a' or in/tmp/dnsmasq.leases

The reason I am asking these questions, is that I would like t use the CLI to find out the IP address of all connected wireless devices.
eibgrad
DD-WRT Guru


Joined: 18 Sep 2010
Posts: 9157

PostPosted: Mon Jul 18, 2022 19:19    Post subject: Reply with quote
It's always been my understanding that any "active client list", whatever the firmware, comes from a variety of sources, be it arp, the wireless adapter(s), DHCP leases, etc. There is no single source for that list because the very idea of an "active client list" is a false notion when it comes to IP.

The IP network is NOT like the old POTS telephone system, where each phone has an hardwired electrical connection to the central telephone switching station. It's packet-switched, and is therefore more stateless in its behavior. You only KNOW a client is active if in fact you "see" packets. But if that device is just idling at any given time, is it or is it NOT actively connected? It's ambiguous due to the nature of how IP works.

That's why all such active client lists are problematic. Most are just a mishmash of various sources that *attempt* to provide something we humans would consider "connected". But if you're depending on something like arp, beware that will eventually be dropped if the client goes silent. But that doesn't mean it's NOT actively connected. NOT if you consider still being pingable (which requires a refresh of arp) makes it actively connected.

Now if you just want to know if the wireless adapters are capable of reporting any actively connected stations based on their own traffic monitoring, that may very well be possible via the driver UI (e.g., w/ Broadcom, using the wl command).

_________________
ddwrt-ovpn-split-basic.sh (UPDATED!) * ddwrt-ovpn-split-advanced.sh (UPDATED!) * ddwrt-ovpn-client-killswitch.sh * ddwrt-ovpn-client-watchdog.sh * ddwrt-ovpn-remote-access.sh * ddwrt-ovpn-client-backup.sh * ddwrt-mount-usb-drives.sh * ddwrt-blacklist-domains.sh * ddwrt-wol-port-forward.sh * ddwrt-dns-monitor.sh (NEW!)
the-joker
DD-WRT Developer/Maintainer


Joined: 31 Jul 2021
Posts: 2146
Location: All over YOUR webs

PostPosted: Mon Jul 18, 2022 19:37    Post subject: Reply with quote
@puterboy2

You are correct but there is more to this than meets the eye.

Read this thread and specifically @brainslayers comments

However @puterboy2 dd-wrt build is old and ancient so the new code is not in place and you will only see the old behavior and cannot configure it to reflect the arp entries (at the loss of all bandwidth usage measurements where applicable).

As well as enjoying all the unpatched CVE's with old ass build Wink.

_________________
Saving your retinas from the burn!🔥
DD-WRT Inspired themes for routers
DD-WRT Inspired themes for the phpBB Forum
DD-WRT Inspired themes for the SVN Trac & FTP site
Join in for a chat @ #style_it_themes_public:matrix.org or #style_it_themes:discord

DD-WRT UI Themes Bug Reporting and Discussion thread

Router: ANus RT-AC68U E1 (recognized as C1)
puterboy2
DD-WRT User


Joined: 24 Feb 2019
Posts: 139

PostPosted: Mon Jul 18, 2022 19:59    Post subject: Reply with quote
Helpful comments... and I will upgrade my FW as soon as practical... (and yes I do use 'wl' extensively on my Broadcom router)

So it seems that the "Active Client" list intentionally has a longer cache of activity than dhcp or arp so as to be able to calculate average BW per MAC address... which is good for my purposes...

My question is which routine/script is called to generate the data as I would like to call it from the CLI.

Thanks
the-joker
DD-WRT Developer/Maintainer


Joined: 31 Jul 2021
Posts: 2146
Location: All over YOUR webs

PostPosted: Wed Jul 20, 2022 10:13    Post subject: Reply with quote
You cant, this is JavaScript and CGI and C source code

https://github.com/mirror/dd-wrt/blob/master/src/router/kromo/dd-wrt/Status_Lan.asp

https://github.com/mirror/dd-wrt/blob/master/src/router/httpd/visuals/arp.c

The changesets applicable (on the other thread I pointed you to) to allow old behavior are

https://svn.dd-wrt.com/changeset/49320
https://svn.dd-wrt.com/changeset/49321

So you will need to look at https://github.com/mirror/dd-wrt/blob/master/src/router/httpd/visuals/ejs.c as well as that contains the code used for these measurements

_________________
Saving your retinas from the burn!🔥
DD-WRT Inspired themes for routers
DD-WRT Inspired themes for the phpBB Forum
DD-WRT Inspired themes for the SVN Trac & FTP site
Join in for a chat @ #style_it_themes_public:matrix.org or #style_it_themes:discord

DD-WRT UI Themes Bug Reporting and Discussion thread

Router: ANus RT-AC68U E1 (recognized as C1)
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum