35
1 IP Addressing (IPv4 ADDRESSES)

IntroIPAdressing

Embed Size (px)

Citation preview

8/8/2019 IntroIPAdressing

http://slidepdf.com/reader/full/introipadressing 1/35

1

IP Addressing

(IPv4 ADDRESSES)

8/8/2019 IntroIPAdressing

http://slidepdf.com/reader/full/introipadressing 2/35

2

Universal Service Concept

Any computer can communicate with any other computer inthe world.

Multiple independently owned and operated networks can be

interconnected to provide universal service.

Internetworking

Four Four levelslevels of of addressesaddresses areare used used inin anan internet internet employing employing 

thethe TCP/IP TCP/IP protocols protocols:: physical  physical  , , logical logical  , , port  port  , , and and specificspecific . .

8/8/2019 IntroIPAdressing

http://slidepdf.com/reader/full/introipadressing 3/35

3

Network Identifiers

Computers on the Internet are referred to as hosts. Eachhost has at least three identifiers:

Internet name for humans to use (i.e. garfield.ncat.edu)

Internet address, a 32 bit binary number written in decimal

as four bytes (i.e.152.8.240.16)

hardware address, such as an Ethernet address (i.e. 00-e0-63-

03-76-c0 for garfield)

8/8/2019 IntroIPAdressing

http://slidepdf.com/reader/full/introipadressing 4/35

4

Internet Names

Hierarchical starting from the righthost.subnet.organization.type

R ightmost identifies the type or organization or country

edu, com, mil, org, net

us, ca, de, uk 

Internet Architecture

An internet consists of a set of networks interconnected by

routers. The internet scheme allows each organization tochoose the number and type of networks, the number of 

routers to use to interconnect them, and the exact

interconnection topology

8/8/2019 IntroIPAdressing

http://slidepdf.com/reader/full/introipadressing 5/35

5

Internet Protocol

To achieve universal service among all computers onan internet, routers must agree to forward informationfrom a source on one network to a destination onanother.

A common protocol is needed on computers androuters to overcome the differing frame formats andaddressing schemes used within each network.

Because each network uses an different andincompatible addressing system, an independentaddressing system is needed.

8/8/2019 IntroIPAdressing

http://slidepdf.com/reader/full/introipadressing 6/35

6

IPv4 ADDRESSESIPv4 ADDRESSES

 An An IPv IPv44 addressaddress isis aa 3232--bit bit addressaddress that that uniquelyuniquely and and 

universallyuniversally definesdefines thethe connectionconnection of of aa devicedevice (for (for 

example,example, aa computer computer or or aa router)router) toto thethe Internet  Internet. .

The address space of IPv4 is

232 or 4,294,967,296.

8/8/2019 IntroIPAdressing

http://slidepdf.com/reader/full/introipadressing 7/35

7

IP Addresses

To be able to identify a host on the internet, each host isassigned an address, the IP address, or  Internet Address.

The standards for IP addresses are described in  RFC 1166 

-- Internet Numbers.

When the host is attached to more than one network , it iscalled multi-homed and it has one IP address for each

network interface.

An IP Address is a 32 bit binary number.

IP addresses are used by the IP protocol to uniquelyidentify a host on the internet.

8/8/2019 IntroIPAdressing

http://slidepdf.com/reader/full/introipadressing 8/35

8

 The Dotted Decimal Notation

IP addresses are usually represented in a dotted decimal form).

IP address is made of four groups of decimal numbers between

0 - 255 separated by dots.

Some of the numbers are special (like 0.0.0.0 or 

255.255.255.255) and are used to designate the defaultgateway, a broadcast or multicast address, or some reserved

numbers for the developers to play with

8/8/2019 IntroIPAdressing

http://slidepdf.com/reader/full/introipadressing 9/35

9

Parts of an IP Address

A part of the address designates the network numbers, and theremaining part designates the host number. So, we may say an

