What are ports in an Operating System and how processes use these ports for communication? | Sololearn: Learn to code for FREE!

0

What are ports in an Operating System and how processes use these ports for communication?

Are ports similar to the mailboxes (which are used in message passing systems in a indirect communication)?

6/29/2021 3:41:28 PM

SATYAM SINGH

2 Answers

New Answer

+1

The equivalent of what you call mailboxes would be sockets in OS design. Ports are a way to connect a process on a local machine to a process on another machine. The easiest to understand example would be port forwarding when using torrenting software. You have a port open on your network, on which you have a bittorrent client running. By opening this port, you're allowing other computers to connect to your bittorrent client. Using the same principle, a web server (e.g. the one serving google.com) is allowing you to connect to it's software on port 80, which your browser uses to display the website.

+1

Ports may refer to hardware ports. Some cpus have seperate input output address spaces for hardware IO e.g. intel x86, ia32, and x64. The operating system may access these hardware ports, usually via the BIOS, to perform printing, serial comms, reading the real time clock (RTC) etc. CPUs that do not have a seperate IO port address space use memory mapped hardware.