Question

I'm working on a school project in which I try to simulate the network phenomenon of Buffer Bloating. This essentially is latency as a consequence of buffers in routers getting larger and larger in time because of the cheap prices of memory.

Now, to start on this project, I have already done some research on the linux "tc"-command and how to use it, but I fail to see how to set the right configuration for my needs. The situation is as follows; I have 3 computers. PC1 is connected to PC2, and PC2 is connected to PC3. In this configuration, PC2 is acting as the router in which a large buffer is used. Traffic is send from PC1 to PC3 over PC2. Now, my intention is to limit the bandwidth PC2 can use to send the incoming data from PC1 to PC3.

I was planning on doing this by setting a large buffer on PC2 with a delay on fetching the packets from the buffer to simulate a slower link. This should cause the large buffer to fill up and introduce latencies.

Now, I want to ask this community on ideas on how to configure this by using the "tc"-command, or maybe other tools that are suitable for the job. Or if you have other ideas on how to simulate buffer bloating, those are welcome too.

Thanks for your patience.

Was it helpful?

Solution

I think there are two ways to simulate bloating, and it depends on the kernel and/or the version of iproute that you are using. TBF and NETEM allow to set the rate and the queue size.

tc qdisc add dev eth0 root tbf rate Xmbit limit Y burst 1500

or

tc qdisc add dev eth0 root netem Xmbit limit Y

where X is the bandwidth and Y the queue size. The first one should work in any 2.6 kernel and ay be in some newer version of 2.4. The later one requires a new version of the Linux kernel and the Iproute tool.

Regards, Diego

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top