A course in TCP/IP
networking
Part 5: Setting up a
network
This course so far has covered the mathematics and organization of IP addresses. This document will discuss practical issues of setting up networks.
Since the first days of networking, the distribution of IP addresses has been under the control of an agency. All organizations wishing to hook up to the original TCP/IP network, which was called the DARPAnet, (Defense Advanced Research Projects Agency net) had to agree to abide by the directions of DARPA. The DARPAnet is now called the Internet, and the governing agency is ICANN – the Internet Corporation for Assigned Names and Numbers. ICANN controls all assignment of IP addresses and gives ISPs (Internet Service Providers) and a few other organizations rights to blocks of IP addresses that they may use in their own networks or may sell to their customers. ISPs also lease access to the physical networks of the Internet from providers who install and control them. Prior to setting up a network, an organization must decide 1) how many networks are needed 2) how many hosts will be on each network, keeping in mind that a single computer may have multiple adapters and therefore require multiple IP addresses 3) how much growth the organization anticipates (this is not required but will save much work later) 4) how your organization will handle routing, which is the movement of packets between networks and 5) locate an ISP from which to lease network access and IP addresses.
The ISP will provide
a block of one or more addresses to the organization, which can use them in any
way it wants. If the organization needs a large number of addresses, the ISP
may provide multiple classful addresses or a single block of addresses. For
example if a corporation will be using 1000 addresses, the ISP will may provide
all the IP addresses in four complete Class C addresses. Even though the
addresses will be provided in classful form, the organization has no obligation
to set up four networks of 250 hosts each.
Networks are set up
depending on the security and work needs of the organization. The
organization's entire network should be isolated from the Internet behind a
firewall, which the ISP will not usually provide. Some networks may need to be
isolated behind a firewall from other networks within the organization. Some
networks may be very heavily used, so that few hosts should be attached. Others
can be larger. Each organization has to analyze these needs and determine how
many networks it needs and how large they should be prior to leasing IP
addresses and network access from the ISP. These networks should be completely
laid out on paper before any IP addresses are acquired.
Each network will
use some whole number of bits for the network address and for the host numbers.
A bit can only belong to the host or the network portion of the address, so
each network will contain a number of IP addresses that is a power of two. If
three bits will be used for the host portion of the IP address, 23
or 8 IP addresses are included in the network. If four bits will be used for
the host portion of the IP address, 24 or 16 addresses will be
included in the network. These need not all be used, but the ISP cannot assign
them to another customer and may charge for all of them, so it is a good idea
to get a number of IP addresses close to the organization's actual use.
Two of the addresses
in the network, regardless of the network's size, are reserved for special
uses. The first is the network
number, which has already been
discussed. It contains the network number in the network bits and zeros in the
host bits of the IP address. The second is the broadcast number, which
contains the network number in the network bits and ones in all the host bits.
The broadcast number is reserved for use by applications that need to send
packets to all hosts on the network. With the exception of the network number
and the broadcast number, all other IP addresses included in the network can be
used for hosts.
For small networks, the proportion of addresses used by the network number and broadcast number may be considerable. A network that uses 8 bits for the host number can include 254 hosts (28=256-2) so the network and broadcast numbers are less than 1% of the available addresses. A network that uses 4 bits for the host number can include 6 hosts (24=8-2). In that case, the network and broadcast numbers are 25% of the available IP addresses. If all networks in an organization use 3 bits for the host number, it will use 50% of its IP addresses for network numbers and broadcast numbers.
This discussion assumes that the routing hardware can support any configuration of networks. This is usually true, but not always. If a network is routing using, for example, Sun workstations running Solaris 8, the setup of networks will be limited by the inability of those systems to handle complex routing. Cisco routers, on the other hand, can handle any network design.
Each host on a network must be cabled to a network device such as a Cisco router, a switching hub (or "switch" ) or a simple hub. A single computer may have multiple adapters, each cabled to different network devices: the term "host" applies to the adapter and not the system. The number of hosts on the network is limited by the number of connections available on the network device and also by the number of IP addresses available for the network.
The routing device must also be cabled to the network. How this is done depends on the device type. Cisco routers serve the function of both a router and a switch. Solaris workstations serving as routers must be cabled to the switch like any other host.
The block of IP addresses provided by the ISP has to be subdivided into networks. Each network has a unique network number and the IP addresses contained in that network cannot overlap with those of any other network. The first IP address, in order, in the network will have all zeros in the host places of the IP address and will serve as the network number. The last IP address will have all ones in the host places of the IP address and will serve as the broadcast number. The remaining IP addresses will be assigned to specific hosts using the host operating system's protocol.
For example, an ISP provides the following block of addresses: 201.56.0.0/22, including all IP addresses from 201.56.0.0 to 201.56.3.255. This network uses 22 places for the network number and 10 places for the host number. That means that the entire network contains about 1000 host numbers. This could be subdivided or subnetted into two /23 networks each containing about 500 host numbers or as one /23 network and two /24 networks each containing about 250 hosts numbers or into one /23 network, one /24 network and two /25 networks, and so on. In this example it will be subdivided into one /23 network and two /24 networks.
The original address can be written in binary as follows, separating the network and host portions with a space:
11001001.0011100.000000 | 00.00000000
The network number has been assigned by the ISP and cannot be changed. Only the host portion of this network can be subnetted.
To subdivide this network into two networks, one bit from the host portion of the address must be used for the network address because one bit permits the enumeration of two networks, 0 and 1, each of which is a /23 network. This leaves 9 bits for host numbers, so 512 host numbers are contained in each of these networks. The network addresses are now:
11001001.0011100.0000000 | 0.00000000
11001001.0011100.0000001 | 0.00000000
In decimal, these are 201.56.0.0/23 and 201.56.2.0/23.
The network 201.56.0.0/23 is final and will not be subdivided further. The network number, broadcast number, and all host numbers can therefore be assigned:
Network number: 11001001.0011100.00000000.00000000 or 201.56.0.0 (zeroes in host places)
Broadcast number: 11001001.0011100.00000001.11111111 or 201.56.1.255 (ones in host places)
Host numbers:
11001001.0011100.00000000.00000001 or 201.56.0.1
11001001.0011100.00000000.00000010 or 201.56.0.2
11001001.0011100.00000000.00000011 or 201.56.0.3
11001001.0011100.00000000.00000100 or 201.56.0.4
…. (about 500 times)
11001001.0011100.00000001.11111100 or 201.56.1.252
11001001.0011100.00000001.11111101 or 201.56.1.253
11001001.0011100.00000001.11111110 or 201.56.1.254
These IP addresses can be assigned to hosts along with the netmask /23 or 255.255.254.0.
The network 201.56.2.0 must be subnetted into two /24 addresses each of which will include 256 host numbers. One more bit must be appropriated from the host portion of the address for the network portion of the address to create two networks. To create four networks would have taken two bits, eight networks, three bits, etc.:
11001001.0011100.00000010 | .00000000
11001001.0011100.00000011 | .00000000
In decimal, these are 201.56.2.0/24 and 201.56.3.0/24. As it turns out these are class C addresses, but that is not important. The first network will be:
network number: 11001001.0011100.00000010.00000000 or 201.56.2.0
broadcast number 11001001.0011100.00000010.11111111 or 201.56.2.255
host numbers:
11001001.0011100.00000010.00000001 or 201.56.2.1
11001001.0011100.00000010.00000010 or 201.56.2.2
11001001.0011100.00000010.00000011 or 201.56.2.3
….(about
250 more addresses)
11001001.0011100.00000010.11111101 or 201.56.2.253
11001001.0011100.00000010.11111110 or 201.56.2.254
The second network
will be:
network number: 11001001.0011100.00000011.00000000 or 201.56.3.0
broadcast number 11001001.0011100.00000011.11111111 or 201.56.3.255
host numbers:
11001001.0011100.00000011.00000001 or 201.56.3.1
11001001.0011100.00000011.00000010 or 201.56.3.2
11001001.0011100.00000011.00000011 or 201.56.3.3
….(about
250 more addresses)
11001001.0011100.00000011.11111101 or 201.56.3.253
11001001.0011100.00000011.11111110 or 201.56.3.254
The three networks defined above have taken up
all of the original 1024 IP addresses: three network numbers, three broadcast
numbers, and 1018 host IP addresses. The first network started with the network
number 201.56.0.0 and went to 201.56.1.255. The second network started with 201.56.2.0
and went to 201.56.2.255. The third network included the IP addresses from
201.56.3.0 to 201.56.3.255.
There are a number
of terms used to describe the way that IP addresses can be combined and
subdivided into networks. In the previous example, instead of providing a
single /22 network, the ISP might have provided four class C networks:
201.46.1.0/24 to 201.46.1.3/24. The same IP addresses are included, just
expressed in a different format. To obtain the same network design described
above, two of those networks, 201.46.0.0/24 and 201.46.1.0/24 would have to
have been combined into one /23 network. The last two networks, 201.46.0.2 and
201.46.0.3 could have been used without reorganization. In binary the original
/24 networks are written:
11001001.0011100.00000000 | .00000000 or 201.46.0.0/24
11001001.0011100.00000001 | .00000000 or 201.46.1.0/24
For these two
networks to become a single network, the network number in both must be the
same. The two network numbers share all but the final place, so they can be
combined into a single network:
11001001.0011100.0000000 | 0.00000000 or 201.46.0.0/23
The result is the
same as in the original example. Only the way the network was formed is
slightly different. The first example used subnetting. This example
used supernetting. The formula changes, but the result is the
same.
It is also possible
to subnet a classful address into classful subnets. In this simple process,
described in RFC 950, a class A or B network is subnetted to a class B or C
network. The process is identical to the non-classful subnetting discussed
above with the restriction that the division between the network portion and
the host portion of the IP address is always on a byte boundary. For example,
the Class A address 28.0.0.0 may be subnetted into 255 Class B addresses by
moving 8 bits of the host portion of the address to the network portion. For
example, the network 28.0.0.0 is written in binary as:
00011100 | 00000000.00000000.00000000 28.0.0.0/8
When subnetted into
Class B networks, the resulting network numbers are:
00011100.00000000 | 00000000.00000000 28.0.0.0/16
00011100.00000001 | 00000000.00000000 28.1.0.0/16
00011100.00000010 | 00000000.00000000 28.2.0.0/16
00011100.00000011 | 00000000.00000000 28.3.0.0/16
00011100.00000011 | 00000000.00000000 28.4.0.0/16
…
00011100.11111111 | 00000000.00000000 28.255.0.0/16
Problems:
1.How many hosts will be configured on a network with the following netmask?
a. /24
b. /26
c. /28
d. /29
2. Subnet the network 110.37.4.0/24 into four subnets. Provide the network number, the broadcast number, the netmask in byte bounded format (such as 255.255.0.0) and the first and last host numbers.
3. Does problem 2 represent classful subnetting (RFC 950)? Explain why or why not.
4. Subnet 18.0.0.0/8 into Class B networks. Give the first two and last two network numbers only.
5. Subnet 18.0.0.0/16 into Class C networks. Give the first two and last two network numbers for each Class C network.
6. Supernet 198.16.5.192/26 and 198.16.5.128/26 into a single network. Give the network number, broadcast number and first and last host numbers.
7. Supernet 198.16.5.128/27, 198.16.5.160/27, 198.16.5.192/27, and 198.16.5.224/27 into a single network. Give the network number.
8. Supernet 198.16.4.0, 198.16.5.0, 198.16.6.0, 198.16.7.0 and 198.16.8.0 into a single network. Give the network number.
9. Supernet 198.16.4.0, 198.16.4.128, 198.16.5.0 and 198.16.5.128 into a single network. Give the network number.
10. Is it possible to supernet 198.16.6.0, 198.16.7.0, 198.16.8.0 and 198.16.9.0?
Solutions:
1.How many hosts will be configured on a network with the following netmask?
a. /24 : (32 bits total) - (24 bits in the network number) = 8 bits. With 8 bits 28 or 256 items can be enumerated, including a broadcast number and a network number. Answer: 256-2 = 254
b. /26 : 26 = 64-2 = 62
c. /28 : 24 = 8-2 = 6
d. /29 :23 = 4-2 = 2
2. Subnet the network 110.37.4.0/24 into four subnets. Provide the network number, the broadcast number, the netmask in byte bounded format (such as 255.255.0.0) and the first and last host numbers.
Only the last byte will be used in subdividing this network, so the first three bytes will be written in decimal and the last byte in binary:
110.37.4.00000000
To form four subnets will require two bits from the host portion of the IP address. The network numbers, host numbers and broadcast numbers for these subnets will be:
Network portion | Host portion
Network #1
network no. 110.37.4.00 | 000000 or in decimal: 110.37.4.0
first host no. 110.37.4.00 | 000001 or in decimal: 110.37.4.1
last host no. 110.37.4.00 | 111110 or in decimal: 110.37.4.62
broadcast no. 110.37.4.00 | 111111 or in decimal: 110.37.4.63
Network #2
network no. 110.37.4.01 | 000000 or in decimal: 110.37.4.64
first host no. 110.37.4.01 | 000001 or in decimal: 110.37.4.65
last host no. 110.37.4.01 | 111110 or in decimal: 110.37.4.126
broadcast no. 110.37.4.01 | 111111 or in decimal: 110.37.4.127
Network #3
network no. 110.37.4.10 | 000000 or in decimal: 110.37.4.128
first host no. 110.37.4.10 | 000001 or in decimal: 110.37.4.129
last host no. 110.37.4.10 | 111110 or in decimal: 110.37.4.190
broadcast no. 110.37.4.10 | 111111 or in decimal: 110.37.4.191
Network #4
network no. 110.37.4.11 | 000000 or in decimal: 110.37.4.192
first host no. 110.37.4.11 | 000001 or in decimal: 110.37.4.193
last host no. 110.37.4.11 | 111110 or in decimal: 110.37.4.254
broadcast no. 110.37.4.11 | 111111 or in decimal: 110.37.4.255
The original 256 IP addresses have been divided into four equal groupings in this example. Each network's network number is one greater than the previous network's broadcast number. The first host number is one greater than the network number, and the last host number is one less than the broadcast number. All values have been assigned.
The netmask for all IP addresses in these networks is /26 or 255.255.255.192.
3. Does problem 2 represent classful subnetting (RFC 950)? Explain why or why not.
There are two reasons that problem 2 is not classful subnetting as described by RFC 950. First, the network number 110.37.4.0/24 is not a truly classful parent network number. Although the division between the network and host portions of the IP address are byte-bounded, the first byte is 110, which indicates that this network was originally part of a Class A network. It has already been subnetted. Second, the subnets formed in problem 2 use a portion of the last byte of the IP address for the network number, so they are not classful.
4. Subnet 18.0.0.0/8 into Class B networks. Give the first two and last two network numbers.
The network number 18.0.0.0 is a Class A network. This subnetting follows the standards of RFC 950. All networks are byte bounded and can be easily written out:
18.0.0.0/16
18.0.1.0/16
…
18.0.254.0/16
18.0.255.0/16
5. Subnet 18.0.0.0/16 into Class C networks. Give the first two and last two network numbers.
These networks are also byte bounded:
18.0.0.0/24
18.0.1.0/24
18.0.2.0/24
…
18.255.254.0/24
18.255.255.0/24
6. Supernet 198.16.5.192/26 and 198.16.5.128/26 into a single network. Give the network number, broadcast number and first and last host numbers.
The first three octets of the network addresses are identical, so only the last byte needs to be written out in binary:
198.16.5.11 | 000000 (198.16.5.192)
198.16.5.10 | 000000 (198.16.5.128)
These two networks are identical up to the 25th bit, so 25 bits may be used for the network number, and both networks may be supernetted to a /25 network:
198.16.5.1 | 0000000 (198.16.5.128)
The broadcast number will be the network number plus ones in the host places:
198.16.5.1 | 1111111 (198.16.5.255)
The first host number is:
198.16.5.1 | 0000001 (198.16.5.129)
The last host number is:
198.16.5.1 | 1111110 (198.16.5.254)
7. Supernet 198.16.5.128/27, 198.16.5.160/27, 198.16.5.192/27, and 198.16.5.224/27 into a single network. Give the network number only.
The first three octets of the network addresses are identical, so only the last byte needs to be written out in binary:
198.16.5.100 | 00000 (198.16.5.128)
198.16.5.101 | 00000 (198.16.5.160)
198.16.5.110 | 00000 (198.16.5.192)
198.16.5.111 | 00000 (198.16.5.224)
These four networks are identical to the 25th bit of the network number, so they may be supernetted into a /25 network.
198.16.5.1 | 0000000 (198.16.5.128)
This is the same network created in Question 6, so the broadcast and host numbers will be the same.
8. Supernet 198.16.4.0, 198.16.5.0, 198.16.6.0, 198.16.7.0 and 198.16.8.0 into a single network. Give the network number.
No netmask was supplied for this problem, but if the last two bytes of each network number are written out in binary, it is obvious that these are /24 (Class C) networks because the network numbers use up three bytes.
198.16.00000100.000 00000 (198.16.4.0) 198.16.00000101.000 00000 (198.16.5.0) 198.16.00000110.000 00000 (198.16.6.0) 198.16.00000111.000 00000 (198.16.7.0)
These networks are identical to the sixth bit of the third byte, so they can be supernetted into a /22 network:
198.16.000001 | 00.00000000 (198.16.4.0)
9. Supernet 198.16.4.0, 198.16.4.128, 198.16.5.0 and 198.16.5.128 into a single network. Give the network number.
No netmask was supplied for this problem, but if the last two bytes of each network number are written out in binary, it is obvious that these are /25 (Class C) networks because the network numbers include one bit of the last byte.
198.16.00000100.0 | 0000000 (198.16.4.0) 198.16.00000100.1 | 0000000 (198.16.4.128) 198.16.00000101.0 | 0000000 (198.16.5.0) 198.16.00000101.1 | 0000000 (198.16.5.128)
These networks are identical to the seventh bit of the third byte, so they can be supernetted into a /23 network:
198.16.0000010 | 0.00000000 (198.16.4.0)
10. Is it possible to supernet 198.16.6.0, 198.16.7.0, 198.16.8.0 and 198.16.9.0?
If these networks are written out in partial binary:
198.16.00000110.000 00000 (198.16.6.0) 198.16.00000111.000 00000 (198.16.7.0)
198.16.00001000.000 00000 (198.16.8.0) 198.16.00001001.000 00000 (198.16.9.0)
These networks are the same to the fourth bit of the third byte, but they can not be supernetted into a /20 network! That network would be 198.16.0.0/24. Such a network must also include 198.16.0.0, 198.16.1.0, 198.16.2.0 etc.