2010-12-21 14:24:15     Getting netem to run

Document created by Aaronwu Employee on Aug 25, 2013
Version 1Show Document
  • View in full screen mode

2010-12-21 14:24:15     Getting netem to run

Steve Strobel (UNITED STATES)

Message: 96923   

 

I am trying to get netem working (to help test a VoIP jitter buffer) using Linux release 2.6.28.10-ADI-2009R1.1 on a BF-537.  I was able to get it to build by enabling NET_SCH_NETEM in the kernel config and in the app/library config, CONFIG_USER_IPROUTE2_TC_TC and USER_IPROUTE2_IP_IP with the attached patch.  The sch_netem module seems to load fine:

 

root:~> modprobe sch_netem

netem: version 1.2

root:/usr/lib> lsmod

Module                  Size  Used by

sch_netem               5488  0

 

But when I try to use it as decribed   www.linuxfoundation.org/collaborate/workgroups/networking/netem, I can't get it to work:

 

root:~> tc qdisc add dev eth0 root netem delay 100ms

Unknown qdisc "netem", hence option "delay" is unparsable

 

I searched for others getting that error message and found that they had problems with a shared library, tc being too old, and iproute.spec needing patched (Redhat), but I haven't been able to figure out the problem in this case.  Any suggestions appreciated.

 

Someone on the Black Asterisk IP-PBX forum mentioned netem here:    tinyurl.com/35ywevh

 

Steve

 

netem.patch

QuoteReplyEditDelete

 

 

2010-12-21 14:35:12     Re: Getting netem to run

Mike Frysinger (UNITED STATES)

Message: 96924   

 

are you building as FLAT or FDPIC ?

QuoteReplyEditDelete

 

 

2010-12-21 15:06:32     Re: Getting netem to run

Steve Strobel (UNITED STATES)

Message: 96925   

 

FDPIC.  I think that was necessary at least at one time to use ALSA.  Related info:

 

 

 

Blackfin build options:  Binary format (FDPIC)  --->   

 

 

 

Executable file formats

[*] Kernel support for FDPIC ELF binaries

[*] Kernel support for flat binaries

[*]   Enable ZFLAT support

[ ]   Enable shared FLAT support

< > Kernel support for MISC binaries

Steve

QuoteReplyEditDelete

 

 

2010-12-21 17:38:57     Re: Getting netem to run

Steve Strobel (UNITED STATES)

Message: 96926   

 

Does the strace info help?  I am not sure how to decipher it:

 

strace tc qdisc add dev eth0 root netem delay 100ms

