Ask is moving to Stack Overflow and! Please use the "opendaylight" tag on either of these sites. This site is now in Read-Only mode


How to get information about packets flowing through all the switches (preferably using REST api)

asked 2014-09-15 14:36:58 -0800

How to get information about packets flowing through all the switches (preferably using REST api) ?

Thanks in Advance

edit retag flag offensive close merge delete


What do you mean by packets? Ie such as flow/table/ports stats? or do you want to see packet_in messages?

Chris O'Shea ( 2014-09-15 20:04:16 -0800 )edit

Hi Chris, I apologize for not formatting my question properly as I am naïve to SDN. But this is what I am trying to do. I have an OSGI module, which is implementing IListenDataPacket, so when the packet/message/traffic arrives at switch I am checking src and dst info and forwarding it (adding flow using IListenDataPacket and then sending using IDataPacketService) through desired path i.e., specific switches. I am sending traffic using iperf, Now I want to show/prove that messages/packets/traffic that I pumped through iperf flowed through desired path i.e through specific switches. So is there a way to monitor the switches and gather the information(like packet size, no of packets etc) about the packet/messages/traffic that flowed through these switches

Darpan Mhatre ( 2014-09-16 13:12:54 -0800 )edit

hii, I want the same functionality. but I am totally new to opendaylight. I mean I have just learnt to create topology in mininet and connect it to controller. So can you please tell how to write own module as you did.

nehajoshi ( 2014-09-16 22:32:35 -0800 )edit seem to be a good tutorial. Maybe worth opening up another Question.

Chris O'Shea ( 2014-09-17 00:29:14 -0800 )edit

Hi Neha, I followed the same example that Chris mentioned. Download the image from that example, it has OSGI module setup in eclipse, opendaylight and other tools. This example learns mac address and ports to forward the packet. Whereas in the module I am working on routing the packets through specific set of switches by learning source, destination and ports. Feel free to ask questions if any.

Darpan Mhatre ( 2014-09-17 07:47:48 -0800 )edit

1 answer

Sort by » oldest newest most voted

answered 2014-09-16 16:36:17 -0800


I think these REST API should answer the question.

Port Statistics of the nodes, this will show you the tx/rx Packets and tx/rx Bytes from each of the ports of the OFswitch

If you want to look at a per flow base then you can use this

both these API can be put just to a single switch by adding /node/OF/<deviceID>/

edit flag offensive delete publish link more


Hi Chris, I only see "node" and not the "flowStatistic". Are the flows getting cleared? I noticed the same thing with dpctl if I execute command dump-flows I see the flows but after a while it clears it out. That's how it works here too?

Darpan Mhatre ( 2014-09-18 07:01:11 -0800 )edit

Do you have timeout (idle or hard) values set on your flows?

Chris O'Shea ( 2014-09-18 09:13:26 -0800 )edit

Yes, I have idle timeout set on flow. Shall I remove that?

Darpan Mhatre ( 2014-09-18 09:41:56 -0800 )edit

Yes that should be removed, cause if it set and no traffic has been seen then the flow will be removed.

Chris O'Shea ( 2014-09-18 10:22:31 -0800 )edit

Thank you Chris!

Darpan Mhatre ( 2014-09-18 11:36:18 -0800 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2014-09-15 14:36:58 -0800

Seen: 3,021 times

Last updated: Sep 16 '14