PART IV
Network Layer
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004
Position of network layer
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004
Network layer duties
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004
Chapters
Chapter 19 Host-to-Host Delivery
Chapter 20 Network Layer Protocols
Chapter 21 Unicast and Multicast Routing Protocols
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004
Chapter 19
Host-to-Host
Delivery:
Internetworking,
Addressing,
and Routing
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004
19.1 Internetworks
Need For Network Layer
Internet As A Packet-Switched Network
Internet As A Connectionless Network
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004
Figure 19.1 Internetwork
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004
Figure 19.2 Links in an internetwork
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004
Figure 19.3 Network layer in an internetwork
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004
Figure 19.4 Network layer at the source
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004
Figure 19.5 Network layer at a router
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004
Figure 19.6 Network layer at the destination
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004
Figure 19.7 Switching
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004
Figure 19.8 Datagram approach
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004
Note:
Switching at the network layer in the
Internet is done using the datagram
approach to packet switching.
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004
Note:
Communication at the network layer
in the Internet is connectionless.
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004
19.2 Addressing
Internet Address
Classful Addressing
Subnetting
Supernetting
Classless Addressing
Dynamic Address Configuration
Network Address Translation
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004
Note:
An IP address is a 32-bit address.
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004
Note:
The IP addresses are unique
and universal.
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004
Figure 19.9 Dotted-decimal notation
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004
Note:
The binary, decimal, and hexadecimal
number systems are reviewed in
Appendix B.
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004
Example 1
Change the following IP addresses from binary notation to dotted-
decimal notation.
a. 10000001 00001011 00001011 11101111
b. 11111001 10011011 11111011 00001111
Solution
We replace each group of 8 bits with its equivalent decimal
number (see Appendix B) and add dots for separation:
a. [Link]
b. [Link]
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004
Example 2
Change the following IP addresses from dotted-decimal notation to
binary notation.
a. [Link]
b. [Link]
Solution
We replace each decimal number with its binary equivalent
(see Appendix B):
a. 01101111 00111000 00101101 01001110
b. 01001011 00101101 00100010 01001110
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004
Note:
In classful addressing, the address
space is divided into five classes: A, B,
C, D, and E.
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004
Figure 19.10 Finding the class in binary notation
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004
Figure 19.11 Finding the address class
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004
Example 3
Find the class of each address:
a. 00000001 00001011 00001011 11101111
b. 11110011 10011011 11111011 00001111
Solution
See the procedure in Figure 19.11.
a. The first bit is 0; this is a class A address.
b. The first 4 bits are 1s; this is a class E address.
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004
Figure 19.12 Finding the class in decimal notation
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004
Example 4
Find the class of each address:
a. [Link]
b. [Link]
c. [Link]
Solution
a. The first byte is 227 (between 224 and 239); the class is D.
b. The first byte is 252 (between 240 and 255); the class is E.
c. The first byte is 134 (between 128 and 191); the class is B.
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004
Figure 19.13 Netid and hostid
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004
Figure 19.14 Blocks in class A
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004
Note:
Millions of class A addresses are
wasted.
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004
Figure 19.15 Blocks in class B
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004
Note:
Many class B addresses are wasted.
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004
Note:
The number of addresses in class C is
smaller than the needs of most
organizations.
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004
Figure 19.16 Blocks in class C
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004
Figure 19.17 Network address
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004
Note:
In classful addressing, the network
address is the one that is assigned to
the organization.
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004
Example 5
Given the address [Link], 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 [Link].
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004
Example 6
Given the address [Link], 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 [Link].
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004
Example 7
Given the network address [Link], find the class.
Solution
The class is A because the netid is only 1 byte.
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004
Note:
A network address is different from a
netid. A network address has both
netid and hostid,
with 0s for the hostid.
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004
Figure 19.18 Sample internet
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004