On Apr 4, 2013, at 1:14 PM, Sayed Qaiser Ali Shah Shah wrote:
> I am using Mininet 2.0 and POX controller. I am writing a script and I need
> to get data from Protocol field i.e. which protocol number is being used so
> that on the basis of that protocol number I can take some decision.
> I tried of.ofp_match() class but didn't get what I want. It may be possible
> that I am using it wrong way. I used this class as
>
> myproto=of.ofp_match()
> log.debug("%s",myproto.nw_proto==1)
>
> Protocol number 1 shows ICMP protocol and as PING is ICMP message so, when I
> ping host h2 from h1 I get False which means that protocol number didn't
> match.
> Can anybody tell me how to get IP protocol field data?
> Any suggestion regarding this will be appreciable
It's not clear to me what you're trying to do, and you haven't provided enough
code for me to guess.
What you *are* doing is instantiating a new (empty) match object and checking
one of its fields before assigning it to something.
Are you trying to examine a packet that has arrived as part of a packet_in
message? If so, you want to examine the event object's "parsed" attribute,
which contains the packet broken out into objects (defined in pox.lib.packet)
corresponding to the various protocols. There is some information about this in
the "Working with packets: pox.lib.packet" section of the POX wiki.
Additionally, you may want to look at the misc.pong component, which examines
incoming packets to see if they are pings.
https://openflow.stanford.edu/display/ONL/POX+Wiki
If that's not helpful, maybe you can expand on what you're trying to do, or
show more code.
-- Murphy