Sie sind auf Seite 1von 6

Medi-Caps Institute of Technology and Management, Indore

Department of Electronics Engineering (EC/EI)


Computer Network (EC-803)

EXPERIMENT No: 2

AIM: Study IP Addressing.


Objective: Students will learn concepts of IP addressing and subnetting.

Following topics are covered:


1. IP addressing fundamentals.
2. Classful IP addressing.
3. Subnet masks.
4. Routing and routing protocols.

1. IP addressing fundamental

The IP address is a 32-bit address that consists of two components network bits and host bits as
shown in Figure 1.
32 Bit Address
NETWORK BITS HOST BITS

Figure 1
1.1 The mask

The network portion of the address is separated from the host portion of the address by a mask.
The mask simply indicates how many bits are used for the network portion, leaving the
remaining bits for the host portion. A 24-bit mask indicates that the first 24 bits of the address
are network bits, and the remaining 8 bits are host bits. A 16-bit mask indicates that the first 16
bits of the address are network bits, and the remaining 16 bits are host bits.

1.2 Dotted Decimal notation

Machines read the IP address as a stream of 32 bits. However, for human consumption, the IP
address is written in dotted decimal notation. The 32-bit address is divided into 4 groups of 8 bits
(an octet or a byte). Each octet is written as a decimal number ranging from 0 to 255.The decimal
numbers are separated by periods, or dots. For ex., IP address shown in Figure 2 is
192.168.32.10.

11000000 .10101000.00100000.00001010
192 168 32 10

Figure 2
Network, host and broadcast addresses

For a given IP network, the network bits remain fixed and the host bits vary.
- The network address is the one that results when all the host bits are not set (the result of
performing an AND operation on the address and its mask).
- The broadcast address is the one that results when all the host bits are set. Host addresses
are those that result with all remaining combinations of the host bits.

24-bit Mask (255.255.255.0)

16-bit Mask (255.255.0.0)

1.3 Formula to determine number of hosts on a given network

Given that there are N host bits in an address, the number of hosts for that network is 2N - 2. Two
addresses are subtracted for the network address and the broadcast address.
8 host bits: 28 - 2 = 254 hosts
16 host bits: 216 - 2 = 65534 hosts
24 host bits: 224 - 2 = 16777214 hosts

1.4 Public addresses

Most IP addresses are public addresses. Public addresses are registered as belonging to a specific
organization. Internet Service Providers (ISP) and extremely large organizations in the U.S.
obtain blocks of public addresses from the American Registry for Internet Numbers (ARIN).
Other organizations obtain public addresses from their ISPs. There are ARIN counterparts in
other parts of the world, and all of these regional registration authorities are subject to the global
Internet Assigned Numbers Authority (IANA). Public IP addresses are routed across the Internet,
so that hosts with public addresses may freely communicate with one another globally. No
organization is permitted use public addresses that are not registered with that organization.

1.5 Private addresses

RFC 1918 designates the following as private addresses.


– Class A range: 10.0.0.0 through 10.255.255.255.
– Class B range: 172.16.0.0 through 172.31.255.255.
– Class C range: 192.168.0.0 through 192.168.255.255.

Private addresses may be used by any organization, without any requirement for registration.
Because private addresses are ambiguous - can’t tell where they’re coming from or going to
because anyone can use them – private addresses are not permitted to be routed across the
Internet. ISPs block private addresses from being routed across their infrastructure. The use of
private addresses, network address translation (NAT), and proxy servers solved the IP address
shortage problem for the short and medium terms. The projected long-term solution is IPv6.

2 Classful IP addressing

2.1 The three main classes

Class A networks
– First octet values range from 1 through 126.
– First octet starts with bit 0.
– Network mask is 8 bits, written as /8 or 255.0.0.0.
– 1.0.0.0 through 126.0.0.0 are class A networks with 16777214 hosts each.
Class B networks
– First octet values range from 128 through 191.
– First octet starts with binary pattern 10.
– Network mask is 16 bits, written as /16 or 255.255.0.0.
– 128.0.0.0 through 191.255.0.0 are class B networks, with 65534 hosts each.
Class C networks
– First octet values range from 192 through 223.
– First octet starts with binary pattern 110.
– Network mask is 24 bits, written as /24 or 255.255.255.0.
– 192.0.0.0 through 223.255.255.0 are class C networks, with 254 hosts each.
Two additional classes, and reserved addresses are:
Class D addresses
– First octet values range from 224 through 239.
– First octet starts with binary pattern 1110.
– Class D addresses are multicast addresses.
• Class E addresses
– Experimental class.
Reserved addresses
– 0.0.0.0 is the default IP address, and it is used to specify a default route.

