Discussion:
[openflow-discuss] Error encountered on issuing dpctl to dump-flows
Navina Ramesh
2013-04-27 20:34:22 UTC
Permalink
Hi,

I have just started writing controllers using Openflow. I am using Mininet 2.0.0 to create a network with 2 OVS Switches. I wrote a controller that behaves like a learning switch, similar to what is shown in l2_learning.py.
I was trying to view the flows I installed by issuing the dpctl command to the switch in my terminal as:

***@mininet-vm:~/pox$ dpctl show tcp:127.0.0.1:6633
dpctl: talking to tcp:127.0.0.1:6633: unexpected end of file

I am running mininet and controller in the same virtual image and hence, 127.0.0.1.

I am getting the following error on my controller(pox) terminal:

ERROR:openflow.of_01:[Con 5/None]: Exception while handling OpenFlow message:
[Con 5/None] ofp_features_request
[Con 5/None] header:
[Con 5/None] version: 1
[Con 5/None] type: 5 (OFPT_FEATURES_REQUEST)
[Con 5/None] length: 8
[Con 5/None] xid: 862702809
Traceback (most recent call last):
File "/home/mininet/pox/pox/openflow/of_01.py", line 622, in read
h(self, msg)
TypeError: 'NoneType' object is not callable

I am not able to figure out why this error is caused. Should I be handling anything in my controller code?

Any pointers will be helpful.

Thanks!
Navina
Eric Chou
2013-04-28 18:13:44 UTC
Permalink
Hi Navina, you can probably add that in your controller code, but it is probably worth pointing out that OVS provides the feature to passively listens for dpctl messages while actively registers to OF controllers. By default this is turned off, you can see that from ~/mininet/mininet/node.py __init__ function with listenPort=None. So you simply need to enable it when you create your custom topology. For my project, I created a custom topology and added them as:

s1 = net.addSwitch('s1')
s1.listenPort = 6634
s2 = net.addSwitch('s2')
s2.listenPort = 6635
s3 = net.addSwitch('s3')
s3.listenPort = 6636

Full code here:
https://github.com/ericchou-python/PyTapDEMON/blob/master/MininetTopology/PyTapDEMON_topo.py

Then dpctl works:
***@mininet-vm:~/pox$ dpctl dump-flows tcp:127.0.0.1:6634
stats_reply (xid=0x4cbd6894): flags=none type=1(flow)
***@mininet-vm:~/pox$ dpctl dump-flows tcp:127.0.0.1:6635
stats_reply (xid=0xbe6b6a1b): flags=none type=1(flow)
***@mininet-vm:~/pox$ dpctl dump-flows tcp:127.0.0.1:6636
stats_reply (xid=0x158a3b4a): flags=none type=1(flow)
***@mininet-vm:~/pox$

If I comment out, say s3 port 6636:
***@mininet-vm:~/pox$ dpctl dump-flows tcp:127.0.0.1:6636
dpctl: failed to send packet to switch: Connection refused
***@mininet-vm:~/pox$

Hope it helps.

Eric
Post by Navina Ramesh
Hi,
I have just started writing controllers using Openflow. I am using Mininet 2.0.0 to create a network with 2 OVS Switches. I wrote a controller that behaves like a learning switch, similar to what is shown in l2_learning.py.
dpctl: talking to tcp:127.0.0.1:6633: unexpected end of file
I am running mininet and controller in the same virtual image and hence, 127.0.0.1.
[Con 5/None] ofp_features_request
[Con 5/None] version: 1
[Con 5/None] type: 5 (OFPT_FEATURES_REQUEST)
[Con 5/None] length: 8
[Con 5/None] xid: 862702809
File "/home/mininet/pox/pox/openflow/of_01.py", line 622, in read
h(self, msg)
TypeError: 'NoneType' object is not callable
I am not able to figure out why this error is caused. Should I be handling anything in my controller code?
Any pointers will be helpful.
Thanks!
Navina
_______________________________________________
openflow-discuss mailing list
https://mailman.stanford.edu/mailman/listinfo/openflow-discuss
Bob Lantz
2013-04-28 21:37:55 UTC
Permalink
1. For OVS, you can (should?) just use ovs-ofctl:

# ovs-ofctl show s1

We should probably update the OpenFlow tutorial (anyone can, actually.)

2. You should also be able to pass listenPort into the Mininet constructor

net = Mininet( ... , listenPort=6634)

3. You should also be able to pass parameters into the switch constructor:

s1 = net.addSwitch( 's1', listenPort=6634 ... )

4. You should also be able to use

