Sunteți pe pagina 1din 46

IP address and

Subnetting
Syed Mushhad Gilani
An IP Address
 An IP address is a unique identifier,
or address for a computer or host
connection on a network.
• IPs are 32 bit binary numbers
represented in 4 parts of 8. Each part is
separated by a decimal point (.) and is
referred to as an octet. This is known
as a dotted decimal notation
 Example: 140.179.220.200
 In Binary:
10001100.10110011.11011100.11001000
Parts of An IP
 Every IP consist of two parts
• One part identifying the network
• One part identifying the node
 The Class of the address and the
subnet mask determines which part
belongs to the network address and
which part belongs to the node
address
Address Classes
 Class A
• Addresses begin with 0xxx, or 1 to 126
decimal
• Class A addresses would have the following
format:
 NNNNNNNN.nnnnnnnn.nnnnnnnn.nnnnnnnn
 There is one octet which defines the
network address, and three which defines
the node address
 Used for networks with more than 65,536
hosts (up to 16777214 hosts)
 Addresses beginning with:
01111111, or 127 decimal, are
reserved for internal, or local
machine use. For example if you ping
using 127.0.0.1, it should point to
yourself.
Class B
 Addresses begin with 10xx, or 128 to
191
 Format
• NNNNNNNN.NNNNNNNN.nnnnnnnn.nnnnnnnn
 There are two octets which define the network
address and two which define the node address
 Used for networks that have between 256 and
65,534 hosts
Class C Addressing
 Addresses begin with 110x, or 192 to
223
 Format
• NNNNNNNN.NNNNNNNN.NNNNNNNN.nnnnnnnn

 There are three octets which define the network


address and one which define the node address
 Used with networks that have fewer than 254
hosts
Class D Addresses
 Special category of IPs, which are
used for multicasting purposes
 Begin with 1110, or 224 to 239

decimal
Class E Addresses
 Special category of IPs, which are
often reserved for future use. They
are usually not be used for host
addresses
 Begin with 1111, or 240 to 254
Private subnets
 There are three network addresses
reserved for private networks
• 10.0.0.0
• 172.16.0.0
• 192.168.0.0
Internet Classes

 10011101 10001111 11111100 11001111 (Class B)


 11011101 10001111 11111100 11001111 (Class C)
 01111011 10001111 11111100 11001111 (Class A)
 11101011 10001111 11111100 11001111 (Class D)
 11110101 10001111 11111100 11001111 (Class E)
 Class A, B are full; class C still has available addresses; D
is reserved for multicasting and class E is reserved for
future use
Dotted decimal notation

 Used to make the form shorter and easier


to read
 Internet addresses are usually written
using this form
 Looking at the first byte of an address in
decimal form will allow us to determine
which class the particular address belongs
(for the example it belongs to class B)
Class ranges for Internet
addresses
The Sub-net Mask
 A 32-bit number used to describe which
portion of an address refers to the subnet
and which portion refers to the host.
• Every computer on a network must have the
same subnet mask. The following are
examples of different subnet masks:
 Class A 255.0.0.0 or
11111111.00000000.00000000.00000000
 Class B 255.255.0.0 or
11111111.11111111.00000000.00000000
 Class C 255.255.255.0 or
11111111.11111111.11111111.00000000
Default subnet masks
Broadcasting
 Used to send packets to all networks
or subnets.
 Two types of broadcasting:
• All-nets broadcasting - packet are
addressed:
 255.255.255.255
• Subnets broadcasting – Host portion of
the address is set to 255. For example
(from text)
 If the IP address is: 192.23.123.2, a class C
with a mask of 255.255.255.0, the
broadcast address would be 192.23.123.255
Subnetting
 Breaking a large network into
smaller networks (subnets)
Example
204.15.5.0 11001100.00001111.00000101.00000000 IP
Address
255.255.255.0
11111111.11111111.11111111.00000000 Subnet
mask

================================
255.255.255.22411111111.11111111.11111111.11100000
Subnetted
0r
This means there are 3 (23 – 2) new hosts available.
Technically this would create eight IPs, but two are
reserved for broadcast and network purposes, which leaves
6.

The subnet broadcast address would be:


204.15.5.255.11001100.00001111.00000101.11111111
Classless Interdomain Routing
(CIDR)
 Routers that support CIDR do not
make assumptions about the first 3
bits of the address, but rely on the
prefix length information.
 Prefix length is described as x (/x)
where x represents the network bits.
• For example: 255.255.255.224 or
11111111.11111111.11111111.11100000
• would be 255.255.255.224/27 because there are
27 network bits assigned
Creating Network Addresses
 Assume you were asked to create
four new networks (subnets) from
the following
• The leased network address is class C:
 204.15.5.0 Network
