Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 13

EXPERIMENT: 4

CONCEPT OF NETWORK IP ADDRESS


AIM: To study the concept of network IP address.
APPARATUS: (software) NA.

THEORY:
IP addressing is important because it facilitates the primary function of the Internet Protocol—the
delivery of datagrams across an internetwork .
IP Address Functions: Identification and Routing:
 Network Interface Identification: Like a street address, the IP address provides unique
identification of the interface between a device and the network. This is required to ensure that
the datagram is delivered to the correct recipients.
 Routing: When the source and destination of an IP datagram are not on the same network, the
datagram must be delivered “indirectly” using intermediate systems, a process called routing. The
IP address is an essential part of the system used to route datagrams.
Number of IP Addresses per Device:
 Any device that has data sent to it at the network layer will have at least one IP address: one per
network interface.
 Normal hosts such as computers and network-capable printers usually get one IP address, while
routers get more than one IP address. Some special hosts may have more than one IP address if
they are multihomed—connected to more than one network.
 Lower-level network interconnection devices such as repeaters, bridges and switches don't
require an IP address because they pass traffic based on layer two (data link layer) addresses.
 Network segments connected by bridges and switches form a single broadcast domain and any
devices on them can send data to each other directly without routing.
 To the Internet Protocol, these devices are “invisible”, they are no more significant than the wires
that connect devices together (with a couple of exceptions). Such devices may, however,
optionally have an IP address for management purposes.
IP Address "Dotted Decimal" Notation:
 IP addresses are 32-bit binary numbers, which can be expressed in binary, hexadecimal or
decimal form.
 Most commonly, they are expressed by dividing the 32 bits into four bytes and converting each to
decimal, then separating these numbers with dots to create dotted decimal notation.
 IP addresses are normally expressed with each octet of 8 bits converted to a decimal number and
the octets separated by a period (a “dot”).
 Each of the octets in an IP address can take on the values from 0 to 255.
 The lowest value is theoretically 0.0.0.0 and the highest is 255.255.255.255.
 Since IP addresses are 32 bits long, the total address space of IPv4 is 232 or 4,294,967,296
addresses. However, not all of these addresses can be used, for a variety of reasons.
Internet IP Address Structure:
 Network Identifier (Network ID): A certain number of bits, starting from the left-most bit, is
used to identify the network where the host or other network interface is located. This is also
sometimes called the network prefix or even just the prefix.
 Host Identifier (Host ID): The remainder of the bits are used to identify the host on the network.
(IP devices are often called hosts).
 IP address = Network ID + Host ID.

IP Address Formats:

 Conventional (“Classful”) Addressing:


 Originally IP addresses were divided into five classes as shown below.
 Classes A, B and C are the most important: the initial bits determine which class an address
belongs to, and the classes differ in how much of the address is taken up with the network
address and how much with the host address.
Note:
 IP addresses are globally managed by Internet Assigned Numbers Authority(IANA) and
regional Internet registries(RIR).
 The number of networks and the number of hosts per class can be derived by this formula

 When calculating hosts' IP addresses, 2 IP addresses are decreased because they cannot
be assigned to hosts, i.e. the first IP of a network is network number and the last IP is
reserved for Broadcast IP.
Class A:
 The first bit of the first octet is always set to 0 (zero). Thus the first octet ranges from 1 –
127, i.e.

00000001 = 0x2^7+0x2^6+0x2^5+0x2^4 +0x2^3+0x2^2+0x2^1+0x2^0 =1.

01111111 = 0x2^7+1x2^6+1x2^5+1x2^4 +1x2^3+1x2^2+1x2^1+1x2^0 =127.

 Class A addresses only include IP starting from 1.x.x.x to 126.x.x.x only. The IP range
127.x.x.x is reserved for loopback IP addresses.
 The default subnet mask for Class A IP address is 255.0.0.0 which implies that Class A
addressing can have 126 networks (27-2) and 16777214 hosts (224-2).
 Class A IP address format is thus:
0NNNNNNN.HHHHHHHH.HHHHHHHH.HHHHHHHH

Class B Address:
 An IP address which belongs to class B has the first two bits in the first octet set to 10,
i.e.

