You need to maintain a ping/pong routing table. All ids of pings you route need to be stored in a table together with the host it came from.
When you send a pong back or receive a pong you just lookup the id in your routing table to find the host you need to forward the pong to.
This generally works the same way as query and push routing. Here is a description of the routing:
http://rfc-gnutella.sourceforge.net/.../index.html#t4
But this is an outdated way to handle ping/pongs. Modern servents today use some kind of ping reduction technology (most often called Pong Caching) to reduce bandwidth and resources. There are various different implementations used by vendors. You find a basic description of Pong Caching here:
http://wiki.limewire.org/index.php?t...ng_Caching_GDF