Anda di halaman 1dari 43

Understanding IP addressing

• The Internet continues to grow at a phenomenal


rate.
• This is reflected in the tremendous popularity of
the World Wide Web (WWW), the opportunities
that businesses see in reaching customers from
virtual storefronts, and the emergence of new
ways of doing business.
• It is clear that expanding business and public
awareness will continue to increase demand for
access to resources on the Internet.
Internet Scaling Problems
• The eventual exhaustion of IP version 4 (IPv4)
address space
• The need to route traffic between the ever
increasing number of networks that comprise
the Internet.
Classful IP Addressing
• 32 bit address value
• The first part of an Internet address identifies
the network on which the host resides.
• The second part identifies the particular host
on the given network.
Classfull IP Addressing
• In recent years, the network number field has
been referred to as the network prefix because
the leading portion of each IP address identifies
the network number.
• All hosts on a given network share the same
network prefix but must have a unique host
number.
• Similarly, any two hosts on different networks
must have different network prefixes but may
have the same host number.
Primary Address Classes

• To provide the flexibility required to support


networks of varying sizes, the Internet
designers decided that the IP address space
should be divided into three address classes-
Class A, Class B, and Class C.
• This is often referred to as classful addressing.
Each class fixes the boundary between the
network prefix and the host number at a
different point within the 32-bit address.
Primary Address Classes
Class A Networks (/8 Prefixes)
• Each Class A network address has an 8-bit network
prefix, with the highest order bit set to 0 (zero) and a 7-
bit network number, followed by a 24-bit host number.
Today, Class A networks are referred to as “/8s”
(pronounced “slash eight” or just “eights”) since they
have an 8-bit network prefix.
• A maximum of 126 (2(POW)7 -2) /8 networks can be
defined. The calculation subtracts two because the /8
network 0.0.0.0 is reserved for use as the default route
and the /8 network 127.0.0.0 (also written 127/8 or
127.0.0.0/8) is reserved for the “loopback” function.
Class A Networks (/8 Prefixes)
• Each /8 supports a maximum of 2(POW)24 -2
(16,777,214) hosts per network
• The host calculation subtracts two because the all-0s
(all zeros or “this network”) and all-1s (all ones or
“broadcast”) host numbers may not be assigned to
individual hosts.
• Since the /8 address block contains 2(POW)31
(2,147,483,648 ) individual addresses and the IPv4
address space contains a maximum of 2(POW)32
(4,294,967,296) addresses, the /8 address space is 50
percent of the total IPv4 unicast address space.
Class B Networks (/16 Prefixes)
• Each Class B network address has a 16-bit network
prefix, with the two highest order bits set to 1-0 and a
14-bit network number, followed by a 16-bit host
number.
• Class B networks are now referred to as “/16s” since
they have a 16-bit network prefix.
• A maximum of 16,384 (2(POW)14 ) /16 networks can
be defined with up to 65,534 (2(POW)16-2) hosts per
network.
• Since the entire /16 address block contains 2(POW)30
(1,073,741,824) addresses, it represents 25 percent of
the total IPv4 unicast address space.
Class C Networks (/24 Prefixes)
• Each Class C network address has a 24-bit network
prefix, with the three highest order bits set to 1-1-0
and a 21-bit network number, followed by an 8-bit host
number.
• Class C networks are now referred to as “/24s” since
they have a 24-bit network prefix.
• A maximum of 2,097,152 (2(POW)21 ) /24 networks
can be defined with up to 254 (2(POW)8-2) hosts per
network.
• Since the entire /24 address block contains 2(POW)29
(536,870,912) addresses, it represents 12.5 percent (or
one eighth) of the total IPv4 unicast address space.
Other Classes
• In addition to the three most popular classes,
there are two additional classes.
• Class D addresses have their leading four bits
set to 1-1-1-0 and are used to support IP
Multicasting.
• Class E addresses have their leading four bits
set to 1-1-1-1 and are reserved for
experimental use.
Dotted-Decimal Notation
• To make Internet addresses easier for people to
read and write, IP
• addresses are often expressed as four decimal
numbers, each separated by a dot.
• This format is called “dotted-decimal notation.”
Dotted-decimal notation divides the 32-bit
Internet address into four 8- bit fields and
specifies the value of each field independently as
a decimal number with the fields separated by
dots.
Unforeseen Limitations to Classful
Addressing
• During the early days of the Internet, the seemingly
unlimited address space allowed IP addresses to be
allocated to an organization based on its request rather
than its actual need. As a result, addresses were freely
assigned to those who asked for them without
concerns about the eventual depletion of the IP
address space.
• The decision to standardize on a 32-bit address space
meant that there were only 2(POW)32 (4,294,967,296)
IPv4 addresses available. A decision to support a
slightly larger address space would have exponentially
increased the number of addresses thus eliminating
the current address shortage problem.
Unforeseen Limitations to Classful
Addressing
• The classful A, B, and C octet boundaries were easy to understand
and implement, but they did not foster the efficient allocation of a
finite address space.
• Problems resulted from the lack of a network class that was
designed to support medium-sized organizations.
• For example, a /24, which supports 254 hosts, is too small while a
/16, which supports 65,534 hosts, is too large.
• In the past, sites with several hundred hosts were assigned a single
/16 address instead of two /24 addresses.
• This resulted in a premature depletion of the /16 network address
space. Now the only readily available addresses for medium-sized
organizations are /24s, which have the potentially negative impact
of increasing the size of the global Internet’s routing table.
A, B, C Networks
Subnetting
• Subnetting was introduced to overcome some of the
problems that parts of the Internet were beginning to
experience with the classful two-level addressing
hierarchy, such as:
• Internet routing tables were beginning to grow.
• Local administrators had to request another network
number from the Internet before a new network could
be installed at their site.
• Both of these problems were attacked by adding
another level of hierarchy to the IP addressing
structure. Instead of the classful two-level hierarchy,
subnetting supports a three-level hierarchy.
Subnetting
• The basic idea of subnetting, which is to divide
the standard classfull host number field into
two parts-the subnet number and the host
number on that subnet
Subnetting
• Subnetting attacked the expanding routing table problem by
ensuring that the subnet structure of a network is never visible
outside of the organization’s private network.
• The route from the Internet to any subnet of a given IP address is
the same, no matter which subnet the destination host is on.
• This is because all subnets of a given network number use the same
network prefix but different subnet numbers.
• The routers within the private organization need to differentiate
between the individual subnets, but as far as the Internet routers
are concerned, all of the subnets in the organization are collected
into a single routing table entry.
• This allows the local administrator to introduce arbitrary complexity
into the private network without affecting the size of the Internet’s
routing tables.
Subnet Design Considerations
• How many total subnets does the organization
need today?
• How many total subnets will the organization
need in the future?
• How many hosts are on the organization’s
largest subnet today?
• How many hosts will there be on the
organization’s largest subnet in the future?
Subnet Design Considerations
• The first step in the planning process is to take the maximum
number of subnets required and round up to the nearest power of
two.
• For example, if an organization needs nine subnets, 2pow3 (or 8)
will not provide enough subnet addressing space, so the network
administrator will need to round up to 2pow4 (or 16).
• The network administrator must always allow adequate room for
growth.
• For example, although 14 subnets are required today, 16 subnets
might not be enough in two years when the 17th subnet needs to
be deployed. In this case, it would be wise to select 2pow5 (or 32)
as the maximum number of subnets.
Subnet Design Considerations
• The second step is to ensure that there are enough host addresses for the
organization’s largest subnet. If the largest subnet needs to support 50
host addresses today, 25 (or 32) will not provide enough host address
space so the network administrator will need to round up to 26 (or 64).
• The final step is to make sure that the organization’s address allocation
provides enough bits to deploy the required subnet addressing plan.
• For example, if the organization has a single /16, it could easily deploy 4
bits for the subnet number and 6 bits for the host number.
• However, if the organization has several /24s and it needs to deploy nine
subnets, it may have to subnet each of its /24s into four subnets (using 2
bits) and then build the network by combining the subnets of three /24
network numbers.
• An alternative solution would be to deploy network numbers from the
private address space (RFC 1918) for internal connectivity and use a
Network Address Translator (NAT) to provide external Internet access.
Subnetting Example
• An organization is assigned the network
number 193.1.1.0/24 and it needs to define
six subnets. The largest subnet is required to
support 25 hosts.
Defining the Subnet Mask / Extended
Prefix Length
• The first step in defining the subnet mask is to determine the number of
bits required to define the six subnets.
• Since a network address can only be subnetted along binary boundaries,
subnets must be created in blocks of powers of two [2 (2(POW)1), 4
(2(POW)2), 8 (2(POW)3), 16 (2(POW)4), and so on].
• Thus, it is impossible to define an IP address block such that it contains
exactly six subnets.
• For this example, the network administrator must define a block of 8
(2(POW)3) and have two unused subnets that can be reserved for future
growth.
• Since 8 = 2(POW)3, three bits are required to enumerate the eight subnets
in the block.
• In this example, the organization is subnetting a /24 so it will need three
more bits, or a /27, as the extended network prefix. A 27-bit extended
network prefix can be expressed in dotted-decimal notation as
255.255.255.224.
Defining the Subnet Mask / Extended
Prefix Length

