简体   繁体   中英

Distinguishing between multiple clients behind the same NAT

I have a Server X and 2 clients A and B behind the same NAT. A and B need to form 10 TCP connections each to X on the same outbound port. X should only accept at most 10 connections from a single client. So I need X to tell A from B right after accept(). Is there any way to do this with just the information in a TCP packet or do or do I have to have the client send the server some unique ID after the connection is established?

In IP, the clients are only identified by their IP address. It is not possible to know from which client the connection came from if there is NAT in between.

In reality TCP/IP stacks of different operating systems and operating system versions work a bit differently and fingerprinting the clients might be possible. This is most likely not useful for you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM