unit3 IP addressing
unit3 IP addressing
IP ADDRESSING
-Prepared By
Ms. Sumedha Seniaray
Assistant Professor
Department of Applied Mathematics, DTU
IP Address
• An IP address is a unique global address for a network interface.
Binary Notation
E.g.
IP ADDRESSING
E.g. IP address 172.16.254.1 belongs to Class B as the 1st byte or the 1st octet i.e. 172 lies in Class B range i.e. 128-191.
• IP address is divided into two parts:
• Network part i.e. net id (identifies a network in the internet)
• Host part i.e. host id (identifies a host in that network)
Fixed
7 Bits Vary NetID varies from 0 0000000 → 0
(0-127)
0 0 1111111 → 127
NetID HostID
8 Bits 24 Bits
• NOTE:
• To identify the network address, all host bits must be 0
• To identify the broadcast address, all host bits are set to 1
To find its broadcast address, set all host bits to 1, that is,
00000111 11111111 11111111 11111111 i.e. 7. 255.255.255 is the broadcast address.
Class B:
• In a Class B Network binary address start with 10 and rest of the 14 bits may vary, therefore the decimal
number in the first byte can be anywhere from 128 to 191.
• Class B IP address range: [128.0.0.0] to [191.255.255.255]
• The first 16 bits (two bytes) identify the network and the remaining 16 bits indicate the host within the
network.
• An example of a Class B IP address is 182.18.255.20, where "182.18" identifies the network and "255.20"
identifies the host on that network.
• No. of Class B networks possible = 214
• No. of Class B hosts possible within any Class B network = 216 – 2
16 Bits 16 Bits
E.g. 128.227.0.50 is a class B IP address
Here, the netID is “128.227” and the hostID is “0.50”
Therefore, it’s network address, is 10000000 11100011 00000000 00000000
i.e. 128.227.0.0 is the network address of the given IP address.
To find its broadcast address, set all host bits to 1, that is,
10000000 11100011 11111111 11111111 i.e. 128. 227.255.255 is the broadcast
address.
Class C:
• In a Class C Network binary address start with 110 and rest of the 21 bits may vary, therefore the decimal
number in the first byte can be anywhere from 192 to 223.
• Class C IP address range: [192.0.0.0] to [223.255.255.255]
• The first 24 bits (three bytes) identify the network and the remaining 8 bits indicate the host within the
network.
• An example of a Class C IP address is 211.64.15.1, where "211.64.15" identifies the network and “1"
identifies the host on that network.
• No. of Class C networks possible = 221
• No. of Class C hosts possible within any Class C network = 28 – 2
24 Bits 8 Bits
E.g. 211.64.15.1 is a class C IP address
Here, the netID is “211.64.15” and the hostID is “1”
Therefore, it’s network address, is 11010011 01000000 00001111 00000000
i.e. 211.64.15.0 is the network address of the given IP address.
To find its broadcast address, set all host bits to 1, that is,
11010011 01000000 00001111 11111111 i.e. 211.64.15.255 is the broadcast
address.
Class D:
• Class D IP addresses are reserved for Multicasting.
• There is no netID and hostID in a Class D IP address but it’s first four bits are fixed starting from 1110 and rest
of the 28 bits may vary, therefore the decimal number in the first byte can be anywhere from 224 to 239.
• Class D IP address range: [224.0.0.0] to [239.255.255.255]
Fixed 1st octet of Class D varies from
1110 1110 0000 → 224
Class D IP address 1110 1111 → 239
• Class E: 32 Bits
• Class E IP addresses are reserved for future purposes such as research, testing and experimentation. They
have never been documented or utilized in a standard way.
• In a Class E Network, binary IP addresses start with 1111, therefore the decimal number can range from 240
to 255.
• Class E IP address range: [240.0.0.0] to [255.255.255.255]
1st octet of Class E varies from
Fixed 1111 1111 0000 → 240
Class E IP address 1111 1111 → 255
32 Bits
Class Ranges of IPv4 Address
Default Mask:
• Although the length of the netid and hostid (in bits) is predetermined
in classful addressing, we can also use a default mask
• Default Mask is used to determine the network address of a given IP
address.
• Default mask can be created by setting all NetID bits to 1 and HostID
bits to 0.
The masks for classes A, B, and C are shown below:
• Default mask is masked (AND operation) with the given IP address to
produce it’s Network address.
Class B
Private IP Addresses:
All other IP addresses are
Public addresses
Eg. 11.1.5.60
Subnetting
• Dividing a network into smaller networks for efficient utilization of IP
addresses is known as Subnetting.
• It supports a 3-level hierarchy Uses Network Mask
NetID
Uses Subnet
Mask SubnetID ........ SubnetID
IP Address
Subnet Mask_
Subnet Address
Eg. Identify the Subnet address for the given IP address 165.170.198.200
when there are 8 subnets for a given network.
165.170.198.200
255.225.224. 0_
165.170.192. 0_ Subnet
Address
Address Depletion
• The imperfection in classful addressing scheme combined with the fast
growth of the Internet led to the near depletion of the available addresses.
• Yet the number of devices on the Internet is much less than the 232 address
space. We have run out of class A and B addresses, and class C address
space is too small for most midsize organizations.
• One solution that has alleviated the problem is the idea of Classless
Addressing.
Classless Addressing
• Classless addressing is used to overcome address depletion and give
organizations more access to the Internet.
• In this addressing scheme, there no classes, but the addresses are
represented as Blocks (group of IP addresses).
• In classless addressing, when an entity, small or large, needs to be connected
to the Internet, it is granted a block (range) of addresses.
• The size of the block (the number of addresses) varies based on the size of the
entity.
• For example, a household may be given only two addresses; a large
organization may be given thousands of addresses.
• An ISP, as the Internet service provider, may be given thousands or hundreds
of thousands based on the number of customers it may serve.
• Classless address is represented using CIDR notation (Classless Inter Domain
Routing notation). Also known as Slash notation.
• Format of CIDR notation: x. y. z. w/ n
IP Address Mask
e.g. 190.36.73.119/20
Mask 11111111 11111111 11110000 00000000 255.255.240.0
n helps find the default mask for the given IP address, where n denotes that
1st n bits of the mask IP address is set to 1 and rest of the bits are set to 0.