Posts

Showing posts with the label ICMP

Send and Capture icmp packets with type&code using hping

Here TCL script files are run at terminals of different hosts setup in a mininet environment. The code at one host generates packets of different ICMP types and codes (Please refer to different types and codes associated with ICMP packets at https://www.iana.org/assignments/icmp-parameters/icmp-parameters.xhtml ). The code run at the second host captures these packets and extract the type and code fields. Here hping3, TCL and mininet are installed on Ubuntu system for the experiment. I)    SCRIPTS Script for creating mininet hosts ~~~~~~~~~~~~~~~~~~~~ Save the following in net.py from mininet.topo import Topo class MyTopo( Topo ):     def __init__( self ):         Topo.__init__( self )         # Add hosts and switches         left_host = self.addHost( 'h0' )         right_host = self.addHost( 'h1' ) ...