• A 27-bit extended network prefix leaves 5 bits to define


host addresses on each subnet.
• This means that each subnetwork with a 27-bit prefix
represents a contiguous block of 2(POW)5 (32)
individual IP addresses. However, since the all-0s and
all-1s host addresses cannot be allocated, there are 30
(25-2) assignable host addresses on each subnet.
Defining the Subnet Numbers
• The eight subnets will be numbered 0 through 7., the
XXX notation indicates the binary representation of the
number.
• The 3-bit binary representation of the decimal values 0
through 7 are: 0 (000 ), 1 (001 ), 2 (010 ), 3 (011 ), 4
(100 ), 5(101 ), 6 (110 ), and 7 (111 ).
• In general, to define Subnet #N, the network
administrator places the binary representation of N
into the bits of the subnet number field.
• For example, to define Subnet #6, the network
administrator simply places the binary representation
of 6 (110 ) into the 3 bits of the subnet number field.
Defining the Subnet Numbers
• The eight subnet numbers for this example are
listed in the following code sample. The
underlined portion of each address identifies
the extended network prefix, while the bold
digits identify the 3 bits representing the
subnet number field:
The All-0s Subnet and All-1s Subnet
• With respect to the all-0s subnet, a router requires that
each routing table update include the route/<prefix
length> pair to differentiate between a route to the all-
0s subnet and a route to the entire network.
• For example, when using RIP-1which does not supply a
mask or prefix length with each route, the routing
advertisements for subnet 193.1.1.0/27 and for
network 193.1.1.0/24 are identical-193.1.1.0. Without
somehow knowing the prefix length or mask, a router
cannot tell the difference between a route to the all-0s
subnet and the route to the entire network.
The All-0s Subnet and All-1s Subnet
• Regarding the all-1s subnet, a router requires that
each routing table entry include the prefix length
so that it can determine whether a broadcast
(directed or all-subnets) should be sent only to
the all-1s subnet or to the entire network.
• For example, when the routing table does not
contain a mask or prefix length for each route,
confusion can occur because the same broadcast
address (193.1.1.255) is used for both the entire
network 193.1.1.0/24 and the all-1s subnet
193.1.1.224/27. This
Defining Host Addresses for Each
Subnet
• According to Internet practices, the host number field
of an IP address cannot contain all 0-bits or all 1-bits.
The all-0s host number identifies the base network (or
subnetwork) number, while the all-1s host number
represents the broadcast address for the network (or
subnetwork).
• In our current example, there are 5 bits in the host
number field of each subnet address. This means that
each subnet represents a block of 30 host addresses
(25 -2 = 30, note that the 2 is subtracted because the
all-0s and the all-1s host addresses cannot be used).
• The hosts on each subnet are numbered 1 through 30.
Defining Host Addresses for Each
Subnet
• In general, to define the address assigned to
Host #N of a particular subnet, the network
administrator places the binary representation
of N into the subnet’s host number field.
• For example, to define the address assigned to
Host #15 on Subnet #2, the network
administrator simply places the binary
representation of 15 (011112 ) into the 5-bits
of Subnet #2’s host number field.
Valid Hosts of Subnet2
• Subnet #2: 11000001.00000001.00000001.010 00000 = 193.1.1.64/27
• Host #1: 11000001.00000001.00000001.010 00001 = 193.1.1.65/27
• Host #2: 11000001.00000001.00000001.010 00010 = 193.1.1.66/27
• Host #3: 11000001.00000001.00000001.010 00011 = 193.1.1.67/27
• Host #4: 11000001.00000001.00000001.010 00100 = 193.1.1.68/27
• Host #5: 11000001.00000001.00000001.010 00101 = 193.1.1.69/27
• .
• .
• Host #15: 11000001.00000001.00000001.010 01111 = 193.1.1.79/27
• Host #16: 11000001.00000001.00000001.010 10000 = 193.1.1.80/27
• .
• .
• Host #27: 11000001.00000001.00000001.010 11011 = 193.1.1.91/27
• Host #28: 11000001.00000001.00000001.010 11100 = 193.1.1.92/27
• Host #29: 11000001.00000001.00000001.010 11101 = 193.1.1.93/27
• Host #30: 11000001.00000001.00000001.010 11110 = 193.1.1.94/27
Valid Hosts of Subnet6
• Subnet #6: 11000001.00000001.00000001.110 00000 = 193.1.1.192/27
• Host #1: 11000001.00000001.00000001.110 00001 = 193.1.1.193/27
• Host #2: 11000001.00000001.00000001.110 00010 = 193.1.1.194/27
• Host #3: 11000001.00000001.00000001.110 00011 = 193.1.1.195/27
• Host #4: 11000001.00000001.00000001.110 00100 = 193.1.1.196/27
• Host #5: 11000001.00000001.00000001.110 00101 = 193.1.1.197/27
• .
• .
• Host #15: 11000001.00000001.00000001.110 01111 = 193.1.1.207/27
• Host #16: 11000001.00000001.00000001.110 10000 = 193.1.1.208/27
• .
• .
• Host #27: 11000001.00000001.00000001.110 11011 = 193.1.1.219/27
• Host #28: 11000001.00000001.00000001.110 11100 = 193.1.1.220/27
• Host #29: 11000001.00000001.00000001.110 11101 = 193.1.1.221/27
• Host #30: 11000001.00000001.00000001.110 11110 = 193.1.1.222/27
Defining the Broadcast Address for
Each Subnet
• The broadcast address for Subnet #2 is the all-1s
host address or:
• 11000001.00000001.00000001.010 11111 =
193.1.1.95
• Note that the broadcast address for Subnet #2 is
exactly one less than the base address for Subnet
#3 (193.1.1.96).
• This is always the case-the broadcast address for
Subnet #n is one less than the base address for
Subnet #(n+1).
Defining the Broadcast Address for
Each Subnet
• The broadcast address for Subnet #6 is simply
the all-1s host address or:
• 11000001.00000001.00000001.110 11111 =
193.1.1.223
• Again, the broadcast address for Subnet #6 is
exactly one less than the base address for
Subnet #7 (193.1.1.224)
Subnet Example #2

