Q1. What is network address?
Answer: We can view network and host addresses in two ways:
1) Network-ID and Host-ID
An IP address is made of two parts, the left part is network ID, the right part is host ID.
For example, in 188.8.131.52, if 100 is a network ID, then 3.4.5 is a host ID. If 100.3 is network ID, then 4.5 is a host ID.
2) Network-address and host-address. Let's look at two examples:
IP-address Network-ID Host-ID Network-address Host-address Mask
184.108.40.206/8 100 4.5.6 220.127.116.11 18.104.22.168 / 8
22.214.171.124/16 150.1 2.3 126.96.36.199 188.8.131.52 / 16
Note: Network mask is presented as / m where m is a 2-digit decimal number between 8 ~ 31.
Note: IP, network, and host addresses are usually presented with masks.
Q2. What is mask?
Answer. IP uses network mask to break up a 32-bit IP-address into network-ID and host-ID. Network-address is made of network-ID bits on the left and 0 bits on the right.
For example, for 184.108.40.206/16, 16 is the network mask, 150.1 is network-ID, 220.127.116.11/16 is network-address, 2.3 is host-ID, 18.104.22.168/16 is host-address. Network-address is used by routers to forward packets. Host address is used to distinguish hosts in the same network.
Q3. Why network addresses?
Answer: When numbers are too many, we use hierarchical structure to manage them. For example, telephone number are structured as.
For example, 086.021.1234.5678 is a number in China, Shanghais. The voice message is switched by country code, city code, and prefix. Structured phone numbers are much easier to switch than flat 10-digit phone numbers.
Internet faces a similar situation. There are nearly 4.2 billion addresses (IP has 32 bits. Or 2 ^ 32 individual addresses.) Routers use routing tables to foreword packets. Obviously, it's much easier for router to handle structured addresses than 4 billion flat ones.
IP's solution is to use network-addresses to forward packets, not individual ones. Network mask breaks an address into a network-ID and a host-ID. Routing tables use network addresses, not IP addresses.
– 22.214.171.124/8 network has 16,777,216 addresses. In a routing table, (126.96.36.199/8, next hop interface) says: forward packets with the same destination network to the same next hop interface.
– 188.8.131.52/16 network has 65,536 addresses. In a routing table, (184.108.40.206/16, next hop interface) takes care of forwarding 65,536 individual addresses in 220.127.116.11/16 network.
– 18.104.22.168/16 network has 65,536 IP addresses. In a routing table, (22.214.171.124/16, next hop interface) takes care of forwarding 65,536 individual address in 126.96.36.199/16 network.
– 188.8.131.52/24 has 256 IP addresses. In a routing table, (184.108.40.206/24, next hop interface) forwards 256 IP addresses in 220.127.116.11 network to the next hop interface.
Q4. How present mask in decimal?
Answer. Present mask the same way as IP address. For example.
/ 8 is presented as 255.0.0.0.
/ 16 is presented as 255.255.0.0.
/ 24 is presented as 255.255.255.0
Q5. Why mask length is multiple of 8 but?
Answer: There are two type of IP addressing schemes: classful and classless. What we've talked so far is classful. Classless IP address can use mask of any length. See next tutorials for details.
This article is the FAQ of an interactive animation. You can play this animation listed under External links.