Q1. What is classless IP address?
Answer: Classless is also called IP subnetting. It divides classful network addresses into smaller networks (subnet). The rules are simple: – In classful addressing scheme, a 32 bit address is divided into Network ID and Host ID in 8-bIt boundary:
Class Network_ID Host_ID Examples……………..Leftmost_byte_range(a.b.c.d)
A……….8 bit……. 24 bit…..126.96.36.199, 188.8.131.52…………0~127
B………16 bit…… 16 bit……184.108.40.206, 220.127.116.11…..128~191
C……. 24 bit……… 8 bit…… 18.104.22.168, 22.214.171.124…192~223
– Classless IP allows more left bits for network ID (and fewer bits for host ID). The number of bits used by
network ID is called network mask. For example, a.b.c.d/m says “network ID is the leftmost m bit.” – Examples of classful and classless addresses:
IP address Mask Class? Network address Network ID Host ID Number of hosts in this network 126.96.36.199/8 /8 class A 188.8.131.52/8 100 4.5.6 16,777,216 184.108.40.206/16 /16 classless 220.127.116.11/16 100.4 5.6 65,536 18.104.22.168/24 /24 classless 22.214.171.124/24 100.4.5 6 256 126.96.36.199/25 /25 classless 188.8.131.52/25 184.108.40.206 6 128
Q2. Why classless?
Answer: Using fixed boundary to allocate bits for network ID and hosts ID results side effects: IP address starvation. Consider this example: A network has 100 computers to be connected to Internet. They are using a class C network 220.127.116.11/24. Then the network grows to 500 computers. It needs a class B network, say 18.104.22.168/16. However, 22.214.171.124/16 covers 65,536 class B IP addresses. This network only uses 500 of them. 65,036 IP addresses are wasted. This causes the shortage of IP address due classful addressing scheme’s fixed networ/host boundary. This problem can be solved by classless addressing. For example, 126.96.36.199/23 allows 512 host ID. It covers addresses 188.8.131.52~184.108.40.206).
Q3. How to subnetting and creates network ID crossing byte boundary?
Answer: Subnetting uses network mask to allocate leftmost bits for network ID. The rules are simple: – Start with a classful address (class A, B, or C). – Add more bits to the classful network ID bits. Class B uses leftmost 16 bits for network ID. Its mask is /16. With classless addressing, the network mask for class B derived network can be /16~.31. – For example,
220.127.116.11 is a class B network address. Its default mask is /16. It covers 65,536 addresses.
18.104.22.168/24 is a classless subnet derived from class B network. Its mask is /24 and contains 256 addresses.
22.214.171.124/25 is a classless subnet derived from a class B network. Its mask is /25 and has 128 addresses. The table below presents classful and classless addresses in binary form:
Network ID/Mask Binary form (32 bits) Network ID/class Number of host ID and range
– 126.96.36.199/16 is a class B address, network ID 150.1 (16 bit), contains 65,356 hosts, (188.8.131.52~184.108.40.206), Its binary presentation is 10010110. 00000001.00000000.00000000
– 220.127.116.11/24 is classless derived from class B, network ID 150.1.2 (24 bits), contains 256 host addresses (18.104.22.168~22.214.171.124 ). Its binary form is 10010110. 00000001.00000010.00000000.
– 126.96.36.199/25 is classless derived from class B, network ID is 188.8.131.52 (25 bit), contains 128 host addresses (184.108.40.206~220.127.116.11). its binary form is 10010110. 00000001.00000010.10000000
Q4. Can we subnetting to create 18.104.22.168/14? Answer: No. Subnetting starts with classful address scheme. 22.214.171.124 is a class B address (150 is within class B range: 128~191). Class B network mask is /16. Subnetting a class B network address can only use masks to reduce the size of network, or increase the mask. /16~/21 are allowed. /1~/15 are not allowed.
Q5. How does a router lookup a classless IP address?
Answer: Let’s use examples to explain router’s operations: 1) When R1 receives ping sent by Jack, it compares ping’s destination IP address (126.96.36.199/25) with destination networks listed in routing table.
– 188.8.131.52/8. 184.108.40.206/25’s left most 8 bit is 150, not 100. Not a match.
– 220.127.116.11/16. 18.104.22.168/25’s left most 16 bit is 150.1. It’s a match. R1 forwards ping to 22.214.171.124/16. 2) When R2 receives ping, it compares ping’s destination IP address (126.96.36.199/25) with routing table’s destination networks. -188.8.131.52/24: 184.108.40.206/25’s left most 24 bit is 150.1. 2, not 150.1.0. Not a match.
-220.127.116.11/24: 18.104.22.168/25’s left most 24 bit is 150.1. 2, not 150.1.1. Not a match.
-22.214.171.124/24: 126.96.36.199/25’s left most 24 bit is 150.1. 2. It’s a match. R2 forward ping to 188.8.131.52/24 network 3) When R3 receives ping, it compares ping’s destination IP address (184.108.40.206/25) with routing table. -220.127.116.11/25: 18.104.22.168/25’s left most 25 bit is 22.214.171.124 2, not 126.96.36.199, Not a match.
– 188.8.131.52/25: 184.108.40.206/25’s left most 25 bit is 220.127.116.11. A match. R3 forwards ping to Rose.
Note: This example is more clear if read together with topology from the companion simulation.
This article is the FAQ of an interactive simulation. You may get more clear concepts by playing the simulation with visualized topology, packets, table. It is located under External links.