How To Measure Your Internet Usage Using VLANs and MRTG

Expert

How To Measure Your Internet Usage Using VLANs and MRTG

With all the talk of the possible upcoming internet usage caps, I was wondering if there was a way that I could measure my own internet usage.  Although it looks like AT&T will provide us a usage meter that we can check to see the total usage on our own accounts, I wanted to see if I could measure my own usage myself as a cross-check on AT&T.

 

Some people have suggested downloading and installing a personal internet usage meter on your computer.  While this works well in single-computer environments, it doesn't solve the problem when there is more than one computer on your network.  You need a measurement system that can measure all internet traffic from all computers and internet devices.

 

A while back, I came up with a method that could measure the RG's total bandwidth usage using MRTG.  (See this thread over at UverseUsers).  However, this only showed total bandwidth, without regard to what bandwidth was being consumed by TV and what was being used by computers.  Since the proposed internet usage limits would be on computer use only, I needed a method to split the bandwidth usage statistics into IPTV and Internet.

 

To do this, I split up my network using VLAN-capable switches, and then used MRTG to measure only the computer bandwidth portion.

The switches I'm using are Netgear GS-108T switches, which can be had for only $79.00 each for an 8-port Gigabit managed switch -- a really good bargain.  The following is a diagram of my home network -- all connections throughout my network are Cat5e (no coax is used):

 

 

The trick is that the main switch (Switch 1) is uplinked to the RG twice.  Port 1 is a member of VLAN 1, which is carrying all Internet traffic, and port 2 is a member of VLAN 2, carrying IPTV traffic.  This enables MRTG to query port 1 of the switch to get traffic counters for only Internet traffic.  All IPTV traffic travels to/from the RG through port 2, so that traffic is not included in the port 1 counters.

 

The green lines on the diagram are Cat5e links that are carrying 802.1q VLAN-tagged frames.  These Ethernet frames have an additional header on them that tells the switch what VLAN they belong to.  When they get to the switch on the other end, that switch strips off the VLAN tag, and switches the packet only to the ports allowed by that VLAN.  What this essentially means is that the only place in the network where packets can go from VLAN 1 to VLAN 2 (or vice versa) is through the RG.  So, if Desktop 1 tries to ping the Office STB, the ping packet will travel all the way up to the RG and back to reach the Office STB.

 

The reason that switch 1 is uplinked to the RG twice is because the RG is not VLAN-aware.  To the RG, it looks like all 3 STBs are on port 2, and all computer hardware is on port 1.  The RG doesn't know that the network is actually mixed together.

 

The computer labeled as the video server actually runs MRTG.  It queries both the RG (for total VDSL statistics, error counts, and line sync rate/capacity) and switch 1 (to get traffic counters for IPTV and Internet off ports 1 and 2).  These parameters are graphed on the MRTG summary page (available here).

 

The final graph on that page, which shows the total Internet data transferred for the last 30 days, is generated on the fly from the MRTG log files.  If anyone is interested and wants to set this up themselves, I'll provide the source code for that (it's VBscript/ASP).

 

Here's some other examples of how data flows through the network for various functions:

 

1. Watching a live TV program on the Office STB.  Note that this traffic doesn't get counted as Internet traffic because it goes through port 2 of switch 1 (only traffic through port 1 of switch 1 gets counted by MRTG):

 

 

2. Watching a DVD from the Video Server on the Living Room XBox Media Center.  Note that this traffic doesn't get counted anywhere by MRTG because it doesn't traverse port 1 of switch 1:

 

 

3. Downloading a file from the Internet to Desktop 2.  This gets counted as Internet traffic since it flows through switch 1 port 1:

 

 

4. Now the really cool one. :smileyhappy:  Watching a recorded program from the DVR, using THDVR, from a remote location using the Slingbox.  This will get counted as Internet traffic in the upload direction as it traverses switch 1 port 1:

 

 

Now, here are some problems you may run into with the above setup:

 

1. Coax devices cannot get their traffic counted.  Now, this isn't a problem if you're only interested in counting Internet traffic.  However, if you have used the trick where you have an STB connected via coax, and then have used the Cat5e port on the STB as a bridge to a computing device, you won't be able to count the traffic from that computing device.

 