IP address has the format NETWORK .HOST.

The network number  part of the IP address is centrally

administered by the Internet Network Information Centre (the

InterNIC) and is unique throughout the Internet.

The IP address consists of a pair of numbers:

IP address = <network number><host number>

8/8/2019 IntroIPAdressing

http://slidepdf.com/reader/full/introipadressing 10/35

10

Network Number Assignment

One point to note about the split of an IP address into

two parts is that this split also splits the responsibility

for selecting the IP address into two parts. The

network number is assigned by the InterNIC, and the

host number by the authority which controls the

network.

The host number can be further subdivided: this

division is controlled by the authority which owns thenetwork , and not by the InterNIC.

8/8/2019 IntroIPAdressing

http://slidepdf.com/reader/full/introipadressing 11/35

11

Change the following IPv4 addresses from binarynotation to dotted-decimal notation.

 Example 1

 Solution

We replace each group of 8 bits with its equivalent  

decimal number (see A ppendix B) and add dots for  separation.

8/8/2019 IntroIPAdressing

http://slidepdf.com/reader/full/introipadressing 12/35

12

Change the following IPv4 addresses from dotted-decimal notation to binary notation.

 Example.2

 Solution

We replace each decimal number with its binary

equivalent (see  A ppendix B).

8/8/2019 IntroIPAdressing

http://slidepdf.com/reader/full/introipadressing 13/35

13

Find the error, if any, in the following IPv4 addresses.

 Example 3

 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.  Amixture of binary notation and dotted-decimal 

notation is not allowed.

8/8/2019 IntroIPAdressing

http://slidepdf.com/reader/full/introipadressing 14/35

14

IP Address Classes

Traditionally, the conventions are that there are three

main types of IP networks.

Class A

Class B

Class C

There are also:

Class D

Class E

8/8/2019 IntroIPAdressing

http://slidepdf.com/reader/full/introipadressing 15/35

15

The first bits of the IP address specify how the rest of the addressshould be separated into its network and host part.

The terms network address and netID are sometimes used

instead of network number, but the formal term, used in RFC

1166, is network number. Similarly, the terms host address and

hostID are sometimes used instead of host number.

 Assigned Classes of Internet Addresses

8/8/2019 IntroIPAdressing

http://slidepdf.com/reader/full/introipadressing 16/35

16

 Address Ranges and Network Prefix

Class A addresses use 7 bits for the network number giving 126 possible

networks (out of every group of network and host numbers, two have a

special meaning). The remaining 24 bits are used for the host number , so

each networks can have up to 224 - minus 2 (16,777,214) hosts.

Class B addresses use 14 bits for the network number , and 16 bits for the

host number giving 16,382 Class B networks each with a maximum of 

65534 hosts.

Class C only 254 hosts (all 0 and 1 combinations are not allowed). 21 bits

for the network number and 8 for the host number giving 2,097,150

networks each with up to 254 hosts.

8/8/2019 IntroIPAdressing

http://slidepdf.com/reader/full/introipadressing 17/35

17

Other Address Classes

There is also a Class D address (starts with 1110)used for multicasting,which is used to address groups

of hosts in a limited area.

Class E addresses are reserved for future use. Class E

(1111) addresses are reserved for the nerds.

8/8/2019 IntroIPAdressing

http://slidepdf.com/reader/full/introipadressing 18/35

18

Special Addresses IP Address Notation

{<network>, <host>} {<network>, <subnet>, <host>}

-1 value means a component consisting of all 1¶s

{0,0} = This host on this network 

{0,<host>} = Specific host on this network 

{-1, -1} = Local broadcast

Broadcast to all hosts on this network  {<network>, -1} = Directed broadcast

Broadcast to all hosts on <network>

{<network>, <subnet>, -1} = Directed broadcast

Broadcast to all hosts on <subnet> of <network>

{<network>, -1, -1} = Directed broadcast

