On Jul 10, 2012, at 12:24 PM, Weiyun wrote:

> Could you give me an example how to generate a ICMP reply message?
>  
> I suppose that first create packet_base instance, then add ipv4 header, and 
> then icmp header?

More like an *ethernet* and then ipv4 and then icmp.

> Is there a way to copy necessary information from ICMP request to reply 
> message, and then modify some attributes?

Sure.  Just copy it.

The pong.py sample in POX does exactly this.  It won't quite work with NOX's 
version of the packet library, but it may be useful as an example.

>  How about ICMP unreachable message?

Well, you can read the RFC and set the fields appropriately.

Also, POX's l2_multi.py has an example of generating destination unreachable 
messages.  Again, it won't be directly usable in NOX, but it might be helpful.


Hope that helps.

-- Murphy

Reply via email to