- More efficient use of increasingly scarce IPv4 addresses.
- Greater use of hierarchy in address assignments (prefix aggregation), lowering the overhead of the Internet-wide routing (routes aggregation)
|
Softpanorama |
May the source be with you, but remember the KISS principle ;-)
Softpanorama Search
|
| News | Internet Protocol | Recommended Links | Quiz | Humor | Etc |
Class Range Allocation
A 1-126 N.H.H.H
B 128-191 N.N.H.H
C 192-223 N.N.N.H
D 224-239 Not applicable
N=Network
H=Host
IPv4 addresses are 32 bits in length. Each 8-bit field, or octet, is represented
by a decimal number between 0 and 255 (for example, 129.150.182.31).
Each IPv4 address identifies a network (network number) and a unique interface on that network (host number) Originally, the 32-bit IPv4 address consisted simply of an 8-bit network number field (which specified the particular network a host was attached to), and a rest field, which gave the address of the host within that network. This format was picked before the advent of local area networks (LANs), when there were only a few, large, networks such as the ARPANET. This resulted in a very low count (256) of network numbers being available, and very early on, as LANs started to appear, it became obvious that that would not be enough.
As a kludge, the definition of IP addresses was changed to allow three different
sizes of the network number field (and the associated rest field),
as specified in the table below:
| Class | Leading Value | Network Number Bits | Rest Bits |
|---|---|---|---|
| Class A | 0 | 7 | 24 |
| Class B | 10 | 14 | 16 |
| Class C | 110 | 21 | 8 |
| Class D (multicast) | 1110 | ||
| Class E (reserved) | 1111 |
The value of the high-order bits (first three bits) determine which portion of the IPv4 address is the network number and which portion is the host number. That means that netmask was essentially was encoded in the first three bits.
The network numbers are divided into three classes: Class A, Class B, and Class
C. This addressing scheme is called classful IPv4 addressing.
A system uses unicast addresses when it needs to communicate with another system. There are three "old" classes of unicast addresses: Class A, Class B, and Class C.
Class A addresses are for very large networks and provide 16,777,214 host addresses. Class A address is split by the first byte with the first byte defining network number and that last three bytes defining host number.
The first bit in class A address is always 0. This allows for up to 128 Class A networks but two (10 and 127) are reserved for special purposes. Zero network also is has special purpose.
For example 10.102.2.113 is class A unicast address
The Internet Assigned Numbers Authority (IANA) has reserved two class A network for special purposes:
The remaining 24 bits define the host number.
Class B addresses are for large networks and provide 65,534 host addresses. In class B address both network number and host number occupies two bytes. The first two bits of class B address are 10, those two bits and the next 14 bits define the network number, and the remaining 16 bits define the host number. This allows for 16,384 Class B networks.
The IANA has reserved 172.16.0.0–172.31.255.255 for private networks. These addresses are not routed in the Internet. Refer to RFC 1918 for additional details.
Class C addresses are for small-sized and mid-sized networks and provide 254 host addresses. In class C address network number occupies first three bytes and host number occupies the last byte. The first three bits are 110, those three and the next 21 bits define the network number, and. the remaining eight bits define the host number. This allows for up to 2,097,152 Class C networks.
The IANA has reserved 192.168.0.0–192.168.255.255 for private networks. These addresses are not routed in the Internet. Refer to RFC 1918 for additional details.
Early allocations of IP addresses by IANA were in some cases not made very efficiently, which contributed to the problem. (However, the commonly-held notion that some organizations unfairly or unnecessarily received class A networks is a canard; most such allocations date to the period before the introduction of address classes, when the only thing available was what later became known as "class A" network number.)
A broadcast address is the address that reaches all systems on the network. A broadcast means that data is simultaneously sent to all of the hosts on the local area network (LAN). In Solaris, the default broadcast address is an address that has a host number of all ones when represented in binary. An example of a broadcast address is 128.50.255.255. You use the ifconfig utility to configure an interface’s broadcast address.
Multicasting is a very efficient way to send large amounts of data to many systems at the same time. A multicast address identifies interfaces that belong to a specific multicast group. Packets that are sent to a multicast address are received by all interfaces that are associated with the multicast address.
If the first four bits are 1110, which makes the first field an integer value between 224 and 239, the address is a multicast address. The remaining 28 bits comprise a group identification number for a specific multicast group. An IPv4 multicast address is a destination address for one or more hosts, while a Class A, B, or C address is an address for an individual host. The IPv4 multicast address maps to an Ethernet multicast address so that the network interface listens for a multicast traffic. The low-order 23 bits of the IPv4 multicast address are placed into the low-order 23 bits of the Ethernet multicast address. Therefore, an IPv4 multicast address of
224.0.0.1 maps to 01:00:5e:00:00:01.
The Internet is composed of many routers that interconnect different networks. Each router interface must be on a unique network and must have a unique address. Assigning different IP addresses to different networks is required because of the IP addressing scheme required by routers. Subnetting and VLSMs are two ways of dividing an assigned network address into multiple, smaller networks for use within an organization. These smaller networks are referred to as subnetworks.
Subnetting
You can divide a network into subnetworks to:
The basic idea of subnetting is to divide the standard host number field into two parts: the subnet number and the host number on that subnet. That leads us from two level hierarchy (NetworkNumber/HostNumber) to three level hierarchy (NetworkNumber/SubnetNumber/HostNumber).
The /etc/inet/netmasks file is linked to the /etc/netmasks file. The file enables the permanent assignment of a netmask. When the system reboots, this file is consulted before the configuration of the network interfaces. The /etc/rcSd/S30network.sh script consults the /etc/inet/netmasks file at run level S. At run level 2, the /etc/rc2.d/S72inetsvc script can recalculate the netmask using the Network Information Service (NIS) maps or Network Information Service Plus (NIS+) databases. For every network that is subnetted, an individual line is entered into this file. The fields in the /etc/inet/netmasks file list the network number and the netmask definition.
An example of an entry for a subnetted Class B network is:
172.16.0.0 255.255.255.0
An example of an entry for a subnetted Class C network is:
192.168.43.0 255.255.255.240
If a netmask is not specified in the /etc/inet/netmasks file for the system to use during system startup, a default Class A, B, or C netmask is assumed. You can also configure an interface’s netmask from the command line by using the ifconfig utility.
# ifconfig qfe0 192.168.1.1 netmask 0xffffff00 up
or
# ifconfig qfe0 192.168.1.1 netmask 255.255.255.0 up
RFC 950 recommends the use of contiguous subnet masks. A contiguous subnet mask is one that only uses contiguous high-order bits. For example:
11111111 11111111 11111111 11110000
Noncontiguous Netmasks Although RFC 950 recommends only the use of contiguous subnet masks, nothing prevents the use of noncontiguous subnet masks. For example:
11111111 11111111 11111111 01001010
However, using noncontiguous subnet masks makes administration more difficult. Avoid the use of noncontiguous subnet masks if at all possible.
One of the major problems with supporting only a single subnet mask across a given network number is that once the mask is selected, it locks the organization into a fixed number of fixed-sized subnets. For example, a Class B subnet that is masked with 255.255.252.0 yields additional 64 subnets with 1024 hosts per subnet. If you need 1028 subnets with some as large as 1000 hosts and some as small as 64 hosts you are out of luck. Similar to the IP space separation into A,B, and C classes VLSM permits organization to use subnets with different number of hosts.
In 1985, RFC 950 specified how an IP network could use multiple subnet masks. The key idea here is similar to idea of class A,B,and C network recursively applied to host part of the address. Variable-Length Subnet Masking (VLSM) is the same concept as CIDR, but the term is now obsolite. Because the old class distinctions are ignored, the new system was called classless routing. This led to the original system being called, classful routing.
When an IP network is assigned more than one subnet mask, it is considered a network with VLSMs because the extended-network numbers have different lengths at each subnet level. To provide the address mask information the ICMP protocol was extended by adding a new pair of ICMP message types, "Address Mask Request" and "Address Mask Reply", analogous to the "Information Request" and "Information Reply" ICMP messages (type 17 and 18 messages).
In key idea was that netmask becomes the part that is nessesary for the interpretation of the address and can be specified by the number of the bit in network part of the address, for example 10.10.10.10/24 mean C class network (24-bit network part of of the address and 8-bit host part of the address)
Two of the main advantages to assign more than one subnet mask to a given IP network number are:
An example of a VLSM entry is:
12.0.0.0 255.255.0.0
12.3.0.0 255.255.255.0
12.3.254.0 255.255.255.224
Note – VLSM subnet masks’ syntax has been recognized since the Solaris 2.6 OE.
VLSM Subnetting, documented in RFC 950, originally referred to the subdivision of a class-based network into subnetworks, but it was generalized for the subdivision of the whole IP addess space into more flexible CIDR blocks instead of fixed A,B and C networks.
CIDR allows single routing entries to refer either to the larger block or to its individual constituents. This permits a single, general routing entry to be used through most of the Internet, more specific routes only being required for routers in the subnetted block.
A subnet mask is a 32-bit number that determines how an IP address is split into network and host portions, on a bitwise basis. For example, 255.255.0.0 is a standard class B subnet mask, since the first two bytes are all ones (network), and the last two bytes are all zeros (host). In a subnetted network, the network portion is extended. For example, a subnet mask of 255.255.255.0 would subnet a class B address space using its third byte. Using this scheme, the first two bytes of an IP address would identify the class B network, the next byte would identify the subnet within that network, and the final byte would select an individual host. Since subnet masks are used on a bit-by-bit basis, masks like 255.255.240.0 (4 bits of subnet; 12 bits of host) are perfectly normal.
In a traditional subnetted network, several restrictions apply, which have been lifted by CIDR. However, if older, non-CIDR routing protocols (such as RIP version 1) are in use, these restrictions must still be observed.
Based on this assumption, a router can exchange subnet routes with other
routers within the network. Since the subnet masks are identical across the
network, the routers will interpret these routes in the same manner. However,
routers not attached to the subnetted network can't interpret these subnet routes,
since they lack the subnet mask. Therefore, subnet routes are not relayed to
routers on other networks. This leads to our second restriction.
The Internet is composed of many routers that interconnect different networks. Each router interface must be on a unique network and must have a unique address. Assigning different IP addresses to different networks is required because of the IP addressing scheme required by routers. Subnetting and VLSMs are two ways of dividing an assigned network address into multiple, smaller networks for use within an organization. These smaller networks are referred to as subnetworks. VLSM, conceptually a stepping stone from subnetting to CIDR, lifted the restrictions of subnetting by relaying subnet information through routing protocols.
Classless Inter-Domain Routing - Wikipedia, the free encyclopedia
Q1. A subnet’s mask is 255.255.255.224. How many nodes can this subnet have?
A: 254-224=30
Q2. A subnet’s mask is 255.255.255.240. How many nodes can this subnet have?
A: 254-40=14
Q3. A subnet’s mask is 255.255.255.192. How many nodes can this subnet have?
A: 254-192=62
Q4. You have a class C subnet. You would like divide it up into 30 more subnets by "subnetting" ? What would be the subnet mask?
A: 255.255.255.248
The length of subnet section to accomodate 30 subnet should be 5 bits. That means that host contans 3 bits
Mask = 256-8=248
Q5. You have a class C subnet. You would like to divide it up into 10 more Subnets by "subnetting" . How many hosts can you have per subnet?
A: 14
Host part will be 4 bits. Max hosts per subnet = 2^4 -2 = 14
Q6. You have a class C subnet. You would like divide it up into 12 more subnets by "subnetting". However you also have to have at least 13 hosts per subnet. Can you do it ?
A: Yes.
See explanation to the answer to Q5
Q7. You have a class C subnet and need 48 nodes per subnet. How many subnets can you have ?
A: 2
# max hosts/subnet = 2^N -2 , that means host part should be 6 bits
That means M can be at most 2 bits
# max subnets = 2^M -2 = 2
Q8. Your class C network has been subnet-ed. Mask for the new subnets is 255.255.255.224. How many subnets and how many nodes per subnet can you have ?
A: 254-224=30
Q9. You have divided your class C network into 2 subnets. Your subnet mask is 255.255.255.192. What are the ranges of IPs for your subnets ? Your Network address before subnetting was 200.252.144.0
A: 200.252.144.65-200.252.144.126 and 200.252.144.129-200.252.144.190
explanation: M=2 N=6
The First range = 2^6+1 to 2^7-2 = 65 to 126
The Second range = 65+2^6 to 126+2^6 = 129 to 190
Q10. Your previous Network Administrator had subnneted your class C network into many subnets. Only info you have is that one of the IP range was 200.252.144.33 through 128.252.144.46. How many subnets did he make ? what was the mask ?
A: 14, 255.255.255.240
explanation: We see that the subnet has 14 nodes. That means N=4 (2^4-2 = 16).
M= 8-4 =4 . Number of Subnets = 2^M -2 = 14.
Mask = 128+64+32+16 (add 4 bits) 255.255.255.240
Q11. You have a class B subnet. You would like divide it up into 30 more subnets by "subnetting" ? What would be the subnet mask ?
A: 255.255.248.0
Refering to the formulas in the "SUBNETTING FORMULAS" section :
M = 5 (since max number of subnets would be 30 if M = 5)
Mask = 2^7+2^6+2^5+2^4+2^3 = 248
Q12. You have a class B subnet. You would like to divide it up into 10 more subnets by "subnetting" . How many hosts can you have per subnet?
A: 4094
Refering: to the formulas in the "SUBNETTING FORMULAS" section.
M = 4 (since max number of subnets would be 6 if M = 3)
N = 16-4 = 12
Max hosts per subnet = 2^12 -2 = 4094
Q13. You have a class B subnet. You would like to divide it up into 12 more subnets by "subnetting". However you also have to have at least 4000 hosts per subnet. Can you do it?
A: Yes.
Refering: to the formulas in the "SUBNETTING FORMULAS" section.
M = 4 (since max number of subnets would be 6 if M = 3)
N = 16-M = 12
Max hosts per subnet = 2^12 -2 = 4094
Q14. You have a class B subnet (128.252.0.0). You want to divide it into 2 subnets. What will the ranges of IPs?
A: 128.252.65.1 to 128.252.126.254 AND 128.252.129.1 to 128.252.190.254
explanation: Referring to the 'SUBNETTINg FORMULA" section:
M=2 N=14. 2^(14-8)+1=65 2^(14-8+1)-2=126
Q15. What IP network addresses are set-aside for class B (for private use)?
a. 128.0.0.0 (mask 255.255.0.0)
b. 128.252.0.0 (mask 255.255.0.0)
c. 172.16.0.0 (mask 255.240.0.0)
d. 172.16.0.0 (mask 255.255.0.0)
e. 172.240.0.0 (mask 255.255.0.0)
A: C
Q16. IP classes and their ranges (A-C):
a. 1-127, 128-191, 192-223
b. 1-127, 128-191, 192-254
c. 1-126, 128-192, 193-223
d. 1-126, 128-191, 192-223
A: D
Q17. What IP network addresses are set aside for class C (for private use) ?
a. 172.16.0.0 (mask 255.240.0.0)
b. 172.16.0.0 (mask 255.255.0.0)
c. 196.168.0.0 (mask 255.255.0.0)
d. 192.168.0.0 (mask 255.255.0.0)
e. 198.168.0.0 (mask 255.255.255.0)
A: D
Q18. What leading bit values in the IP address indicate a class A
and Class B address ?
a. 0 and 10
b. 0 and 11
c. 1 and 11
d. 01 and 10
e. 10 and 110
A: A
Q19. What leading bit values in the IP address indicate a class C address ?
a. 0
b. 01
c. 10
d. 11
e. 110
A: C
Q20. Consider the IP address 128.252.144.84. What is the network
id and what is the node id ? assume classful networking.
a. 0.0.0.0 and 128.252.144.84
b. 128.0.0.0 and 252.144.84
c. 128.252.0.0 and 144.84
d. 128.252.144.0 and 84
A: C (class B network)
Q21. You have a class C subnet. You would like divide it up into 8 more subnets by "subnetting" ? What would be the subnet mask ?
a. 255.255.255.192
b. 255.255.255.224
c. 255.255.255.240
d. 255.255.255.248
d. 255.255.255.252
A: C
Explanation:
Refer to the formulas in the "SUBNETTING FORMULAS" section.
M = 4 (since max number of subnets would be 6 if M = 3)
Mask = 2^7+2^6+2^5+2^4 = 240
Q22. You have a class C subnet. You would like divide it up into 5 more subnets by "subnetting" . How many hosts can you have per subnet ?
a. 30
b. 31
c. 30
d. 62
e. 126
A: C
Explanation:
Refering: to the formulas in the "SUBNETTING FORMULAS" section.
M = 3 (since max number of subnets would be 2 if M = 2)
N = 8-M = 5
Max hosts per subnet = 2^5 -2 = 30
Q23. You have a class C subnet. You would like divide it up into 5 more subnets by "subnetting". However you also have to have at least 31 hosts per subnet. Can you do it ?
a. Yes
b. No
ans: B
Explanation:
Answer is NO (Even though you are asking for 5x31=155 nodes)
Referring: to the formulas in the "SUBNETTING FORMULAS" section.
M = 3 (since max number of subnets would be 2 if M = 2)
N = 8-M = 5
Max hosts per subnet = 2^5 -2 = 30
Q24. You have a class C subnet. You would like divide it up into subnets by "subnetting". You have to have at least 24 nodes per subnet. How many subnets can you have ?
a. 2
b. 6
c. 7
d. 8
e. 14
A: B
Explanation:
Refering: to the formulas in the "SUBNETTING FORMULAS" section:
# max hosts/subnet = 2^N -2 , that means N has to be at least 5
That means M can be at most 3
# max subnets = 2^M -2 = 6
Q25. Your class C network has been subnet-ed. Mask for the new subnets is 255.255.255.248. How many subnets and how many nodes per subnet can you have ?
a. 30, 6
b. 30, 7
c. 62, 2
d. 62, 6
e. 62, 7
A: A
Q26. You have divided your class C network into 6 subnets. Your subnet mask is 255.255.255.224. What are the ranges of IPs for your subnets ? Your Network address before subnetting was 200.252.144.0
a. 32-62, 64-93, 96-125, 128-157, 160-189, 192-221
b. 33-63, 65-94, 97-126, 129-158, 161-190, 193-222
c. 34-64, 66-95, 98-127, 130-159, 162-191, 194-223
d. 35-65, 67-96, 99-128, 131-160, 163-192, 195-224
A: B
Explanation: M=3 N=5
From the formulas in "SUBNETTING FORMULAS" section :
The First range = 2^5+1 to 2^6-2 = 33 to 62
The 2nd range = 33+32 to 62+32 = 65 to 94
The 3rd range = 65+32 to 94+32 = 97 to 126
The 4rd range = 97+32 to 126+32 = 129 to 158
The 5th range = 129+32 to 158+32 = 161 to 190
The 6th range = 161+32 to 190+32 = 193 to 222
Q26. Your previous Network Administrator had subnneted your Class C network into many subnets. Only info you have is that the mask was 255.255.255.224 How many subnets did he make ? How many nodes were there per subnet ?
a. 2, 62
b. 7, 30
c. 6, 30
d. 6, 62
e. 7, 62
A: C
Explanation: 224=128+64+32 . That means number borrowed 1 bits = 3. M=3.
Subnets = 2^M -2 = 6 . Nodes per subnet = 2^N - 2 = 30 .
Q27. You have a class B subnet. You would like divide it up into 5 more subnets by "subnetting" . How many hosts can you have per subnet ?
a. 30
b. 1022
c. 2046
d. 4094
e. 8190
A: E
Explanation:
Refering: to the formulas in the "SUBNETTING FORMULAS" section.
M = 3 (since max number of subnets would be 2 if M = 2)
N = 16-M = 13
Max hosts per subnet = 2^13 -2 = 8190
Q30. You have a class B subnet. You would like divide it up into 5 more subnets by "subnetting". However you also have to have at least 6000 hosts per subnet. Can you do it ?
a. Yes
b. No.
A: B
Explanation:
Refering to the formulas in the "SUBNETTING FORMULAS" section.
M = 3 (since max number of subnets would be 2 if M = 2)
N = 16-M = 13
Max hosts per subnet = 2^13 -2 = 3070
Q31. Class D IP address range an its use?
a. 192-223, broadcast
b. 224-239, multicast
c. 224-255, broadcast
d. 192-255, multicast
A: B
Q32. Class E IP address range and its use ?
a. 240-255, experimental
b. 224-239, multicast
c. 224-255, multicast
d. 192-255, experimental
A: A
Q33. CIDR stands for ____________________?
a. Carrier International Domain Routing
b. Carrier Independent Domain Routing
c. Classless Inter-Domain Routing
d. Cross-platform Inter-Domain Routing
A: C
479. Which IP-class provides the fewest numbers of Hosts?
a. Class A
b. Class B
c. Class C
d. Class D
ans: D
480. You see the following subnet addresses ; what is the subnet mask ?
128.252.4.0
128.252.8.0
128.252.12.0
128.252.16.0
a. 255.255.255.0
b. 255.255.192.0
c. 255.255.240.0
d. 255.255.252.0
ans: D
Copyright © 1996-2009 by Dr. Nikolai Bezroukov. www.softpanorama.org was created as a service to the UN Sustainable Development Networking Programme (SDNP) in the author free time. Submit comments This document is an industrial compilation designed and created exclusively for educational use and is placed under the copyright of the Open Content License(OPL). Site uses AdSense so you need to be aware of Google privacy policy. Original materials copyright belong to respective owners. Quotes are made for educational purposes only in compliance with the fair use doctrine.
Disclaimer:
Last modified: August 09, 2009