2.2 Addressing Schemes
Internet access can be facilitated for hosts using the private addressing scheme in two ways:
- Through a router configured with a single or block of valid public IP addresses; the router translates between the private and public addresses (NAT). - A proxy server that fulfills requests for internet resources on behalf of clients.
Organizations need to do this for a number of reasons: -It is inefficient to have very large numbers of computers on the same network. A single network in this sense is a single broadcast domain; excessive broadcast traffic is created when there are more hosts on the same network.
-Many organizations have more than one site and WAN links between them. The WAN link normally forms a separate network. -It is useful to divide a network into logically distinct zones for security and administrative control.
There are some additional constraints to consider when planning an addressing scheme: -Network ID cannot be 127 - this address is reserved for loopback testing. -Network and / or host IDS cannot be all 1s in binary - this reserved for broadcasts.
-Network and / or host ID cannot be all zeroes in binary - 0 means "This Network". -Host ID must be unique on the subnet. -Network ID must bee unique on the internet (if using a public addressing scheme).
Planning an IP Addressing Scheme A network designer will need to plan the network addressing scheme carefully. Before choosing a scheme, consider the following factors:
-Whether you need a public or private addressing scheme. -How many networks and subnetworks you need. -How many hosts per subnet.
These addresses can be drawn from one of the pool of addresses defined in RFC 1918 as non-routable over the internet:
10.0.0.0 to 10.255.255.255 169.254.0.0 to 169.254.255.255 172.16.0.0 to 172.31.255.255 192.168.0.0 to 192.168.255.255
Net ID - Binary 192.32.168.0 - 1100000000.00100000.10101 000.00000000 192.32.169.0 -11000000.00100000.10101 001.00000000 192.32.170.0 - 11000000.00100000.10101 010.00000000 192.31.171.0 - 11000000.00100000.10101 011.00000000
192.32.172.0 - 11000000.001000000.10101 100.00000000 192.32.173.0 - 11000000.00100000.10101 101.00000000 192.32.174.0 - 11000000.00100000.10101 110.00000000 192.32.175.0 - 1100000000.00100000.10101 111.00000000
Private Addressing
A private network will typically use a private addressing scheme to allocate IP address to hosts.
169.254.0.0 to 169.254.255.255
APIPA / link-local autoconfiguration. This range is used by hosts for autoconfiguration (selecting a link-local address). The first 256 addresses and last 256 addresses should not be used by hosts though.
Creating Subnets
An IP network address can represent an organization on the internet, but most companies need to farther subdivide their networks into different logical groups. These groups are referred to as subnetworks or subnets.
IP Addressing Schemes
As described earlier, the combination of an IP address and subnet mask can be used to describe a network ID and a host ID. "Addressing schemes" describes different ways of configuring IP addressing to suit different types and sizes of networks.
The network address could also be expressed in classless notation as 192.32.168.0/21, meaning that the network prefix contains 21 bits (count the 1s in the example below). Note that the address of the first subnetwork is the same as the network address.
As with subnetting, an ANDing process is used to determine whether to route or not. If the ANDed result reveals the same network ID as the destination address, then it is the same network. In the table below, the first two IP addresses belong to the same network (the second is the broadcast address for the network) but the third is in a different one:
10.0.0.0 to 10.255.255.255
Class A private address range
172.16.0.0 to 172.31.255.255
Class B private address range
192.168.0.0 to 192.168.255.255
Class C private address range
Class D and E There are two additional classes of IP address (D and E) that utilize the remaining number. Class D addresses (224.0.0.0 through 239.255.255.255) are used for multicasting;
Class E addresses (240.0.0.0 through 255.255.255.255) are reserved for experimental use and testing.
Classful Addressing The classful addressing scheme was employed in the 1980s, before the use of subnet masks to identify the network ID portion of an address became widespread.
Classful addressing allocates a network ID based on the first octet of the IP address. The network IDs are divided into three classes, defining different sizes of network.
For example, rather than allocate a class B (or /16) network address to a company, several contiguous class C ( or /24) addresses could be assigned. Eight /24 network addresses gives 2032 hosts. However, this would mean complicated routing with many entries in the route tables, because there are now eight networks.
Classless Inter-Domain Routing (CIDR) is used to collapse these routing entries into single entry. If the network addresses assigned to a company were 192.32.168.0 through to 192.32.175.0 and we wished to view this as one network, we would only consider he first 21 bits of the address.
Supernetting is described in RFC 4632.
Essentially, it uses bits normally assigned to the network ID to mask them as host or subnet bits.
While routers have performed classless routing for years, the class terminology is still very widely used.
Even under classless addressing, the old classes are often used as names for the default subnet masks; a Class A network is /8, a Class B network is /16, and a Class C network is /24.
Classful Addressing In the classful addressing system, an organization was allocated to a network address from a suitable class (A, B, or C). With the introduction of subnetting, depending on the class of IP address, some of the octets were fixed but the remaining portion could use any valid addressing scheme.
For example, an organization might be allocated the network address 128.248.0.0 where it can allocate the third and fourth octets as it desires.
The process of designing the scheme is as follows(Continued): -Next work out how many hosts each subnet must support and whether there is enough space left in the scheme to accomadate them.
For example, if your network address is in the /16 range and you use 4 bits for subnetting, you have 12 bits for hosts in each subnet. The number of hosts per subnet can be expressed using the formula 2(to the power of N)-2, where N is the number of bits you have allocated for the host ID. 12 bits is enough for 4094 hosts in each subnet.
The whole network is still referred to by the network ID (by routers external to the network) and the default mask : 172.16.0.0 / 255.255.0.0 for example.
However, routers within the network add bits to the mask to differentiate the subnets,
127.0.0.0 is reserved and cannot be assigned to ordinary hosts.
It is used for the loopback address ( a special address used to check that TCP/IP is correctly installed).
Address - Binary
Mask: 255.255.248.0 - 11111111.11111111.11111000.00000001 IP:192.32.168.1 - 11000000.00100000.10101000.00000001 IP:192.32.175.255 - 1100000000.00100000.10101111.11111111 IP:192.32.176.1 - 11000000.00100000.10110000.00000001
The broadcast address of a subnet is one where the host bits are all set to 1.
Multicast must take place using specially configured routers and protocols.
In dotted decimal, the mask would be 255.255.240.0. Subnet masks consist of a variable number of contiguous high order bits. This means that each octet in decimal will always be one of the following:
Number of High Order Bits - Decimal Equivalent 1(10000000) - 128 2(11000000) - 192 3(11100000) - 224 4(11110000) - 240 5(11111000) - 248 6(11111100) - 252 7(11111110) - 254 8(11111111) - 255
Most configuration dialogs require you to input a subnet mask in dotted decimal format.
Some may require you to enter the network address and prefix in slash notation however.
Work out the host ranges for each subnet. Take the subnet address and add a binary 1 to it for the first host.
Take the next subnet ID and deduct two binary digits from it. In our case, this is 172.16.16.1 and 172.16.31.254 respectively. Repeat for all subnets.
Routers external to the network just use to /21 prefix, so the complexity of the LAN subnets is hidden and doesn't need to clog up their routing tables.
The LAN's internal routers use the /24 prefix, or could even multiple prefixes to create sub-subnets (Variable Length Subnet Masking).
The process of designing the scheme is as follows: -Work out how many subnets are required (remembering to allow for future growth) then round this number to nearest power of 2. Fox example, if you need 12 subnets, the next nearest power of 2 is 16.
The exponent is the number of bits you will need to add your default mask. For example, 16 is 2 to the power of four, so you will need to add 4 bits to the default network prefix.
Supernetting was designed to solve two major problems of the classful addressing scheme as more and more networks joined the internet through the early 1990s.
The first was that network addresses (specifically, Class B addresses) were becoming very scarce and second was near exponential growth in internet routing tables.
Classless Subnets
The introduction of subnetting (in 1985) was the first step towards a classless addressing scheme. In a classless scheme, the network ID does not depend on the class of the IP address number but on the number of bits set to 1 in an associated network prefix.
Work out the next subnet ID, which will be the lowest subnet value higher (32 in the example).
The second and subsequent subnet IDs are all the lowest subnet ID higher than the one before - 16, 32, 48, and so on.
When considering classful addressing, it is important to be able to identfiy the address class from the first octet of the IP address.
The table below shows how to identify an address class from the first octet of the IP address in decimal: 1-127 Class A 128-191 Class B 192-223 Class C
Class A network addresses support large number of hosts - over 16 million. However, there are only 126 of them.
There are 16 thousand Class B networks, each containing up to about 65,000 hosts. Finally class C networks support only 254 hosts each, but there are over 2 million of them.
The subnet mask for the example above contains 20 ones followed by 12 zeroes.
Therefore, the network prefix, expressed in slash notation, is 172.16.0.0/20.
Now work out the subnets. The easiest way to find the first subnet ID is to deduct the least significant octet in the mask (240 in the example) from 256.
This gives the first subnet ID, which, in full, is 172.16.16.0/20.
Public Internet Addressing
When an organization wants to connect to the internet, is must apply for a range of public IP addresses via its Internet Service Provider (ISP).
Classful Subnets
When working with classful addresses, the default subnet mask can be modified to allow a single network to be divided into a number of subnets. To do this, additional bits of the IP address have to be allocated to the network address rather than the host ID.
Wherever a 1 appears in the binary mask, the corresponding digit in the IP address is part of the network or subnet address.
When you are planning what your mask will be, remember this rule. Allocate more bits in the mask if you need more subnets. Allocate fewer bits in the mask if you need more hosts per subnet.
Just for comparison, is you have a /24 (or Class C) network address, there will only be enough space left for 14 hosts per subnet (2(to the power of 4)-2).
You can make more efficient use of the space by deploying Variable Length Subnet Masks (VLSM). In this case, you assign network prefixes of different subnets. For example, you could create some /26 subnets with up to 50 hosts and some /30 subnets with just two hosts (for WAN links perhaps).
Remember that we subtract 2 because each subnet's network address
and broadcast address cannot be assigned to hosts.
For example, if the network designer added 4 bits to the mask,
it would mean a subnet mask of 20 bits (the 16 bits of the default class B mask plus the 4 bits you added).
Alternatively, rather than worry about different address class ranges (i.e. A is 1 to 127),
just remember the rule that all class A networks start with a binary 0, all class B start with a binary 10, and class C start with a binary 110.
Under this classful system, almost all Class B addresses became allocated. This shortage of network addresses prompted the development of IP version 6, which uses 128-bit IP addresses. However, the development of IPv6 has been enormously protracted, so a series of stopgap
measures have been introduced over the years. The earliest were the use of subnetting and private address ranges to hide the complexity of private local networks from the wider internet. Another significant measure was the introduction of supernetting or Classless Interdomain Routing (CIDR) in 1993.
Broadcast, Multicast, and Unicast IPv4 uses a number of mechanisms with which to communicate with other hosts. When an IPv4 host wants to send a packet to another single host, it uses a unicast packet, addressed to the destination host. If, however, the local host
needs to communicate with multiple hosts, it can do so either by using a broadcast, in which the destination address is all hosts on the local subnetwork, or else by using a multicast address, which represents a group of computers, programmed to respond to a particular address.
Supernetting allows for a more flexible, hierarchical system of network addressing,
with efficient routing between networks on the internet.
Any organization can use these addresses on private LANs
without applying to a registrar and multiple organizations can use these ranges simultaneously.