Download as pdf
Download as pdf
You are on page 1of 8
Bharati Vidyapeeth (Deemed to be University), Calege of rgnesing Pane bvucgo Department of Electronics and Communication Engineering Subject: Computer Communication Networks Sem: VI Experiment No:4 Study of Network IP Addresses Aim: Study of network IP addresses Apparatus : PC,LAN Theory: ‘An IPv4 address is typically written in decimal digits, formatted as four 8-bit fields separated by periods. The various IPV4 addressing are as below. Classful Addressing: One of the fundamental features of classful IP addressing is that each address contains a self-encoding key that identifies the dividing point between the network prefix and the host number, Fist Second Third Fourth Fist Second Third Fourth byte byte byte _ byte byre byte byte__byte casa [a] css [or] Class D [1170 lass [224-239] Class [1107 Class [240-255] Binary notation ‘i Dotted-decimal notation Class A Networks (/8 Prefixes) : Each Class A network address has an 8-bit network prefix, with the highest order bit set to 0 (zero) anda 7-bit network number, followed by a 24-bit host number. A maximum of 126 (27 -2) /8 networks can be defined. The calculation subtracts two because the /8 network 0.0.0.0 is reserved for use as the default route and the /8 network 127.0.0.0 (also written 127/8 or Bharati Vidyapeeth (Deemed to be University), Calege of rgnesing Pane bvucgo Department of Electronics and Communication Engineering Subject: Computer Communication Networks Sem: VI 127.0.0.0/8) is reserved for the “loopback” function, Each /8 supports 2 maximum of 224 -2 (16,777,214) hosts per network. The host calculation subtracts two because the all-0s (all zeros or “this network”) and all-1s (all ones or “broadcast”) host numbers may not be assigned to individual hosts. Since the /8 address block contains 231 (2, 147,483,648 ) individual addresses and the IPv4 address space contains a maximum of 232 (4,294,967,296) addresses, the /8 address space is 50 percent of the total IPv4 unicast address space. Class B Networks (/16 Prefixes): Each Class B network address has a 16-bit network prefix, with the two highest order bits set to 1-0 and a 14-bit network number, followed by a 16-bit host number. Class B networks are now referred to as “/L6s” since they have a 16-bit network prefix. A maximum of 16,384 (214 ) /16 networks can be defined with up to 65,534 (216-2) hosts per network. Since the entire /16 address block contains 230 (1,073,741,824) addresses, it represents 25 percent of the total IPv4 unicast address space. Class © Networks (/24 Prefixes) : Each Class C network address has 2 24-bit network prefix, with the three highest order bits set to 1-1-0 and a 21-bit network number, followed by an 8-bit host number. Class C networks are now referred to as “/24s” since they have a 24-bit network prefix. A maximum of 2,097,182 (221 ) /24 networks can be defined with up to 254 (28-2) hosts per network. Since the entire [24 address block contains 229 (536,870,912) addresses, it represents 12.5 percent (or oneeighth) of the total IPv4 unicast address space In addition to the three most popular classes, there are two additional classes, Class D addresses have their leading four bits set to 1-1-1-0 and are used to support IP Multicasting. Class E addresses have their leading four bits set to 1-1-1-1 and are reserved for experimental use Classless Addressing To reduce the wastage of IP addresses in a block, we use sub-netting. What we do is that we use host id bits as net id bits of a classful IP address. We give the IP address and define the number of bits for mask along with it (usually followed by a ‘/" symbol), like, 192.168.1.1/28. Here, subnet mask is found by putting the given number of bits out of 32 as 1, like, in the given address, we need to put 28 out of 32 bits as 1 and the rest as 0, and so, the subnet mask would be 255.255.255.240. Some values calculated in subnetting = 1, Number of subnets : 2%" bits for mask No.of it in gefeut mask) 2, Subnet address : AND result of subnet mask and the given IP address 3. Broadcast address : By putting the host bits as 1 and retaining the network bits as in the IP address 4, Number of hosts per subnet ; 2152 Givensitsformesk) _ 5. First Host ID : Subnet address + 1 (adding one to the binary representation of the subnet address) Bharati Vidyapeeth (Deemed to be University), o College of Engineering, Pune bvucgo S-FRZ,__ Department of Electronics and Communication Engineering Subject: Computer Communication Networks Sem: VI 6. Last Host ID : Subnet address + Number of Hosts Problems based on IP addresses: Q1. Determine the correct class for a given IP address: IP Address Class 10.3.28.1 Class 131.107.2.89 Class 3.3.57.1 Class 200.200.5.2 Class 191.107.2.10 Class 2.023.6.15 Class Q2,Which class support the no of host as 1000, 253 : Ans: Q3, Identify invalid IP address Review the following IP addresses. Circle the portion of the IP address that would be invalid if it were assigned to a host, and then explain why it is invalid, > 131.107.256.80: > 192.16.032.3: > 0111001.32.68.1 > 256.255.255.255: Q4, Which of the following can be the beginning address of a block that contains 256 addresses? .205.16.37.32 b.190.16.42.0 0.17.17.32.0 .123.45.24.52 Solution In this case, the right-most byte must be 0. As we mentioned in Chapter 4, the IP addresses use base 256 arithmetic. When the right-most byte is 0, the total address is divisible by 256. Only two addresses are Bharati Vidyapeeth (Deemed to be University), College of Engineering, Pune bvucgo Department of Electronics and Communication Engineering Subject: Computer Communication Networks Sem: VI eligible (b and o). Q5.Which of the following can be the beginning address of a block that contains 1024 addresses? a, 205.16,37.32 b.190.16.42.0 ©. 17.17.32.0 .123,45,.24,52 Solution: In this case, we need to check two bytes because 1024 = 4 x 256. The right-most byte must be divisible by 256. The second byte (from the right) must be divisible by 4, Only one address is eligible (c). Q6.Which of the following can be the beginning address of a block that contains 16 addresses? a, 205.16.37.32 b.190.16.42.44 ©. 17.17.33.80 .123.45.24.52 Solution: Only two are eligible (a and c). The address 205. 16.37.32 is eligible because 32 is divisible by 16. The address 17.17.33.80 is eligible because 80 is divisible by 16. Q7.Find the block if one of the addresses is 190.87.140.202/29. Solution: We follow the procedure in the previous examples to find the first address, the number of addresses, and the last address. To find the first address, we notice that the mask (/29) has five 1 in the last byte. So we write the last byte 2s powers of 2 and retain only the leftmost five as shown below: 202 128 +64+0+04+84+04+2+0 The leftmost § numbers are —~ 128+64+0+0+8 The first address is 190.87.140.200/29 The number of addresses is 2°? or 8. To find the last address, we use the complement of the mask. The mask has twenty-nine 1s; the complement has three 1s. The complement is 0.0.0.7. If we add this to the first address, we get 190.87.140.207/29. In other words, the first address is 190.87.140.200/29, the last address is 190.87.140.207/20. There are only 8 addresses in this block. Bharati Vidyapeeth (Deemed to be University), College of Engineering, Pune bvucgo Department of Electronics and Communication Engineering Subject: Computer Communication Networks Sem: VI Q.8.A block of addresses is granted to 2 small organization. We know that one of the addresses is 205.16.37.39/28. What is the first address in the block? What is the last address in the block?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 get 11001101 00010000 00100101 0010000 or 205.16.37.32. 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 The value of n is 28, which means that number of addresses is 2 32-28 or 16 .9 An ISP is granted a block of addresses starting with 190.100.0.0/16 (65,536 addresses). The ISP needs to distribute these addresses to three groups of customers as follows: a. The first group has 64 customers; each needs 256 addresses. b. The second group has 128 customers; each needs 128 addresses. c. The third group has 128 customers; each needs 64 addresses, Design the subblocks and find out how many addresses are still available after these allocations. Solution:Group 1 For this group, each customer needs 256 addresses. This means that & (log2 256) bits are needed to define each host. The prefix length is then 32 — 8 = 24. The addresses are Ist Customer: 190.100.0.0/24 — 190.100.0.255/24 2nd Customer: 190.100.1.0/24 — 190.100.1.255/24 64th Customer: 190.100.63.0/24 190.100.63.255/24 Total = 64 x 256 = 16,384 Group 2: For this group, each customer needs 128 addresses. This means that 7 (log2 128) bits are needed to define each host. The prefix length is then 32 ~ 7 = 25. The addresses are Bharati Vidyapeeth (Deemed to be University), oS College of Engineering, Pune S-FRZ,__ Department of Electronics and Communication Engineering Subject: Computer Communication Networks Sem: VI Ist Customer: — 190.100.64.0/25 190.100.64.127/25 2nd Customer: —190.100.64.128/25 190.100.64.255/25 128th Customer: 190.100.127.128/25 190.100.127.255/25 Total = 128 x 128 = 16,384 Group 3: For this group, each customer needs 64 addresses. This means that 6 (log264) bits are needed to each host. The prefix length is then 32 ~ 6= 26. The addresses are Ist Customer: 190.100.128.0/26 190.100.128.63/26 2nd Customer: 190.100.128.64/26 —190.100.128.127/26 128th Customer: 190.100.159.192/26 — 190.100.159.255/26 Total = 128 x 64 = 8192 Number of granted addresses to the ISP: 65,536 Number of allocated addresses by the ISP: 40,960 Number of available addresses: 24,576 Q.10 An ISP is granted a block of addresses starting with 190.100.0.0/16 (65,536 addresses). The ISP needs to distribute these addresses to three groups of customers as follows: a. The first group has 64 customers; each needs 256 addresses. b. The second group has 128 customers; each needs 128 addresses. c. The third group has 128 customers; each needs 64 addresses. Design the subblocks and find out how many addresses are still available after these allocations. Solution: Group 1 For this group, each customer needs 256 addresses. This means that 8 (|og2 256) bits are needed to define each host. The prefix length is then 32 — 8 = 24. The addresses are Bharati Vidyapeeth (Deemed to be University), + College of Engineering, Pune EF BRR, __ Department of Electronics and Communication Engineering Subject: Computer Communication Networks Ist Customer: 190.100.0.0/24 — 190.100.0.255/24 2nd Customer: 190.100.1.0/24 190.100.1.255/24 64th Customer: 190.100.63.0/24 —190.100.63.255/24 Total = 64 x 256 = 16,384 Group 2: For this group, each customer needs 128 addresses. This means that 7 (log2 128) bits are needed to define each host. The prefix length is then 32 ~ 7 = 25. The addresses are Ist Customer: 190.100.64.0/25 190.100.64.127/25 2nd Customer: —190.100.64.128/25 190.100.64.255/25 128th Customer: 190.100.127.128/25 190.100.127.255/25 Total = 128 x 128 = 16,384 Group 3: For this group, each customer needs 64 addresses. This means that 6 (log264) bits are needed to each host. The prefix length is then 32 ~ 6 = 26. The addresses are Ist Customer: — 190.100.128.0/26 190.100.128.63/26 2nd Customer: —190.100.128.64/26 — 190.100.128.127/26 128th Customer: 190.100.159.192/26 — 190.100.159.255/26 Total = 128 X 64 = 8/92 Bharati Vidyapeeth (Deemed to be University), Calege of rgnesing Pane bvucgo Department of Electronics and Communication Engineering Subject: Computer Communication Networks Sem: VI Number of granted addresses to the ISP: 65,536 Number of allocated addresses by the ISP: 40,960 Number of available addresses: 24,576 Conclusion:

You might also like