Is it possible that a hardware device change the response info to the same IP?

0

I am building a relay server for a game and wanted to make it work in most situations. The host and clients will connect to the relay server that works as a middle man.

Basic info:

The relay server (We call it R) got a static IP.

The App (Server or client) (We call it A) can in theory use any type of provider ex 3G/4G/Wifi... and be behind any number of firewalls/NATs/Proxys/Switches... think worst case scenario.

So my question is if A send a UDP message to R. R get a IP and a port that it can send a response to. All ok.

But say A (same A) send another UDP message to R. Is there some hardware or maybe software in the world that may change the IP or port that R will respond to?

Examples in theory:

Can a NAT give a different port to respond to even if the message is to the same IP as before? Is there a firewall that only allow one response per outbound message? Can one message go via a proxy while another message don't go via a proxy that result in one of the messages may have a different port to send a response to? If A use a 3G connection and drive a car and they switch cell-tower. Can R get another IP or port when using the new cell-tower? Again, think worst case scenario.

Why?

The reason I ask is because I wonder if:

  1. I can use the same IP and port that I got from the first message from A.
  2. Or should I send a message now and then to update the response info.
  3. Or should R only send to A if A first send a message and I just send back one response on each request.

nr 3 should always work, regardless situation. But I just want to know if I overthink this.

This question may be too wide, but it's hard to pinpoint it.

Knight

Posted 2017-07-24T09:06:14.113

Reputation: 1

1

You're using a stateless transfer protocol so you will have to do your own tracking. You won't know whenever A already sent you data in the first place without keeping track in some manner. As your example includes "any number of NATs" that already means that it could change at any point depending on the NAT, though it might be unlikely for regular users. As you don't have any conformation of whenever the other party actually received your messages you certainly can do (1) but without implementing some kind of session it's bad.

– Seth – 2017-07-24T09:34:07.973

@Seth. In this case tracking is not important for R. I already have another system for tracking. – Knight – 2017-07-24T10:56:18.433

In which case this isn't important either because it shouldn't matter. As said with various NAT setups and proxy setup there is a chance and if you already do have a session layer implemented, use the data from that layer. – Seth – 2017-07-24T10:58:28.557

No answers