sudo mn --listenport=6634
Post by Eric Chou
s1 = net.addSwitch('s1')
s1.listenPort = 6634
s2 = net.addSwitch('s2')
s2.listenPort = 6635
s3 = net.addSwitch('s3')
s3.listenPort = 6636
https://github.com/ericchou-python/PyTapDEMON/blob/master/MininetTopology/PyTapDEMON_topo.py
stats_reply (xid=0x4cbd6894): flags=none type=1(flow)
stats_reply (xid=0xbe6b6a1b): flags=none type=1(flow)
stats_reply (xid=0x158a3b4a): flags=none type=1(flow)
dpctl: failed to send packet to switch: Connection refused
Hope it helps.
Eric
Post by Navina Ramesh
Hi,
I have just started writing controllers using Openflow. I am using Mininet 2.0.0 to create a network with 2 OVS Switches. I wrote a controller that behaves like a learning switch, similar to what is shown in l2_learning.py.
dpctl: talking to tcp:127.0.0.1:6633: unexpected end of file
I am running mininet and controller in the same virtual image and hence, 127.0.0.1.
[Con 5/None] ofp_features_request
[Con 5/None] version: 1
[Con 5/None] type: 5 (OFPT_FEATURES_REQUEST)
[Con 5/None] length: 8
[Con 5/None] xid: 862702809
File "/home/mininet/pox/pox/openflow/of_01.py", line 622, in read
h(self, msg)
TypeError: 'NoneType' object is not callable
I am not able to figure out why this error is caused. Should I be handling anything in my controller code?
Any pointers will be helpful.
Thanks!
Navina
_______________________________________________
openflow-discuss mailing list
https://mailman.stanford.edu/mailman/listinfo/openflow-discuss
_______________________________________________
openflow-discuss mailing list
https://mailman.stanford.edu/mailman/listinfo/openflow-discuss
Eric Chou
2013-04-29 03:20:06 UTC
Permalink
Thanks Bob! Your reply in #1 pointed me to read up on the difference between ovs-ofctl vs. ovs-dpctl. I think I get the difference after reading more about both. One quick question, what is the difference between dpctl vs. ovs-dpctl / ovs-ofctl? I guess one was a historical tool and the other two were separated out as the cleaner way to separate what the switch installs vs. what OpenFlow sees? Is that a fair statement?

If I play with the ova-ofctl more and feel I can accurately update the tutorial I will find some time to do it. :)

Eric
Post by Bob Lantz
# ovs-ofctl show s1
We should probably update the OpenFlow tutorial (anyone can, actually.)
2. You should also be able to pass listenPort into the Mininet constructor
net = Mininet( ... , listenPort=6634)
s1 = net.addSwitch( 's1', listenPort=6634 ... )
4. You should also be able to use
sudo mn --listenport=6634
Post by Eric Chou
s1 = net.addSwitch('s1')
s1.listenPort = 6634
s2 = net.addSwitch('s2')
s2.listenPort = 6635
s3 = net.addSwitch('s3')
s3.listenPort = 6636
https://github.com/ericchou-python/PyTapDEMON/blob/master/MininetTopology/PyTapDEMON_topo.py
stats_reply (xid=0x4cbd6894): flags=none type=1(flow)
stats_reply (xid=0xbe6b6a1b): flags=none type=1(flow)
stats_reply (xid=0x158a3b4a): flags=none type=1(flow)
dpctl: failed to send packet to switch: Connection refused
Hope it helps.
Eric
Post by Navina Ramesh
Hi,
I have just started writing controllers using Openflow. I am using Mininet 2.0.0 to create a network with 2 OVS Switches. I wrote a controller that behaves like a learning switch, similar to what is shown in l2_learning.py.
dpctl: talking to tcp:127.0.0.1:6633: unexpected end of file
I am running mininet and controller in the same virtual image and hence, 127.0.0.1.
[Con 5/None] ofp_features_request
[Con 5/None] version: 1
[Con 5/None] type: 5 (OFPT_FEATURES_REQUEST)
[Con 5/None] length: 8
[Con 5/None] xid: 862702809
File "/home/mininet/pox/pox/openflow/of_01.py", line 622, in read
h(self, msg)
TypeError: 'NoneType' object is not callable
I am not able to figure out why this error is caused. Should I be handling anything in my controller code?
Any pointers will be helpful.
Thanks!
Navina
_______________________________________________
openflow-discuss mailing list
https://mailman.stanford.edu/mailman/listinfo/openflow-discuss
_______________________________________________
openflow-discuss mailing list
https://mailman.stanford.edu/mailman/listinfo/openflow-discuss
Ben Pfaff
2013-04-29 15:51:47 UTC
Permalink
Post by Eric Chou
Thanks Bob! Your reply in #1 pointed me to read up on the difference
between ovs-ofctl vs. ovs-dpctl. I think I get the difference after
reading more about both. One quick question, what is the difference
between dpctl vs. ovs-dpctl / ovs-ofctl? I guess one was a historical
tool and the other two were separated out as the cleaner way to
separate what the switch installs vs. what OpenFlow sees? Is that a
fair statement?
ovs-ofctl works with OpenFlow switches (any OpenFlow switch, not just
Open vSwitch).

