I saw the recent thread about live bandwidth monitoring and learned about several tools I was previously unaware of. However, I have a slightly more complex need and am hopeful somebody will have an idea of how I may accomplish this.
I'm planning on implementing traffic shaping on my mail server running FreeBSD 7.1. I'm doing this because my boss sent a 10 meg file to 17 people last week - everybody was complaining to me about how slow it was to check or send mail. While not common, neither is a situation like this uncommon. From my understanding, traffic shaping should eliminate this problem.
To this end, I've written down everything that leaves the box over the DSL line to the internet and prioritized the traffic for each item.
I intend to allow any of these to borrow from the root queue as needed. If I understand things correctly, this should allow everything to function correctly, even if one item is saturating the link.
The problem I'm having is deciding on how much bandwidth to reserve for each item. There's a total of 512k upstream available on the DSL line, which obviously needs to be sliced up in an efficient manner. I can see the total bandwidth used at any given time as well as the peak by using systat -ifstat 1 (very cool), but it's not broken down or limited by port. Looking at the man page for systat, it doesn't look like this is possible with this tool.
I found ntop online, but it has a ton of dependencies that I really don't think I need. (After I get the traffic shaping policy done, I doubt I'll even use it again.) I can dump the packets on a given port with tcpdump, but there's no method that I can see of measuring the current or average data rate. I thought of writing something that would exploit tcpdump to get what I'm looking for (which I'll probably try before installing something with as many dependencies as ntop), but feel that there must be something like this already.
I have two questions:
Does my plan sound like a good one to accomplish the goal of not allowing one item to monopolize the link?
Is there a tool available, preferably either built into the kernel or as a port with minimal dependencies, that can tell me how much bandwidth is used by a given port during a span of time?
I'm planning on implementing traffic shaping on my mail server running FreeBSD 7.1. I'm doing this because my boss sent a 10 meg file to 17 people last week - everybody was complaining to me about how slow it was to check or send mail. While not common, neither is a situation like this uncommon. From my understanding, traffic shaping should eliminate this problem.
To this end, I've written down everything that leaves the box over the DSL line to the internet and prioritized the traffic for each item.
Code:
1 - Answers to DNS requests
2 - Serving web pages
3 - RBL checks
4 - Antivirus update checks
5 - Mail being retrieved by user via IMAP/POP3
6 - Outgoing e-mail
7 - Responding to pings
8 - Traffic from administration laptop
9 - Traffic from WiFi hotspot router
I intend to allow any of these to borrow from the root queue as needed. If I understand things correctly, this should allow everything to function correctly, even if one item is saturating the link.
The problem I'm having is deciding on how much bandwidth to reserve for each item. There's a total of 512k upstream available on the DSL line, which obviously needs to be sliced up in an efficient manner. I can see the total bandwidth used at any given time as well as the peak by using systat -ifstat 1 (very cool), but it's not broken down or limited by port. Looking at the man page for systat, it doesn't look like this is possible with this tool.
I found ntop online, but it has a ton of dependencies that I really don't think I need. (After I get the traffic shaping policy done, I doubt I'll even use it again.) I can dump the packets on a given port with tcpdump, but there's no method that I can see of measuring the current or average data rate. I thought of writing something that would exploit tcpdump to get what I'm looking for (which I'll probably try before installing something with as many dependencies as ntop), but feel that there must be something like this already.
I have two questions:
Does my plan sound like a good one to accomplish the goal of not allowing one item to monopolize the link?
Is there a tool available, preferably either built into the kernel or as a port with minimal dependencies, that can tell me how much bandwidth is used by a given port during a span of time?