Interaction Between OSI Layers

Imagine a Web browser displaying a Web page that it received from a Web server. Before that happened, the browser somehow interacted with the software implementing other layers of TCP/IP on the client computer, causing a request to flow to the server. Likewise, the broswer application somehow communicated with the Web server application, telling the server what Web page the browser wanted to display. A fancy way to describe these two ideas that is "interaction between OSI layers." The process of how layers interact on the same computer, as well as how the same layer processes on different computers communicate with each other, is all interrelated. The software or hardware products implementing the logic of some of the OSI protocol layers provide two general functions:

• Each layer provides a service to the layer above it in the protocol specification.

• Each layer communicates some information with the same layer's software or hardware on other computers. In some cases, the other computer is connected to the same media; in other cases, the other computer is on the other end of the network.

Interactions Between Adjacent Layers on the Same Computer

The post office analogy provides an easy comparison to networking and interactions between adjacent layers. The words in my letter to Mike Z are the application data. While still at my office, I put the letter in an envelope because the USPS will not just deliver the paper; it requires me to provide an envelope. On that envelope, I provide an address that meets USPS specifications for addresses. Having done that, and after putting on the correct postage stamp, I expect the USPS to deliver the letter. That's exactly the same concept of the interactions between layers on the same computer. When sending data, the higher layers expect the lower layers to help deliver the data. However, the lower layers expect the higher layers to give them the data in a certain format, with certain header and address information attached. (The header acts like the envelope in the analogy.)

So, to provide services to the next higher layer, the layer must know about the standard interfaces defined between itself and the next higher layer. These interfaces include definitions of what Layer N+1 must provide to Layer N to get services, as well as what information Layer N must provide back to Layer N+1 when data has been received. And these details are all part of the protocol specifications.

Figure 3-2 presents a graphical representation of two computers and provides an excellent backdrop for a discussion of interactions between layers on the same computer.

Figure 3-2 Example for Discussion of Adjacent-Layer Interactions

Application Presentation Session Transport Network Data Link Physical

Figure 3-2 Example for Discussion of Adjacent-Layer Interactions

L7

Data

L6

L7

Data

L5

L6

L7

Data

L4

L5

L6

L7

Data

L3

L4

L5

L6

L7

Data

L2H

L3

L4

L5

L6

L7

Data

Send bits

Application Presentation © Session Transport Network Data Link Physical

L7

Data

L6

L7

Data

L5

L6

L7

Data

L4

L5

L6

L7

Data

L3

L4

L5

L6

L7

Data

L2H

L3

L4

L5

L6

L7

Data

Receive bits

L# - Layer # header L#H - Layer # header L#T - Layer # trailer

The data is created by some application on Host A. For example, an e-mail message is typed by the user. Each layer creates a header and passes the data down to the next layer. (The arrows in Figure 3-2, Step 1, denote the passing of data between layers.) Just as I had to put an envelope around my letter to Mike, a layer typically has to put some header around its data before giving it to the next lower layer that is providing service. Passing the data down to the next layer implies that the lower layer needs to perform some services for the higher layer; to perform these services, the lower layer adds some information in a header or trailer. For example, the transport layer hands off its data and header; the network layer adds a header with the correct destination network layer address so that the packet can be delivered to the other computer.

From each layer's perspective, the bits after that layer's header are considered to be data. For instance, Layer 4 considers the Layer 5, 6, and 7 headers, along with the original user data, to be one large data field.

After the application creates the data, the software and hardware implementing each layer perform their work, adding the appropriate header and trailer. The physical layer can use the media to send a signal for physical transmission, as shown in Step 2 in Figure 3-2.

Upon receipt (Step 3), Host B begins the adjacent layer interactions on Host B. The right side of Figure 3-2 shows an arrow pointing next to the computer (Step 4), signifying that the received data is being processed as it goes up the protocol stack. In fact, thinking about what each layer does in the OSI model can help you decide what information could be in each header.

The following sequence outlines the basics of processing at each layer and shows how each lower layer provides a service to the next higher layer. Consider the receipt of data by the host on the right side of Figure 3-2:

Step 1 The physical layer (Layer 1) ensures bit synchronization and places the received binary pattern into a buffer. It notifies the data link layer that a frame has been received after decoding the incoming signal into a bit stream. Therefore, Layer 1 has provided delivery of a stream of bits across the medium.