Address
 255.255.255.224 Subnet mask
 11111111.11111111.11111111.11100000

23 – 2 = 6
 Performing the AND (combination to get
network addresses)
• 3 bits have been borrowed to create the
subnets. Therefore, there are 8 possible
combinations as follows:
 000 – 0 (This is reserved and not used)
 001 – 32
 010 – 64
 011 – 96
 100 – 128
 101 – 160
 110 – 192
 111 – 224 (This is reserved and not used)
 The old network address was:
• 204.15.5.0
 The Four new network addresses would be
• 204.15.5.32
• 204.15.5.64
• 204.15.5.96
• 204.15.5.128
• The two remaining network addresses
(204.15.5.160 and 204.15.5.192) can be kept
for future use if more new networks are
needed.
IP Addressing and
Subnetting
Quick Techniques
A Few Ways The Exam Will Test
Your IP Addressing Knowledge
1. Given an IP address and mask, what
is the network/subnet number?
2. Given an IP address and mask, what
is the network/subnet broadcast
address?
3. Given an IP address and mask, what
are the assignable IP addresses in that
network/subnet?
Given an IP address and
mask, what is the
network/subnet number?
Decimal Algorithm for Deriving the
Network Number, No Subnetting in Use
 Step 1 – Write down the IP address
in decimal.
 Step 2 – Copy below the IP address

either the first one, two, or three


dotted decimal numbers of the
address, based on whether the
address is a Class A, B, or C address.
 Step 3 – For the remaining dotted
decimal numbers, record the decimal
value 0.
Decimal Algorithm for Deriving the
Network Number, No Subnetting in Use
IP Address Network Part Network
Number
8.1.4.5 8 8.0.0.0

130.4.100.1 130.4 130.4.0.0

199.1.1.4 199.1.1 199.1.1.0

172.100.2.2 172.100 172.100.0.0


Decimal Algorithm for Deriving the
Subnet Number, Basic Subnetting in
Use
 Step 1 – Write down the IP address in
decimal.
 Step 2 – Copy below the IP address either
the first one, two, or three dotted decimal
numbers of the address, based on
whether the subnet mask is 255.0.0.0,
255.255.0.0 or 255.255.255.0,
respectively .
 Step 3 – For the remaining dotted decimal
numbers, record the decimal value 0.
Decimal Algorithm for Deriving the
Subnet Number, Basic Subnetting in
Use
IP Address Mask Net and Full Subnet
Sub
8.1.4.5 255.255.0.0 8.1 8.1.0.0

130.4.100.1 255.255.255.0 130.4.100 130.4.100.0

199.1.1.4 255.255.255.0 199.1.1 199.1.1.0

172.100.2.2 255.255.255.0 172.100.2 172.100.2.0

17.9.44.3 255.255.255.0 17.9.44 17.9.44.0


Decimal Algorithm for Deriving the
Subnet Number, Difficult Subnetting
 Step 1 – Write down the IP address in
decimal.
 Step 2 – Write down the mask in decimal.
 Step 3 – Examine the mask. One of the
four octets will have a value besides 255
or 0; otherwise this would not be
considered a difficult case. The octet with
the non-255, non-0 value is considered to
be the “interesting” octet. The other three
are considered “boring.” Write down the
number of this “interesting” octet. ( For
example mask 255.255.240.0 has an
interesting third octet)
Decimal Algorithm for Deriving the
Subnet Number, Difficult Subnetting
 Step 4 – Subtract the mask’s
interesting octet value from 256.
Call that value the multiplier. Write
it down.
 Step 5 – For any boring octets to the
left of the interesting octet, copy
those octets’ values onto your paper,
leaving space for the remaining
octets. This will be where you record
your subnet number.
Decimal Algorithm for Deriving the
Subnet Number, Difficult Subnetting
 Step 6 – For any boring octets to the
right of the interesting octet, record
a value 0 in your subnet number.
One of the four octets should still be
empty – the interesting octet.
 Step 7 – Examine the interesting
octet of the original IP address.
Discover the multiple of the
multiplier closest to this number, but
less than the number. Write it into
the interesting octet of the subnet
Decimal Algorithm for Deriving the
Subnet Number, Difficult Subnetting
Address (Step 1) 130.4.101.129
Mask (Step 2) 255.255.252.0
Interesting Octet (Step 3) 3rd
Multiplier (Step 4) 256-252=4
Subnet boring octets (Step 5) 130.4.____.____
Subnet boring octets (Step 6) 130.4.____.0
Subnet (Step 7) 130.4.100.0
Decimal Algorithm for Deriving the
Subnet Number, Difficult Subnetting

Address (Step 1) 199.1.1.4