10000000 = 1x2^7+0x2^6+0x2^5+0x2^4 +0x2^3+0x2^2+0x2^1+0x2^0 =128.

10111111 = 1x2^7+0x2^6+1x2^5+1x2^4 +1x2^3+1x2^2+1x2^1+1x2^0 =191.

 Class B IP Addresses range from 128.0.x.x to 191.255.x.x. The default subnet mask for
Class B is 255.255.x.x.
 Class B has 16384 (214) Network addresses and 65534 (216-2) Host addresses.
 Class B IP address format is:
10NNNNNN.NNNNNNNN.HHHHHHHH.HHHHHHHH

Class C Address:
 The first octet of Class C IP address has its first 3 bits set to 110, that is −

11000000 = 1x2^7+1x2^6+0x2^5+0x2^4 +0x2^3+0x2^2+0x2^1+0x2^0 =192.

11011111 = 1x2^7+1x2^6+0x2^5+1x2^4 +1x2^3+1x2^2+1x2^1+1x2^0 =223.

 Class C IP addresses range from 192.0.0.x to 223.255.255.x. The default subnet mask for Class C
is 255.255.255.x.
 Class C gives 2097152 (221) Network addresses and 254 (28-2) Host addresses.
 Class C IP address format is: 110NNNNN.NNNNNNNN.NNNNNNNN.HHHHHHHH

Class D Address:
Very first four bits of the first octet in Class D IP addresses are set to 1110, giving a range of −

11100000 = 1x2^7+1x2^6+1x2^5+0x2^4 +0x2^3+0x2^2+0x2^1+0x2^0 =224.

11101111 = 1x2^7+1x2^6+1x2^5+0x2^4 +1x2^3+1x2^2+1x2^1+1x2^0 =239.

 Class D has IP address range from 224.0.0.0 to 239.255.255.255.


 Class D is reserved for Multicasting.
 In multicasting data is not destined for a particular host, that is why there is no need to extract
host address from the IP address, and Class D does not have any subnet mask.

Class E Address:
This IP Class is reserved for experimental purposes only for R&D or Study. IP addresses in this
class ranges from 240.0.0.0 to 255.255.255.254. Like Class D, this class too is not equipped with
any subnet mask.

Each IP class is equipped with its own default subnet mask which bounds that IP class to have
prefixed number of Networks and prefixed number of Hosts per network. Classful IP addressing
does not provide any flexibility of having less number of Hosts per Network or more Networks
per IP Class
Range of special IP addresses:
169.254.0.0 – 169.254.0.16 : Link local addresses
127.0.0.0 – 127.0.0.8 : Loop-back addresses
0.0.0.0 – 0.0.0.8 : used to communicate within the current network.

Rules for assigning Host ID:


Host ID’s are used to identify a host within a network. The host ID are assigned based on the following
rules:
 Within any network, the host ID must be unique to that network.
 Host ID in which all bits are set to 0 cannot be assigned because this host ID is used to represent
the network ID of the IP address.
 Host ID in which all bits are set to 1 cannot be assigned because this host ID is reserved as a
broadcast address to send packets to all the hosts present on that particular network.

Rules for assigning Network ID:


Hosts that are located on the same physical network are identified by the network ID, as all host on the
same physical network is assigned the same network ID. The network ID is assigned based on the
following rules:
 The network ID cannot start with 127 because 127 belongs to class A address and is reserved for
internal loop-back functions.
 All bits of network ID set to 1 are reserved for use as an IP broadcast address and therefore,
cannot be used.
 All bits of network ID set to 0 are used to denote a specific host on the local network and are not
routed and therefore, aren’t used.

Classful addressing :

 Classful networking was replaced by Classless Inter-Domain Routing (CIDR) in 1993.


 The division between Network and node was accomplished using a technique called subnetting.

 CIDR or Classless Inter Domain Routing provides the flexibility of borrowing bits of Host part
of the IP address and using them as Network in Network, called Subnet. By using subnetting, one
single Class A IP address can be used to have smaller sub-networks which provides better
network management capabilities.
 There are two versions of IP addresses: IPv4 and IPv6, and they have different formats, the major
