mininet | Emulator for rapid prototyping of Software Defined Networks | Networking library

 by   mininet Python Version: 2.3.0 License: BSD-3-Clause

kandi X-RAY | mininet Summary

kandi X-RAY | mininet Summary

mininet is a Python library typically used in Networking applications. mininet has no bugs, it has no vulnerabilities, it has build file available, it has a Permissive License and it has high support. You can download it from GitHub.

Mininet emulates a complete network of hosts, links, and switches on a single machine. To create a sample two-host, one-switch network, just run:. Mininet is useful for interactive development, testing, and demos, especially those using OpenFlow and SDN. OpenFlow-based network controllers prototyped in Mininet can usually be transferred to hardware with minimal changes for full line-rate execution.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              mininet has a highly active ecosystem.
              It has 4841 star(s) with 1710 fork(s). There are 281 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 256 open issues and 437 have been closed. On average issues are closed in 341 days. There are 89 open pull requests and 0 closed requests.
              It has a positive sentiment in the developer community.
              The latest version of mininet is 2.3.0

            kandi-Quality Quality

              mininet has 0 bugs and 0 code smells.

            kandi-Security Security

              mininet has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              mininet code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              mininet is licensed under the BSD-3-Clause License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              mininet releases are available to install and integrate.
              Build file is available. You can build the component from source.
              Installation instructions, examples and code snippets are available.
              mininet saves you 7795 person hours of effort in developing the same functionality from scratch.
              It has 16626 lines of code, 1204 functions and 155 files.
              It has high code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed mininet and discovered the below as its top functions. This is intended to give you an instant insight into mininet implemented functionality, and help decide if they suit your requirements.
            • Exports the topology
            • Write data to stdin
            • Return an IPv4 address
            • Convert an IP address to a string
            • Load topology
            • Add a link
            • Append text
            • Add a node to the graph
            • Parse command line arguments
            • Configures the interface
            • Parse command line options
            • Dialog to save the topology
            • Create a scratch network
            • Run iperfw test
            • Start a shell
            • Tests the port number
            • Cleanup zombie processes
            • R LinearBandwidth test
            • Plot line
            • Applies the variables defined in the configuration
            • Initialize the header
            • Imports the topology
            • Setup the frame body
            • Create the body of the notebook
            • Setup the widget
            • Start the server
            Get all kandi verified functions for this library.

            mininet Key Features

            No Key Features are available at this moment for mininet.

            mininet Examples and Code Snippets

            How to get going.,Working with mininet,Starting a POX based openflow controller
            Pythondot img1Lines of Code : 7dot img1License : Strong Copyleft (GPL-3.0)
            copy iconCopy
            cd ~/pox #or wherever
            ./pox.py samples.pretty_log misc.of_tutorial
            
            ./pox.py samples.pretty_log misc.of_tutorial
            
            sudo mn --topo tree,depth=3,fanout=2  --controller remote --switch ovsk
            
            mininet> h1 ping h2
            
            sudo mn -c
            
            ./pox.py samples.pretty_log  
            How to get going.,Working with mininet
            Pythondot img2Lines of Code : 5dot img2License : Strong Copyleft (GPL-3.0)
            copy iconCopy
            sudo mn 
            
            mininet> h1 ping h2
            
            mininet> h1 ls
            
            mininet> pingall
            
            sudo mn -c
              
            How to get going.,Working with mininet,Working with floodlight
            Pythondot img3Lines of Code : 3dot img3License : Strong Copyleft (GPL-3.0)
            copy iconCopy
            cd ~/floodlight #or wherever you installed
            java -jar target/floodlight.jar
            
            sudo mn --topo tree,depth=3,fanout=4 --controller remote --switch ovsk,protocols=OpenFlow13
              

            Community Discussions

            QUESTION

            ovs-ofctl add a flow to allow only ARP ethernet frames
            Asked 2021-Dec-13 at 17:38

            I am starting to learn SDN with ovs-ofctl and mininet, and I am configuring a switch following some tutorials, but there's something I don't catch.

            When I start my topology with:

            sudo mn --topo single,2 --controller remote --switch ovsk

            Now if I want to add a simple flow between h1 and h5, I do:

            ...

            ANSWER

            Answered 2021-Dec-13 at 17:38

            I think the main reason is a confusion between all involved protocols.

            (1) Ping is done using ICMP, in particular ICMP echo request and ICMP echo reply messages. These messages are encapsulated in IP packets, which are in turn encapsulated in it Ethernet packets. In this case Ethernet next header field (i think it is actually called ethertype in general and dl_type here) is set to IP, which is 0x0800.

            A more in-depth guide on how to read ICMP packets in wireshark can be found here.

            (2) ARP is necessary for end-systems to match IP addresses to MAC addresses. ARP is encapsulated directly into Ethernet frames, where ethernet next header is set to value 0x806

            Thus

            Source https://stackoverflow.com/questions/70317486

            QUESTION

            Mininet script sending traffic from virtual machine's IP instead of host machines'
            Asked 2021-Dec-05 at 11:04

            In a python3/mininet script I have a tested, valid dictionary of host machines and their IP addresses. For each of the keys - by iterating dictOfAllHostsAndIPs.keys() - I execute a script on each emulated host's terminal

            ...

            ANSWER

            Answered 2021-Dec-05 at 11:04

            I think I see what is going on in the source, but i have not run the framework to confirm it.

            It looks like mininet inatalls a NAT rule for every node:

            Source https://stackoverflow.com/questions/69469784

            QUESTION

            ImportError: No module named mininet.log
            Asked 2021-Oct-19 at 09:17

            I am working on mininet when I run miniedit without sudo it gives me error

            ...

            ANSWER

            Answered 2021-Oct-19 at 09:17

            I make a test with pycharm and if you install the library with the command : pip install mininet

            your import may not have any error

            maybe you installed your library with : sudo pip install mininet and your library is only available for root user

            try sudo pip uninstall mininet and pip install mininet

            Source https://stackoverflow.com/questions/69607287

            QUESTION

            Keyerror when handling the EventOFPFlowStatsReply message in the Ryu Controller
            Asked 2021-Aug-16 at 21:15

            I'm trying to get the requested FlowStat information in Simple_monitor_13 (Ryu SDN Controller), but when run with a simple mininet topology and "pingall", the application keeps reporting Keyerrors coming from very basic Match Fields like Ipv4_src, eth_type. Did I misunderstand how this event works? And how can this request be fulfilled?

            ...

            ANSWER

            Answered 2021-Aug-16 at 21:15
            FlowStatsReply

            A FlowStatsReply contains statistics for each flow installed on the switch. Since flows do not have dedicated unique identifiers, they are instead identified by their match fields. If a flow rule does not match on a certain header field, its corresponding flow entry in the FlowStatsReply won't contain that field either.

            Matches in SimpleMonitor13

            If you look at SimpleSwitch13, which SimpleMonitor13 inherits from, you will find that the controller installs flows in its _packet_in_handler with the following match:

            Source https://stackoverflow.com/questions/68693346

            QUESTION

            How to run an XMLRPC server and an XMLRPC client on Mininet hosts through a python script?
            Asked 2021-May-13 at 11:24

            I am trying to run an XMLRPC server and an XMLRPC client on Mininet hosts, using the script below.

            ...

            ANSWER

            Answered 2021-May-13 at 11:24

            Replace print(net.hosts[0].cmd('python3 xmlrpc_server.py')) with print(net.hosts[0].sendCmd('python3 xmlrpc_server.py')). Connection is sometimes refused, but that issue can be resolved with exception handling on the client script.

            Source https://stackoverflow.com/questions/67487800

            QUESTION

            How to add flow rules in POX controller
            Asked 2021-Apr-19 at 11:52

            I recently started learning SDN and installed mininet to understand its working. I understood how to build basic topologies and how to create flow rules through command line as well. Then i came across POX controller which seems to better than default controller but I am not able to understand how do I insert flow rules to satisfy various types of networks constraints like traffic between 2 hosts should flow through a specific switch only.

            After going through a lot of internet sources, I figured out that one way would be, I can create my own python file, but my doubt is that inside the python file , I can write syntax for building the topology and then write flow rules but what is the syntax for writing flow rules is my doubt.

            Any material which can explain above issues in detail through examples would be very helpful. Most of the tutorials on github and Internet were tough to understand.

            ...

            ANSWER

            Answered 2021-Apr-19 at 11:52

            You should go through some of POX APIs in the POX documentation. It has a detailed explanation with some examples, which I find to be enough for getting started with building your own POX Component (i.e. what you referred to as a python file).

            As quoted from this teaching material:

            In general a POX controller consists of three parts:

            1.Listener

            2.Control logic

            3.Messenger

            First you need to figure out the type of the event you want the controller to listen to (e.g., ConnectionUp, PacketIn, etc).

            Then using some logic you can distinguish between different flows and attach a proper action for a specific flow.

            Finally you send the message to the switch to add the new rule in the Openflow table.

            Installing new flow rules falls under the control logic part mentioned above, and is explained, with examples, under the OpenFlow Messages section: Flow table modification.

            Source https://stackoverflow.com/questions/65832990

            QUESTION

            How to use ftrace for tcp probe?
            Asked 2021-Feb-15 at 16:10

            I am trying to do an assignment (from another univ's coursepage) which has a line in the starter code (Python with mininet) as

            os.system("rmmod tcp_probe; modprobe tcp_probe full=1")

            Popen("cat /proc/net/tcpprobe > %s" % (outfile), shell=True)

            which gives an error saying that tcp_probe has been disabled.

            I found out by googling that tcp_probe has been deprecated in the linux kernel. However it just asks me to 'do the same using ftrace'. I have tried searching online but could not find out how to use ftrace to achieve the same.

            Any help is appreciated.

            ...

            ANSWER

            Answered 2021-Feb-15 at 16:10

            tldr;

            Unfortunately, I could not find any way to get TCP tracepoints to work in Mininet, which is what ftrace would uses. The reason for this is that the mininet's /sys/kern/debug directory is empty, i.e., tracing cannot be enabled.

            Options:

            1. Using mininet-tracing (not recommended)

            There probably is a way to get the kernel to include this, or you could use https://github.com/mininet/mininet-tracing which might get you what you need, but I have seen reports that it is slow, and has been updated 9 years ago...

            2. Writing a new kernel module (I have tested this and it works)

            What I found as a solution instead, was to force printing for the TCP I had in mind and then take a look at the results that way. In order to enable this, you would essentially need to extend some of TCP's behaviour and (quite possibly) reuse the TCP module you have in mind. And create a new kernel module.

            Here I have provided an example that you can use. It logs socket information on each ACK. I also included a Makefile and a script to load/unload the kernel module. After you enable the module and let some traffic flow (assuming you are on a debian-based linux) you should be able to find the logs of your TCP in /var/log/kern.log.

            Note: This is a hacky way around the issue, but was good enough for my needs, and hopefully can help someone else too.

            Source https://stackoverflow.com/questions/65868476

            QUESTION

            what is the difference between ovs and ovsk?
            Asked 2021-Feb-15 at 04:12

            when running mininet topology, we can use ovs or ovsk for --switch argument in mininet's mn command, for instance:

            ...

            ANSWER

            Answered 2021-Jan-15 at 20:58

            From the mn code in mn git: ovsk and ovs point to the same class of object OVSSwitch, "ovsk" is still existing for compatibility reason, but actually they are the same.

            Source https://stackoverflow.com/questions/65639569

            QUESTION

            How to expose mininet (containernet) host ports to launch application on localhost?
            Asked 2021-Feb-08 at 08:34

            Below is the topology I am trying to create with mininet(containernet) where there are 3 containers with a layer 2 switch in between. I want to access these containers (eg. kali linux container) on the localhost on the browser. I tried exposing the ports like it says in the documentation but still I cannot access it on the browser. Note- I can access the containers (eg kali linux conatiner) if I dont use containernet on localhost. For reference 3rd host uses the following docker container- https://hub.docker.com/r/lukaszlach/kali-desktop

            ...

            ANSWER

            Answered 2021-Feb-08 at 08:34

            The missing piece of the puzzle is we need to add dcmd="/init" to our containernet topology as opposed to our base class.

            For above problem, the following code will work- d2 = net.addDocker('d2', ip='10.0.2.15', dimage="lukaszlach/kali-desktop:xfce-top10",ports=[5900,6080],dcmd="/init , port_bindings={5900:5900,6080:6080},publish_all_ports= True, environment={"USER": "kali", "PASSWORD": "kali" , "ROOT_PASSWORD": "root"})

            Source https://stackoverflow.com/questions/65902549

            QUESTION

            Unable to access values in nested dictionary for adding link in network
            Asked 2020-Dec-02 at 07:57

            I have the following dictionary

            d={'s1': {'s2': {}, 's3': {}, 's4': {}}, 's2': {'s5': {'bw': 20, 'delay': '1ms'}}, 's3': {'s6': {'bw': 20, 'delay': '1ms'}}, 's4': {'s7': {'bw': 20, 'delay': '1ms'}}, 's5': {'h1': {'bw': 10, 'delay': '5ms'}, 'h2': {'bw': 10, 'delay': '5ms'}}, 's6': {'h3': {'bw': 10, 'delay': '5ms'}, 'h4': {'bw': 10, 'delay': '5ms'}}, 's7': {'h5': {'bw': 10, 'delay': '5ms'}, 'h6': {'bw': 10, 'delay': '5ms'}}}

            I would like to access the values of bw and delay for link. For ex- I want addLink(s7,h6,bw=10,delay=5ms) to work.

            I am using following code for it #!/usr/bin/python

            ...

            ANSWER

            Answered 2020-Dec-02 at 00:15

            If you want to call the method as addLink(s7, h6, bw=10, delay=5ms), then you could create the links by using:

            Source https://stackoverflow.com/questions/65100274

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install mininet

            See INSTALL for installation instructions and details.

            Support

            Mininet 2.3.0 supports Python 3 and Python 2!. You can install both the Python 3 and Python 2 versions of Mininet side by side, but the most recent installation will determine which Python version is used by default by mn. You can run mn directly with Python 2 or Python 3, as long as the appropriate version of Mininet is installed, e.g. More information regarding Python 3 and Python 2 support may be found in the release notes on http://docs.mininet.org.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries

            Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular Networking Libraries

            Moya

            by Moya

            diaspora

            by diaspora

            kcptun

            by xtaci

            cilium

            by cilium

            kcp

            by skywind3000

            Try Top Libraries by mininet

            openflow

            by mininetC

            oflops

            by mininetC

            mininet-tests

            by mininetPython

            mininet-util

            by mininetPython

            mininet.github.com

            by mininetHTML