Network Engineer · Module 01 · Addressing
IPv4 addressing
Lesson 6 of 13
- 01The OSI model
- 02The TCP/IP model
- 03Encapsulation
- 04Frames and MAC addresses
- 05ARP
- 06IPv4 addressing
- 07Subnetting
- 08IPv6 basics
- 09TCP and UDP
- 10Network components and topologies
- 11WAN concepts
- 12Wireless principles
- 13Virtualization and cloud basics
Every device on an IP network needs an address — but an IPv4 address isn't just an ID. It carries two pieces of information at once: which network the device is on, and which host it is on that network. Routers only care about the first part.
32 bits, four octets
An IPv4 address is 32 bits long. To make it readable, we split it into four 8-bit octets and write each one in decimal, separated by dots.
192.168.10.25/24
192
168
10
25
- Subnet mask
- 255.255.255.0
- Network address
- 192.168.10.0
- Broadcast
- 192.168.10.255
- Usable hosts
- 254
The prefix length (/24) says how many bits, counted from the left, belong to the network. The remaining bits identify the host.
- With
/24, the first three octets are the network:192.168.10. - The last octet,
25, is this host. - Every device on this LAN shares
192.168.10— that's how they know they can talk directly.
Network, broadcast and usable hosts
Two addresses in every subnet are reserved:
- the network address — all host bits set to 0 (
192.168.10.0) - the broadcast address — all host bits set to 1 (
192.168.10.255)
Everything in between can be assigned to devices. With 8 host bits, that's 2⁸ − 2 = 254 usable hosts.
The prefix doesn't have to fall on an octet boundary. Here's a /26: two more bits move to the network side, and the subnet shrinks.
172.16.5.130/26
172
16
5
130
- Subnet mask
- 255.255.255.192
- Network address
- 172.16.5.128
- Broadcast
- 172.16.5.191
- Usable hosts
- 62
Why routers care
When a packet leaves a host, each router compares the destination's network bits with its routing table and forwards the packet one hop closer. The host bits only matter on the final network.
Configure it on a Cisco router
R1> enableR1# configure terminalR1(config)# interface g0/0R1(config-if)# ip address 192.168.10.1 255.255.255.0R1(config-if)# no shutdownR1(config-if)# endR1# show ip interface briefInterface IP-Address OK? Method Status ProtocolGigabitEthernet0/0 192.168.10.1 YES manual up upIn the lab, you'll address a small topology in Packet Tracer and verify connectivity with ping.
Lab files
- lab-ipv4-basic
Log in to download the lab files for this lesson. Log in