This article will describe how to emulate a leaf and spine network using Mininet and configure the ONOS segment routing application to provide equal cost multi-path (ECMP) routing of flows across the fabric. The Mininet Dashboard application running on the sFlow-RT real-time analytics platform is used to provide visibility into traffic flows across the emulated network.
First, run ONOS using Docker:
docker run --name onos --rm -p 6653:6653 -p 8181:8181 -d onosproject/onosUse the graphical interface, http://onos:8181, to enable the OpenFlow Provider Suite, Network Config Host Provider, Network Config Link Provider, and Segment Routing applications. The screen shot above shows the resulting set of enabled services.
Next, install sFlow-RT and the Mininet Dashboard application on host with Mininet:
wget https://inmon.com/products/sFlow-RT/sflow-rt.tar.gz tar -xvzf sflow-rt.tar.gz ./sflow-rt/get-app.sh sflow-rt mininet-dashboardStart sFlow-RT:
./sflow-rt/start.shDownload the sr.py script:
wget https://raw.githubusercontent.com/sflow-rt/onos-sr/master/sr.pyStart Mininet:
sudo env ONOS=10.0.0.73 mn --custom sr.py,sflow-rt/extras/sflow.py \ --link tc,bw=10 --topo=sr '--controller=remote,ip=$ONOS,port=6653'The sr.py script is used to create a leaf and spine topology in Mininet and send the network configuration to the ONOS controller. The sflow.py script enables sFlow monitoring of the switches and sends the network topology to sFlow-RT.
The leaf and spine topology will appear in the ONOS web interface.
The topology will also appear in the Mininet Dashboard application:
Run an iperf test using the Mininet cli:
mininet> iperf h1 h3The path that the traffic takes is highlighted on the Mininet Dashboard topology:
In this case the traffic flowed between leaf1 and leaf2 via spine1. Since ONOS segment routing uses equal cost multi-path routing, subsequent iperf tests may take the alternative via spine2.
Switch to the Charts tab to see traffic trend charts. In this case, the trend charts show the results of six iperf tests. The Traffic chart shows the top flows and the Topology charts show the busy links and the network diameter.
See Writing Applications for an introduction to programming sFlow-RT's analytics engine. Mininet flow analytics provides a simple example of detecting large (elephant) flows.
Hello.
ReplyDeleteThank you for your post. Can we amend the sr.py (to accommodate a custom topology) or use a custom script to work with onos controller and still use sFlow?
ONOS traffic analytics and ONOS measurement based control provide additional examples of using Mininet with ONOS and sFlow / sFlow-RT.
ReplyDeleteSegment routing requires quite a bit of configuration. You could use the sr.py script as a basis for building your own custom topology. Enabling sFlow is independent of the topology script, just include the sflow-rt/extras/sflow.py script in the list of custom topologies to enable sFlow and push the Mininet topology to sFlow-RT (sFlow-RT must be running before you start Mininet).
hello Peter, thank you for your response. Where can I find help or guidance to create a custom topology bench-marking sr.py? Any help would be much appreciated. Thank you in advance
ReplyDeleteHi Peter,
ReplyDeleteSFlow-RT seems to work really well with software switches in a Mininet environment. Can I also use SFlow-RT on OF-DPA switches? Do you have any experience testing Segment Routing and ONOS with physical switches based on OF-DPA?
Leaf and spine traffic engineering using segment routing and SDN used physical, Broadcom based, switches with ONOS and segment routing. The results closely matched Mininet emulations. In this example the switches were running a version of FTOS.
DeleteBroadcom ASICs supported by OF-DPA include hardware support for sFlow. However, I don't believe OF-DPA includes APIs needed to configure the sFlow instrumentation.
SAI, SDKLT, and OpenNSL provide methods to configure sFlow instrumentation in the ASIC.
The open source Host sFlow has been ported to a number of network operating systems to export the measurements as standard sFlow.
Hi Peter. I followed your tutorial and catched a problem.
ReplyDeleteI can use Iperf to send the packets between 2 hosts, but I cannot replay the packets in a pcap file between 2 hosts (Using tcpreplay). Do you know why?
Thank you in advance
I wouldn't expect replaying a pcap to work. Mininet is emulating a real network and protocol interactions matter (ARP, tcp connection establishment, etc).
DeleteA better approach is to automate tests using iperf, etc. to create real traffic patterns that can be replayed as needed.
Hai sir,
ReplyDeleteI tried the above sections, but i had a problem, when i running this command :
sudo env ONOS=10.0.0.73 mn --custom sr.py,sflow-rt/extras/sflow.py \
--link tc,bw=10 --topo=sr '--controller=remote,ip=$ONOS,port=6653'
Its simply shows the cursor blinking
Then i tried to change the onos ip to localhost
Then its works,and create toplogy on mininet and those output shows in mininet-dashboard
But the onos Gui shows no devices are connected.
how to solve this problem??
If you are running ONOS on the local machine then ONOS=localhost is the correct setting.
DeleteDid you enable the OpenFlow Provider Suite, Network Config Host Provider, Network Config Link Provider, and Segment Routing applications in ONOS?
Thank you sir,
DeleteNow its working fine.Thank you again for sharing this informative blog.Its highly help my project works.
hi sir, thank you for sharing this. I have tried to follow the steps. The devices visible in mininet dashboard but not in onos. Only hosts are registered but not devices. I have enabled all related apps. Have tried on onos 2.5, 2.0, and 1.15. Is there any other setting on onos that I need to enable?
ReplyDeleteDid you enable enable the OpenFlow Provider Suite, Network Config Host Provider, Network Config Link Provider, and Segment Routing applications shown in the ONOS screen capture? ONOS 1.15 was used in this example.
DeleteI just tried the example using the ONOS 2.5 docker image and the examples work. The network topology appears in the ONOS UI. You do need to start the ONOS applications listed above.
DeleteHey, is there a way to add a customized path rather than defaulting to ECMP?
ReplyDeleteThe ONOS segment routing module used to have the ability to set up tunnels. This feature was used to optimize the paths that elephant flows take across the fabric - see Leaf and spine traffic engineering using segment routing and SDN.
DeleteI don't believe that the latest version of ONOS supports the tunnel API. I don't know what the current plans are for adding path selection.
Hi peter, How I can contact you? I am a master student and my dissertation about SRv6. I would like to implement the practical part in my dissertation but I do not know how as I am facing some difficulties. Can you help me and I will pay for your services ?
ReplyDeleteSorry - I don't think I can be of much help. I haven't worked on SRv6 and my current focus is on other applications for sFlow analytics, primarily DDoS mitigation and BGP as a control plane.
DeleteHi Peter,
ReplyDeleteIs there any way to change the code so that it would support TCP? Currently it only supports UDP.
The iperf tests described in this article involve TCP traffic. What code are you referring to?
DeleteHi Peter,
ReplyDeleteHope you are well.
Thank you for this tutorial.
I am able to ping only between h1 and h2, however, I am not able to pingall. I mean the communication happens only between h1 and h2 what could be the problem?
Much appreciated,
M.A
I haven't used ONOS in a while so I don't know if this example works any more. Have you checked to make sure all the ONOS applications needed for segment routing are enabled (the screen capture at the begining of the page shows the list).
DeleteHi Peter,
ReplyDeleteThank you for sharing.
I use docker onos 2.4.0. By running your command, I can see the corresponding switch display on ONOS UI and mininet Dashboard. My h1 can ping h2, but h1 cannot ping h3. Can you tell me what is the reason?
I haven't used ONOS in a while so I don't know if this example works any more. Have you checked to make sure all the ONOS applications needed for segment routing are enabled (the screen capture at the begining of the page shows the list).
Delete