The document provides an introduction to IP addressing and subnetting. Some key points include:
- An IP address identifies a device on an IP network and is made up of 32 binary bits divided into a network and host portion using a subnet mask.
- IP addresses are written in dotted decimal format with four octets separated by periods.
- IP addresses allow devices to communicate using TCP/IP by sending and receiving IP packets.
- IP addresses are classified into classes A, B, and C depending on the range of the first octet. Each class supports a different number of networks and hosts.
- Subnetting allows a network to be divided into multiple subnets while appearing as a single network externally using a subnet
2. An IP address is an address used to uniquely identify a
device on an IP network.
The address is made up of 32 binary bits which can be
divisible into a network portion and host portion with
the help of a subnet mask.
32 binary bits are broken into four octets (1 octet = 8
bits)
Dotted decimal format (for example, 172.16.81.100)
IP Addressing
3. If a device wants to communicate using TCP/IP, it needs
an IP address.
When the device has an IP address and the appropriate
software and hardware, it can send and receive IP packets.
IP addresses consist of a 32-bit number, usually written in
dotted-decimal notation.
The "decimal" part of the term comes from the fact that
each byte (8 bits) of the 32-bit IP address is converted to
its decimal equivalent.
IP Addressing…
4. The four resulting decimal numbers are written in
sequence, with "dots," or decimal points, separating the
numbers—hence the name dotted-decimal.
Example: Dotted-decimal notation and binary
notation for an IPv4 address
IP Addressing…
5. Example 1: Change the following IPv4 addresses from
binary notation to dotted-decimal notation.
IP Addressing…
Solution: We replace each group of 8 bits with its
equivalent decimal number and add dots for separation.
6. Example 2: Change the following IPv4 addresses from
dotted-decimal notation to binary notation.
IP Addressing…
Solution: We replace each decimal number with its
binary equivalent.
7. Each of the decimal numbers in an IP address is called an octet.
So, for an IP address of 168.1.1.1, the first octet is 168, the second
octet is 1, and so on.
The range of decimal numbers in each octet is between 0 and 255,
inclusive.
Note that each network interface uses a unique IP address.
If you put two Ethernet cards in a PC to forward IP packets
through both cards, they both would need unique IP addresses.
Similarly, routers, which typically have many network interfaces that
forward IP packets, have an IP address for each interface
IP Addressing…
8. Example 3: Find the error, if any, in the following IPv4
addresses.
Solution:
a. There must be no leading zero (045).
b. There can be no more than four numbers.
c. Each number needs to be less than or equal to 255.
d. A mixture of binary notation and dotted-decimal
notation is not allowed.
9. Assigning IP address has two ways such as static and dynamic.
Static:
Each computer is assigned a unique address manually by the
network administrator.
It will keep this address until the network administrator assigns a
different one.
IP conflict would happen if not carefully assigned
Difficult to update/change
Dynamic
Automatic configuration by DCHP server.
Easy to update
IP Addressing…
10. IPv4 (Internet protocol version 4)
Uses 32 bit address.
Possible addresses 2^32 = 4,294,967,296 (4.3 billion)
Some addresses are reserved like private addresses and
multicast addresses.
Private addresses (LANs)
10.0.0.0 – 10.255.255.255
172.16.0.0 – 172.31.255.255
192.168.0.0 – 192.168.255.255
Total reserved private addresses = 18 Million
Multicast addresses
224.0.0.0 – 239.255.255.255
Total multicast addresses = 270 million
Available addresses = possible addresses – (private
addresses+ multicast addresses)
11. IPv6 (Internet protocol version 6)
Increase in number of addresses.
128 bits long address.
Represented in hexadecimal.
Possible addresses 2^128.
2^96 more address than IPv4.
ARP, RARP, IGMP are deleted or merged into ICMPv6
protocol.
13. Class A/8 network
In class A networks, the first 8 bits(first octet) of the IP
address are fixed for network address (i.e. the first of the
four numbers).
Class A has few networks, each with many hosts.
IPv4 address space is 2^32=4,294,967,296 addresses.
Class A individual addresses 2^31=2,147,483,648 which is
50 percent of IPv4 address space.
Class A networks assigned to large companies. For
example, IBM have the class A network 9.*.*.* and
Apple have 17.*.*.*.
14. Cont…
Start with binary 0
Totally for class A has 126 available network addresses
which is 27
-2= 126.
All zeros (00000000) is reserved for default route, 127 is
reserved for loopback(01111111)
Each network support maximum of 16,777,214(2^24-2)
hosts, all zeros for these network and all ones for
broadcast number.
15. Range 1.x.x.x to 126.x.x.x
Default subnet mask 255.0.0.0
Example: 100.55.254.1 or 9.23.188.29
More examples????
Cont…
16. Class B/16 network
Class B network has 2 start bits(10),14 bit network
number & 16 bit host number.
Medium number of networks, each with a medium
number of hosts.
A maximum of 2^14= 16,384 networks can be defined.
They can have up to 216-2 ( one for network and one
for broadcast address) = 65,534 different computers on
their network.
Class B individual addresses 2^30=1,073,741,842
It contain 25 percent of the total IPv4 address space
Microsoft is an example of a company with a class B
network.
17. Cont…
It starts with bit 10
Range 128.x.x.x to 191.x.x.x
It has 16 bits for network id and 16 bits for host id
Its default subnet mask 255.255.0.0
Example: 172.16.125.3
18. Class C/24 Network
Class C networks have the first 24 bits of the IP
address fixed.
A maximum of 2^21=2,097,152 networks can be
defined with up to 2^8-2 =254 hosts per network.
Class C’s individual addresses is 2^29 =536,870,912
This represents 12.5 percent of the total Ipv4 address
space.
Many networks, each with a few hosts.
19. Cont…
Start with bit 110
Range 192.x.x.x to 223.x.x.x
Its default subnet mask 255.255.255.0
Example: 200.23.12.99
20. Summary of Classful IP
The class A format allow for up to 126 networks with 16 million
hosts each, class B about 16,384 networks with up to 65,538 hosts each,
and class C about 2 million networks with up to 254 hosts each.
Also supported format is multicast (Class D), in which a datagram is
directed to multiple hosts.
Addresses beginning with 1111( Class E) are reserved for use in the
future.
21. Summary of Classful IP…
For most organizations, a class A network, with 16 million addresses, is
too big, and a class C network, with 254 addresses is too small.
A class B network, with 65,534, is just right.
26. Example 4
Find the class of each address.
a. 00000001 00001011 00001011 11101111
b. 11000001 10000011 00011011 11111111
c. 14.23.120.8
d. 252.5.15.111
Solution
a. The first bit is 0. This is a class A address.
b. The first 2 bits are 1; the third bit is 0. This is a class C
address.
c. The first byte is 14; the class is A.
d. The first byte is 252; the class is E.
27. Private IP Address
Are address that are reserved for internal networks only
They are commonly used in internetworks not connected
to the global internet.
Is used by any company in its internal networks
28. It is globally unique address which assign to devices
which connect to internet.
Company and organization purchases public IP address
from IANA such as web servers, google servers, mail
server.
But devices using private address can also access the
global internet by using NAT(Network Address
Translation).
NAT is used for the purpose of translation between
private and public IP addresses.
Public IP Address
29. Network Address
The network address is the first address.
It defines the network to the rest of the Internet.
Given the network address, we can find the class of the address, the
block, and the range of the addresses in the block
In classful addressing, the network address (the first address in the
block) is the one that is assigned to the organization.
30. Network Address
Given the network address 132.21.0.0, find the
class, the block, and the range of the addresses
Solution
The 1st byte is between 128 and 191. Hence, Class B.
The block has a netid of 132.21.
The addresses range from 132.21.0.0 to 132.21.255.255.
34. Subnet and Subnet Mask
Subnet allows the block of addresses to be split into
several parts for internal use as multiple networks, while still
acting like a single network to the outside world.
The networks such as Ethernet LANs that result from
dividing up a larger network are called subnets.
Subnets are defined by fixing a certain number of the 32
bits in the IP address, and allowing the others to vary.
35. Subnet…
Subnetting an IP network can be done for various reasons
including:
Organization
Use of different physical media
Preservation of address space
Security
Control network traffic
36. Subnetting
Subnetting is done by borrowing bits from the host part and
add them to the network part.
The host portion of the internet address is partitioned into a
subnet number and a host number.
Number of subnet/network=2n , where n is borrowed 1s
from host part.
Number of hosts per subnet=2m -2, where m is remaining
0s for host part.
37. Subnet mask is an IP address with 32 bits that identify the
network portion of the address from host portion address.
So , the subnetted network and bit positions containing this
extended network number are indicated by the address mask.
38. Cont…
In general subnet plays an important parts in IP address by helping to
determine the network, subnetwork and host part of IP address.
Example: Address Masks
Network layer devices use IP address and mask to determine network
portion of the address.
Class Mask Dot decimal
A 11111111000000000000000000000000 255.0.0.0
B 11111111111111110000000000000000 255.255.0.0
C 11111111111111111111111100000000 255.255.255.0
42. Finding the Subnet Address
Given an IP address, we can find the subnet address the same way we
found the network address. We apply the mask to the address by
ANDing the given address with the subnet mask..
Example 1:
What is the subnetwork address if the destination address is
173.45.34.56 and the subnet mask is 255.255.240.0?
43. Solution
173.45.34.56 11001000 00101101 00100010 00111000
AND
255.255.240.0 11111111 11111111 11110000 00000000
173.45.32.0 11001000 00101101 00100000 00000000
Therefore, the subnetwork address is 173.45.32.0.
44. Finding subnet address…
Example 2: What is the subnetwork address if the destination address is
19.30.84.5 and the mask is 255.255.192.0?
47. Subnetting and subnet mask…
Example 1: Let scenario which has IP address with class C
192.168.50.0/24 and 6 sub-networks. Then find each
subnetworks, host addresses range, and broadcast for each
subnetworks.
48. Solution:
Total number of subnets for the above scenario is 6.
So we need 3 network bits from host portion of the given IP address
(192.168.50.0/24) then 23 = 8 subnets we have but we need only 6.
Then the subnet mask becomes /24+3 =/27 which is .11100000 with
equivalent decimal of .224 for all sub-networks.
Subnetwork range is 256-224 or 25 = 32 (5 is host bit left from 8 bits
when 3 bits borrowed for subnet bits and we have 32-2=30 hosts in each
subnets)
Then look the following table carefully
49. 49
Subnetting and subnet mask…
Solution:
No.
subnets
Subnetworks Usable Host ranges Broad cast
address
0 192.168.50.0 192.168.50.1-192.168.50.30 192.168.50.31
1 192.168.50.32 192.168.50.33-192.168.50.62 192.168.50.63
2 192.168.50.64 192.168.50.65-192.168.50.94 192.168.50.95
3 192.168.50.96 192.168.50.97-192.168.50.126 192.168.50.127
4 192.168.50.128 192.168.50.129-192.168.50.158 192.168.50.159
5 192.168.50.160 192.168.50.161-192.168.50.190 192.168.50.191
6 192.168.50.192 192.168.50.193-192.168.50.222 192.168.50.232
7 192.168.50.224 192.168.50.225-192.168.50.254 192.168.50.255
Mask address or subnet mask for all subnetwork of the above table is
/24+3 = /27 or 225.255.255.224
50. Subnetting and subnet mask…
Solution:
In general we have 8 subnetworks in class C and for our
scenario we use 6 of them and remaining subnets are reserved
for expanding network if necessary.
Now it easy to assign host ID to host and network ID and
configure the router for routing the message
51. Cont…
Example 2: A company is granted the site address 201.70.64.0 (class
C). The company needs six subnets. Design the subnets.
Exercise: Design for 10 Subnets???
Solution
The number of 1s in the default mask is 24 (class C).
The company needs six subnets. This number 6 is not a power of 2. The
next number that is a power of 2 is 8 (23). We need 3 more 1s in the
subnet mask. The total number of 1s in the subnet mask is 27 (24 + 3).
The total number of 0s is 5 (32 - 27).
52. Cont…
The mask is
11111111 11111111 11111111 11100000
or
255.255.255.224
The number of subnets is 8.
The number of addresses in each subnet is 25 -2 (5 is the number
of 0s) or 30.
Next Slide
54. Cont…
Example 3: A company is granted the site address 181.56.0.0 (class B).
The company needs 1000 subnets. Design the subnets.
Solution
The number of 1s in the default mask is 16 (class B).
The company needs 1000 subnets. This number is not a power of 2. The
next number that is a power of 2 is 1024 (210). We need 10 more 1s in
the subnet mask.
The total number of 1s in the subnet mask is 26 (16 + 10).
The total number of 0s is 6 (32 - 26).
55. Cont…
The mask is
11111111 11111111 11111111 11000000
or
255.255.255.192.
The number of subnets is 1024.
The number of addresses in each subnet is 26 (6 is the number
of 0s) or 64 having 62 hosts per each subnet.
See next slide
57. Cont…
Example 4: An organization has an IP address of 10.0.0.0/15. Design
the network with maximum number subnets, host addresses and
broadcast addresses.
Solution
The mask is 11111111 11111110 00000000 00000000
or
255.254.0.0.
Total number of 1s borrowed is 7, i.e 27 = 128 subnets.
The total number of 0s is 17 (32 - 15), i.e 217_2 = 131,070 hosts per subnet
Increment for the subnet is 256-254=2 or 21 =2
???? Exercise: Design the network for 31.0.0.0/16 and 31.0.0.0/18
58.
59.
60.
61. Exercise 1
Subnet the Class C IP Address 205.11.2.0 so that you have 30 subnets.
What is the subnet mask for the maximum number of hosts?
How many hosts can each subnet have?
What is the IP address of host 3 on subnet 3 ?
62. Solution
Current mask= 255.255.255.0
Bits needs for 30 subnets is5, 25 =32 possible subnets
Bits left for hosts = 3 , 23 -2=6 possible hosts.
So our mask in binary =11111000= 248 decimal
Final Mask =255.255.255.248
Address of host 3 on subnet 2 is 205.11.2.19
What about IP address of host 7 on subnet 8 ?
63. Exercise 2
Subnet the Class C IP Address 195.1.1.0 So that you have 10 subnets each
with a maximum 12 hosts on each subnet. List the Address of host 1 on
1st, 2nd, 3rd, 4th, and 11thsubnets
Solution
Current mask= 255.255.255.0
Bits needed for 10 subnets =4, 24 =16 possible subnets
Bits needed for 12 hosts = 4, 24 = 16-2=14 possible hosts.
So subnet mask in binary is 11110000 which is 240 in decimal
Final Mask is 255.255.255.240
65. Variable Length Subnet Mask(VLSM)-Classless IP address
Allows the ability to have more than one subnet mask within a
network
Allows re-subnetting: create sub-subnet network address
Increase the routes capability
66. Classful and classless IP
Classful (Obsolete):
Wasteful address architecture
Network boundaries are fixed at 8, 16 or 24 bits(class
A, B, and C)
Classless:
Efficient architecture( best current practice)
Network boundaries may occur at any bit(e.g. /12,
/16, /19, /24 etc)