Hi everyone,

I have a minor problem trying to implement a stats polling mechanism from an
openflow controller. I am trying to get flow_stats and aggregate flow stats
from an openvswitch instance. As an example fo the behaviour, I have
installed the following flows in the flow table:

 cookie=0x0, duration=272.966s, table_id=0, n_packets=190836,
n_bytes=28625400,
idle_timeout=1200,priority=65535,udp,in_port=1,vlan_tci=0x0000/0xffff,dl_src=00:04:23:b4:74:95,dl_dst=00:1e:68:9a:c5:75,nw_src=10.1.1.1,nw_dst=192.168.2.2,nw_tos=0,tp_src=8080,tp_dst=8080
actions=output:2
 cookie=0x0, duration=272.966s, table_id=0, n_packets=190831,
n_bytes=28624650,
idle_timeout=1200,priority=65535,udp,in_port=1,vlan_tci=0x0000/0xffff,dl_src=00:04:23:b4:74:95,dl_dst=00:1e:68:9a:c5:75,nw_src=10.1.1.1,nw_dst=192.168.2.4,nw_tos=0,tp_src=8080,tp_dst=8080
actions=output:2
 cookie=0x0, duration=272.966s, table_id=0, n_packets=190046,
n_bytes=28506900,
idle_timeout=1200,priority=65535,udp,in_port=1,vlan_tci=0x0000/0xffff,dl_src=00:04:23:b4:74:95,dl_dst=00:1e:68:9a:c5:75,nw_src=10.1.1.1,nw_dst=192.168.2.1,nw_tos=0,tp_src=8080,tp_dst=8080
actions=output:2
 cookie=0x0, duration=272.966s, table_id=0, n_packets=190872,
n_bytes=28630800,
idle_timeout=1200,priority=65535,udp,in_port=1,vlan_tci=0x0000/0xffff,dl_src=00:04:23:b4:74:95,dl_dst=00:1e:68:9a:c5:75,nw_src=10.1.1.1,nw_dst=192.168.2.5,nw_tos=0,tp_src=8080,tp_dst=8080
actions=output:2
 cookie=0x0, duration=272.966s, table_id=0, n_packets=190085,
n_bytes=28512750,
idle_timeout=1200,priority=65535,udp,in_port=1,vlan_tci=0x0000/0xffff,dl_src=00:04:23:b4:74:95,dl_dst=00:1e:68:9a:c5:75,nw_src=10.1.1.1,nw_dst=192.168.2.6,nw_tos=0,tp_src=8080,tp_dst=8080
actions=output:2
 cookie=0x0, duration=272.966s, table_id=0, n_packets=190512,
n_bytes=28576800,
idle_timeout=1200,priority=65535,udp,in_port=1,vlan_tci=0x0000/0xffff,dl_src=00:04:23:b4:74:95,dl_dst=00:1e:68:9a:c5:75,nw_src=10.1.1.1,nw_dst=192.168.2.7,nw_tos=0,tp_src=8080,tp_dst=8080
actions=output:2
 cookie=0x0, duration=272.966s, table_id=0, n_packets=189674,
n_bytes=28451100,
idle_timeout=1200,priority=65535,udp,in_port=1,vlan_tci=0x0000/0xffff,dl_src=00:04:23:b4:74:95,dl_dst=00:1e:68:9a:c5:75,nw_src=10.1.1.1,nw_dst=192.168.2.3,nw_tos=0,tp_src=8080,tp_dst=8080
actions=output:2
 cookie=0x0, duration=272.966s, table_id=0, n_packets=190550,
n_bytes=28582500,
idle_timeout=1200,priority=65535,udp,in_port=1,vlan_tci=0x0000/0xffff,dl_src=00:04:23:b4:74:95,dl_dst=00:1e:68:9a:c5:75,nw_src=10.1.1.1,nw_dst=192.168.2.8,nw_tos=0,tp_src=8080,tp_dst=8080
actions=output:2


the flows as it can be seen differ only on the destination address and have
sequential dest ip addresses.

I am sending an ofp_flow_stats_request with the following format:

Frame 1 (122 bytes on wire, 122 bytes captured)
Ethernet II, Src: Intel_b4:74:94 (00:04:23:b4:74:94), Dst: Intel_b2:b6:cc
(00:04:23:b2:b6:cc)
Internet Protocol, Src: 10.1.0.1 (10.1.0.1), Dst: 10.1.0.2 (10.1.0.2)
Transmission Control Protocol, Src Port: 6633 (6633), Dst Port: 42201
(42201), Seq: 1, Ack: 1, Len: 56
OpenFlow Protocol
    Header
        Version: 0x01
        Type: Stats Request (CSM) (16)
        Length: 56
        Transaction ID: 0
    Stats Request
        Type: Individual flow statistics (0x0001)
        Flags: 0x0000
        Flow Stats Request
            Match
                Match Types
                    .... .... .... .... .... .... .... ...1 =   Input port:
Wildcard (1)
                    .... .... .... .... .... .... .... ..1. =   VLAN ID:
Wildcard (1)
                    .... .... .... .... .... .... .... .1.. =   Ethernet Src
Addr: Wildcard (1)
                    .... .... .... .... .... .... .... 1... =   Ethernet Dst
Addr: Wildcard (1)
                    .... .... .... .... .... .... ...1 .... =   Ethernet
Type: Wildcard (1)
                    .... .... .... .... .... .... ..1. .... =   IP Protocol:
Wildcard (1)
                    .... .... .... .... .... .... .1.. .... =   TCP/UDP Src
Port: Wildcard (1)
                    .... .... .... .... .... .... 1... .... =   TCP/UDP Dst
Port: Wildcard (1)
                    .... .... .... .... ..10 0000 .... .... =   IP Src Addr
Mask: /0 (32)
                    .... .... .... 0111 11.. .... .... .... =   IP Dst Addr
Mask: /1 (31)
                    .... .... ...1 .... .... .... .... .... =   VLAN
priority: Wildcard (1)
                    .... .... ..1. .... .... .... .... .... =   IPv4 DSCP:
Wildcard (1)
                IP Src Addr: 0.0.0.0 (0.0.0.0)
                IP Dst Addr: 192.168.2.0 (192.168.2.0)
            Table ID: All Tables
            Out Port: None  (not associated with a physical port)

but I receive the following reply:
Frame 2 (846 bytes on wire, 846 bytes captured)
Ethernet II, Src: Intel_b2:b6:cc (00:04:23:b2:b6:cc), Dst: Intel_b4:74:94
(00:04:23:b4:74:94)
Internet Protocol, Src: 10.1.0.2 (10.1.0.2), Dst: 10.1.0.1 (10.1.0.1)
Transmission Control Protocol, Src Port: 42201 (42201), Dst Port: 6633
(6633), Seq: 1, Ack: 57, Len: 780
OpenFlow Protocol
    Header
        Version: 0x01
        Type: Stats Reply (CSM) (17)
        Length: 780
        Transaction ID: 0
    Stats Reply
        Type: Individual flow statistics (0x0001)
        Flags: 0
        Flow Stats Reply
            Table ID: 0
            Match
                Input Port: 1
                Ethernet Src Addr: Intel_b4:74:95 (00:04:23:b4:74:95)
                Ethernet Dst Addr: QuantaCo_9a:c5:75 (00:1e:68:9a:c5:75)
                Input VLAN ID: 65535
                Input VLAN priority: 0
                Ethernet Type: IP (0x0800)
                IPv4 DSCP: 0
                Protocol: UDP (0x11)
                IP Src Addr: 10.1.1.1 (10.1.1.1)
                IP Dst Addr: 192.168.2.2 (192.168.2.2)
                TCP/UDP Src Port: http-alt (8080)
                TCP/UDP Dst Port: http-alt (8080)
            Flow Duration (sec): 10
            Flow Duration (nsec): 0
            Priority: 65535
            Number of seconds idle before expiration: 1200
            Number of seconds before expiration: 0
            Cookie: 0x0000000000000000
            Packet Count: 87642
            Byte Count: 13146300
            Output Action(s)
                Action
                    Type: Output to switch port (0)
                    Len: 8
                    Output port: 2
                    Max Bytes to Send: 2000
                # of Actions: 1
        Flow Stats Reply
            Table ID: 0
            Match
                Input Port: 1
                Ethernet Src Addr: Intel_b4:74:95 (00:04:23:b4:74:95)
                Ethernet Dst Addr: QuantaCo_9a:c5:75 (00:1e:68:9a:c5:75)
                Input VLAN ID: 65535
                Input VLAN priority: 0
                Ethernet Type: IP (0x0800)
                IPv4 DSCP: 0
                Protocol: UDP (0x11)
                IP Src Addr: 10.1.1.1 (10.1.1.1)
                IP Dst Addr: 192.168.2.4 (192.168.2.4)
                TCP/UDP Src Port: http-alt (8080)
                TCP/UDP Dst Port: http-alt (8080)
            Flow Duration (sec): 10
            Flow Duration (nsec): 0
            Priority: 65535
            Number of seconds idle before expiration: 1200
            Number of seconds before expiration: 0
            Cookie: 0x0000000000000000
            Packet Count: 87209
            Byte Count: 13081350
            Output Action(s)
                Action
                    Type: Output to switch port (0)
                    Len: 8
                    Output port: 2
                    Max Bytes to Send: 2000
                # of Actions: 1
        Flow Stats Reply
            Table ID: 0
            Matchfrom
                Input Port: 1
                Ethernet Src Addr: Intel_b4:74:95 (00:04:23:b4:74:95)
                Ethernet Dst Addr: QuantaCo_9a:c5:75 (00:1e:68:9a:c5:75)
                Input VLAN ID: 65535
                Input VLAN priority: 0
                Ethernet Type: IP (0x0800)
                IPv4 DSCP: 0
                Protocol: UDP (0x11)
                IP Src Addr: 10.1.1.1 (10.1.1.1)
                IP Dst Addr: 192.168.2.1 (192.168.2.1)
                TCP/UDP Src Port: http-alt (8080)
                TCP/UDP Dst Port: http-alt (8080)
            Flow Duration (sec): 10
            Flow Duration (nsec): 0
            Priority: 65535
            Number of seconds idle before expiration: 1200
            Number of seconds before expiration: 0
            Cookie: 0x0000000000000000
            Packet Count: 87335
            Byte Count: 13100250
            Output Action(s)
                Action
                    Type: Output to switch port (0)
                    Len: 8
                    Output port: 2
                    Max Bytes to Send: 2000
                # of Actions: 1
        Flow Stats Reply
            Table ID: 0
            Match
                Input Port: 1
                Ethernet Src Addr: Intel_b4:74:95 (00:04:23:b4:74:95)
                Ethernet Dst Addr: QuantaCo_9a:c5:75 (00:1e:68:9a:c5:75)
                Input VLAN ID: 65535
                Input VLAN priority: 0
                Ethernet Type: IP (0x0800)
                IPv4 DSCP: 0
                Protocol: UDP (0x11)
                IP Src Addr: 10.1.1.1 (10.1.1.1)
                IP Dst Addr: 192.168.2.5 (192.168.2.5)
                TCP/UDP Src Port: http-alt (8080)
                TCP/UDP Dst Port: http-alt (8080)
            Flow Duration (sec): 10
            Flow Duration (nsec): 0
            Priority: 65535
            Number of seconds idle before expiration: 1200
            Number of seconds before expiration: 0
            Cookie: 0x0000000000000000
            Packet Count: 87925
            Byte Count: 13188750
            Output Action(s)
                Action
                    Type: Output to switch port (0)
                    Len: 8
                    Output port: 2
                    Max Bytes to Send: 2000
                # of Actions: 1
        Flow Stats Reply
            Table ID: 0
            Match
                Match Types
                Input Port: 1
                Ethernet Src Addr: Intel_b4:74:95 (00:04:23:b4:74:95)
                Ethernet Dst Addr: QuantaCo_9a:c5:75 (00:1e:68:9a:c5:75)
                Input VLAN ID: 65535
                Input VLAN priority: 0
                Ethernet Type: IP (0x0800)
                IPv4 DSCP: 0
                Protocol: UDP (0x11)
                IP Src Addr: 10.1.1.1 (10.1.1.1)
                IP Dst Addr: 192.168.2.6 (192.168.2.6)
                TCP/UDP Src Port: http-alt (8080)
                TCP/UDP Dst Port: http-alt (8080)
            Flow Duration (sec): 10
            Flow Duration (nsec): 0
            Priority: 65535
            Number of seconds idle before expiration: 1200
            Number of seconds before expiration: 0
            Cookie: 0x0000000000000000
            Packet Count: 87276
            Byte Count: 13091400
            Output Action(s)
                Action
                    Type: Output to switch port (0)
                    Len: 8
                    Output port: 2
                    Max Bytes to Send: 2000
                # of Actions: 1
        Flow Stats Reply
            Table ID: 0
            Match
                Input Port: 1
                Ethernet Src Addr: Intel_b4:74:95 (00:04:23:b4:74:95)
                Ethernet Dst Addr: QuantaCo_9a:c5:75 (00:1e:68:9a:c5:75)
                Input VLAN ID: 65535
                Input VLAN priority: 0
                Ethernet Type: IP (0x0800)
                IPv4 DSCP: 0
                Protocol: UDP (0x11)
                IP Src Addr: 10.1.1.1 (10.1.1.1)
                IP Dst Addr: 192.168.2.7 (192.168.2.7)
                TCP/UDP Src Port: http-alt (8080)
                TCP/UDP Dst Port: http-alt (8080)
            Flow Duration (sec): 10
            Flow Duration (nsec): 0
            Priority: 65535
            Number of seconds idle before expiration: 1200
            Number of seconds before expiration: 0
            Cookie: 0x0000000000000000
            Packet Count: 87437
            Byte Count: 13115550
            Output Action(s)
                Action
                    Type: Output to switch port (0)
                    Len: 8
                    Output port: 2
                    Max Bytes to Send: 2000
                # of Actions: 1
        Flow Stats Reply
            Table ID: 0
            Match
                Input Port: 1
                Ethernet Src Addr: Intel_b4:74:95 (00:04:23:b4:74:95)
                Ethernet Dst Addr: QuantaCo_9a:c5:75 (00:1e:68:9a:c5:75)
                Input VLAN ID: 65535
                Input VLAN priority: 0
                Ethernet Type: IP (0x0800)
                IPv4 DSCP: 0
                Protocol: UDP (0x11)
                IP Src Addr: 10.1.1.1 (10.1.1.1)
                IP Dst Addr: 192.168.2.3 (192.168.2.3)
                TCP/UDP Src Port: http-alt (8080)
                TCP/UDP Dst Port: http-alt (8080)
            Flow Duration (sec): 10
            Flow Duration (nsec): 0
            Priority: 65535
            Number of seconds idle before expiration: 1200
            Number of seconds before expiration: 0
            Cookie: 0x0000000000000000
            Packet Count: 87474
            Byte Count: 13121100
            Output Action(s)
                Action
                    Type: Output to switch port (0)
                    Len: 8
                    Output port: 2
                    Max Bytes to Send: 2000
                # of Actions: 1
        Flow Stats Reply
            Table ID: 0
            Match
                Match Types
                Input Port: 1
                Ethernet Src Addr: Intel_b4:74:95 (00:04:23:b4:74:95)
                Ethernet Dst Addr: QuantaCo_9a:c5:75 (00:1e:68:9a:c5:75)
                Input VLAN ID: 65535
                Input VLAN priority: 0
                Ethernet Type: IP (0x0800)
                IPv4 DSCP: 0
                Protocol: UDP (0x11)
                IP Src Addr: 10.1.1.1 (10.1.1.1)
                IP Dst Addr: 192.168.2.8 (192.168.2.8)
                TCP/UDP Src Port: http-alt (8080)
                TCP/UDP Dst Port: http-alt (8080)
            Flow Duration (sec): 10
            Flow Duration (nsec): 0
            Priority: 65535
            Number of seconds idle before expiration: 1200
            Number of seconds before expiration: 0
            Cookie: 0x0000000000000000
            Packet Count: 87513
            Byte Count: 13126950
            Output Action(s)
                Action
                    Type: Output to switch port (0)
                    Len: 8
                    Output port: 2
                    Max Bytes to Send: 2000
                # of Actions: 1

you can notice in the reply I receive 8 flow stats, while I should receive 1
flow only. This I noticed happens also in the case when I query with an
aggr_flow_stats request.

Is this expected behaviour or am I using incorrectly the openflow protocol?

thanks in advance for the replies.

-- 
Charalampos Rotsos
PhD student
The University of Cambridge
Computer Laboratory
William Gates Building
JJ Thomson Avenue
Cambridge
CB3 0FD

Phone: +44-(0) 1223 767032
Email: cr...@cl.cam.ac.uk
_______________________________________________
discuss mailing list
discuss@openvswitch.org
http://openvswitch.org/mailman/listinfo/discuss_openvswitch.org

Reply via email to