Enabling sFlow in Mininet

2,178 views
Skip to first unread message

Peter Phaal

unread,
May 19, 2016, 11:45:44 PM5/19/16
to sFlow-RT
Enabling sFlow using ovs-vsctl can be tricky. The following article describes simple --custom sflow.py script that automates the process and posts the topology to sFlow-RT:


I hope the script will make it easier for Mininet users to incorporate traffic analytics in their projects.

Peter

Nevyan Neykov

unread,
Jun 5, 2016, 3:39:07 PM6/5/16
to sFlow-RT
Thanks for the update, do you know where one can get the contents of :
extras/sflow.py

Nevyan

Peter Phaal

unread,
Jun 5, 2016, 3:44:01 PM6/5/16
to Nevyan Neykov, sFlow-RT
Download a copy of sFlow-RT:
http://sflow-rt.com/download.php

The sflow.py file is included in the sflow-rt/extras directory
> --
> You received this message because you are subscribed to the Google Groups
> "sFlow-RT" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sflow-rt+u...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Peter Phaal

unread,
Jun 14, 2017, 10:29:21 AM6/14/17
to Nevyan Neykov, sFlow-RT
This discussion is of general interest, so I would like to keep it on the mailing list.

Crossfire DDoS attacks are interesting, 

The sFlow data will allow you to rapidly detect that the links are becoming overloaded and characterize the flows that are driving demand on the link(s).

I don't think OpenStack has APIs that would allow you to mitigate the attacks. It might be more practical to inject controls via BGP. BGP analytics is also likely to be helpful in characterizing the flows. If you can get sFlow directly from the routers then it may include BGP data as part of the sFlow feed, otherwise you can splice BGP data from the router with sFlow from switches:


FYI The latest version of the leafandspine.py script posts the topology (you need to start sFlow-RT first).

On Tue, Jun 13, 2017 at 11:02 PM, Nevyan Neykov <nevya...@gmail.com> wrote:
Hello mr. Phaal,
thank you for the information provided, I've been doing experiments with mininet and sFlow for further usage with OpenStack's OpenVSwitch.
I would like to ask could sFlow script got capabilities to be extended not only to detect elephant flows, but to ensure prevention against elaborate DDoS attacks such as crossfire.
Specifically being interested in features such as: traffic re-routing, and then storing information about persistent (malicious) connections still using the old routes;
as well as doing automatic link bandwidth expansion per host and monitoring the newly allocated bandwidth usage.

Best regards,
Nevyan Neykov

On 20 June 2016 at 10:52, Nevyan Neykov <nevya...@gmail.com> wrote:
Hello, thank you for the information. Managed to push flows to mininet's openvswitch ! It will be good if the leafandspine.py has the same way of pushing mininet's topology as sflow.py without the need to write topology to a file and install an apache server.

Best,
Nevyan

On 13 June 2016 at 04:26, Peter Phaal <peter...@gmail.com> wrote:
The REST API call won't work. You need to use JavaScript API and
include the leafandspine-hybrid.js script:

include('extras/leafandspine-hybrid.js');

The Mininet forwarding rules use two tables. By default table 0 has a
rule to lookup the forwarding rule from table 1. The rules in table 1
implement ECMP forwarding. Adding high priority rules to table 0
override the default behavior. The include emulates the hybrid
OpenFlow NORMAL action as a goto table 1.

http://blog.sflow.com/2014/10/super-normal.html

