ip adresses

38
IP Addresses

Upload: alisha-rizvi

Post on 14-Apr-2017

240 views

Category:

Education


0 download

TRANSCRIPT

Page 1: IP Adresses

IP Addresses

Page 2: IP Adresses

An IP address is a unique 32 bits long identifier and gives us maximum 2^32 addresses.

IP address is a logical address in the network layer.

Every host and router on the internet has an IP address.

What Is An IP Address?

Page 3: IP Adresses
Page 4: IP Adresses

IP address does not actually refer to a host. It really refers to a network interface.

Page 5: IP Adresses
Page 6: IP Adresses

Each IP address has two fundamental parts

* NETWORK PORTION, which describes the physical wire the device is attached to.

* HOST PORTION, which identifies the host on that wire.

Page 7: IP Adresses

There are two prevalent notations to show an IP

address

Binary Notation 01110101 10010101 00011101 00000010

Dotted Decimal Notation 117 . 149 . 29 . 2

Page 8: IP Adresses

1st Byte 2nd Byte 3rd Byte 4th Byte =128 =143 =137 =144

128.143.137.144

Example

10000000 10001111 10001001 10010000

Page 9: IP Adresses

* 111.56.045.78 There must be no leading zero (045). 221.34.7.8.20 There can be no more than four numbers in an IP address. 75.45.301.14 Each number needs to be less than or equal to 255 (301). 11100010.23.14.67 A mixture of binary notation and dotted decimal notation is not allowed.

We can’t write IP address in the following forms

Page 10: IP Adresses

Classful Addressing

The address space is divided into five categories:

1. Class A2. Class B3. Class C4. Class D5. Class E

Page 11: IP Adresses

Class C network id host11 0

Network Prefix24 bits

Host Number8 bits

bit # 0 1 23 242 313

Class B 1 network id hostbit # 0 1 15 162

Network Prefix16 bits

Host Number16 bits

031

Class A 0Network Prefix

8 bits

bit # 0 1 7 8

Host Number24 bits

31

Page 12: IP Adresses

Class D multicast group id11 1bit # 0 1 2 313

04

Class E (reserved for future use)11 1bit # 0 1 2 313

14

05

Page 13: IP Adresses

Class A 1.0.0.0 to 127.255.255.255 Class B 128.0.0.0 to 191.255.255.255 Class C 192.0.0.0 to 223.255.255.255 Class D 224.0.0.0 to 239.255.255.255 Class E 240.0.0.0 to 255.255.255.255

Range Of Host Addresses

Page 14: IP Adresses

Finding the Classes in Binary & Dotted Decimal Notation

Page 15: IP Adresses

Find the class of each addressa. 00000001 00001011 00001011 11101111b. 11000001 10000011 00011011 11111111c. 14.23.120.8d. 252.5.15.111Solutiona. The first bit is 0 - Class Ab. The first 2 bits are 1 & the third bit is 0 - Class Cc. The first byte is 14 - Class Ad. The first byte is 252 - Class E

Page 16: IP Adresses

To create subnets, some host bits are reassigned as network bits.

Always start borrowing with the leftmost host bit.

Subnets

Page 17: IP Adresses

Network Prefix Host Number

Network Prefix Host NumberSubnet Number

Page 18: IP Adresses

1) Class A Borrowing 12 bits for subnets 28.0.0.0

=Network =Subnet =Host

Examples

00011100 00000000 00000000 00000000

00011100 00000000 00000000 00000000

Page 19: IP Adresses

2) Class B Borrowing 5 bits for subnets 147.10.0.0

=Network =Subnet =Host

10010011 00001010 00000000 00000000

10010011 00001010 00000000 00000000

Page 20: IP Adresses

3) Class C Borrowing 3 bits for subnets 192.168.10.0

=Network =Subnet =Host

11000000 10101000 00001010 00000000

11000000 10101000 00001010 00000000

Page 21: IP Adresses

The subnet mask is created, using binary ones in network and subnet bits, and binary zeroes in host bits.

Subnet Mask

Page 22: IP Adresses

If 3 bits were borrowed, the mask for a Class C address would be

= 255.255.255.224 or 255.255.255.224/27

The /27 = the total network and subnet bits. For a Class C this means 3 bits are borrowed

8+8+8+3 For a Class B this means 11 bits are borrowed

8+8+8+3 For a Class A this means 19 bits are borrowed

8+8+8+3

11111111 11111111 11111111 11100000

Page 23: IP Adresses

Number of usable subnets Number of borrowed bits = 2 - 2

Borrow 3 bits : 2³ - 2 = 6 usable subnets Borrow 4 bits : 2⁴ - 2 = 14 usable subnets Borrow 5 bits : 2⁵ - 2 = 30 usable subnets

Number of usable hosts Number of remaining host bits = 2 - 2

3 bits borrowed, leaves 2⁵ - 2 = 30 hosts 4 bits borrowed, leaves 2⁴ - 2 = 14 hosts 5 bits borrowed, leaves 2³ - 2 = 6 hosts

1 Bit is for Subnet Id & Another is for Broadcast

Page 24: IP Adresses

CIDR (Classless Inter-Domain Routing) was introduced in 1993 replacing the previous generation of IP address syntax - classful networks.CIDR introduction allowed for:* More efficient use of IPv4 address space* Prefix aggregation, which reduced the size of

routing tablesCIDR allows routers to group routes together to reduce the bulk of routing information carried by the core routers.

Classless Inter Domain Routing (CIDR)

Page 25: IP Adresses

/10: 4 Million hostsNetwork = 10 bits Host = 22 bits

Network = 19 bits Host = 13 bits

Network = 20 bits Host = 12 bits

Host = 6 bitsNetwork = 24 bits

Network = 28 bits Host = 4bits

/19: 8190 hosts

/20: 4094 hosts

/24: 256 hosts

/28: 14 hosts

Examples

Page 26: IP Adresses

* Efficient Address Space Allocation * Elimination of Class Imbalances * Efficient Routing Entries * No Separate Subnetting Method

Advantages

Page 27: IP Adresses

Without CIDR A router must maintain individual routing table entries for each network.

Routing Table Entries

Page 28: IP Adresses

With CIDR A router can summarize these routes using a single network address by using a 13-bit prefix: 172.24.0.0/13

STEPS:1. Count the number of left-most matching bits, /13 (255.248.0.0)2. Add all zeros after the last matching bit: 172.24.0.0 = 10101100 00011000 00000000 00000000

Page 29: IP Adresses

* IPv6 uses a 128 bit address space, yielding 340,282,366,920,938,463,463,374,607,431,768,211,456

possible addresses.

* IPv6 has been slow to arrive.

* IPv6 requires new software; IT staffs must be retrained.

* IPv6 will most likely coexist with IPv4 for years to come.

* Some experts believe IPv4 will remain for more than 10 years.

Long term Solution : IPV6 (Coming)

Page 30: IP Adresses

EXERCISEQUESTION

S

Page 31: IP Adresses

1. Suppose that instead of using 16 bits for the network part of a class B address originally, 20 bits had been used. How many class B networks would there have been?Solution * With 16 bits we have 2^(16-2) class B networks (16384) * With 20 bits we have 2^(20-2) class B networks (262144)

2 Bits are for the classful addressing

Page 32: IP Adresses

2. Convert the IP address whose hexadecimal representation is C22F1582 to dotted decimal notation.

SolutionC22F1582 = 11000010 00101111 00010101 10000010 = 194.47.21.130

Page 33: IP Adresses

3. A network on the internet has a subnet mask of 255.255.240.0. What is the maximum number of host it can handle? Solution 255.255.240.0

11111111 11111111 11110000 00000000

The mask is 20 bit long, so, the network & subnet part is 20 bit long. The remaining 12 bits are for the host part, so [(2^12)-2]=4094 host addresses exit.

Page 34: IP Adresses

4. A router has just received the following new IP addresses : 57.6.96.0/21, 57.6.104.0/21, 57.6.112.0/21 & 57.6.120.0/21 If all of them use the same outgoing line, can they be aggregated? If so, to what ? If not, why not?

Solution

57.6.96.0/22 : 00111001 00000110 01100000 0000000057.6.104.0/21 : 00111001 00000110 01101000 0000000057.6.112.0/21 : 00111001 00000110 01110000 0000000057.6.120.0/21 : 00111001 00000110 01111000 00000000

The first 19 bits are the same for all the addresses. So, these can be

aggregated to 57.6.96.0/19

Page 35: IP Adresses

5. A route has the following (CIDR) entries in its routing table:

  Address/mask Next hop 135.46.56.0/22 Interface 0 135.46.60.0/22 Interface 1 192.53.40.0/23 Router 1 Default Router 2  For each of the following IP address,

a) 135.46.63.10b) 135.46.57.14c) 135.46.52.2d) 192.53.40.7e) 192.53.56.7

Page 36: IP Adresses

(a) 135.46.63.10 135.46.63.10 10000111 00101110 00111111 00001010

255.255.252.0 11111111 11111111 11111100 00000000

AND 135.46.60.0 10000111 00101110 00111100 00000000

It matches entry with 135.46.60.0/22, and no other

matches found, so its forwarded to Interface 1.

Page 37: IP Adresses

Similarly, (b) Interface 0 (c) Router 2 (d) Router 1 (e) Router 2

Page 38: IP Adresses

ThankYou