DEV Community

Piyush Bhoi
Piyush Bhoi

Posted on • Edited on

Networking Basics: IP, Subnet, CIDR, and Ports Explained Simply

Networking is the backbone of how computers and devices talk to each other — whether at home, in offices, or on the internet. If you’re new to IT, cloud computing, or DevOps, understanding some key networking concepts is essential. This blog will break down IP addresses, subnetting, CIDR, and ports in simple terms with everyday examples, so you get a solid grasp of how networks work.

What is an IP Address?

Think of an IP address like a home address for your device on a network. Every device connected to the internet or a local network has a unique IP address that helps identify and communicate with it.

There are two common types:

1.) IPv4: The most common format, looks like 192.168.1.10 — four sets of numbers separated by dots.

2.) IPv6: A newer format to handle more devices, looks like 2001:0db8:85a3::8a2e:0370:7334.

Example:
Your laptop might have the IP 192.168.1.10 and your printer might have 192.168.1.20. Since they’re on the same network, they can easily share files or print documents.

What is Subnetting?

Subnetting is like dividing a big school (network) into smaller classes (subnets). It breaks down a large network into smaller, manageable parts.

Why subnet?

  • Saves IP addresses
  • Improves security by isolating groups of devices
  • Helps control network traffic

There are two types of IP addresses:


Type     Example            Where Used
Private  192.168.0.0/16     Inside your home or office
Public   8.8.8.8 (Google)   On the internet

Enter fullscreen mode Exit fullscreen mode

Example:
Your WiFi router assigns private IPs like 192.168.1.5 to your phone and laptop, while the router itself has a public IP from your ISP to connect to the internet.

Image description

What is CIDR?

CIDR stands for Classless Inter-Domain Routing. It’s a way to describe how many IP addresses are inside a subnet.

You write it like this: IP/Prefix — for example, 192.168.1.0/24.

The /24 part tells you how big the subnet is.

  • /24 means 256 IP addresses (254 usable for devices)
  • /16 means 65,536 IP addresses
  • /30 means 4 IP addresses (2 usable)

How to calculate?

Formula: 2^(32 - Prefix)
Example: /28 means 2^(32-28) = 16 IP addresses in that subnet.

What are Ports?

Think of ports as doors on your device that apps use to send or receive data.

Each service or app uses a specific port number to communicate.

Port Type Range Common Examples
Well-known 0 – 1023 HTTP (80), HTTPS (443), SSH (22)
Registered 1024 – 49151 MySQL (3306), RDP (3389)
Dynamic/Private 49152 – 65535 Temporary ports for apps

Example:

  • When you visit a website, your browser connects to the server on port 80 (HTTP) or 443 (HTTPS).
  • When you remotely login to a server using SSH, it uses port 22.

Quick Tips to Remember

  • Public IP: Used to communicate over the internet.
  • Private IP: Used inside your local network.
  • Subnetting: Splits big networks into smaller parts.
  • CIDR: Shows how many IPs are in a subnet.
  • Ports: Identify which service or app is communicating.

Networking is a big topic, but starting with these basics sets a strong foundation for cloud, DevOps, and IT careers. Keep exploring, practicing, and soon you’ll be comfortable working with more advanced network setups.

Top comments (0)