ovs-dpctl works with Linux kernel datapaths.

dpctl is an antique from the OpenFlow reference implementation. If I
recall correctly, it includes aspects of ovs-ofctl and ovs-dpctl.
Navina Ramesh
2013-04-29 16:54:44 UTC
Permalink
Thanks for showing how to use the listenPort option. I was able to fix my problem! :)

----- Original Message -----
From: "Bob Lantz" <***@cs.stanford.edu>
To: "Eric Chou" <***@gmail.com>
Cc: "Navina Ramesh" <***@acis.ufl.edu>, openflow-***@mailman.stanford.edu
Sent: Sunday, April 28, 2013 5:37:55 PM
Subject: Re: [openflow-discuss] Error encountered on issuing dpctl to dump-flows


1. For OVS, you can (should?) just use ovs-ofctl:


# ovs-ofctl show s1


We should probably update the OpenFlow tutorial (anyone can, actually.)


2. You should also be able to pass listenPort into the Mininet constructor


net = Mininet( ... , listenPort=6634)


3. You should also be able to pass parameters into the switch constructor:


s1 = net.addSwitch( 's1', listenPort=6634 ... )


4. You should also be able to use


sudo mn --listenport=6634






On Apr 28, 2013, at 11:13 AM, Eric Chou < ***@gmail.com > wrote:




Hi Navina, you can probably add that in your controller code, but it is probably worth pointing out that OVS provides the feature to passively listens for dpctl messages while actively registers to OF controllers. By default this is turned off, you can see that from ~/mininet/mininet/node.py __init__ function with listenPort=None. So you simply need to enable it when you create your custom topology. For my project, I created a custom topology and added them as:



s1 = net . addSwitch ( 's1' )
s1 . listenPort = 6634
s2 = net . addSwitch ( 's2' )
s2 . listenPort = 6635
s3 = net . addSwitch ( 's3' )
s3 . listenPort = 6636


Full code here:
https://github.com/ericchou-python/PyTapDEMON/blob/master/MininetTopology/PyTapDEMON_topo.py


Then dpctl works:

***@mininet-vm:~/pox$ dpctl dump-flows tcp:127.0.0.1:6634
stats_reply (xid=0x4cbd6894): flags=none type=1(flow)
***@mininet-vm:~/pox$ dpctl dump-flows tcp:127.0.0.1:6635
stats_reply (xid=0xbe6b6a1b): flags=none type=1(flow)
***@mininet-vm:~/pox$ dpctl dump-flows tcp:127.0.0.1:6636
stats_reply (xid=0x158a3b4a): flags=none type=1(flow)
***@mininet-vm:~/pox$


If I comment out, say s3 port 6636:

***@mininet-vm:~/pox$ dpctl dump-flows tcp:127.0.0.1:6636
dpctl: failed to send packet to switch: Connection refused
***@mininet-vm:~/pox$


Hope it helps.


Eric




On Apr 27, 2013, at 1:34 PM, Navina Ramesh < ***@acis.ufl.edu > wrote:


Hi,

I have just started writing controllers using Openflow. I am using Mininet 2.0.0 to create a network with 2 OVS Switches. I wrote a controller that behaves like a learning switch, similar to what is shown in l2_learning.py.
I was trying to view the flows I installed by issuing the dpctl command to the switch in my terminal as:

***@mininet-vm:~/pox$ dpctl show tcp:127.0.0.1:6633
dpctl: talking to tcp:127.0.0.1:6633: unexpected end of file

I am running mininet and controller in the same virtual image and hence, 127.0.0.1.

I am getting the following error on my controller(pox) terminal:

ERROR:openflow.of_01:[Con 5/None]: Exception while handling OpenFlow message:
[Con 5/None] ofp_features_request
[Con 5/None] header:
[Con 5/None] version: 1
[Con 5/None] type: 5 (OFPT_FEATURES_REQUEST)
[Con 5/None] length: 8
[Con 5/None] xid: 862702809
Traceback (most recent call last):
File "/home/mininet/pox/pox/openflow/of_01.py", line 622, in read
h(self, msg)
TypeError: 'NoneType' object is not callable

I am not able to figure out why this error is caused. Should I be handling anything in my controller code?

Any pointers will be helpful.

Thanks!
Navina
_______________________________________________
openflow-discuss mailing list
openflow-***@lists.stanford.edu
https://mailman.stanford.edu/mailman/listinfo/openflow-discuss

_______________________________________________
openflow-discuss mailing list
openflow-***@lists.stanford.edu
https://mailman.stanford.edu/mailman/listinfo/openflow-discuss

Loading...