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

  • Brkdncr
    link
    fedilink
    661 year ago

    If an ip address is a house number, then a port is an apartment number.

  • @a_fancy_kiwi
    link
    English
    51
    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.

    • sebinspace
      link
      English
      161 year ago

      And the best port of all, 25565

      • @2dollarsim
        link
        English
        41 year ago

        Haha knew that one sounded familiar but it’s been a while

        • Dran
          link
          English
          31 year ago

          What’s the reference?

          • Ignisnex
            link
            English
            81 year ago

            It’s the port for a Minecraft Java server.

          • @RGB3x3
            link
            English
            61 year ago

            It’s for Minecraft, haha

          • Ignisnex
            link
            English
            21 year ago

            deleted by creator

    • @TheBeege
      link
      English
      11 year ago

      I came up with the same analogy! This one is great. People understand it really quickly

  • @hydra
    link
    English
    311 year ago

    Imagine you have a bunch of island countries. Each country needs to communicate with other countries for several affairs and to trade. A network connection is a route where boats transit back and forth between two said countries with people and things. The location of each island is encoded with a unique address, called an IP (Internet Protocol) address. The thing is, each country also has a huge, massive amount of different sea ports. A big amount of them. To be precise, 65536 different ones.

    Each port number is associated with a service or a city that benefits from said sea traffic and expects boats. So to send a boat from one country to another, you need to send that boat from a specific port to a specific port in country (IP address). For example, port 80 is Website City in Google Land. You need to google something / send and receive boats with cargo (your search query). You have to send a boat from your own port 80 (Firefox Town) to Google Land (IP address of a Google server)'s own port 80 which is located in Website City.

    Each network connection is a series of sea trips between cities.

    • @silvanocerza
      link
      English
      21 year ago

      Awesome explanation, I’m reusing this for sure.

      • @hydra
        link
        English
        11 year ago

        Thanks c:

  • @TheBananaKing
    link
    English
    281 year ago

    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.

    • Andrzej
      link
      fedilink
      41 year ago

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

      • iByteABit
        link
        fedilink
        51 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.

        • PupBiru
          link
          fedilink
          11 year ago

          id say your telephone number example can be extended:

          1800 is for free numbers, but why? no particular reason, just that’s the number that got chosen at some time… same with port 80 being HTTP: that’s just the number that got chosen!

          you can also have an HTTP server running on port 25 (usually mail); it’s just bad practice… just like there’s no reason why your phone company couldn’t make a regular phone number toll free!

          what’s pretty normal though is running an HTTP server on say, port 5000: this is just for more technical users though, because you have to know the port; your browser doesn’t “remember” it for you

      • TechyShishy
        link
        fedilink
        11 year ago

        Mostly history. Numbers were chosen rather than other identifiers because they were simpler to use over the wire back in the day when the protocol was written when every bit cost, and nobody at the time could imagine a single physical machine managing more than 65535 programs at the same time, since that was how you conventionally hooked things up. The IANA (International Assigned Numbers Authority, https://iana.org/) is responsible for maintaining a list of “registered” numbers, but those are largely by convention, not by requirement. Web browsers associate https traffic with port 443 by default, but as a developer, we can set up a webserver on port 50443 and send our browser to if we specify that number explicitly. It just wouldn’t know about it by default.

        Nowadays, with virtual machines, NAT subnetworks, and the absurdity that is involved in port-per-transaction networking (We’re looking at you nginx proxy frontends), it’s gotten a bit congested. Fortunately, IPv6 has relieved quite a bit of that, and we now have a much larger pool of 2x(IP/Port) quads to draw from, but it was a real issue there for a while.

    • Brkdncr
      link
      fedilink
      21 year ago

      For convulsion’s sake, one network interface can have more than one ip.

      • BaroqueInMind
        link
        fedilink
        11 year ago

        For convulsion’s sake

        Yeah… Networking makes me want to hurl and puke sometimes as well.

  • @HardlightCereal
    link
    English
    27
    edit-2
    1 year ago

    Ports are a way of sorting requests sent to the same physical device into different services. If a single device is providing three different services, you want to send your request to the right service on the device. For example, maybe your device has a website, a piece of accounting software, and an online video game running on it. If it weren’t for ports, you’d need three different devices to run those three different programs. But with ports, as long as I know what port the service I want is on, I can send my request to the right service on that device.

    If you have limited money to buy devices but you want to make a lot of different apps, ports are important. Ports are also important if you’re a business like Google that provides lots of different services.

  • @[email protected]
    link
    fedilink
    English
    261 year ago

    Imagine a computer is like a building that can provide goods and services such as coffee shop, travel agency, bookshop, movie rental, etc. and has a street address, that would be the network address. That address would take you to the building door, but you still need to know on what floor is the service you’re looking for. That would be the port number.

    • @[email protected]
      link
      fedilink
      English
      151 year ago

      Expanding on the building analogy. It’s more like a package gets dropped off at the building with a room number (port number) attached. The building mail room (operating system) Then hands this package off to the room number listed. With the room being some process ruining on the computer

  • @BiteForce5584
    link
    English
    231 year ago

    So, you know when you want to send a letter to someone, you need to write their address on the envelope? That address tells the post office exactly where your letter needs to go. But imagine if the person receiving the letter lives in a big house with many apartments and many people. Just the house address might not be enough. You might also need to specify the apartment where the person you want to receive the letter is located.

    In computer networking, the ‘address’ is like the IP address of a computer. It tells the network where to send the information. But computers are like a big house converted to apartments. They can do many things and run many applications at the same time. Each of these applications is like a person in a different apartment in the house.

    The ‘port’ is like the apartment number in the house. When information arrives for a particular IP address (the house), the port number (the apartment number) makes sure the information gets delivered to the right application (the right person in the right apartment).

    So, when you play an online game, or use a web browser, or send an email, each of these applications uses a different port number. This allows your computer to know which application should receive the information that’s coming from the internet.

    In summary, in computer networking, a port helps your computer sort incoming and outgoing data so it goes to the right program.

    • @SonnyIC
      link
      English
      61 year ago

      what’s port forwarding

      • Murray
        link
        English
        91 year ago

        Exactly what it says on the tin. It forwards mail/packets received on one or more ports to specific ports on another machine on the network.

        • @SonnyIC
          link
          English
          31 year ago

          Thanks for the answer!

    • @Deestan
      link
      English
      11 year ago

      This answer takes the “5” of “ELI5” seriously by not using advanced words or refer to systems that are unfamiliar to 5-year-olds. ⭐

  • @takeda
    link
    English
    17
    edit-2
    1 year ago

    If you would compare a server to a building, with its own street address, then port would be an apartment number for every application (tenant) living there.

    Ports are what allowing you to run multiple applications and all can communicate over the internet. Without ports you would need to have a dedicated computer for every application.

  • Jajcus
    link
    fedilink
    161 year ago

    Additionally to all the correct answers, a ‘port’ can also mean something completely different ‘in networking’.

    It can be a physical socket in a network equipment, like ‘Ethernet port’. Or it can be a virtual equivalent of such, e.g. when connecting virtual machines on a host - that could be called a ‘logical port’.

    Those can sometimes be used interchangeably with ‘interface’ or ‘device’, but it depends on convention used in particular system or environment.

  • @Aceticon
    link
    English
    12
    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.

  • @MKBandit
    link
    English
    101 year ago

    Think of it as doors. Each port is a door to the ip address. Let’s you choose/monitor what goes where

  • @zaggynl
    link
    English
    101 year ago

    If IP addresses are streets, ports are mailboxes.

  • 0485
    link
    English
    91 year ago

    Let’s consider an analogy to help illustrate the concept of ports in computer networking.

    Imagine you are the owner of a large office building with multiple departments and employees. The building represents a computer or a network device, and each department within the building represents a different application or service running on that device.

    Now, think of the employees in each department as the data packets or information that needs to be sent and received. In order to reach the correct department, each employee needs to specify the department number and the floor on which it is located. In this analogy, the department number is analogous to a port number, and the floor represents the device’s IP address.

    By having different department numbers (port numbers), the building can handle communication for various departments simultaneously. If someone wants to send a package to the Marketing department, they would address it to the Marketing department number, and the building’s mailroom would direct it to the correct location.

    Similarly, in computer networking, applications or services running on a device are assigned specific port numbers. When data is sent over a network, it includes both the IP address and the port number. Routers and network devices use this information to route the data to the correct application or service running on the destination device.

    In this analogy, the building’s address (IP address) helps identify the device, while the department numbers (port numbers) help identify the specific application or service within the device.

    I hope this analogy helps clarify the concept of ports in computer networking!

    • BOMBSOP
      link
      English
      21 year ago

      Yes, this is the comment that made it click. Thank you very much 😀

  • @linearchaos
    link
    English
    91 year ago

    Your IP address is like the main office number for your computer. The ports are like internal extension numbers.

    When you’re setting up a program and it’s asking you what logical port it should use, It’s asking you which extension it should be using. Just like if you were dealing with phone numbers and phone systems you have to give it a number that’s not already in use, and it probably makes sense to give it a number that is known for that type of service.

  • @[email protected]
    link
    fedilink
    English
    81 year ago

    There’s something important missing from most of the other answers. There’s a lot of different kinds of network and internet traffic. Web browsing, email, instant messaging, online video games…

    By formal standard, certain port numbers are designated for certain functions. Web traffic happens on port 80. Incoming email is sent on port 143, outgoing email is sent on port 456 or 587. Something like Discord will have a specific port it uses for both sending and receiving messages. Word of Warcraft has certain ports its uses for telling the server when you cast a spell, and for the server to tell your client when you take damage.

    So yes, ports are like PO boxes at a post office, but the analogy doesn’t quite capture it. Port 80 is always web traffic, and this is important, since your web browser requests pages on port 80, just as a web server returns web pages on port 80. The web server probably has other ports on it, like FTP (ports 20 and 21) or SFPT (port 22). If you connect to a web server on port 80, that means you’re asking for its webpages. If you connect on 20, 21, or 22, it means you’re trying to transfer files to it.

    • frozen
      link
      fedilink
      English
      21 year ago

      All true, except almost all web traffic nowadays is over port 443 (HTTPS) instead of 80.

      • @Stimmed
        link
        English
        31 year ago

        Almost true. Port 80 is usually used for unencrypted web traffic. But anything can be ran on any port. Standards are standards, not requirements.

        You can run https, ftp, virus communication, DNS, or anything else on port 80. People trying to connect to it might get confused though.

        • @Stimmed
          link
          English
          41 year ago

          I should give useful context though.

          When you connect to a server, you send traffic to an IP address. That is like a street address with a letter. But when you send a letter in the mail, more than one person could live at a house, so you also include a name (or port number when sending to one service such as web traffic to a server that does many things). Usually that name corresponds to a person living there, like if you send a letter to John even though Sarah also lives there.

          That is usually how it works, but not always. John and Sarah may have agreed that all letters should be named backwards, so John opens all letters to the name Sarah, and Sarah opens all letters to the name John. This would confuse anyone trying to send a letter to John unless John told them to use the name Sarah when sending a letter. Both could also agree that if a letter shows up for Bob, Sarah should open those as well (only Sarah’s best friend would know to use the name Bob).

          These exceptions are usually people either trying to obfuscate what is running on a port to pretend to be something different, it trying to make it hard to find the port associated with the server.