0

I'm fairly new to mininet so sorry if I missed this, but I couldnt find an answer anywhere

I have a basic mininet topology configured as follows:

   switch = self.addSwitch('s1')
   for h in range(2):
        host = self.addHost('h%s' % (h + 1))
        self.addLink( host, switch, bw=bw_link, delay=delay, loss=loss, max_queue_size=int(maxq),
            use_htb=True)

It's almost exactly the same thing as on the mininet github example. According to the documentation "loss is expressed as a percentage (between 0 and 100)"

However, when I pass in the parameter

loss = .5

I get the following output:

(10.00Mbit 0% loss) (10.00Mbit 0% loss) *** Configuring hosts

And running ping 1000 times has a 0% loss rate. I'm confused about what I'm missing

Eli M
  • 1
  • 2

1 Answers1

1

In the Mininet code, the loss is expressed an an integer variable. So, floating point will not work. Your loss of 0.5 is rounded to 0.

What you can do is download the source code from GitHub, change the relevant lines to float, and compile it.

According to this link, I believe you have to change lines 296 and 357 in link.py. Depending on the version of mininet, the line numbers may have changed, but it should still be in class TClink in this file.

Niloy Saha
  • 444
  • 2
  • 4
  • 14