Modeling Layered Protocols
Layered protocols are used in many communications networks to decompose an otherwise complex system into more manageable parts. Each of these parts, or layers, has a well-defined interface to the adjacent layers, offering a specific set of services to the higher layer while acting as a client of the services provided by the lower layer. Modeler’s block-structured approach to modeling is well-suited to modeling layered protocols. Each layer in a protocol can be modeled by a processor or queue module. In some cases, it might be appropriate to further decompose each layer into multiple modules.
The following figure shows the concept of a layered protocol as described by the ISO OSI Model, and an analogous layered node model. Each layer of the OSI Model has a corresponding processor module in the node model, and these modules exchange data over packet streams only with the modules that represent the adjacent layers. Just as each layer of the OSI Model is typically specified individually, so each layer of the node model can be implemented by a processor module executing a process developed separately from the others.
Figure 176: OSI / Modeler Layering Analogy

Many of the example models supplied with Modeler are designed this way. For example, the X.25 node model, which is in the models/std/x25 directory, incorporates an application processor, the X.25 DCE or DTE module (which implements the network layer), and the LAPB module (which implements the data-link layer). The following figure shows the X.25 DTE node model.
Figure 177: Example of a Layered Protocol Model

Interfaces between adjacent layers normally transfer control information, such as a command value or an address, in addition to packet data. Modeler provides the ICI (Interface Control Information block) to pass such parameters between layers. This encourages modularity between different protocols, as it allows the control information to remain separate from the data packet. Most protocol layers will not need to examine a data packet passed by a higher layer at all, but can use the information in the ICI to control its processing. In particular, the format of the data packet remains local to a particular interface, and does not depend on the packet format at higher or lower layers of the protocol stack. Instead, a layer will combine information from an ICI with the higher layer data packet into a packet format suitable for the lower layer (or unpack the lower layer’s packet, packaging information from the packet header into an ICI for the higher layer). The process of combining data into lower-level packets is illustrated in the diagram below. For more examples of this strategy, examine the x25 model and the process models in the standard model directories.
Figure 178: Interfacing Adjacent Layers of Protocol Stack
