Network Emulator (Netem) on DD-WRT

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


Joined: 09 Dec 2010
Posts: 4

PostPosted: Fri Dec 10, 2010 10:11    Post subject: Network Emulator (Netem) on DD-WRT Reply with quote
I am trying to figure out how I can use NETEM module in DD-WRT , e.g,

# tc qdisc change dev eth0 root netem delay 100ms 10ms

and...

# tc qdisc change dev eth0 root netem loss .1%

I have seen some people doing it on OPENWRT but no one seems to have done it on DD-WRT. Here are the things that I have tried already.

I tried using "ipkg install ip tc" but apparently NETEM module does no come with these packages..

I used the frimware modification kit to copy "q_netem.o" and "sch_netem.so" from a similar kernel into my image file. But when I run "insmod sch_netem" nothing happens...

I figured maybe the best way is to compile a custom image but I have not been successful in building DD-WRT v.24. The current-toolchain that I downloaded does not seem to work for me at all. I keep getting syntax errors and cannot compile.


Does anyone know how I can run NETEM or compile a custom image with NETEM (compatible with my WGR614v8)? I would really appreciate any help.
Sponsor
oxygenx
DD-WRT Guru


Joined: 11 Nov 2007
Posts: 566

PostPosted: Fri Dec 10, 2010 14:57    Post subject: Reply with quote
you should really use openwrt then.
_________________
Router: WNDR3300 (wl0: n-Only 5Ghz, WPA2-AES, wl1: g-Only, WPA-Mixed-Mixed)
WDS Node 1: WNDR3300 (wl0: n-Only 5Ghz, WPA2-AES, WDS-connected Router, wl1: g-Only WPA-Mixed-Mixed)
WDS Node 2: WRT54GL (g-Only, WPA-Mixed-Mixed WDS-connected to Router)
Modem: Cisco EPC3202
clients: Notebook 1, D-Link 323, PS3 Slim, Kathrein UFC960 connected to WDS Node 1 via Gigabit Switch. Notebook 2, Deskjet 6980 connected to WDS Node 2
praxio
DD-WRT Novice


Joined: 09 Dec 2010
Posts: 4

PostPosted: Sat Dec 11, 2010 11:09    Post subject: Reply with quote
oxygenx wrote:
you should really use openwrt then.


I tried, the issue is that my router (WGR614v8) is not supported by openwrt... just bricks my router. any idea how to use netem on DD-WRT?


Last edited by praxio on Sat Dec 11, 2010 11:52; edited 1 time in total
phuzi0n
DD-WRT Guru


Joined: 10 Oct 2006
Posts: 10075

PostPosted: Sat Dec 11, 2010 11:17    Post subject: Reply with quote
praxio wrote:
The issue is that my router (WGR614v8) is not supported by OPENWRT... any idea how to use netem on DD-WRT?

Compile the module or whole firmware yourself.

_________________
Read the forum announcements thoroughly! Be cautious if you're inexperienced.
Available for paid consulting.
Looking for bricks and spare routers to expand my collection.
praxio
DD-WRT Novice


Joined: 09 Dec 2010
Posts: 4

PostPosted: Mon Dec 13, 2010 14:03    Post subject: Reply with quote
DONE IT.

Building the whole firmware did not work for me. I compiled the modules and modified the firmware using firmware modification toolkit. Here are the instructions:

- Compile DD-WRT. See instructions at (http://www.dd-wrt.com/phpBB2/viewtopic.php?t=28348 ).
- Under src/router run 'make menuconfig'. make sure you select the netem module in linux kernel configuration : networking options --> QOS and fair Queuing --> (M) Network Emulator

- run install script and compile DD-WRT.
- find your q_netem.so in src/router/iproute2/tc/
- find your sch_netem.o in src/linux/brcm/linux_v24_2/net/sched/

- Checkout firmware modification toolkit.

$ mkdir firmware_mod_kit
$ cd firmware_mod_kit
$ svn checkout http://firmware-mod-kit.googlecode.com/svn/trunk/ firmware-mod-kit-read-only
$ cd firmware-mod-kit-read-only/trunk

- Extract the firmware you are using (I used a generic mini build):

$ ./extract_firmware.sh dd-wrt.v24_mini_generic.bin dd-wrt.v24_mini_generic

- Go to the extracted firmware directory, under rootfs:

$ cd dd-wrt.v24_mini_generic/rootfs

- copy q_netem.so to usr/lib

$ cp ~/DD-WRT/src/router/iproute2/tc/q_netem.so usr/lib

- copy sch_netem.so to lib/modules/2.4.36

$ cp ~/DD-WRT/src/router/linux/linux/net/sch/sch_netem.o lib/modules/2.4.37

- build the modified firmware:

$ cd ../../
$ ./build_firmware.sh dd-wrt.v24_mini_generic_netem dd-wrt.v24_mini_generic

- Your custom image is now in dd-wrt.v24_mini_generic_netem , upgrade your router with the image, then telnet to the router and run :

$ insmod sch_netem
$ lsmod

- You should be abale to see sch_netem is installed. netem should be working now. Run these commands to check:

$ tc qdisc add dev eth0 root netem delay 10ms
$ tc qdisc add dev eth0 root netem loss 20%
makaveli101
DD-WRT Novice


Joined: 17 May 2010
Posts: 35

PostPosted: Wed Nov 28, 2012 1:11    Post subject: Reply with quote
could you please make a fw with netdem for me? i use dir-615d r15778 (the only stable build)
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum 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