Lecture Slides - IP Addressing Part 1
Lecture Slides - IP Addressing Part 1
History
Computer network is getting connected in Late 60’s.
In 1978 ISO (International Standard Organization) proposed a new model for
networking for easy access and understanding. Which is of 7 layers and known as
OSI (Open System Interface) model.
As the updatation in OSI model TCP/IP (Transmission Control Protocol/ Internet
Protocol) is developed and merged in 1st January 1983 with APRANET (The
Advanced Research Projects Agency Network).
The TCP/IP model have 4 layers which strictly follow the 7 layers of OSI model.
Introduction
The IP (Internet Protocol) is basically a unique address of any device by which the
device can communicate with other devices or communicate world wide in terms of
Internet.
There are two basic Types of IP address.
◦ IPv4 (IP version 4) (Earlier technology still used by 70% devices)
◦ IPv6 (IP version 6) (Newer version as the addresses range is about to complete of IPv4)
IPv4 (The address is divided into four parts each having 8 bits and separated by dotted
decimal point and usually written in decimal for easy understanding)
*We are learning only about IPv4 addressing here.
OSI model V/S TCP/IP model
OSI Model TCP/IP Model
1. Application Layer 1. Application Layer
2. Presentation Layer Telnet FTP DNS
3.Session Layer
4. Transportation Layer 2. Transport Layer
TCP UDP
5. Network Layer 3. Internet Layer
IP
6. Data link Layer 4. Host to Host network
7. Physical Layer LAN X.25
IP addressing Basic class ful
addressing
An IP address basically a 32-bit address that uniquely universally defines
connection of host or a router to the Internet. IP address is unique.
Address space of IPv4 is 232 .
Introduced by IANA (Internet Assigned Numbers Authority).
32 bit is divided into 4 equal parts of 8-8 bits separated by dotted decimal notation.
It is in the range of minimum 0.0.0.0 to 255.255.255.255.
Each 8 bit group is known by OCTET.
Ip address
Introduction: A device on the network needs an ip
(internet protocol) to communicate with each
other devices
Ip adders is a 32-bit logical adders written in dotted
decimal
Ip address is a unique number assigned to any device
operating on ip network
Used to identify device on a network
Ip addressing concept
Ip address
3
Octets
The 32-bit IP address is broken up into
4 octets, which are arranged into a
dotted-decimal notation scheme.
An octet is a set of 8 bits & not a
musical instrument.
Example of an IP version 4:
172.64.126.52
4
Thinking in Binary
The binary system uses only 2
values “0 & 1” to represent
numbers in positions representing
increasing powers of 2.
We all are accustomed to thinking
& working in the decimal system,
which is based on the number 10.
5
Thinking in Binary (Cont.)
To most humans, the number 124
represents 100 + 20 + 4.
To the computer, this number is
1111100, which is 64 (26) + 32 (25)
+ 16 (24) + 8 (23) + 4 (22) + 0 + 0
6
Each position in a binary number
represents, right to left, a power of
two beginning with 20 & increasing
by one power as it moves left: 20,
21, 22, 24, etc.
Peter Smith
7
Converting to Decimal
You’ll need to convert binary to
decimal & vice versa to compute
subnets & hosts.
So, it’s time for a quick review lesson
in binary-to-decimal conversion.
There are 8 bits in an octet & each bit
can only be a 1 or a 0.
Peter Smith
8
Converting to Decimal (Cont.)
What then do you suppose is the largest
decimal number that can be expressed
in an octet?
Eight 1’s (1111 1111)
Peter Smith
9
Converting to Decimal (Cont.)
Now, for double the money, what is its
equivalent decimal value?
27 26 25 24 23 22 21 20
1 1 1 1 1 1 1 1
128 64 32 16 8 4 2 1
Peter Smith
10
Converting to Decimal (Cont.)
Therefore, the largest decimal number
that can be stored in an IP address octet
is 255.
The significance of this should become
evident later in this presentation.
Peter Smith
11
IP Address
128 64 32 16 8 4 2 1 Answer
1 1 0 0 0 0 0 0 192
0 0 0 0 1 0 1 0 10
1 0 1 0 1 0 0 0 168
1 0 1 0 1 1 0 0 172
0 0 0 1 0 0 0 0 16
Decimal to Binary
Decimal 128 64 32 16 8 4 2 1
18 0 0 0 1 0 0 1 0
152 1 0 0 1 1 0 0 0
200 1 1 0 0 1 0 0 0
15 0 0 0 0 1 1 1 1
240 1 1 1 1 0 0 0 0
Types of ip address
Ip address divided into
Class A
Class B
Class C
Class D
Class E
Class A addressing
Peter Smith
12
IP Address Classes (Cont.)
The 5 IP classes are split up based on
the value in the 1st octet:
Peter Smith
13
IP Address Classes (Cont.)
Using the ranges, you can determine the
class of an address from its 1st octet
value.
An address beginning with 120 is a
Class A address, 155 is a Class B
address & 220 is a Class C address.
Peter Smith
14
Are You the Host or the
Network?
The 32 bits of the IP address are divided into
Network & Host portions, with the octets
assigned as a part of one or the other.
Network & Host Representation
By IP Address Class
Class Octet1 Octet2 Octet3 Octet4
Peter Smith
15
Are You the Host or the
Network? (Cont.)
Each Network is assigned a network
address & every device or interface
(such as a router port) on the network is
assigned a host address.
There are only 2 specific rules that
govern the value of the address.
Peter Smith
16
Are You the Host or the
Network? (Cont.)
A host address cannot be designated by
all zeros or all ones.
These are special addresses that are
reserved for special purposes.
Peter Smith
17
Class A Addresses
Class A IP addresses use the 1st 8 bits
(1st Octet) to designate the Network
address.
The 1st bit which is always a 0, is used
to indicate the address as a Class A
address & the remaining 7 bits are used
to designate the Network.
The other 3 octets contain the Host
address.
Peter Smith
18
Class A Addresses (Cont.)
There are 128 Class A Network
Addresses, but because addresses with
all zeros aren’t used & address 127 is a
special purpose address, 126 Class A
Networks are available.
Peter Smith
19
Class A Addresses (Cont.)
There are 16,777,214 Host addresses
available in a Class A address.
Rather than remembering this number
exactly, you can use the following formula to
compute the number of hosts available in any
of the class addresses, where “n” represents
the number of bits in the host portion:
(2n – 2) = Number of available hosts
Peter Smith
20
Class A Addresses (Cont.)
For a Class A network, there are:
224 – 2 or 16,777,214 hosts.
Half of all IP addresses are Class A
addresses.
You can use the same formula to determine
the number of Networks in an address class.
Eg., a Class A address uses 7 bits to
designate the network, so (27 – 2) = 126 or
there can be 126 Class A Networks.
Peter Smith
21
Class B IP Addresses
Class B addresses use the 1st 16 bits
(two octets) for the Network address.
The last 2 octets are used for the Host
address.
The 1st 2 bit, which are always 10,
designate the address as a Class B
address & 14 bits are used to designate
the Network. This leaves 16 bits (two
octets) to designate the Hosts.
Peter Smith
22
Class B IP Addresses (Cont.)
So how many Class B Networks can
there be?
Using our formula, (214 – 2), there can
be 16,382 Class B Networks & each
Network can have (216 – 2) Hosts, or
65,534 Hosts.
Peter Smith
23
Class C IP Addresses
Class C addresses use the 1st 24 bits
(three octets) for the Network address
& only the last octet for Host
addresses.the 1st 3 bits of all class C
addresses are set to 110, leaving 21 bits
for the Network address, which means
there can be 2,097,150 (221 – 2) Class C
Networks, but only 254 (28 – 2) Hosts
per Network.
Peter Smith
24
Class C IP Addresses (Cont.)
Peter Smith
25
Special Addresses
A few addresses are set aside for
specific purposes.
Network addresses that are all binary
zeros, all binary ones & Network
addresses beginning with 127 are
special Network addresses.
Peter Smith
26
Special Addresses (Cont.)
Peter Smith
27
Special Addresses (Cont.)
Within each address class is a set of
addresses that are set aside for use in
local networks sitting behind a firewall
or NAT (Network Address Translation)
device or Networks not connected to
the Internet.
Peter Smith
28
Special Addresses (Cont.)
A list of these addresses for each IP
address class:
Peter Smith
29
IP Address Classification
•CLASS A
•In Class A : First bit of the first octet is reserved as priority bit, bit value is zero.
•0xxxxxxx. xxxxxxxx. xxxxxxxx. Xxxxxxxx
27 26 25 24 2 3 22 21 20
0 0 0 0 0 0 0 0 = 0
0 0 0 0 0 0 0 1 = 1
0 0 0 0 0 0 1 0 = 2
0 0 0 0 0 0 1 1 = 3
0 0 0 0 0 1 0 0 = 4 Class A Range
0 . 0 . 0 . 0 to
127 . 255 . 255 .255
0 1 1 1 1 1 1 1 = 127
Class B Range
•In Class B : First two bits of the first octet are reserved as priority bits, bit value as 10.
•10xxxxxx. xxxxxxxx. xxxxxxxx. xxxxxxxx
27 26 25 24 23 22 21 20
1 0 0 0 0 0 0 0 = 128
1 0 0 0 0 0 0 1 = 129
1 0 0 0 0 0 1 0 = 130
1 0 0 0 0 0 1 1 = 131
1 0 0 0 0 1 0 0 = 132
Class B Range
128 . 0 . 0 . 0 to
1 0 1 1 1 1 1 1 = 191 191 . 255 . 255 .255
Class C Range
•In Class C : First three bits of the first octet are reserved as priority bits, bit value as 110.
•110xxxxx. xxxxxxxx. xxxxxxxx. Xxxxxxxx
27 26 25 24 23 22 21 20
1 1 0 0 0 0 0 0 = 192
1 1 0 0 0 0 0 1 = 193
1 1 0 0 0 0 1 0 = 194
1 1 0 0 0 0 1 1 = 195
1 1 0 0 0 1 0 0 = 196
Class C Range
192 . 0 . 0 . 0 to
1 1 0 1 1 1 1 1 = 223 223 . 255 . 255 .255
Class D Range
•In Class D : First four bits of the first octet are reserved as priority bits, bit value as 1110.
•1110xxxx. xxxxxxxx. xxxxxxxx. xxxxxxxx
27 26 25 24 23 22 21 20
1 1 1 0 0 0 0 0 = 224
1 1 1 0 0 0 0 1 = 225
1 1 1 0 0 0 1 0 = 226
1 1 1 0 0 0 1 1 = 227
1 1 1 0 0 1 0 0 = 228
Class D Range
224 . 0 . 0 . 0 to
1 1 1 0 1 1 1 1 = 239 239 . 255 . 255 .255
Class E Range
•In Class E : First four bits of the first octet are reserved as priority bits, bit value as 1111.
•1111xxxx. xxxxxxxx. xxxxxxxx. xxxxxxxx
27 26 25 24 23 22 21 20
1 1 1 1 0 0 0 0 = 240
1 1 1 1 0 0 0 1 = 241
1 1 1 1 0 0 1 0 = 242
1 1 1 1 0 0 1 1 = 243
1 1 1 1 0 1 0 0 = 244
Class E Range
240 . 0 . 0 . 0 to
1 1 1 1 1 1 1 1 = 255 255 . 255 . 255 .255
Ranges
•No. of Host
= 2no of host bits -2
= 224 – 2 (-2 is for Network ID & Broadcast ID)
= 16777216 - 2
= 16777214 Hosts/Network
CLASS B – No. Networks & Hosts
•No. of Host
= 2no of host bits -2
= 216 – 2 (-2 is for Network ID & Broadcast ID)
= 65536 - 2
= 65534 Hosts/Network
CLASS C – No. Networks & Hosts
•No. of Host
= 2no of host bits -2
= 28 – 2 (-2 is for Network ID & Broadcast ID)
= 256 - 2
= 254 Hosts/Network
Network & Broadcast Address
•Network address: This is the address that identifies the subnet of a host.
•Broadcast address: An IP Address that allows information to be sent to all machines on a given
subnet rather than a specific machine.
•Valid IP Addresses lie between the Network Address and the Broadcast Address.
•Only Valid IP Addresses are assigned to hosts/clients
Example - Class A
•Class A : N.H.H.H
−Network Address :
0xxxxxxx.00000000.00000000.00000000
−Broadcast Address :
0xxxxxxx.11111111.11111111.11111111
10.255.255.254
10.255.255.255 Broadcast Address
Example - Class B
•Class B : N.N.H.H
−Network Address :
10xxxxxx.xxxxxxxx.00000000.00000000
−Broadcast Address :
10xxxxxx.xxxxxxxx.11111111.11111111
Class B
172.16.0.0 Network Address
172.16.0.1
172.16.0.2
172.16.0.3
Valid IP Addresses
172.16.255.254
172.16.255.255 Broadcast Address
Example - Class C
•Class C : N.N.N.H
−Network Address :
110xxxxx.xxxxxxxx.xxxxxxxx.00000000
−Broadcast Address :
110xxxxx.xxxxxxxx.xxxxxxxx.11111111
Class C
192.168.1.0 Network Address
192.168.1.1
192.168.1.2
192.168.1.3
Valid IP Addresses
192.168.1.254
192.168.1.255 Broadcast Address
Private IP Address
•There are certain addresses in each class of IP address that are reserved for Private
Networks. These addresses are called private addresses.
•These addresses are not Routable (or) valid on Internet.
Class A
10.0.0.0 to 10.255.255.255
Class B
172.16.0.0 to 172.31.255.255
Class C
192.168.0.0 to 192.168.255.255
Various IP classes
IP has five different classes differentiated by characteristics.
◦ Class-A ranges from 0 to 127
◦ Class-B ranges from 128 to 191
◦ Class-C ranges from 192 to 223
◦ Class-D ranges from 224 to 239
◦ Class-E ranges from 240 to 255
First Octet is defines the class of particular IP e.g. - 128.11.3.31 is follow in class –B
127.0.0.0 to 127.255.255.255 is a range of look back IP.
IP Classes (Contd.)
Official Method to find the class of particular IP.
Check the first octet, Convert it to Binary, then
If, 1st bit is 0 then it comes to class A, If 1st bit is 1 and 2nd bit is 0 then it comes to class B, If 1st
two bit is 1 and 3rd bit is 0 then it comes to class C. If 1st three bits are 1and 4th bit is 0 then it
comes to class D and if all 4 bits are 1 then it comes to class E.
bit # 0 1 7 8 31
Class A 0 bit # 0 1 2 3 4 31
Network Prefix Host Number
8 bits 24 bits
Class D 1110 multicast group id
bit # 0 1 2 15 16 31
IP v4 IP V6
32 bit address 128 bit address
Represent in decimal Represent in hexadecimal
Support 232 address Support 2128 address
Ipv4 header does not identify Better support forQos
packet flow for Qos handling by
routers
Header include checksum Header does not include
checksum
Ping (packet internet Groper)
Ping tool is used by computers network to test whether
the intended host is reachable a cross the ip network