0% found this document useful (0 votes)
48 views72 pages

IP Addressing & Subnetting

The document discusses IP addressing and subnetting, including how IP addresses are broken into classes and octets, how to determine the network and host portions of an address, and how subnet masks are used to separate network and host IDs to determine local routing.

Uploaded by

Francis Pulaizi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
48 views72 pages

IP Addressing & Subnetting

The document discusses IP addressing and subnetting, including how IP addresses are broken into classes and octets, how to determine the network and host portions of an address, and how subnet masks are used to separate network and host IDs to determine local routing.

Uploaded by

Francis Pulaizi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 72

IP Addressing & Subnetting

IP Addressing
• Primary job of IP – delivering messages
• IP Addressing
– Network Interface Identification
– Routing
• There are two types of IP addresses:
– IP Version 4 (32 bit address)
– IP Version 6 (128 bit address)
• We will discuss IPv4 addressing
IP Addressing continued
• You can probably work with decimal numbers
much easier than with the binary numbers
needed by the computer.
• Working with binary numbers is time-
consuming & error-prone.

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
Thinking in Binary (Cont.)
• 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.

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.

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)

9
Converting to Decimal (Cont.)

• Now, 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

The binary number 1111 1111 converts into the


decimal number:
128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = 255

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.

11
Classful IP Addressing Scheme
• In classful addressing, IP addresses are divided
into 5 classes, each of which is designated
with the alphabetic letters A to E.
• Class D addresses are used for multicasting.
• Class E addresses are reserved for testing &
some mysterious future use.

12
IP Address Classes (Cont.)

• The 5 IP classes are split up based on


the value in the 1st octet:

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.

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

Class A Network Host Host Host

Class B Network Network Host Host

Class C Network Network Network Host

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.

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.

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.

18
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

19
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 ) = 128 or there can be 128 Class A
Networks.

20
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.

21
Class B IP Addresses (Cont.)
• So how many Class B Networks can there be?
• Using our formula, (214 ), there can be 16,384
Class B Networks & each Network can have
(216 – 2) Hosts, or 65,534 Hosts.

22
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,152 (221 ) Class C
Networks, but only 254 (28 – 2) Hosts per
Network.

23
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.

24
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.
• These are also called private IP addresses

25
Special Addresses (Cont.)

• A list of these addresses for each IP


address class:

26
Network Mask
• An IP address has 2 parts:
– The Network identification.
– The Host identification.
• Frequently, the Network & Host portions of the
address need to be separately extracted.
• In most cases, if you know the address class, it’s easy
to separate the 2 portions.

27
Network Mask (Cont.)
• With the rapid growth of the internet & the ever-
increasing demand for new addresses, the
standard address class structure has been
expanded by borrowing bits from the Host
portion to allow for more Networks.
• This has allowed Classless Inter Domain Routing
to be possible
• Under this addressing scheme, called Subnetting,
separating the Network & Host requires a special
process called Subnet Masking.
28
Subnet Mask (Cont.)
• The subnet masking process was developed to
identify & extract the Network part of the
address.
• A subnet mask, which contains a binary bit
pattern of ones & zeros, is applied to an address
to determine whether the address is on the local
Network.
• If it is not, the process of routing it to an outside
network begins.

29
Subnet Mask (Cont.)
• The function of a subnet mask is to determine
whether an IP address exists on the local network
or whether it must be routed outside the local
network.
• It is applied to a message’s destination address to
extract the network address.
• If the extracted network address matches the
local network ID, the destination is located on the
local network.

30
Subnet Mask (Cont.)
• However, if they don’t match, the message
must be routed outside the local network.
• The process used to apply the subnet mask
involves Boolean Algebra to filter out non-
matching bits to identify the network address.

31
Boolean Algebra
• Boolean Algebra is a process that applies binary
logic to yield binary results.
• Working with subnet masks, you need only 4
basic principles of Boolean Algebra:
– 1 and 1 = 1
– 1 and 0 = 0
– 0 and 1 = 0
– 0 and 0 = 0

32
Boolean Algebra (Cont.)
• In another words, the only way you can get a
result of a 1 is to combine 1 & 1. Everything
else will end up as a 0.
• The process of combining binary values with
Boolean Algebra is called Anding.

