I'm trying to simulate a network on a single machine.
I have multiple nodes that communicate through tcp sockets.
I tried to create one dummy interface for each node like this:
ip link add name int1 type dummy
ip address add 10.0.1.1 dev int1
ifconfig int1 up
All nodes can bind the respective addresses and communicate without problems. However, I also want to add delay and limit the bandwidth of each interface to simulate real world conditions.
I used tc add delay to the interface like this:
tc qdisc add dev int1 root netem delay 200ms
But there was no increase in execution times as I was expecting.
My questions are:
Can i do traffic shaping on dummy interfaces? If not what is the best way to simulate a network on a single machine
I also noted that pings to the created interfaces land on loopback and not on the actual interface. Why?