0% found this document useful (0 votes)
5 views

IP Addressing Subnetting1

The document discusses IP addressing and subnetting, explaining the significance of unique IP addresses for hosts and routers on the Internet, as well as the differences between IPv4 and IPv6. It covers the classification of IP addresses, subnet masks, and the advantages and disadvantages of subnetting, while also detailing how to convert between binary and decimal systems. Additionally, the document outlines the structure of various IP address classes and their respective subnetting applications.
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

IP Addressing Subnetting1

The document discusses IP addressing and subnetting, explaining the significance of unique IP addresses for hosts and routers on the Internet, as well as the differences between IPv4 and IPv6. It covers the classification of IP addresses, subnet masks, and the advantages and disadvantages of subnetting, while also detailing how to convert between binary and decimal systems. Additionally, the document outlines the structure of various IP address classes and their respective subnetting applications.
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 74

IP Addressing &

Subnetting

By Hellen Nantege
IP ADDRESSING
IP Addressing
 Every host or router on the Internet is identified
by a unique IP address
 The role of an IP address can be defined as "A
name indicates what we seek. An address
indicates where it is. A route indicates how to get
there.” (from Internet Protocol – DARPA Internet
Program Protocol Specification (September
1981))
 A Computer can have more than one IP address
 There are two common versions IPv4 and IPv6
Types / ways of Ips
 An IP address can be a single recipient or a group of
recipients
 Three ways:

 uniticast  One single IP to another

 Multicast  To only intended recipients

 broadcast  to all connected recipients


Classification of IPs
 Ip addresses classifications include:
• Static addresses – Never change but
can be changed due to network
administration. Details of the country,
continent and region where machine is
located
• Dynamic address – Assigned to
computers when they get connected to
the internet each time. ISPs usually
reserve portion of their assigned
addresses for subscribers.
• Static are less secure than Dynamic
IPv4
 IPv4 is the old version but still in use
 Each IPv4 address is 32 bits in length and
normally written in dotted decimal format that
means each byte (8 bits) are separated by a dot
 Each decimal number is in the range of 0 to 255

For example: 192.168.0.111000000
10101000 00000000 00000001
 You can represent 232 = 4 294 967 296 different
addresses
 Each IPv4 Address is separated by a net mask
into a network and a host (computers) part.
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
 Example of an IP version 4:
172.64.126.52
IPv6
 IPv6 was standardized in 1998 and deployed starting in mid
2000.
 Each IPv6 address is 128 bits in length
 This means you can represent 2128 ≈ 3.4 * 10 38 different
addresses
 IPv6 addresses are represent in hexadecimal
 You combine two octets and separate the group by a colon (:)

For example 1001:0dab:79b4:0000:0001:9c3d:0268:8877
 You can replace one sequence of blocks by :: if they only
contain zeros

For example 1001:0dab:79b4::0001:9c3d:0268:8877
 Each IPv6 address is separated by a prefix length into a
network and host part
IPv6 vs IPv4
 6 provides better end to end connectivity
than 4.
 6 has comparatively faster routing
 6 offers ease of administration than 4
 6 has more security for apps and
networks
 6 provides better muticast and anycast
ablilities
 6 has better mobility features than 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.
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
 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.
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.
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)


Converting to Decimal
(Cont.)
 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
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.
IP Address Classes
 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.
IP Address Classes (Cont.)
 The 5 IP classes are split up based
on the value in the 1st octet:
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.
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


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.
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.
IP Addressing Classes

Class A - 0nnnnnnn.hhhhhhhh.hhhhhhhh.hhhhhhhh
Initial byte = 0-127 (7 bits)
1.0.0.0 – 127.255.255.255

Class B - 10nnnnnn.nnnnnnnn.hhhhhhhh.hhhhhhhh
Initial byte = 128-191 (14 bits)
128.0.0.0 – 191.255.255.255

Class C - 100nnnnn.nnnnnnnn.nnnnnnnn.hhhhhhhh
Initial byte = 192-223 (21 bits)
192.0.0.0 – 223.255.255.255
Class D – Used in multicasting.
Class E – Reserved for Future Use.
n = network address h = host address
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.
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.
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
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.
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.
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.
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.
Class C IP Addresses (Cont.)
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.
Special Addresses (Cont.)
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.
Special Addresses (Cont.)
 A list of these addresses for each
IP address class:
Subnet 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.
Subnet 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.
 Under this addressing scheme, called
Subnetting, separating the Network &
Host requires a special process called
Subnet Masking.
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.
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.
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.
Subnet Mask
Determines the way an IP address is split into
network and hosts portions

Class A -
0nnnnnnn.hhhhhhhh.hhhhhhhh.hhhhhhhh
Subnet Mask = 255.0.0.0 IP Address /8

Class B -
10nnnnnn.nnnnnnnn.hhhhhhhh.hhhhhhhh
Subnet Mask = 255.255.0.0 IP Address /16

Class C -
100nnnnn.nnnnnnnn.nnnnnnnn.hhhhhhhh
Subnet Mask = 255.255.255.0 IP Address /24
SUBNETTING
Definition

Subnetwork, or subnet, is a logically


visible, distinctly addressed part of a
single Internet Protocol network.

Subnetting is the division of a


