IPv4 Addresses & Subnets

• This lesson focuses on wired networks. Wireless networks have other network components that are not covered here


IPv4 Addresses

• IPv4 stands for Internet Protocol version 4
• It is a core protocol used for Internet communication that was introduced in 1983
• An IPv4 address is composed of four octets. Each decimal value is separated by a dot, so it's sometimes known as dotted decimal notation
• Each octet is made up of eight bits, and each bit can be a value of 1 or 0

• Each group of 8 bits forms a byte. An IP address is always 4 bytes long or 32 bits (8 bits times 4 = 32 bits)


Binary Numbers

• A binary number is a number expressed in the base-two or binary numeral system, which only uses two symbols, zero (0) and one (1)

Decimal Value1286432168421
Byte1000 00000100 00000010 00000001 00000000 10000000 01000000 00100000 0001
Base 22^72^62^52^42^32^22^12^0

• If you add all of the values, you'll notice that the maximum value is 255

Convert decimal to binary values

• The process is to look at the decimal value and then determine which binary values need to be added together to equal the decimal value

Decimal Value82517184226254
Base 22^32^4 + 2^3 + 2^02^4 + 2^02^7 + 2^5 + 2^4 + 2^32^7 + 2^6 + 2^5 + 2^12^7 + 2^6 + 2^5 + 2^4 + 2^3 + 2^2 + 2^1


IP Classes and Private IPs

• There are five classes of IP addresses
• Classes A, B, and C are available for public use
• Class D is used specifically for multicast addresses
• Class E is reserved for research and development and is not available for public use

Address classBit pattern of first byteFirst byte decimal rangeHost assignment range in dotted decimal
A0xxxxxxx1 to 1271.0.0.1 to
B10xxxxxx128 to 191128.0.0.1 to
C110xxxxx192 to 223192.0.0.1 to
D1110xxxx224 to 239224.0.0.1 to
E11110xxx240 to 255240.0.0.1 to


Private IP Addresses

• Classes A, B, and C each have a range of IP addresses reserved for internal use
• Private IP addresses cannot be used on the public Internet

Address classPrivate network IDNetwork address range
A10. to
B172.16.0.0172.16.0.0 to
C192.168.0.0192.168.0.0 to

• There are three reasons why private IP addresses exist:
1) Public IP addresses are not free. Using private IP addresses saves money
2) There is a finite number of public IPv4 addresses, and they are running out
3) Private IP addresses offer a level of security because that IP address is not visible from the Internet


Translating private IP addresses to public

• Devices using private IP address are able to access the Internet via Network Address Translation (NAT) and Port Address Translation (PAT)
• NAT maps your device's private IP address to a public IP address


Subnet Masks

• Subnets are subdivided networks based on teams or business departments etc.
• The subnet provides a specific range of IP addresses for a group of hosts use
• The mask divides an IP address into an extended network address and a host address
• In a valid subnet mask, network portions are set to 1 and host portions are set to 0
• Each address class has a default subnet mask, as shown in the following table

ClassNetwork bitsHost bitsDecimal address rangeSubnet mask
A8 bits24 bits1 to 127255.0.0.0
B16 bits16 bits128 to 191255.255.0.0
C24 bits8 bits192 to 223255.255.255.0
DReservedReserved224 to 239N/A
EReservedReserved240 to 255N/A

Class1st octet2nd octet3rd octet4th octet
Class ANetworkHostHostHost
Class BNetworkNetworkHostHost
Class CNetworkNetworkNetworkHost


CIDR Notation

• CIDR stands for Classless Inter-Domain Routing, and is a way of specifying the subnet mask for an IP address
• CIDR notation simplifies subnet notation. In CIDR notation, the number of subnet mask bits is converted into a single digit, which appears after the IP address



Configure Subnets

• On the network, there can be up to 28 (256) available subnet addresses
• Two IP addresses are in use by default: is the network address is the broadcast address
• Therefore, there are 254 (256 - 2) host IP addresses available, and the range of addresses available for hosts would be to
• For example, you may have a class C network that is used by 8 departments of 20 people each
Network Bits = 3
▪ 8 departments → 8 subnets (2 ^ 3)
Host Bits = 5
▪ Each subnet needs 20 hosts (2 ^ 5)
◇ Default Class C subnet mask: 11111111.11111111.11111111.00000000 (/24)
◇ Modified subnet mask for this example: 11111111.11111111.11111111.11100000 (/27)
• The following table lists the network address, broadcast address, and available host address range for each subnet

SubnetNetwork addressBroadcast addressAvailable host address range
Subnet 1192.168.2.0192.168.2.31192.168.2.1 to
Subnet 2192.168.2.32192.168.2.63192.168.2.33 to
Subnet 3192.168.2.64192.168.2.95192.168.2.65 to
Subnet 4192.168.2.96192.168.2.127192.168.2.97 to
Subnet 5192.168.2.128192.168.2.159192.168.2.129 to
Subnet 6192.168.2.160192.168.2.191192.168.2.161 to
Subnet 7192.168.2.192192.168.2.223192.168.2.193 to
Subnet 8192.168.2.224192.168.2.255192.168.2.225 to

• Designating bits to create subnets reduces the number of hosts available for each subnet