Networking for Beginners – Tutorial 5
IPv4 Addressing & Subnetting Fundamentals
Public vs Private IP • Network ID • Host ID • Subnet Mask • CIDR • Default Gateway
Course: Networking for Beginners to Advanced
Lesson: 5 of 30
Introduction
Every device connected to a network requires an IP address. Whether it's a computer, Cisco switch, router, firewall, Hikvision IP camera, or NVR, each device must have a unique address to communicate.
In this lesson, you'll learn how IPv4 addressing works and how subnetting helps organize networks efficiently.
What is IPv4?
IPv4 (Internet Protocol Version 4) is the most widely used addressing system in computer networks.
An IPv4 address consists of 32 bits, divided into 4 octets.
Example
192.168.10.101
Each octet ranges from 0 to 255.
Example:
192 . 168 . 10 . 101
Binary Representation
Computers understand binary (0s and 1s), not decimal numbers.
Example:
| Decimal | Binary |
|---|---|
| 192 | 11000000 |
| 168 | 10101000 |
| 10 | 00001010 |
| 101 | 01100101 |
IPv4 Address:
192.168.10.101
Binary:
11000000.10101000.00001010.01100101
IPv4 Address Structure
An IP address has two parts:
- Network ID
- Host ID
Example:
192.168.10.101/24
Network ID Host ID 192.168.10 . 101
- Network ID identifies the network.
- Host ID identifies the individual device.
Network ID
The Network ID identifies the network to which devices belong.
Example:
192.168.10.0
All devices with addresses like:
192.168.10.10 192.168.10.20 192.168.10.30
belong to the same network.
Host ID
The Host ID identifies each device within the network.
Example:
| Device | Host |
|---|---|
| PC | 192.168.10.10 |
| Laptop | 192.168.10.20 |
| Printer | 192.168.10.30 |
| Camera | 192.168.10.101 |
| NVR | 192.168.10.201 |
Each device must have a unique Host ID.
Public IP Address
A Public IP is assigned by your Internet Service Provider (ISP) and is reachable from the Internet.
Example:
203.0.113.25
Uses:
- Websites
- Cloud Servers
- Remote VPN
- Public CCTV Access
Private IP Address
Private IP addresses are used inside local networks and are not routable on the public Internet.
Private IPv4 Ranges
| Class | Range |
|---|---|
| A | 10.0.0.0 – 10.255.255.255 |
| B | 172.16.0.0 – 172.31.255.255 |
| C | 192.168.0.0 – 192.168.255.255 |
Example:
192.168.10.101
This is a private IP commonly used for enterprise CCTV systems.
Public vs Private IP
| Feature | Public IP | Private IP |
|---|---|---|
| Internet Accessible | ✔ | ✘ |
| Assigned By | ISP | Local Administrator/DHCP |
| Used In | Internet | Home & Office Networks |
| Cost | Usually Included with ISP Service | Free |
What is a Subnet Mask?
A Subnet Mask tells devices which part of an IP address is the Network ID and which part is the Host ID.
Most common subnet mask:
255.255.255.0
Binary:
11111111.11111111.11111111.00000000
The first 24 bits are the network, and the remaining 8 bits are for hosts.
Common Subnet Masks
| CIDR | Subnet Mask | Usable Hosts |
|---|---|---|
| /24 | 255.255.255.0 | 254 |
| /25 | 255.255.255.128 | 126 |
| /26 | 255.255.255.192 | 62 |
| /27 | 255.255.255.224 | 30 |
| /28 | 255.255.255.240 | 14 |
| /29 | 255.255.255.248 | 6 |
| /30 | 255.255.255.252 | 2 |
What is CIDR?
CIDR (Classless Inter-Domain Routing) is a shorthand notation for subnet masks.
Example:
| CIDR | Subnet Mask |
|---|---|
| /24 | 255.255.255.0 |
| /25 | 255.255.255.128 |
| /26 | 255.255.255.192 |
Instead of writing:
255.255.255.0
you can write:
192.168.10.101/24
What is a Default Gateway?
The Default Gateway is the device that forwards traffic to other networks.
In most networks, the gateway is the router or a Layer 3 switch.
Example:
| Device | IP |
|---|---|
| PC | 192.168.10.20 |
| Camera | 192.168.10.101 |
| NVR | 192.168.10.201 |
| Cisco Layer 3 Switch | 192.168.10.1 |
Gateway:
192.168.10.1
How Data Travels
Example:
Computer:
192.168.10.20
Camera:
192.168.10.101
Since both devices are in the 192.168.10.0/24 network, they communicate directly through the switch.
If the destination is:
192.168.20.100
the data is sent to the default gateway, which routes it to the correct network.
Basic Subnetting Example
Suppose you have:
Network
192.168.10.0/24
You need two separate departments.
Subnet 1
192.168.10.0/25
Hosts:
192.168.10.1 ↓ 192.168.10.126
Broadcast:
192.168.10.127
Subnet 2
192.168.10.128/25
Hosts:
192.168.10.129 ↓ 192.168.10.254
Broadcast:
192.168.10.255
Enterprise CCTV IP Planning
For a 9-floor building:
| VLAN | Floor | Network |
|---|---|---|
| 101 | Floor 1 | 192.168.101.0/24 |
| 102 | Floor 2 | 192.168.102.0/24 |
| 103 | Floor 3 | 192.168.103.0/24 |
| 104 | Floor 4 | 192.168.104.0/24 |
| 105 | Floor 5 | 192.168.105.0/24 |
| 106 | Floor 6 | 192.168.106.0/24 |
| 107 | Floor 7 | 192.168.107.0/24 |
| 108 | Floor 8 | 192.168.108.0/24 |
| 109 | Floor 9 | 192.168.109.0/24 |
| 200 | NVRs | 192.168.200.0/24 |
| 300 | Management | 192.168.300.0/24 |
This structure makes it easier to manage cameras, troubleshoot issues, and improve network security.
Cisco Configuration Example
Assign a management IP address to a VLAN interface:
configure terminal interface vlan 300 ip address 192.168.300.1 255.255.255.0 no shutdown exit ip routing end write memory
Practical Exercise
Question: What is the Network ID for the IP address 192.168.50.25/24?
Answer:
- Network ID: 192.168.50.0
- Host ID: 25
- Default Gateway (example): 192.168.50.1
Summary
After completing this lesson, you should understand:
- ✅ IPv4 address structure
- ✅ Network ID and Host ID
- ✅ Public vs. Private IP addresses
- ✅ Subnet masks
- ✅ CIDR notation
- ✅ Default gateway
- ✅ Basic subnetting
- ✅ IP planning for Cisco enterprise networks and Hikvision CCTV systems
Next Tutorial (Lesson 6)
Subnetting Made Easy – Learn Binary, VLSM & Real-World Examples
In the next lesson, you'll learn:
- Binary numbers explained
- How subnetting works step by step
- Variable Length Subnet Masking (VLSM)
- Calculating network ranges
- Broadcast addresses
- Usable host addresses
- Practical subnetting exercises
- Designing efficient IP addressing for Cisco enterprise networks and Hikvision CCTV deployments
0 Comments