[pox-dev] How to use sendToDPID(dpid,packet) function?
Murphy McCauley
murphy.mccauley at gmail.com
Fri Jul 5 18:33:39 PDT 2013
I think sendToDPID() just doesn't do what you think it does. It is for sending OpenFlow commands to a switch -- the same as connection.send(), except it looks up the connection for you based on DPID. I believe you're trying to use it to send a packet out of some port on a switch. There's an obvious piece of information missing here -- sendToDPID takes a DPID, but how would it know which port you want to send the packet out of?
What you need to do is create an ofp_packet_out() which has an output action to the appropriate port and the data you want to send as the 'data' attribute. This is similar to the flood() function in l2_learning which is in your source. There are even closer examples in other modules (e.g., misc.dhcpd). Then send *that* using sendToDPID(), or in your case -- just use connection.send().
-- Murphy
On Jul 5, 2013, at 12:52 PM, Kavit Shah wrote:
> Command line with log, my code and screen shot of the wireshrak are attached in the text and png files.
>
> I am using HP Pro curve switch, i think it supports OF 1.0 spec.
>
>
> #####################################
> #####################################
>
> Important part of my code in the attached file
>
> #####################################
> #####################################
>
> Questions:
>
> 1) sendToDPID function is not working the way I expect it to work. According to me if that function works I should see packet out in wireshark.
>
> 2) Am I extracting dpid of the switch correctly ?
>
> 3) What is the reason for getting an error while switch connects to the POX controller ?
>
> ERROR:openflow.of_01:[00-16-b9-ce-2f-40|800 1] OpenFlow Error:
> [00-16-b9-ce-2f-40|800 1] Error: header:
> [00-16-b9-ce-2f-40|800 1] Error: version: 1
> [00-16-b9-ce-2f-40|800 1] Error: type: 1 (OFPT_ERROR)
> [00-16-b9-ce-2f-40|800 1] Error: length: 20
> [00-16-b9-ce-2f-40|800 1] Error: xid: 7
> [00-16-b9-ce-2f-40|800 1] Error: type: OFPET_BAD_REQUEST (1)
> [00-16-b9-ce-2f-40|800 1] Error: code: OFPBRC_BAD_TYPE (1)
> [00-16-b9-ce-2f-40|800 1] Error: datalen: 8
> [00-16-b9-ce-2f-40|800 1] Error: 0000: 01 12 00 08 00 00 00 07 ........
>
>
> <sendToDPID_question.txt><sendToDPID_wireshark.png>_______________________________________________
> mininet-discuss mailing list
> mininet-discuss at lists.stanford.edu
> https://mailman.stanford.edu/mailman/listinfo/mininet-discuss
More information about the pox-dev
mailing list