Mask (Step 2) 255.255.255.224
Interesting Octet (Step 3) 4th
Multiplier (Step 4) 256-224=32
Subnet boring octets (Step 5) 199.1.1.____
Subnet boring octets (Step 6) 199.1.1.____
Subnet (Step 7) 199.1.1.0
Decimal Algorithm for Deriving the
Subnet Number, Difficult Subnetting

Address (Step 1) 17.9.44.70


Mask (Step 2) 255.255.255.192
Interesting Octet (Step 3) 4th
Multiplier (Step 4) 256-192=64
Subnet boring octets 17.9.44.____
(Step 5)
Subnet boring octets 17.9.44.____
(Step 6)
Subnet (Step 7) 17.9.44.64
Given an IP Address and
Mask, What Is the
Network/Subnet Broadcast
Address?
Decimal Algorithm for Deriving the
Broadcast Address, No Subneting or
Basic Subnetting
 Step 1 – Write down the IP address in
decimal
 Step 2 – Copy below the IP address
either the first one, two, or three dotted
decimal numbers of the address, based
on whether the subnet mask is
255.0.0.0, 255.255.0.0 or
255.255.255.0, respectively.
 Step 3 – For the remaining dotted
decimal numbers, record the decimal
value 255.
Decimal Algorithm for Deriving the
Broadcast Address, No Subneting or
Basic Subnetting
IP Address Mask Net and Broadcast
Sub
8.1.4.5 255.255.0.0 8.1 8.1.255.255

130.4.100.1 255.255.255.0 130.4.100 130.4.100.25


5
199.1.1.4 255.255.255.0 199.1.1 199.1.1.255

172.100.2.2 255.255.255.0 172.100.2 172.100.2.25


5
17.9.44.3 255.255.255.0 17.9.44 17.9.44.255
Decimal Algorithm for Deriving the
Broadcast Address, Difficult Subnetting
 Step 1 – Write down the IP address in
decimal.
 Step 2 – Write down the mask in decimal.
 Step 3 – Examine the mask. One of the
four octets will have a value besides 255
or 0; otherwise this would not be
considered a difficult case. The octet with
the non-255, non-0 value is considered to
be the “interesting” octet. The other three
are considered “boring.” Write down the
number of this “interesting” octet. ( For
example mask 255.255.240.0 has an
interesting third octet)
Decimal Algorithm for Deriving the
Broadcast Address, Difficult Subnetting
 Step 4 – Subtract the mask’s
interesting octet value from 256.
Call that value the multiplier. Write
it down.
 Step 5 – For any boring octets to the
left of the interesting octet, copy
those octets values onto your paper,
leaving space for the remaining
octets. This will be where you record
the broadcast address.
Decimal Algorithm for Deriving the
Broadcast Address, Difficult Subnetting
 Step 6 – For any boring octets to the right
of the interesting octet, record a value of
255 in the broadcast address. One of the
four octets should still be empty – the
interesting octet.
 Step 7 – Examine the interesting octet of
the original IP address. Discover the
multiple of the multiplier closest to this
number, but greater than the number.
Subtract 1 from this multiple. Write it into
the interesting octet of the broadcast
address.
Decimal Algorithm for Deriving the
Broadcast Address, Difficult Subnetting
Address (Step 1) 130.4.101.129
Mask (Step 2) 255.255.252.0
Interesting Octet (Step 3) 3rd
Multiplier (Step 4) 256-252=4
Boring octets to left (Step 5) 130.4.____.____
Boring octets to right (Step 130.4.____.255
6)
Broadcast address (Step 7) 130.4.103.255
(104 is the closest multiple of 4
and is greater than 101; 104-
1=103
Decimal Algorithm for Deriving the
Broadcast Address, Difficult Subnetting
Address (Step 1) 199.1.1.5
Mask (Step 2) 255.255.255.224
Interesting Octet (Step 3) 4th
Multiplier (Step 4) 256-224=32
Boring octets to left (Step 5) 199.1.1.____
Boring octets to right (Step 199.1.1.____
6)
Broadcast address (Step 7) 199.1.1.31
(32 is the closest multiple of 32
and is greater than 5; 32-1=31
Given an IP Address and
Mask, What Are the Assignable
IP Addresses in That
Subnet/Network?
You often have to deal with the
question, “What IP addresses
are in this subnet?” Simply put,
the valid IP addresses that are
available for assignment in a
subnet are those numerically
between the subnet number and
the broadcast address.
Assignable Host Addresses
Subnet Subnet Mask Broadcast Host
Number Address Range
130.4.100.0 255.255.252.0 130.4.103.255 100.1 to
103.254
199.1.1.0 255.255.255.224 199.1.1.31 1.1 to
1.30
172.100.200.0 255.255.254.0 172.100.201.255 200.1 to
201.254
17.9.44.64 255.255.255.192 17.9.44.127 44.65 to
44.126

S-ar putea să vă placă și