What you're really talking about here is changing OpenFlow. OpenFlow is a standard, meaning any changes should go through the Open Networking Foundation (who maintains the standard). Any changes you make will make your program incompatible with other switches that implement the OpenFlow protocol. The exception to this is if you add any extra functionality using OpenFlow's vendor extension capabilities.
Specifically, your new stats messages should probably use the Vendor Statistics mechanism described in the OpenFlow spec, and your new configuration should probably be sent using a message with an ofp_vendor_header structure. For additional help on properly extending OpenFlow, you might want to ask on one of the OpenFlow mailing lists (like openflow-discuss). Within NOX, your changes will start in src/lib/openflow-event.cc. For example, your new configuration data will require altering handle_vendor(), and your new stats type will require altering handle_stats_reply(). Then, of course, you'll have to modify your switch to use the new messages also. -- Murphy On Feb 23, 2012, at 6:50 AM, Duc Thien wrote: > Thanks for reply! > > I'm trying to create 2 kind of message : > Message send from Nox to change state of switch ( eg:change frequency). I > intend to add new variable to message Switch_set_config: > > struct ofp_switch_config { > struct ofp_header header; > uint8_t state; /*State of switch*/ > uint16_t flags; /* OFPC_* flags. */ > uint16_t miss_send_len; /* Max bytes of new flow that datapath > should send to the controller. */ > }; > OFP_ASSERT(sizeof(struct ofp_switch_config) == 13); > > enum ofp_switch_state { > STATE_OFF = 0X00; /*switch off */ > STATE_10Mbps = 0X01; > STATE_100Mbps = 0X02; > STATE_1Gbps = 0X03; > } > 2. Message carry infomation of switch to NOX (eg: traffic and power > consumption). I'm going to create new message using statistic message: > struct ofp_switch_stats_request{ > uint64_t datapath_id; > uint64_t traffic; /* Total traffic in switch*/ > uint16_t power; /*Power consumption in switch */ > } > OPF_ASSERT(sizeof(struct ofp_switch_stats_request) = 11); > > /*Body of ofp_switch_stats_reply */ > > struct ofp_switch_stats_reply{ > > uint64_t datapath_id; > uint8_t traffic; /*traffic in switch*/ > uint16_t power; /*power consumption in switch */ > } > > OPF_ASSERT(sizeof(struct ofp_switch_stats_request) = 11); > > > Would you help me? > > -- > Tô Đức Thiện > Điện tử 5 -K53-Trường ĐHBK Hà Nội > ĐT :01686481787 > > _______________________________________________ > nox-dev mailing list > nox-dev@noxrepo.org > http://noxrepo.org/mailman/listinfo/nox-dev
_______________________________________________ nox-dev mailing list nox-dev@noxrepo.org http://noxrepo.org/mailman/listinfo/nox-dev