computer network into groups of
computers that have a common,
designated IP address routing prefix.
Advantages
- Allows a single shared network address to split it up
into many smaller networks.
- Without subnets, organizations would require many
network addresses
Limited number of Network addresses available
- Alleviates traffic
Smaller routing tables
Alleviates excessive packet collision and
congestion
- Easier to manage and solve problems
- Better Security
Separating departments with highly sensitive
material
Disadvantages

 Doesn’t allocate IP address


proportionately per subnet
 Limited by the number of IP
address
 Require buying extra hardware
such as routers
Subnet Applications
Anywhere a large group of computers are
located.
SubNetted Networks
 The network portion of the address is
extended by splitting up the host
number

 Borrowing 1 or more bits from the


host bit portion
Example:
Dividing a network into 2 subnets requires to borrow
1 bit

Class C:
11111111.11111111.11111111.10000000(255.255.2
55.128)
CIDR IP address /25
This would allow 126 hosts per subnet

All 1’s are reserved for broadcast ID


All 0’s are reserved for network ID
192.168.5.130 / 192.168.5.0 = Network ID
24 4 Subnets = 62
Subnet mask =
255.255.255.0 hosts/subnet
Borrow 2 bits from
host byte
Subnet Mask =
255.255.255.192
Subnet A =
-> /26
192.168.5.1/26
to
192.168.5.62/26
Subnet B ->
192.168.5.65/26
to
192.168.5.126/26
Subnet C ->
192.168.5.129/26
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
using ANDING;
 1 and 1 = 1

 1 and 0 = 0

 0 and 1 = 0

 0 and 0 = 0
Default Standard Subnet
Masks
 There are default standard subnet
masks for Class A, B and C addresses:
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.
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.00
010101
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.00000
000
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:
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.
5. IP address : 206.175.162.21
6. Subnet mask : 255.255.255.0
7. Network address: 206.175.162.0
Verifying an IP Address
 IP addresses are verified using
PING, Trace & Telnet.
 It is important that you know that
PING is used to verify IP address
connections to the Network Layer
& that Telnet is used to verify
network IP address connections to
the Application Layer.
Verifying with Telnet
 The reason you need to verify IP
addresses is to ensure that the various
parts of a network can properly
communicate with the other parts.
 Eg., if you can Telnet (Terminal
Emulation Protocol) into a router from a
remote location on the same network,
you can verify that the interface & route
are up and available.
Verifying with Telnet (Cont.)
 Because Telnet operates on the
OSI Model’s Application Layer,
when it’s functioning, it’s safe to
assume that all lower layers are
also functioning.

 Hope you know the OSI & TCP/IP


layers?
Verifying with PING
 The PING (Packet Internet Groper)
command verifies OSI Layer 3
(Network Layer) connectivity.
 It sends out ICMP (Internet Control
Message Protocol) messages to
verify both the logical addresses &
the Physical connection.
Verifying with PING (Cont.)
 The PING command issued from a Cisco
router responds with a number of single
character responses.
Verifying with Traceroute
 The Traceroute or Trace command
is used to show the complete route
from a source to a destination.
 Trace sends out probe packets one
at a time to each router or switch
in the path between the source &
the destination IP address entered.
Verifying with Traceroute
(Cont.)
 Traceroute displays the round-trip
time for each packet sent to each
upstream router.
 Traceroute has really only 2 results:
 Time exceeded or
 Destination unreachable.
 Trace is used to determine where a
breakdown in a route may be
occurring.
Verifying with Traceroute
(Cont.)
 Example on how Trace is used:
 A network has 4 routers (A, B, C & D). A
Trace command is issued on router A to
trace the route from itself to router D.
 A timing response comes back from
router B, but the next message indicates
that router C is unreachable. You can be
fairly certain that the problem lies
somewhere on the route between router
B & router C.
Verifying with Traceroute
(Cont.)
 Like PING, Trace has its own set of
response codes:
Classless
Interdomain
Routing (CIDR)
CIDR Background
 Created in response to the
exhaustion of IPV4 network
addresses
 Increase in size of the Internet’s
routing tables
Features of CIDR
 Elimination of classful addressing
 Enhanced router aggregation
 Supernetting
 Classless Addressing
Class C Subnetting

# of Subnets # of NetMask 4th Octet CIDR


Hosts/Subne Notation
t
2 126 255.255.255.1 10000000 /25
28
4 62 255.255.255.1 11000000 /26
92
8 30 255.255.255.2 11100000 /27
24
16 14 255.255.255.2 11110000 /28
40
32 6 255.255.255.2 11111000 /29
48
64 2 255.255.255.2 11111100 /30
52
Classless Addressing
 Generalised network prefix, could be
any length not limited to 8, 16, 24 bits
 E.g. 122.126.66.8/16 identifies a CIDR
address with 20 network bits
 Network address is 122.126.0.0
 Broadcast address is 122.126.255.255
 16 network bits
 16 host bits
Classless Addressing
 E.g. 172.110.20.2/24
 Network address 172.110.20.0
 Broadcast address 172.110.20.255
 Number of network bits 24
 Number of host bits 8
Assignment:/
10mrks/10mins
 From the knowledge you have
acquired, determine the?
 The class, Total hosts & Networks for
that class, Network address, Broadcast
address, Number of network bits,
Number of host bits for these Ips:
 192.168.20.4
 120.100.3.1
Questions

You might also like