Step 2 The data link layer examines the frame check sequence (FCS) in the trailer to determine whether errors occurred in transmission (error detection). If an error has occurred, the frame is discarded. (Some data link protocols perform error recovery, and some do not.) The data link address(es) are examined so that Host B can decide whether to process the data further. If the data is addressed to host B, the data between the Layer 2 header and trailer is given to the Layer 3 software. The data link has delivered the data across that link.

Step 3 The network layer (Layer 3) destination address is examined. If the address is Host B's address, processing continues (logical addressing) and the data after the Layer 3 header is given to the transport layer (Layer 4) software. Layer 3 has provided the service of end-to-end delivery.

Step 4 If error recovery was an option chosen for the transport layer (Layer 4), the counters identifying this piece of data are encoded in the Layer 4 header along with acknowledgment information (error recovery). After error recovery and reordering of the incoming data, the data is given to the session layer.

Step 5 The session layer (Layer 5) can be used to ensure that a series of messages is completed. For example, this data could be meaningless if the next four exchanges are not completed. The Layer 5 header could include fields signifying that this is a middle flow in a chain, not an ending flow. After the session layer ensures that all flows are completed, it passes the data after the Layer 5 header to the Layer 6 software.

Step 6 The presentation layer (Layer 6) defines and manipulates data formats. For example, if the data is binary instead of character data, the header denotes that fact. The receiver does not attempt to convert the data using the default ASCII character set of Host B. Typically, this type of header is included only for initialization flows, not with every message being transmitted (data formats). After the data formats have been converted, the data (after the Layer 6 header) is then passed to the application layer (Layer 7) software.

Step 7 The application layer (Layer 7) processes the final header and then can examine the true end-user data. This header signifies agreement to operating parameters by the applications on Host A and Host B. The headers are used to signal the values for all parameters; therefore, the header typically is sent and received at application initialization time only. For example, for file transfer, the size of the file to be transferred and the file formats used would be communicated (application parameters).

Interactions Between the Same Layers on Different Computers

Layer N must interact with Layer N on another computer to successfully implement its functions. For example, the transport layer (Layer 4) can send data, but if another computer does not acknowledge that the data was received, the sender will not know when to perform error recovery. Likewise, the sending computer encodes a destination network layer address (Layer 3) in the network layer header. If the intervening routers do not cooperate by performing their network layer tasks, the packet will not be delivered to the true destination.

The post office analogy can help in this case as well. If I write the letter to Mike and put the address but not his name on the envelope, the letter gets to the office because I gave the USPS enough information to deliver the letter. No one knows to whom to give the letter, though. In real life, someone would open the letter and see that it's addressed to Mike—but, of course, the office might have more than one Mike! With real networking, the sending application needs to put some header around the data so that the receiving computer knows what application should receive the data.

To interact with the same layer on another computer, each layer defines a header and, in some cases, a trailer. Headers and trailers are additional data bits, created by the sending computer's software or hardware, that are placed before or after the data given to Layer N by Layer N+1. The information needed for this layer to communicate with the same layer process on the other computer is encoded in the header and trailer. The receiving computer's Layer N software or hardware interprets the headers and trailers created by the sending computer's Layer N, learning how Layer N's processing is being handled, in this case.

Figure 3-3 provides a conceptual perspective on the same-layer interactions. The application layer on Host A communicates with the application layer on Host B. Likewise, the transport, session, and presentation layers on Host A and Host B also communicate. The bottom three layers of the OSI model have to do with delivery of the data; Router 1 is involved in that process.

Host A's network, physical, and data link layers communicate with Router 1; likewise, Router 1 communicates with Host B's physical, data link, and network layers. Figure 3-3 provides a visual representation of the same-layer interaction concepts.

