I would like to be able to PAT such that outbound traffic for a given destination port is translated to some random port within a range on a per-PDU or per-packet basis.
The intention is that outbound traffic will be 'scattered' across the specified port range, similar to the principle of frequency hopping for radio transmission... Preferably, I would like this to be transparent to upstream applications.
An example scenario would be a file transfer utility that sends a stream of packetised data to host with destination port 9080. I would like to translate (perhaps even listen on localhost TCP port 9080) all traffic for a given host with destination port 9080 such that each packet goes out to the given host on a random port between, say 49000 to 50000.
To further clarify, I am not concerned with the source port from which traffic originates. My intention is to have a sender that sends on destination port 'N' across a link to a receiver that is listening for traffic coming in on destination port 'N'. After traffic leaves the sender, I want to randomize the destination port to a value within a known range... so a bunch of traffic will be seen over the wire with random destination ports... because the range is known, this traffic can then be re-translated to destination port 'N' by the firewall or similar at the receiver end.
[N] = packet with destination port 'N' [A <=N=> B] = packet with destination port between A and B /--[49000 <=N=> 50000]--\ SENDER --[N]-[N]-[N]--> (RANDOMISER)<---[49000 <=N=> 50000]--->(UNDO)-[N]-[N]-[N]-->RECEIVER \--[49000 <=N=> 50000]--/
I am looking to achieve this on both Windows and Linux platforms. So far I am unable to find much in the way of useful information or suggestions, and so any advice or suggestions would be appreciated.