<s>
In	O
computer	B-Architecture
networking	I-Architecture
,	O
a	O
port	O
or	O
port	B-Protocol
number	I-Protocol
is	O
a	O
number	O
assigned	O
to	O
uniquely	O
identify	O
a	O
connection	O
endpoint	O
and	O
to	O
direct	O
data	O
to	O
a	O
specific	O
service	O
.	O
</s>
<s>
At	O
the	O
software	O
level	O
,	O
within	O
an	O
operating	B-General_Concept
system	I-General_Concept
,	O
a	O
port	O
is	O
a	O
logical	O
construct	O
that	O
identifies	O
a	O
specific	O
process	B-Operating_System
or	O
a	O
type	O
of	O
network	B-General_Concept
service	I-General_Concept
.	O
</s>
<s>
A	O
port	O
at	O
the	O
software	O
level	O
is	O
identified	O
for	O
each	O
transport	B-Architecture
protocol	I-Architecture
and	O
address	O
combination	O
by	O
the	O
port	B-Protocol
number	I-Protocol
assigned	O
to	O
it	O
.	O
</s>
<s>
The	O
most	O
common	O
transport	B-Architecture
protocols	I-Architecture
that	O
use	O
port	B-Protocol
numbers	I-Protocol
are	O
the	O
Transmission	B-Protocol
Control	I-Protocol
Protocol	I-Protocol
(	O
TCP	O
)	O
and	O
the	O
User	B-Protocol
Datagram	I-Protocol
Protocol	I-Protocol
(	O
UDP	O
)	O
;	O
those	O
port	B-Protocol
numbers	I-Protocol
are	O
16-bit	O
unsigned	B-Algorithm
numbers	I-Algorithm
.	O
</s>
<s>
A	O
port	B-Protocol
number	I-Protocol
is	O
always	O
associated	O
with	O
a	O
network	B-Protocol
address	I-Protocol
of	O
a	O
host	O
,	O
such	O
as	O
an	O
IP	B-Protocol
address	I-Protocol
,	O
and	O
the	O
type	O
of	O
transport	B-Architecture
protocol	I-Architecture
used	O
for	O
communication	O
.	O
</s>
<s>
Specific	O
port	B-Protocol
numbers	I-Protocol
are	O
reserved	O
to	O
identify	O
specific	O
services	O
so	O
that	O
an	O
arriving	O
packet	B-Protocol
can	O
be	O
easily	O
forwarded	O
to	O
a	O
running	O
application	O
.	O
</s>
<s>
For	O
this	O
purpose	O
,	O
port	B-Protocol
numbers	I-Protocol
lower	O
than	O
1024	O
identify	O
the	O
historically	O
most	O
commonly	O
used	O
services	O
and	O
are	O
called	O
the	O
well-known	O
port	B-Protocol
numbers	I-Protocol
.	O
</s>
<s>
Higher-numbered	O
ports	O
are	O
available	O
for	O
general	O
use	O
by	O
applications	O
and	O
are	O
known	O
as	O
ephemeral	B-Protocol
ports	I-Protocol
.	O
</s>
<s>
Ports	O
provide	O
a	O
multiplexing	B-Architecture
service	O
for	O
multiple	O
services	O
or	O
multiple	O
communication	O
sessions	O
at	O
one	O
network	B-Protocol
address	I-Protocol
.	O
</s>
<s>
In	O
the	O
client	B-Operating_System
–	I-Operating_System
server	I-Operating_System
model	I-Operating_System
of	O
application	O
architecture	O
,	O
multiple	O
simultaneous	O
communication	O
sessions	O
may	O
be	O
initiated	O
for	O
the	O
same	O
service	O
.	O
</s>
<s>
For	O
TCP	O
and	O
UDP	O
,	O
a	O
port	B-Protocol
number	I-Protocol
is	O
a	O
16-bit	O
unsigned	B-Algorithm
integer	O
,	O
thus	O
ranging	O
from	O
0	O
to	O
65535	O
.	O
</s>
<s>
For	O
TCP	O
,	O
port	B-Protocol
number	I-Protocol
0	O
is	O
reserved	O
and	O
cannot	O
be	O
used	O
,	O
while	O
for	O
UDP	O
,	O
the	O
source	O
port	O
is	O
optional	O
and	O
a	O
value	O
of	O
zero	O
means	O
no	O
port	O
.	O
</s>
<s>
A	O
process	B-Operating_System
associates	O
its	O
input	O
or	O
output	O
channels	O
via	O
an	O
internet	B-Protocol
socket	I-Protocol
,	O
which	O
is	O
a	O
type	O
of	O
file	B-Application
descriptor	I-Application
,	O
associated	O
with	O
a	O
transport	B-Architecture
protocol	I-Architecture
,	O
a	O
network	B-Protocol
address	I-Protocol
such	O
as	O
an	O
IP	B-Protocol
address	I-Protocol
,	O
and	O
a	O
port	B-Protocol
number	I-Protocol
.	O
</s>
<s>
A	O
socket	O
is	O
used	O
by	O
a	O
process	B-Operating_System
to	O
send	O
and	O
receive	O
data	O
via	O
the	O
network	O
.	O
</s>
<s>
The	O
operating	B-General_Concept
system	I-General_Concept
's	O
networking	B-Architecture
software	I-Architecture
has	O
the	O
task	O
of	O
transmitting	O
outgoing	O
data	O
from	O
all	O
application	O
ports	O
onto	O
the	O
network	O
,	O
and	O
forwarding	O
arriving	O
network	B-Protocol
packets	I-Protocol
to	O
processes	O
by	O
matching	O
the	O
packet	B-Protocol
's	O
IP	B-Protocol
address	I-Protocol
and	O
port	B-Protocol
number	I-Protocol
to	O
a	O
socket	O
.	O
</s>
<s>
For	O
TCP	O
,	O
only	O
one	O
process	B-Operating_System
may	O
bind	O
to	O
a	O
specific	O
IP	B-Protocol
address	I-Protocol
and	O
port	O
combination	O
.	O
</s>
<s>
Common	O
application	O
failures	O
,	O
sometimes	O
called	O
port	O
conflicts	O
,	O
occur	O
when	O
multiple	O
programs	O
attempt	O
to	O
use	O
the	O
same	O
port	B-Protocol
number	I-Protocol
on	O
the	O
same	O
IP	B-Protocol
address	I-Protocol
with	O
the	O
same	O
protocol	O
.	O
</s>
<s>
Applications	O
implementing	O
common	O
services	O
often	O
use	O
specifically	O
reserved	O
well-known	O
port	B-Protocol
numbers	I-Protocol
for	O
receiving	O
service	O
requests	O
from	O
clients	O
.	O
</s>
<s>
This	O
process	B-Operating_System
is	O
known	O
as	O
listening	O
,	O
and	O
involves	O
the	O
receipt	O
of	O
a	O
request	O
on	O
the	O
well-known	O
port	O
potentially	O
establishing	O
a	O
one-to-one	O
server-client	O
dialog	O
,	O
using	O
this	O
listening	O
port	O
.	O
</s>
<s>
In	O
many	O
operating	B-General_Concept
systems	I-General_Concept
special	O
privileges	O
are	O
required	O
for	O
applications	O
to	O
bind	O
to	O
these	O
ports	O
because	O
these	O
are	O
often	O
deemed	O
critical	O
to	O
the	O
operation	O
of	O
IP	O
networks	O
.	O
</s>
<s>
Conversely	O
,	O
the	O
client	O
end	O
of	O
a	O
connection	O
typically	O
uses	O
a	O
high	O
port	B-Protocol
number	I-Protocol
allocated	O
for	O
short	O
term	O
use	O
,	O
therefore	O
called	O
an	O
ephemeral	B-Protocol
port	I-Protocol
.	O
</s>
<s>
IANA	O
is	O
responsible	O
for	O
the	O
global	O
coordination	O
of	O
the	O
DNS	B-Protocol
root	O
,	O
IP	B-Protocol
addressing	I-Protocol
,	O
and	O
other	O
protocol	O
resources	O
.	O
</s>
<s>
This	O
includes	O
the	O
registration	O
of	O
commonly	O
used	O
TCP	B-Protocol
and	I-Protocol
UDP	I-Protocol
port	I-Protocol
numbers	O
for	O
well-known	O
internet	O
services	O
.	O
</s>
<s>
The	O
port	B-Protocol
numbers	I-Protocol
are	O
divided	O
into	O
three	O
ranges	O
:	O
the	O
well-known	O
ports	O
,	O
the	O
registered	O
ports	O
,	O
and	O
the	O
dynamic	O
or	O
private	O
ports	O
.	O
</s>
<s>
One	O
common	O
use	O
for	O
this	O
range	O
is	O
for	O
ephemeral	B-Protocol
ports	I-Protocol
.	O
</s>
<s>
Transport-layer	B-Architecture
protocols	I-Architecture
,	O
such	O
as	O
the	O
Transmission	B-Protocol
Control	I-Protocol
Protocol	I-Protocol
(	O
TCP	O
)	O
and	O
the	O
User	B-Protocol
Datagram	I-Protocol
Protocol	I-Protocol
(	O
UDP	O
)	O
,	O
transfer	O
data	O
using	O
protocol	B-Protocol
data	I-Protocol
units	I-Protocol
(	O
PDUs	O
)	O
.	O
</s>
<s>
For	O
TCP	O
,	O
the	O
PDU	O
is	O
a	O
segment	O
,	O
and	O
for	O
UDP	O
it	O
is	O
a	O
datagram	B-Protocol
.	O
</s>
<s>
Both	O
protocols	O
use	O
a	O
header	B-General_Concept
field	O
for	O
indicating	O
the	O
source	O
and	O
destination	O
port	B-Protocol
numbers	I-Protocol
.	O
</s>
<s>
The	O
port	B-Protocol
numbers	I-Protocol
are	O
encoded	O
in	O
the	O
transport	B-Architecture
protocol	I-Architecture
packet	B-General_Concept
header	I-General_Concept
,	O
and	O
they	O
can	O
be	O
readily	O
interpreted	O
not	O
only	O
by	O
the	O
sending	O
and	O
receiving	O
hosts	O
but	O
also	O
by	O
other	O
components	O
of	O
the	O
networking	O
infrastructure	O
.	O
</s>
<s>
In	O
particular	O
,	O
firewalls	B-Application
are	O
commonly	O
configured	O
to	O
differentiate	O
between	O
packets	B-Protocol
based	O
on	O
their	O
source	O
or	O
destination	O
port	B-Protocol
numbers	I-Protocol
.	O
</s>
<s>
Port	B-Protocol
forwarding	I-Protocol
is	O
an	O
example	O
application	O
of	O
this	O
.	O
</s>
<s>
This	O
is	O
accomplished	O
with	O
the	O
Simple	B-Protocol
Mail	I-Protocol
Transfer	I-Protocol
Protocol	I-Protocol
(	O
SMTP	B-Protocol
)	O
.	O
</s>
<s>
A	O
standard	O
SMTP	B-Protocol
service	O
application	O
listens	O
on	O
TCP	B-Protocol
port	I-Protocol
25	I-Protocol
for	O
incoming	O
requests	O
.	O
</s>
<s>
The	O
second	O
service	O
is	O
usually	O
either	O
the	O
Post	B-Protocol
Office	I-Protocol
Protocol	I-Protocol
(	O
POP	O
)	O
or	O
the	O
Internet	B-Protocol
Message	I-Protocol
Access	I-Protocol
Protocol	I-Protocol
(	O
IMAP	B-Protocol
)	O
which	O
is	O
used	O
by	O
email	B-Protocol
client	I-Protocol
applications	O
on	O
users	O
 '	O
personal	O
computers	O
to	O
fetch	O
email	O
messages	O
from	O
the	O
server	O
.	O
</s>
<s>
The	O
POP	O
service	O
listens	O
on	O
TCP	B-Protocol
port	I-Protocol
number	O
110	O
.	O
</s>
<s>
Both	O
services	O
may	O
be	O
running	O
on	O
the	O
same	O
host	O
computer	O
,	O
in	O
which	O
case	O
the	O
port	B-Protocol
number	I-Protocol
distinguishes	O
the	O
service	O
that	O
was	O
requested	O
by	O
a	O
remote	O
computer	O
,	O
be	O
it	O
a	O
user	O
's	O
computer	O
or	O
another	O
mail	O
server	O
.	O
</s>
<s>
While	O
the	O
listening	O
port	B-Protocol
number	I-Protocol
of	O
a	O
server	O
is	O
well	O
defined	O
(	O
IANA	O
calls	O
these	O
the	O
well-known	O
ports	O
)	O
,	O
the	O
client	O
's	O
port	B-Protocol
number	I-Protocol
is	O
often	O
chosen	O
from	O
the	O
dynamic	B-Protocol
port	I-Protocol
range	O
(	O
see	O
below	O
)	O
.	O
</s>
<s>
In	O
some	O
applications	O
,	O
the	O
clients	O
and	O
the	O
server	O
each	O
use	O
specific	O
port	B-Protocol
numbers	I-Protocol
assigned	O
by	O
the	O
IANA	O
.	O
</s>
<s>
A	O
good	O
example	O
of	O
this	O
is	O
DHCP	B-Protocol
in	O
which	O
the	O
client	O
always	O
uses	O
UDP	O
port	O
68	O
and	O
the	O
server	O
always	O
uses	O
UDP	O
port	O
67	O
.	O
</s>
<s>
Port	B-Protocol
numbers	I-Protocol
are	O
sometimes	O
seen	O
in	O
web	O
or	O
other	O
uniform	O
resource	O
locators	O
(	O
URLs	O
)	O
.	O
</s>
<s>
By	O
default	O
,	O
HTTP	B-Protocol
uses	O
port	O
80	O
and	O
HTTPS	B-Protocol
uses	O
port	B-Protocol
443	I-Protocol
,	O
but	O
a	O
URL	O
like	O
http://www.example.com:8080/path/	O
specifies	O
that	O
the	O
web	B-Application
browser	I-Application
connects	O
instead	O
to	O
port	B-Protocol
8080	I-Protocol
of	O
the	O
HTTP	B-Protocol
server	O
.	O
</s>
<s>
The	O
concept	O
of	O
port	B-Protocol
numbers	I-Protocol
was	O
established	O
by	O
the	O
early	O
developers	O
of	O
the	O
ARPANET	O
in	O
informal	O
cooperation	O
of	O
software	O
authors	O
and	O
system	O
administrators	O
.	O
</s>
<s>
The	O
term	O
port	B-Protocol
number	I-Protocol
was	O
not	O
yet	O
in	O
use	O
.	O
</s>
<s>
Today	O
,	O
network	B-Protocol
socket	I-Protocol
refers	O
to	O
a	O
related	O
but	O
distinct	O
concept	O
,	O
namely	O
the	O
internal	O
address	O
of	O
an	O
endpoint	O
used	O
only	O
within	O
the	O
node	O
.	O
</s>
<s>
Network	O
administrators	O
were	O
asked	O
to	O
submit	O
a	O
note	O
or	O
place	O
a	O
phone	O
call	O
,	O
"	O
describing	O
the	O
function	O
and	O
socket	O
numbers	O
of	O
network	B-General_Concept
service	I-General_Concept
programs	O
at	O
each	O
HOST	O
"	O
.	O
</s>
<s>
This	O
catalog	O
was	O
subsequently	O
published	O
as	O
RFC	O
433	O
in	O
December	O
1972	O
and	O
included	O
a	O
list	O
of	O
hosts	O
and	O
their	O
port	B-Protocol
numbers	I-Protocol
and	O
the	O
corresponding	O
function	O
used	O
at	O
each	O
host	O
in	O
the	O
network	O
.	O
</s>
<s>
This	O
first	O
registry	O
function	O
served	O
primarily	O
as	O
documentation	O
of	O
usage	O
and	O
indicated	O
that	O
port	B-Protocol
number	I-Protocol
usage	O
was	O
conflicting	O
between	O
some	O
hosts	O
for	O
"	O
useful	O
public	O
services	O
"	O
.	O
</s>
<s>
The	O
document	O
promised	O
a	O
resolution	O
of	O
the	O
conflicts	O
based	O
on	O
a	O
standard	O
that	O
Postel	O
had	O
published	O
in	O
May	O
1972	O
in	O
RFC	O
349	O
,	O
in	O
which	O
he	O
first	O
proposed	O
official	O
assignments	O
of	O
port	B-Protocol
numbers	I-Protocol
to	O
network	B-General_Concept
services	I-General_Concept
and	O
suggested	O
a	O
dedicated	O
administrative	O
function	O
,	O
which	O
he	O
called	O
a	O
czar	O
,	O
to	O
maintain	O
a	O
registry	O
.	O
</s>
<s>
The	O
Telnet	B-Protocol
service	O
received	O
the	O
first	O
official	O
assignment	O
of	O
the	O
value	O
1	O
.	O
</s>
<s>
In	O
the	O
early	O
ARPANET	O
,	O
the	O
AEN	O
was	O
also	O
called	O
a	O
socket	O
name	O
,	O
and	O
was	O
used	O
with	O
the	O
Initial	O
Connection	O
Protocol	O
(	O
ICP	O
)	O
,	O
a	O
component	O
of	O
the	O
Network	B-Protocol
Control	I-Protocol
Protocol	I-Protocol
(	O
NCP	O
)	O
.	O
</s>
<s>
Today	O
the	O
terminology	O
service	O
name	O
is	O
still	O
closely	O
connected	O
with	O
port	B-Protocol
numbers	I-Protocol
,	O
the	O
former	O
being	O
text	O
strings	O
used	O
in	O
some	O
network	O
functions	O
to	O
represent	O
a	O
numerical	O
port	B-Protocol
number	I-Protocol
.	O
</s>
