Dynamically generate reverse mapping of incoming/outgoing packet to process and thread id during debugging
Publication Date: 2014-Nov-26
The IP.com Prior Art Database
While debugging network traffic, at times it is important to find out the process or thread to whom this packet is likely to be delivered. This article presents one possible framework to achieve the mentioned, keeping the efficiency perspective into consideration.
Page 01 of 2
Dynamically generate reverse mapping of incoming /outgoing packet to process and thread id during debugging
Disclosed is a framework, to efficiently map incoming packet to its corresponding process and thread. This information primarily is needed during debugging and so care has to be taken not to add any overhead during normal packet processing.
During network packet debugging, from a user perspective it is important to profile packet details from process or thread perspective instead of just being at port ID level. Today, as a socket is created the process id and thread id of the creating process is attached to socket information. Now when a packet arrives it has only IP address/port related information at link layer.
Packet filters like Berkley Packet Filter(BPF) and etc., work on link layer and to fetch the process/thread ID to whom this packet is intended for, it demands to fetch the socket and then required information. Accessing the socket details poses the complication, we would need to take required locks all the time and do all the look ups.
1. Taking these locks increases the frequency of lock contention among other Central Processing Unit ( CPU ) processing packets as well.
2. Can slow the network performance.
3. Since, processing becomes slow, actual problem being debugged might not be recreated again.
While debugging network related issues it is important to maintain the expected network performance at the same time should be able to give as much data as possible for ease in debugging.
Adding process ID and thread ID like information would be much useful.
Framework proposed, mentions to use dynamic tracing to build a initial set of reverse mapping using internal data structures and then plant probes to continuously update this internal data structure as and when sockets are created and destroyed.
Filtering mechanisms will use this internal data structure to fetch the required details.
1. Need not use any additional da...