Network Emulator (Netem) on DD-WRT for Netgear R7000

Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware
Author Message
cgavriluta
DD-WRT Novice


Joined: 28 Jul 2016
Posts: 5

PostPosted: Thu Jul 28, 2016 14:48    Post subject: Network Emulator (Netem) on DD-WRT for Netgear R7000 Reply with quote
Is it possible to somehow get Netem on the dd-wrt for netgear's r7000?
I am aware of this post: http://www.dd-wrt.com/phpBB2/viewtopic.php?p=725945
But none of the links are still valid.
Any pointers to a clean and actual step by step instruction?
Sponsor
<Kong>
DD-WRT Guru


Joined: 15 Dec 2010
Posts: 4339
Location: Germany

PostPosted: Thu Jul 28, 2016 16:15    Post subject: Re: Network Emulator (Netem) on DD-WRT for Netgear R7000 Reply with quote
cgavriluta wrote:
Is it possible to somehow get Netem on the dd-wrt for netgear's r7000?
I am aware of this post: http://www.dd-wrt.com/phpBB2/viewtopic.php?p=725945
But none of the links are still valid.
Any pointers to a clean and actual step by step instruction?


Netem is already compiled into the kernel which is shipped with the R7000.

_________________
KONG PB's: http://www.desipro.de/ddwrt/
KONG Info: http://tips.desipro.de/
cgavriluta
DD-WRT Novice


Joined: 28 Jul 2016
Posts: 5

PostPosted: Fri Jul 29, 2016 11:56    Post subject: Re: Network Emulator (Netem) on DD-WRT for Netgear R7000 Reply with quote
<Kong> wrote:

Netem is already compiled into the kernel which is shipped with the R7000.


Then I might be doing something wrong. These are my steps:
1. Flash dd-wrt for r7000 taken from here http://www.desipro.de/ddwrt-ren/K3-AC-Arm/Initial/
2. SSH into the router
3. ddup --flash-latest to update to the latest version (completes succesfully)
4. Run test case:
Step 1:
Code:

root@DD-WRT:~# tc qdisc add dev eth0 root handle 1: tbf rate 220kbit latency 50ms burst 1540
root@DD-WRT:~# tc qdisc
qdisc noqueue 0: dev lo root refcnt 2
qdisc tbf 1: dev eth0 root refcnt 2 rate 220000bit burst 1540b lat 3.2ms
qdisc noqueue 0: dev vlan1 root refcnt 2
qdisc noqueue 0: dev vlan2 root refcnt 2
qdisc fq_codel 0: dev eth1 root refcnt 2 limit 10240p flows 1024 quantum 1514 target 5.0ms interval 100.0ms ecn
qdisc fq_codel 0: dev eth2 root refcnt 2 limit 10240p flows 1024 quantum 1514 target 5.0ms interval 100.0ms ecn
qdisc noqueue 0: dev br0 root refcnt 2

Step 1 worked fine, now trying to add a netem discipline.
Step2:
Code:

root@DD-WRT:~# tc qdisc add dev eth0 parent 1: handle 2: netem latency 100ms
root@DD-WRT:~# tc qdisc
qdisc noqueue 0: dev lo root refcnt 2
qdisc tbf 1: dev eth0 root refcnt 2 rate 220000bit burst 1540b lat 3.2ms
qdisc noqueue 0: dev vlan1 root refcnt 2
qdisc noqueue 0: dev vlan2 root refcnt 2
qdisc fq_codel 0: dev eth1 root refcnt 2 limit 10240p flows 1024 quantum 1514 target 5.0ms interval 100.0ms ecn
qdisc fq_codel 0: dev eth2 root refcnt 2 limit 10240p flows 1024 quantum 1514 target 5.0ms interval 100.0ms ecn
qdisc noqueue 0: dev br0 root refcnt 2

As you can see the netem discipline is not added. Also if I look at the loaded modules:
Code:

root@DD-WRT:~# lsmod
Module                  Size  Used by
nf_nat_pptp             1584  0
nf_conntrack_pptp       3190  1 nf_nat_pptp
nf_nat_proto_gre         929  1 nf_nat_pptp
nf_conntrack_proto_gre     2783  1 nf_conntrack_pptp
ext4                  304978  1
jbd2                   47832  1 ext4
mbcache                 6944  1 ext4
crc16                   1060  1 ext4
usb_storage            36685  1
sr_mod                 11068  0
cdrom                  24143  1 sr_mod
sd_mod                 23511  2
scsi_mod               83092  3 usb_storage,sr_mod,sd_mod
xhci_plat_hcd           2052  0
xhci_pci                2440  0
xhci_hcd               82223  2 xhci_plat_hcd,xhci_pci
ohci_hcd               15999  0
ehci_pci                2826  0
ehci_hcd               32871  1 ehci_pci
usbcore               120574  8 usb_storage,xhci_plat_hcd,xhci_pci,xhci_hcd,ohci_hcd,ehci_pci,ehci_hcd
usb_common              1589  1 usbcore
wl                   4255061  0
igs                     9587  1 wl
emf                    12775  2 wl,igs
switch_robo             9324  0
switch_core             4930  1 switch_robo
et                     42478  0