Readers' Questions

  • cornelia
    What protocol communicates data between routers?
    2 months ago
  • The protocol used to communicate data between routers is called a routing protocol. Examples of commonly used routing protocols include OSPF (Open Shortest Path First), BGP (Border Gateway Protocol), IS-IS (Intermediate System to Intermediate System), EIGRP (Enhanced Interior Gateway Routing Protocol) and RIP (Routing Information Protocol).
    • iole
      Which of the following is a session level interaction?
      2 months ago
    • A session level interaction is an interaction that lasts for a specific amount of time, during which two or more individuals interact. Examples include conversations between two people, online chats, and online courses.
      • LIVIO
        What model is used to describe how data communication occurs between hosts?
        2 months ago
      • The OSI (Open Systems Interconnection) model is used to describe how data communication occurs between hosts. It is a seven-layer reference model that defines how data is transmitted and received between two or more computers in a network. Each layer has specific functions that enable data communication to take place.
        • monica
          How osi model work from one media?
          1 year ago
        • The OSI Model works from one media by breaking down communications into seven distinct layers. The first layer, Physical, consists of the media used to send signals, such as copper wire or a wireless network. The second layer, Data Link, is responsible for formatting the data into the signals used to transmit data over the physical media. The third layer, Network, is responsible for managing the addressing and routing of messages across networks. The fourth layer, Transport, manages the reliable delivery of data. The fifth layer, Session, establishes and maintains communication between two applications. The sixth layer, Presentation, is responsible for making sure data is presented properly to the other side. The seventh layer, Application, is responsible for user applications like web browsing and email.
          • asphodel
            How to convey an OSI interface?
            1 year ago
          • An OSI interface is typically conveyed using a computer network protocol or an application program interface (API). Protocols such as TCP/IP and application programming interfaces such as NETBIOS or Windows Sockets can be used to convey an OSI interface.
            • floyd
              How to demonstrate seven osi layer work together?
              1 year ago
            • publio
              How are each layer communicate to each other in osi model?
              1 year ago
            • Each layer communicates with its adjacent layers, which are the layer directly above and below it, using protocols that are specific to that layer.
              • sven
                How are each layer communicate with each other OSI?
                1 year ago
              • Each layer in the OSI model communicates with the layer directly above and below it. Layer 7, the top layer, is the Application layer. It communicates with Layer 6, the Presentation layer, which communicates with Layer 5, the Session layer, and so on, down to Layer 2, the Data Link layer, and Layer 1, the Physical layer.
                • Hana
                  How IT architecture layers are interacting with each others?
                  1 year ago
                • IT architecture layers are designed to interact with each other in order to provide an efficient IT system. Typically, the layers will include the hardware, operating system, middleware, applications, and user interface layers. Each layer is connected to the other layers in order to allow data and information to flow smoothly between them. The hardware layer provides the physical platform for the other layers to operate on, while the operating system provides the instructions to the hardware on how to operate the system. The middleware layer provides a communication bridge between the hardware and applications layers, allowing them to interact. The applications layer provides the specific functionality that the user is requesting, while the user interface layer provides the user with the means to interact with the applications. All of the layers must be set up and configured properly in order to provide the best user experience.
                  • Torsten
                    How do the layers of the osi model interact?
                    1 year ago
                  • The layers of the OSI Model interact by relying on a service from one layer to deliver data to the next layer in the stack. Each layer takes care of its specific task and hands off the data to the layer above it. The 7 layers of the OSI model are: Application, Presentation, Session, Transport, Network, Data Link, and Physical.
                    • cristian
                      How application program interface communicates with lower layers of OSI?
                      1 year ago
                    • Application program interface (API) communicates with lower layers of the OSI model (e.g., transport layer and network layer) by issuing commands and requests that can be understood and processed by them. For example, an API can be used to make requests for information from the transport layer, such as an IP address, or the network layer, such as a MAC address. The result is then passed back up the stack to the application layer, where the response can be interpreted and used.
                      • Tomi
                        How do the layers interact with each other?
                        1 year ago
                      • The different layers of a computer system interact with each other in order to pass data between them. For example, the application layer might send a request down to the transport layer, which is responsible for managing the transmission of data across the network. The transport layer then passes the message down to the network layer, which handles routing and addressing of the message. The network layer passes the message to the data link layer, which formats it for transmission over the physical link. Finally, the physical layer transmits the message across the physical link.

                        Disclosure: Some of the links above are affiliate links. This means that, at zero cost to you, I will earn an affiliate commission if you click through the link and finalize a purchase.

                        Figure 3-3 Same-Layer Interactions on Different Computers

                        Application

                        Application

                        Presentation

                        Presentation

                        Session

                        Session

                        Transport

                        Transport

                        Network

                        Network

                        Network

                        Data link

                        Data link

                        Data link

                        Physical

                        Physical

                        Physical

                        Host A

                        Router 1

                        Host B

                        The post office analogy again helps. I, Wendell, the letter writer, is the equivalent of Host A. I write the letter, put it in the envelope, address and stamp the envelope, and drop it off at the local post office. The post office forwards the letter through many other mail-sorting centers because our home office, where Mike is, is 2,000 miles away. The mailing centers look at only the address—in fact, only at the ZIP code—until the letter makes it to Campbell, California. So I, the sender (Host A), put the address on the letter, which is used by many mailing centers (routers) who deliver the letter to our home office (host B), where the letter is given to the correct individual (correct application).

                        Continue reading here: Data Encapsulation

                        Was this article helpful?

                        +6 -6