kids encyclopedia robot

Port (computer networking) facts for kids

Kids Encyclopedia Facts

In computer networking, a port or port number is like a special address that helps computers send and receive information correctly. Imagine it as a numbered dock at a busy shipping port. Each dock (port number) is used for a specific type of cargo (data).

When computers talk to each other over a network, they use these numbers. This helps direct data to the right program or service on a computer. For example, your web browser uses one port, and your email program uses another. This way, your computer knows where to send incoming data.

The most common ways computers send data are using something called Transmission Control Protocol (TCP) and User Datagram Protocol (UDP). These protocols use port numbers that are 16-bit numbers. This means they can range from 0 to 65535.

A port number always works with a computer's IP address. An IP address is like a street address for your computer. The port number is like the apartment number at that address. Together, they make sure data goes to the exact right place. Some port numbers are reserved for common services. These are called well-known port numbers and are usually below 1024. Other ports are used for temporary connections.

Ports help many different programs or services share one network connection. This is like having many different shops in one building. Each shop has its own entrance (port number).

What is a Port Number?

For TCP and UDP, a port number is a whole number from 0 to 65535. Port 0 is usually not used for TCP. For UDP, a source port of zero means no port is used.

When a program wants to send or receive data, it "binds" to a port. This means it connects its communication channels to a specific port number. This connection is called an internet socket. The computer's operating system then manages all the data traffic. It makes sure outgoing data gets sent and incoming data goes to the correct program.

Only one program can use a specific IP address and port combination at a time for TCP. If two programs try to use the same port, it causes a "port conflict." This is like two shops trying to use the same entrance at the same time.

Common Port Numbers Explained

Many common services use specific, well-known port numbers. This helps other computers know where to find them. For example, a web server usually "listens" for requests on port 80. This is like a shop always having its main entrance open.

The Internet Assigned Numbers Authority (IANA) manages these port numbers. They make sure everyone uses them consistently.

Port numbers are grouped into three main ranges:

  • Well-known ports: These are from 0 to 1023. They are for very common services.
  • Registered ports: These are from 1024 to 49151. They are for other specific services.
  • Dynamic or private ports: These are from 49152 to 65535. They are often used for temporary connections.

Here are some important well-known port numbers:

Notable well-known port numbers
Number Assignment
20 File Transfer Protocol (FTP) Data Transfer (for sending files)
21 File Transfer Protocol (FTP) Command Control (for controlling file transfers)
22 Secure Shell (SSH) Secure Login (for secure remote access)
23 Telnet (for remote login, but not secure)
25 Simple Mail Transfer Protocol (SMTP) (for sending emails)
53 Domain Name System (DNS) (for translating website names to IP addresses)
67, 68 Dynamic Host Configuration Protocol (DHCP) (for assigning IP addresses)
80 Hypertext Transfer Protocol (HTTP) (for websites)
110 Post Office Protocol (POP3) (for receiving emails)
119 Network News Transfer Protocol (NNTP) (for online newsgroups)
123 Network Time Protocol (NTP) (for syncing computer clocks)
143 Internet Message Access Protocol (IMAP) (for managing emails)
161 Simple Network Management Protocol (SNMP) (for managing network devices)
194 Internet Relay Chat (IRC) (for online chat)
443 HTTP Secure (HTTPS) (for secure websites)
546, 547 DHCPv6 (IPv6 version of DHCP)

How Ports Work in Networks

Protocols like TCP and UDP use port numbers in their data packets. These numbers are in the packet's "header." This means that not only the sending and receiving computers can see them, but also other network devices.

For example, a firewall can use port numbers to decide which data packets to allow or block. This is like a security guard checking the dock number on a package. Port forwarding is another way ports are used. It directs incoming data from one port to another.

Port Scanning and Security

Port scanning is when someone tries to connect to many ports on a computer. People might do this to find out which services are running. Sometimes, network administrators do this to check for weak spots in their network's security. Unfortunately, hackers also use it for harmful reasons.

Computers often keep a record of these connection attempts. This helps them detect unusual activity. A technique called port knocking uses a special sequence of port connections to unlock a server.

Real-World Examples of Ports

Let's look at how email uses ports. An email server needs two main services.

  • One service sends and receives emails between servers. This uses Simple Mail Transfer Protocol (SMTP) on TCP port 25.
  • The other service lets your email program get messages from the server. This often uses Post Office Protocol (POP) on TCP port 110.

Both services can run on the same computer. The port number tells the computer which service a request is for.

While servers use well-known ports, your computer (the client) usually uses a temporary port. This temporary port is chosen from the "dynamic" port range. However, some applications, like DHCP, use specific ports for both the client and the server. DHCP clients always use UDP port 68, and DHCP servers always use UDP port 67.

Ports in Web Addresses (URLs)

You might sometimes see port numbers in web addresses, also known as uniform resource locators (URLs).

  • Normally, web pages use port 80 for HTTP and port 443 for HTTPS.
  • But if you see something like `http://www.example.com:8080/path/`, it means your web browser should connect to port 8080 instead of the usual port 80.

A Brief History of Port Numbers

The idea of port numbers started with the early internet, called the ARPANET. At first, they were called "socket numbers." These numbers helped identify different services on computers.

In 1972, computer scientists Vint Cerf and Jon Postel asked people to list how they were using these numbers. They wanted to create a clear catalog. This led to the first official assignments of port numbers to network services. Jon Postel suggested having a special person, a "czar," to manage this list.

The very first official port assignment was for the Telnet service, which received the number 1. Here are some of the first port assignments:

Port assignments in RFC 349
Port number Assignment
1 Telnet (for remote access)
3 File transfer
5 Remote job entry
7 Echo (for testing connections)
9 Discard (for throwing away data)

Today, the term "service name" is still linked to port numbers. Service names are text words that represent the numerical port numbers.

See also

Kids robot.svg In Spanish: Puerto de red para niños

kids search engine
Port (computer networking) Facts for Kids. Kiddle Encyclopedia.