33
Default Standard Subnet Masks

• There are default standard subnet


masks for Class A, B and C addresses:

34
A Trial Separation
• Subnet masks apply only to Class A, B or C IP
addresses.
• The subnet mask is like a filter that is applied
to a message’s destination IP address.
• Its objective is to determine if the local
network is the destination network.

35
A Trial Separation (Cont.)
• The subnet mask goes like this:
1. If a destination IP address is 206.175.162.21,
we know that it is a Class C address & that its
binary equivalent is:
11001110.10101111.10100010.00010101

36
A Trial Separation (Cont.)
2. We also know that the default standard Class
C subnet mask is: 255.255.255.0 and that its
binary equivalent is:
11111111.11111111.11111111.00000000

37
A Trial Separation (Cont.)

3. When these two binary numbers (the IP


address & the subnet mask) are combined
using Boolean Algebra, the Network ID of
the destination network is the result:

38
A Trial Separation (Cont.)
4. The result is the IP address of the network
which in this case is the same as the local
network & means that the message is for a
node on the local network.

39
Subnetting
Introduction
• Subnetting is the foundation underlying the
expansion of both Local Networks & the Internet
in today’s world.
• Subnetting has become essential knowledge for
the Administrator of any network.
• There are 2 fundamental reasons why subnetting
has so much importance in today’s networking
environment:

41
Introduction (Cont.)
1) The world is running out of available IP
addresses. There just isn’t an unlimited
number of IP addresses available &
subnetting helps extend the existing
addresses until either the next version of IP
is rolled out or some other technology
charges on the scene.

42
Introduction (Cont.)
2) Subnetting reduces the size of the routing
tables stored in routers. Subnetting extends
the existing IP address base & restructures
the IP address. As a result, routers must
have a way to extract from a IP address both
the Network address & the Host address.

43
Introduction (Cont.)
• There are only 3 usable IP address classes:
– Class A
– Class B
– Class C
• Class A networks have the highest number of
available hosts.
• Class C networks have the fewest number of
hosts.

44
Subnetting Networks ID

• A 3-step example of how the default


Class A subnet mask is applied to a
Class A address:

45
Subnetting Networks ID (Cont.)
• In the previous slide, the default Class A subnet mask
(255.0.0.0) is AND’d with the Class A address
(123.123.123.001) using Boolean Algebra, which
results in the Network ID (123.0.0.0) being revealed.
• The default Class B subnet mask (255.255.0.0) strips
out the 16-bit network ID & the default Class C
subnet mask (255.255.255.0) strips out the 24-bit
network ID.

46
Subnetting, Subnet & Subnet Mask
• Subnetting, a subnet & a subnet mask are all
different.
• In fact, the 1st creates the 2nd & is identified by
the 3rd.
• Subnetting is the process of dividing a
network & its IP addresses into segments,
each of which is called a subnetwork or
subnet.

47
Subnetting, Subnet & Subnet Mask
(Cont.)

• The subnet mask is the 32-bit number that the


router uses to cover up the network address
to show which bits are being used to identify
the subnet.

48
Subnetting
• A network has its own unique address, such as a
Class B network with the address 172.20.0.0
which has all zeroes in the host portion of the
address.
• From the basic definitions of a Class B network &
the default Class B subnet mask, you know that
this network can be created as a single network
that contains 65,534 individual hosts.

49
Subnetting (Cont.)
• Through the use of subnetting, the network
from the previous slide can be logically
divided into subnets with fewer hosts on each
subnetwork.
• It does not improve the available shared
bandwidth only, but it cuts down on the
amount of broadcast traffic generated over
the entire network as well.

50
Subnetting (Cont.)
• Example of subnetting: when the network
administrator divides the 172.20.0.0 network
into 5 smaller networks – 172.20.1.0,
172.20.2.0, 172.20.3.0, 172.20.4.0 &
172.20.5.0 – the outside world stills sees the
network as 172.20.0.0, but the internal
routers now break the network addressing
into the 5 smaller subnetworks.

