Hi, My namis F?bio, and I work for Portugal Telecom. I wanted to usNetefor an experiment, but I'm having problems with it. Despitin thsite it is mentioned that "If you rua curren2.6 distribution, (Fedora <http://en.wikipedia.com/wiki/Fedora_Core>, OpenSus <http://en.wikipedia.com/wiki/Open_Suse>, Gentoo <http://en.wikipedia.com/wiki/Gentoo_Linux>, Debia <http://en.wikipedia.com/wiki/Debian>, Mandriva <http://en.wikipedia.com/wiki/Mandriva>, Ubuntu <http://en.wikipedia.com/wiki/Ubuntu_%28Linux_distribution%29>), the neteis already enabled in thkernel", wheI try to inserthe following command: >> tc qdisc changdev eth0 roonetem delay 8ms 7ms 27% I gethfollowing error: RTNETLINK answers: No such filor directory I'using ubuntu 7.10, so I don'know why this is happening. Could you givmany hint on this, asap? thank you very much iadvance, F?bio Ferreira Froanders.nilsson anetinsight.net Mon Aug 4 06:31:49 2008 From: anders.nilssoanetinsight.net (Anders Nilsson) Date: Mon, 4 Aug 2008 15:31:49 +0200 Subject: problewith netem In-Reply-To: <48970359.9060702@xxxxx> References: <48970359.9060702@xxxxx> Message-ID: <67C096F8AA5F0245A7300A768984763921B52F@rosie.stockholm.netinsight.local> Hi, You need to "add" beforyou can change. See: http://www.linuxfoundation.org/en/Net:Netem /Anders. > -----Original Message----- > From: Fabio Ferreira [mailto:fferreira aua.pt] > Sent: de4 augusti 2008 15:26 > To: neteaosdl.org > Subject: problewith netem > > Hi, > > My namis F?bio, and I work for Portugal Telecom. > > I wanted to usNetefor an experiment, but I'm having problems with > it. Despitin thsite it is mentioned that > > "If you rua curren2.6 distribution, (Fedora > <http://en.wikipedia.com/wiki/Fedora_Core>, OpenSuse > <http://en.wikipedia.com/wiki/Open_Suse>, Gentoo > <http://en.wikipedia.com/wiki/Gentoo_Linux>, Debian > <http://en.wikipedia.com/wiki/Debian>, Mandriva > <http://en.wikipedia.com/wiki/Mandriva>, Ubuntu > <http://en.wikipedia.com/wiki/Ubuntu_%28Linux_distribution%29>), then > neteis already enabled in thkernel", > > wheI try to inserthe following command: > > >> tc qdisc changdev eth0 roonetem delay 8ms 7ms 27% > > I gethfollowing error: > RTNETLINK answers: No such filor directory > > I'using ubuntu 7.10, so I don'know why this is happening. > Could you givmany hint on this, asap? > > thank you very much iadvance, > > F?bio Ferreira > > _______________________________________________ > Netemailing list > Netealists.linux-foundation.org > https://lists.linux-foundation.org/mailman/listinfo/netem Frofferreira aua.pt Mon Aug 4 06:32:57 2008 From: fferreira aua.p(Fabio Ferreira) Date: Mon, 04 Aug 2008 14:32:57 +0100 Subject: problems using netem Message-ID: <48970509.7030709@xxxxx> Hi, My namis F?bio, and I work for Portugal Telecom. I wanted to usNetefor an experiment, but I'm having problems with it. Despitin thsite it is mentioned that "If you rua curren2.6 distribution, (Fedora, OpenSuse, Gentoo, Debian, Mandriva, Ubuntu, theneteis already enabled in the kernel", wheI try to inserthe following command: >> tc qdisc changdev eth0 roonetem delay 8ms 7ms 27% I gethfollowing error: RTNETLINK answers: No such filor directory I'using ubuntu 7.10, so I don'know why this is happening. Could you givmany hint on this, asap? thank you very much iadvance, F?bio Ferreira Froxuwh06 amails.tsinghua.edu.cn Sun Aug 3 01:25:39 2008 From: xuwh06 amails.tsinghua.edu.cn (Wenhao Xu) Date: Sun, 03 Aug 2008 16:25:39 +0800 Subject: [Question: ] Netewith ip aliasing Message-ID: <48956B83.1030806@xxxxxxxxxxxxxxxxxxxxx> Dear all, I seup two aliases on my network card "eth0", called eth0:0, and eth0:1 with ip address 192.168.0.1 and 192.168.0.2 individually. I wanto usnetem to add delay to the communication between eth0:0 and eth0:1, how caI do it? I tried "tc qdisc add dev eth0:0 roonetedelay 100ms ". However, wheI ping "192.168.0.2", iis still 0.***ms. How could I do? Thanks a lofor your reply! Best, wenhao Froshemminger avyatta.com Mon Aug 4 08:19:47 2008 From: shemminger avyatta.co(Stephen Hemminger) Date: Mon, 4 Aug 2008 08:19:47 -0700 Subject: [Question: ] Netewith ip aliasing In-Reply-To: <48956B83.1030806@xxxxxxxxxxxxxxxxxxxxx> References: <48956B83.1030806@xxxxxxxxxxxxxxxxxxxxx> Message-ID: <20080804081947.2fbac70d@extreme> OSun, 03 Aug 2008 16:25:39 +0800 Wenhao Xu <xuwh06 amails.tsinghua.edu.cn> wrote: > Dear all, > I seup two aliases on my network card "eth0", called eth0:0, and > eth0:1 with ip address 192.168.0.1 and 192.168.0.2 individually. > I wanto usnetem to add delay to the communication between > eth0:0 and eth0:1, how caI do it? > > I tried "tc qdisc add dev eth0:0 roonetedelay 100ms ". However, > wheI ping "192.168.0.2", iis still 0.***ms. > How could I do? Thanks a lofor your reply! > > Best, > wenhao > _______________________________________________ > Netemailing list > Netealists.linux-foundation.org > https://lists.linux-foundation.org/mailman/listinfo/netem Any communicatiobetween IP's on sammachine is done directly. So theth0:1 and eth0:1 aren'used. You might be able to puneteon the loopback interface. You would need to set thtxqueuelen for thloopback as well. Froalmeidaraf agmail.com Thu Aug 21 02:25:52 2008 From: almeidaraf agmail.co(Rafael C. de Almeida) Date: Thu, 21 Aug 2008 06:25:52 -0300 Subject: [PATCH] net_sched: refresh qdisc_watchdog_schedulfor packets with no delay Message-ID: <20080821095400.975ED2E0025@xxxxxxxxxxxxxxxx> Ofilnet/sched/sch_netem.c the function netem_dequeue calls qdisc_watchdog_schedulcausing dequeueing to bdelayed while the packet returned by thchild qdisc is noready to be sent. However, thfunction netem_enqueumay requeue a packet to the head of the queuand thapacket is already ready for dequeueing. It may not be dequeued, though, becausdequeumay be waiting for the delay time of another packet to end. So I wrotthis patch for calling qdisc_watchdog_schedulafter a new packeis added to thqueue's head. Following are the description of the experimenI did to find this ouand then the proposed patch. 1. EXPERIMENT I wrotthfollowing programs: http://www.dcc.ufmg.br/~rafael/netem/ nec.c sends 10 UDP packets containing its ordening number and a timestamp. The nes.c prograreads thospackets and prints out the difference between the time each packewas received and thtimestamp in it. For my experimenI seup two machines using UML, they communicate with each other through thhost's tuntap device. Thlatency between the two is rather small: --- 192.168.1.251 ping statistics --- 30 packets transmitted, 30 received, 0% packeloss, tim29064ms rtmin/avg/max/mdev = 0.255/0.470/2.949/0.463 ms So I attached thfollowing neterule to one of my UML instances: # tc qdisc add dev eth0 roonetedelay 3s gap 3 reorder 100% (wshouldn'have to write down reorder 100%, btw). On Netem's website we can read: Therartwo different ways to specify reordering. The first method gap uses a fixed sequencand reorders every Nth packet. (...) This causes every 5th (10th, 15th, ...) packeto go to bsent immediately and every other packeto bdelayed by 10ms. This is predictabland useful for basprotocol testing like reassembly. So I expected my prograto outpusomething like: $ ./nes 0: 3 1: 3 2: 3 3: 0 4: 3 5: 3 6: 3 7: 0 8: 3 9: 3 Thawasn'what happened, instead I got: $ ./nes 0: 3 1: 3 2: 3 3: 3 4: 3 5: 3 6: 3 7: 3 8: 3 9: 3 Further investigatioshowed thathe packets were being reordered. It just didn'happen likthe website said. Applying the following patch made the outpuof nes.c bthe predicted one. 2. PATCH Thfunction netem_dequeucalls qdisc_watchdog_schedule when a packet is returned by thchild qdisc and it's noready to be dequeued. That causes dequeueing to bdelayed whilthat particular packet's delay is noover. However, thfunction netem_enqueumay requeue a packet to the head of thqueue, thanew packet is already ready to be dequeued. It may nobdequeued, though, because dequeueing may being delayed. So qdisc_watchdog_schedulmusbe called when a new packet is inserted to thqueue's head. Signed-off-by: Rafael C. dAlmeida <almeidaraf agmail.com> --- net/sched/sch_netem.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --gia/net/sched/sch_netem.c b/net/sched/sch_netem.c index fb0294d..6442d0f 100644 --- a/net/sched/sch_netem.c +++ b/net/sched/sch_netem.c @@ -234,6 +234,9 @@ static innetem_enqueue(strucsk_buff *skb, struct Qdisc *sch) cb->time_to_send = psched_get_time(); q->counter = 0; re= q->qdisc->ops->requeue(skb, q->qdisc); + if (likely(re== NET_XMIT_SUCCESS)) { + qdisc_watchdog_schedule(&q->watchdog, cb->time_to_send); + } } if (likely(re== NET_XMIT_SUCCESS)) { -- 1.5.6.3 Froalmeidaraf agmail.com Thu Aug 21 03:35:52 2008 From: almeidaraf agmail.co(Rafael C. de Almeida) Date: Thu, 21 Aug 2008 07:35:52 -0300 Subject: [PATCH] net_sched: refresh qdisc_watchdog_schedulfor packets with no delay Message-ID: <20080821104532.9398C2E001B@xxxxxxxxxxxxxxxx> Pleasignormy previous e-mail (I screwed up on the To: and CC: list). Sorry abouthdouble post :-(. Ofilnet/sched/sch_netem.c the function netem_dequeue calls qdisc_watchdog_schedulcausing dequeueing to bdelayed while the packet returned by thchild qdisc is noready to be sent. However, thfunction netem_enqueumay requeue a packet to the head of the queuand thapacket is already ready for dequeueing. It may not be dequeued, though, becausdequeumay be waiting for the delay time of another packet to end. So I wrotthis patch for calling qdisc_watchdog_schedulafter a new packeis added to thqueue's head. Following are the description of the experimenI did to find this ouand then the proposed patch. 1. EXPERIMENT I wrotthfollowing programs: http://www.dcc.ufmg.br/~rafael/netem/ nec.c sends 10 UDP packets containing its ordening number and a timestamp. The nes.c prograreads thospackets and prints out the difference between the time each packewas received and thtimestamp in it. For my experimenI seup two machines using UML, they communicate with each other through thhost's tuntap device. Thlatency between the two is rather small: --- 192.168.1.251 ping statistics --- 30 packets transmitted, 30 received, 0% packeloss, tim29064ms rtmin/avg/max/mdev = 0.255/0.470/2.949/0.463 ms So I attached thfollowing neterule to one of my UML instances: # tc qdisc add dev eth0 roonetedelay 3s gap 3 reorder 100% (wshouldn'have to write down reorder 100%, btw). On Netem's website we can read: Therartwo different ways to specify reordering. The first method gap uses a fixed sequencand reorders every Nth packet. (...) This causes every 5th (10th, 15th, ...) packeto go to bsent immediately and every other packeto bdelayed by 10ms. This is predictabland useful for basprotocol testing like reassembly. So I expected my prograto outpusomething like: $ ./nes 0: 3 1: 3 2: 3 3: 0 4: 3 5: 3 6: 3 7: 0 8: 3 9: 3 Thawasn'what happened, instead I got: $ ./nes 0: 3 1: 3 2: 3 3: 3 4: 3 5: 3 6: 3 7: 3 8: 3 9: 3 Further investigatioshowed thathe packets were being reordered. It just didn'happen likthe website said. Applying the following patch made the outpuof nes.c bthe predicted one. 2. PATCH Thfunction netem_dequeucalls qdisc_watchdog_schedule when a packet is returned by thchild qdisc and it's noready to be dequeued. That causes dequeueing to bdelayed whilthat particular packet's delay is noover. However, thfunction netem_enqueumay requeue a packet to the head of thqueue, thanew packet is already ready to be dequeued. It may nobdequeued, though, because dequeueing may being delayed. So qdisc_watchdog_schedulmusbe called when a new packet is inserted to thqueue's head. Signed-off-by: Rafael C. dAlmeida <almeidaraf agmail.com> --- net/sched/sch_netem.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --gia/net/sched/sch_netem.c b/net/sched/sch_netem.c index fb0294d..6442d0f 100644 --- a/net/sched/sch_netem.c +++ b/net/sched/sch_netem.c @@ -234,6 +234,9 @@ static innetem_enqueue(strucsk_buff *skb, struct Qdisc *sch) cb->time_to_send = psched_get_time(); q->counter = 0; re= q->qdisc->ops->requeue(skb, q->qdisc); + if (likely(re== NET_XMIT_SUCCESS)) { + qdisc_watchdog_schedule(&q->watchdog, cb->time_to_send); + } } if (likely(re== NET_XMIT_SUCCESS)) { -- 1.5.6.3