I don't know how to access header fields of a packet and how to generate ICMP and IP packet in java.
InetAddress ia = InetAddress.getLocalHost();
int port = 7;
DatagramPacket dp = new DatagramPacket(data, data.length, ia, port);
Is this a right way or I am going in wrong direction?