51
Subnetting (Cont.)
• In the example, only a single IP address is used
to reference the network & instead of 5
network addresses, only one network
reference is included in the routing tables of
routers on other networks.

52
Borrowing Bits to Grow a Subnet
• The key concept in subnetting is borrowing bits from
the host portion of the network to create a
subnetwork.
• Rules govern this borrowing, ensuring that some bits
are left for a Host ID.

53
Borrowing Bits to Grow a Subnet (Cont.)
• For each IP address class, only a certain
number of bits can be borrowed from the host
portion for use in the subnet mask.

54
Subnetting a Class A Network
• The default subnet mask for a class A network
is 255.0.0.0 which allows for more than
16,000,000 hosts on a single network.
• The default subnet mask uses only 8 bits to
identify the network, leaving 24 bits for host
addressing .

55
Subnetting a Class A Network (Cont.)
• To subnet a Class A network, you need to borrow a
sufficient number of bits from the 24-bit host portion
of the mask to allow for the number of subnets you
plan to create, now & in the future.
• Example: To create 2 subnets with more than 4
millions hosts per subnet, you must borrow 2 bits
from the 2nd octet & use 10 masked (value equals
one) bits for the subnet mask (11111111.11000000)
or 255.192 in decimal.

56
Subnetting a Class A Network (Cont.)
• Keep in mind that each of the 8-bit octets has
binary place values.
• When you borrow bits from the Host ID
portion of the standard mask, you don’t
change the value of the bits, only how they
are grouped & used.

57
Subnetting a Class A Network (Cont.)

58
Class A Subnet Masks (Cont.)
• All subnet masks contain 32 bits; no more, no
less.
• However a subnet mask cannot filter more
than 30 bits. This means 2 things:
– One, that there cannot be more than 30 ones bits
in the subnet mask.
– Two, that there must always be at least 2 bits
available for the Host ID.

59
Class A Subnet Masks (Cont.)
• The subnet mask with the highest value
(255.255.255.252) has a binary representation
of:
11111111.11111111.11111111.11111100
• The 2 zeroes in this subnet mask represent the
2 positions set aside for the Host address
portion of the address.

60
Slash Notation(Cont.)
• An IP address such as 192.168.2.35 is a class C
address with default mask as 255.255.255.0
• This can also be written as 192.168.2.35/24
which means that the first 24 bits are used for
subnet mask.
• Similarly, 183.27.46.89/27 means that the
first 27 bits are used for masking, resulting
into a mask of 255.255.255.224

61
Knowing How to Calculate Subnets

• To determine the number of subnets &


hosts per subnet available for any of the
available subnet masks, 2 simple formulas
to calculate these numbers:
• Number of subnets = 2n
• Number of Hosts = 2n-2

62
Subnetting – Example
• Host IP Address: 138.101.114.250
• Network Mask: 255.255.0.0 (or /16)
• Subnet Mask: 255.255.255.192 (or /26)

Given the following Host IP Address, Network Mask and Subnet mask find the following
information:
• Major Network Information
– Major Network Address
– Major Network Broadcast Address
– Range of Hosts if not subnetted
• Subnet Information
– Subnet Address
– Range of Host Addresses (first host and last host)
– Broadcast Address
• Other Subnet Information
– Total number of subnets
– Number of hosts per subnet
Major Network Information
• Host IP Address: 138.101.114.250
• Network Mask: 255.255.0.0
• Subnet Mask: 255.255.255.192

• Major Network Address: 138.101.0.0


• Major Network Broadcast Address: 138.101.255.255
• Range of Hosts if not Subnetted: 138.101.0.1 to 138.101.255.254
Step 1: Convert to Binary
138. 101. 114. 250
IP Address 10001010 01100101 01110010 11111010
Mask 11111111 11111111 11111111 11000000
255. 255. 255. 192

Step 1:
Translate Host IP Address and Subnet Mask into binary notation
Step 2: Find the Subnet Address
138. 101. 114. 250
IP Address 10001010 01100101 01110010 11111010
Mask 11111111 11111111 11111111 11000000
Network 10001010 01100101 01110010 11000000
138 101 114 192

