Author Topic: limit bandwidth of a lan port by an avr MCU  (Read 6217 times)

0 Members and 1 Guest are viewing this topic.

Offline m.m.mTopic starter

  • Regular Contributor
  • *
  • Posts: 105
  • Country: ir
  • EE MSc Student and Hobbyist
limit bandwidth of a lan port by an avr MCU
« on: November 15, 2013, 12:03:24 pm »
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.
25 y/o Electronics Lover
 

Online Monkeh

  • Super Contributor
  • ***
  • Posts: 7990
  • Country: gb
Re: limit bandwidth of a lan port by an avr MCU
« Reply #1 on: November 15, 2013, 12:14:15 pm »
Even if you could do it, you'd have to learn ten times what the QoS page of your router requires.
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: limit bandwidth of a lan port by an avr MCU
« Reply #2 on: November 15, 2013, 12:18:30 pm »
Quote
is it possible?

It is possible for some people.

However, if the qos settings confuse you, it is probably not possible for you.
================================
https://dannyelectronics.wordpress.com/
 

alm

  • Guest
Re: limit bandwidth of a lan port by an avr MCU
« Reply #3 on: November 15, 2013, 12:33:47 pm »
Building a repeater with an ATmega handling the traffic will certainly limit the bandwidth.
 

Offline Psi

  • Super Contributor
  • ***
  • Posts: 9889
  • Country: nz
Re: limit bandwidth of a lan port by an avr MCU
« Reply #4 on: November 15, 2013, 12:41:21 pm »
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 do

Step2: 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 IP

Step6: Point the webbrower on another PC to the monowall IP

Step7: Configure IP's, DHCP

Step8: 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.
« Last Edit: November 15, 2013, 01:02:12 pm by Psi »
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline amyk

  • Super Contributor
  • ***
  • Posts: 8240
Re: limit bandwidth of a lan port by an avr MCU
« Reply #5 on: November 15, 2013, 12:51:31 pm »
Building a repeater with an ATmega handling the traffic will certainly limit the bandwidth.
That was my thought too...
 

Offline madires

  • Super Contributor
  • ***
  • Posts: 7695
  • Country: de
  • A qualified hobbyist ;)
Re: limit bandwidth of a lan port by an avr MCU
« Reply #6 on: November 15, 2013, 04:17:58 pm »
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.
 

Offline Stonent

  • Super Contributor
  • ***
  • Posts: 3824
  • Country: us
Re: limit bandwidth of a lan port by an avr MCU
« Reply #7 on: November 15, 2013, 05:13:21 pm »
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.
The larger the government, the smaller the citizen.
 

Offline Psi

  • Super Contributor
  • ***
  • Posts: 9889
  • Country: nz
Re: limit bandwidth of a lan port by an avr MCU
« Reply #8 on: November 16, 2013, 02:18:00 am »
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.
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline c4757p

  • Super Contributor
  • ***
  • Posts: 7799
  • Country: us
  • adieu
Re: limit bandwidth of a lan port by an avr MCU
« Reply #9 on: November 16, 2013, 02:28:06 am »
modifying the fairness

This phrase just about sounds lifted from an Orwell novel.
No longer active here - try the IRC channel if you just can't be without me :)
 

Offline madires

  • Super Contributor
  • ***
  • Posts: 7695
  • Country: de
  • A qualified hobbyist ;)
Re: limit bandwidth of a lan port by an avr MCU
« Reply #10 on: November 16, 2013, 11:06:51 pm »
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.

Both use different concepts and methods, but also overlap a little bit. So I wouldn't say that they are nearly the same. Please see  https://en.wikipedia.org/wiki/Traffic_shaping and https://en.wikipedia.org/wiki/Quality_of_service for a more detailed explanation. And if that isn't enough you can get tons of literature and white papers about both topics :-)
 

Offline Psi

  • Super Contributor
  • ***
  • Posts: 9889
  • Country: nz
Re: limit bandwidth of a lan port by an avr MCU
« Reply #11 on: November 16, 2013, 11:10:58 pm »
There interchangeable in conversation, but yeah. Different apporaches
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline m.m.mTopic starter

  • Regular Contributor
  • *
  • Posts: 105
  • Country: ir
  • EE MSc Student and Hobbyist
Re: limit bandwidth of a lan port by an avr MCU
« Reply #12 on: November 19, 2013, 07:49:46 pm »
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.
25 y/o Electronics Lover
 

alm

  • Guest
Re: limit bandwidth of a lan port by an avr MCU
« Reply #13 on: November 19, 2013, 08:14:16 pm »
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.
 

Offline ColinB

  • Contributor
  • Posts: 23
Re: limit bandwidth of a lan port by an avr MCU
« Reply #14 on: November 26, 2013, 02:48:44 pm »
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.
 

Offline m.m.mTopic starter

  • Regular Contributor
  • *
  • Posts: 105
  • Country: ir
  • EE MSc Student and Hobbyist
Re: limit bandwidth of a lan port by an avr MCU
« Reply #15 on: November 26, 2013, 04:30:55 pm »
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.
thanks, 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?
25 y/o Electronics Lover
 

Offline madires

  • Super Contributor
  • ***
  • Posts: 7695
  • Country: de
  • A qualified hobbyist ;)
Re: limit bandwidth of a lan port by an avr MCU
« Reply #16 on: November 26, 2013, 05:25:18 pm »
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.
thanks, 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?

Please see http://wiki.openwrt.org/doc/howto/packet.scheduler/packet.scheduler for a starting point or search for "OpenWRT traffic shaping".
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf