Reading Fritz!Box 7490 router UPnP

Started by wurzel

wurzel

Reading Fritz!Box 7490 router UPnP   17 January 2016, 03:06

Hello!

I have a problem getting the router read out to work with my router. I read on these forums that apparently it is working with a similar albeit older model of fritz box routers, so I figured it should work with mine (AVM Fritz Box 7490) as well, but no luck. I have the router read out set to UPnP (SNMP is not supported by the router) and it shows Gateway Name and WAN Interface Name but as soon as I confirm the settings all readings stop and the graph freezes. When I change back to LAN reading, it starts up as normal again.

As I can't get the LAN filtering to work correctly with either driver (TDI stops tracking traffic and freezes the graph and WFP reports way too low traffic when I enable LAN filtering) and router read out would be preferable anyway it would be nice if I could get this to run. Apparently the "Fritz!Box Traffic" tool, specifically designed for my router brand by a 3rd party author, does exactly that, but it's nowhere near as nice and comprehensive as NetWorx is, so I'd really love to somehow get the read out through NetWorx.

Anyway, thanks for listening to my issue and also thanks for this great tool in the first place! smile

Greets
SoftPerfect Support forum - Andrew avatar image

Re: Reading Fritz!Box 7490 router UPnP   17 January 2016, 20:02

Most likely it's a bug in the router that reports negative values for UL/DL counters.

Could you please try this portable build and post here what it prints in the console?
wurzel

Re: Reading Fritz!Box 7490 router UPnP   18 January 2016, 00:54

Hello again!

Thanks for your fast answer (and for fixing my typo ^^), here's the output:

Polling UPnP
Obtaining service
Service obtained
Exception: Außerhalb des Bereichs
Reseting bytes
Polling UPnP
Obtaining service
Service obtained
Exception: Außerhalb des Bereichs
Reseting bytes
...

The Out of range exception probably describes what you already assumed?
SoftPerfect Support forum - Andrew avatar image

Re: Reading Fritz!Box 7490 router UPnP   18 January 2016, 11:58

Yes, unfortunately it suggests an issue with the data router reports.

At the moment NetWorx uses the built-in Windows UPnP implementation which fails if a router is not strictly compliant to the UPnP standard. The most common issue is when the router's firmware uses signed integers to store DL/UL counters and then turn negative after 2 GB (2^31).

This could be worked around if we wrote our own UPnP implementation that would handle non-compliant response data correctly. Would you be willing to help us with testing if we did this?
wurzel

Re: Reading Fritz!Box 7490 router UPnP   19 January 2016, 00:55

Yeah, definitely!
SoftPerfect Support forum - Andrew avatar image

Re: Reading Fritz!Box 7490 router UPnP   19 January 2016, 15:36

Cool, could you please try the new build?

It's got a custom UPnP implementation; if it doesn't work, we can debug and fix it.
wurzel

Re: Reading Fritz!Box 7490 router UPnP   19 January 2016, 23:20

This build seems to read out the values! It just doesn't seem to show correct ones yet. Here's a screenshot of the graph and the other tool that shows the correct values for comparison:

SoftPerfect support forum

If you need any more testing, please let me know!
SoftPerfect Support forum - Andrew avatar image

Re: Reading Fritz!Box 7490 router UPnP   20 January 2016, 15:19

I have checked what Fritz!Box Traffic does internally and found it issues a UPnP command called GetAddonInfos. It seems to be specific to Fritz!Box and when called it returns ByteReceiveRate and ByteSendRate. The Fritz!Box Traffic app simply displays these values, while their calculation is done by the router, which also explains the unrealistically looking graph with two straight lines.

Since this is device-specific, NetWorx instead uses the GetTotalBytesReceived and GetTotalBytesSent commands defined in the UPnP standard. The incorrect graphing shown above is caused by the device seemingly updating the counters every 2 seconds or so, while NetWorx polls the device every second.

This issue could be worked around by smoothing the graph with a simple moving average, which I have just implemented.

Simply download the latest build and see if it improves the charting. If not, go to the hidden settings and make sure Smooth spikes is enabled. Then change Mean samples to something like 10, 20 or 30 until the charting looks better.
wurzel

Re: Reading Fritz!Box 7490 router UPnP   21 January 2016, 02:10

With mean samples set to 30 and spike smoothing enabled the graph looks quite allright. Ofc it loses it's responsiveness a bit, but I guess that's normal considering the whole polling involved. Fritz!Box appearantly doesn't like to stick to standards very much :')
Thanks a lot for your efforts!

Reply to this topic

Sometimes you can find a solution faster if you try the forum search, have a look at the knowledge base, or check the software user manual to see if your question has already been answered.

Our forum rules are simple:

  • Be polite.
  • Do not spam.
  • Write in English. If possible, check your spelling and grammar.

Author:

Email:

Subject

A brief and informative title for your message, approximately 4–8 words:

     

Spam prevention: please enter the following code in the input field below.

 **     **  **     **  **         ********  ******** 
 **     **   **   **   **    **      **     **       
 **     **    ** **    **    **      **     **       
 **     **     ***     **    **      **     ******   
 **     **    ** **    *********     **     **       
 **     **   **   **         **      **     **       
  *******   **     **        **      **     **       

Message: