trafficshaping

How to priotize packets using tc and cgroups

心已入冬 提交于 2019-12-21 05:23:11
问题 I am trying to prioritize the packets that are generated from a certain process group so that they'll be picked first to be transmitted from the PC. I aim to do this by using cgroups and tc, but it seems not to work. First I set up cgroups on ubuntu as follows, modprobe cls_cgroup # load this module to get net_cls mkdir /sys/fs/cgroup/net_cls # mount point mount -t cgroup net_cls -onet_cls /sys/fs/cgroup/net_cls/ mkdir /sys/fs/cgroup/net_cls/foo # new cgroup echo 0x00010001 > /sys/fs/cgroup

How to throttle network traffic for environment simulation?

☆樱花仙子☆ 提交于 2019-12-18 20:14:40
问题 I'm trying to test an application that uses a database connection. What I would like to do is throttling the bandwith to, say, 1 MBit or such to get a better feeling for the application under realistic conditions. I already use Wireshark to have a look at the communication with the DB and I expected Wireshark to have a feature like that but as it seems there is no way to do something like that. Any suggestions? 回答1: Check out WANem. You can download a bootable ISO that you boot up on any

Calculation of written and read bytes in netty application

﹥>﹥吖頭↗ 提交于 2019-12-13 05:59:54
问题 I need to track individual client's connections (written, read bytes and speed(bytes per second)) in my simple http server netty app. As I understand, to do this, I have to use ChannelTrafficShapingHandler . What methods must be overriden and how can I do these calculations? My ChannelInitializer: public class HttpServerInitializer extends ChannelInitializer<SocketChannel> { @Override protected void initChannel(SocketChannel ch) throws Exception { ChannelPipeline pipeline = ch.pipeline();

How to priotize packets using tc and cgroups

大憨熊 提交于 2019-12-03 16:36:06
I am trying to prioritize the packets that are generated from a certain process group so that they'll be picked first to be transmitted from the PC. I aim to do this by using cgroups and tc, but it seems not to work. First I set up cgroups on ubuntu as follows, modprobe cls_cgroup # load this module to get net_cls mkdir /sys/fs/cgroup/net_cls # mount point mount -t cgroup net_cls -onet_cls /sys/fs/cgroup/net_cls/ mkdir /sys/fs/cgroup/net_cls/foo # new cgroup echo 0x00010001 > /sys/fs/cgroup/foo/net_cls.classid # echo in a class id echo 2348 > /sys/fs/cgroup/net_cls/foo/tasks # echo in pid of