execve(NULL, [0x265fe48], [/* 0 vars */] <unfinished ...>

mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x28cd000

stat("/etc/ld.so.cache", {st_mode=S_IFREG|0644, st_size=1724, ...}) = 0

open("/etc/ld.so.cache", O_RDONLY)      = 3

mmap2(NULL, 1724, PROT_READ, MAP_PRIVATE, 3, 0) = 0x28cc000

close(3)                                = 0

open("/lib/libm.so.0", O_RDONLY)        = 3

fstat(3, {st_mode=S_IFREG|0755, st_size=66708, ...}) = 0

mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x28c9000

read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0j\0\1\0\0\0@\33\0\0004\0\0\0\24"..., 4096) = 4096

mmap2(NULL, 65312, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE|MAP_EXECUTABLE, 3, 0) = 0x2910000

mmap2(NULL, 4524, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x28aa000

pread(3, "\3\0{0\377\343\2\225\0372\377\343\315\370\0372\377\343\20\225\1\350\0\0008\5\20\0x\5\0\350\3"..., 4520, 61440) = 4520

close(3)                                = 0

munmap(0x28c9000, 4096)                 = 0

open("/lib/libresolv.so.0", O_RDONLY)   = 3

fstat(3, {st_mode=S_IFREG|0755, st_size=1756, ...}) = 0

mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x28c9000

read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0j\0\1\0\0\0\20\3\0\0004\0\0\0\254"..., 4096) = 1756

mmap2(NULL, 868, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE|MAP_EXECUTABLE, 3, 0) = 0x1ef5000

mmap2(NULL, 1028, PROT_READ|PROT_WRITE, MAP_PRIVATE, 3, 0) = 0x28cb000

close(3)                                = 0

munmap(0x28c9000, 4096)                 = 0

open("/lib/libgcc_s.so.1", O_RDONLY)    = 3

fstat(3, {st_mode=S_IFREG|0755, st_size=52304, ...}) = 0

mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x28c9000

read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0j\0\1\0\0\0\254#\0\0004\0\0\0\220"..., 4096) = 4096

mmap2(NULL, 48352, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE|MAP_EXECUTABLE, 3, 0) = 0x2980000

mmap2(NULL, 6264, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x255c000

pread(3, "\1\350\0\0\20\0\0\0\0\0\0\350\0\0\1\350\0\0\0`\20\0\0\0\32\345\t\0\0\350\3\0S"..., 6104, 45056) = 6104

close(3)                                = 0

munmap(0x28c9000, 4096)                 = 0

open("/lib/libc.so.0", O_RDONLY)        = 3

fstat(3, {st_mode=S_IFREG|0755, st_size=258356, ...}) = 0

mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x28c9000

read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0j\0\1\0\0\0\274\312\0\0004\0\0\0L"..., 4096) = 4096

mmap2(NULL, 250424, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE|MAP_EXECUTABLE, 3, 0) = 0x29c0000

mmap2(NULL, 15780, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2548000

pread(3, "ECT\0--\0\0%s: option `%s' is ambigu"..., 6700, 249856) = 6700

close(3)                                = 0

munmap(0x28c9000, 4096)                 = 0

open("/lib/libc.so.0", O_RDONLY)        = 3

fstat(3, {st_mode=S_IFREG|0755, st_size=258356, ...}) = 0

close(3)                                = 0

open("/lib/libc.so.0", O_RDONLY)        = 3

fstat(3, {st_mode=S_IFREG|0755, st_size=258356, ...}) = 0

close(3)                                = 0

open("/lib/libc.so.0", O_RDONLY)        = 3

fstat(3, {st_mode=S_IFREG|0755, st_size=258356, ...}) = 0

close(3)                                = 0

munmap(0x28cc000, 1724)                 = 0

stat("/lib/ld-uClibc.so.0", {st_mode=S_IFREG|0755, st_size=30360, ...}) = 0

ioctl(0, SNDCTL_TMR_TIMEBASE or TCGETS, {B115200 opost isig icanon echo ...}) = 0

ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, {B115200 opost isig icanon echo ...}) = 0

open("/proc/net/psched", O_RDONLY)      = 3

ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, 0x28ff920) = -1 ENOTTY (Inappropriate ioctl for device)

mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_SHARED|MAP_ANONYMOUS|0x4000000, 0, 0) = 0x28cc000

read(3, "000003e8 00000400 000f4240 000000"..., 256) = 36

close(3)                                = 0

write(2, "Unknown qdisc \""..., 15Unknown qdisc ")     = 15

write(2, "netem"..., 5netem)                 = 5

write(2, "\", hence option \""..., 17", hence option ")  = 17

write(2, "delay"..., 5delay)                 = 5

write(2, "\" is unparsable\n"..., 16" is unparsable

)   = 16

_exit(1)                                = ?

QuoteReplyEditDelete

 

 

2010-12-21 19:32:51     Re: Getting netem to run

Mike Frysinger (UNITED STATES)

Message: 96930   

 

i just built up trunk kernel, enabled the options mentioned in the wiki, and things seemed to work fine

 

root:/> tc qdisc add dev eth0 root netem delay 100ms

root:/> ping 192.168.1.2

PING 192.168.1.2 (192.168.1.2): 56 data bytes

64 bytes from 192.168.1.2: seq=0 ttl=64 time=100.000 ms

64 bytes from 192.168.1.2: seq=1 ttl=64 time=100.000 ms

....

QuoteReplyEditDelete

 

 

2010-12-22 00:53:29     Re: Getting netem to run

Steve Strobel (UNITED STATES)

Message: 96938   

 

Thanks, Mike, for testing it out. 

 

I can't seem to find anything about it in the wiki.  Would you mind posting the link?  If I can't get it to work with the options listed there, I guess I will have to update to the trunk version and try that.

QuoteReplyEditDelete

 

 

2010-12-22 09:28:37     Re: Getting netem to run

Mike Frysinger (UNITED STATES)

Message: 96956   

 

i was referring to the wiki you quoted, not docs.b.u.o

QuoteReplyEditDelete

 

 

2010-12-22 16:10:36     Re: Getting netem to run

Steve Strobel (UNITED STATES)

Message: 96961   

 

Mike,

 

I just pulled the iproute2 directory from the trunk with the iproute2-2.6.35 update you added yesterday.   It built cleanly and seems to delay correctly.  Thanks a million.

 

Steve

Attachments

Outcomes