home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BURKS 2
/
BURKS_AUG97.ISO
/
BURKS
/
LINUX
/
HOWTO
/
mini
/
ipsubnet.txt
< prev
next >
Wrap
Text File
|
1997-07-07
|
24KB
|
558 lines
IP Sub-Networking Mini-Howto
Robert Hart, hartr@interweft.com.au
v1.0, 31 March 1997
This document describes why and how to subnetwork an IP network - that
is using a single A, B or C Class network number to function correctly
on several interconnected networks.
1. Copyright
This document is distributed under the terms of the GNU Public License
(GPL).
This document is directly supported by InterWeft IT Consultants
(Melbourne, Australia).
The latest version of this document is available at the InterWeft WWW
site at InterWeft IT Consultants <http://www.interweft.com.au/> and
from The Linux Documentation Project <http://sunsite.unc.edu/LDP>.
2. Introduction
With available IP network numbers rapidly becoming an endangered
species, efficient use of this increasingly scarce resource is
important.
This document describes how to split a single IP network number up so
that it can be used on several different networks.
This document concentrates on C Class IP network numbers - but the
principles apply to A and B class networks as well.
2.1. Other sources of information
There are a number of other sources of information that are of
relevance for both detailed and background information on IP numbers.
Those recommended by the author are:-
╖ The Linux Network Administrators Guide
<http://sunsite.unc.edu/LDP/LDP/nag/nag.html>.
╖ The Linux System Administration Guide
<http://linuxwww.db.erau.edu/SAG/>.
╖ TCP/IP Network Administration by Craig Hunt, published by O'Reilly
and Associates <http://www.ora.com/catalog/tcp/noframes.html>.
3. The Anatomy of IP numbers
Before diving into the delight of sub-networking, we need to establish
some IP number basics.
3.1. IP numbers belong to Interfaces - NOT hosts!
First of all, let's clear up a basic cause of misunderstanding - IP
numbers are not assigned to hosts. IP numbers are assigned to network
interfaces on hosts.
Eh - what's that?
Whilst many (if not most) computers on an IP network will possess a
single network interface (and have a single IP number as a
consequence), this is not the only way things happen. Computers and
other devices can have several (if not many) network interfaces - and
each interface has its own IP number.
So a device with 6 active interfaces (such as a router) will have 6 IP
numbers - one for each interface to each network to which it is
connected. The reason for this becomes clear when we look at an IP
network!
Despite this, most people refer to host addresses when referring to an
IP number. Just remember, this is simply shorthand for the IP number
of this particular interface on this host. Many (if not the majority)
of devices on the Internet have only a single interface and thus a
single IP number.
3.2. IP Numbers as "Dotted Quads"
In the current (IPv4) implementation of IP numbers, IP numbers consist
of 4 (8 bit) bytes - giving a total of 32 bits of available
information. This results in numbers that are rather large (even when
written in decimal notation). So for readability (and organisational
reasons) IP numbers are usually written in the 'dotted quad' format.
The IP number
192.168.1.24
is an example of this - 4 (decimal) numbers separated by (.) dots.
As each one of the four numbers is the decimal representation of an 8
bit byte, each of the 4 numbers can range from 0 to 255 (that is take
on 256 unique values - remember, zero is a value too).
In addition, part of the IP number of a host identifies the network on
which the host resides, the remaining 'bits' of the IP number identify
the host (oops - network interface) itself. Exactly how many bits are
used by the network ID and how many are available to identify hosts
(interfaces) on that network is determined by the network 'class'.
3.3. Classes of IP Networks
There are three classes of IP numbers
╖ Class A IP network numbers use the leftmost 8 bits (the leftmost of
the dotted quads) to identify the network, leaving 24 bits (the
remaining three dotted quads) to identify host interfaces on that
network.
Class A addresses always have the leftmost bit of the leftmost byte
a zero - that is a decimal value of 0 to 127 for the first dotted
quad. So there are a maximum of 128 class A network numbers
available, with each one containing up to 33,554,430 possible
interfaces.
However, the networks 0.0.0.0 (known as the default route) and
127.0.0.0 (the loop back network) have special meanings and are not
available for use to identify networks. So there are only 126
available A class network numbers.
╖ Class B IP network numbers use the leftmost 16 bits (the leftmost
two dotted quads) to identify the network, leaving 16 bits (the
last two dotted quads) to identify host interfaces. Class B
addresses always have the leftmost 2 bits of the leftmost byte set
to 1 0. This leaves 14 bits left to specify the network address
giving 32767 available B class networks. B Class networks thus have
a range of 128 to 191 for the first of the dotted quads, with each
network containing up to 32,766 possible interfaces.
╖ Class C IP network numbers use the leftmost 24 bits (the leftmost
three bytes) to identify the network, leaving 8 bits (the rightmost
byte) to identify host interfaces. Class C addresses always start
with the leftmost 3 bits set to 1 1 0 or a range of 192 to 255 for
the leftmost dotted quad. There are thus 4,194,303 available C
class network numbers, each containing 254 interfaces. (C Class
networks with the first byte greater than 223 are however reserved
and unavailable for use).
In summary:
Network class Usable range of first byte values (decimal)
A 1 to 126
B 128 to 191
C 192 to 254
There are also special addresses that are reserved for 'unconnected'
networks - that is networks that use IP but are not connected to the
Internet, These addresses are:-
╖ One A Class Network
10.0.0.0
╖ 16 B Class Networks
172.16.0.0 - 172.31.0.0
╖ 256 C Class Networks 192.168.0.0 - 192.168.255.0
You will note that this document uses these sequences throughout to
avoid confusion with 'real' networks and hosts.
3.4. Network numbers, interface addresses and broadcast addresses
IP numbers can have three possible meanings:-
╖ the address of an IP network (a group of IP devices sharing common
access to a transmission medium - such as all being on the same
Ethernet segment). A network number will always have the interface
(host) bits of the address space set to 0 (unless the network is
sub-networked - as we shall see);
╖ the broadcast address of an IP network (the address used to 'talk',
simultaneously, to all devices in an IP network). Broadcast
addresses for a network always have the interface (host) bits of
the the address space set to 1 (unless the network is sub-networked
- again, as we shall see).
╖ the address of an interface (such as an Ethernet card or PPP
interface on a host, router, print server etc). These addresses can
have any value in the host bits except all zero or all 1 - because
with the host bits all 0, the address is a network address and with
the host bits all 1 the address is the broadcast address.
In summary and to clarify things
For an A class network...
(one byte of network address space followed by three bytes of host
address space)
10.0.0.0 is an A Class network number because all the host
bits of the address space are 0
10.0.1.0 is a host address on this network
10.255.255.255.255 is the broadcast address of this network
because all the host bits of the address space are 1
For a B class network...
(two bytes of netwo