Computer Networks
Wardah Saleh
Contents:
IP Address
Subnet Mask
Classful IP Address
CIDR
Sub-netting
AIUB Wardah Saleh Computer
2
Networks
IP Address
• Full form Internet Protocol Address/ Logical Address
192.168.1.1 192.168.1.2
AIUB Wardah Saleh Computer
3
Networks
IP Address (Continued…)
• Layer-3/Network layer address
• Versions: IPV4, IPV6
• IPV4: 32 bit long, 2^32=4,294,967,296 IP addresses
• Expressed in dot decimal format
• Example: 192.168.10.1
• Binary format:
11000000.10101000.00001010.00000001
• Comprised of four octets, separated by dots
• Each octet is an 8 bit number
AIUB Wardah Saleh Computer
4
Networks
IP Address (Continued…)
• Example:
192.168.10.1 (Decimal)
11000000.10101000.00001010.00000001 (binary)
2^7 2^6 2^5 2^4 2^3 2^2 2^1 2^0
=128 =64 =32 =16 =8 =4 =2 =1
1 1 0 0 0 0 0 0
128+64=192
AIUB Wardah Saleh Computer
5
Networks
Subnet Mask
• IP address has two parts:
Network Portion (N)
Host Portion (H)
• Used to identify N and H portion
• IP is incomplete without SM
• Rules:
All network bit set to “1”
All host bit set to “0”
•AIUB Network bits in SM must always contiguous
Wardah Saleh Computer
6
Networks
Subnet Mask (Continued…)
• Example:
IP address: 172.16.0.0
Subnet Mask: 255.255.0.0 (decimal)
Subnet Mask: 11111111.11111111.00000000.00000000 (binary)
AIUB Wardah Saleh Computer
7
Networks
Classful IP Address
• IPV4 address space is structured into five classes:
Class 1st Octet 1st Octet 2nd Octet 3rd Octet 4th Octet Default SM
A 0 - 127 N H H H 255.0.0.0
B 128 – 191 N N H H 255.255.0.0
C 192 – 223 N N N H 255.255.255.0
D 224 – 239 Multicast N/A
E 240 - 255 N/A
Experimental
AIUB Wardah Saleh Computer
8
Networks
Classful IP Address (Continued…)
Number of Networks: Number of Hosts:
Class 1st Octet 1st octet in Binary 2^N 2^H - 2
A 0 – 127 00000000 – 01111111 2^7 = 128 2^24-2=16,777,214
B 128 – 191 10000000 – 10111111 2^14 = 16,384 2^16 – 2 = 65,534
C 192 – 223 11000000 – 11011111 2^21 = 2,097,152 2^8 – 2 = 254
AIUB Wardah Saleh Computer
9
Networks
CIDR
• Full form Classless Inter-Domain Routing
• Simplified method of representing SM
• Invented to keep the Internet running out of IP addresses
• Represented by a slash (/) sign
• Classful addresses in CIDR:
Class A - /8
Class B - /16
Class C - /24
AIUB Wardah Saleh Computer
10
Networks
CIDR (Continued…)
• Difference between classful and classless IP:
172.16.0.0/16 – class B and classful
SM: 255.255.0.0 (decimal)
SM: 11111111.11111111.00000000.00000000 (binary)
172.16.0.0/24 – class B and classless
SM: 255.255.255.0 (decimal)
SM: 11111111.11111111.11111111.00000000 (binary)
AIUB Wardah Saleh Computer
11
Networks
CIDR (Continued…)
• Classful address scheme of allocating IP address can be very
wasteful…
• For example:
With classful addressing scheme, minimum number of IP address is
256 (for class C)
Giving 256 IP addresses to an organization needing only 15
addresses is so wasteful
• CIDR solves this problem
AIUB Wardah Saleh Computer
12
Networks
Sub-netting
• Process of dividing a big network into smaller multiple networks
• Main reason for sub-netting is solving the shortage of IP addresses
over the Internet
• Sub-netting is two types:
FLSM (Fixed Length Subnet Mask)
VLSM (Variable Length Subnet Mask)
AIUB Wardah Saleh Computer
13
Networks
FLSM
• Used to classful addressing. For example a classful address of
class A (/8)
• Breaks a network segment into smaller EQUAL-SIZED subnets
• All of the subnets will have the same SM
• Still results inefficient use of IP address
AIUB Wardah Saleh Computer
14
Networks
VLSM
• Breaks up a network into smaller UNEQUAL-SIZED subnets
• Supports different number of hosts in each subnet
• SM of all subnets varies
• Provides more efficient use of address space
AIUB Wardah Saleh Computer
15
Networks
AIUB Wardah Saleh Computer
16
Networks