• An organization is assigned the network


number 140.25.0.0/16 and it must create a set
of subnets that supports up to 60 hosts on
each subnet.
Subnet Example #2

• The first step is to determine the number of bits


required to define 60 hosts on each subnet.
• To support 60 hosts, the network administrator must
define a minimum address block of 62 (26-2) host
addresses. However, this choice would only provide
two unused host addresses on each subnet for future
growth, which is not likely to support additional
growth.
• The network administrator must define a block of 126
(27-2) host addresses with 66 addresses on each
subnet for future growth. A block of 126 host
addresses requires 7 bits in the host number field.
Subnet Example #2
• The next step is to determine the subnet
mask/extended prefix length.
• Since 7 bits of the 32-bit IP address are
required for the host number field, the
extended prefix must be a /25 (25 = 32-7).
• A 25-bit extended network prefix can be
expressed in dotted-decimal notation as
255.255.255.128
Defining Each of the Subnet Numbers
• The 512 subnets will be numbered 0 through 511. The 9-bit
binary representation of the decimal values 0 through 511
are: 0 (0000000002 ), 1 (0000000012 ), 2 (0000000102 ), 3
(0000000112 ), ..., 511 (1111111112 ).
• To define Subnet #3, the network administrator places the
binary representation of 3 (0000000112 ) into the 9 bits of
the subnet number field.
• The 512 subnet numbers for this example are listed in the
following sample code.
• The underlined portion of each address identifies the
extended network prefix, while the bold digits identify the
9 bits representing the subnet number field.
Defining Each of the Subnet Numbers
• Base Net: 10001100.00011001 .00000000.00000000 = 140.25.0.0/16
• Subnet #0: 10001100.00011001.00000000.0 0000000 = 140.25.0.0/25
• Subnet #1: 10001100.00011001.00000000.1 0000000 = 140.25.0.128/25
• Subnet #2: 10001100.00011001.00000001.0 0000000 = 140.25.1.0/25
• Subnet #3: 10001100.00011001.00000001.1 0000000 = 140.25.1.128/25
• Subnet #4: 10001100.00011001.00000010.0 0000000 = 140.25.2.0/25
• Subnet #5: 10001100.00011001.00000010.1 0000000 = 140.25.2.128/25
• Subnet #6: 10001100.00011001.00000011.0 0000000 = 140.25.3.0/25
• Subnet #7: 10001100.00011001.00000011.1 0000000 = 140.25.3.128/25
• Subnet #8: 10001100.00011001.00000100.0 0000000 = 140.25.4.0/25
• Subnet #9: 10001100.00011001.00000100.1 0000000 = 140.25.4.128/25
• .
• .
• Subnet #510: 10001100.00011001.11111111.0 0000000 = 140.25.255.0/25
• Subnet #511: 10001100.00011001.11111111.1 0000000 = 140.25.255.128/25
Defining Host Addresses for Each
Subnet
• In this example there are 7 bits in the host
number field of each subnet address, which
means that each subnet represents a block of 126
host addresses.
• The hosts on each subnet are numbered 1
through 126.
• The valid host addresses for Subnet #3 are listed
in the following sample code.
• The underlined portion of each address identifies
the extended network prefix, while the bold
digits identify the 7-bit host number field:
Defining Host Addresses for Each
Subnet
• Subnet #3: 10001100.00011001.00000001.1 0000000 = 140.25.1.128/25
• Host #1: 10001100.00011001.00000001.1 0000001 = 140.25.1.129/25
• Host #2: 10001100.00011001.00000001.1 0000010 = 140.25.1.130/25
• Host #3: 10001100.00011001.00000001.1 0000011 = 140.25.1.131/25
• Host #4: 10001100.00011001.00000001.1 0000100 = 140.25.1.132/25
• Host #5: 10001100.00011001.00000001.1 0000101 = 140.25.1.133/25
• Host #6: 10001100.00011001.00000001.1 0000110 = 140.25.1.134/25
• .
• .
• Host #62: 10001100.00011001.00000001.1 0111110 = 140.25.1.190/25
• Host #63: 10001100.00011001.00000001.1 0111111 = 140.25.1.191/25
• Host #64: 10001100.00011001.00000001.1 1000000 = 140.25.1.192/25
• Host #65: 10001100.00011001.00000001.1 1000001 = 140.25.1.193/25
• .
• .
• Host #123: 10001100.00011001.00000001.1 1111011 = 140.25.1.251/25
• Host #124: 10001100.00011001.00000001.1 1111100 = 140.25.1.252/25
• Host #125: 10001100.00011001.00000001.1 1111101 = 140.25.1.253/25
• Host #126: 10001100.00011001.00000001.1 1111110 = 140.25.1.254/25
Defining the Broadcast Address for
Each Subnet
• The broadcast address for Subnet #3 is the all-
1s host address or:
• 10001100.00011001.00000001.1 1111111 =
140.25.1.255
• The broadcast address for Subnet #3 is exactly
one less than the base address for Subnet #4
(140.25.2.0

Anda mungkin juga menyukai