Broadcast to all hosts on all subnets of <network> {<127>, <any>} = Loopback address

Packet never leaves the NIC

Should never appear on the network 

8/8/2019 IntroIPAdressing

http://slidepdf.com/reader/full/introipadressing 19/35

19

IP Address Space Shortage

It is clear that a class A address will only be assigned tonetworks with a huge number of hosts, and that class C addresses are suitable for networks with a small number of hosts. However , this means that medium-sized networks

(those with more than 254 hosts or where there is anexpectation that there may be more than 254 hosts in thefuture) must use Class B addresses. The number of small- tomedium-sized networks has been growing very rapidly inthe last few years and it was feared that, if this growth had been allowed to continue unabated, all of the available Class

B network addresses would have been used by the mid-1990s. This is termed the IP Address Exhaustion problem.The problem and how it is being addressed are discussed inThe IP Address Exhaustion Problem.

8/8/2019 IntroIPAdressing

http://slidepdf.com/reader/full/introipadressing 20/35

20

IPv 4 - Problems

The decision to standardize on a 32 bit address space

meant that there were only 232 (4,294,967,296) IPv4

addresses available.

During the early days of the Internet, the seeminglyunlimited address space allowed IP addresses to be

allocated based on requests rather than its actual need.

The class A, B, and C octet boundaries were easy to

understand and implement, but they did not foster 

efficient allocation of addresses.

8/8/2019 IntroIPAdressing

http://slidepdf.com/reader/full/introipadressing 21/35

21

IPv 4 - Problems

Class C, which supports 254 hosts, is too small.

Class B, which supports 65534 hosts is too large.

In the past, sites with several hundred hosts have been

assigned as single Class B address rather than coupleof Class C addresses.

Unfortunately, this has resulted in a prematuredepletion of the Class B network address space.

8/8/2019 IntroIPAdressing

http://slidepdf.com/reader/full/introipadressing 22/35

22

Private Internets

Another approach to conservation of the IP address space isdescribed in  RFC 1597 - Address Allocation for Private

 Internets.

Briefly,

it relaxes the rule that IP addresses are globally unique byreserving part of the address space for networks which are usedexclusively within a single organization and which do not require IPconnectivity to the Internet. There are three ranges of addresses whichhave been reserved by IANA for this purpose:

y

10.0.0.0 A single Class A network y 172.16 through 172.31 16 contiguous Class B networks

y 192.168.0 through 192.168.255 256 contiguous Class C networks

8/8/2019 IntroIPAdressing

http://slidepdf.com/reader/full/introipadressing 23/35

23

Private Internets

Any organization may use any addresses in these rangeswithout reference to any other organization.However 

 because these addresses are not globally unique, they cannot be

referenced by hosts in another organization and they are not defined to

any external routers.

R outers in networks not using private addresses, particularlythose operated by Internet service providers, are expected to

quietly discard all routing information regarding these

addresses.

R outers in an organization using private addresses are

expected to limit all references to private addresses to internal

links; they should neither advertise routes to private addresses

to external routers nor forward IP datagrams containing private

addresses to via external routers.

8/8/2019 IntroIPAdressing

http://slidepdf.com/reader/full/introipadressing 24/35

24

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

 Example.4

 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.

8/8/2019 IntroIPAdressing

http://slidepdf.com/reader/full/introipadressing 25/35

25

Table:  Default masks for classful addressing 

In classful addressing, a large part of the available addresses were wasted.

Classful addressing, which is almost obsolete, is replaced with classless

addressing.

CLASSFUL AND CLASS LESS

ADDRESS

SUBNET MASKA subnet Mask always comes with an IP address

Through a Subnet Mask One can differentiate among the Network and

host part of the IP address

There are three ways of writing a subnet mask

8/8/2019 IntroIPAdressing

http://slidepdf.com/reader/full/introipadressing 26/35

26

Figure.3 shows a block of addresses, in both binary and dotted-

