IP Addresses & Classes Presented By: M.Usman Khan Ghauri Nauman Aslam.

43
IP Addresses & Classes Presented By: M.Usman Khan Ghauri Nauman Aslam

Transcript of IP Addresses & Classes Presented By: M.Usman Khan Ghauri Nauman Aslam.

Page 1: IP Addresses & Classes Presented By: M.Usman Khan Ghauri Nauman Aslam.

IP Addresses & Classes

Presented By:M.Usman Khan GhauriNauman Aslam

Page 2: 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

Page 3: IP Addresses & Classes Presented By: M.Usman Khan Ghauri Nauman Aslam.

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)

Page 4: IP Addresses & Classes Presented By: M.Usman Khan Ghauri Nauman Aslam.

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)

Page 5: IP Addresses & Classes Presented By: M.Usman Khan Ghauri Nauman Aslam.

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

Page 6: IP Addresses & Classes Presented By: M.Usman Khan Ghauri Nauman Aslam.

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]

Page 7: IP Addresses & Classes Presented By: M.Usman Khan Ghauri Nauman Aslam.

Address classes• Classes of Networks

N H H HClass A:

N N N HClass C:

N N H HClass B:

Network number assigned by NICHost number assigned by Systems Administrator

1 Byte 1 Byte 1 Byte 1 Byte

Page 8: IP Addresses & Classes Presented By: M.Usman Khan Ghauri Nauman Aslam.

Class ranges for Internet addresses

Page 9: IP Addresses & Classes Presented By: M.Usman Khan Ghauri Nauman Aslam.

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)

Page 10: IP Addresses & Classes Presented By: M.Usman Khan Ghauri Nauman Aslam.

Class A

• IP Address Bit Patterns

0Network #

Host #Class A:

Bit # 1 2 - 8 9 – 32 (24 bits)

Class A address range1.0.0.0 – 126.0.0.0 (127.0.0.0 is for loopback)Private Class A address: 10.0.0.0Number of hosts: 224 -2 = 16,777,214

8 16 24 32

Page 11: IP Addresses & Classes Presented By: M.Usman Khan Ghauri Nauman Aslam.

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.

Page 12: IP Addresses & Classes Presented By: M.Usman Khan Ghauri Nauman Aslam.

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

Page 13: IP Addresses & Classes Presented By: M.Usman Khan Ghauri Nauman Aslam.

13

IP addressing

• IP Address Bit Patterns

Class B:

Bit #1 3 - 16 17 – 32 (16 bits)

Class B address range128.0.0.0 – 191.255.0.0Private Class B : 172.16.0.0 – 172.31.0.0 Number of hosts: 216 - 2 = 65,534

1 0Network #

Host #

2

8 16 24 32

Page 14: IP Addresses & Classes Presented By: M.Usman Khan Ghauri Nauman Aslam.

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

Page 15: IP Addresses & Classes Presented By: M.Usman Khan Ghauri Nauman Aslam.

IP addressing

• IP Address Bit Patterns

Class C:

Bit #1 4 - 24 25 – 32 (8 bits)

Class C address range192.0.0.0 – 233.255.255.0Private Class C : 192.168.0.0 Number of hosts: 28 - 2 = 254

2

8 16 24 32

1 1 0 Network # Host #

3

Page 16: IP Addresses & Classes Presented By: M.Usman Khan Ghauri Nauman Aslam.

Class D Addresses

• Special category of IPs, which are used for multicasting purposes

• Begin with 1110, or 224 to 239 decimal

Page 17: IP Addresses & Classes Presented By: M.Usman Khan Ghauri Nauman Aslam.

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

Page 18: IP Addresses & Classes Presented By: M.Usman Khan Ghauri Nauman Aslam.

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.

Page 19: IP Addresses & Classes Presented By: M.Usman Khan Ghauri Nauman Aslam.

Private networks

• There are three network addresses reserved for private networks

• 10.0.0.0 - 10.255.255.255Addresses: 16,777,216

• 172.16.0.0 - 172.31.255.255Addresses: 1,048,576

• 192.168.0.0 - 192.168.255.255Addresses: 65,536

Page 20: IP Addresses & Classes Presented By: M.Usman Khan Ghauri Nauman Aslam.

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)

Page 21: IP Addresses & Classes Presented By: M.Usman Khan Ghauri Nauman Aslam.

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

Page 22: IP Addresses & Classes Presented By: M.Usman Khan Ghauri Nauman Aslam.

• 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

Network Masks

Page 23: IP Addresses & Classes Presented By: M.Usman Khan Ghauri Nauman Aslam.

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

Page 24: IP Addresses & Classes Presented By: M.Usman Khan Ghauri Nauman Aslam.

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

Page 25: IP Addresses & Classes Presented By: M.Usman Khan Ghauri Nauman Aslam.

SUB-NETTING

Page 26: IP Addresses & Classes Presented By: M.Usman Khan Ghauri Nauman Aslam.

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.

Page 27: IP Addresses & Classes Presented By: M.Usman Khan Ghauri Nauman Aslam.

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.

Page 28: IP Addresses & Classes Presented By: M.Usman Khan Ghauri Nauman Aslam.

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:

Page 29: IP Addresses & Classes Presented By: M.Usman Khan Ghauri Nauman Aslam.

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

Page 30: IP Addresses & Classes Presented By: M.Usman Khan Ghauri Nauman Aslam.

• 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 255.255.255.224 host address range 1 to 30

– 204.15.5.32 255.255.255.224 host address range 33 to 62

– 204.15.5.64 255.255.255.224 host address range 65 to 94

– 204.15.5.96 255.255.255.224 host address range 97 to 126

– 204.15.5.128 255.255.255.224 host address range 129 to 158

– 204.15.5.160 255.255.255.224 host address range 161 to 190

– 204.15.5.192 255.255.255.224 host address range 193 to 222

– 204.15.5.224 255.255.255.224 host address range 225 to 254

Page 31: IP Addresses & Classes Presented By: M.Usman Khan Ghauri Nauman Aslam.

IP Addressing and Subnetting

Quick Techniques

Page 32: IP Addresses & Classes Presented By: M.Usman Khan Ghauri Nauman Aslam.

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

Page 33: IP Addresses & Classes Presented By: M.Usman Khan Ghauri Nauman Aslam.

Subnet & Routing 33

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

Page 34: IP Addresses & Classes Presented By: M.Usman Khan Ghauri Nauman Aslam.

34

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

Page 35: IP Addresses & Classes Presented By: M.Usman Khan Ghauri Nauman Aslam.

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

Page 36: IP Addresses & Classes Presented By: M.Usman Khan Ghauri Nauman Aslam.

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.

Page 37: IP Addresses & Classes Presented By: M.Usman Khan Ghauri Nauman Aslam.

Now Solve?

• DeviceB: 172.16.28.15/20 ?

• Are deviceA and B on same subnet?

Page 38: IP Addresses & Classes Presented By: M.Usman Khan Ghauri Nauman Aslam.

SUPERNETTING

Page 39: IP Addresses & Classes Presented By: M.Usman Khan Ghauri Nauman Aslam.

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

Page 40: IP Addresses & Classes Presented By: M.Usman Khan Ghauri Nauman Aslam.

Supernetting

Page 41: IP Addresses & Classes Presented By: M.Usman Khan Ghauri Nauman Aslam.

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.

Page 42: IP Addresses & Classes Presented By: M.Usman Khan Ghauri Nauman Aslam.
Page 43: IP Addresses & Classes Presented By: M.Usman Khan Ghauri Nauman Aslam.

Did you get it enough?