this post was submitted on 28 Jun 2023
103 points (100.0% liked)

Explain Like I'm Five

14220 readers
4 users here now

Simplifying Complexity, One Answer at a Time!

Rules

  1. Be respectful and inclusive.
  2. No harassment, hate speech, or trolling.
  3. Engage in constructive discussions.
  4. Share relevant content.
  5. Follow guidelines and moderators' instructions.
  6. Use appropriate language and tone.
  7. Report violations.
  8. Foster a continuous learning environment.

founded 1 year ago
MODERATORS
 

I often see that network settings have a field for logical port. What is this field.referring to?

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 16 points 1 year ago (3 children)

One network interface has just one IP address, but it can have a bunch of different programs listening and talking.

A server might have both a webserver and a mail server running on the same machine - and they don't want each other's network traffic.

So you mark each packet with a destination port number, to let the server work out which program you're talking to.

Your web browser will mark all its packets with port 80 or port 443, and when the server gets those, it knows it's web traffic, and passes it to the webserver software.

Your email client will mark all its packets with port 25 or 993, and when the server gets those, it knows it's email traffic, and passes it to the mailserver software.

Typically each separate kind of network service will have its own well-known port number assigned to it.

There's also a source port field on packets, so that your computer can get return traffic back to the right program running on your machine.

[–] [email protected] 2 points 1 year ago (1 children)

Ok I have a follow up question if you'll indulge me - why those numbers in particular?

[–] [email protected] 3 points 1 year ago

No reason, they're conventions. Check out this list and you'll get a better idea. It's simply a number that the developer assigns without a particular meaning. It's kinda like telephone help lines, one thing that a developer might want to try is to find a pretty memorable number while trying to avoid conflicts with other programs running at the same time.

load more comments (1 replies)