BTIT CN Unit - 1 - IP Addressing
BTIT CN Unit - 1 - IP Addressing
BTIT CN Unit - 1 - IP Addressing
Topics
Faculty:
Introduction to IP Addressing
Subnet addressing
Network Address Translation (NAT)
Assistant Professor
Department of Computer Science & Engineering
Jamia Hamdard University, New Delhi
18 March 2016
IP Address
and
18 March 2016
Friday18 18 / 03 / 2016
18 March 2016
IP Addresses
IPv4 Addresses
Classfull Addressing
Class-A Addressing
Class-B Addressing
Class-C Addressing
Class-D Addressing
Class-E Addressing
IPv6 Addresses
18 March 2016
Friday18 18 / 03 / 2016
IANA
Only 5 RIRs around the world
USER
18 March 2016
M numbers
18 March 2016
USER
M numbers
USER
M numbers
ISP
USER
M numbers
RIR
N numbers
ISP
N numbers
ISP
RIR
RIR
N numbers
ISP
RIR
N numbers
N numbers
RIR
ISP
USER
M numbers5
Friday18 18 / 03 / 2016
Classfull Addressing
Notations
Binary Notations
01110010111000111100101010101010
114
227
. 202 .
170
Dotted-Decimal Notations
For representing the binary into dotted decimal,
we divide the 32 Bits into 4 octets of 8 Bits each.
Rough Note:
Friday18 18 / 03 / 2016
32 Bits
8 Bits
8 Bits
1st Octet
2nd Octet
0
to
255
8 Bits
8 Bits
3rd Octet
0
to
255
0
to
255
0 0 0 0 0 0 0 0
= 0
1 1 1 1 1 1 1 1
= 255
4th Octet
0
to
255
18 March 2016
Class A Addressing
Leading
Bit
Network ID
(net ID)
Host ID
24 Bits
7 Bits
0
1st Octet
0
to
127
2nd Octet
0 - 255
0 0 0 0 0 0 0 0 = 0
to
0 1 1 1 1 1 1 1 = 127
18 March 2016
3rd Octet
0 - 255
4th Octet
0 - 255
to
127.255.255.255
Max.No. of possible Networks
= 27
= 128
Max. No. of possible Hosts per Network
= 224
Dr. Siddhartha Sankar Biswas
10
= 16777216
Friday18 18 / 03 / 2016
Leading
Bits
Class B Addressing
Network ID
(net ID)
Host ID
16 Bits
14 Bits
1 0
1st Octet
128 - 191
2nd Octet
3rd Octet
0 - 255
0 - 255
4th Octet
0 - 255
to
191.255.255.255
1 0 0 0 0 0 0 0 = 128
to
1 0 1 1 1 1 1 1 = 191
18 March 2016
Class C Addressing
Leading
Bits
Network ID
(net ID)
Host ID
21 Bits
8 Bits
1 1 0
1st Octet
192 - 223
2nd Octet
0 - 255
1 1 0 0 0 0 0 0 = 192
to
1 1 0 1 1 1 1 1 = 223
18 March 2016
3rd Octet
0 - 255
4th Octet
0 - 255
to
223.255.255.255
Max. No. of possible Networks
= 221
= 2097152
Max No. of possible Hosts per Network
= 28
Dr. Siddhartha Sankar Biswas
12
= 256
Friday18 18 / 03 / 2016
Class D Addressing
(used for Multicasting)
Leading
Bits
Multicast
28 Bits
1 1 1 0
1st Octet
224 - 239
2nd Octet
0 - 255
3rd Octet
0 - 255
4th Octet
0 - 255
to
1 1 1 0 0 0 0 0 = 224
to
1 1 1 0 1 1 1 1 = 239
18 March 2016
239.255.255.255
Max. No. of possible Networks
= 20
= 1
Max No. of possible Hosts
(for multicasting) per Network
= 228
Dr. Siddhartha Sankar Biswas
= 268435456
13
Class E Addressing
(Reserved for Future Use)
Leading
Bits
28 Bits
1 1 1 1
1st Octet
240 - 255
2nd Octet
0 - 255
1 1 1 1 0 0 0 0 = 240
to
1 1 1 1 1 1 1 1 = 255
18 March 2016
3rd Octet
0 - 255
4th Octet
0 - 255
to
255.255.255.255
and
14
Friday18 18 / 03 / 2016
Class
Leading
Bits
N/W
ID
Size
(Bits)
Host
ID
Size
(Bits)
10
110
1110
1111
Max. No.
of Hosts
per N/W
24
27 =
128
16777216
14
16
214 =
16384
216 =
65536
21
221 =
2097152
28 =
256
223.255.255.255
228 =
224.0.0.0
28
224 =
20 = 1
268435456
Data is Multicast
to all Hosts
18 March 2016
E
D 6%
6%
C
13%
B
25%
18 March 2016
IP
Range
Max. No.
of
N/W
0.0.0.0
to
127.255.255.255
128.0.0.0
to
191.255.255.255
192.0.0.0
to
to
239.255.255.255
224.0.0.0
to
239.255.255.255
Future
Use
15
% of
addresses
in each
class
A
50%
Max. No.
of N/W
Max. No.
of IP
addresses
possible
Friday18 18 / 03 / 2016
Case 1:
Case 2:
If suppose there needs to be 125 sub-networks and each of them
would require to 50,000 to 70,000 hosts?
Ans: Class A
Case 3:
Case 4:
Ans: Class B
17
was facing
Therefore
Internet Engineering Task Force (IETF)
developed a new IPv4 addressing scheme known as
Classless Addressing, technically known as
Classless Inter-Domain Routing(CIDR) addressing scheme.
Friday18 18 / 03 / 2016
Problem Statement
What do you think , which Class of network would a network engineer
implement in a organization
If suppose there needs to be 500 sub-networks and each of them
would require to 50,000 to 70,000 hosts?
Rough Note:
18 March 2016
19
Class A
Network ID
(net ID)
Host ID
24 Bits
7 Bits
1 0
14 Bits
Network ID
(net ID)
Leading
Bits 18 March 2016
16 Bits
Host ID
Class B
Dr. Siddhartha Sankar Biswas
20
10
Friday18 18 / 03 / 2016
Let us remove the class system where Net ID and Host ID have fixed
no. of bits assigned.
Lets make the no. of bits required for defining Net ID and Host ID
more flexible and as per requirement.
And since we are eliminating class system, we would be able to free
the leading bits which were used as identification purpose.
Network ID
(net ID)
Host ID
23 Bits
9 Bits
18 March 2016
21
Let us remove the class system where Net ID and Host ID have fixed
no. of bits assigned.
Lets make the no. of bits required for defining Net ID and Host ID
more flexible and as per requirement.
And since we are eliminating class system, we would be able to free
the leading bits which were used as identification purpose.
Network ID
(net ID)
9 Bits
Host ID
23 Bits
22
11
Friday18 18 / 03 / 2016
Network ID
(net ID)
Host ID
23 Bits
9 Bits
IP Address Range
Starting IP
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
In Binary Notation :
0 0 0 0 0 0 0 0
0.0.0.0
Last IP
1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1
In Binary Notation :
18 March 2016
1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1
255.255.255.255
Dr. Siddhartha Sankar Biswas
Network ID
(net ID)
23
Host ID
23 Bits
9 Bits
0 0 0 0 0 0 0 0
In Binary Notation :
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0.0.0.0 / 9
1 1 1 1 1 1 1 1
1 0 0 0 0 0 0 0
In Binary Notation :
18 March 2016
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
255.128.0.0 / 9
Dr. Siddhartha Sankar Biswas
24
12
Friday18 18 / 03 / 2016
Address Blocks
In classless addressing, when an entity, small or
large, needs to be connected to the Internet,
it is always granted a block (range) of addresses.
The size of the block (the number of addresses)
varies based on the nature and size of the entity.
For example,
25
Restrictions
To simplify the handling of addresses,
the Internet authorities impose three restrictions on
classless address blocks:
18 March 2016
26
13
Friday18 18 / 03 / 2016
Example:
205.16.37.32
Last
205.16.37.47
First
3440387360 / 16 = 2150124210
27
(evenly divisible)
Mask
As we know seen that in classless IPv4 addressing,
addresses are given in contiguous block.
But writing the whole block can be time consuming thing,
so there needs a better way of defining the blocks instead
of writing all the numbers.
therefore a better way of defining a block of IPv4
classless IP addresses is developed known as masking.
In IPv4 addressing, a block of addresses can be defined as
x.y.z.t / n , where
and
18 March 2016
Dr. Siddhartha Sankar Biswas
28
n leftmost
bits are 1s and
rest of the (32-n) bits are 0s.
14
Friday18 18 / 03 / 2016
and18 then
March 2016
29
Example
A block of IP address is granted to an organization.
We know that one of the address is 205.16.37.39/28.
18 March 2016
30
15
Friday18 18 / 03 / 2016
Solution
One of the IP address of the block = 205.16.37.39
In binary the IP address will be
31
AND
Mask
First IP Address
of the block
32
16
Friday18 18 / 03 / 2016
Mask
Compliment
Last IP Address
of the block
18 March 2016
33
and then
Mask
Compliment
34
17
Friday18 18 / 03 / 2016
Subnet Addressing
To understand subnet addressing, we must understand the
following concepts:
Hierarchy
Network Addresses
18 March 2016
35
Two-Level Hierarchy
(No Subnetting possible)
28 Bits
Network prefix
4 Bits
Host Address
18 March 2016
36
18
Friday18 18 / 03 / 2016
Example
An organization is assigned the block 205.16.37.32/28
Design the network configuration for the organization.
18 March 2016
37
Solution
In order to design the network configuration for the
Organization which was granted 205.16.37.32/28
And Mask = 28
38
19
Friday18 18 / 03 / 2016
AND
Mask
First IP Address
of the block
39
Mask
Compliment
Last IP Address
of the block
18 March 2016
i.e. 205.16.37.47
Dr. Siddhartha Sankar Biswas
40
20
Friday18 18 / 03 / 2016
and then
41
Rest of the
Internet
205.16.37.32/28
Organization
Network
205.16.37.33/28
18 March 2016
Routers External IP
x.y.z.t /n
Routers Internal IP
205.16.37.40/28
205.16.37.34/28
205.16.37.46/28
205.16.37.47/28
42
21
Friday18 18 / 03 / 2016
Three-Level Hierarchy
(Subnetting)
Host ID
6 Bits
26 Bits
Network prefix
Host Address
43
and
5
Bits
26 Bits
Network prefix
Sub-Network
prefix
Host Address
18 March 2016
44
22
Friday18 18 / 03 / 2016
and
4
Bits
26 Bits
Network prefix
Sub-Network
prefix
Host Address
18 March 2016
45
Example
An organization is assigned the block 17.12.14.10/26.
The organization has 3 offices.
The network engineer wants to create 3 independent
sub-blocks (i.e sub nets)
of size 32,16 and 16 addresses, for the offices.
Design the network configuration for the organization.
18 March 2016
46
23
Friday18 18 / 03 / 2016
Solution
Assigned block is : 17.12.14.10/26
Therefore one of the IP of this block is : 17.12.14.10
And Mask is : 26
Host IP
Address
Subnet
mask
Subnet
Mask
Compliment
18 March 2016
47
AND
Mask
First IP Address
of the block
48
24
Friday18 18 / 03 / 2016
Mask
Compliment
Last IP Address
of the block
18 March 2016
49
and then
Mask
Compliment
50
25
Friday18 18 / 03 / 2016
17.12.14.0
to
Total = 64 Addresses
17.12.14.63
This block is needed to be divided among the
3 sub-networks having 32,16 and 16 addresses each.
Since the organizations needs 3 sub-networks,
so we need to assign 3 subnet address,
one for each of the sub-networks.
But for defining the 3 subnet address
we need to find the masks for each of the subnets.
So, before proceeding further,
lets find the subnet masks for each of subnets.
18 March 2016
51
52
26
Friday18 18 / 03 / 2016
Sub-Network 1
Lets assign the following address sub-block to subnet-1
17.12.14.0 / 27
to
Total = 32 Addresses
17.12.14.31 / 27
Let us find the subnet address of the sub-network 1
Mask = 27
Lets take any one of the IP from the block = 17.12.14.30
IP Address
Mask
AND
Subnet address of
subnet 1
18 March 2016
i.e. 17.12.14.0
Dr. Siddhartha Sankar Biswas
53
Sub-Network 2
Lets assign the following address sub-block to subnet-2
17.12.14.32 / 28
to
Total = 16 Addresses
17.12.14.47 / 28
Let us find the subnet address of the sub-network 2
Mask = 28
Lets take any one of the IP from the block = 17.12.14.39
IP Address
Mask
AND
Subnet address of
subnet 1
18 March 2016
54
27
Friday18 18 / 03 / 2016
Sub-Network 3
Lets assign the following address sub-block to subnet-3
17.12.14.48 / 28
to
Total = 16 Addresses
17.12.14.63 / 28
Let us find the subnet address of the sub-network 3
Mask = 28
Lets take any one of the IP from the block = 17.12.14.55
IP Address
Mask
AND
Subnet address of
subnet 1
i.e. 17.12.14.48
18 March 2016
17.12.14.63/28
17.12.14.31/27
17.12.14.30/27
55
17.12.14.0/27
Subnet address
Of Subnet -1
17.12.14.48/28
Subnet address
Of Subnet -3
17.12.14.50/28
Subnet - 3
17.12.14.49/28
Subnet - 1
17.12.14.2/27
17.12.14.1/27
17.12.14.34/28
17.12.14.32/28
Subnet address
Of Subnet -2
x.y.z.t/n
17.12.14.47/28
Subnet - 2
17.12.14.33/28
Network : 17.12.14.10/27
18 March 2016
Internet
56
28
Friday18 18 / 03 / 2016
172.18.3.1
172.18.3.2
172.18.3.20
Sender
Organizations
Network
172.18.3.30
NAT Router
200.24.5.8
25.8.3.101
Responder
25.8.2.10
25.40.76.56
25.40.3.79
And18 March
many
more ..
2016
Source: 172.18.3.1
Destination: 25.8.2.10
Step 1.1
Translation Table
(maintained at
NAT Router)
Private
External
172.18.3.1
25.8.2.10
Updation
Step 1.2
Checking
Step 2.2
Step 2.3
18 March 2016
25.8.49.110
Internet
Step 1.2
57
Source: 200.24.5.8
Destination: 25.8.2.10
Step 1.3
Source: 25.8.2.10
Step 2.2
Destination: 172.18.3.1
Dr. Siddhartha Sankar Biswas
Step 2.1
Source: 25.8.2.10
Destination: 200.24.5.8
58
29