On Jul 8, 2013, at 9:13 AM, nibble nibble wrote:

> to get the packet and process it I have the following code. 
> 
> packet = event.parsed # This is the parsed packet data.
> packet_in = event.ofp
> 
> I want to figure out which host the packet is coming from(either its ip or 
> its name).
> I have used "packet.src" but I got something like:  "b2:cb:4a:04:2f:93" which 
> I do not know how toi translate to ip or name of host.

The packets are parsed into a chain.  The first item is an "ethernet" object 
because the packet is an Ethernet frame.  Further down the chain, there may (or 
may not) be an IP header.  You need to find it (if it's there) and get its 
.srcip attribute.

The last example of the introductory part of the "Working with packets" section 
of the POX manual wiki demonstrates exactly this.

Good luck.

-- Murphy

Reply via email to