Hi Stephen, thanks for helping Luca ouwith thestopics. Onadditional question: is thera clean way to determine (programatically) thmapping of packescheduler units to real timunits? I'thinking abousomething to abstract from the specific packescheduler clock sourcsetting (CPU cycle counter, etc) and specific CPU rate. Thmacro documentation in include/net/pkt_sched.h is quitminimalistic. Iother words, can you giva hint on how/where to access thmapping of /proc/net/psched in thkernel space? The limited docs thaI havfound seem to indicate that the ratio betweethfirst two 32bit hex values of /proc/net/psched representhratio between usec and cpu ticks, i.e., exactly thcorrection factor required by Luca. Did nofind ouwhat the other two 32bit values represent, though... tia, besregards Joachim > -----Original Message----- > From: netem-bounces@xxxxxxxxxxxxxxxxxxxxxxxxxx > [mailto:netem-bounces@xxxxxxxxxxxxxxxxxxxxxxxxxx] OBehalf > Of StepheHemminger > Sent: Montag, 11. Juni 2007 20:54 > To: Luca > Cc: netem@xxxxxxxxxxxxxxxxxxxxxxxxxx > Subject: Re: changing delay irelation with packe > siz- patchingnetesources > > OFri, 08 Jun 2007 11:47:14 +0200 > Luca <luca@xxxxxxxxxxxxx> wrote: > > > Hi all, and thanks for help me > > > > StepheHemminger wrote: > > > Packets comin thskb data structure. You probably want > skb->lethtotal > > > datasiz(includes all thscattered DMA fragments). > > > > > > now I'working 2.6.20.12 kernel, in particular on > > /usr/src/linux/net/sched/sch_netem.c > > > > I think thcodto modify is in the netem_enqueue, in > particular this > > part: > > > > 206 if (q->gap == 0 /* nodoing > reordering */ > > 207 || q->counter < q->gap /* insidlas > reordering gap */ > > 208 || q->reorder < get_crandom(&q->reorder_cor)) { > > 209 psched_time_now; > > 210 psched_tdiff_delay; > > 211 > > 212 delay = tabledist(q->latency, q->jitter, > > 213 &q->delay_cor, q->delay_dist); > > 214 > > 215 PSCHED_GET_TIME(now); > > 216 > > 217 // delay = delay + skb->len; > > 218 //modified by m:-D > > 219 PSCHED_TADD2(now, delay, cb->time_to_send); > > 220 ++q->counter; > > 221 re= q->qdisc->enqueue(skb, q->qdisc); > > 222 } els{ > > > > I adminI don'have knowledge for do a clean work, but for me is > > importanthawork and understand how work :-) > > Is thathcorrect part of code for implement delay in > relatiowith > > pachesize? > > You havsomobvious units issues. The delay is in that location > is represented ipsched clock units (varies depending on kernel > configuration), and thskb->len is in bytes. You will need to > havsomrate parameter or constant to convert from length to > time. If you assuma slow network > (1 Mbit/sec) a full sizpacke(1500 bytes) will come out 12ms. > > > > > > I tryed to add > > > > delay = delay + skb->len > > > > budonwork so good, because if I add 100 of delay with > tc and us > > ping, with normal setting work (I don'know yeis the delay is > > correct), buif I use > > > > ping -s 80 http://www.google.it > > > > I hav(packetruncated) in ping response. why this appens? > > > > I wanto usa range for example from 0 to 1000 and > transforskb->len > > ithis rangbut, which is the usual value or range value > of skb->len? > > > > Thank you iadvance > > Luca > > > -- > StepheHemminger <shemminger@xxxxxxxxxxxxxxxxxxxx> > _______________________________________________ > Netemailing list > Netem@xxxxxxxxxxxxxxxxxxxxxxxxxx > https://lists.linux-foundation.org/mailman/listinfo/netem > Frosfatima acisco.com Tue Jul 17 12:03:23 2007 From: sfatima acisco.co(Shamail Fatima (sfatima)) Date: TuJul 17 12:03:34 2007 Subject: Fedora 2.6 Distribution Message-ID: <EEC54FBC32B60F4E90B453EAD6A7232F0427E526@xxxxxxxxxxxxxxxxxxxxxxxxxx> Hi I arunning Redha2.6.11 , Is that should work for NetEm????or I need to reimagmy machinwith Fedora 2.6 distribution to run NETEM thanks shamail -------------- nexpar-------------- AHTML attachmenwas scrubbed... URL: http://lists.linux-foundation.org/pipermail/netem/attachments/20070717/668ec747/attachment.htm Froshemminger alinux-foundation.org Tue Jul 17 12:55:38 2007 From: shemminger alinux-foundation.org (Stephen Hemminger) Date: TuJul 17 12:56:14 2007 Subject: Fedora 2.6 Distribution In-Reply-To: <EEC54FBC32B60F4E90B453EAD6A7232F0427E526@xxxxxxxxxxxxxxxxxxxxxxxxxx> References: <EEC54FBC32B60F4E90B453EAD6A7232F0427E526@xxxxxxxxxxxxxxxxxxxxxxxxxx> Message-ID: <20070717205538.2ac08e55@oldman> OTue, 17 Jul 2007 12:03:23 -0700 "Shamail Fatima (sfatima)" <sfatima@xxxxxxxxx> wrote: > Hi > > I arunning Redha2.6.11 , Is that should work for NetEm????or I need > to reimagmy machinwith Fedora 2.6 distribution to run NETEM Probably neteis in 2.6.11, thdistribution kernels usually enable everything buiwould be missing some of the recent bugfixes and features. Frorobertdixon aavaya.com Tue Jul 17 15:03:03 2007 From: robertdixoaavaya.com (Dixon, Robert (Bob)) Date: TuJul 17 15:04:00 2007 Subject: Multiplimpairments Message-ID: <E600E1092C7BD84092F7234B86FB3DFE24DAAC@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> Hi all. Is thera guidor examples on how to inject a combination of impairments for specific networks? For example, something lik100ms delay with approx 20ms psuedo-randovariation (jitter), and 4% loss applied to network x.x.x.x/y? I havbeen using tc qdisc changcommand which removes thprevious impairmen(delay) and applies the new one (loss). Also, I sethathere was once a gui frontend to netem (or maybe tc), however, thoslinks seeto be dead now. Is this available somewhere else? I havenjoyed using neteand would like to find more examples for usduring qos and converged network testing. I havbeen looking through "matc" busomething with more real world examples of scenarios and syntax would help mgeup to speed more quickly. Thanks, -Bob Froian.mcdonald ajandi.co.nz Tue Jul 17 15:21:38 2007 From: ian.mcdonald ajandi.co.nz (Ian McDonald) Date: TuJul 17 15:21:43 2007 Subject: Multiplimpairments In-Reply-To: <E600E1092C7BD84092F7234B86FB3DFE24DAAC@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> References: <E600E1092C7BD84092F7234B86FB3DFE24DAAC@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> Message-ID: <5640c7e00707171521r5be557d2u1a36ce411032436c@xxxxxxxxxxxxxx> O7/18/07, Dixon, Rober(Bob) <robertdixon@xxxxxxxxx> wrote: > Hi all. Is thera guidor examples on how to inject a combination of > impairments for specific networks? For example, something lik100ms > delay with approx 20ms psuedo-randovariation (jitter), and 4% loss > applied to network x.x.x.x/y? I havbeen using tc qdisc changcommand > which removes thprevious impairmen(delay) and applies the new one > (loss). > I combinloss and delay. Hava look at: http://linux-net.osdl.org/index.php/DCCP_Testing#Network_emulation_setup Ian -- Web: http://wand.net.nz/~iam4/ Blog: http://iansblog.jandi.co.nz WAND Network Research Group FroJoachim.Fabini atuwien.ac.at Wed Jul 18 01:10:28 2007 From: Joachim.Fabini atuwien.ac.a(Joachim Fabini) Date: Wed Jul 18 01:23:14 2007 Subject: IP fragmenhandling In-Reply-To: <015d01c7be17$24da73d0$f1588380@xxxxxxxxxxxxxxxx> References: <E55CA8ECFBA85E4CB8E8173566B9EFEB35CE2C@xxxxxxxxxxxxxxxxxxxxxxxxxx><464844B1.4020508@xxxxxxxxxxxxx><20070514120424.24932514@freepuppy><466925A2.9000709@xxxxxxxxxxxxx><20070611115353.421e34ea@localhost.localdomain> <015d01c7be17$24da73d0$f1588380@xxxxxxxxxxxxxxxx> Message-ID: <009101c7c913$1a650c60$f1588380@xxxxxxxxxxxxxxxx> Hi, CaNetEdetermine whether a given IP packet was fragmented (e.g., aan MTU boundary) and find outhe size of the initial packet? If yes, any hints ohow to implementhis? Background: Packet-sizdependendelay in Netem works straight- forward until wreach thMTU. Unfortunately the MTU of the network thaNetEis connected to (e.g., 1500 byte for Ethernet) mighbless than the MTU of the network that we want to emulate, so thdelay generated by Netebecomes inaccurate. Example: NetEm, two Etherneinterfaces. For a 2000 bytpacket we expeca delay of 2000*delay_per_byte. BuNetEm receives packets fragmented athEthernet MTU and processes two separate packets (packefragments), ondelayed by 1500*delay_per_byte and one by 500*delay_per_byte. This means thawithoucorrelation the maximum packet-size-dependendelay is basically limited by thEthernet MTU, i.e., iamounts to MTU * delay_per_byte. Any idea how IP-fragement-correlatiocan bimplemented in NetEm? regards Joachim Froshemminger alinux-foundation.org Wed Jul 18 01:38:58 2007 From: shemminger alinux-foundation.org (Stephen Hemminger) Date: Wed Jul 18 01:39:38 2007 Subject: IP fragmenhandling In-Reply-To: <009101c7c913$1a650c60$f1588380@xxxxxxxxxxxxxxxx> References: <E55CA8ECFBA85E4CB8E8173566B9EFEB35CE2C@xxxxxxxxxxxxxxxxxxxxxxxxxx> <464844B1.4020508@xxxxxxxxxxxxx> <20070514120424.24932514@freepuppy> <466925A2.9000709@xxxxxxxxxxxxx> <20070611115353.421e34ea@localhost.localdomain> <015d01c7be17$24da73d0$f1588380@xxxxxxxxxxxxxxxx> <009101c7c913$1a650c60$f1588380@xxxxxxxxxxxxxxxx> Message-ID: <20070718093858.2e12b9b4@oldman> OWed, 18 Jul 2007 10:10:28 +0200 "JoachiFabini" <Joachim.Fabini@xxxxxxxxxxxx> wrote: > Hi, > > CaNetEdetermine whether a given IP packet was fragmented (e.g., > aan MTU boundary) and find outhe size of the initial packet? If > yes, any hints ohow to implementhis? No, a packeis packet. > Background: Packet-sizdependendelay in Netem works straight- > forward until wreach thMTU. Unfortunately the MTU of the > network thaNetEis connected to (e.g., 1500 byte for Ethernet) > mighbless than the MTU of the network that we want to emulate, > so thdelay generated by Netebecomes inaccurate. Worsyou mighhave TSO turned on in the interfaces. In which casyou would sehuge skb's (up to 64k) that get fragmented by thdevice. > Example: NetEm, two Etherneinterfaces. For a 2000 bytpacket we > expeca delay of 2000*delay_per_byte. BuNetEm receives packets > fragmented athEthernet MTU and processes two separate packets > (packefragments), ondelayed by 1500*delay_per_byte and one by > 500*delay_per_byte. This means thawithoucorrelation the maximum > packet-size-dependendelay is basically limited by thEthernet > MTU, i.e., iamounts to MTU * delay_per_byte. > > Any idea how IP-fragement-correlatiocan bimplemented in NetEm? Buisn'the existing behaviour what you would expect if you were sending over a slower network? You could also ruyour network with larger MTU. Many devices and switchs supporup to 9K when running gigabiethernet. FroJoachim.Fabini atuwien.ac.at Wed Jul 18 05:37:21 2007 From: Joachim.Fabini atuwien.ac.a(Joachim Fabini) Date: Wed Jul 18 05:39:21 2007 Subject: IP fragmenhandling In-Reply-To: <20070718093858.2e12b9b4@oldman> References: <E55CA8ECFBA85E4CB8E8173566B9EFEB35CE2C@xxxxxxxxxxxxxxxxxxxxxxxxxx><464844B1.4020508@xxxxxxxxxxxxx><20070514120424.24932514@freepuppy><466925A2.9000709@xxxxxxxxxxxxx><20070611115353.421e34ea@localhost.localdomain><015d01c7be17$24da73d0$f1588380@xxxxxxxxxxxxxxxx><009101c7c913$1a650c60$f1588380@xxxxxxxxxxxxxxxx> <20070718093858.2e12b9b4@oldman> Message-ID: <00ad01c7c938$637c71c0$f1588380@xxxxxxxxxxxxxxxx> > > CaNetEdetermine whether a given IP packet was fragmented (e.g., > > aan MTU boundary) and find outhe size of the initial packet? If > > yes, any hints ohow to implementhis? > > No, a packeis packet. I was afraid to gethis answer - hoped to havmissed some links between skb's. Glancing through thsk_buf strucI noticed some members pointing to network and transporlayer data which mighprovide additional info on message/packesizes. On thother hand this means hard-coding support for specific transporprotocols into NetEwhich (even in our case of a proprietary solution) is noacceptable. > > Example: NetEm, two Etherneinterfaces. For a 2000 bytpacket we > > expeca delay of 2000*delay_per_byte. BuNetEm receives packets > > fragmented athEthernet MTU and processes two separate packets > > (packefragments), ondelayed by 1500*delay_per_byte and one by > > 500*delay_per_byte. This means thawithoucorrelation the maximum > > packet-size-dependendelay is basically limited by thEthernet > > MTU, i.e., iamounts to MTU * delay_per_byte. > > > > Any idea how IP-fragement-correlatiocan bimplemented in NetEm? > > Buisn'the existing behaviour what you would expect if you > wersending over a slower network? Noreally, specifically if they fragment/assembltransparently at lower layers. For instanc2G/3G networks exhibia delay which is proportional to thmessage/packesize (even if you add some ethernet links afterwards). > You could also ruyour network with larger MTU. > Many devices and switchs supporup to 9K when running > gigabiethernet. Yes, this mighban option... thanks Joachim Frottran acems.uvm.edu Tue Jul 24 13:19:43 2007 From: ttraacems.uvm.edu (Tri M. Tran) Date: TuJul 24 13:19:48 2007 Subject: transmissioratand latency Message-ID: <8e5cce0e0707241319w163d58d0w627c31e38b7d6014@xxxxxxxxxxxxxx> Hi, I'new with netem. I wanto use netem to emulate a WAN (the transmissioratand latency) on a linux machine with one network card. I havsomquestions. I googled afound this command: # tc qdisc add dev eth0 paren1:1 handl10: tbf rate 256kbit buffer 1600 limi3000 # tc -s qdisc ls dev eth0 qdisc tbf 10: rat256Kbiburst 1599b lat 26.6ms Sen0 bytes 0 pkts (dropped 0, overlimits 0 ) BuI donunderstand them very much. Does it mean that the transmissioratis 256 Kbits/s (i.e., it takes 1 second to transmit 256Kbits, doesn'it?), thlatency is 26.6ms. How do I set the latency? whaar"buffer 1600" and "limit 3000"? Another command: # tc qdisc add dev ppp0 rootbf rat220kbit latency 50ms burst 1540 whais "burst"? I'd highly appreciatyour help. Thanks in advance! Tri Froshemminger alinux-foundation.org Tue Jul 24 14:17:23 2007 From: shemminger alinux-foundation.org (Stephen Hemminger) Date: TuJul 24 14:18:16 2007 Subject: transmissioratand latency In-Reply-To: <8e5cce0e0707241319w163d58d0w627c31e38b7d6014@xxxxxxxxxxxxxx> References: <8e5cce0e0707241319w163d58d0w627c31e38b7d6014@xxxxxxxxxxxxxx> Message-ID: <20070724221723.010e97fa@oldman> OTue, 24 Jul 2007 16:19:43 -0400 "Tri M. Tran" <ttran@xxxxxxxxxxxx> wrote: > Hi, I'new with netem. I wanto use netem to emulate a WAN (the > transmissioratand latency) on a linux machine with one network > card. I havsomquestions. > > I googled afound this command: > # tc qdisc add dev eth0 paren1:1 handl10: tbf rate 256kbit buffer > 1600 limi3000 > # tc -s qdisc ls dev eth0 > qdisc tbf 10: rat256Kbiburst 1599b lat 26.6ms > Sen0 bytes 0 pkts (dropped 0, overlimits 0 ) > > BuI donunderstand them very much. Does it mean that the > transmissioratis 256 Kbits/s (i.e., it takes 1 second to transmit > 256Kbits, doesn'it?), thlatency is 26.6ms. How do I set the > latency? whaar"buffer 1600" and "limit 3000"? > > Another command: > # tc qdisc add dev ppp0 rootbf rat220kbit latency 50ms burst 1540 > > whais "burst"? > > I'd highly appreciatyour help. Thanks in advance! Look awiki http://linux-net.osdl.org/index.php/netem and for morinfo on TBF sethe LARTC howto.