简体   繁体   English

Mininet净亏损<1%

[英]Mininet net loss <1%

I'm fairly new to mininet so sorry if I missed this, but I couldnt find an answer anywhere 我是mininet的新手,如果错过了此链接,对不起,但是我在任何地方都找不到答案

I have a basic mininet topology configured as follows: 我有一个基本的mininet拓扑,配置如下:

   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. 这几乎与mininet github示例中的完全一样。 According to the documentation "loss is expressed as a percentage (between 0 and 100)" 根据文档,“损失表示为百分比(0到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. 而运行ping 1000次具有0%的丢失率。 I'm confused about what I'm missing 我对丢失的东西感到困惑

In the Mininet code, the loss is expressed an an integer variable. 在Mininet代码中,损失表示为整数变量。 So, floating point will not work. 因此,浮点数将不起作用。 Your loss of 0.5 is rounded to 0. 您的亏损0.5会四舍五入为0。

What you can do is download the source code from GitHub, change the relevant lines to float, and compile it. 您可以做的是从GitHub下载源代码,将相关行更改为float并进行编译。

According to this link , I believe you have to change lines 296 and 357 in link.py . 根据此链接 ,我相信您必须在link.py更改行296和357。 Depending on the version of mininet, the line numbers may have changed, but it should still be in class TClink in this file. 根据mininet的版本,行号可能已更改,但是该文件中的行号仍应为TClink。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM