Free Certification Practice Tests and Study Guides
Join Us! | Login | Help




Ports, Port Numbers, and Sockets


If there's one thing that can be a bit confusing to many Network+ certification exam candidates, it's the concept of ports and sockets. Well, it was confusing to me when I got started with computer certifications! Let's take a look at ports and sockets, and why we need them in the first place.

Past Network+ exam tutorials have focused on how two PCs start communicating, but what we've got to keep in mind is that host PCs may and probably will have several different kinds of communications going on at the same time. A single PC may be sending email, receiving a Telnet request, and accessing the Internet at the same time. These conversations have to kept separate.. but how?

Through the use of ports, that's how. Each potential type of conversation a host can have is preassigned a port number, and these port numbers allow different types of communications to take place over the same physical cable by keeping them logically separated.

Let's go back to that PC we were talking about. If the PC is using SMTP for email communications, it will use port 25. At the same time, the host will be using port 23 for Telnet and port 80 to access the web via HTTP. The same physical cable is in use, but the communications are kept logically separate by use of port numbers.

A socket is simply the host's IP address followed by a colon and the port number in use. If the previously mentioned host had an IP address of 10.1.1.1, the socket number for SMTP would be 10.1.1.1:25, 10.1.1.1:23 for Telnet, and 10.1.1.1:80 for HTTP.

The range of port numbers is quite large - 0 through 65,535 - and the 0 - 1023 range is known as the well-known port numbers. Don't worry, you don't have to memorize all of them! As you gain more and more experience with networks, you'll be surprised how many of these you remember without even thinking about it. In the meantime, for both your Network+ and CCNA exams as well as working with real-world networks, it's a good idea to know this list of often-used ports.

File Transfer Protocol uses both ports 20 and 21.

Telnet uses port 23.

Simple Mail Transfer Protocol (SMTP) uses port 25.

Domain Name Service (DNS) uses port 53.

HyperText Transfer Protocol (HTTP) uses port 80, while the secure version of HTTP, HTTPS, uses port 443.

If you're familiar with these protocols, that's great - and if you're not, just look for upcoming Network+ exam tutorials!

About the Author:
Chris Bryant, CCIE #12933, is the owner of The Bryant Advantage, home of free CCNA and CCNP tutorials! Pass the CCNA exam with Chris Bryant!





IT Showcase