Cisco

Network Engineer · 01

Network Fundamentals

Lessons in this module ▾

Network Engineer · Module 01 · Addressing

IPv4 addressing

Lesson 6 of 13

  1. 01The OSI model
  2. 02The TCP/IP model
  3. 03Encapsulation
  4. 04Frames and MAC addresses
  5. 05ARP
  6. 06IPv4 addressing
  7. 07Subnetting
  8. 08IPv6 basics
  9. 09TCP and UDP
  10. 10Network components and topologies
  11. 11WAN concepts
  12. 12Wireless principles
  13. 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

Network — 24 bitsHost — 8 bits
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

Network — 26 bitsHost — 6 bits
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.

hop 1PC1192.168.1.10hop 2SW1VLAN 10hop 3R110.0.0.1hop 4R210.0.0.2hop 5SRV172.16.0.5
Each router forwards on the network portion; the host portion matters only at the destination LAN.

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        up

In 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