1

I am trying to set the bandwidth to 1.7MBps, but it is not working. I saw to use argument --link=tc,bw=1.7 so I did and it is still not working. When I use commands in the mininet console to see the bandwidth, it's way too big but I found out it is kind of okay, that it isn't working properly. I am calculating bandwidths from ports stats and the highest I got so far was 0.4MBps. I also added CPU to my virtual machine, did not help. What am I doing wrong?
The traffic is generated by downloading data with clients from servers. (Also I am using RYU's switch: simple_switch_stp_13 and controller ofctl_rest.)

#IMPORTS#
limit=1.7
OVSSwitch14 = partial(OVSSwitch, protocols='OpenFlow13')
class SingleSwitchTopo(Topo):
        def build(self):
                origin = self.addHost('origin', ip='10.11.0.1')
                se1 = self.addHost('se1', ip='10.11.0.2')
                se2 = self.addHost('se2', ip='10.11.0.3')
#adding cients
                client1 = self.addHost('client1', ip='10.11.0.11')
                client2 = self.addHost('client2', ip='10.11.0.12')
                client3 = self.addHost('client3', ip='10.11.0.13')
                client4 = self.addHost('client4', ip='10.11.0.14')
                client5 = self.addHost('client5', ip='10.11.0.15')
                client6 = self.addHost('client6', ip='10.11.0.16')
#adding switches
                s1 = self.addSwitch('s1')
                s2 = self.addSwitch('s2')
                s3 = self.addSwitch('s3')
                s4 = self.addSwitch('s4')
                s5 = self.addSwitch('s5')
                s6 = self.addSwitch('s6')
#adding links
                self.addLink(s1, se1, cls=TCLink, bw=limit)
                self.addLink(s1, s3, cls=TCLink, bw=limit)
                self.addLink(s2, client1, cls=TCLink,bw=limit)
                self.addLink(s2, origin, cls=TCLink,bw=limit)
                self.addLink(s2, s4, cls=TCLink, bw=limit)
                self.addLink(s3, client2, cls=TCLink, bw=limit)
                self.addLink(s3, s4, cls=TCLink, bw=limit)
                self.addLink(s4, client3, cls=TCLink, bw=limit)
                self.addLink(s4, s5, cls=TCLink, bw=limit)
                self.addLink(s4, s6, cls=TCLink, bw=limit)
                self.addLink(s5, se2, cls=TCLink, bw=limit)
                self.addLink(s2, s3, cls=TCLink, bw=limit)
                self.addLink(s6, client4, cls=TCLink, bw=limit)
                self.addLink(s6, client5, cls=TCLink, bw=limit)
                self.addLink(s3, client6, cls=TCLink, bw=limit)

                mgsw = self.addSwitch('s66766')  # DPID used for the Management switch

def setup():
        "Start Network"
        topo = SingleSwitchTopo()
        OVSSwitch14 = partial(OVSSwitch, protocols='OpenFlow13')
        net = Mininet(topo=topo, ipBase='10.11.0.0/24', switch=OVSSwitch14, controller=RemoteController,autoSetMacs=True, xterms=True , link=TCLink)
        for h in net.hosts:
                info('Disabling IPV6 for ' + str(h) + '\n')
                h.cmd("sysctl -w net.ipv6.conf.all.disable_ipv6=1")
                h.cmd("sysctl -w net.ipv6.conf.default.disable_ipv6=1")
                h.cmd("sysctl -w net.ipv6.conf.lo.disable_ipv6=1")
                h.cmd("echo ''")
    
        net.start()
    net.pingAll()
    net.pingAll()   
        CLI(net)
if __name__ == '__main__':
        setLogLevel('info')
        setup()
Aninkan
  • 31
  • 3
  • Can you follow the following guide: https://stackoverflow.com/help/minimal-reproducible-example to create a minimal reproducible example, so we can check your work? The way you are setting the bandwidth with bw=limit is correct. In practice the whole path will be as slow as the slowest (bottleneck) link, so I wonder if there is any particular reason you are setting the limit on all and if that makes any difference. – Misho Janev Dec 15 '21 at 13:22
  • thank you. I didn't know that the whole path would be as slow as the slowest link. I set the bw on all of the links just in case. Now I've tried it with only setting it to one link, and the max bandwidth was over 130MB/s , although the overall bandwidth range was very different. – Aninkan Dec 18 '21 at 15:53

1 Answers1

0

so the mistake was kind of dumb. when setting a bandwidth in mininet you set it in Mbit/s, not Mbytes/s. Therefore I had to convert MB/s to Mb/s, which in my case is 13.6Mb = 1.7 MB

Aninkan
  • 31
  • 3