Looking for a Tutor Near You?

Post Learning Requirement »
x
x

Direction

x

Ask a Question

x

Hire a Tutor

Network Layer: Logical Addressing

Loading...

Published in: Networking
5,516 Views

This PPT will give a brief idea about Network Layer: Logical Addressing.

Muhammad R / Dubai

4 years of teaching experience

Qualification: Bachelor of Science, CCNA Certified, Nebosh Certified, Flash Certified.

Teaches: CCNA Certification, Flash, Networking, Graphic Design, Computer, Science, Maths, Computer Science, Mathematics, Physics

Contact this Tutor
  1. 19.1 Data Communications Forouzan and Networking Fourth Edition Chapter 19 Network Layer: Logical Addressing Copyright O The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
  2. 19-1 ADDRESSES An IPv4 address a 32-bit address that uniquely and universally defines the connection of a device (for example, a computer or a router) to the Internet. Topics discussed in this section: Address Space Notations Classful Addressing Classless Addressing Network Address Translation (NAT) 19.2
  3. Note An IPv4 address is 32 bits long. 19.3
  4. Note The IPv4 addresses are unique and universal. 19.4
  5. Note The address space of IPv4 is 232 or 4,294,967,296. 19.5
  6. Figure 19.1 Dotted-decimal notation and binary notation for an IPv4 address 10000000 19.6 00001011 00000011 128.11.3.31
  7. Note Numbering systems are reviewed in Appendix B. 19.7
  8. Example 19.1 Change the following IPv4 addresses from binary notation to dotted-decimal notation. a. Solution We replace each group of 8 bits with its equivalent decimal number (see Appendix B) and add dots for separation. a. 129.11.11.239 b. 193.131.27.255 19.8
  9. Example 19.2 Change the following IPv4 addresses from dotted-decimal notation to binary notation. 111.56.45.78 a. b. 221.34.7.82 Solution We replace each decimal number with its equivalent (see Appendix B). a. 11011101 00100010 00000111 01010010 19.9 binary
  10. Example 19.3 Find the error, if any, in the following IPv4 addresses. 11.56.045.78 a. b. 221.34.7.8.20 75.45.301.14 d. 1100010.23.14.67 Solution There must be no leading zero (045). a, b. There can be no more than four numbers. Each number needs to be less than or equal to 255. A mixture of binary notation and dotted-decimal notation is not allowed. 19.10
  11. Note In classful addressing, the address space is divided into five classes: A, B, C, D, and E. 19.11
  12. Figure 19.2 Finding the classes in binary and dotted-decimal notation Class A Class B Class C Class D Class E Second Third Fourth Fi rst byte byte byte byte 1110 Fi rst Second Third Fourth byte byte byte byte Class A 0-127 Class B 128-191 Class C 192-223 Class D 224-239 Class E 240-255 b. Dotted-decimal notation a. Binary notation 19.12
  13. Example 19.4 Find the class of each address. c 14.23.120.8 d. 252.5.15.111 Solution The first bit is 0. This is a class A address, a. b. The first 2 bits are 1; the third bit is 0. This is a class C address. The first byte is 14; the class is A. Thefirst byte is 252; the class is E. 19.13
  14. Table 19.1 Number of blocks and block size in classful IPv4 addressing Class c D 19.14 Number of Blocks 128 16,3 84 1 1 Block Size 65,536 256 Application Unicast Unicast Unicast Multicast Reserved
  15. Note In classful addressing, a large part of the available addresses were wasted. 19.15
  16. Table 19.2 Default masks for classful addressing Class c 19.16 Binary Dotted-Decimal 255.0.o.o 255.255.0.0 255.255.255.0 CIDR / 16
  17. Note Classful addressing, which is almost obsolete, is replaced with classless addressing. 19.17
  18. Example 19.5 Figure 19.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 19.18
  19. Figure 19.3 A block of 16 addresses granted to a small organization First Last 19.19 Block 205.16.37.32 205.16.37.33 205.16.37.47 a. Decimal 11001101 11001101 11001101 b. Binary Block 00010000 00100101 00010000 00100101 00010000 00100101 OOI 00000 00100001
  20. Note 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. 19.20
  21. Note The first address in the block can be found by setting the rightmost 32 - n bits to Os. 19.21
  22. Example 19.6 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 is 11001101 00010000 00100101 00100111 If we set 32—28 rightmost bits to 0, we get 11001101 00010000 00100101 0010000 This is actually the block shown in Figure 19.3. 19.22
  23. Note The last address in the block can be found by setting the rightmost 32 - n bits to Is. 19.23
  24. Example 19.7 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 This is actually the block shown in Figure 19.3. 19.24
  25. Note The number of addresses in the block can be found by using the formula 232-n 19.25
  26. Example 19.8 Find the number of addresses in Example 19.6. Solution The value of n is 28, which means that number of addresses is 2 32-28 or 16. 19.26
  27. Example 19.9 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 (twenty-eight Is and four Os). Find The first address a, b. The last address The number of addresses. 19.27
  28. Example 19.9 (continued) Solution The first address can be found by ANDing the given a. addresses with the mask. ANDing here is done bit by bit. The result ofANDing 2 bits is 1 if both bits are Is; the result is 0 otherwise. Address: Mask: First address: 19.28 IIOOIIOI 00010000 00100101 00100111 IIOOIIOI 00010000 00100101 00100000
  29. Example 19.9 (continued) The last address can be found by ORing the given b. 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 Os; the result is 1 otherwise. The complement of a number is found by changing each 1 to 0 and each 0 to 1. Address: Last address: 19.29 11001101 00010000 00100101 00100111
  30. Example 19.9 (continued) The number of addresses can be found by complementing the mask, interpreting it as a decimal number, and adding 1 to it. Mask complement: Number of addresses: 19.30 = 16
  31. Figure 19.4 A network configuration for the block 205.16.37.32/28 Block First Last 19.31 Block 205.16.37.32 205.1637.33 205.1637.47 a. Decimal 11001101 11001101 11001101 b. Binary 00010000 00010000 00010000 01 01 OOI OOI 01 OOI 00000 00100001 00101 111
  32. Note 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. 19.32
  33. Figure 19.5 Two levels of hierarchy in an IPv4 address Area code Exchange office Subscriber 19.33
  34. Figure 19.6 A frame in a character-oriented protocol 28 bits Network prefix Host add ress 19.34 4 bits
  35. Note 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. 19.35
  36. Figure 19.7 Configuration and addresses in a subnetted network Subnet 1 17.12.14.31/27 17.12.14.30/27 17.12.14.20/27 17.12.14.1/27 17.12.14.2/27 Network: 17.12.14.0/26 Subnet 3 17.12.14.50/28 Subnet 2 17.12.14.34/28 x.y.z.t/n 17.12.1 4.63/28 1 17.12.1 4.62/28 | 17.12.14.49/28 17.12.1 4.47/28 17.12.14.46/28 17.12.14.33/28 To the rest of the Internet 19.36
  37. Figure 19.8 Three-level hierarchy in an IPv4 address Subnet 1 Network prefix Subnet prefix Host address I I Subnets 2 and 3 Network prefix Subnet prefix Host address 19.37
  38. Example 19.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: The first group has 64 customers; each needs 256 a. addresses. The second group has 128 customers; each needs 128 b. addresses. 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. 19.38
  39. Example 19.10 (continued) Solution Figure 19.9 shows the situation. Group 1 For this group, each customer needs 256 addresses. This means that 8 (log2 256) bits are needed to define each host. The prefix length is then 32 — 8 = 24. The addresses are 1st Customer: 190.100.0.0/24 2nd Customer: 64th Customer: 190.100.63.0/24 Total = 64 x 256 = 16,384 19.39 o. 255/24 190.100.1.255/24 190.100.63.255/24
  40. Example 19.10 (continued) 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 — are 1st Customer: 2nd Customer: 190.100.64.0/25 190.100.64.128/25 7 = 25. The addresses 190.100.64.127/25 190.100.64.255/25 190.100.127.255/25 128th Customer: 190.100.127.128/25 Total = 128 x 128 = 16,384 19.40
  41. Example 19.10 (continued) 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 190.100.128.0/26 190.100.128.63/26 1st Customer: 190.100.128.64/26 190.100.128.127/26 2nd Customer: 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 19.41
  42. Figure 19.9 An example of address allocation and distribution by an ISP ISP To and from the Internet 19.42 0 o Customer 001: 190.100.0.0/24 Group 1: 190. I OO.O.O to 190.100.63.255 Customer 064: 190.100.63.0/24 Customer 001: 190.100.64.0/25 Group 2: 190.100.64.O to 190.100.127.255 Customer 1 28: 190.100.127.128/25 Customer 001: 190.100.128.0/26 Group 3: 190.100.128.0 to 190.100.159.255 Customer 1 28: 190.100.159.192/26 Available 190.100.160.0 to 190.100.255.255
  43. Table 19.3 Addresses for private networks 10.0.o.o 172.16.0.0 192.168.0.0 19.43 Range to to to 10.255.255.255 172.31.255.255 192.168.255.255 Total 224 220 216
  44. Figure 19.10 A NAT implementation Site using private addresses 172.18.3.1 19.44 172.18.3.2 172.18.3.20 172.18.3.30 I NAT router Internet 200.24.5.8
  45. Figure 19.11 | 172.18.3.1 Addresses in a NAT Source: 172.183.1 Destination: 172.18.3.1 19.45 Source: 200.24.5.8 I nte rnet Destination: 200.24.5.8
  46. Figure 19.12 NAT address translation Destination: 25.8.2.10 Source: 172.18.3.1 Destination: 25.8.2.10 sou 200.24.5.8 Translation table Private 172.18.3.1 Destination: 172.18.3.1 Source: 25.8.2.10 19.46 Exte rnal 25.8.2.lO Destination: 200.24.5.8 Source: 25.8.2.10
  47. Table 19.4 Five-column translation table Private Address 172.18.3.1 172.18.3.2 19.47 Private Port 1400 1401 External Address 25.8.3 2 25.8.3 2 External Port 80 80 Transport Protocol TCP TCP
  48. Figure 19.13 An ISP and NAT 172.18.3.1 172.24.1.1 172.30.1 oo 19.48 1000 addresses I nternet site
  49. 19-2 IPv6 ADDRESSES 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. Topics discussed in this section: Structure Address Space 19.49
  50. Note An IPv6 address is 128 bits long. 19.50
  51. Figure 19.14 IPv6 address in binary and hexadecimal colon notation 128 bits 0000 = 16 bytes = 32 hex digits FDEC 19.51 0074 0000 0000 BOFF 0000 FFFF
  52. Figure 19.15 Abbreviated IPv6 addresses : 0000 . 0000 0000 : BOFF Original FDEC Abbreviated 0074 : 0000 : FFFO FDEC : 74 : FDEC o : o: o : BOFF BOFF : o: Gap : FFFO FFFO More abbreviated 19.52
  53. Example 19.11 Expand the address 0:15::1:12:1213 to its original. Solution We first need to align the left side of the double colon to the left of the original pattern and the right side of the double colon to the right of the original pattern to find how many Os we need to replace the double colon. xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx 1: 12:1213 This means that the original address is. 19.53
  54. Table 19.5 Type Prefix 0000 0000 0000 0001 0000 001 0000 010 0000 011 0000 1 0001 001 010 19.54 Type prefixes for IPv6 addresses Type Reserved Unassigned ISO network addresses IPX (Novell) network addresses Unassigned Unassigned Reserved IReserved Provider-based unicast addresses Fraction 1/256 1/256 1/128 1/128 1/128 1/32 1/16
  55. Table 19.5 Type Prefix 011 100 101 110 1110 19.55 Type prefixes for IPv6 addresses (continued) Type Unassigned Geographic-based unicast addresses Unassigned Unassigned Unassigned Unassigned Unassigned Unassigned Unassigned Link local addresses Site local addresses Multicast addresses Fraction 1/16 1/32 1164 1/128 1/512 1/1024 1/1024 1/256
  56. Figure 19.16 Prefixes for provider-based unicast address Subnet prefix Subscriber prefix Provider prefix Provider identifier INTERNIC 11000 RIPNIC 01000 APNIC 10100 Registry 19.56 Subscriber identifier Subnet identifier Node identifier
  57. Multicast address in IPv6 Figure 19.17 4 4 8 bits 0000 Permanent 0001 Transient 0000 0001 0010 0101 1000 1110 112 bits Group ID Reserved Node local Link local Site local Organizational Global Reserved
  58. Figure 19.18 8 bits 00000000 8 bits 00000000 8 bits 00000000 8 bits 00000000 19.58 Reserved addresses in IPv6 120 bits All os 120 bits ooooooooooooooooo 00000000001 88 bits All os 72 bits All os 16 bits All IS 32 bits IPv4 address 32 bits IPv4 address a. Unspecified b. Loopback c. Compatible d. Mapped
  59. Figure 19.19 Local addresses in IPv6 10 bits 10 bits 19.59 70 bits All os 38 bits All os 32 bits Subnet add ress 48 bits Node add ress 48 bits Node address a. Link local b. Site local