Thanks for your help.

Yes, I thought msg.cookie would be there. In this case the cookie is set in
the flow. Also, it seems that the cookie attribute should exist even if the
cookie wasn't set in the flow.

Here is a trace showing the exception:

[therbert@TNSRyu ryu]$ ryu-manager --verbose ryu/app/tsn_controller.py
loading app ryu/app/tsn_controller.py
loading app ryu.controller.ofp_handler
instantiating app None of DPSet
creating context dpset
creating context wsgi
instantiating app ryu/app/tsn_controller.py of RestTsnAPI
instantiating app ryu.controller.ofp_handler of OFPHandler
BRICK dpset
  PROVIDES EventDP TO {'RestTsnAPI': set(['dpset'])}
  CONSUMES EventOFPStateChange
  CONSUMES EventOFPPortStatus
  CONSUMES EventOFPSwitchFeatures
BRICK ofp_event
  PROVIDES EventOFPStateChange TO {'dpset': set(['main', 'dead'])}
  PROVIDES EventOFPStatsReply TO {'RestTsnAPI': set(['main'])}
  PROVIDES EventOFPSwitchFeatures TO {'dpset': set(['config'])}
  PROVIDES EventOFPFlowStatsReply TO {'RestTsnAPI': set(['main'])}
  PROVIDES EventOFPPortStatus TO {'dpset': set(['main'])}
  PROVIDES EventOFPPacketIn TO {'RestTsnAPI': set(['main'])}
  CONSUMES EventOFPEchoRequest
  CONSUMES EventOFPErrorMsg
  CONSUMES EventOFPPortDescStatsReply
  CONSUMES EventOFPHello
  CONSUMES EventOFPSwitchFeatures
BRICK RestTsnAPI
  CONSUMES EventDP
  CONSUMES EventOFPPacketIn
  CONSUMES EventOFPFlowStatsReply
  CONSUMES EventOFPStatsReply
(7187) wsgi starting up on http://0.0.0.0:8080/
connected socket:<eventlet.greenio.GreenSocket object at 0x2bd4790>
address:('127.0.0.1', 54370)
hello ev <ryu.controller.ofp_event.EventOFPHello object at 0x2bdb050>
move onto config mode
EVENT ofp_event->dpset EventOFPSwitchFeatures
switch features ev version: 0x3 msg_type 0x6 xid 0xebadb8d6
OFPSwitchFeatures(capabilities=71,datapath_id=8796749727743,n_buffers=256,n_tables=254,ports={1:
OFPPort(port_no=1,hw_addr='08:00:27:24:87:ff',name='eth1',config=0,state=0,curr=10272,advertised=10287,supported=10287,peer=0,curr_speed=1000000,max_speed=1000000),
2:
OFPPort(port_no=2,hw_addr='8a:38:dc:f8:d7:dc',name='veth0',config=0,state=0,curr=2112,advertised=0,supported=0,peer=0,curr_speed=10000000,max_speed=0),
4294967294:
OFPPort(port_no=4294967294,hw_addr='08:00:27:24:87:ff',name='br0',config=0,state=0,curr=0,advertised=0,supported=0,peer=0,curr_speed=0,max_speed=0)})
move onto main mode
EVENT ofp_event->dpset EventOFPStateChange
DPSET: register datapath <ryu.controller.controller.Datapath object at
0x2bd4d50>
EVENT dpset->RestTsnAPI EventDP
register_controller dpid is 8796749727743
Initializing tsnOfController dpid is 00000800272487ff
in TsnOfController:switch_features_handler: dpid is 8796749727743
Set flow to drop all packets
Set default mode to send pkts to monitor port
(7187) accepted ('127.0.0.1', 57432)
set tuple: P: 6 src: 192.168.100.2:0, dst: 192.168.100.3:8080
 nwsrc type is <type 'str'>
127.0.0.1 - - [02/Oct/2014 12:17:35] "POST /TSN/set_tuple/all HTTP/1.1" 200
144 0.004251
EVENT ofp_event->RestTsnAPI EventOFPPacketIn
hub: uncaught exception: Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/ryu/lib/hub.py", line 52, in
_launch
    func(*args, **kwargs)
  File "/usr/lib/python2.6/site-packages/ryu/base/app_manager.py", line
274, in _event_loop
    handler(ev)
  File "/home/therbert/ryu/ryu/app/tsn_controller.py", line 176, in
packet_in_handler
    TsnController.packet_in_handler(ev)
  File "/home/therbert/ryu/ryu/app/tsn_controller.py", line 294, in
packet_in_handler
    controller.packet_in_handler(ev)
  File "/home/therbert/ryu/ryu/app/tsn_controller.py", line 656, in
packet_in_handler
    print "id: %s len: %s reason: %s tid: %s " % (msg.buffer_id,
msg.total_len, msg.reason, msg.table_id, msg.cookie)
AttributeError: 'OFPPacketIn' object has no attribute 'cookie'


On Thu, Oct 2, 2014 at 12:01 AM, FUJITA Tomonori <
fujita.tomon...@lab.ntt.co.jp> wrote:

> On Wed, 01 Oct 2014 17:33:12 -0400
> Thomas F Herbert <thomasfherb...@gmail.com> wrote:
>
> > What is the best way of extracting the cookie of the matched flow from
> > an incoming packet_in msg. I am using version 1.3.
> > ryu 1.3
>
> How about packet_in msg's cookie field?
------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Ryu-devel mailing list
Ryu-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to