this post was submitted on 07 Sep 2026
20 points (100.0% liked)

No Stupid Questions

49733 readers
558 users here now

No such thing. Ask away!

!nostupidquestions is a community dedicated to being helpful and answering each others' questions on various topics.

The rules for posting and commenting, besides the rules defined here for lemmy.world, are as follows:

Rules (interactive)


Rule 1- All posts must be legitimate questions. All post titles must include a question.

All posts must be legitimate questions, and all post titles must include a question. Questions that are joke or trolling questions, memes, song lyrics as title, etc. are not allowed here. See Rule 6 for all exceptions.



Rule 2- Your question subject cannot be illegal or NSFW material.

Your question subject cannot be illegal or NSFW material. You will be warned first, banned second.



Rule 3- Do not seek mental, medical and professional help here.

Do not seek mental, medical and professional help here. Breaking this rule will not get you or your post removed, but it will put you at risk, and possibly in danger.



Rule 4- No self promotion or upvote-farming of any kind.

That's it.



Rule 5- No baiting or sealioning or promoting an agenda.

Questions which, instead of being of an innocuous nature, are specifically intended (based on reports and in the opinion of our crack moderation team) to bait users into ideological wars on charged political topics will be removed and the authors warned - or banned - depending on severity.



Rule 6- Regarding META posts and joke questions.

Provided it is about the community itself, you may post non-question posts using the [META] tag on your post title.

On fridays, you are allowed to post meme and troll questions, on the condition that it's in text format only, and conforms with our other rules. These posts MUST include the [NSQ Friday] tag in their title.

If you post a serious question on friday and are looking only for legitimate answers, then please include the [Serious] tag on your post. Irrelevant replies will then be removed by moderators.



Rule 7- You can't intentionally annoy, mock, or harass other members.

If you intentionally annoy, mock, harass, or discriminate against any individual member, you will be removed.

Likewise, if you are a member, sympathiser or a resemblant of a movement that is known to largely hate, mock, discriminate against, and/or want to take lives of a group of people, and you were provably vocal about your hate, then you will be banned on sight.



Rule 8- All comments should try to stay relevant to their parent content.



Rule 9- Reposts from other platforms are not allowed.

Let everyone have their own content.



Rule 10- Majority of bots aren't allowed to participate here. This includes using AI responses and summaries.



Credits

Our breathtaking icon was bestowed upon us by @Cevilia!

The greatest banner of all time: by @TheOneWithTheHair!

founded 3 years ago
MODERATORS
 

I'm not great at networking concepts, but my basic understanding is that computer networking relies on constructs like IP addresses and port numbers to direct data packets to the correct device and application.

So, if I'm playing an online game like Minecraft or Counter-Strike, I am able to connect to the dedicated game server using the server's IP address (which might be associated with a physical device, or a virtual device like a VM or a OCI container) and port number (which is like a communication "channel", associated with a particular piece of software).

And, as such, you can host multiple game server instances for the same game on different IPs or ports, as long as each server has some way to be individually addressed.

But I start to get a bit confused when I think about the packet's return trip and how the server communicates back to the clients...

In some cases, each client will be connecting from their own network modem, with their own IP address assigned to them dynamically or statically by their ISP. In that case, I would imagine that the server could just keep a list of client connections and route relevant data back to each client.

But in other cases, you might have a multiple clients playing a game behind one modem (like housemates or a LAN party where multiple players join the same remote/internet server), or a newer problem, multiple different networks sharing an IP address due to CG-NAT at the ISP level. In which case, from the perspective of the server, multiple players would be playing from the same IP address and communicating over the same port, right?

So how does the server differentiate between >2 players connecting from the same IP address and communicating over the same port?

Or does it not even try, and instead just broadcast all of the relevant game data to every client?

And if that's the case, how do huge games like battle royales or MMOs handle sending game state to a large number of users?

top 7 comments
sorted by: hot top controversial new old
[–] dhork@lemmy.world 8 points 2 hours ago* (last edited 2 hours ago)

A lot of good answers here, talking about the IP/port combinations used to identify both sides of a connection. But a key thing to understand is that the ports don't need to be the same on both ends. On the Client side, the port number is often assigned just for that connection. (The standards call those "ephemeral" ports.) So, two independant connections from the same IP are differentiated by their client side IP ports.

It should also be noted that NAT works by translating both IP addresses and ports. So if those two connections are coming from behind the NAT and have different internal IPs but the same port, the NAT will translate that to two different ports from the public IP.

[–] CombatWombat@feddit.online 11 points 3 hours ago* (last edited 3 hours ago)

The internet is an inter-networking protocol. Your modem/router gets a single IP address to represent the entire network publicly, but it assigns addresses to each device internally. When it receives a packet from the wider internet, it performs a translation to figure out which internal address to route the packet to. There are headers attached to the packet that your router uses to keep track of which internal addresses to send it to. It's kind of like when someone gets the mail for a single family home -- everyone who lives there has the same street address, but you can figure out who's room to take the mail to based on the name on the envelope.

[–] Shadow@lemmy.ca 5 points 3 hours ago* (last edited 2 hours ago)

There's two ports involved, the client port and the server port. Multiple clients with different client ports and the same ip can connect to the same server port, but they can't reuse the same client side port. (if necessary routers can remap this on the fly and change the client port as it leaves the network, keeping a list in its "connection tracking" table)

The client port is usually randomly chosen by the OS networking stack, between 1024-65535.

[–] beufff@jlai.lu 4 points 3 hours ago

The router keeps track of the client ephemeral source port to map to which private IP it needs to send the return packet. If devices inside the same network use the same source port, destination IP and destination port then something like Dynamic NAT with port overload is used : What it will do is map the port with another ephemeral ports (usually +1) that's free. The router keeps track of all those mappings.

[–] Strider@lemmy.world 3 points 3 hours ago* (last edited 3 hours ago)

I didn't read everything to be fair but you do not only have destination IP and Port but also source IP and port in which case they're separate connections even if the source IP might be the same.

And that's only the IP connection side, there's also a lot more to it there could be authentication and stuff which makes it also more unique.

[–] originalucifer@moist.catsweat.com 2 points 3 hours ago (1 children)

its all about the mac address and how that is encapsulated but available at differing parts of the routed networks in transit.

[–] davad@lemmy.world 2 points 38 minutes ago

You went a layer too low. You can stay at the TCP/IP layer to explain this one. Jumping to MAC addresses is a little like saying "it all depends on how different machines interpret electrical signals." It's true, but not particularly helpful.