Está en la página 1de 45

IP ADDRESSING METHODS

What is an IP address?
• IP (Internet Protocol) address A way to identify machines on a network A unique identifier Used to connect to another computer

TYPES OF IP ADDRESSES
An IPv4 address is a 32-bit address that uniquely and universally defines the connection of a device (for example, a computer or a router) to the Internet. Despite all short-term solutions, address depletion is still a long-term problem for the Internet. This and other problems in the IP protocol itself have been the motivation for IPv6.

An IPv6 address is 128 bits long.

IP STRUCTURE
IP addresses consist of four sections Each section is 8 bits long Each section can range from 0 to 255 network layer address, consisting of NETWORK portion, and HOST portion

.967.NOTATIONS Dotted-decimal notation and binary notation for an IPv4 address The address space of IPv4 is 232 or 4.296.294.

E – Each class occupies some part of the address space . This architecture is called as classful addressing Special case of classless addressing In CA the address space is divided into five classes : – A.classful addressing • • • • IPV4 addressing uses the concept of classes .C.B.D.

CLASSES .

it is used as the network address that represents the organization to the rest of the world.ADDRESSES AND BLOCKS The first address in a block is normally not assigned to any device. .

216 Hosts per Network .777.CLASS A • This class is for very large networks. such as a major international company might have – 0000000-01111111 – 0-127 – 0 can not be used as Net ID – 127 is reserved for loop back functions – 126 Different Networks – 16.

384 Different Networks 65. • A good example is a large college campus. – – – – – – 1000000-101111111 128-191 The first IP Address is the NET ID The last IP Address is the Broadcast Address 16.CLASS B • This class is used for medium-sized networks.536 Hosts per Network .

CLASS C • Class C addresses are commonly used for small to mid-size businesses. 11000000-11011111 – 192-223 – The first IP Address is the NET ID – The last IP Address is the Broadcast Address – 2.097.152 Different Networks – 256 Hosts per Network .

CLASS D &E CLASS D – Used for multicast broadcasts CLASS E – Experimental addresses not available to the public .

Reserved addresses Addresses beginning 127 are reserved for loopback and internal testing xxx.0 reserved for network address xxx.0.255.255.255 reserved for broadcast .0.

Example of Classes .

Example .

Disadvantages of • One problem is that each class is divided into fixed number of blocks with each block having a fixed size In classful addressing. . a large part of the available addresses were wasted.

