Need help with your equipment?
SomeJoe7777's profile

Expert

 • 

9.4K Messages

Monday, November 24th, 2008 4:20 AM

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

Mentor

 • 

47 Messages

15 years ago

Nice job.

Guru

 • 

532 Messages

15 years ago

I  maybe late on finding this thread but....... IM BLOWING MY HEAD OFF!!!! MY NOSE IS BLEEDING. Are you from what planet somejoe777??? :smileyhappy:

Professor

 • 

2.8K Messages

15 years ago

This is fantastic!

Tutor

 • 

7 Messages

14 years ago

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??

Expert

 • 

9.4K Messages

14 years ago

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.

 

Tutor

 • 

7 Messages

14 years ago

Okay ill see what i can do. How do you contact Tier II?

Expert

 • 

9.4K Messages

14 years ago

Call tech support using the number in my signature or using 1-800-ATT-2020, and ask to speak to tier 2.

 

If they can't or won't reduce your profile, contact David and his team using the information in this thread, he can help.

 

Scholar

 • 

85 Messages

13 years ago

How do you know if your switches are VLAN-capable.  I already have a couple but they are D-LINK and at this point, I really only need 3 switches (1 in closet with RG, one for office and one for living room).  Why buy new hardware if what I have will work 🙂

Expert

 • 

9.4K Messages

13 years ago

 


@rharkness wrote:

How do you know if your switches are VLAN-capable.  I already have a couple but they are D-LINK and at this point, I really only need 3 switches (1 in closet with RG, one for office and one for living room).  Why buy new hardware if what I have will work 🙂


 

You will need to get the switch model number and look on D-Link's site for the documentation and see if the switches have VLAN capability.

 

In general, for a switch to be VLAN capable, they have to be a managed switch or a "smart" switch which has a web interface where the various switching features can be configured.

 

Scholar

 • 

85 Messages

13 years ago

I don't think mine are VLAN compatible.  But, I have been wanting to upgrade my network.  I currently have a router/switch in my office that also has 802.11g wireless and a hub in the closet and another really old switch in the living room.

 

I'm slowly trying to get my network capable of keeping the 1000mb throughput my house in case I ever get around to building the media server I want to build  so that I can take the hundreds of DVDs I own and make them easier to access by the family (another topic).


So, I am going to start researching to see about getting VLAN compatible switches.  I personally haven't had much love for netgear of linksys and have been with D-Link for awhile now. But if they don't have it, they don't have it

Not finding what you're looking for?
New to AT&T Community?
New to the AT&T Community? Start by visiting the Community How-To.
New to the AT&T Community?
Visit the Community How-To.