Lec 09 IPv4 Addressing Lec 10 IPv4 Subnetting
Lec 09 IPv4 Addressing Lec 10 IPv4 Subnetting
DATA COMMUNICATION
& NETWORKING
Lecture 9
IPv4 Addressing
Fundamental
CONTENTS
Introduction
Notations
Classful addressing
Classless addressing
INTRODUCTION
IP Address?
An address that identifies the connection of a host to
network.
Devided into 2:
Internet Protocol version 4 (IPv4)
Up to 4.2 billion address.
Internet Protocol version 6 (IPv6)
Up to 340 trilion address.
Where is IPv5?
It held as experimental address forced to the development of
IPv6
INTRODUCTION
The IPv4 addresses are unique and universal.
The exact address space of IPv4 is
232 or 4,294,967,296.
Consists of 4 bytes (32 bits)
NOTATIONS
Binary Notation
Solution
129.11.239.11
249.155.15.251
Example
Solution
01101111 00101101 00111000 01001110
01001011 00100010 00101101 01001110
CLASSFUL ADDRESSING
Example: 192.11.103.4
12.4.112.23
How to remember?
Address Classes
5 different classes of address – A,B,C,D & E
Class A :: First bit is 1
Class B :: 1st bit is 1 and 2nd bit is 0
Class C :: 1st bit is 1, 2nd bit is 1 and 3rd bit is 0
Class D :: 1st bit is 1, 2nd bit is 1, 3rd bit is 1 and 4th is 0
Class E :: All first 4 bit are 1
Address Classes
5 different classes of address – A,B,C,D & E
Example
Solution
The first bit is 0; this is a class A address.
The first 4 bits are 1s; this is a class E address.
Example
Solution
The first bit is 0; this is a class B address.
The first bit are 0; this is a class A address.
Example
Find the class of each address:
227.12.14.87
252.5.15.111
134.11.78.56
Example
Find the class of each address:
227.12.14.87
252.5.15.111
134.11.78.56
Solution
The first byte is 227 (between 224 and 239); the class is D.
The first byte is 252 (between 240 and 255); the class is E.
The first byte is 134 (between 128 and 191); the class is B.
Netid and Hostid
netid hostid
4 bytes
Example
192.168.2.1
Class C which is “192.168.2” is netid while “.1” is
hostid
60.5.6.244
Class A which is “60” is netid while “.5.6.244” is
host id
Classes and Block
Each class is divide into a fixed number of block
Each block having a fixed size
A large part of the available addresses were wasted
IPv4 Addressing
Subnetting
edited by
EH18
IP Addressing & Subnetting
IP Addressing (Re-call)
Subnetting
VLSM
CIDR
IP Addresses
An IP address is an address used to uniquely
identify a device on an IP network.
The address is made up of 32 binary bits which
can be divisible into a network portion and
host portion with the help of a subnet mask.
32 binary bits are broken into four octets (1 octet
= 8 bits)
Dotted decimal format (for example,
172.16.81.100)
IP Address Classes
IP Address Classes
NA:
68.0.
.60 NA: 1
2.168.0
192.
192.1
92.16
168.
.65 .71 .73 .87 .98
NA: 19
.5 .11 .23 .37 .58
NA:
8.0.1
0.18
20
192.168.0.___ 0 192.168.180.___
BA: BA:
NA: NA:
.125 .133 .138 .148 .168 .185 .193 .198 .240 .244
192.168.60.___ 192.168.120.___
BA: BA:
NA: NA:
Private Address Range
NA:
68.0.
.60 NA: 1
2.168.0
192.
192.1
92.16
168.
.65 .71 .73 .87 .98
NA: 19
.5 .11 .23 .37 .58
NA:
8.0.1
0.18
20
192.168.0.___ 0 192.168.180.___
BA: BA:
NA: NA:
.125 .133 .138 .148 .168 .185 .193 .198 .240 .244
192.168.60.___ 192.168.120.___
BA: BA:
NA: NA:
Default Subnet Masks
Distinguishes which portion of the address
identifies the network and which portion
of the address identifies the node.
Default masks:
Class A: 255.0.0.0
Class B: 255.255.0.0
Class C: 255.255.255.0
Subnetting
Creates multiple logical networks that exist
within a single Class A, B, or C network.
If you do not subnet, you will only be able
to use one network from your Class A, B, or
C network, which is unrealistic
Each data link on a network must have a
unique network ID, with every node on that
link being a member of the same network
Benefits of Subnetting
.2 .3 .130 .131
Subnets? 21 = 2
Hosts? 215– 2 = 32,766 (7 bits in the third
octet, and 8 in the fourth)
Valid subnets? 256 – 128 = 128. 0, 128.
Remember that subnetting is performed in the
third octet, so the subnet numbers are really
0.0 and 128.0, as shown in the next table
Broadcast address for each subnet?
Valid hosts?
Practice Example #1B: 255.255.128.0 (/17)
Network 172.16.0.0
Subnet 0.0 128.0
First Host 0.1 128.1
Last Host 127.254 255.254
Broadcast 127.255 255.255
Practice Example #2B: 255.255.240.0 (/20)
Network 172.16.0.0
Subnets? 24= 16.
Hosts? 212 – 2 = 4094.
Valid subnets? 256 – 240 = 0, 16, 32, 48,
etc., up to 240.
Broadcast address for each subnet?
Valid hosts?
Practice Example #2B: 255.255.240.0 (/20)
Network 172.16.0.0
Subnet 0.0 16.0 ……….. 240.0
IPv4 Addressing
Subnetting
Extra Notes
edited by
EH17
Subnetting
Range of address
192.168.2.8 to 192.168.2.15
192.168.8 is network address
192.168.2.15 is broadcast address
Useable address is 192.168.2.7 to
192.168.2.14
6 addresses
Example
11000000101010000000001100010100
11111111111111111111111111110000
11000000101010000000001100010000
Solution
The binary representation of the given address is
11001101 00010000 00100101 00100111
If we set 32−28 rightmost bits to 0, rest is 1s we get
11111111 11111111 11111111 11110000
Using ANDing process
11001101 00010000 00100101 00100000
or
205.16.37.32
19.92
Cont.
ii. Find the last address (broadcast address) for the block
Solution
If we set 32 − 28 rightmost bits from 0 to 1, we get
11001101 00010000 00100101 00101111
or
205.16.37.47
Solution
Convert to decimal and adding with 1
1111 = 15 , then + 1
= 16 addresses
Any Questions ??