Transcript File

IP Addresses & Classes
Presented By:
M.Usman Khan Ghauri
Nauman Aslam
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
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)
Why are IP addresses
necessary?
• IP addressing makes it possible for data passing
over the network media of the Internet to find its
destination.
• Because each IP address is a 32-bit value, that
means that there are four billion different IP address
possibilities.
• To ensure that each network number on the Internet
will always be unique and unlike that of any other
number, an organization called the International
Network Information Center(InterNIC)
Parts of An IP
• Every IP consist of two parts
– One part identifying the network(Network ID)
– One part identifying the node(Host ID)
• 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
What are the different classes of
networks?
• There are three classes of IP addresses
that are commercially used, company can
receive from the InterNIC. The InterNIC
reserves class "A" IP addresses for
governments throughout the world, class
"B" IP addresses for medium size
companies, and class "C“
• 2 other classes D&E [details on slides]
Address classes
• Classes of Networks
1 Byte
1 Byte
1 Byte
1 Byte
Class A:
N
H
H
H
Class B:
N
N
H
H
Class C:
N
N
N
H
Network number assigned by NIC
Host number assigned by Systems Administrator
Class ranges for Internet
addresses
Class A
• 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)
Class A
• IP Address Bit Patterns
Bit #
1
Class A:
0
8
2-8
9 – 32 (24 bits)
Network
#
16
Host #
24
Class A address range
1.0.0.0 – 126.0.0.0 (127.0.0.0 is for loopback)
Private Class A address: 10.0.0.0
Number of hosts: 224 -2 = 16,777,214
32
Loopback
• 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
IP addressing
• IP Address Bit Patterns
Bit #
Class B:
1
2
3 - 16
17 – 32 (16 bits)
1
0
Network #
Host #
8
16
24
32
Class B address range
128.0.0.0 – 191.255.0.0
Private Class B : 172.16.0.0 – 172.31.0.0
Number of hosts: 216 - 2 = 65,534
13
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
IP addressing
• IP Address Bit Patterns
Bit #
Class C:
8
1
2
3
1
1
0 Network #
16
4 - 24
24
Class C address range
192.0.0.0 – 233.255.255.0
Private Class C : 192.168.0.0
Number of hosts: 28 - 2 = 254
25 – 32 (8 bits)
32
Host #
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
What IP addresses are reserved
for broadcasts?
• for the network that is 176.10.0.0, the broadcast address
that would be sent out to all devices on that network
would be 176.10.255.255.
Private networks
• There are three network addresses
reserved for private networks
• 10.0.0.0 - 10.255.255.255
Addresses: 16,777,216
• 172.16.0.0 - 172.31.255.255
Addresses: 1,048,576
• 192.168.0.0 - 192.168.255.255
Addresses: 65,536
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)
Network Masks
•
•
A network mask helps you know which portion of the address identifies the
network and which portion of the
address identifies the node. Class A, B, and C networks have default
masks, also known as natural masks, as shown here:
–
–
–
•
•
•
•
Class A: 255.0.0.0
Class B: 255.255.0.0
Class C: 255.255.255.0
An IP address on a Class A network that has not been subnetted would
have an address/mask pair similar to: 8.20.15.1 255.0.0.0.
convert the address and mask to binary numbers.
8.20.15.1 = 00001000.00010100.00001111.00000001
255.0.0.0 = 11111111.00000000.00000000.00000000
Network Masks
• Any address bits which have corresponding mask bits set to 1
represent the network ID.
• Any address bits that have corresponding mask bits set to 0
represent the node ID.
• 8.20.15.1 = 00001000.00010100.00001111.00000001
• 255.0.0.0 = 11111111.00000000.00000000.00000000
• −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
• net id | host id
• netid = 00001000 = 8
• hostid = 00010100.00001111.00000001 = 20.15.1
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
• 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
Network Address
VS
Broadcast address
• A Network address has all the host bits set to “0”
• A Broadcast address has all the host bits set to “1”
• Therefore
– 131.181.112.0 is the network address
– 131.181.115.255 is the broadcast address
SUB-NETTING
Subnetting
• Breaking a large network into smaller
networks (subnets)
• Subnetting
– Is the act of “borrowing” bits from the host
portion to create smaller networks (called
subnetworks)
– Subnetting is used to reduce the number of
broadcast domains
– Communication between these subnetworks is
achieved through a router.
Who assigns subnet
addresses?
• As with the host number portion of class
"A," class "B," and class "C” addresses,
subnet addresses are assigned locally.
• Usually this is done by the network
administrator.
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:
Sub-netting
• To subnet a network, extend the natural mask using
some of the bits from the host ID portion of the address
to create a subnetwork ID.
• For example, given a Class C network of 204.15.5.0
which has a natural mask of 255.255.255.0, you can
create subnets in this manner:
• 204.15.5.0 − 11001100.00001111.00000101.00000000
• 255.255.255.224 −
11111111.11111111.11111111.11100000
•
•
•
3 Borrowed bits = eight subnets. (23 =8)
5 bits = 32 hosts (25 =32) actually 30 hosts.
So, with this in mind, these subnets have been created.
–
–
–
–
–
–
–
–
204.15.5.0
204.15.5.32
204.15.5.64
204.15.5.96
204.15.5.128
204.15.5.160
204.15.5.192
204.15.5.224
255.255.255.224
255.255.255.224
255.255.255.224
255.255.255.224
255.255.255.224
255.255.255.224
255.255.255.224
255.255.255.224
host address range 1 to 30
host address range 33 to 62
host address range 65 to 94
host address range 97 to 126
host address range 129 to 158
host address range 161 to 190
host address range 193 to 222
host address range 225 to 254
IP Addressing and Subnetting
Quick Techniques
Subnet mask
• How do we determine how many bits to “borrow”
for a subnet?
• Determine the number of sub networks required
• Work from the MOST significant (LHS) bits of
the first octet after the network number and
calculate the number of bits needed to create
the required number of subnetworks
Subnet mask
• How do we determine how many bits to “borrow”
for a subnet given the number of hosts required?
• Determine the number of hosts required
• Work from the LEAST significant (RHS) bits of
the last octet and calculate the number of bits
needed to create the required number of
subnetworks
Subnet & Routing
33
Subnet mask
• Example:
– You are given a class B address and you require
1000 nodes per subnet
– By working from the RHS (last octet) of the 4th octet,
calculate the number of bits to equal or slightly
exceed 1000. (ie 2x = > 1000)
– This would equate to 210 or 1024-2 networks
– Hence you will need to borrow 6 bits from the host
portion to create subnetworks with 1000 hosts each
34
Now Identify!
• In this example, you are given two address / mask
combinations, written with the prefix/length notation,
which have been assigned to two devices.
• Your task is to determine if these devices are on the
same subnet or different subnets.
• You can do this by using the address and mask of each
device to determine to which subnet each address
belongs.
[Classless Interdomain Routing (CIDR) format]
• DeviceA: 172.16.17.30/20
• DeviceB: 172.16.28.15/20
Example Solution 1
• 172.16.17.30 − 10101100.00010000.00010001.00011110
• 255.255.240.0 −11111111.11111111.11110000.00000000
•
−−−−−−−−−−−−−−−−|sub|−−−−−−−−−−−−
• subnet =
10101100.00010000.00010000.00000000 =
172.16.16.0
• Looking at the address bits that have a corresponding
mask bit set to one, and setting all the other address bits
to zero (this is equivalent to performing a logical "AND"
between the mask and address), shows you to which
subnet this address belongs. In this case, DeviceA
belongs to subnet 172.16.16.0.
Now Solve?
• DeviceB: 172.16.28.15/20 ?
• Are deviceA and B on same subnet?
SUPERNETTING
Supernetting
Supernetting is the idea of combining two or
more blocks of IP addresses that together
compose a continuous range of addresses
(no missing addresses in the middle).
A super subnet that contained both
of the smaller classful subnets
Supernetting
Supernetting
Rules:
** The number of blocks must be a power of 2 (1, 2,
4, 8, 16, . . .).
** The blocks must be contiguous in the address space
(no gaps between the blocks).
** The third byte of the first address in the superblock
must be evenly divisible by the number of blocks. In
other words, if the number of blocks is N, the third
byte must be divisible by N.
Did you get it enough?