–Addresses beginning with 127 are reserved for internal loopback addresses.
Local host IP address used is 127.0.0.1.

2.2 The need to improve IP addressing efficiency

As IP networking and internetworking progressed, it became very apparent that class A and B
networks were simply too large.

254 hosts on one network segment are manageable, but 65534 hosts or more on a single network
segment is difficult to manage. This would result in class A and B networks not being fully
utilized, meaning that not all the host addresses would get used, or it would result in more hosts
being put onto a single network segment than could reasonably be managed. For these and other
reasons, there was a need to improve the efficiency of IP addressing. That is, to provide a way to
limit the number of host addresses per network segment to what is actually needed, regardless of
the network class. This need was met progressively through the conceptions of subnet masks,
variable-length subnet masks (VLSM), and classless inter-domain routing (CIDR).

3 Subnet masks

Subnet masks are used to make classful networks more manageable and efficient, by creating
smaller subnets (sub networks) and reducing the number of host addresses per subnet to what is
actually required. Subnet masks were first used on class boundaries.

Extended Network Prefix

The extended network prefix has traditionally been identified by the subnet mask. For example,
if an administrator has the /16 address of 130.5.0.0 and wants to use the entire third octet to
represent the subnet number, the administrator must specify a subnet mask of 255.255.255.0.
The standards describing modern routing protocols often refer to the extended network prefix
length rather than the subnet mask. The prefix length is equal to the number of contiguous one-
bits in the traditional subnet mask. This means that specifying the network address 130.5.5.25
with a subnet mask of 255.255.255.0 can also be expressed as 130.5.5.25/24. However, each
routing protocol is still required to carry the complete four-octet subnet mask.

3.1 Subnet Design Consideration


Subnet design is done considering the number of sub networks and maximum number of hosts
present in a subnet in the organization and future growth.

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, 23 (or
8) will not provide enough subnet addressing space, so the network administrator will need to
round up to 24 (or 16).

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).

Example 1. 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.

Number of subnets = 6 (Considering in powers of 2, the nearest number is 8).


Since 23=8, therefore, 3 bits will be used to create subnets. 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.

A 27-bit extended network prefix leaves 5 bits to define host addresses on each subnet. So,
maximum number of host that can be addressed in a subnet will be 30 (25-2=30). Sine all 1’s is
used for broadcast addressing and all 0’s for sub network address.
The sub network address assigned will be as follows,
Base Network address: 193.1.1.0/24
Subnet 0: 11000001.00000001.00000001.000 00000 = 193.1.1.0/27
Subnet 1: 11000001.00000001.00000001.001 00000 = 193.1.1.32/27
Subnet 2: 11000001.00000001.00000001.010 00000 = 193.1.1.64/27
Subnet 3: 11000001.00000001.00000001.011 00000 = 193.1.1.96/27
Subnet 4: 11000001.00000001.00000001.100 00000 = 193.1.1.128/27
Subnet 5: 11000001.00000001.00000001.101 00000 = 193.1.1.160/27
Subnet 6: 11000001.00000001.00000001.110 00000 = 193.1.1.192/27
Subnet 7: 11000001.00000001.00000001.111 00000 = 193.1.1.224/27

Subnet address having all 0’s and 1’s are prohibited to use to avoid confusion between classful
and classless addressing and routing.

Valid subnet and host address for subnet 2 are,


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 #30: 11000001.00000001.00000001.010 11110 = 193.1.1.94/27

4. Assignment

1. Complete the following table which provides practice in converting a number from
binary notation to decimal format.

2. Express 145.32.59.24 in binary format and identify the address class:


3. Express 200.42.129.16 in binary format and identify the address class:
4. Express 14.82.19.54 in binary format and identify the address class:
5. 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.
6. An organization has been assigned the 132.45.0.0/16 network block to establish eight subnets.
Answer the following.
a. __________ binary digits are required to define eight subnets.
b. Specify the extended network prefix that allows the creation of eight subnets.
c. Express the subnets in binary format and dotted-decimal notation:
d. List the range of host addresses that can be assigned to Subnet #3
(132.45.96.0/19).
e. What is the broadcast address for Subnet #3 (132.45.96.0/19)?

Das könnte Ihnen auch gefallen