<p>I had a discussion with a developer earlier today re identifying TCP packets going out on a particular interface with the same payload. He told me that the probability of finding a TCP packet that has an equal payload (even if the same data is sent out several times) is very low due to the way TCP packets are constructed at system level. I was aware this may be the case due to the system's MTU settings (usually 1500 bytes) etc., but what sort of probability stats am I really looking at? Are there any specific protocols that would make it easier identifying matching payloads?</p>

[{'answer_id': 81865, 'author': 'mdec', 'author_id': 15534, 'author_profile': 'https://Stackoverflow.com/users/15534', 'pm_score': 2, 'selected': True, 'text': '<p>EDIT: Sorry, my original idea was ridiculous. </p>\n\n<p>You got me interested so I googled a little bit and found <a href="http://monkey.org/~jose/software/flowgrep/" rel="nofollow noreferrer">this</a>. If you wanted to write your own tool you would probably have to inspect each payload, the easiest way would probably be some sort of hash/checksum to check for identical payloads. Just make sure you are checking the payload, not the whole packet.</p>\n\n<p>As for the statistics I will have to defer to someone with greater knowledge on the workings of TCP.</p>\n'}, {'answer_id': 82178, 'author': 'Chris', 'author_id': 15578, 'author_profile': 'https://Stackoverflow.com/users/15578', 'pm_score': 2, 'selected': False, 'text': "<p>It is the protocol running over tcp that defines the uniqueness of the payload, not the tcp protocol itself.</p>\n\n<p>For example, you might naively think that HTTP requests would all be identical when asking for a server's home page, but the referrer and user agent strings make the payloads different.</p>\n\n<p>Similarly, if the response is dynamically generated, it may have a date header:</p>\n\n<p>Date: Fri, 12 Sep 2008 10:44:27 GMT</p>\n\n<p>So that will render the response payloads different.  However, subsequent payloads may be identical, if the content is static.</p>\n\n<p>Keep in mind that the actual packets will be different because of differing sequence numbers, which are supposed to be incrementing and pseudorandom.</p>\n"}, {'answer_id': 82313, 'author': 'Desty', 'author_id': 2161072, 'author_profile': 'https://Stackoverflow.com/users/2161072', 'pm_score': 2, 'selected': False, 'text': '<p>Chris is right. More specifically, two or three pieces of information in the packet header should be different:</p>\n\n<ul>\n<li>the sequence number (which is\nintended to be unpredictable) which\nis increases with the number of\nbytes transmitted and received.</li>\n<li>the timestamp, a field containing two\ntimestamps (although this field is optional).</li>\n<li>the checksum, since both the payload <em>and header</em> are checksummed, including the changing sequence number.</li>\n</ul>\n'}, {'answer_id': 595544, 'author': 'jdizzle', 'author_id': 70603, 'author_profile': 'https://Stackoverflow.com/users/70603', 'pm_score': 1, 'selected': False, 'text': "<p>Sending the same PAYLOAD is probably fairly common (particularly if you're running some sort of network service).  If you mean sending out the same tcp segment (header and all) or the whole network packet (ip and up), then the probability is substantially reduced.</p>\n"}]
['https://Stackoverflow.com/questions/81504', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/368855/']