Hi Sadesh,

I think you can construct a ICMP request as below. I did use python
interactively just as example.
The ethernet packet object 'eth' must be sent by using openflow's
ofp_packet_out() (method) message along
with ofp_action_output() (method) action to inform switch which output port
the packet must be sent from.
python was started from pox installation directory.

>>> import pox.lib.packet as pkt
>>> from pox.lib.addresses import IPAddr,EthAddr
>>> echo = pkt.ICMP.echo(payload="0123456789")
>>> icmp = pkt.icmp(type=pkt.ICMP.TYPE_ECHO_REQUEST,payload=echo)
>>> ip =
pkt.ipv4(srcip=IPAddr("10.0.0.1"),dstip=("10.0.0.2"),protocol=pkt.ipv4.ICMP_PROTOCOL,payload=icmp)
>>> eth =
pkt.ethernet(src=EthAddr("aa:bb:cc:dd:ee:fe"),dst=EthAddr("aa:bb:cc:dd:ee:ff"),type=pkt.ethernet.IP_TYPE,payload=ip)
>>> print eth
[aa:bb:cc:dd:ee:fe>aa:bb:cc:dd:ee:ff IP]
>>> print eth.payload
[IP+ICMP 10.0.0.1>10.0.0.2 (cs:00 v:4 hl:5 l:20 t:64)]
>>> print eth.payload.payload
[t:ECHO_REQUEST c:0 chk:0][ICMP id:25863 seq:0]


I didn't test myself now but it should work :)
Hope it helps

-- 
Att
Lucas Brasilino
MSc Student @ Federal University of Pernambuco (UFPE) / Brazil
twitter: @lucas_brasilino


2015-02-26 0:03 GMT-03:00 Sandesh Shrestha <sande...@ualberta.ca>:

> Dear All,
>
> I want to create an ICMP request(not reply) packet in POX. How can I do
> that?Especially what will be the icmp payload and source ip and mac address
> so that I get reply from the mininet host.
>
>
> Thanks,
> Sandesh Shrestha
> www.sandeshshrestha.blogspot.com
>
>
>

Reply via email to