NUMERACY
CALCULATING IP ADDRESS
module 1
BY JOSEPH GALETA
IP ADDRESS
• An IP (internet protocol) address is a unique address
that identifies a device on the internet or a local
network
IP ADDRESS STRUCTURE
• IP addresses are expressed as a set of four numbers.
• Example address might be 192.158.1.38.
• Each number in the set can range from 0 to 255. So, the
full IP addressing range goes from 0.0.0.0 to
255.255.255.255. IP addresses are not random.
TYPES OF IP ADDRESSES
• PUBLIC IP ADDRESS:
A public IP address is used outside a network.
• PRIVATE IP ADDRESS:
A private IP address is used inside a network.
DIFFERENCE BWTN PUBLIC AND
PRIVATE
FEATURE PUBLIC IP ADDRESS PRIVATE IP ADDRESS
Accessibility Globally accessible Only accessible within the private
network
purpose Communication with external Communication within the private
networks network
Assignment Assigned by an ISP Assigned by network administrator
security More exposed to threats Less exposed to threats
CALCULATING IP ADDRESSES
192.168.1.1/24
NETWORK ADDRESS. HOST/ SUBNET MASK
SUBNET MASK: IS four-octet number used to identify the network ID
portion of a 32-bit IP address
Why use subnet masks?
• Efficient IP address allocation: Allows for better management of IP addresses within a network.
• Network segmentation: Divides a network into smaller, more manageable segments.
• Improved security: Can be used to isolate different parts of a network
BINARY
• Binary. is a number system that uses only two digits: 0 and 1.
Key points about binary:
• Base 2: Unlike the decimal system (base 10), binary has a base of 2.
• Place values: Each digit in a binary number represents a power of 2.
For example, the rightmost digit represents 2^0, the next digit
represents 2^1, and so on.
• Conversion: Binary numbers can be converted to and from other
number systems, such as decimal, hexadecimal, and octal.
EXAMPLE 1
• COVERT FROM BINARY TO DECIMAL
• BINARY: 1011
• DECIMAL: (1*2^3) +(0*2^2)+(1*2^1)+(1*2^1)
• 8+0+2+1=11
DECIMAL
Decimal is the number system we use in everyday life. It's based on 10
digits (0, 1, 2, 3, 4, 5, 6, 7, 8, and 9). Each digit represents a power of
10.
Key points about decimals:
• Base 10: The decimal system has a base of 10.
• Place values: The position of a digit in a decimal number determines
its value. For example, the rightmost digit represents the ones place,
the next digit represents the tens place, and so on.
• Conversion: Decimal numbers can be converted to and from other
number systems, such as binary, hexadecimal, and octal.
WHEN ALLOCATING IP ADDRESSES
Network Size:
The number of devices that need to be connected to the network.
Growth Potential:
The anticipated future growth of the network.
Security Requirements:
The level of security needed for the network.
Network Topology:
The physical layout of the network.
Existing Infrastructure:
Any existing IP address schemes or equipment.
IP Address Class:
The appropriate class of IP address (A, B, or C) based on the network size.
Subnet Mask:
The desired number of subnets and hosts per subnet.
DIFFERENCE BTWN IPV4 AND IPV6
•Address Space:
IPv4 uses 32 bits for addresses, while IPv6 uses 128 bits. This provides a significantly larger
address space for IPv6.
•Notation:
IPv4 addresses are written in dotted-decimal notation, while IPv6 addresses are written in
hexadecimal notation.
•Transition:
The transition from IPv4 to IPv6 is ongoing, with many organizations adopting dual-stack
configurations to support both protocols.
Concept of subnets mask and prefix
length
• 192.168.1.0
An IP address consists of two parts. Network address and Hot address
255.255.255.0
A subnet mask reveals how many bits in the IP address are used for the
network by masking the network portion of the IP address
Example
192.168.1.0 = binary 11000000.1010100.00000001.00000000
255.255.255.0 = 111111111.11111111.11111111.00000000
How to solve IP address to binary
8bits Octet Chart
128 64 32 16 8 4 2 1
If the number is 1, then the number that it represents counts
If the number is 0, then the number that it represents does not count
Ex. 1
192.168.1.0 = (11000000.10101000.00000001.)00000000
255.255.255.0 = (11111111.11111111.11111111.)00000000
This means say all that is connected with ones are network portions and the
zeros are Host
• Ex.2
172.16.1.0 =(10101100.00010000.) 00000001.00000000
255.255.0.0 =(11111111.11111111.)00000000.00000000
In this example, 2 will see the two portions are networks and the next two are the
host.
Ex 3
10.0.1.0 = (00001010.)00000000.00000001. 00000000
255.0.0.0 = (11111111.)00000000.00000000. 00000000
In this example, the first portion is for the network while the 3 portion is for the
host.
• Subnet Mask
Why does an IP address have a
network and host part
• Manager ability: Breaking down the large network into smaller networks or sub-
networks.
• Broadcast is used when a computer sends out data to all computer on the
network
subnetting
• Is done by changing the default subnet mask by borrowing some of
the bits from the host portion
EX.1
Formulas used to calculate hosts and
networks
Two formula
2^y-
Where y means the number of bits borrowed
2^x-2=#
Where x mean number of bits remaining in the host field after
borrowing
EXAMPLE
• What I the total number of usable host IDS you can have on a /24 or
255.255.255.0 network?
• Subnet mask: /24
• Binary #: 11111111.1111111.1111111.00000000
formula= h = 2*x-2
H=2^8-2
H=254
Example 2
• Find the number of subnets and the number of valid hosts per subnet
Soln
192.168.1.0
255.255.255.240 Change the subnet mask to binary
Binary: 11111111.1111111.1111111.11110000
subnets: 2^y,2^4= 16
Host: 2^x -2 , 2^4-2 =16 – 2= 14