ip_conntrack with QoS and bandwidth use reporting

Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Contributions Upload
Goto page Previous  1, 2, 3, 4, 5, 6  Next
Author Message
cyberde
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 1488
Location: the Netherlands

PostPosted: Wed Jan 26, 2011 8:22    Post subject: Reply with quote
Hi alexatkinuk, thank you for picking this up so quickly :)

Here you are, I changed my wan-ip with MYWANIP Wink

_________________
Firmware: DD-WRT v24-sp2 (latest available) mega
WRT320N

Donater
Sponsor
hberntsen
DD-WRT Novice


Joined: 26 Jan 2011
Posts: 3

PostPosted: Wed Jan 26, 2011 17:11    Post subject: Reply with quote
I have the same sec0 is not defined error. I'm running
DD-WRT v24-sp2 (08/07/10) std - build 14896 on a TP-Link TL-WR1043ND. I also get the error of 2 missing javascript files: pie.js and wz_jsgraphics.js
hberntsen
DD-WRT Novice


Joined: 26 Jan 2011
Posts: 3

PostPosted: Wed Jan 26, 2011 17:38    Post subject: Reply with quote
I removed these lines from the script:
Code:

  update.onUpdate("ip_conntrack", function(u) {
    eval('setCONTable(' + u.ip_conntrack + ')'); 
    });

And now i can see the traffic per client. I still cant see the hostnames of the clients.(I added my server to /tmp/hosts manually). The 192.168.100.252 ip is my upc cable router connected to the wan port. Network setup: [upc modem/router] --- [wan port of dd-wrt router]. I dont know why it is in this clients list.

When i run the traffic_monitor sh script my router cpu load increases from ~5% to ~35%.
hberntsen
DD-WRT Novice


Joined: 26 Jan 2011
Posts: 3

PostPosted: Wed Jan 26, 2011 20:37    Post subject: Reply with quote
Fixed the sec0 error for me. As you can see in cyberde's conntrack file, there is a secmark=0. The script removes the mark= part, so sec0 remains. In traffic_monitor.sh, line number 48 you need to change
Code:

$(NF-1)

to
Code:

$(NF-2)

Thanks alexatkinuk for this nice script!
The only problem remains that the name of every client is a '*'. I hope the router can handle the cpu usage.

Edit: Found a bug, when i click on a client's ip adress i get an javascript alert with the message 'undefined'
alexatkinuk
DD-WRT User


Joined: 07 Dec 2010
Posts: 129
Location: Sheffield, UK

PostPosted: Fri Jan 28, 2011 6:48    Post subject: Reply with quote
Yes, that was what I thought the issue was but I did not want to suggest making that change as I wanted to know what the field was, so I could detect if it was present or not in traffic_monitor automatically.

The question for me though, why did the contents of ip_conntrack change in newer DD-WRT? A change in the kernel itself?

The alert with undefined is not a bug, its actually intended, an easter egg of sorts. Its debugging code as I want it so if you click on an IP address it does an nslookup on that IP, then remembers the results in the hosts array until you reload the page. I just haven't done it yet. Wink

_________________
2xWZR-HP-G300NH(B) (B0 B0) DD-WRT v24-sp2 (06/14/11) std 17201
One antenna swapped for an RP-SMA connector and 14dB external Yagi.
http://csdprojects.co.uk/ddwrt/
cyberde
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 1488
Location: the Netherlands

PostPosted: Sun Jan 30, 2011 9:15    Post subject: Reply with quote
Changing $(NF-1) to $(NF-2) didn't work on my router tho.
Will wait for your update Smile

_________________
Firmware: DD-WRT v24-sp2 (latest available) mega
WRT320N

Donater
alexatkinuk
DD-WRT User


Joined: 07 Dec 2010
Posts: 129
Location: Sheffield, UK

PostPosted: Thu Feb 03, 2011 1:02    Post subject: Reply with quote
cyberde wrote:
Changing $(NF-1) to $(NF-2) didn't work on my router tho.
Will wait for your update Smile