MASKING  Help us to find the NetId and HostId  Mask: 32-bit made of 1s followed by 0s.16.24) .  CIDR(Classless Interdomain Routing): used to show the mask in the form /n (n=8.  Dose not apply to classes D and E.

z. .z. x. The last address in the block can be found by setting the rightmost 32 − n bits to 1s.y.y.t /n in which x. The number of addresses in the block can be found by using the formula 232−n.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.• In IPv4 addressing.

EXERCISES .

Solution We replace each group of 8 bits with its equivalent decimal number and add dots for separation.Change the following IPv4 addresses from binary notation to dotted-decimal notation. .

Change the following IPv4 addresses from dotted-decimal notation to binary notation. Solution We replace each decimal number with its binary equivalent .

14. The first 2 bits are 1.15. 252. the class is A.111 Solution a. This is a class C address. b.5. The first bit is 0.23. d. a. 00000001 00001011 00001011 11101111 b. the class is E. The first byte is 252. 11000001 10000011 00011011 11111111 c. The first byte is 14.Find the class of each address. . This is a class A address. the third bit is 0. c.8 d.120.

A block of 16 addresses granted to a small organization .

16.16.37.37.39/28. .A block of addresses is granted to a small organization.32. What is the first address in the block? Solution The binary representation of the given address is 11001101 00010000 00100101 00100111 If we set 32−28 rightmost bits to 0. We know that one of the addresses is 205. we get 11001101 00010000 00100101 0010000 or 205.

we get 11001101 00010000 00100101 00101111 or 205.6.Find the last address for the block in Example 19.37.47 .16. Solution The binary representation of the given address is 11001101 00010000 00100101 00100111 If we set 32 − 28 rightmost bits to 1.

.Find the number of addresses in the above Example Solution The value of n is 28. which means that number of addresses is 2 32−28 or 16.

Find a. . and the number of addresses is to represent the mask as a 32bit binary (or 8-digit hexadecimal) number. In the Example the /28 can be represented as 11111111 11111111 11111111 11110000 (twenty-eight 1s and four 0s). The first address b. The number of addresses.Another way to find the first address. The last address c. This is particularly useful when we are writing a program to find these pieces of information. the last address.

.Solution a. The result of ANDing 2 bits is 1 if both bits are 1s. the result is 0 otherwise. ANDing here is done bit by bit. The first address can be found by ANDing the given addresses with the mask.

The last address can be found by ORing the given addresses 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 complement of a number is found by changing each 1 to 0 and each 0 to 1. . the result is 1 otherwise.b.

interpreting it as a decimal number. and adding 1 to it.c. The number of addresses can be found by complementing the mask. .

Hierarchy in IP ADDRESS:no subnetting • Each address in the block can be considered as a two-level hierarchical structure: the leftmost n bits (prefix) define the network. the rightmost 32 − n bits define the host .

Three levels of hierarchy:subnetting • If an organization was granted a large block in classes A or B • It could divide the addresses into several contiguous groups and assign each group to smaller networks ( subnets) • The organization is one entity but inside its into different groups • All messages sent to the router that connects the organization to the internet • The router routes the messages to the appropriate subnets .

• The organization create small subblocks of addresses each assigned to the specefic subnets the organization has its own network mask Each subnet also has its own subnet mask .

The org has 3 offices and needs to divide the addresses into three subblocks of 32. • Total no of addresses is 64 • 2(32-26)=24=64 • 64 should be splitted into 32.16 .0/26. Design the subblocks and find the new masks.Example • An organization is granted a block of addresses 17.16 and 16 addresses .40.16 .12.

28 .28.Find the new masks Organization mask -26 Subnet mask -27.

.

Design the subnets. two subnets.24. c. four subnets.0/24. each with 4 addresses. b. each with 16 addresses. three subnets.74.Example An organization is granted a block of addresses with the beginning address 14. two subnets. . d. each with 64 addresses. There are 232−24= 256 addresses in this block. each with 32 addresses. The organization needs to have 11 subnets as shown below: a.

.

.ADDRESS ALLOCATION Address allocation is the responsibility of a global authority called the Internet Corporation for Assigned Names and Addresses (ICANN). It usually assigns a large block of addresses to an ISP to be distributed to its Internet users.

each needs 128 addresses c.0. b.An ISP is granted a block of addresses starting with 190. Design the subblocks and find out how many addresses are still available after these allocations. The first group has 64 customers.100. The third group has 128 customers. each needs 64 addresses. The second group has 128 customers.0/16 (65. each needs 256 addresses. The ISP needs to distribute these addresses to three groups of customers as follows: a.536 addresses). .

.

Group 1 For this group.384 190.63.0/24 2nd Customer 190.255/24 190.100.0.1. This means the suffix length is 8 (28 =256). each customer needs 256 addresses.100.100. The addresses are: 1st Customer 190.100.1. The prefix length is then 32 − 8 = 24.0.63.0/24 .255/24 ..255/24 190.100.0/24 Total = 64 × 256 = 16..100. 64th Customer 190.

100. each customer needs 128 addresses.100.100. The addresses are: 1st Customer 2nd Customer ··· 128th Customer 190. This means the suffix length is 7 (27 =128).64.100.128/25 190.127.100. The prefix length is then 32 − 7 = 25.Group 2 For this group.64.255/25 Total = 128 × 128 = 16.127/25 190.100.128/25 190.64.64.255/25 190.127.384 .0/25 190.

128.192 .128.Group 3 For this group.63/26 190.100. This means the suffix length is 6 (26 = 64).255/26 Total = 128 × 64 = 8.100.100. each customer needs 64 addresses.100.128. The prefix length is then 32 − 6 = 26.127/26 190.0/26 190.192/26 190.159.64/26 190. The addresses are: 1st Customer 2nd Customer ··· 128th Customer 190.100.100.159.128.

960 Number of available addresses: 24.536 Number of allocated addresses by the ISP: 40.576 .Number of granted addresses to the ISP: 65.