decimal notation, granted to a small business that needs 16  addresses.

We can see that the restrictions are applied to this block. The

addresses are contiguous. The number of addresses is a power of 2

(16 = 24 ), and the first address is divisible by 16. The first address,

when converted to a decimal number, is 3,440,387,360, which when

divided by 16 results in 215,024,210.

 Example.5

Figure 3  A block of 16 addresses granted to a small organization

8/8/2019 IntroIPAdressing

http://slidepdf.com/reader/full/introipadressing 27/35

27

In IPv4 addressing, a block of addresses can be defined

as x.y.z.t /n in which x.y.z.t defines one of the addresses

and the /n defines the mask.

The first address in the block can be found by setting

the rightmost 32 í n bits to 0s.

The last address in the block can be found by settingthe rightmost 32 í n bits to 1s.

The number of addresses in the block can be found

by using the formula 232ín.

The first address in a block is normally not assigned

to any device; it is used as the network address that

represents the organization to the rest of the world.

8/8/2019 IntroIPAdressing

http://slidepdf.com/reader/full/introipadressing 28/35

28

 A block of addresses is granted to a small organization. We know

that one of the addresses is 205.16.37.39/28. What is the first  

address in the block?

 Solution

The binary representation of the given address is11001101 00010000 00100101 00100111

 If we set 32í28 rightmost bits to 0, we get 

11001101 00010000 00100101 0010000

or 

205.16.37.32 .This is actually the block shown in Figure 19.3.

 Example.6 

8/8/2019 IntroIPAdressing

http://slidepdf.com/reader/full/introipadressing 29/35

29

Find the last address for the block in Example 19.6.

 Solution

The binary representation of the given address is

11001101 00010000 00100101 00100111

 If we set 32 í 28 rightmost bits to 1, we get 11001101 00010000 00100101 00101111

or 

205.16.37.47 

This is actually the block shown in Figure 19.3.

 Example 7 

8/8/2019 IntroIPAdressing

http://slidepdf.com/reader/full/introipadressing 30/35

30

Find the number of addresses in Example 19.6.

 Example.8

 Solution

The value of n is 28, which means that number  

of addresses is 2 32í28 or 16.

8/8/2019 IntroIPAdressing

http://slidepdf.com/reader/full/introipadressing 31/35

31

 Another way to find the first address, the last address, and the

number of addresses is to represent the mask as a 32-bit binary (or 8-digit hexadecimal) number. This is particularly useful when we

are writing a program to find these pieces of information. In

 Example 19.5 the /28 can be represented as

11111111 11111111 11111111 11110000

(twenty-eight 1s and four 0s).

Find 

a. The first address

b. The last addressc. The number of addresses.

 Example 9

8/8/2019 IntroIPAdressing

http://slidepdf.com/reader/full/introipadressing 32/35

32

 Solutiona. The first address can be found by ANDing the given

addresses with the mask. ANDing here is done bit by

bit. The result of   ANDing 2 bits is 1 if both bits are 1s;

the result is 0 otherwise.

 Example.9 (continued)

8/8/2019 IntroIPAdressing

http://slidepdf.com/reader/full/introipadressing 33/35

33

b. The last address can be found by ORing the givenaddresses with the complement of the mask. ORing  

here is done bit by bit. The result of ORing 2 bits is 0 if  

both bits are 0s; the result is 1 otherwise. The

complement of a number is found by changing each 1

to 0 and each 0 to 1.

 Example.9 (continued)

8/8/2019 IntroIPAdressing

http://slidepdf.com/reader/full/introipadressing 34/35

34

c. The number of addresses can be found bycomplementing the mask, interpreting it as a decimal 

number, and adding 1 to it.

 Example.9 (continued)

8/8/2019 IntroIPAdressing

http://slidepdf.com/reader/full/introipadressing 35/35

35

Figure.4   A network configuration for the block 205.16.37.32/28