Understanding Basic Networking
Finding Your IP Address
Use the following commands based on your OS:
# Windows
ipconfig
# Linux
ifconfig
What is an IP Address?
An IP Address is a unique number assigned to every device within a network.
IP Address = Network ID + Host ID
| Part |
Description |
| Network ID |
Identifies the network — same for all devices in a network |
| Host ID |
Uniquely identifies each device within the network |
IP Address Versions
| Version |
Bits |
Format |
Range per octet |
| IPv4 |
32-bit |
x.x.x.x (4 octets) |
0 to 255 |
| IPv6 |
128-bit |
Hexadecimal groups |
— |
Example IPv4 address:
192.168.0.110
Subnet Mask & Network Sizing
How to Read a Subnet Mask
- Octets with 255 → part of the Network ID
- Octets with 0 → part of the Host ID
Example 1 — /24 Subnet
IP Address : 192.168.0.110
Subnet Mask: 255.255.255.0
─────────────
Network ID : 192.168.0
Host ID : 110
Host bits : 1 octet = 8 bits
Network size = 2^8 − 2 = 254 usable hosts
Example 2 — /16 Subnet
IP Address : 192.168.0.110
Subnet Mask: 255.255.0.0
─────────────
Network ID : 192.168
Host ID : 0.110
Host bits : 2 octets = 16 bits
Network size = 2^16 − 2 = 65,534 usable hosts
Why subtract 2?
| Reserved Address |
Meaning |
| All 0s in host ID |
Network address |
| All 1s in host ID |
Broadcast address |
Formula: Usable hosts = 2^n − 2 where n = number of host bits
Common Subnet Sizes
| Subnet Mask |
Host Bits |
Max Usable Hosts |
255.0.0.0 |
24 bits |
16,777,214 |
255.255.0.0 |
16 bits |
65,534 |
255.255.255.0 |
8 bits |
254 |
Network Communication & Router
┌──────────────┐ ┌────────┐ ┌──────────────┐
│ Device A │◄──────►│ Router │◄──────►│ Device B │
│ 192.168.0.10 │ │(GW) │ │ 10.0.0.5 │
│ Network: .0 │ └────────┘ │ Network: 10. │
└──────────────┘ └──────────────┘
| Concept |
Description |
| Same Network |
Devices can communicate directly |
| Different Network |
Traffic must pass through a Router |
| Router |
Forwards packets between different networks |
| Default Gateway |
The IP address of your router |