instrumentationintel-pinpacket-injection

Memory reference traces with Intel Pin of packet processing applications


I'm learning how to use Intel Pin and I have a couple of questions regarding the instrumentation process for a particular usecase. I would like to create a memory reference trace of a simple packet processing application. I have developed the required pintool for that purpose and my questions are the following.

Thank you


Solution

  • I assume you are doing something related to following the data flow / code flow of the network packet, probably closely related to data tainting?

    Assuming I use the same network packet trace at all times as input to my packet processing application and let's say I instrument that same application on two different machines. How will the memory reference traces be different?

    There are multiple factors that can make the memory trace trace quite different, the crucial point being "two different machines":

    Apparently Pin instruments userspace and is architecture independent so I wouldn't expect to see big qualitative differences in the two output memory reference traces. Is that assumption correct ?

    Pintools needs to be recompiled for different archs, but the pintool itself should not change the way the target application is traced (same pintool + same os + same application = nearly same trace).

    How will the memory trace change if I experiment with the rate at which I inject network packets to my packet processing application ?

    This is system dependent and also depends on your insertion point(s). If you start tracing at recv() or recvfrom() there might be some congestion or dropped packets (UDP) if, for example, the rate is too important. Depends on the protocol, your receive window, etc. There are really multiple factors here.

    Or will it change at all and if yes how can I detect how the output traces differ ?

    I'd probably check the code flow rather than the data flow for this case (seems easier to me). Given exactly the same packet but different rates, if the code branches are not the same (maybe at the basic block (BBL) level), this immediately tells that the same packet is handled differently.