0% found this document useful (0 votes)
27 views

Port (Computer Networking) - Wikipedia

Port numbers are used to identify connection endpoints and direct data to specific network services. At the software level, a port identifies a specific process or network service. Common transport protocols like TCP and UDP use 16-bit port numbers ranging from 0 to 65535. Specific port numbers are reserved to identify common services, like port 80 for HTTP. Ports provide multiplexing for multiple processes or communication sessions at a single network address.

Uploaded by

badri495170
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views

Port (Computer Networking) - Wikipedia

Port numbers are used to identify connection endpoints and direct data to specific network services. At the software level, a port identifies a specific process or network service. Common transport protocols like TCP and UDP use 16-bit port numbers ranging from 0 to 65535. Specific port numbers are reserved to identify common services, like port 80 for HTTP. Ports provide multiplexing for multiple processes or communication sessions at a single network address.

Uploaded by

badri495170
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Port (computer

networking)

In comput er net working, a por t or por t number is a number assigned t o uniquely ident ify a
connect ion endpoint and t o direct dat a t o a specific service. At t he soft ware level, wit hin an
operat ing syst em, a port is a logical const ruct t hat ident ifies a specific process or a t ype of
net work service. A port at t he soft ware level is ident ified for each t ransport prot ocol and
address combinat ion by t he port number assigned t o it . The most common t ransport
prot ocols t hat use port numbers are t he Transmission Cont rol Prot ocol (TCP) and t he User
Dat agram Prot ocol (UDP); t hose port numbers are 16-bit unsigned numbers.

A port number is always associat ed wit h a net work address of a host , such as an IP address,
and t he t ype of t ransport prot ocol used for communicat ion. It complet es t he dest inat ion or
originat ion address of a message. Specific port numbers are reserved t o ident ify specific
services so t hat an arriving packet can be easily forwarded t o a running applicat ion. For t his
purpose, port numbers lower t han 1024 ident ify t he hist orically most commonly used
services and are called t he well-known port numbers. Higher-numbered port s are available for
general use by applicat ions and are known as ephemeral port s.

Port s provide a mult iplexing service for mult iple services or mult iple communicat ion sessions
at one net work address. In t he client –server model of applicat ion archit ect ure, mult iple
simult aneous communicat ion sessions may be init iat ed for t he same service.
Port number
For TCP and UDP, a port number is a 16-bit unsigned int eger, t hus ranging from 0 t o 65535. For
TCP, port number 0 is reserved and cannot be used, while for UDP, t he source port is opt ional
and a value of zero means no port. A process associat es it s input or out put channels via an
int ernet socket , which is a t ype of file descript or, associat ed wit h a t ransport prot ocol, a
net work address such as an IP address, and a port number. This is known as binding. A socket
is used by a process t o send and receive dat a via t he net work. The operat ing syst em's
net working soft ware has t he t ask of t ransmit t ing out going dat a from all applicat ion port s
ont o t he net work, and forwarding arriving net work packet s t o processes by mat ching t he
packet 's IP address and port number t o a socket . For TCP, only one process may bind t o a
specific IP address and port combinat ion. Common applicat ion failures, somet imes called port
conflicts , occur when mult iple programs at t empt t o use t he same port number on t he same
IP address wit h t he same prot ocol.

Applicat ions implement ing common services oft en use specifically reserved well-known port
numbers for receiving service request s from client s. This process is known as listening, and
involves t he receipt of a request on t he well-known port pot ent ially est ablishing a one-t o-
one server-client dialog, using t his list ening port . Ot her client s may simult aneously connect t o
t he same list ening port ; t his works because a TCP connect ion is ident ified by a t uple
consist ing of t he local address, t he local port , t he remot e address, and t he remot e port .[1]
The well-known port s are defined by convent ion overseen by t he Int ernet Assigned Numbers
Aut horit y (IANA). In many operat ing syst ems special privileges are required for applicat ions t o
bind t o t hese port s because t hese are oft en deemed crit ical t o t he operat ion of IP net works.
Conversely, t he client end of a connect ion t ypically uses a high port number allocat ed for
short -t erm use, t herefore called an ephemeral port .

Common port numbers


IANA is responsible for t he global coordinat ion of t he DNS root , IP addressing, and ot her
prot ocol resources. This includes t he regist rat ion of commonly used TCP and UDP port
numbers for well-known int ernet services.

The port numbers are divided int o t hree ranges: t he well-known ports , t he registered ports ,
and t he dynamic or private ports .
The well-known port s (also known as system ports ) are t hose numbered from 0 t hrough 1023.
The requirement s for new assignment s in t his range are st rict er t han for ot her regist rat ions.[2]

Notable well-known por t numbers

Number Assignment

20 File Transfer Prot ocol (FTP) Dat a Transfer

21 File Transfer Prot ocol (FTP) Command Cont rol

22 Secure Shell (SSH) Secure Login

23 Telnet remot e login service, unencrypt ed t ext messages

25 Simple Mail Transfer Prot ocol (SMTP) email delivery

53 Domain Name Syst em (DNS) service

67, 68 Dynamic Host Configurat ion Prot ocol (DHCP)

80 Hypert ext Transfer Prot ocol (HTTP) used in t he World Wide Web

110 Post Office Prot ocol (POP3)

119 Net work News Transfer Prot ocol (NNTP)

123 Net work Time Prot ocol (NTP)

143 Int ernet Message Access Prot ocol (IMAP) Management of digit al mail

161 Simple Net work Management Prot ocol (SNMP)

194 Int ernet Relay Chat (IRC)

443 HTTP Secure (HTTPS) HTTP over TLS/SSL

546, 547 DHCPv6 IPv6 version of DHCP

The regist ered port s are t hose from 1024 t hrough 49151. IANA maint ains t he official list of
well-known and regist ered ranges.[3]

The dynamic or privat e port s are t hose from 49152 t hrough 65535. One common use for t his
range is for ephemeral port s.

Network behavior
Transport -layer prot ocols, such as t he Transmission Cont rol Prot ocol (TCP) and t he User
Dat agram Prot ocol (UDP), t ransfer dat a using prot ocol dat a unit s (PDUs). For TCP, t he PDU is
a segment , and for UDP it is a dat agram. Bot h prot ocols use a header field for indicat ing t he
source and dest inat ion port numbers. The port numbers are encoded in t he t ransport prot ocol
packet header, and t hey can be readily int erpret ed not only by t he sending and receiving
host s but also by ot her component s of t he net working infrast ruct ure. In part icular, firewalls
are commonly configured t o different iat e bet ween packet s based on t heir source or
dest inat ion port numbers. Port forwarding is an example applicat ion of t his.

Port scanning
The pract ice of at t empt ing t o connect t o a range of port s in sequence on a single host is
commonly known as port scanning. This is usually associat ed eit her wit h malicious cracking
at t empt s or wit h net work administ rat ors looking for possible vulnerabilit ies t o help prevent
such at t acks. Port connect ion at t empt s are frequent ly monit ored and logged by host s. The
t echnique of port knocking uses a series of port connect ions (knocks) from a client
comput er t o enable a server connect ion.

Examples
An example of t he use of port s is t he delivery of email. A server used for sending and
receiving email generally needs t wo services. The first service is used t o t ransport email t o
and from ot her servers. This is accomplished wit h t he Simple Mail Transfer Prot ocol (SMTP).
A st andard SMTP service applicat ion list ens on TCP port 25 for incoming request s. The
second service is usually eit her t he Post Office Prot ocol (POP) or t he Int ernet Message
Access Prot ocol (IMAP) which is used by email client applicat ions on users' personal
comput ers t o fet ch email messages from t he server. The POP service list ens on TCP port
number 110. Bot h services may be running on t he same host comput er, in which case t he port
number dist inguishes t he service t hat was request ed by a remot e comput er, be it a user's
comput er or anot her mail server.

While t he list ening port number of a server is well defined (IANA calls t hese t he well-known
port s), t he client 's port number is oft en chosen from t he dynamic port range (see below). In
some applicat ions, t he client s and t he server each use specific port numbers assigned by t he
IANA. A good example of t his is DHCP in which t he client always uses UDP port 68 and t he
server always uses UDP port 67.
Use in URLs
Port numbers are somet imes seen in web or ot her uniform resource locat ors (URLs). By
default , HTTP uses port 80 and HTTPS uses port 443, but a URL like
http://www.example.com:8080/path/ specifies t hat t he web browser connect s
inst ead t o port 8080 of t he HTTP server.

History
The concept of port numbers was est ablished by t he early developers of t he ARPANET in
informal cooperat ion of soft ware aut hors and syst em administ rat ors. The t erm port number
was not yet in use. It was preceded by t he use of t he t erm socket number in t he early
development st ages of t he net work. A socket number for a remot e host was a 40-bit
quant it y.[4] The first 32 bit s were similar t o t oday's IPv4 address, but at t he t ime t he most -
significant 8 bit s were t he host number. The least -significant port ion of t he socket number
(bit s 33 t hrough 40) was an ent it y called Another Eightbit Number, abbreviat ed AEN.[5] Today,
network socket refers t o a relat ed but dist inct concept , namely t he int ernal address of an
endpoint used only wit hin t he node.

