• No results found

Data Encapsulation

In document CCNAEXAM pdf (Page 122-125)

The term encapsulation describes the process of putting headers and trailers around some data. Encapsulation puts the data in the correct, expected format so that another adjacent layer can provide a service or so that the same layer on another computer knows what needs to be done. For example, I put an envelope around my letter to Mike because that was required by the USPS, which provided me a service. I put Mike’s name on the envelope so that the people in our home office would know to whom to give the letter—the equivalent of the “same” layer on another computer.

As seen previously in Figure 3-2, when each layer creates its header, it places the data given to it by the next-higher layer behind its own header, thereby encapsulating the higher layer’s data. In the case of a data link (Layer 2) protocol, the Layer 3 header and data are placed between the Layer 2 header and the Layer 2 trailer. The physical layer does not use encapsulation because it does not use headers or trailers.

Host A Application Presentation Session Transport Network Data link Physical Network Data link Physical Router 1 Host B Application Presentation Session Transport Network Data link Physical

OSI: Concepts, Layers, and Encapsulation 95

Again referring to Figure 3-2, Step 1, the following list describes the encapsulation process for sending data by Host A:

Step 1 The application has already created the data. The application layer creates the application header and places the data behind it. This data structure is passed to the presentation layer.

Step 2 The presentation layer creates the presentation header and places the data behind it. This data structure is passed to the session layer. Step 3 The session layer creates the session header and places the data

behind it. This data structure is passed to the transport layer. Step 4 The transport layer creates the transport header and places the data

behind it. This data structure is passed to the network layer. Step 5 The network layer creates the network header and places the data

behind it. This data structure is passed to the data link layer. Step 6 The data link layer creates the data link header and places the data

behind it. The data link trailer is added to the end of the structure. This data structure is passed to the physical layer.

Step 7 The physical layer encodes a signal onto the medium to transmit the frame.

This seven-step process accurately describes what happens for the seven-layer OSI model. However, encapsulation by each layer does not typically happen for each transmission of data by the application. Normally, Layers 5 through 7 use headers during initialization—and occasionally after initialization—but, in most flows, there is no Layer 5, 6, or 7 header. This is because there is no new information to exchange for every flow of data.

An analogy can help in this case. A friend of mine from church spent several summers teaching English in a communist country. When I wrote to her, she assumed that I would write in English, but I could not write about “church” without the sensors tossing the letter. So, we agreed on encryption before she left. Under our code, God was called “Phil,” and I could write things such as, “I saw Fred at Phil’s house yesterday, and he said hi.” I still had to address the letters before I mailed them, just like the lower OSI layers need to exchange some information for every piece of data sent. I didn’t need to repeat what “Phil” really meant in each letter, just like the upper layers do not need to repeat encryption rules.

Previous CCNA exams referred to a five-step process for encapsulation. This included the typical encapsulation by the transport, network, and data link layers as steps 2 through 4 in the seven-step process. The first step in the five-step process was the application’s creation of the data, and the fifth step was the physical layer’s transmission of the bit stream. In case any questions remain in the CCNA question database referring to a five-step encapsulation process, the following list provides the details and explanation.

96 Chapter 3: OSI Reference Model and Layered Communication

NOTE The term LxPDU, where x represents the number of one of the layers, is used to represent the bits that include the headers and trailers for that layer, as well as the encapsulated data. For instance, an IP packet is an L3PDU, which includes the IP header and any encapsulated data.

Step 1 Create the data—This simply means that the application has data to send.

Step 2 Package the data for transport—In other words, the transport layer (TCP or UDP) creates the transport header and places the data behind it. The L4PDU, called a segment in TCP/IP terminology, is created here.

Step 3 Add the destination and source network layer addresses to the data—The network layer creates the network header, which includes the network layer addresses, and places the data (L4PDU) behind it. In other words, the L3PDU is created here. Step 4 Add the destination and source data link layer addresses to

the data—The data link layer creates the data link header, places the data (L3PDU) behind it, and places the data link trailer at the end. In other words, the L2PDU is created here.

Step 5 Transmit the bits—The physical layer encodes a signal onto the medium to transmit the frame.

This five-step process happens to match the TCP/IP network model very well. Figure 3-4 depicts the concept; the numbers shown represent each of the five steps.

Figure 3-4 Five Steps of Data Encapsulation—TCP/IP

Several very important terms describe details about encapsulation. Layer N PDU (protocol data unit) is a term used to describe a set of bytes that includes the Layer N header and trailer and the user data. From Layer N’s perspective, the higher-layer headers and the user data form one large data or information field. A few other terms describe some of these PDUs. The Layer 2

LH IP TCP Data LT IP TCP Data TCP Data Data Application Transport Internet Network interface 1. 2. 3. 4. 5. Transmit bits

OSI: Concepts, Layers, and Encapsulation 97

PDU (including the data link header and trailer) is called a frame. Similarly, the Layer 3 PDU is called a packet, or sometimes a datagram. Finally, the Layer 4 PDU is called a segment. Figure 3-5 illustrates the construction of frames, packets, and segments and the different layers’ perspectives on what is considered to be data.

Figure 3-5 Frames, Packets, and Segments

In document CCNAEXAM pdf (Page 122-125)