If that doesn't fix it, I have no idea the cause so it wont get fixed I'm afraid. :(

[EDIT]

Sorry, forum logged me out for some reason do I didn't realise you had included the files I asked for. There is some hope in that case, I will certainly look into it. Smile

_________________
2xWZR-HP-G300NH(B) (B0 B0) DD-WRT v24-sp2 (06/14/11) std 17201
One antenna swapped for an RP-SMA connector and 14dB external Yagi.
http://csdprojects.co.uk/ddwrt/


Last edited by alexatkinuk on Mon Feb 07, 2011 10:20; edited 1 time in total
ddempsey
DD-WRT Novice


Joined: 07 Feb 2011
Posts: 3

PostPosted: Mon Feb 07, 2011 6:05    Post subject: Reply with quote
Hey, looks like an great script, but I have a problem.. The page loads and doesn't report any errors but all it says is CALCULATING...

Attached is a pic
alexatkinuk
DD-WRT User


Joined: 07 Dec 2010
Posts: 129
Location: Sheffield, UK

PostPosted: Mon Feb 07, 2011 11:59    Post subject: Reply with quote
What browser are you using? You need to find the javascript console and see what error it is reporting.

In Firefox:
Tools menu, Error console.

In Google Chrome:
Right click on the page, Inspect Element, click on Console.

_________________
2xWZR-HP-G300NH(B) (B0 B0) DD-WRT v24-sp2 (06/14/11) std 17201
One antenna swapped for an RP-SMA connector and 14dB external Yagi.
http://csdprojects.co.uk/ddwrt/
ddempsey
DD-WRT Novice


Joined: 07 Feb 2011
Posts: 3

PostPosted: Mon Feb 07, 2011 13:11    Post subject: Reply with quote
ahh,

I'm getting

Error: sec0 is not defined
Source File: http://10.0.0.1/user/qos_conntrack.js
Line: 377
alexatkinuk
DD-WRT User


Joined: 07 Dec 2010
Posts: 129
Location: Sheffield, UK

PostPosted: Mon Feb 07, 2011 15:14    Post subject: Reply with quote
ddempsey wrote:
ahh,

I'm getting

Error: sec0 is not defined
Source File: http://10.0.0.1/user/qos_conntrack.js
Line: 377


Good, so its still the known issue.

Try the version I just uploaded. :D

(its only traffic_monitor.sh that needs changing)

_________________
2xWZR-HP-G300NH(B) (B0 B0) DD-WRT v24-sp2 (06/14/11) std 17201
One antenna swapped for an RP-SMA connector and 14dB external Yagi.
http://csdprojects.co.uk/ddwrt/
ddempsey
DD-WRT Novice


Joined: 07 Feb 2011
Posts: 3

PostPosted: Tue Feb 08, 2011 0:43    Post subject: Reply with quote
I find it very slow and sometimes it hangs on firefox3.6.13/ie8
nathanf
DD-WRT Novice


Joined: 02 Feb 2011
Posts: 6

PostPosted: Tue Feb 08, 2011 14:55    Post subject: Reply with quote
Hi there,

I've been looking at these scripts for a bit now, but I am very new to linux/iptables/scripts etc and not had the bottle to install one yet.

This one does look very interesting though. Just a couple of questions.

What time period do the stats cover?

Also,I see that another poster was trying to record historical data for each client and that's what I am hoping to achieve eventually too. Could this be done by using a USB Key or HDD plugged into the router if supported?

Thanks in advance,

Nathan.
alexatkinuk
DD-WRT User


Joined: 07 Dec 2010
Posts: 129
Location: Sheffield, UK

PostPosted: Tue Feb 08, 2011 16:58    Post subject: Reply with quote
ddempsey wrote:
I find it very slow and sometimes it hangs on firefox3.6.13/ie8


Unfortunately I have experienced the same though usually only when the router is under load.

It seems the browser hangs if the router is taking a while to respond to a request for new data. I think its an issue with trying to update every second so one request overlaps another if it takes too long. I am making a few minor changes so you can reduce the refresh rate if you have problems.

In the meantime, I would recommend using Google Chrome as its fast Javascript engine seems to really help reduce the frequency of problems.

nathanf wrote:
Hi there,

I've been looking at these scripts for a bit now, but I am very new to linux/iptables/scripts etc and not had the bottle to install one yet.

This one does look very interesting though. Just a couple of questions.

What time period do the stats cover?

Also,I see that another poster was trying to record historical data for each client and that's what I am hoping to achieve eventually too. Could this be done by using a USB Key or HDD plugged into the router if supported?

Thanks in advance,

Nathan.


The stats time period is from the time you started the traffic_monitor.sh script up until something resets those stats. My script currently never resets them, however the router rebooting or saving any changes in the DD-WRT control panel does.

Its actually something I have been thinking about, how to keep track of when the stats were last reset.

This ties into your second question as I think the only way to keep track would be to log the results and compare them, so if they reset you can make a note of when it happened.

The problem is that for it to work on all routers you can only save to nvram and how much you can save there varies depending on the router. You also shouldn't save there very often, I think ttraff (the traffic monitor on DD-WRT) only saves daily, so that wouldn't really fix our problem.

So yes, using a USB stick should be extremely helpful. However I do not want to make that mandatory as not everyone can use it. It is something I will probably look into though.

_________________
2xWZR-HP-G300NH(B) (B0 B0) DD-WRT v24-sp2 (06/14/11) std 17201
One antenna swapped for an RP-SMA connector and 14dB external Yagi.
http://csdprojects.co.uk/ddwrt/
nathanf
DD-WRT Novice


Joined: 02 Feb 2011
Posts: 6

PostPosted: Wed Feb 09, 2011 8:13    Post subject: Reply with quote
Thanks Alex, that makes a lot of sense Smile

If you do decide to look at getting it working on a USB Stick or other form of USB storage, do let me know as I'd love that functionality.

Tonight I shall be brave and attempt to install your script. Tomorrow I shall most probably go an buy a new router after I make a hash of it! Rolling Eyes lol

Oh and by the way, I am only an hour or so up the M1 from you!

Cheers,

Nathan
Goto page Previous  1, 2, 3, 4, 5, 6  Next Display posts from previous:    Page 3 of 6
Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Contributions Upload 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