Networking Models 69 is responsible for a specific part of network communication. These layers interact with the layer above and below them only. This interaction very narrowly defines a layer’s purpose. The two common network models that use layers are the Open System Inter- connection (OSI) reference model and the TCP/IP reference model. The OSI Reference Model The early development of LANs, MANs, and WANs was chaotic in many ways. The early 1980s saw tremendous increases in the number and size of networks. As compa- nies realized the money they could save and the productivity they could gain by using networking technology, they added networks and expanded existing networks almost as rapidly as new network technologies and products were introduced. By the mid-1980s, these companies began to experience difficulties from all the imple- mented expansions. It became more difficult for networks that used different specifica- tions and implementations to communicate with each other. These companies realized that they needed to move away from proprietary networking systems. Proprietary sys- tems are privately developed, owned, and controlled. In the computer industry, propri- etary is the opposite of open. Proprietary means that one company or a small group of companies controls all usage of the technology. Open means that free usage of the technology is available to the public. To address the problem of network incompatibility and the inability to communicate with one another, the International Organization for Standardization (ISO) researched different network schemes, such as DECnet, Systems Network Architecture (SNA), and TCP/IP, to find a set of rules. As a result of this research, the ISO created a net- work model that would help vendors create networks that would be compatible and operate with other networks. The process of breaking down complex communications into smaller discrete tasks can be compared to the process of building an automobile. When taken as a whole, the design, manufacture, and assembly of an automobile is a highly complex process. It is unlikely that a single person would know how to perform all the required tasks to build a car from scratch. This is why mechanical engineers design the car, manufactur- ing engineers design the molds to make the parts, and assembly technicians each assemble a part of the car. The OSI reference model, released in 1984, was the descriptive scheme that the ISO created. This reference model provided vendors with a set of standards that ensured greater compatibility and interoperability among the various types of network technol- ogies that were produced by many companies around the world. 1102.book Page 69 Tuesday, May 20, 2003 2:53 PM 70 Chapter 2: Networking Fundamentals The OSI reference model is the primary model used as a guideline for network commu- nications. Although other models exist, most network vendors today relate their prod- ucts to the OSI reference model, especially when they want to educate users on the use of their products. The OSI reference model is considered the best tool available for teaching people about sending and receiving data on a network. The OSI reference model defines the network functions that occur at each layer. More importantly, it is a framework that facilitates an understanding of how information travels throughout a network. In addition, the OSI reference model describes how information, or data packets, travels from application programs (such as spreadsheets and documents) through a network medium (such as wires) to another application program that is located in another computer on a network, even if the sender and receiver have different types of network media. The OSI reference model has seven numbered layers, each of which illustrates a partic- ular network function: ■ Layer 7—Application layer ■ Layer 6—Presentation layer ■ Layer 5—Session layer ■ Layer 4—Transport layer ■ Layer 3—Network layer ■ Layer 2—Data link layer ■ Layer 1—Physical layer This separation of networking functions is called layering. Dividing the network into seven layers provides the following advantages: ■ It breaks network communication into smaller, simpler parts. ■ It standardizes network components to allow multiple-vendor development and support. ■ It allows different types of network hardware and software to communicate. ■ It prevents changes in one layer from affecting the other layers so that they can be developed more quickly. ■ It breaks network communication into smaller components to make learning easier. By working through the layers of the OSI reference model, you will understand how data packets travel through a network and what devices operate at each layer. As a result, you will understand how to troubleshoot network problems if they occur dur- ing data packet flow. 1102.book Page 70 Tuesday, May 20, 2003 2:53 PM Networking Models 71 OSI Layers and Functions Each OSI layer has a set of functions that it must perform for data packets to travel from a source to a destination on a network. The following sections briefly describe each layer in the OSI reference model. Layer 7: The Application Layer The application layer is the OSI layer that is closest to the user. It provides network services to the user’s applications. It differs from the other layers in that it does not provide services to any other OSI layer; instead, it provides services only to applica- tions outside the OSI model. Examples of such applications are spreadsheet programs and word-processing programs. The application layer establishes the availability of intended communication partners and also synchronizes and establishes agreement on procedures for error recovery and control of data integrity. Examples of the Layer 7 applications include Telnet and HTTP. Layer 6: The Presentation Layer The presentation layer ensures that the information that the application layer of one system sends out can be read by the application layer of another system. If necessary, the presentation layer translates among multiple data formats by using a common for- mat. One of the more important tasks of this layer is encryption and decryption. The common Layer 6 graphic standards are PICT, TIFF, and JPEG. Examples of Layer 6 standards that guide the presentation of sound and movies are MIDI and MPEG. Layer 5: The Session Layer As its name implies, the session layer establishes, manages, and terminates sessions between two communicating hosts. The session layer provides its services to the pre- sentation layer. It also synchronizes dialogue between the two hosts’ presentation lay- ers and manages their data exchange. In addition to handling session regulation, the session layer offers provisions for efficient data transfer, class of service, and exception reporting of session layer, presentation layer, and application layer problems. Exam- ples of Layer 5 protocols are the Network File System (NFS), X-Window System, and AppleTalk Session Protocol (ASP). Layer 4: The Transport Layer The transport layer segments data from the sending host’s system and reassembles it into a data stream on the receiving host’s system. The boundary between the transport layer and the session layer can be thought of as the boundary between application pro- tocols and data-flow protocols. Whereas the application, presentation, and session 1102.book Page 71 Tuesday, May 20, 2003 2:53 PM 72 Chapter 2: Networking Fundamentals layers are concerned with application issues, the lowest four layers are concerned with data-transport issues. The transport layer attempts to provide a data-transport service that shields the upper layers from transport-implementation details. Specifically, issues such as reliability of transport between two hosts are the concern of the transport layer. In providing com- munication service, the transport layer establishes, maintains, and properly terminates virtual circuits. Transport error detection and recovery and information flow control are used to provide reliable service. Examples of Layer 4 protocols are Transmission Control Protocol (TCP), User Datagram Protocol (UDP), and Sequenced Packet Exchange (SPX). Layer 3: The Network Layer The network layer is a complex layer that provides connectivity and path selection between two host systems that might be located on geographically separated networks. Additionally, the network layer is concerned with logical addressing. Examples of Layer 3 protocols are Internet Protocol (IP), Internetwork Packet Exchange (IPX), and AppleTalk. Layer 2: The Data Link Layer The data link layer provides reliable transit of data across a physical link. In so doing, the data link layer is concerned with physical (as opposed to logical) addressing, net- work topology, network access, error notification, ordered delivery of frames, and flow control. Layer 1: The Physical Layer The physical layer defines the electrical, mechanical, procedural, and functional speci- fications for activating, maintaining, and deactivating the physical link between end systems. Such characteristics as voltage levels, timing of voltage changes, physical data rates, maximum transmission distances, physical connectors, and other similar attributes are defined by physical layer specifications. Peer-to-Peer Communications For data packets to travel from the source to the destination, each layer of the OSI model at the source must communicate with its peer layer at the destination. This form of communication is called peer-to-peer communication. During this process, the pro- tocols at each layer exchange information, called protocol data units (PDUs), between peer layers. Each layer of communication on the source computer communicates with a layer-specific PDU and with its peer layer on the destination computer, as shown in Figure 2-17. 1102.book Page 72 Tuesday, May 20, 2003 2:53 PM Networking Models 73 Figure 2-17 Peer-to-Peer Communication Data packets on a network originate at a source and then travel to a destination. Each layer depends on the service function of the OSI layer below it. To provide this service, the lower layer uses encapsulation to put the PDU from the upper layer into its data field. Each layer then adds whatever headers it needs to perform its function. As the data moves through the layers of the OSI model, additional headers are added. The group- ing of data at the Layer 4 PDU is called a segment. The network layer provides a service to the transport layer. The network layer moves the data through the internetwork by encapsulating the data and attaching a header to create a packet (the Layer 3 PDU). The header contains information required to com- plete the transfer, such as source and destination logical addresses. The data link layer provides a service to the network layer. It encapsulates the network layer information in a frame (the Layer 2 PDU). The frame header contains the physical addresses required to complete the data link functions, and the frame trailer contains the frame check sequence (FCS), which is used by the receiver to detect whether the data is in error. This then becomes the data that is passed down to the physical layer. The physical layer provides a service to the data link layer. The physical layer encodes the data link frame into a pattern of 1s and 0s (bits) for transmission on the medium (usually a wire) at Layer 1. Network devices such as hubs, switches, and routers work at the lowest three layers. Hubs operate at Layer 1, switches operate at Layer 2, and routers at Layer 3. The first layer that deals with the end-to-end transport between end users is the transport layer (Layer 4). 1102.book Page 73 Tuesday, May 20, 2003 2:53 PM 74 Chapter 2: Networking Fundamentals DoD (TCP/IP) Model Although the OSI reference model is universally recognized, the historical and techni- cal open standard of the Internet is Transmission Control Protocol/Internet Protocol (TCP/IP). The TCP/IP reference model and the TCP/IP protocol suite make data com- munication possible between any two computers anywhere in the world at nearly the speed of light. The TCP/IP model has historical importance, just like the standards that allowed the telephone, electrical power, railroad, television, and videotape industries to flourish. The U.S. DoD provided funding for the invention of the TCP/IP reference model because it wanted a network that could survive any conditions, even a nuclear war. To illus- trate further, imagine a world at war, criss-crossed by different kinds of connections, including wires, microwaves, optical fibers, and satellite links. Then imagine that information/data (in the form of packets) must flow, regardless of the condition of any particular node or network on the internetwork (which, in this case, might have been destroyed by the war). The DoD wants its packets to get through every time, under any conditions, from any one point to any other point. This very difficult design problem brought about the creation of the TCP/IP model, which has since become the standard on which the Internet has grown. When reading about the TCP/IP model layers, remember the original intent of the Internet; it helps explain why certain things are as they are. The TCP/IP model, as shown in Figure 2-18, has four layers: ■ The application layer ■ The transport layer ■ The Internet layer ■ The network access layer Figure 2-18 The TCP/IP Model Application (Layer 7) Presentation (Layer 6) Session (Layer 5) Transport (Layer 4) Network (Layer 3) Data Link (Layer 2) Physical (Layer 1) OSI Application Transport Internet Network Access TCP/IP 1102.book Page 74 Tuesday, May 20, 2003 2:53 PM Networking Models 75 It is important to note that some of the layers in the TCP/IP model have the same names as layers in the OSI model. However, do not confuse the layers of the two models. Even with the same name, most the layers have the same functions in each model, but some do not. Detailed Encapsulation Process All communications on a network originate at a source and are sent to a destination. The information that is sent on a network is called data or data packets. If one com- puter (Host A) wants to send data to another computer (Host B), the data must first be packaged by a process called encapsulation. Encapsulation Encapsulation wraps data with the necessary protocol information before network transit. Therefore, as the data moves down through the layers of the OSI model, each OSI layer adds a header (and also a trailer at Layer 2) to the data before passing it down to a lower layer. The headers and trailers contain control information for the network devices and receiver, to ensure proper delivery of the data and to ensure that the receiver can properly interpret the data. For example, think of a header as an address on an envelope. An address is required on the envelope so that the letter inside the envelope can be delivered to the desired recipient. To see how encapsulation occurs, examine the manner in which data travels through the layers, as illustrated in Figure 2-19. After the data is sent from the source, it travels through the application layer down through the other layers. The packaging and flow of the data that is exchanged go through changes as the layers perform their services for end users. The data, in the form of electronic signals, must travel across a cable to the correct destination computer and then be converted to its original form to be read by the recipient. As you can imagine, several steps are involved in this process. For this rea- son, developers of hardware, software, and protocols recognized that the most efficient way to implement network communications would be as a layered process. Lab Activity OSI Model and TCP/IP Model In this exercise, you describe and compare the layers of the OSI and TCP/IP models. You also name the TCP/IP protocols and utilities that operate at each layer. NOTE The word header means that informa- tion was added to the front of the packet, just as trailers are added to the end. In addition, an address is an important piece of information that gets added. 1102.book Page 75 Tuesday, May 20, 2003 2:53 PM 76 Chapter 2: Networking Fundamentals Figure 2-19 Encapsulation As illustrated in Figure 2-20, networks must perform the following five conversion steps to encapsulate data: Step 1 Build the data—As a user sends an e-mail message, its alphanumeric characters are converted to data that can travel across the internetwork. Step 2 Package the data for end-to-end transport—The data is packaged for internetwork transport. By using segments, the transport function ensures that the message hosts at both ends of the e-mail system can communicate reliably. Step 3 Append (add) the network address to the header—The data is put into a packet or datagram that contains a network header with source and des- tination logical addresses. These addresses help network devices send the packets across the network along a chosen path. Step 4 Append (add) the local address to the data link header—Each network device must put the packet into a frame. The frame allows connection to the next directly-connected network device on the link. Each device in the chosen network path requires framing to be connected to the next device. Step 5 Convert to bits for transmission—A clocking function lets the devices distinguish these bits as they travel across the medium. The medium on the physical internetwork can vary along the path used. For example, the e-mail message can originate on a LAN, cross a campus backbone, and go out a WAN link until it reaches its destination on another remote LAN. Headers and trailers are added as data moves down through the layers of the OSI model. 1102.book Page 76 Tuesday, May 20, 2003 2:53 PM Networking Models 77 Figure 2-20 Data Encapsulation Process De-Encapsulation When the remote device receives a sequence of bits, the physical layer at the remote device passes the bits to the data link layer for manipulation. The data link layer does the following: Step 1 Verifies that the MAC destination address matches this station’s address or is an Ethernet broadcast. If neither of these situations is true, the frame is discarded. Step 2 If the data is in error, it can be discarded, and the data link layer might ask for the data to be retransmitted. If the data is not in error, the data link layer reads and interprets the control information in the data link header. Step 3 The data link layer strips the data link header and trailer and then passes the remaining data up to the network layer based on the control informa- tion in the data link header. This process is called de-encapsulation. Each subsequent layer performs a similar de- encapsulation process. Think of the de-encapsulation process as the process of reading the address on a letter to see if it is for you and then removing the letter from the enve- lope if the letter is addressed to you. More Information: Cyclical Redundancy Check Each data packet has information added to the raw data itself, in the form of packet headers. The headers contain addressing information so that the packets reach the correct destination. They also contain sequencing information so the data can be reassembled accurately when all packets reach the receiving computer. continues 1102.book Page 77 Tuesday, May 20, 2003 2:53 PM 78 Chapter 2: Networking Fundamentals Networking Devices Equipment that connects directly to a network segment is called a device. These devices are broken into two classifications: ■ End user devices—Include computers, printers, scanners, and other devices that provide services directly to the user. ■ Network devices—Include all devices that connect the end-user devices to allow them to communicate. End-user devices that provide users with a connection to the network are also called hosts. Figure 2-21 shows an example of an end-user device—a workstation. Figure 2-21 End-User Device: Workstation Header information is placed at the head of the packet, in front of the original data. Packets also can include trailer information, which is appended to the back of the packet, following the orig- inal data. The error-checking component in the trailer is called a cyclical redundancy check (CRC). The CRC performs calculations on the packet before it leaves the source computer and again when it reaches the destination. If the results of these calculations are different, the data has changed. This can occur because of a disruption of the electrical signals that represent the 0s and 1s making up the data. If a discrepancy is found, that packet can be resent. More Information: Cyclical Redundancy Check (Continued) 1102.book Page 78 Tuesday, May 20, 2003 2:53 PM . layer-specific PDU and with its peer layer on the destination computer, as shown in Figure 2 -17 . 11 02. book Page 72 Tuesday, May 20 , 20 03 2: 53 PM Networking Models 73 Figure 2 -17 Peer-to-Peer Communication Data. between application pro- tocols and data-flow protocols. Whereas the application, presentation, and session 11 02. book Page 71 Tuesday, May 20 , 20 03 2: 53 PM 72 Chapter 2: Networking Fundamentals layers. information that gets added. 11 02. book Page 75 Tuesday, May 20 , 20 03 2: 53 PM 76 Chapter 2: Networking Fundamentals Figure 2 -19 Encapsulation As illustrated in Figure 2- 20, networks must perform