Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
  • Mikalai Zaikin

Query Regarding Using Port Numbers As Identifiers for Applications

Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello all,
I read in Head First JSP and Servlets that ports 0 to 65535 are used as a logical connection to a server-side running application and we are not supposed to use ports 0-1023(well-known ports) for our custom-based applications.That's fine. However, don't you think that port numbers are finite? What if I develop a new protocol (suppose )that does not have an equivalent port number between 0-65535?My question is this--How do TCP port numbers handle or can they really assign a new port number to an entirely new protocol? Are all these numbers 0-65535 currently been assigned to protocols? Can they be made greater than 65535 in the near future when the Web will expand manifold? Kindly guide me. Thank you all in advance for clarifying my weird queries.
Posts: 2856
Firefox Browser Fedora Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This question is by no means related to the SCWCD.
Please CarefullyChooseOneForum
One of the moderators will move it to an appropriate place.
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Internet Assigned Numbers Authority assignes the numbers. From rfc4340:

Port numbers are divided into three ranges. The Well Known Ports are
those from 0 through 1023, the Registered Ports are those from 1024
through 49151, and the Dynamic and/or Private Ports are those from
49152 through 65535. Well Known and Registered Ports are intended
for use by server applications that desire a default contact point on
a system. On most systems, Well Known Ports can only be used by
system (or root) processes or by programs executed by privileged
users, while Registered Ports can be used by ordinary user processes
or programs executed by ordinary users. Dynamic and/or Private Ports
are intended for temporary use, including client-side ports, out-of-
band negotiated ports, and application testing prior to registration
of a dedicated port; they MUST NOT be registered.

As for the range, it depends on a protocol. TCP and UDP have 2 bytes for each port number (source port, destination port)
[ July 24, 2008: Message edited by: Irina Goble ]
A day job? In an office? My worst nightmare! Comfort me tiny ad!
We need your help - Coderanch server fundraiser
    Bookmark Topic Watch Topic
  • New Topic