IP Address
IP Addresses
IP run at network layer - it must be
capable of providing communication
between hosts on different kinds of
networks.
The address must include information
about what network the receiving host is
on.
IP Addresses
IP addresses are logical addresses (or internet address)
32 bits.
IPv4 (version 4)
Includes a network ID and a host ID.
Every host must have a unique IP address.
IP Address Format
The 32-bit IP address is grouped eight
bits at a time, separated by dots, and
represented in decimal format (known
as dotted decimal notation).
The minimum value for an octet is 0, and
The maximum value for an octet is 255.
IP Addresses
IP Addresses are usually shown in dotted
decimal notation:
[Link] 00000001 00000010 00000011 00000100
[Link] is [Link]
10000000 11010101 00000001 00000001
CS has a class B network
IP Addressing
Three fields of variable sizes (dependent on the class of the address)
◦ Class Type field defines the class (5 possible classes that an internet address is
part off)
◦ Network ID – up the class type, this field can be anywhere between 7 and 24 bits
◦ Host ID – up to the class type it can be anywhere between 8 and 24 bits
Internet Classes
ClassA, B are full; class C still has available addresses; D is reserved
for multicasting and class E is reserved for future use
IP Broadcast and Network
Addresses
An IP broadcast addresses has a host ID of all
1s.
An IP address that has a host ID of all 0s is
called a network address and refers to an entire
network.
IP Address High-Order No. Bits
Class Format Purpose Bit(s) Network/Host Max. Hosts
A N.H.H.H1 Few large 0 7/24 167772142
organizations (224 - 2)
B N.N.H.H Medium-size 1, 0 14/16 65534 (216 - 2)
organizations
C N.N.N.H Relatively 1, 1, 0 21/8 254 (28 - 2)
small
organizations
D N/A Multicast 1, 1, 1, 0 N/A (not for N/A
groups (RFC commercial
1112) use)
E N/A Experimental 1, 1, 1, 1 N/A N/A
Two levels of hierarchy
All the addresses on Internet have a network id and a host id
To reach a specific host, first reach to the network using the first
portion of the address;
then reach the host itself using the second portion of the IP address.
IP Subnet Addressing
IP networks can be divided into smaller
networks called subnetworks.
Subnetting provides the network
administrator with several benefits (extra
flexibility, more efficient use of network
addresses, and the capability to contain
broadcast traffic).
Subnets are under local administration.
Three level hierarchy network
IP Subnet Mask
Subnet mask is a 4 byte (32 bit) number used to
identify the sub-network ID and the host ID
from an IP address.
A subnet address is created by "borrowing"
bits from the host field and designating them as
the subnet field.
The number of borrowed bits varies and is
specified by the subnet mask.
Another Practical example
Consider network address [Link], create 254 subnets with 254 hosts per subnet
Class B Subnetting Reference Chart
Number of Bits Subnet Mask Number of Subnets Number of Hosts
2 [Link] 2 214-2
3 [Link] 6 213-2
4 [Link] 14 212-2
5 [Link] 30 211-2
6 [Link] 62 210-2
7 [Link] 126 29-2
8 [Link] 254 28-2
9 [Link] 510 27-2
10 [Link] 1022 26-2
11 [Link] 2046 25-2
12 [Link] 4094 24-2
13 [Link] 8190 23-2
14 [Link] 16382 22-2
Class C Subnetting Reference Chart
Number of Bits Subnet Mask Number of Subnets Number of Hosts
2 [Link] 2 26-2
3 [Link] 6 25-2
4 [Link] 14 24-2
5 [Link] 30 23-2
6 [Link] 62 22-2
Masking
Example
Q. IP Address: [Link]
Sub-net mask: [Link]
A. Network Class: B
Network ID: 187.199
Result of logical AND operation: 187.199.127
Sub-network ID: 127
Host ID: 5
Q. IP Address: [Link]
Sub-net mask: [Link]
A. Network Class: B
Network ID: 187.199
Result of logical AND operation: [Link]
Sub-network ID: 112
Host ID: 15.5
Example(Continued..)
Q. IP Address: [Link]
Sub-net mask: [Link]
A. Network Class: B
Network ID: 187.199
Result of logical AND operation: [Link]
Sub-network ID: 0
Host ID: 127.5
Types of subnetting
The two types of subnetting are:
Static length
Variable length
'Static Length' subnetting?
Supportsmultiple subnets of same
number of host
Using one subnet mask in all the subnets
'Variable Length' subnetting?
Multiple subnets of different number of
hosts
Using different subnet masks in different
subnets.
Disadvantage in using 'Static
Length' subnetting?
A large number of IP addresses will be wasted.
[Link] us say, we have a class C IP network address
[Link] sub-netted using a subnet mask
[Link].
The total number of possible subnetwork is 2 and the
total number of possible hosts per subnetwork is 62.
Even if a subnetwork has just 4 hosts, it will be
allocated the above subnetwork IP address, in this case
58 host IP addresses will be wasted.
Advantages:
Advantage 'Static Length' subnetting?
It is easy to configure a network using 'Static
Length' subnetting.
Advantage 'Variable Length' subnetting?
In the case of 'Variable Length' subnetwork, IP
addresses are allocated depending on the
number of hosts present in the subnetwork. So
available host IP addresses are efficiently used
and are not wasted.