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

192.168.48.64
Value1921684864
Octal/binary11000000101010000011000001000000


65.1.36.254
Value65136254
Octal/binary01000001000000010010010011111110


• 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
Binary0000100000011001`00010001101110001110001011111110
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 127.255.255.254
B10xxxxxx128 to 191128.0.0.1 to 191.255.255.254
C110xxxxx192 to 223192.0.0.1 to 223.255.255.254
D1110xxxx224 to 239224.0.0.1 to 239.255.255.254
E11110xxx240 to 255240.0.0.1 to 255.255.255.255


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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.0.0.01.0.0.0 to 10.255.255.255
B172.16.0.0172.16.0.0 to 172.31.255.255
C192.168.0.0192.168.0.0 to 192.168.255.255


• 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
255000
11111111000
Class BNetworkNetworkHostHost
25525500
111111111111111100
Class CNetworkNetworkNetworkHost
2552552550
1111111111111111111111110


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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

images/153-1.png

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Configure Subnets



• On the network 207.21.54.0/24, there can be up to 28 (256) available subnet addresses
• Two IP addresses are in use by default:
207.21.54.0 is the network address
207.21.54.255 is the broadcast address
• Therefore, there are 254 (256 - 2) host IP addresses available, and the range of addresses available for hosts would be 207.21.54.1 to 207.21.54.254
• For example, you may have a class C network 192.168.2.7/27 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 192.168.2.30
Subnet 2192.168.2.32192.168.2.63192.168.2.33 to 192.168.2.62
Subnet 3192.168.2.64192.168.2.95192.168.2.65 to 192.168.2.94
Subnet 4192.168.2.96192.168.2.127192.168.2.97 to 192.168.2.126
Subnet 5192.168.2.128192.168.2.159192.168.2.129 to 192.168.2.158
Subnet 6192.168.2.160192.168.2.191192.168.2.161 to 192.168.2.190
Subnet 7192.168.2.192192.168.2.223192.168.2.193 to 192.168.2.222
Subnet 8192.168.2.224192.168.2.255192.168.2.225 to 192.168.2.254


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


Index