Getting 5-tuple information in a php script
<p>Is there any simple way to get the 5-tuple information (source ip, source pprt, destination ip, destination port, layer-4 protocol) in php?</p>

<p>I see that there is $_SERVER['REMOTE_ADDR'] that gives me source ip. How can I get remaining 4 elements?</p>

<p>EDIT: From <a href="http://php.net/manual/en/reserved.variables.server.php" rel="nofollow">http://php.net/manual/en/reserved.variables.server.php</a>, I see that there are $_SERVER elements for REMOTE_ADDR, REMOTE_PORT, SERVER_PORT, SERVER_ADDR that the webserver I am using is not setting. I can modify the webserver code to export these elements as well.</p>

<p>Would it be safe to assume that layer-4 protocol would always be tcp?</p>