sch_neten is not between the modules.
I ran the exact same commands on a raspberry pi (the only other linux I have at hand) and they all worked. The behavior is the expected one, and sch_netem is between the modules when I run lsmod.

Am I missing something? Am I not using the right build version?

Also, don't know if related, but the version of iproute2 is ss050330 on the router and ss140804 on the raspberry.
<Kong>
DD-WRT Guru


Joined: 15 Dec 2010
Posts: 4339
Location: Germany

PostPosted: Fri Jul 29, 2016 12:21    Post subject: Re: Network Emulator (Netem) on DD-WRT for Netgear R7000 Reply with quote
cgavriluta wrote:


sch_neten is not between the modules.
I ran the exact same commands on a raspberry pi (the only other linux I have at hand) and they all worked. The behavior is the expected one, and sch_netem is between the modules when I run lsmod.

Am I missing something?


As I said, netem is compiled directly into the kernel, not compiled as loadable module, thus you don't need to load it and it won't show up under loaded modules.

Your problem is, that the shipped tc does not have netem support. Thus either need to compile a full blown tc or install it through additional packages.

I have such a package in my private repo, but have not pushed this to the public repo. If I find the time, I can give it a short test and sync my publich package repo.

_________________
KONG PB's: http://www.desipro.de/ddwrt/
KONG Info: http://tips.desipro.de/
cgavriluta
DD-WRT Novice


Joined: 28 Jul 2016
Posts: 5

PostPosted: Fri Jul 29, 2016 12:43    Post subject: Re: Network Emulator (Netem) on DD-WRT for Netgear R7000 Reply with quote
<Kong> wrote:

I have such a package in my private repo, but have not pushed this to the public repo. If I find the time, I can give it a short test and sync my publich package repo.


Would that mean that I would be able to install it with the ipkg tool? If yes then that would be wonderful!
cgavriluta
DD-WRT Novice


Joined: 28 Jul 2016
Posts: 5

PostPosted: Sun Aug 21, 2016 10:25    Post subject: Re: Network Emulator (Netem) on DD-WRT for Netgear R7000 Reply with quote
<Kong> wrote:

I have such a package in my private repo, but have not pushed this to the public repo. If I find the time, I can give it a short test and sync my publich package repo.


Hi Kong!
Any new developments on this?
<Kong>
DD-WRT Guru


Joined: 15 Dec 2010
Posts: 4339
Location: Germany

PostPosted: Sun Aug 21, 2016 13:06    Post subject: Re: Network Emulator (Netem) on DD-WRT for Netgear R7000 Reply with quote
cgavriluta wrote:
<Kong> wrote:

I have such a package in my private repo, but have not pushed this to the public repo. If I find the time, I can give it a short test and sync my publich package repo.


Hi Kong!
Any new developments on this?


I already updated my package repo.

_________________
KONG PB's: http://www.desipro.de/ddwrt/
KONG Info: http://tips.desipro.de/
gw_1984
DD-WRT Novice


Joined: 25 Aug 2016
Posts: 4

PostPosted: Mon Aug 29, 2016 18:11    Post subject: Reply with quote
Hi Kong,

I am setting up my Asus RT-N66U(mips) router using v3.0. Do you have mips version of tc?

thank you very much!
cgavriluta
DD-WRT Novice


Joined: 28 Jul 2016
Posts: 5

PostPosted: Wed Sep 07, 2016 13:50    Post subject: Re: Network Emulator (Netem) on DD-WRT for Netgear R7000 Reply with quote
gw_1984 wrote:
Hi Kong,

I am setting up my Asus RT-N66U(mips) router using v3.0. Do you have mips version of tc?

thank you very much!


For the R7000 I installed the package called 'tc-legacy - 2.6.39-1'. It installs under /opt/sbin/tc. Now I am able to run:
Code:
/opt/sbin/tc qdisc add dev eth0 root netem delay 100ms
and it has the expected effect!

Btw, if this is your package Kong, then thank you very much![/code]
drnorton
DD-WRT User


Joined: 08 Dec 2009
Posts: 137

PostPosted: Mon Dec 18, 2017 14:42    Post subject: Reply with quote
Can someone tell me what I must write as command
to delay a port range from 27000 to 27050

Like this ??

/opt/sbin/tc qdisc add dev eth0 root netem dport 27000 delay 50ms

thanks..
drnorton
DD-WRT User


Joined: 08 Dec 2009
Posts: 137

PostPosted: Fri Dec 07, 2018 8:47    Post subject: Reply with quote
Sorry when I activate this old thread.

Hello Kong,
can you tell me how I can manage a delay for special IP Adresses in LAN ?

I use this for now.
tc qdisc add dev eth0 root netem delay 50ms

But this will reduce the connection speed for all Ip adresses in LAN. I like to have it only for 4 or 5 adresses or for a ip range like 192.168.6.30 - 192.168.6.40.

Thanks
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum