So I know I can delay all the packets of a stream for a given delay using Linux tc and netem. What is presented here http://www.linuxfoundation.org/collaborate/workgroups/networking/netem#Delay_distribution just delays all of the packets for a given amount of time, not changing the intervals between the actual packets.
What I want to do is set the minimal interval time between each consecutive pair of packets to be say 100ms. And I don't want any reordering.
Any thought much appreciated.
Regards,
kravvcu
So, if I understood your requirement right, You want a constant interpacket delay of 100ms and no reordering. The command in the link you mentioned(linux foundation) introduces a delay of 100ms and a jitter of 20ms. This jitter creates reordering.
There are 2 approaches to meet your requirement.
tc qdisc add/change/replace dev eth0 root netem delay 100msrateparameter in your netem command. netem internally maintains a tfifo queue. with therateparameter netem calculates the packet delay of the next packet based on the time-to-send of the last packet in its tfifo queue. Thus having delay and jitter but no reordering.The command to the same is
tc qdisc add/change/replace dev eth0 root netem rate 1000mbit delay 100msrate 1000mbitor any rate which is very high does the job!This feature is not documented anywhere. However, was discussed back in 2011/2012/2013 in the linux netdev mailing list. ATM I cannot find the link to the same. However, I can point to the linux source code which implements the above mentioned code.
http://lxr.free-electrons.com/source/net/sched/sch_netem.c#L495
Please vote if the answer was useful!