Outreachy Week 2: Getting Connection Details for Network Processes21 Dec 2017
This blog post summarizes my progress until the second week of Outreachy.
Mainly over these two weeks I’ve worked on fetching the following details which will eventually help to associate packets with their corresponding processes .
I’ve made extensive use of
/proc file system to fetch these details.
Fetching a List of Sockets on different interfaces
The virtual files present in
/proc/net/ have details about our system’s network configuration and
/proc/net/udp in particular have details about the sockets which have been created to transfer data with the respective tranport protocol .
Appropriate data structures have been used to store the socket entries of these files after parsing the necessary details:
Mapping Socket Inode to its PID
/proc/net/udp do have the socket’s inode but they don’t have the
PID information required to map the packets to processes. Therefore a traversal of the
/proc dir was done to map the inode with the process to which it belonged to.
Sample Output from the Test
For those interested to have a look at the details which have been fetched through these steps, here is a sample output from a test file :
Next thing in line which I’m working on is the packet capture on different interfaces.
Feel free to check out my work.
Stay tuned !