On March 26, 1972, Vint Cerf and Jon Post el called for document ing t he t hen-current usages
and est ablishing a socket number cat alog in RFC 322. Net work administ rat ors were asked t o
submit a not e or place a phone call, "describing t he funct ion and socket numbers of net work
service programs at each HOST".[6] This cat alog was subsequent ly published as RFC 433 in
December 1972 and included a list of host s and t heir port numbers and t he corresponding
funct ion used at each host in t he net work. This first regist ry funct ion served primarily as
document at ion of usage and indicat ed t hat port number usage was conflict ing bet ween
some host s for "useful public services".[5] The document promised a resolut ion of t he
conflict s based on a st andard t hat Post el had published in May 1972 in RFC 349, in which he
first proposed official assignment s of port numbers t o net work services and suggest ed a
dedicat ed administ rat ive funct ion, which he called a czar, t o maint ain a regist ry.[7] The 256
values of t he AEN were divided int o t he following ranges:
AEN ranges

Por t number range Assignment

0 through 63 Net work-wide st andard funct ions

64 through 127 Host -specific funct ions

128 through 239 Reserved for fut ure use

240 through 255 Any experiment al funct ion

The Telnet service received t he first official assignment of t he value 1. In det ail, t he first set
of assignment s was:[7]

Por t assignments in RFC 349 (https://datatracker.ietf.org/doc/html/rfc349)

Por t number Assignment

1 Telnet

3 File t ransfer

5 Remot e job ent ry

7 Echo

9 Discard

In t he early ARPANET, t he AEN was also called a socket name,[8] and was used wit h t he Init ial
Connect ion Prot ocol (ICP), a component of t he Net work Cont rol Prot ocol (NCP).[9][10] NCP
was t he forerunner of t he modern Int ernet prot ocols. Today t he t erminology service name is
st ill closely connect ed wit h port numbers, t he former being t ext st rings used in some
net work funct ions t o represent a numerical port number.

References

1. Postel, John. Transport Control Protocol


(https://datatracker.ietf.org/doc/html/rfc7
93) . doi:10.17487/RFC0793 (https://doi.
org/10.17487%2FRFC0793) . RFC 793 (ht
tps://datatracker.ietf.org/doc/html/rfc79
3) . Retrieved 1 January 2023.

2. Michelle Cotton; Lars Eggert; et al.


(August 2011). Internet Assigned
Numbers Authority (IANA) Procedures for
the Management of the Service Name
and Transport Protocol Port Number
Registry (https://datatracker.ietf.org/doc/
html/rfc6335) . IETF.
doi:10.17487/RFC6335 (https://doi.org/1
0.17487%2FRFC6335) . BCP 165. RFC
6335 (https://datatracker.ietf.org/doc/ht
ml/rfc6335) .

3. "Port Numbers" (https://www.iana.org/as


signments/service-names-port-numbers/
service-names-port-numbers.xhtml) .
Internet Assigned Numbers Authority
(IANA).
4. Crocker, S. (16 March 1970). Protocol
Notes (https://datatracker.ietf.org/doc/ht
ml/rfc36) . doi:10.17487/RFC0036 (http
s://doi.org/10.17487%2FRFC0036) . RFC
36 (https://datatracker.ietf.org/doc/html/r
fc36) .

5. Postel, J.; Neigus, N. (22 December


1972). Socket number list (https://datatra
cker.ietf.org/doc/html/rfc433) .
doi:10.17487/RFC0433 (https://doi.org/1
0.17487%2FRFC0433) . RFC 433 (https://
datatracker.ietf.org/doc/html/rfc433) .

6. Cerf, V.; Postel, J. (26 March 1972). Well


Known Socket Numbers (https://datatrac
ker.ietf.org/doc/html/rfc322) .
doi:10.17487/RFC0322 (https://doi.org/1
0.17487%2FRFC0322) . RFC 322 (https://
datatracker.ietf.org/doc/html/rfc322) .
7. Postel, J. (30 May 1972). Proposed
Standard Socket Numbers (https://datatra
cker.ietf.org/doc/html/rfc349) .
doi:10.17487/RFC0349 (https://doi.org/1
0.17487%2FRFC0349) . RFC 349 (https://
datatracker.ietf.org/doc/html/rfc349) .

8. Shoshani, A.; Harslem, E. (14 July 1971).


Initial Connection Protocol--Reviewed (htt
ps://datatracker.ietf.org/doc/html/rfc19
7) . doi:10.17487/RFC0197 (https://doi.or
g/10.17487%2FRFC0197) . RFC 197 (http
s://datatracker.ietf.org/doc/html/rfc19
7) .

9. NIC 7104, ARPANET Protocol Handbook


10. Postel, Jon; Feinler, E. (1978). ARPANET
Protocol Handbook. Menlo Park, CA:
Network Information Center.
Retrieved from
"https://en.wikipedia.org/w/index.php?
title=Port_(computer_networking)&oldid=118432
2827"

This page was last edited on 9 November 2023,


at 18:24 (UTC). •
Content is available under CC BY-SA 4.0 unless
otherwise noted.

You might also like