Lab2 IP Addressing and Subnetting
Lab2 IP Addressing and Subnetting
IP Addressing
Each Network Interface Card (NIC or Network card) present in a
PC is assigned one Network address called as IP address. This IP
address is assigned by the administrator of the network. No two PCs
can have the same IP address.
There is a burned-in address on the NIC called as Physical
Address [or MAC]. The MAC address of a network card indicates
the vendor of that card and a unique serial number.
IP address classes
IP addresses are divided into different classes. These classes
determine the maximum number of hosts per network ID. Only three
classes are actually used for network connectivity. The following
table lists all of the address class.
IP address class Value of the leftmost byte (part w)
Class A 1-126 [0 and 127 are not allowed]
Class B 128-191
Class C 192-223
0000 0001: 1
0111 1110: 126
First 8 bits are used for network part and the remaining for host
part.
Class B: First two bits in w are 10, and others can be anything
1000 0000: 128
1011 1111: 191
First 16 bits are used for network part and the remaining for
host part
Class C: first three bits in w are 110, and others can be anything
1100 0000: 128
1101 1111: 223
First 24 bits are used for network part and last 8 bits for host
part.
Class D: first four bits in w are 1110, and others can be anything;
used for multicast.
1110 0000: 224
1110 1111: 239
Class E: future use or experimental purposes.
Invalid IP address.
a) If the network part is all 0s, the address belongs to class
A. But this is an invalid ip address because for an ip
address all the network or host part should not be all 1s
or all 0s.
b) If the network part is all 1s, this address belongs to class
E. But due to presence of all 1s, it is not valid. This
represent broadcast to all networks.
c) If the host part is all 0s, this represents network address.
This is not a valid ip address.
3
Lab#2: IP Addressing and Subnetting
Summary:
4
Lab#2: IP Addressing and Subnetting
Subnetting
Subnetting is the practice of dividing a network into two or
more networks.
Subnet mask
Subnet mask is a 32-bit value that allows the receptionist of IP
packet to distinguish network ID portion in the IP address form the
host ID portion.
Once you have the address and the mask represented in binary,
then identifying the network and host ID is easier. Any address bits
which have corresponding mask bits set to 1 represent the network
ID. Any address bits that have corresponding mask bits set to 0
represent the node ID.
8.20.15.1 = 00001000.00010100.00001111.00000001
255.0.0.0 = 11111111.00000000.00000000.00000000
-----------------------------------
net id | host id
netid = 00001000 = 8
hostid = 00010100.00001111.00000001 = 20.15.1
5
Lab#2: IP Addressing and Subnetting
7
Lab#2: IP Addressing and Subnetting
Remember:
Subnets:
0, 64, 128, 192
Another example:
172.16.10.15/20
This IP belongs to class B, [16 bits for network and 16 for host]
So masked bits = 20 – 16 = 4.
Subnets = 24 = 16.
Host bits = 16 - 4 = 12
Another way: 32 – 20 = 12.
Block size = 212 = 4096. (16 . 0)
Hosts per block = 4096 – 2 = 4094
Subnets:
0.0, 16.0, 32.0, 48.0, 64.0, 80.0, 96.0, 112.0, 128.0, 144.0, 160.0, 176.0, 192.0,
208.0, 224.0, 240.0
8
Lab#2: IP Addressing and Subnetting
9
Lab#2: IP Addressing and Subnetting
Exercises:
Part 1
2) Which address class (es) will allow you to have more than
1000 hosts per network?
3) Which address class (es) will allow only 254 hosts per
network?
Part 2
Part 3
Determine the Network ID, First Valid Host, Last Valid Host, and
Broadcast ID of the following network address/mask pairs:
192.168.1.134/27
160.150.140.130/18
10