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

  • intensely_human@lemm.ee
    link
    fedilink
    English
    arrow-up
    2
    ·
    3 months ago

    A port is like an apartment number. Except instead of apartments, it’s just mailboxes. Bob’s mailbox is number 25. If you want to get a message to Bob, uou write “box 25” on the address.

    A port number is just an additional piece of info that the operating system associates with a particular program. If something comes in on port 22, the sshd is going to handle it because it’s “listening on port 22”, meaning that it has registered itself with the OS as the recipient of anything that comes in marked “port 22”.

  • Aceticon@lemmy.world
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    1 year ago

    Imagine the computer as a shopping mall, which has a name and address (i.e the IP address).

    A port is a specific store in that mall, from were you can get specific things.

    The analogy even holds further in that for certain “stores”, the same store by name of certain chains (i.e. Burger King) will provide the same service in different malls if its present there (for example, port 80 is were the HTTP service is, by convention) and the same kind of service can be provided in other stores (nobody stops you from having an HTTP service on a different port).

    Were the analogy breaks is that unlike with chain store names (which are protected by trademark) there really is no enforcement that a certain port has a certain service (i.e. you can put whatever service you want on port 80 of a computer you control) and certain services being in certain ports is merely a convention.

  • a_fancy_kiwi@lemmy.world
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    1 year ago

    Imagine you need to go see your doctor. They work in a building with 65535 rooms. Some rooms are empty. Some rooms have people in them that provide different services. But you need your doctor so you look up their location.

    You learn the building address (IP address) and the room number (port)

    In practice, you attach services to specific ports so that other computers can access those services. Typically, http traffic is on port 80 and https is on port 443. So if you visit a website, you are likely connected to a server on one of those two ports. But it’s not a requirement. You could create a website and put it on port 2097, or 532, or 47210; it doesn’t matter.