Step 2:
Determine the Network (or Subnet) where this Host address lives:
1. Draw a line under the mask
2. Perform a bit-wise AND operation on the IP Address and the Subnet Mask
Note: 1 AND 1 results in a 1, 0 AND anything results in a 0
3. Express the result in Dotted Decimal Notation
4. The result is the Subnet Address of this Subnet or “Wire” which is
138.101.114.192
Step 2: Find the Subnet Address
138. 101. 114. 250
IP Address 10001010 01100101 01110010 11111010
Mask 11111111 11111111 11111111 11000000
Network 10001010 01100101 01110010 11000000
138 101 114 192

Step 2:
Determine the Network (or Subnet) where this Host address lives:
Quick method:
1. Find the last (right-most) 1 bit in the subnet mask.
2. Copy all of the bits in the IP address to the Network Address
3. Add 0’s for the rest of the bits in the Network Address
Step 3: Subnet RangeG.D.
/ Host Range
S.D.

IP Address 10001010 01100101 01110010 11 111010


Mask 11111111 11111111 11111111 11 000000
Network 10001010 01100101 01110010 11 000000
 subnet   host 
counting range counting
range
Step 3:
Determine which bits in the address contain Network (subnet) information and
which contain Host information:
• Use the Network Mask: 255.255.0.0 and divide (Great Divide) the from the
rest of the address.
• Use Subnet Mask: 255.255.255.192 and divide (Small Divide) the subnet
from the hosts between the last “1” and the first “0” in the subnet mask.
Step 4: First Host /G.D.Last HostS.D.
IP Address 10001010 01100101 01110010 11 111010
Mask 11111111 11111111 11111111 11 000000
Network 10001010 01100101 01110010 11 000000
 subnet   host 
counting range counting
range

First Host 10001010 01100101 01110010 11 000001


138 101 114 193

Last Host 10001010 01100101 01110010 11 111110


138 101 114 254

Broadcast 10001010 01100101 01110010 11 111111


138 101 114 255

Host Portion
• Subnet Address: all 0’s
• First Host: all 0’s and a 1
• Last Host: all 1’s and a 0
• Broadcast: all 1’s
Step 5: Total Number of Subnets
G.D. S.D.

IP Address 10001010 01100101 01110010 11 111010


Mask 11111111 11111111 11111111 11 000000
Network 10001010 01100101 01110010 11 000000
 subnet   host 
counting range counting
range

• TotalFirstnumber
Host of138subnets
10001010 01100101
101
01110010
114
11 000001
193
– Number
Last Host
of subnet
10001010
bits 01100101
10 01110010 11 111110

– 210 = 1,024 138 101 114 254

Broadcast 10001010 01100101 01110010 11 111111


– 1,024 total subnets
138 101 114 255

• Subtract one “if” all-zeros subnet cannot be used


• Subtract one “if” all-ones subnet cannot be used
Step 6: Total Number of Hosts per
Subnet G.D. S.D.

IP Address 10001010 01100101 01110010 11 111010


Mask 11111111 11111111 11111111 11 000000
Network 10001010 01100101 01110010 11 000000
 subnet   host 
counting range counting
range

• TotalFirstnumber
Host of hosts per
10001010 subnet 01110010
01100101 11 000001
138 101 114 193
– Number of host bits 6
Last Host 10001010 01100101 01110010 11 111110
– 2 = 64
6
138 101 114 254
– 64Broadcast
host per subnets
10001010 01100101 01110010 11 111111
• Subtract one for
138the subnet 101
address 114 255

• Subtract one for the broadcast address


– 62 hosts per subnet
Home Work
1. An IP address 101.10.11.110 on a classful network has subnet
mask 255.255.240.0, determine:
i. Class of the IP Address
ii. Default Subnet Mask
iii. Network Address
iv. Broadcast Address
v. Subnet Address
vi. Broadcast address for the subnet
vii. Valid Host ranges for the subnet
viii. Number of valid hosts on this subnet
ix. Number of subnets that can be created
2. 14 valid subnets are to be created using class C network address
192.168.1.0. Determine:
i. Required Subnet Mask
ii. First three valid subnets
iii. Last three valid subnets
iv. Number of valid hosts per subnet
72

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy