Thank you Murphy.

I am trying to look at the Flow table entries in the POX controller while
one host is pinging another. So when I write the following piece of code:
.
.
.
*for f in event.stats:
      show_flow_entries = f.show()*
      *log.info("Shows everything: %s", show_flow_entries)*
.
.
.

it gives me the following output (the entire flow table entry for the
particular flow), which is expected:

*INFO:flow_stats:Shows everything: length: 96
table_id: 0
match:
  wildcards:  (0 = 0)
  in_port: 3
  dl_src: 00:00:00:00:00:04
  dl_dst: 00:00:00:00:00:03
  dl_vlan: 65535
  dl_vlan_pcp: 0
  dl_type: 0x800
  nw_tos: 0
  nw_proto: 1
  nw_src: 10.0.0.4
  nw_dst: 10.0.0.3
  tp_src: 0
  tp_dst: 0
duration_sec: 9
duration_nsec: 791000000
priority: 65535
idle_timeout: 10
hard_timeout: 30
cookie: 0
packet_count: 9
byte_count: 882
actions:
  type: 0
  len: 8
  port: 2
  max_len: 0*

Now my questions are:
   1. where are these actions defined for the given rules?
   2. Suppose I want to extract and display individual elements of the
actions, for example, the *type* or the* len* entries from the above
output, how do I do this? When I try to display* f.actions*, it gives me an
output which looks like the below:
*[<pox.openflow.libopenflow_01.ofp_action_output
object at 0x977d9cc>]*. What does this mean? And how do I extract the
individual entries from this list?
   3. Suppose I want to modify or add actions, how do I go about it?


Many Thanks,
Udita



On Tue, Mar 19, 2013 at 4:08 PM, Murphy McCauley
<[email protected]>wrote:

> On Mar 19, 2013, at 6:07 AM, udita gangwal wrote:
>
> I would like to know how the Flow Table entries (Rule, Actions and Stats)
> could be viewed using the POX controller?
>
> Send the switch an ofp_flow_stats_request.  Handle the
> resulting FlowStatsReceived event.  The event object will have a list of
> ofp_flow_stats in the stats attribute.  These ofp_flow_stats entries
> contain the match, actions, and stats.
>
> This is exactly what the web flows example does.  It then summarizes only
> the flows on port 80.  (It should actually check that it's specifically
> TCP, but it doesn't.)
>
> I also want to know what the variable “web_flows” signifies in the code
> “flow_stats.py” which is given in the POX wiki. Why is it incremented by 1
> every time?
>
> Because it's counting the number of flow entries that use port 80 -- flows
> carrying web traffic.  This is so it can print out a message like: "Web
> traffic: 96695 bytes over 16 flows".  That is, there are 16 flows that use
> port 80, and 96695 bytes have been transferred over all of them.
>
> -- Murphy
>

Reply via email to