limit bandwidth of a lan port by an avr MCU - Page 1
Forum section: electronics / general

author: m.m.m
author_rank: Regular Contributor
timestamp: November 15, 2013, 12:03:24 pm
content: hi everyone, I wanted to limit the bandwidth of an ethernet connection, since I don't have access to the computer using the bandwidth, and the QOS configuration of the router confused me at all and couldn't get it working that way so I decided to do it in this way, I want a device having an ethernet input and an ethernet output and be able to control the output ethernet port bandwidth by the MCU using uart or by a webpage on the network. I also would prefer avr because I only have an avr programmer.is it possible? I know the uart interfacing part. the only part I don't know is the bandwidth limitation.

author: Monkeh
author_rank: Super Contributor
timestamp: November 15, 2013, 12:14:15 pm
content: Even if you could do it, you'd have to learn ten times what the QoS page of your router requires.

author: dannyf
author_rank: Super Contributor
timestamp: November 15, 2013, 12:18:30 pm
content: QuoteIt is possible for some people.However, if the qos settings confuse you, it is probably not possible for you.

author: Unknown
author_rank: Unknown
timestamp: November 15, 2013, 12:33:47 pm
content: Building a repeater with an ATmega handling the traffic will certainly limit the bandwidth.

author: Psi
author_rank: Super Contributor
timestamp: November 15, 2013, 12:41:21 pm
content: If you can't figure out how to setup the QOS on your existing modem the following will be just as hard and not much use. But.. if the QOS on your existing modem is just shit and doesn't work properly like most of the cheap modems then the following will provide a much better QOS type system.Step1: Get an old computer, anything faster than a Pentium 1 will doStep2: Insert two PCI network cards into it.Step3: Download and copy monowall onto the computers HDD (its an entire OS running freeBSD not an app)Step4: Connect one port to your internet connection and the other to your switch/hub that supplies internet to the house/business.Step5: If using an ADSL modem for internet set it to bridged mode so it gives monowall your public IPStep6: Point the webbrower on another PC to the monowall IPStep7: Configure IP's, DHCPStep8: Restart computer and monowall box and just check your internet is all working fine. No point continuing until you have the internet part working.Step9: Point the webbrowser on another PC to monowalls IP again. Now you can enable and play with the monowall trafficshaper.Setup PIPES, QUEUES and RULES.Rules allow you to treat traffic differently based on IP/PORT/SOURCE/DESTINATION. Rules apply to QUEUEs.A queue uses a particular PIPE which is a set amount of your bandwidth.All done.

author: amyk
author_rank: Super Contributor
timestamp: November 15, 2013, 12:51:31 pm
content: Quote from: alm on November 15, 2013, 12:33:47 pmThat was my thought too...

author: madires
author_rank: Super Contributor
timestamp: November 15, 2013, 04:17:58 pm
content: Limiting the overall ethernet bandwidth isn't QoS, it's called traffic shaping. The cheap solution is to get a simple DSL router supported by OpenWRT and to install a traffic shaper. If you can get an used managed switch supporting traffic shaping use that one. It may also replace the current dumb switch.

author: Stonent
author_rank: Super Contributor
timestamp: November 15, 2013, 05:13:21 pm
content: I'm almost picturing some guy playing Call of Duty and suddenly his big sister fires up Netflix on her laptop and he keeps lagging.

author: Psi
author_rank: Super Contributor
timestamp: November 16, 2013, 02:18:00 am
content: QOS and 'traffic shaping' are more or less interchangeable.But QOS is all about maintaining quality/fairness where as traffic shaping is about modifying the fairness based on rules.

author: c4757p
author_rank: Super Contributor
timestamp: November 16, 2013, 02:28:06 am
content: Quote from: Psi on November 16, 2013, 02:18:00 amThis phrase just about sounds lifted from an Orwell novel.

author: madires
author_rank: Super Contributor
timestamp: November 16, 2013, 11:06:51 pm
content: Quote from: Psi on November 16, 2013, 02:18:00 amBoth use different concepts and methods, but also overlap a little bit. So I wouldn't say that they are nearly the same. Please seehttps://en.wikipedia.org/wiki/Traffic_shapingandhttps://en.wikipedia.org/wiki/Quality_of_servicefor a more detailed explanation. And if that isn't enough you can get tons of literature and white papers about both topics :-)

author: Psi
author_rank: Super Contributor
timestamp: November 16, 2013, 11:10:58 pm
content: There interchangeable in conversation, but yeah. Different apporaches

author: m.m.m
author_rank: Regular Contributor
timestamp: November 19, 2013, 07:49:46 pm
content: thanks a lot everyone, found a post about QOS, and so far I got from that post, QOS only can do some managements on uplink, not for the download rate.I'm currently working on my broken wifi router to get open-wrt on it. I think it's the easiest and best solution.

author: Unknown
author_rank: Unknown
timestamp: November 19, 2013, 08:14:16 pm
content: QoS on downstream traffic is tricky and may not work as expected. If some hosts keeps sending packets through your slow cable/DSL connection, what good is queueing packets in your router going to do? Queueing and prioritizing is pointless on downstream traffic. The traffic is already past the bottleneck, so prioritizing one type over the other is not going to do much good on a 1Gbit/s ethernet link. Dropping packets sometimes works, but depends on the protocol to detect the dropped packets, interpret it as congestion and slow down.

author: ColinB
author_rank: Contributor
timestamp: November 26, 2013, 02:48:44 pm
content: If you have a hard or impossible time getting OpenWRT on your existing router, you can get a TP-Link TL-WR841N for only USD 20.00 , I just got one and it is super easy and quick to install OpenWRT on it, and it just works.

author: m.m.m
author_rank: Regular Contributor
timestamp: November 26, 2013, 04:30:55 pm
content: Quote from: ColinB on November 26, 2013, 02:48:44 pmthanks, can you explain more about it? which method does OpenWRT use and how much effect does it do, and which options does it have for limiting bandwidth? can you please take a screenshot of the configuration page?

author: madires
author_rank: Super Contributor
timestamp: November 26, 2013, 05:25:18 pm
content: Quote from: m.m.m on November 26, 2013, 04:30:55 pmPlease seehttp://wiki.openwrt.org/doc/howto/packet.scheduler/packet.schedulerfor a starting point or search for "OpenWRT traffic shaping".