difference between them being that it’s possible to create vastly more unique IPv6 addresses (2 128)
than IPv4 addresses (232).

Procedure:

To find ip address:
 Go to Command prompt.
 Type “ipconfig” in the command prompt and press ‘Enter’,
This gives us the IP address of the device in terms of IP4 and IP6.

Result : study of IP address is done.


EXPERIMENT: 5
CONCEPT OF NETID USING MASKS
AIM: To study the concept of Identification of NET ID using masks.
APPARATUS: (software) NA.

THEORY:
 An IP address consists of two parts, i.e., the first one is a network address, and the other one is a
host address.
 There are two types of IP addresses:
 IPv4
 IPv6
 IPv4:
Is a version 4 of IP. It is a current version and the most commonly used IP address.
It is a 32-bit address numeric addressing method written in four numbers separated by 'dot', i.e.,
periods. This address is unique for each device, offers 12 header fields and support VLSM
(Virtual Length Subnet Mask).

 IPv6:
IPv6 (Internet Protocol version 6) is the sixth revision to the Internet Protocol and the successor
to IPv4. It functions similarly to IPv4 in that it provides the unique IP addresses necessary for
Internet-enabled devices to communicate. It utilizes a 128-bit IP address. Alphanumeric
addressing method. Bits are separated by a colon (:). It offers 8 header fields and Do not support
VLSM (Virtual Length Subnet Mask).
Subnet /Subnetwork:

 The Internet Protocol (IP) is the method for sending data from one computer to another over the
internet. Each computer, or host, on the internet has at least one IP address as a unique identifier.
 CIDR or Classless Inter Domain Routing provides the flexibility of borrowing bits of Host part
of the IP address and using them as Network in Network, called Subnet.
 Subnets are a logical partition of an IP network into multiple, smaller network segments (A
subnet, or subnetwork, is a segmented piece of a larger network).
 Each of these subnets has its own specific address. To create these additional networks we use a
subnet mask.
 The subnet mask simply determines which portion of the IP address belongs to the host.
 A subnet address is created by borrowing bits from the host field and designating them as subnet
field.
 The subnet address is created by dividing the host address into network address and host address.
 The network address specifies the type of subnetwork in the network and the host address
specifies the host of that subnet.

 Subnets are under local administration. As such, the outside world sees an organization as a
single network and has no detailed knowledge of the organization’s intema1 structure.
 Subnetting provides the network administrator with several benefits, including extra
flexibility, more efficient use of network address and the capability to contain broadcast
traffic
 The size of a subnet depends on the connectivity requirements and the network
technology employed.
 A point-to-point subnet allows two devices to connect, while a data center subnet might
be designed to connect many more devices.
 Each organization is responsible for determining the number and size of the subnets it
creates, within the limits of the address space available for its use.

 Computers that belong to a subnet are addressed with an identical most-significant bit-group in
their IP addresses. This results in the logical division of an IP address into two fields: the network
number or routing prefix and the rest field or host identifier. The rest field is an identifier for a
specific host or network interface.
 A subnet mask is like an IP address, but for only internal usage within a network. Routers use
subnet masks to route data packets to the right place. Subnet masks are not indicated within data
packets traversing the Internet — those packets only indicate the destination IP address, which a
router will match with a subnet.
 The routing prefix may be expressed in Classless Inter-Domain Routing (CIDR) notation written
as the first address of a network, followed by a slash character (/), and ending with the bit-length
of the prefix.
 For example, 198.51.100.0/24 is the prefix of the Internet Protocol version 4 network
starting at the given address, having 24 bits allocated for the network prefix, and the
remaining 8 bits reserved for host addressing. Addresses in the range 198.51.100.0 to
198.51.100.255 belong to this network. Or For example, 255.255.255.0 is the
subnet mask for the prefix 198.51.100.0/24.
 The IPv6 address specification 2001:db8::/32 is a large address block with 296 addresses,
having a 32-bit routing prefix.

Type of Subnetting
There are two types of Subnetting:
 Fixed Length Subnet Masks (FLSM)
 Variable Length Subnet Masks (VLSM)

 In FLSM, all subnets have equal number of host addresses and use same Subnet mask. It is easy