On Fri, Jun 10, 2016 at 8:07 AM, Nevyan Neykov <nevya...@gmail.com> wrote:
> hello, thank you for the information. After some installations, removing
> already used ports in order to start sflow to listento openflow, and
> manually pushing the topology through CURL, I managed to get the script
> working, when running the rule:
> {"priority":500,"idleTimeout":20,"hardTimeout":3600,"match":{"eth_type":2048,"ip_proto":17,"nw_dst":"10.0.0.2","tcp_src":"53"},"actions":[]}
> it outputs:
> 2016-06-10T08:04:30-0700 WARNING: mark.js mark.js#29 setOfRule: error
> parsing rule: No table found for rule
> now looking out to find this 'table'
> Do you know what might be the reason behind this ?
>
> Best,
> Nevyan
>
>
> On 8 June 2016 at 22:59, Peter Phaal <peter...@gmail.com> wrote:
>>
>> Each of the tutorials is different and the setups are not compatible.
>>
>> I worked through the following tutorial:
>> http://blog.sflow.com/2015/01/hybrid-openflow-ecmp-testbed.html
>>
>> I noticed a mistake (which I corrected). The names of the system
>> properties (http://sflow-rt.com/reference.php#properties) needed to
>> enable the OpenFlow controller have changed since I wrote the article.
>>
>> Here is my start.sh:
>> #!/bin/sh
>>
>> HOME=`dirname $0`
>> cd $HOME
>>
>> JAR="./lib/sflowrt.jar"
>> JVM_OPTS="-Xms200M -Xmx200M -XX:+UseG1GC -XX:MaxGCPauseMillis=100"
>> RT_OPTS="-Dsflow.port=6343 -Dhttp.port=8008 -Dopenflow.start=yes
>> -Dopenflow.flushRules=no -Dscript.file=mark.js"
>>
>> exec java ${JVM_OPTS} ${RT_OPTS} -jar ${JAR}
>>
>> If things are working correctly, you should see the following output
>> when you start sFlow-RT and run an iperf test in Mininet:
>>
>> pp@mininet:~/sflow-rt$ ./start.sh
>>
>> 2016-06-08T13:56:56-0700 INFO: Listening, OpenFlow port 6633
>>
>> 2016-06-08T13:56:56-0700 INFO: Listening, sFlow port 6343
>>
>> 2016-06-08T13:56:56-0700 INFO: Starting the Jetty [HTTP/1.1] server on
>> port 8008
>>
>> 2016-06-08T13:56:56-0700 INFO: Starting
>> com.sflow.rt.rest.SFlowApplication application
>>
>> 2016-06-08T13:56:56-0700 INFO: Listening, http://localhost:8008
>>
>> 2016-06-08T13:56:56-0700 INFO: mark.js started
>>
>> 2016-06-08T13:56:57-0700 INFO: Lead and spine hybrid mode enabled
>>
>> 2016-06-08T13:56:57-0700 INFO: OF: connected to 127.0.0.1:40976 using OF
>> 1.3
>>
>> 2016-06-08T13:56:57-0700 INFO: OF: connected to 127.0.0.1:40977 using OF
>> 1.3
>>
>> 2016-06-08T13:56:57-0700 INFO: OF: connected to 127.0.0.1:40978 using OF
>> 1.3
>>
>> 2016-06-08T13:56:57-0700 INFO: OF: connected to 127.0.0.1:40975 using OF
>> 1.3
>>
>> 2016-06-08T13:56:57-0700 WARNING: OF1.3: error from 127.0.0.1:40978:
>> type = OFPET_BAD_REQUEST, code = OFPBRC_BAD_TYPE, cause =
>> OFStatisticsMessage [type=TABLE_FEATURES, flags=0, data=[]]
>>
>> 2016-06-08T13:56:57-0700 WARNING: OF1.3: error from 127.0.0.1:40977:
>> type = OFPET_BAD_REQUEST, code = OFPBRC_BAD_TYPE, cause =
>> OFStatisticsMessage [type=TABLE_FEATURES, flags=0, data=[]]
>>
>> 2016-06-08T13:56:57-0700 WARNING: OF1.3: error from 127.0.0.1:40975:
>> type = OFPET_BAD_REQUEST, code = OFPBRC_BAD_TYPE, cause =
>> OFStatisticsMessage [type=TABLE_FEATURES, flags=0, data=[]]
>>
>> 2016-06-08T13:56:57-0700 WARNING: OF1.3: error from 127.0.0.1:40976:
>> type = OFPET_BAD_REQUEST, code = OFPBRC_BAD_TYPE, cause =
>> OFStatisticsMessage [type=TABLE_FEATURES, flags=0, data=[]]
>>
>> 2016-06-08T13:56:57-0700 INFO: OF1.3: 127.0.0.1:40977 = datapath
>> 0000000000000004
>>
>> 2016-06-08T13:56:57-0700 INFO: OF1.3: 127.0.0.1:40975 = datapath
>> 0000000000000002
>>
>> 2016-06-08T13:56:57-0700 INFO: OF1.3: 127.0.0.1:40978 = datapath
>> 0000000000000003
>>
>> 2016-06-08T13:56:57-0700 INFO: OF1.3: 127.0.0.1:40976 = datapath
>> 0000000000000001
>>
>> 2016-06-08T13:56:57-0700 INFO: OF1.3: datapath 0000000000000002 added
>> to controller
>>
>> 2016-06-08T13:56:57-0700 INFO: OF1.3: datapath 0000000000000001 added
>> to controller
>>
>> 2016-06-08T13:56:57-0700 INFO: OF1.3: datapath 0000000000000004 added
>> to controller
>>
>> 2016-06-08T13:56:57-0700 INFO: OF1.3: datapath 0000000000000003 added
>> to controller
>>
>> 2016-06-08T13:57:45-0700 INFO: {
>>
>>  "match": {
>>
>>   "in_port": "3",
>>
>>   "dl_type": 2048,
>>
>>   "ip_proto": 6,
>>
>>   "nw_src": "10.0.0.1",
>>
>>   "nw_dst": "10.0.1.2",
>>
>>   "tcp_src": "55699",
>>
>>   "tcp_dst": "5001"
>>
>>  },
>>
>>  "actions": [
>>
>>   "set_ip_dscp=8",
>>
>>   "output=normal"
>>
>>  ],
>>
>>  "priority": 1000,
>>
>>  "idleTimeout": 5
>>
>> }
>>
>> On Wed, Jun 8, 2016 at 12:24 PM, Nevyan Neykov <nevya...@gmail.com>
>> wrote:
>> > I've been doing separate experiments with the scripts. Tried lots of
>> > tutorials on blog.sflow.com -> same results up so far
>> >
>> > port variable stays null.
>> >
>> >
>> > On 8 June 2016 at 18:23, Peter Phaal <peter...@gmail.com> wrote:
>> >>
>> >> If you are using leafandspine.py, don't use sflow.py, the two scripts
>> >> are incompatible. Were you able to get the large flow marking example
>> >> described in the following article working?
>> >> http://blog.sflow.com/2015/01/hybrid-openflow-ecmp-testbed.html
>> >>
>> >> On Wed, Jun 8, 2016 at 8:53 AM, Nevyan Neykov <nevya...@gmail.com>
>> >> wrote:
>> >> > re, again.
>> >> > on other machine somehow managed to run both leafandspine and
>> >> > sflow.py,
>> >> > corrected sflow.py to output full topology:
>> >> >
>> >> > {
>> >> >  "links": {
>> >> >   "s1-s2": {
>> >> >    "node1": "s1",
>> >> >    "node2": "s2",
>> >> >    "port1": "s1-eth1",
>> >> >    "port2": "s2-eth3"
>> >> >   },
>> >> >   "s1-s3": {
>> >> >    "node1": "s1",
>> >> >    "node2": "s3",
>> >> >    "port1": "s1-eth2",
>> >> >    "port2": "s3-eth3"
>> >> >   }
>> >> >  },
>> >> >  "nodes": {
>> >> >   "s1": {
>> >> >    "agent": "127.0.0.1",
>> >> >    "dpid": "0000000000000001",
>> >> >    "ports": {
>> >> >     "s1-eth1": {"ifindex": "306"},
>> >> >     "s1-eth2": {"ifindex": "308"}
>> >> >    }
>> >> >   },
>> >> >   "s2": {
>> >> >    "agent": "127.0.0.1",
>> >> >    "dpid": "0000000000000002",
>> >> >    "ports": {
>> >> >     "s2-eth1": {"ifindex": "309"},
>> >> >     "s2-eth2": {"ifindex": "310"},
>> >> >     "s2-eth3": {"ifindex": "305"}
>> >> >    }
>> >> >   },
>> >> >   "s3": {
>> >> >    "agent": "127.0.0.1",
>> >> >    "dpid": "0000000000000003",
>> >> >    "ports": {
>> >> >     "s3-eth1": {"ifindex": "311"},
>> >> >     "s3-eth2": {"ifindex": "312"},
>> >> >     "s3-eth3": {"ifindex": "307"}
>> >> >    }
>> >> >   }
>> >> >  },
>> >> >  "version": 1
>> >> > }
>> >> >
>> >> > and this is what I get as an output when event is triggered :
>> >> > INFO:
>> >> >
>> >> >
>> >> > {"agent":"127.0.0.1","dataSource":"310","metric":"tcp","threshold":125000,"value":131841.32231404958,"timestamp":1465400800054,"thresholdID":"elephant","eventID":5,"flowKey":"10.0.0.2,10.0.0.3,57289,5001"}
>> >> > then ofInterfaceToPort - retuns null.
>> >> > so the script can not continue.
>> >> >
>> >> > Best,
>> >> > Nevyan
>> >> >
>> >> > On 8 June 2016 at 11:38, Nevyan Neykov <nevya...@gmail.com> wrote:
>> >> >>
>> >> >> Hello, I've tried the leafandspine.py example, first it starts with:
>> >> >> Unable to contact the remote controller at remote: 6633
>> >> >> then on: adding links: (10.00Mbit) *** Error: RTNETLINK answers: No
>> >> >> such
>> >> >> file or directory
>> >> >> then on starting switches: ovs-ofctl: unknown action !
>> >> >>
>> >> >> Best,
>> >> >> Nevyan
>> >> >>
>> >> >> On 7 June 2016 at 23:54, Peter Phaal <peter...@gmail.com> wrote:
>> >> >>>
>> >> >>> You need to use the leafandspine.py script to setup Mininet if you
>> >> >>> want to use sFlow-RT's hybrid OpenFlow controller:
>> >> >>> http://blog.sflow.com/2015/01/hybrid-openflow-ecmp-testbed.html
>> >> >>>
>> >> >>> The controller will not work with a generic Mininet topology. It
>> >> >>> requires that the flow rules are pre-populated (see the
>> >> >>> leafandspine.py script for an example).
>> >> >>>
>> >> >>> There /of/rule/{dpid}/{name}/json REST API can be used to install
>> >> >>> rules, but you need to supply a mapping between sFlow agent/ifindex
>> >> >>> and OpenFlow dpid/port. The leafandspine.py script adds this
>> >> >>> information to the exported topology.
>> >> >>>
>> >> >>>
>> >> >>> On Tue, Jun 7, 2016 at 7:06 AM, Nevyan Neykov
>> >> >>> <nevya...@gmail.com>
>> >> >>> wrote:
>> >> >>> > Thanks for the reply. I've tried the tutorials given, modified
>> >> >>> > them
>> >> >>> > to
>> >> >>> > work
>> >> >>> > with mininet until the point of insertion of the openflow rule,
>> >> >>> > then
>> >> >>> > again
>> >> >>> > setOfRule function giving the null pointer exception. Testing
>> >> >>> > them
>> >> >>> > on 2
>> >> >>> > different ubuntu/virtualbox/mininet installations. Same exception
>> >> >>> > coming
>> >> >>> > when tested with the new topology mapping setup: sudo mn --custom
>> >> >>> > extras/sflow.py --link tc,bw=10 --topo tree,depth=2,fanout=2
>> >> >>> >
>> >> >>> > I would also like to ask, whether is possible with python only
>> >> >>> > REST
>> >> >>> > API
>> >> >>> > to
>> >> >>> > trigger setOfRule or similar function in order to set openflow
>> >> >>> > rule,
>> >> >>> > such
>> >> >>> > as:/of/rule/{dpid}/{name}/json -> requiring the 'dpid' parameter,
>> >> >>> > which
>> >> >>> > I
>> >> >>> > wonder how to get from the captured event.
>> >> >>> >
>> >> >>> > Best,
>> >> >>> > Nevyan
>> >> >>> >
>> >> >>
>> >> >>
>> >> >
>> >
>> >
>
>



Peter Phaal

unread,
Jun 18, 2017, 8:01:28 PM6/18/17
to Nevyan Neykov, sFlow-RT
Please don't drop the mailing list.

Is there any reason to be using Ubuntu 17.04? I get errors relating to setting link bandwidth on Ubuntu 16+ (output shown below). Setting link speeds is critical. I have found Mininet to work most reliably on Ubuntu 14.04.

$ sudo mn --link tc,bw=10

*** No default OpenFlow controller found for default switch!

*** Falling back to OVS Bridge

*** Creating network

*** Adding controller

*** Adding hosts:

h1 h2 

*** Adding switches:

s1 

*** Adding links:

(10.00Mbit) *** Error: RTNETLINK answers: No such file or directory

(10.00Mbit) *** Error: RTNETLINK answers: No such file or directory

(h1, s1) (10.00Mbit) *** Error: RTNETLINK answers: No such file or directory

(10.00Mbit) *** Error: RTNETLINK answers: No such file or directory

(h2, s1) 

*** Configuring hosts

h1 h2 

*** Starting controller


*** Starting 1 switches

s1 ...(10.00Mbit) (10.00Mbit) 

*** Starting CLI:


On Sun, Jun 18, 2017 at 9:03 AM, Nevyan Neykov <nevya...@gmail.com> wrote:
Hello, thank you for the BGP idea,

trying the examples again on ubuntu 17.04, mininet 2.2.2 starting with http://blog.sflow.com/2016/05/mininet-flow-analytics.html

replaced:
  ifs = re.findall(r'^(\S+).*?inet addr:(\S+).*?', ifconfig, re.S|re.M)

with:
  ifs = re.findall(r'^(\S+).*?inet (\S+).*?', ifconfig, re.S|re.M)

because of an error, resulting in empty array. Then the network topology loads fine, but elephant.py as well as the graphical sflow-rt won't recognize events such as large flows, when testing with iperf. Also the agents are not shown on sflow-rt. Do you have any further ideas.

Best,
Nevyan

 

Nevyan Neykov

unread,
Jun 19, 2017, 6:17:27 AM6/19/17
to Peter Phaal, sFlow-RT
ok, got it running under ubuntu 14.04 !
I would appreciate any information on how to achieve integration between sFlow and Quagga in order to get the BGP example working.

Best, Nevyan

Peter Phaal

unread,
Jun 19, 2017, 11:31:50 AM6/19/17
to sFlow-RT, peter...@gmail.com
The following article demonstrates remote triggered blackhole routing using Quagga and VirtualBox VMs:

The example uses CumulusVX images for the routers, but you could just use Linux VMs to run Quagga and Host sFlow (http://www.sflow.net) agents.

It may also be possible to run multiple Quagga instances under Mininet, but I have never tried it.

Peter Phaal

unread,
Jun 21, 2017, 11:09:13 AM6/21/17
to Nevyan Neykov, sFlow-RT
The following error message is a clue:

ovs-vsctl: no row "r010_1" in table Bridge

The sflow.py script assumes that the network devices in the Mininet topology are Open vSwitch bridges. In your case, they are Router objects:

It might be easiest to move the gathering and export of topology information and configuration of sFlow to the start.py script.

On Wed, Jun 21, 2017 at 3:11 AM, Nevyan Neykov <nevya...@gmail.com> wrote:
BGP and mininet, with lots of adjustments so far successfully. Then used extras/sflow.py in order to connect sflow to the topology. So far the topology is not getting exported to sflow-rt. Attaching my debugging efforts, if you could please take a look on.

*** errRun: ['grep', '-c', 'processor', '/proc/cpuinfo']
1
  0*** Setting resource limits

*** Creating network
*** Adding controller
*** errRun: ['which', 'controller']
/usr/local/bin/controller
  0*** errRun: ['which', 'mnexec']
/usr/bin/mnexec
  0*** errRun: ['which', 'ifconfig']
/sbin/ifconfig
  0*** c0 : ('unset HISTFILE; stty -echo; set +m',)
unset HISTFILE; stty -echo; set +m
*** errRun: ['which', 'telnet']
/usr/bin/telnet
  0*** c0 : ('echo A | telnet -e A 127.0.0.1 6653',)
Telnet escape character is 'A'.
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection refused
*** Adding hosts:
*** errRun: ['which', 'mnexec']
/usr/bin/mnexec
  0*** errRun: ['which', 'ifconfig']
/sbin/ifconfig
  0*** h010_11 : ('unset HISTFILE; stty -echo; set +m',)
unset HISTFILE; stty -echo; set +m
h010_11 *** h010_21 : ('unset HISTFILE; stty -echo; set +m',)
unset HISTFILE; stty -echo; set +m
h010_21 *** h010_31 : ('unset HISTFILE; stty -echo; set +m',)
unset HISTFILE; stty -echo; set +m
h010_31 *** h010_41 : ('unset HISTFILE; stty -echo; set +m',)
unset HISTFILE; stty -echo; set +m
h010_41 *** h010_51 : ('unset HISTFILE; stty -echo; set +m',)
unset HISTFILE; stty -echo; set +m
h010_51 *** h100_11 : ('unset HISTFILE; stty -echo; set +m',)
unset HISTFILE; stty -echo; set +m
h100_11 *** h200_11 : ('unset HISTFILE; stty -echo; set +m',)
unset HISTFILE; stty -echo; set +m
h200_11
*** Adding switches:
*** r010_1 : ('unset HISTFILE; stty -echo; set +m',)
unset HISTFILE; stty -echo; set +m
r010_1 *** r010_2 : ('unset HISTFILE; stty -echo; set +m',)
unset HISTFILE; stty -echo; set +m
r010_2 *** r010_3 : ('unset HISTFILE; stty -echo; set +m',)
unset HISTFILE; stty -echo; set +m
r010_3 *** r010_4 : ('unset HISTFILE; stty -echo; set +m',)
unset HISTFILE; stty -echo; set +m
r010_4 *** r010_5 : ('unset HISTFILE; stty -echo; set +m',)
unset HISTFILE; stty -echo; set +m
r010_5 *** r100_1 : ('unset HISTFILE; stty -echo; set +m',)
unset HISTFILE; stty -echo; set +m
r100_1 *** r200_1 : ('unset HISTFILE; stty -echo; set +m',)
unset HISTFILE; stty -echo; set +m
r200_1
*** Adding links:
*** r010_1 : ('ip link add name r010_1-eth3 address 96:7d:c0:46:b6:82 type veth peer name h010_11-eth0 address e6:24:2d:40:ca:04 netns 10760',)

added intf r010_1-eth3 (3) to node r010_1
moving r010_1-eth3 into namespace for r010_1
*** r010_1 : ('ifconfig', 'r010_1-eth3', 'up')

added intf h010_11-eth0 (0) to node h010_11
moving h010_11-eth0 into namespace for h010_11
*** h010_11 : ('ifconfig', 'h010_11-eth0', 'up')
(r010_1, h010_11) *** r010_1 : ('ip link add name r010_1-eth1 address d6:a0:4e:1d:56:cd type veth peer name r010_2-eth1 address 26:a4:d5:50:b9:28 netns 10776',)

added intf r010_1-eth1 (1) to node r010_1
moving r010_1-eth1 into namespace for r010_1
*** r010_1 : ('ifconfig', 'r010_1-eth1', 'up')

added intf r010_2-eth1 (1) to node r010_2
moving r010_2-eth1 into namespace for r010_2
*** r010_2 : ('ifconfig', 'r010_2-eth1', 'up')
(r010_1, r010_2) *** r010_1 : ('ip link add name r010_1-eth4 address 4a:02:f4:83:7a:f8 type veth peer name r100_1-eth1 address c6:e9:99:86:e8:de netns 10784',)

added intf r010_1-eth4 (4) to node r010_1
moving r010_1-eth4 into namespace for r010_1
*** r010_1 : ('ifconfig', 'r010_1-eth4', 'up')

added intf r100_1-eth1 (1) to node r100_1
moving r100_1-eth1 into namespace for r100_1
*** r100_1 : ('ifconfig', 'r100_1-eth1', 'up')
(r010_1, r100_1) *** r010_1 : ('ip link add name r010_1-eth5 address a2:8b:de:51:e7:b1 type veth peer name r200_1-eth1 address 0a:a6:2a:9b:17:87 netns 10786',)

added intf r010_1-eth5 (5) to node r010_1
moving r010_1-eth5 into namespace for r010_1
*** r010_1 : ('ifconfig', 'r010_1-eth5', 'up')

added intf r200_1-eth1 (1) to node r200_1
moving r200_1-eth1 into namespace for r200_1
*** r200_1 : ('ifconfig', 'r200_1-eth1', 'up')
(r010_1, r200_1) *** r010_2 : ('ip link add name r010_2-eth3 address ce:c3:55:a5:d6:b9 type veth peer name h010_21-eth0 address 3e:07:36:63:75:3f netns 10762',)

added intf r010_2-eth3 (3) to node r010_2
moving r010_2-eth3 into namespace for r010_2
*** r010_2 : ('ifconfig', 'r010_2-eth3', 'up')

added intf h010_21-eth0 (0) to node h010_21
moving h010_21-eth0 into namespace for h010_21
*** h010_21 : ('ifconfig', 'h010_21-eth0', 'up')
(r010_2, h010_21) *** r010_2 : ('ip link add name r010_2-eth2 address 2a:10:b9:35:02:85 type veth peer name r010_3-eth1 address 36:a2:01:e2:be:30 netns 10778',)

added intf r010_2-eth2 (2) to node r010_2
moving r010_2-eth2 into namespace for r010_2
*** r010_2 : ('ifconfig', 'r010_2-eth2', 'up')

added intf r010_3-eth1 (1) to node r010_3
moving r010_3-eth1 into namespace for r010_3
*** r010_3 : ('ifconfig', 'r010_3-eth1', 'up')
(r010_2, r010_3) *** r010_3 : ('ip link add name r010_3-eth3 address 1a:f5:ff:b6:c9:e9 type veth peer name h010_31-eth0 address 02:29:dd:0c:26:19 netns 10764',)

added intf r010_3-eth3 (3) to node r010_3
moving r010_3-eth3 into namespace for r010_3
*** r010_3 : ('ifconfig', 'r010_3-eth3', 'up')

added intf h010_31-eth0 (0) to node h010_31
moving h010_31-eth0 into namespace for h010_31
*** h010_31 : ('ifconfig', 'h010_31-eth0', 'up')
(r010_3, h010_31) *** r010_3 : ('ip link add name r010_3-eth2 address 82:dd:6a:b7:43:ce type veth peer name r010_4-eth1 address 16:4a:56:47:b5:61 netns 10780',)

added intf r010_3-eth2 (2) to node r010_3
moving r010_3-eth2 into namespace for r010_3
*** r010_3 : ('ifconfig', 'r010_3-eth2', 'up')

added intf r010_4-eth1 (1) to node r010_4
moving r010_4-eth1 into namespace for r010_4
*** r010_4 : ('ifconfig', 'r010_4-eth1', 'up')
(r010_3, r010_4) *** r010_4 : ('ip link add name r010_4-eth3 address ba:d9:27:09:d6:7e type veth peer name h010_41-eth0 address c2:07:bc:80:93:24 netns 10766',)

added intf r010_4-eth3 (3) to node r010_4
moving r010_4-eth3 into namespace for r010_4
*** r010_4 : ('ifconfig', 'r010_4-eth3', 'up')

added intf h010_41-eth0 (0) to node h010_41
moving h010_41-eth0 into namespace for h010_41
*** h010_41 : ('ifconfig', 'h010_41-eth0', 'up')
(r010_4, h010_41) *** r010_4 : ('ip link add name r010_4-eth2 address 0e:4f:17:67:65:78 type veth peer name r010_5-eth1 address da:e1:6d:70:9b:5c netns 10782',)

added intf r010_4-eth2 (2) to node r010_4
moving r010_4-eth2 into namespace for r010_4
*** r010_4 : ('ifconfig', 'r010_4-eth2', 'up')

added intf r010_5-eth1 (1) to node r010_5
moving r010_5-eth1 into namespace for r010_5
*** r010_5 : ('ifconfig', 'r010_5-eth1', 'up')
(r010_4, r010_5) *** r010_5 : ('ip link add name r010_5-eth3 address fa:17:83:67:0e:9d type veth peer name h010_51-eth0 address c2:8f:ae:18:bc:03 netns 10768',)

added intf r010_5-eth3 (3) to node r010_5
moving r010_5-eth3 into namespace for r010_5
*** r010_5 : ('ifconfig', 'r010_5-eth3', 'up')

added intf h010_51-eth0 (0) to node h010_51
moving h010_51-eth0 into namespace for h010_51
*** h010_51 : ('ifconfig', 'h010_51-eth0', 'up')
(r010_5, h010_51) *** r010_5 : ('ip link add name r010_5-eth2 address 8a:09:10:5f:8f:cf type veth peer name r010_1-eth2 address be:ac:74:7b:53:ec netns 10774',)

added intf r010_5-eth2 (2) to node r010_5
moving r010_5-eth2 into namespace for r010_5
*** r010_5 : ('ifconfig', 'r010_5-eth2', 'up')

added intf r010_1-eth2 (2) to node r010_1
moving r010_1-eth2 into namespace for r010_1
*** r010_1 : ('ifconfig', 'r010_1-eth2', 'up')
(r010_5, r010_1) *** r100_1 : ('ip link add name r100_1-eth3 address 5a:e1:89:33:ff:2d type veth peer name h100_11-eth0 address 5a:65:c0:bb:32:cf netns 10770',)

added intf r100_1-eth3 (3) to node r100_1
moving r100_1-eth3 into namespace for r100_1
*** r100_1 : ('ifconfig', 'r100_1-eth3', 'up')

added intf h100_11-eth0 (0) to node h100_11
moving h100_11-eth0 into namespace for h100_11
*** h100_11 : ('ifconfig', 'h100_11-eth0', 'up')
(r100_1, h100_11) *** r100_1 : ('ip link add name r100_1-eth2 address be:eb:6a:42:a4:7a type veth peer name r200_1-eth2 address 82:3f:02:9b:90:56 netns 10786',)

added intf r100_1-eth2 (2) to node r100_1
moving r100_1-eth2 into namespace for r100_1
*** r100_1 : ('ifconfig', 'r100_1-eth2', 'up')

added intf r200_1-eth2 (2) to node r200_1
moving r200_1-eth2 into namespace for r200_1
*** r200_1 : ('ifconfig', 'r200_1-eth2', 'up')
(r100_1, r200_1) *** r200_1 : ('ip link add name r200_1-eth3 address 56:6a:d3:49:c0:9d type veth peer name h200_11-eth0 address e2:32:1a:bc:12:d2 netns 10772',)

added intf r200_1-eth3 (3) to node r200_1
moving r200_1-eth3 into namespace for r200_1
*** r200_1 : ('ifconfig', 'r200_1-eth3', 'up')

added intf h200_11-eth0 (0) to node h200_11
moving h200_11-eth0 into namespace for h200_11
*** h200_11 : ('ifconfig', 'h200_11-eth0', 'up')
(r200_1, h200_11)
*** Configuring hosts
h010_11 *** h010_11 : ('ifconfig', 'h010_11-eth0', '10.0.0.1/8', 'up')
*** h010_11 : ('ifconfig lo up',)
h010_21 *** h010_21 : ('ifconfig', 'h010_21-eth0', '10.0.0.2/8', 'up')
*** h010_21 : ('ifconfig lo up',)
h010_31 *** h010_31 : ('ifconfig', 'h010_31-eth0', '10.0.0.3/8', 'up')
*** h010_31 : ('ifconfig lo up',)
h010_41 *** h010_41 : ('ifconfig', 'h010_41-eth0', '10.0.0.4/8', 'up')
*** h010_41 : ('ifconfig lo up',)
h010_51 *** h010_51 : ('ifconfig', 'h010_51-eth0', '10.0.0.5/8', 'up')
*** h010_51 : ('ifconfig lo up',)
h100_11 *** h100_11 : ('ifconfig', 'h100_11-eth0', '10.0.0.6/8', 'up')
*** h100_11 : ('ifconfig lo up',)
h200_11 *** h200_11 : ('ifconfig', 'h200_11-eth0', '10.0.0.7/8', 'up')
*** h200_11 : ('ifconfig lo up',)

*** Starting controller
c0 *** errRun: ['which', 'controller']
/usr/local/bin/controller
  0*** c0 : ('controller -v ptcp:6653 1>/tmp/c0.log 2>/tmp/c0.log &',)

*** Starting 7 switches
r010_1 r010_2 r010_3 r010_4 r010_5 r100_1 r200_1
*** r010_1 : ('sysctl -w net.ipv4.ip_forward=1',)
net.ipv4.ip_forward = 1
*** r010_2 : ('sysctl -w net.ipv4.ip_forward=1',)
net.ipv4.ip_forward = 1
*** r010_3 : ('sysctl -w net.ipv4.ip_forward=1',)
net.ipv4.ip_forward = 1
*** r010_4 : ('sysctl -w net.ipv4.ip_forward=1',)
net.ipv4.ip_forward = 1
*** r010_5 : ('sysctl -w net.ipv4.ip_forward=1',)
net.ipv4.ip_forward = 1
*** r100_1 : ('sysctl -w net.ipv4.ip_forward=1',)
net.ipv4.ip_forward = 1
*** r200_1 : ('sysctl -w net.ipv4.ip_forward=1',)
net.ipv4.ip_forward = 1
Waiting 3 seconds for sysctl changes to take effect...
*** r010_1 : ('/usr/lib/quagga/zebra -f conf/zebra-r010_1.conf -d -i /tmp/zebra-r010_1.pid > logs/r010_1-zebra-stdout 2>&1',)
% Can't set interface IP address: Success.
*** r010_1 : ('/usr/lib/quagga/ospfd -f conf/ospfd-r010_1.conf -d -i /tmp/ospfd-r010_1.pid > logs/r010_1-ospfd-stdout 2>&1',)
*** r010_1 : ('/usr/lib/quagga/bgpd -f conf/bgpd-r010_1.conf -d -i /tmp/bgpd-r010_1.pid > logs/r010_1-bgpd-stdout 2>&1',)
Starting zebra and ospfd and bgpd on r010_1
*** r010_2 : ('/usr/lib/quagga/zebra -f conf/zebra-r010_2.conf -d -i /tmp/zebra-r010_2.pid > logs/r010_2-zebra-stdout 2>&1',)
% Can't set interface IP address: Success.
*** r010_2 : ('/usr/lib/quagga/ospfd -f conf/ospfd-r010_2.conf -d -i /tmp/ospfd-r010_2.pid > logs/r010_2-ospfd-stdout 2>&1',)
Starting zebra and ospfd on r010_2
*** r010_3 : ('/usr/lib/quagga/zebra -f conf/zebra-r010_3.conf -d -i /tmp/zebra-r010_3.pid > logs/r010_3-zebra-stdout 2>&1',)
% Can't set interface IP address: Success.
*** r010_3 : ('/usr/lib/quagga/ospfd -f conf/ospfd-r010_3.conf -d -i /tmp/ospfd-r010_3.pid > logs/r010_3-ospfd-stdout 2>&1',)
Starting zebra and ospfd on r010_3
*** r010_4 : ('/usr/lib/quagga/zebra -f conf/zebra-r010_4.conf -d -i /tmp/zebra-r010_4.pid > logs/r010_4-zebra-stdout 2>&1',)
% Can't set interface IP address: Success.
*** r010_4 : ('/usr/lib/quagga/ospfd -f conf/ospfd-r010_4.conf -d -i /tmp/ospfd-r010_4.pid > logs/r010_4-ospfd-stdout 2>&1',)
Starting zebra and ospfd on r010_4
*** r010_5 : ('/usr/lib/quagga/zebra -f conf/zebra-r010_5.conf -d -i /tmp/zebra-r010_5.pid > logs/r010_5-zebra-stdout 2>&1',)
% Can't set interface IP address: Success.
*** r010_5 : ('/usr/lib/quagga/ospfd -f conf/ospfd-r010_5.conf -d -i /tmp/ospfd-r010_5.pid > logs/r010_5-ospfd-stdout 2>&1',)
Starting zebra and ospfd on r010_5
*** r100_1 : ('/usr/lib/quagga/zebra -f conf/zebra-r100_1.conf -d -i /tmp/zebra-r100_1.pid > logs/r100_1-zebra-stdout 2>&1',)
% Can't set interface IP address: Success.
*** r100_1 : ('/usr/lib/quagga/bgpd -f conf/bgpd-r100_1.conf -d -i /tmp/bgpd-r100_1.pid > logs/r100_1-bgpd-stdout 2>&1',)
Starting zebra and bgpd on r100_1
*** r200_1 : ('/usr/lib/quagga/zebra -f conf/zebra-r200_1.conf -d -i /tmp/zebra-r200_1.pid > logs/r200_1-zebra-stdout 2>&1',)
% Can't set interface IP address: Success.
*** r200_1 : ('/usr/lib/quagga/bgpd -f conf/bgpd-r200_1.conf -d -i /tmp/bgpd-r200_1.pid > logs/r200_1-bgpd-stdout 2>&1',)
Starting zebra and bgpd on r200_1
*** h010_11 : ('ifconfig h010_11-eth0 10.1.0.2/24',)
*** h010_11 : ('route add default gw 10.1.0.1',)
*** h010_21 : ('ifconfig h010_21-eth0 10.2.0.2/24',)
*** h010_21 : ('route add default gw 10.2.0.1',)
*** h010_31 : ('ifconfig h010_31-eth0 10.3.0.2/24',)
*** h010_31 : ('route add default gw 10.3.0.1',)
*** h010_41 : ('ifconfig h010_41-eth0 10.4.0.2/24',)
*** h010_41 : ('route add default gw 10.4.0.1',)
*** h010_51 : ('ifconfig h010_51-eth0 10.5.0.2/24',)
*** h010_51 : ('route add default gw 10.5.0.1',)
*** h100_11 : ('ifconfig h100_11-eth0 100.1.0.2/24',)
*** h100_11 : ('route add default gw 100.1.0.1',)
*** h200_11 : ('ifconfig h200_11-eth0 200.1.0.2/24',)
*** h200_11 : ('route add default gw 200.1.0.1',)
*** Enabling sFlow:
!setting sflow to switches!
ovs-vsctl -- --id=@sflow create sflow agent=lo target=127.0.0.1 sampling=10 polling=10 -- -- set bridge r010_1 sflow=@sflow -- set bridge r010_2 sflow=@sflow -- set bridge r010_3 sflow=@sflow -- set bridge r010_4 sflow=@sflow -- set bridge r010_5 sflow=@sflow -- set bridge r100_1 sflow=@sflow -- set bridge r200_1 sflow=@sflow
r010_1 r010_2 r010_3 r010_4 r010_5 r100_1 r200_1
*** errRun: ['ovs-vsctl', '--', '--id=@sflow', 'create', 'sflow', 'agent=lo', 'target=127.0.0.1', 'sampling=10', 'polling=10', '--', '--', 'set', 'bridge', 'r010_1', 'sflow=@sflow', '--', 'set', 'bridge', 'r010_2', 'sflow=@sflow', '--', 'set', 'bridge', 'r010_3', 'sflow=@sflow', '--', 'set', 'bridge', 'r010_4', 'sflow=@sflow', '--', 'set', 'bridge', 'r010_5', 'sflow=@sflow', '--', 'set', 'bridge', 'r100_1', 'sflow=@sflow', '--', 'set', 'bridge', 'r200_1', 'sflow=@sflow']
ovs-vsctl: no row "r010_1" in table Bridge
  1*** Sending topology
!switches!
[<Router r010_1: r010_1-eth1:None,r010_1-eth2:None,r010_1-eth3:None,r010_1-eth4:None,r010_1-eth5:None pid=10774> , <Router r010_2: r010_2-eth1:None,r010_2-eth2:None,r010_2-eth3:None pid=10776> , <Router r010_3: r010_3-eth1:None,r010_3-eth2:None,r010_3-eth3:None pid=10778> , <Router r010_4: r010_4-eth1:None,r010_4-eth2:None,r010_4-eth3:None pid=10780> , <Router r010_5: r010_5-eth1:None,r010_5-eth2:None,r010_5-eth3:None pid=10782> , <Router r100_1: r100_1-eth1:None,r100_1-eth2:None,r100_1-eth3:None pid=10784> , <Router r200_1: r200_1-eth1:None,r200_1-eth2:None,r200_1-eth3:None pid=10786> ]
{'ports': {}, 'agent': '127.0.0.1'}
{'ports': {}, 'agent': '127.0.0.1'}
{'ports': {}, 'agent': '127.0.0.1'}
{'ports': {}, 'agent': '127.0.0.1'}
{'ports': {}, 'agent': '127.0.0.1'}
{'ports': {}, 'agent': '127.0.0.1'}
{'ports': {}, 'agent': '127.0.0.1'}
{'ports': {}, 'agent': '127.0.0.1'}
*** Starting CLI:


Best,
Nevyan

Nevyan Neykov

unread,
Jun 21, 2017, 11:39:21 AM6/21/17
to Peter Phaal, sFlow-RT
Yes, I used the suggested approach in the attached file, initializing sFlow right after the network topology generation, BGP and OSPF initialization, but probably not implementing it the right way.
Reply all
Reply to author
Forward
0 new messages