Lecture - 05 - Chapter 2 - 03 Sep 2024
Lecture - 05 - Chapter 2 - 03 Sep 2024
Lecture - 05 - Chapter 2 - 03 Sep 2024
Lecture 05
Chapter 2
Port Numbers
Then what is the difference between Process ID (PID) & Port Numbers?
A process ID is a unique identifier assigned to a running process in an operating system. It is used to track and manage
individual processes. On the other hand, a port number is a communication endpoint in a network, used to identify a specific
process or service running on a computer. Port numbers are essential for enabling communication between different processes or
services over a network. While a process ID is specific to a single operating system instance, a port number is used for network
communication between multiple systems.
Let's consider a scenario where you have a web server running on your computer. The web server is a process that listens for
incoming requests on a specific port number, typically port 80 for HTTP or port 443 for HTTPS.
In this case, the process ID (PID) is a unique identifier assigned to the running instance of the web server process. The operating
system assigns this PID to keep track of the process, manage its resources, and allow interaction with it.
The port number, on the other hand, is used to identify the specific service or process within the network. When the web server
process starts, it binds itself to a specific port number (e.g., port 80). This means that the web server process will listen for incoming
requests on that port number.
When a client (such as a web browser) wants to access a webpage hosted by your web server, it initiates a connection to your
computer's IP address on port 80. The operating system receives this incoming network request on port 80 and forwards it to the web
server process associated with that port.
The web server process, identified by its PID, receives the incoming request, processes it, and sends back the requested webpage to
the client over the same connection.
So, in summary, the PID identifies the running instance of the web server process on your computer, while the port number (in this
case, port 80) allows incoming network requests to be directed to the correct process for handling and responding to those requests.
Addressing processes
▪ to receive messages, process ▪ identifier includes both IP address
must have identifier and port numbers associated with
▪ host device has unique 32-bit process on host.
IP address ▪ example port numbers:
▪ Q: does IP address of host on • HTTP server: 80
which process runs suffice for • mail server: 25
identifying the process? ▪ to send HTTP message to
▪ A: no, many processes gaia.cs.umass.edu web server:
can be running on • IP address: 128.119.245.12
same host • port number: 80
▪ more shortly…
Application Layer: 2-7
Sockets (A combination of port number and IP address)
application application
socket controlled by
process process app developer
transport transport
network network controlled
link by OS
link Internet
physical physical
protocol://host-name[:port]/directory-
path/resource
time time
Non-persistent HTTP response time = 2RTT+ file transmission time
Application Layer: 2-25
Non Persistent HTTP Shortcomings
❖ Most Web pages have multiple objects
▪ e.g., HTML file and a bunch of embedded images
No Retake
Be on time