2. You cannot use the RG's built-in wireless if you want to count that traffic.  You must use an external 802.11g/n wireless access point connected to the Internet VLAN to get wireless devices' traffic counted.  This is why I have shown a wireless access point in my diagrams (I haven't installed that yet).

 

3. MRTG runs as a service, so it's required to be installed on a computer that runs 24/7. 

 

I know this setup goes beyond what many people may want to do, but I hope it gives you some ideas of what you might want to try with your network.

 

Message Edited by SomeJoe7777 on 11-24-2008 11:27 AM
Message 1 of 33 (18,378 Views)

Re: How To Measure Your Internet Usage Using VLANs and MRTG

Dude, I love your diagrams.  Were they done in Visio?  Would you be willing to share the original file so we can make our own diagrams of our networks?  Thanks!
Message 2 of 33 (17,961 Views)
Guru

Re: How To Measure Your Internet Usage Using VLANs and MRTG

This is very helpful!
Message 3 of 33 (17,961 Views)
Expert

Re: How To Measure Your Internet Usage Using VLANs and MRTG

[ Edited ]

I thought about using Visio, but I just whipped these up in Photoshop.  Basically each element is in its own layer so I could move them around while making the diagram.  If you want to downlaod the Photoshop document, it's available here.

 

Message 4 of 33 (17,961 Views)
Employee

Re: How To Measure Your Internet Usage Using VLANs and MRTG

I am not sure if the individual can measure usage in a complex setup like yours. The internet, phone, and the tv are seperate streams because of QoS. Basicly they are like vlan circuits. The RG if programmed should be able to display the usage of each stream. I have no idea how or what they are doing in Reno. So knowledge wise I am in the same boat as the rest of you.
Employee Contributor*
*I am an AT&T employee and the postings on this site are my own and don't necessarily represent AT&T's position, strategies or opinions.
Message 5 of 33 (17,961 Views)

Re: How To Measure Your Internet Usage Using VLANs and MRTG

If all your STBs are on coax and all your computers are on a seperate router behind the RG, I believe you could use this page to monitor internet usage (http://192.168.1.254/xslt?PAGE=J07).

                              

Message 6 of 33 (17,961 Views)

Re: How To Measure Your Internet Usage Using VLANs and MRTG


SomeJoe7777 wrote:

I thought about using Visio, but I just whipped these up in Photoshop.  Basically each element is in its own layer so I could move them around while making the diagram.  If you want to downlaod the Photoshop document, it's available here.

 


Thanks, that's great.

 

Also thanks to the other Joe for posting the link to the Console.

Message 7 of 33 (17,961 Views)

Re: How To Measure Your Internet Usage Using VLANs and MRTG

[ Edited ]

Holy cow, I had a T2 tech call my network "scary" because I had more than one switch in my setup. The poor guy they sent to you must have crapped his pants and jumpped out the window Smiley Very Happy

                              

Message 8 of 33 (17,961 Views)
Expert

Re: How To Measure Your Internet Usage Using VLANs and MRTG

Wow! :smileysurprised:
Message 9 of 33 (17,961 Views)
Teacher

Re: How To Measure Your Internet Usage Using VLANs and MRTG

Kudos given!

 

Nice diagram. Nobody can done it better.

Message 10 of 33 (17,961 Views)
Mentor

Re: How To Measure Your Internet Usage Using VLANs and MRTG

Nice job.
Message 11 of 33 (14,562 Views)

Re: How To Measure Your Internet Usage Using VLANs and MRTG

I  maybe late on finding this thread but....... IM BLOWING MY HEAD OFF!!!! MY NOSE IS BLEEDING. Are you from what planet somejoe777??? :smileyhappy:
Message 12 of 33 (14,562 Views)
Professor

Re: How To Measure Your Internet Usage Using VLANs and MRTG

This is fantastic!
Message 13 of 33 (14,562 Views)
Tutor

Re: How To Measure Your Internet Usage Using VLANs and MRTG

SomeJoe, I have 3 NetGear switches in my house, now how do I get them to run like your network? Cause sometimes I get high ping times while Online Gaming on PS3. I have a switch in my room running a STB and my PS3. Another switch is in the Living Room with the DVR and the last one is the closest to the RG with a NetGear Switch running the computer and a STB. Can you help or give me some advice??

Message 14 of 33 (14,562 Views)
Expert

Re: How To Measure Your Internet Usage Using VLANs and MRTG

First, you need to have your line profile changed (I replied to your other post) so that your line runs properly.  If the latency persists after that then we'll address it.

 

Message 15 of 33 (14,562 Views)
Share this topic
Announcements

Welcome to the AT&T Community Forums!!! Stop by the Community How-To section for tips on how to get started.