I'm learning the TCP and UDP protocols and I have a question about UDP.
I used C to develop a UDP server and a UDP client in my LAN and it works as expected. The server and the client could communicate each other. However, I don't know if UDP could still work as expected ifthere are many clients behind a same NAT.
As my understanding, NAT can maintain all of the status of TCPs, and each client has its own connection status. So when the NAT receives a TCP packet from the server, it knows to which client it should send the TCP packet.
But I don't know what would happen for UDP since UDP is stateless... In other words, when NAT receives a UDP packet, can it know to which client it should send the UDP packet?