title: Identify the PID of process which is transmitting icmp packets
body: <p>I have written a program which will create and transmit the icmp packets over the network.</p>
  
  <p>Now, I want to write a program which will identity the processes (PID) in the system which are transmitting the icmp packets. If I am not wrong, possible output of these program will be PID of the previous program that I have coded and some system processes which are creating and transmitting icmp packets.</p>
  
  <p>NOTE : I have used python for coding, scapy for packets manipulation and PySide for GUI(extra information) I am running this program in Fedora 20 in VMWare.</p>
  
  <p>EDIT : I have written another program which will generate and send the packet to destination. The code is as follows : </p>
  
  <pre><code>from scapy.all import *
  
  while True:
      send(IP(dst = '192.168.0.101')/ICMP()/'This is a message')
  </code></pre>
  
  <p>I run this program through terminal and using "ps -e" i found the pid is 2046.
  When i run "lsof -p 2046", it gives me following output.</p>
  
  <pre><code>COMMAND  PID USER   FD   TYPE DEVICE  SIZE/OFF    NODE NAME
  python  2263 root  cwd    DIR  253,1      4096  393217 /root
  python  2263 root  rtd    DIR  253,1      4096       2 /
  python  2263 root  txt    REG  253,1      6412 1312778 /usr/bin/python2.7
  python  2263 root  mem    REG  253,1     40536  132769 /usr/lib/python2.7/lib-dynload/arraymodule.so
  python  2263 root  mem    REG  253,1     76968  132773 /usr/lib/python2.7/lib-dynload/cPickle.so
  python  2263 root  mem    REG  253,1    141376  132758 /usr/lib/python2.7/lib-dynload/_io.so
  python  2263 root  mem    REG  253,1     21576  132804 /usr/lib/python2.7/lib-dynload/zlibmodule.so
  python  2263 root  mem    REG  253,1     13336  132779 /usr/lib/python2.7/lib-dynload/fcntlmodule.so
  python  2263 root  mem    REG  253,1     22348  132795 /usr/lib/python2.7/lib-dynload/selectmodule.so
  python  2263 root  mem    REG  253,1     34952  132768 /usr/lib/python2.7/lib-dynload/_struct.so
  python  2263 root  mem    REG  253,1     21976  132756 /usr/lib/python2.7/lib-dynload/_heapq.so
  python  2263 root  mem    REG  253,1     50736  132784 /usr/lib/python2.7/lib-dynload/itertoolsmodule.so
  python  2263 root  mem    REG  253,1     34068  132789 /usr/lib/python2.7/lib-dynload/operator.so
  python  2263 root  mem    REG  253,1     29584  132747 /usr/lib/python2.7/lib-dynload/_collectionsmodule.so
  python  2263 root  mem    REG  253,1     18708  132800 /usr/lib/python2.7/lib-dynload/timemodule.so
  python  2263 root  mem    REG  253,1     16936  132774 /usr/lib/python2.7/lib-dynload/cStringIO.so
  python  2263 root  mem    REG  253,1     32804  132767 /usr/lib/python2.7/lib-dynload/_ssl.so
  python  2263 root  mem    REG  253,1     10768  132754 /usr/lib/python2.7/lib-dynload/_functoolsmodule.so
  python  2263 root  mem    REG  253,1    169076 1313915 /usr/lib/liblzma.so.5.0.99
  python  2263 root  mem    REG  253,1    437616 1314045 /usr/lib/libpcre.so.1.2.1
  python  2263 root  mem    REG  253,1    140980 1324120 /usr/lib/libselinux.so.1
  python  2263 root  mem    REG  253,1     14660 1313891 /usr/lib/libkeyutils.so.1.5
  python  2263 root  mem    REG  253,1     52740 1311324 /usr/lib/libkrb5support.so.0.1
  python  2263 root  mem    REG  253,1     89336 1314317 /usr/lib/libz.so.1.2.8
  python  2263 root  mem    REG  253,1    103924 1314111 /usr/lib/libresolv-2.18.so
  python  2263 root  mem    REG  253,1    217596 1311314 /usr/lib/libk5crypto.so.3.1
  python  2263 root  mem    REG  253,1     14816 1313563 /usr/lib/libcom_err.so.2.1
  python  2263 root  mem    REG  253,1    853160 1311323 /usr/lib/libkrb5.so.3.3
  python  2263 root  mem    REG  253,1    296208 1311189 /usr/lib/libgssapi_krb5.so.2.2
  python  2263 root  mem    REG  253,1   1875268 1310866 /usr/lib/libcrypto.so.1.0.1e
  python  2263 root  mem    REG  253,1    414804 1311008 /usr/lib/libssl.so.1.0.1e
  python  2263 root  mem    REG  253,1     75480  132765 /usr/lib/python2.7/lib-dynload/_socketmodule.so
  python  2263 root  mem    REG  253,1     16892  132755 /usr/lib/python2.7/lib-dynload/_hashlib.so
  python  2263 root  mem    REG  253,1 106070928 1320811 /usr/lib/locale/locale-archive
  python  2263 root  mem    REG  253,1   2064488 1313517 /usr/lib/libc-2.18.so
  python  2263 root  mem    REG  253,1    328148 1313917 /usr/lib/libm-2.18.so
  python  2263 root  mem    REG  253,1     12836 1314239 /usr/lib/libutil-2.18.so
  python  2263 root  mem    REG  253,1     17912 1313596 /usr/lib/libdl-2.18.so
  python  2263 root  mem    REG  253,1    134608 1314076 /usr/lib/libpthread-2.18.so
  python  2263 root  mem    REG  253,1   1659436 1314088 /usr/lib/libpython2.7.so.1.0
  python  2263 root  mem    REG  253,1     14284  132764 /usr/lib/python2.7/lib-dynload/_randommodule.so
  python  2263 root  mem    REG  253,1     23572  132771 /usr/lib/python2.7/lib-dynload/binascii.so
  python  2263 root  mem    REG  253,1     30320  132786 /usr/lib/python2.7/lib-dynload/math.so
  python  2263 root  mem    REG  253,1    150572 1313337 /usr/lib/ld-2.18.so
  python  2263 root    0u   CHR  136,1       0t0       4 /dev/pts/1
  python  2263 root    1u   CHR  136,1       0t0       4 /dev/pts/1
  python  2263 root    2u   CHR  136,1       0t0       4 /dev/pts/1
  python  2263 root    5u  sock    0,7       0t0   73120 protocol: UDP
  </code></pre>