Dear all, Sorry to bother you.
I am writing a NOX module whose name is router. It can be use as a router. But
there are some questions that NOX cannot add flow entry to flow table in
openvswitch through send_openflow_command.
This is part of my code.
// set up a new flow
ofp_action_list act_list;
ofp_action *act;
act = new ofp_action();
act->set_action_dl_addr(OFPAT_SET_DL_DST, ARPTable[RouteEntry.NextIPAddr]);
act_list.action_list.push_back(*act);
act = new ofp_action();
act->set_action_output(RouteEntry.outPort, 0);
act_list.action_list.push_back(*act);
// set up new flow
boost::shared_array<uint8_t> of_raw;
size_t size = sizeof(ofp_flow_mod)+act_list.mem_size();
of_raw.reset(new uint8_t[size]);
of_flow_mod ofm;
ofm.header = openflow_pack::header(OFPT_FLOW_MOD, size);
ofm.match = flow.get_exact_match();
ofm.cookie = htonl(0);
ofm.command = htons(OFPFC_ADD);
ofm.flags = htons(0);
ofm.priority = htons(OFP_DEFAULT_PRIORITY);
ofm.idle_timeout = htons(120);
ofm.hard_timeout = htons(0);
ofm.buffer_id = buffer_id;
ofm.pack((ofp_flow_mod*) openflow_pack::get_pointer(of_raw));
act_list.pack(openflow_pack::get_pointer(of_raw,sizeof(ofp_flow_mod)));
lg.dbg("Install flow entry %s with %zu actions",
flow.to_string().c_str(), act_list.action_list.size());
send_openflow_command(datapath_id, of_raw, false);
Irun this code in nox(ip: 192.168.0.1) and send packet from host(ip:
192.168.57.1) to terminal(ip: 10.0.0.1), then nox show that flow has been
installed successfully, packet has also been sent to terminal successfully and
wiresharek can capture the OFP packet too, but openvswitch cannot add this flow
to flow table.
The attachment is capture file from wireshark.
Thanks!
packet
Description: Binary data
