Network Layer: Mcgraw-Hill ©the Mcgraw-Hill Companies, Inc., 2004
Network Layer: Mcgraw-Hill ©the Mcgraw-Hill Companies, Inc., 2004
Network Layer: Mcgraw-Hill ©the Mcgraw-Hill Companies, Inc., 2004
Network Layer
McGraw-Hill
Figure 19.1
Internetwork
McGraw-Hill
Figure 19.2
Links in an internetwork
McGraw-Hill
Figure 19.3
McGraw-Hill
Figure 19.7
Switching
McGraw-Hill
Figure 19.8
Datagram approach
McGraw-Hill
Note: Switching at the network layer in the Internet is done using the datagram approach to packet switching.
McGraw-Hill
McGraw-Hill
McGraw-Hill
Figure 19.9
Dotted-decimal notation
McGraw-Hill
Note: The binary, decimal, and hexadecimal number systems are reviewed in Appendix B.
McGraw-Hill
Example 1
Change the following IP addresses from binary notation to dotteddecimal notation. a. 10000001 00001011 00001011 11101111
b.
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. 249.155.251.15
McGraw-Hill
Example 2
Change the following IP addresses from dotted-decimal notation to binary notation. a. 111.56.45.78
b.
75.45.34.78
Solution
We replace each decimal number with its binary equivalent (see Appendix B): a. b. 01101111 00111000 00101101 01001110 01001011 00101101 00100010 01001110
McGraw-Hill
Note: In classful addressing, the address space is divided into five classes: A, B, C, D, and E.
McGraw-Hill
Figure 19.10
McGraw-Hill
McGraw-Hill
Example 3
Find the class of each address: a. b. 00000001 00001011 00001011 11101111 11110011 10011011 11111011 00001111
Solution
See the procedure in Figure 19.11. a. b. The first bit is 0; this is a class A address. The first 4 bits are 1s; this is a class E address.
McGraw-Hill
Figure 19.12
McGraw-Hill
Example 4
Find the class of each address: a. b. c. 227.12.14.87 252.5.15.111 134.11.78.56
Solution
a. b. c. The first byte is 227 (between 224 and 239); the class is D. The first byte is 252 (between 240 and 255); the class is E. The first byte is 134 (between 128 and 191); the class is B.
McGraw-Hill
Figure 19.13
McGraw-Hill
Figure 19.14
Blocks in class A
McGraw-Hill
McGraw-Hill
Figure 19.15
Blocks in class B
McGraw-Hill
McGraw-Hill
Note: The number of addresses in class C is smaller than the needs of most organizations.
McGraw-Hill
Figure 19.16
Blocks in class C
McGraw-Hill
Figure 19.17
Network address
McGraw-Hill
Note: In classful addressing, the network address is the one that is assigned to the organization.
McGraw-Hill
Example 5
Given the address 23.56.7.91, find the network address.
Solution
The class is A. Only the first byte defines the netid. We can find the network address by replacing the hostid bytes (56.7.91) with 0s. Therefore, the network address is 23.0.0.0.
McGraw-Hill
Example 6
Given the address 132.6.17.85, find the network address.
Solution
The class is B. The first 2 bytes defines the netid. We can find the network address by replacing the hostid bytes (17.85) with 0s. Therefore, the network address is 132.6.0.0.
McGraw-Hill
Example 7
Given the network address 17.0.0.0, find the class.
Solution
The class is A because the netid is only 1 byte.
McGraw-Hill
Note: A network address is different from a netid. A network address has both netid and hostid, with 0s for the hostid.
McGraw-Hill
Figure 19.18
Sample internet
McGraw-Hill
McGraw-Hill
McGraw-Hill
McGraw-Hill
McGraw-Hill
Figure 19.22
McGraw-Hill
McGraw-Hill
Note: The network address can be found by applying the default mask to any address in the block (including itself). It retains the netid of the block and sets the hostid to 0s.
McGraw-Hill
Example 8
A router outside the organization receives a packet with destination address 190.240.7.91. Show how it finds the network address to route the packet.
Solution
The router follows three steps: 1. The router looks at the first byte of the address to find the class. It is class B. 2. The default mask for class B is 255.255.0.0. The router ANDs this mask with the address to get 190.240.0.0. 3. The router looks in its routing table to find out how to route the packet to this destination. Later, we will see what happens if this destination does not exist.
McGraw-Hill The McGraw-Hill Companies, Inc., 2004
Figure 19.23
Subnet mask
McGraw-Hill
Example 9
A router inside the organization receives the same packet with destination address 190.240.33.91. Show how it finds the subnetwork address to route the packet.
Solution
The router follows three steps: 1. The router must know the mask. We assume it is /19, as shown in Figure 19.23. 2. The router applies the mask to the address, 190.240.33.91. The subnet address is 190.240.32.0. 3. The router looks in its routing table to find how to route the packet to this destination. Later, we will see what happens if this destination does not exist.
McGraw-Hill