what is port number, in computer network terms

262 views

what is port number, in computer network terms

In: 3

9 Answers

Anonymous 0 Comments

An IP address is like your home address. The port is like saying which door to go in and out of.

Anonymous 0 Comments

An IP address can identify a single system, but a system can host multiple services. How does the system know which service to pass incoming messages to? If you receive messages from multiple services on a system, how do you know which one sent it to you?

Port numbers allow you to address specific services running on a single system. Think of it like one of those stacked mail boxes in apartment complexes. The building address (IP address) is enough to get a letter to the building, but there can be multiple tenants in the same building. In order to get the letter to the correct tenant, you also need need to provide an apartment/suite/etc. number (port number) so that the letter ends up in the correct mailbox.

Anonymous 0 Comments

On a network, each device or computer has a unique address – in internet terms, an IP or Internet Protocol address – 192.145.204.74 for example. This is like a unique everywhere address… like a postal or zip code (for you Americans) in conjunction with a street address**.

However, at each address there might be multiple programs wanting to send or receive data. So think of a network port like a mailbox in an apartment building. The IP address gets the data to the right building and the port gets the data to the right program at that building.

For example, web/http/browser traffic is on port 80. So a web server program running at reddit’s computer center will listen for requests on that port. Sending data to a different port at that server address will be ignored, unless the computer and appropriate programs running on it are configured to “listen” on the different ports.

Another example would be if your video game server uses port 1234. Spotify is streaming music on port 4070. Thus, your operating system (or its firewall if you want to get picky) knows that anything coming to port 4070 it hands over to Spotify and anything destined for port 1234 it delivers to your video game.

If two or more programs were listening on the same port things would get confusing. If Spotify and your video game were both using the same port the video game would get a data packet for Spotify and go “wtf is this?” and your video game wouuldn’t behave properly. Or spotify would get a video game packet and try and decode it like Spotify music and it would be gobblygook.

There are, [by convention some ports that are reserved for specific types of services](https://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers). For example web/http servers use 80 and 1080. Secure web traffic uses port 443. But beyond these commonly accepted or reserved ports you can just choose a “free” port for your own application. But unless you register it, if something else comes along using the same port there could be confusion.

** a street address isn’t good enough, there could be a 12 Maybury Ave. in two different cities. Likewise a postal/zip code can sometimes refer to multiple houses or buildings. But a zip code AND street address is most likely unique.

Anonymous 0 Comments

An apartment number in an apartment complex. The computer is the apartment complex. A program chooses to take residence in an apartment with that number. They send/receive mail through that number and address. That’s the internet (or other network).

Anonymous 0 Comments

It’s a solution to letting multiple things talk to your computer at one time despite (usually) having one network adapter.

Your network adapter has just one address. If that was all you had, then if you tried to talk to two things at once your computer would get confused about which program should see the responses.

So you don’t just have an address, you have a port number, and programs have to declare what ports they want to listen on. That way even if 10 different programs are listening for network traffic, as long as they all use different ports your computer can keep things straight.

So your network card is like a mailbox, but multiple people can live in a house. That’s why letters and packages have a name on them: so people know which person in the house should open the mail.

Anonymous 0 Comments

Imagine a big apartment building. It would have a single street address right? Like 445 Main Street? This is similar to an IP address for a computer. It determines “where the computer exists on the internet”.

What if I wanted to send a letter to an individual in that apartment block? How would I do that? Well, they’d likely have an apartment number right? So their full address might be “Apartment 12, 445 Main Street”.

This is pretty much was a computer port it, it’s the ‘apartment number’ for a specific service that exists on a computer.

So, say you’re running a simple web server on a computer, usually that service “listens” to port 80. So any network traffic that finds its way to port 80 on that computer is ‘delivered’ to the webserver to process.

There are a number of ‘standard’ port numbers for services such as HTTP, FTP, RDP, etc., but it’s often possible to reassign port numbers.

When you type an address into a browser such as [www.reddit.com](http://www.reddit.com), your browser implicitly sends that data to port 80. However if you needed to specific a specific port, you can add it to the URL using a colon deliminator such as [www.reddit.com:80/](https://www.reddit.com:80/)

Anonymous 0 Comments

There are usually a number of different program running on a computer that communicate over the network. If one such program sends out a message and a reply comes back the computer needs to figure out which program to give the message to.

One way to do this is to use ports. These are usually assigned to specific protocols.

For example port 80 is the default port for http and port 443 the default port for https. This is the port you sen request to on webservers when you want them to show you a website.

Most of the times you need not worry about these things as the various program running on all the computers involved will take care of it.

Fun Fact:

Port 666 was used by the original DOOM game and appears in lists of TCP & UDP ports to this day.

Anonymous 0 Comments

I like to think about ports and addresses like boat slips in a harbor.

Imagine a harbor with one or more very long docks. Each dock has 65,545 slips, where a boat may dock.

These docks are your network addresses (e.g. 192.168.1.1) and each slip is a port where a connection may dock. Much like a docked boat in the way, only one connection per address:port combination is allowed at one time.

Anonymous 0 Comments

An IP address is like a building’s street address, and the port number is like a suite/apartment number.