in implementation and simple in operation but wastes a lot of IP addresses.
 In VLSM, subnets have flexible number of host addresses and use different subnet mask. It is
hard in implementation and complex in operation but utilizes maximum IP addresses.

Following figure shows an example of FLSM and VLSM.


Note:
Class C: Net id bits = 24 and Host id bits= 8
Subnets = 2^8 =64

 There are two main types of IP address, public and private. Servers on the public Internet use
public addresses, while local networks of computers (e.g., your home network) use private
addresses. The following IP address ranges are private addresses:

 10.0.0.0 – 10.255.255.255
 172.16.0.0 – 172.31.255.255
 192.168.0.0 – 192.168.255.255

 Static Versus Dynamic IP Addresses:


 An IP address can be static or dynamic. A static IP address will never change and it is a
permanent Internet address. A dynamic IP address is a temporary address that is assigned
each time a computer or device accesses the Internet.
 The four numbers in an IP address are used in different ways to identify a particular network
and a host on that network. Four regional Internet registries -- ARIN, RIPE NCC, LACNIC
and APNIC-- assign Internet addresses from the following three classes:
Class A - supports 16 million hosts on each of 126 networks
Class B - supports 65,000 hosts on each of 16,000 networks
Class C - supports 254 hosts on each of 2 million networks
 The number of unassigned Internet addresses is running out, so a new classless
scheme called CIDR is gradually replacing the system based on classes A, B, and C
and is tied to adoption of IPv6. In IPv6 the IP address size is increased from 32 bits to
128 bits

 Network address
The network IP address is the first address of the subnet. You calculate it by converting the IP
address and subnet mask to binary and performing a bitwise AND logical operation. A router uses
this address to forward traffic to the correct network. It isn't possible to assign the network
address to a host.
 Broadcast address
A host can use the broadcast address to send data to all the other hosts on the subnet. It's the
last address on the subnet. We can calculate it by using the network address and adding the total
number of addresses (minus one) in the subnet.

 First and last host addresses


The next address after the network address is the first address available to be assigned to a host.
The address just before the broadcast address is the last address that you can allocate to a host.
 Wildcard mask
The wildcard mask is the subnet mask with the bits inverted, therefore selecting the host part of
the IP address.
 Total number of addresses
We can calculate the total number of addresses in a subnet from the CIDR using the following
formula:
total number of addresses = 2(32 - CIDR)

 Usable number of hosts


The network and broadcast addresses are not available to be assigned to hosts on the network. So,
the number of available addresses that you can assign to hosts is the total number of addresses
minus two.
 Binary subnet mask and IP address
These outputs are the subnet mask and IP address converted to binary format. These are helpful
when manually subnetting networks.
 CIDR notation
This result is the IP address in quad-dotted notation, followed by a forward-slash and the CIDR
number.

Eg : If IP address is given as 192.168.10.0/28

1. Find the subnet mask


Soln: Class C (192-223)
Default subnet mask is N.N.N.H: 255.255.255.0 (8+8+8+0)(32 bits)
IP address = Net Id+ Host Id
CIDR for class C = 24( but given is 28, so extra 4 bits is borrowed from host )
(11110000 = 240)

IP address = 192.168.10.0/28
Subnet mask = 255.255.255.240

1. How to find out the No. of network


Soln: formula : 2^n (n= total no of bits borrowed from host)
From the fig 4 bits are borrowed from host
2^4 =16
16 networks can be created.

2. How to find the number of IP address on each network.


Soln: formula : 2^n (n= total no of bits remaining in the host bits)

2^4 =16
One will have 16 IP address on each network.
3. How to find the number of hosts in each network
Soln: Formula 2^n – 2 (n= total no of bits remaining in the host bits)
( On every network first IP address is a Network Id
Last IP address a a Broadcast Id)
(for which we will subtract as 2)
2^2 – 2= 14 (14 Host IP address can exist on each Network)

Procedure:
 To know the logical address and subnet mask:
 Go to Command prompt.
 Type “ipconfig/all” in the command prompt and press ‘Enter’,
This gives us the -- IP address of the device in terms of IP4 and IP6.
-- subnet mask
Result: Study of Net id, Subnetting, Subnet Mask is done.

You might also like