TCP/IP Ports

Ports are used to identify processes running in the applications on a host.

Let's assume we have two applications running on one PC that require TCP/IP communications. Assume one is a web browser and the other is an email client.

Both applications send and receive packets with the same IP address, so how does the Transport layer differentiate a web browser packet from an email packet?

The answer is port numbers.

ports.JPG

TCP/IP "Well-Known" Ports

“Well-Known" ports are port numbers that have been reserved for common applications, typically server applications. The port numbers assigned to these server applications have to be known by the client’s Transport layer, so they can add the correct destination port number to messages. Clients know that servers will be listening for their requests at these reserved port numbers. This graphic shows some examples of these Well-Known port numbers.

well_known_ports.JPG
Click image to enlarge.

The well known port numbers are assigned by IANA which is the Internet Assigned Numbers Authority. IANA is the same group that manages the DNS Root and IP addresses.


Client side port numbers are generated and assigned by the Transport layer. They could be any number from 1024 to 65535. These port numbers are typically allocated for short term use and are referred to as “Ephemeral or Dynamic Ports”.

ephemeral_ports.JPG
Click image to enlarge.

20th Annual
Microchip MASTERs Conference 2016
Register now - Deadline: July 29

JW Marriott Desert Ridge Resort-Phoenix, AZ

© 2016 Microchip Technology, Inc.
Information contained on this site regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.