19.1 Chapter 19 Network Layer: Logical Addressing Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
IPv4 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. Address Space Notations Classful Addressing ( complete from book till mask) Classless Addressing ( from book till two-level hierarchy: no subnetting, example 19.9 not included) Subnetting/Supernetting ( from lecture notes) Network Address Translation (NAT) ( from Book till one address IP) IPv6 ( from lecture notes) Topics discussed in this section:
19.3 An IPv4 address is 32 bits long. Note
19.4 The IPv4 addresses are unique and universal. Note
19.5 The address space of IPv4 is 2 32 or 4,294,967,296. Note
19.6 Figure 19.1 Dotted-decimal notation and binary notation for an IPv4 address
19.7 In classful addressing, the address space is divided into five classes: A, B, C, D, and E. Note
19.8 Figure 19.2 Finding the classes in binary and dotted-decimal notation
19.9 Table 19.1 Number of blocks and block size in classful IPv4 addressing
19.10 In classful addressing, a large part of the available addresses were wasted. Note
19.11 Table 19.2 Default masks for classful addressing showing netid and hostid
19.12 Classful addressing, which is almost obsolete, is replaced with classless addressing. Note
19.13 Classless addressing: Variable size blocks. Address block restrictions: 1.Contiguous. 2.Power of 2. 3.First address devisable by the number of addresses. Note
19.14 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 = 2 4 ), 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 19.5
19.15 Figure 19.3 A block of 16 addresses granted to a small organization
19.16 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. Note
19.17 The first address in the block can be found by setting the rightmost 32 − n bits to 0s. Note
19.18 The last address in the block can be found by setting the rightmost 32 − n bits to 1s. Note
19.19 The number of addresses in the block can be found by using the formula 2 32−n. Note
19.20 Figure 19.4 Network address
19.21 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. Note
19.22 Figure level hierarchy in an IPv4 address
SUBNETTING SUPERNETTING
Figure 5-2 A network with three levels of hierarchy (subnetted)
Figure 5-3 Addresses in a network with and without subnetting
Figure 5-4 Hierarchy concept in a telephone number
Figure 5-5 Default mask and subnet mask
Finding the Subnet Address Given an IP address, we can find the subnet address by applying the mask to the address. We can do this in two ways: straight or short-cut.
Straight Method In the straight method, we use binary notation for both the address and the mask and then apply the AND operation to find the subnet address.
Example 1 What is the subnetwork address if the destination address is and the subnet mask is ?
Solution The subnetwork address is
Short-Cut Method ** If the byte in the mask is 255, copy the byte in the address. ** If the byte in the mask is 0, replace the byte in the address with 0. ** If the byte in the mask is neither 255 nor 0, we write the mask and the address in binary and apply the AND operation.
Example 2 What is the subnetwork address if the destination address is and the mask is ? Solution See Figure 5.6
Figure 5-6 Example 2
Figure 5-7 Comparison of a default mask and a subnet mask
The number of subnets must be a power of 2.
Example 3 A company is granted the site address (class C). The company needs six subnets. Design the subnets. Solution The number of 1s in the default mask is 24 (class C).
Solution (Continued) The company needs six subnets. This number 6 is not a power of 2. The next number that is a power of 2 is 8 (2 3 ). We need 3 more 1s in the subnet mask. The total number of 1s in the subnet mask is 27 (24 3). The total number of 0s is 5 (32 27). The mask is
Solution (Continued) or The number of subnets is 8. The number of addresses in each subnet is 2 5 (5 is the number of 0s) or 32. See Figure next slide
Example 3
A supernetwork
19.42 In supernetting, an organization can combine several class C blocks to create a larger range of addresses. Several networks are combined to create a super network. Classless addressing has eliminate the need for this. Supernetting
19.43 NAT: A large set of addresses internally and one address or small set of addresses externally. NAT
19.44 Table 19.3 Addresses for private networks
19.45 Figure A NAT implementation
19.46 Figure Addresses in a NAT
19.47 Figure NAT address translation
NAT Example Case 1: Host A in the figure sends a packet to IP address , port 80, with its local port set to The resulting entry in the NAT box (assume that the current row index is 9000) is Case 2: Supposed just after part (A) above, host B sends a packet to the same destination address and port, with it's local port also set to The resulting entry in the NAT box NAT enabled router Row # 9000 Row # 9001
IPv6 ADDRESSES from lecture notes 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.
19.50 An IPv6 address is 128 bits long. It uses Hexadecimal representation Note