• The osi reference model levels are in the correct order. How the OSI model works

    Modern world IT is a huge, branching structure that is difficult to understand. To simplify understanding and improve debugging even at the stage of designing protocols and systems, a modular architecture was used. It is much easier for us to figure out that the problem is in the video chip when the video card is a separate device from the rest of the equipment. Or notice a problem in separate area network than to shovel the entire network.

    A separate layer of IT - the network - is also built modularly. The network functioning model is called the network model of the basic reference model of interaction open systems ISO/OSI. Briefly - the OSI model.

    The OSI model consists of 7 layers. Each level is abstracted from the others and knows nothing about their existence. The OSI model can be compared to the structure of a car: the engine does its job by creating torque and transferring it to the gearbox. The engine does not care what happens next with this torque. Will he spin a wheel, caterpillar or propeller? Just like the wheel, it doesn’t matter where this torque came from - from the engine or the handle that the mechanic turns.

    Here we need to add the concept of payload. Each level carries a certain amount of information. Some of this information is proprietary to this level, for example, the address. The site's IP address does not carry any significance for us. useful information. We only care about the cats that the site shows us. So this payload is carried in that part of the layer called the protocol data unit (PDU).

    Layers of the OSI Model

    Let's look at each level of the OSI Model in more detail.

    Level 1. Physical ( physical). Load unit ( PDU) here is the bit. The physical layer knows nothing except ones and zeros. At this level, wires, patch panels, network hubs (hubs that are now difficult to find in our usual networks) work. network adapters. It is the network adapters and nothing else from the computer. The network adapter itself receives the bit sequence and transmits it further.

    Level 2. Duct ( data link). PDU - frame ( frame). Addressing appears at this level. The address is MAC address. The link layer is responsible for the delivery of frames to the recipient and their integrity. In our usual networks on link level ARP protocol is running. Second-level addressing only works within one network segment and does not know anything about routing - this is handled by a higher level. Accordingly, devices operating on L2 are switches, bridges and a network adapter driver.

    Level 3. Network ( network). PDU packet ( packet). The most common protocol (I won’t talk further about “the most common” - this article is for beginners and, as a rule, they don’t encounter anything exotic) here is IP. Addressing occurs using IP addresses, which consist of 32 bits. The protocol is routed, that is, a packet can reach any part of the network through a certain number of routers. Routers operate on L3.

    Level 4. Transport ( transport). PDU segment ( segment)/datagram ( datagram). At this level, the concepts of ports appear. TCP and UDP work here. Protocols at this level are responsible for direct communication between applications and for the reliability of information delivery. For example, TCP can request a retransmission of data if the data was received incorrectly or not all. TCP can also change the data transfer rate if the receiving side does not have time to receive everything (TCP Window Size).

    The following levels are “correctly” implemented only in the RFC. In practice, the protocols described at the following levels operate simultaneously at several levels of the OSI model, so there is no clear division into session and presentation layers. In this regard, currently the main stack used is TCP/IP, which we will talk about below.

    Level 5. Session ( session). PDU data ( data). Manages the communication session, information exchange, and rights. Protocols - L2TP, PPTP.

    Level 6. Executive ( presentation). PDU data ( data). Data presentation and encryption. JPEG, ASCII, MPEG.

    Level 7. Applied ( application). PDU data ( data). The most numerous and varied level. It runs all high-level protocols. Such as POP, SMTP, RDP, HTTP, etc. Protocols here do not have to think about routing or guaranteeing the delivery of information - this is done by lower layers. At level 7, it is only necessary to implement specific actions, for example, receiving an html code or an email message to a specific recipient.

    Conclusion

    The modularity of the OSI model allows for quick identification of problem areas. After all, if there is no ping (3-4 levels) to the site, there is no point in delving into the overlying layers (TCP-HTTP) when the site is not displayed. By abstracting from other levels, it is easier to find an error in the problematic part. By analogy with a car - we don’t check the spark plugs when we puncture the wheel.

    The OSI model is a reference model - a kind of spherical horse in a vacuum. Its development took a very long time. In parallel with it, the TCP/IP protocol stack was developed, which is actively used in networks at present. Accordingly, an analogy can be drawn between TCP/IP and OSI.

    Just started working network administrator? Don't want to get confused? Our article will be useful to you. Have you heard a time-tested administrator talk about network problems and mention some levels? Have you ever been asked at work what layers are secure and work if you are using an old firewall? To understand the basics information security, you need to understand the principle of the hierarchy of the OSI model. Let's try to see the capabilities of this model.

    A self-respecting system administrator should be well versed in network terms

    Translated from English - the basic reference model for the interaction of open systems. More precisely, the network model of the OSI/ISO network protocol stack. Introduced in 1984 as a conceptual framework that separated the process of sending data to world wide web in seven easy steps. It is not the most popular, since the development of the OSI specification has been delayed. The TCP/IP protocol stack is more advantageous and is considered the main model used. However, you have a huge chance to encounter the OSI model as a system administrator or in the IT field.

    Many specifications and technologies have been created for network devices. It's easy to get confused in such diversity. It is the open systems interaction model that helps network devices using each other to understand each other. various methods communication. Note that OSI is most useful to software and hardware manufacturers designing compatible products.

    Ask, what benefit does this have for you? Knowledge of the multi-level model will give you the opportunity to freely communicate with employees of IT companies; discussing network problems will no longer be oppressive boredom. And when you learn to understand at what stage the failure occurred, you can easily find the reasons and significantly reduce the range of your work.

    OSI levels

    The model contains seven simplified steps:

    • Physical.
    • Duct.
    • Network.
    • Transport.
    • Sessional.
    • Executive.
    • Applied.

    Why does breaking it down into steps make life easier? Each level corresponds to a specific stage of sending a network message. All steps are sequential, which means that the functions are performed independently, there is no need for information about the work at the previous level. The only necessary components are how the data from the previous step is received, and how the information is sent to the subsequent step.

    Let's move on to a direct acquaintance with the levels.

    Physical layer

    The main task of the first stage is sending bits through physical communication channels. Physical communication channels are devices created for transmitting and receiving information signals. For example, optical fiber coaxial cable or twisted pair. Shipping can also take place via wireless communication. The first stage is characterized by the data transmission medium: interference protection, bandwidth, wave impedance. The qualities of the electrical final signals are also set (type of encoding, voltage levels and signal transmission speed) and connected to standard types of connectors, and contact connections are assigned.

    The functions of the physical stage are performed on absolutely every device connected to the network. For example, a network adapter implements these functions on the computer side. You may have already encountered the first step protocols: RS-232, DSL and 10Base-T, which define the physical characteristics of the communication channel.

    Data Link Layer

    At the second stage, the abstract address of the device is associated with physical device, the availability of the transmission medium is checked. Bits are formed into sets - frames. The main task of the link layer is to identify and correct errors. For correct transmission, specialized bit sequences are inserted before and after the frame and a calculated checksum is added. When the frame reaches the destination, the checksum of the already arrived data is calculated again; if it matches the checksum in the frame, the frame is considered correct. Otherwise, an error appears that can be corrected by retransmitting information.

    The channel stage makes it possible to transmit information thanks to a special connection structure. In particular, buses, bridges, and switches operate through link layer protocols. Step two specifications include: Ethernet, Token Ring, and PPP. The functions of the channel stage in a computer are performed by network adapters and drivers for them.

    Network layer

    In standard situations, the functions of the channel stage are not enough for high-quality information transfer. Second step specifications can only transfer data between nodes with the same topology, for example, a tree. There is a need for a third stage. It is necessary to form a unified transport system with a branched structure for several networks that have an arbitrary structure and differ in the method of data transfer.

    To explain it differently, the third step processes the Internet protocol and performs the function of the router: search the best way for information. A router is a device that collects data about the structure of internetwork connections and transmits packets to the destination network (transit transfers - hops). If you encounter an error in the IP address, then this is a problem that occurred on network level. Stage three protocols are broken down into networking, routing or address resolution protocols: ICMP, IPSec, ARP and BGP.

    Transport layer

    For data to reach applications and upper levels stack, a fourth stage is required. It provides the required degree of reliability of information transmission. There are five classes of transport stage services. Their difference lies in the urgency, feasibility of restoring interrupted communication, and the ability to detect and correct transmission errors. For example, packet loss or duplication.

    How to choose a transport stage service class? When the quality of communication channels is high, a lightweight service is an adequate choice. If communication channels are not secure at the very beginning, it is advisable to resort to a developed service that will provide maximum possibilities to find and solve problems (control of data delivery, delivery timeouts). Stage 4 specifications: TCP and UDP of the TCP/IP stack, SPX of the Novell stack.

    The combination of the first four levels is called the transport subsystem. It fully provides the selected level of quality.

    Session layer

    The fifth stage helps in regulating dialogues. It is impossible for interlocutors to interrupt each other or speak synchronously. The session layer remembers the active party at a particular moment and synchronizes information, coordinating and maintaining connections between devices. Its functions allow you to return to control point during a long shipment and do not start all over again. Also at the fifth stage, you can terminate the connection when the exchange of information is completed. Session layer specifications: NetBIOS.

    Executive level

    The sixth stage is involved in the transformation of data into a universal recognizable format without changing the content. Since in different devices are disposed of various formats, information processed at the representational level enables systems to understand each other, overcoming syntactic and coding differences. In addition, at the sixth stage, it becomes possible to encrypt and decrypt data, which ensures secrecy. Examples of protocols: ASCII and MIDI, SSL.

    Application layer

    The seventh stage on our list and the first if the program sends data over the network. Consists of sets of specifications through which the user, Web pages. For example, when sending messages by mail specifically to application level a convenient protocol is selected. The composition of the seventh stage specifications is very diverse. For example, SMTP and HTTP, FTP, TFTP or SMB.

    You may have heard somewhere about the eighth level of the ISO model. Officially, it does not exist, but a comic eighth stage has appeared among IT workers. This is all due to the fact that problems can arise due to the fault of the user, and as you know, a person is at the pinnacle of evolution, so the eighth level appeared.

    Having considered the OSI model, you were able to understand the complex structure of the network and now understand the essence of your work. Things get pretty simple when you break the process down!

    The concept of “open system” and problems of standardization

    The universal thesis about the benefits of standardization, valid for all industries, acquires special significance in computer networks. The essence of the network is the connection of different equipment, which means that the problem of compatibility is one of the most acute. Without the adoption by all manufacturers of generally accepted rules for constructing equipment, progress in the matter of “building” networks would be impossible. Therefore, the entire development of the computer industry is ultimately reflected in standards - any new technology only acquires “legal” status when its content is enshrined in the appropriate standard.

    In computer networks, the ideological basis of standardization is a multi-level approach to the development of network interaction tools. It was on the basis of this approach that a standard seven-level model of interaction of open systems was developed, which became a kind of universal language of network specialists.

    Multi-level approach. Protocol. Interface. Protocol stack

    Organizing interactions between devices on a network is a complex task. As you know, to solve complex problems, a universal technique is used - decomposition, that is, breaking one complex problem into several simpler task modules (Fig. 1.20). The decomposition procedure includes a clear definition of the functions of each module that solves a separate problem, and the interfaces between them. As a result, a logical simplification of the task is achieved, and in addition, it becomes possible to modify individual modules without changing the rest of the system.

    Decomposition often uses a multi-level approach. It is as follows. All the many modules are divided into levels. The levels form a hierarchy, that is, there are overlying and underlying levels (Fig. 1.21). The set of modules that make up each level is formed in such a way that, to perform their tasks, they make requests only to the modules of the immediately adjacent underlying level. On the other hand, the results of the work of all modules belonging to a certain level can only be transferred to modules of the adjacent higher level. This hierarchical decomposition of the problem requires a clear definition of the function of each level and the interfaces between the levels. An interface defines a set of functions that the underlying layer provides to the upper layer. As a result of hierarchical decomposition, relative independence of levels is achieved, and therefore the possibility of their easy replacement.

    In this case, lower-level modules can, for example, solve all issues related to the reliable transmission of electrical signals between two neighboring nodes. Modules more high level organize the transportation of messages within the entire network, using the means of the mentioned lower level. And at the top level there are modules that provide users with access to various services - file, print, etc. Of course, this is only one of many possible options for dividing the general task of organizing network interaction into private subtasks.

    A multi-level approach to the description and implementation of system functions is applied not only in relation to network tools. This operating model is used, for example, in local file systems, when an incoming request to access a file is sequentially processed by several program levels (Fig. 1.22). The request is first analyzed by the upper level, which sequentially parses the compound symbolic file name and determines the unique file identifier. The next level finds all the main characteristics of a file using a unique name: address, access attributes, etc. Then, at a lower level, access rights to this file are checked, and then, after calculating the coordinates of the file area containing the required data, physical exchange is performed with external device using the disk driver.

    The multi-level representation of network interaction means has its own specifics due to the fact that the message exchange process involves two cars, that is, in in this case it is necessary to organize the coordinated work of the two “hierarchies”. When transmitting messages, both participants in a network exchange must accept many agreements. For example, they must agree on the levels and shape of electrical signals, how to determine the length of messages, agree on methods of checking reliability, etc. In other words, agreements must be made for all levels, starting from the lowest - the bit transfer level - to the highest, implementing a service for network users.

    In Fig. Figure 1.23 shows a model of interaction between two nodes. On each side, the means of interaction are represented by four levels. The interaction procedure between these two nodes can be described as a set of rules for the interaction of each pair of corresponding levels of both parties involved.

    Formalized rules that determine the sequence and format of messages exchanged between network components located at the same level, but in different nodes, are called protocol.

    Modules that implement adjacent layer protocols and are located in the same node also interact with each other in accordance with clearly defined rules and using standardized message formats. These rules are usually called interface. An interface defines a set of services that a given layer provides to its neighboring layer.

    In essence, a protocol and an interface express the same concept, but traditionally in networks they have been assigned different scopes of action: protocols define the rules for the interaction of modules of the same level in different nodes, and interfaces define the rules for the interaction of modules of neighboring levels in the same node.

    The tools of each level must work, firstly, their own protocol, and secondly, interfaces with neighboring levels.

    A hierarchically organized set of protocols sufficient to organize the interaction of nodes in a network is called stack of communication protocols.

    Communication protocols can be implemented in both software and hardware. Lower-level protocols are often implemented using a combination of software and hardware, while higher-level protocols are typically implemented purely in software.

    A software module that implements a certain protocol is often also called a “protocol” for brevity. Moreover, the relationship between a protocol - a formally defined procedure and a protocol - software module, implementing this procedure, is similar to the relationship between an algorithm for solving a certain problem and a program that solves this problem.

    It is clear that the same algorithm can be programmed with different degrees of efficiency. In the same way, a protocol can have several software implementations. That is why, when comparing protocols, one should take into account not only the logic of their operation, but also the quality of software solutions. Moreover, the efficiency of interaction between devices on a network is influenced by the quality of the entire set of protocols that make up the stack, in particular, how rationally functions are distributed between protocols of different levels and how well the interfaces between them are defined.

    OSI model

    Just because a protocol is an agreement between two interacting entities, in this case two computers working on a network, does not mean that it is necessarily standard. But in practice, when implementing networks, they tend to use standard protocols. These may be proprietary, national or international standards.

    In the early 80s, a number of international standardization organizations - ISO, ITU-T and some others, developed a model that played a significant role in the development of networks. This model is called model of open systems interaction (Open System Interconnection, OSI) or OSI model. The OSI model defines different layers of system interaction, gives them standard names, and specifies what functions each layer should perform. The OSI model was developed based on extensive experience gained from creating computer networks, mainly global ones, in the 70s. A full description of this model takes up more than 1000 pages of text.

    In the OSI model (Fig. 1.25), communication means are divided into seven levels:

      Applied

      Representative

      Session

      Transport

      Network

      Duct

      Physical.

    Each layer deals with one specific aspect of network device interaction.

    The OSI model only describes system tools interactions implemented by the operating system, system utilities, and system hardware. The model does not include means for end-user application interaction. Applications implement their own communication protocols by accessing system tools. Therefore, it is necessary to distinguish between the application interaction layer and the application layer.

    You should also keep in mind that the application can take over the functions of some of the upper layers of the OSI model. For example, some DBMSs have built-in remote file access capabilities. In this case, the application, when accessing remote resources, does not use the system file service: It bypasses the upper layers of the OSI model and directly accesses the system facilities responsible for transporting messages across the network, which are located at the lower layers of the OSI model.

    So, let's say an application makes a request to an application layer, such as a file service. Based on this request, the application level software generates a message in a standard format. A typical message consists of a header and a data field. The header contains service information that must be passed through the network to the application layer of the destination machine to tell it what work needs to be done. In our case, the header obviously must contain information about the location of the file and the type of operation that needs to be performed on it. The message data field may be empty or contain some data, such as that which needs to be written to deleted file. But in order to deliver this information to its destination, there are still many tasks to be solved, the responsibility for which lies with lower levels.

    After the message is generated, the application layer forwards it down the stack to the representative layer. The representative layer protocol, based on the information received from the application layer header, performs the required actions and adds its own service information to the message - the representative layer header, which contains instructions for the representative layer protocol of the destination machine. The resulting message is passed down to the session layer, which in turn adds its header, etc. (Some protocol implementations place service information not only at the beginning of the message in the form of a header, but also at the end, in the form of a so-called “trailer” -.) Finally, the message reaches the lower, physical layer, which actually transmits it along communication lines to the recipient machine. At this point, the message is “overgrown” with headers of all levels (Fig. 1.26).

    When a message arrives over the network at the destination machine, it is received by its physical layer and sequentially moves up from layer to layer. Each level analyzes and processes the header of its level, performing functions corresponding to this level, and then removes this header and passes the message to the higher level.

    Along with the term message (message) There are other terms used by network specialists to designate units of data in exchange procedures. ISO standards use a common name to refer to the units of data that protocols at different levels deal with: protocol block data ( Protocol Data Unit , PDU ). To designate data blocks of certain levels - Special names are often used: frame, packet, datagram, segment.

    The OSI model distinguishes between two main types of protocols. The protocols with connection establishment (connection- oriented) Before exchanging data, the sender and receiver must first establish a connection and perhaps select some protocol parameters that they will use when exchanging data. After completing the conversation, they must terminate this connection . The telephone is an example of interaction , connection-based .

    The second group of protocols is protocols without first establishing a connection (connectionless). Such protocols are also called datagram protocols. The sender simply transmits the message when it is ready. Dropping a letter into mailbox is an example of communication without first establishing a connection. When computers interact, both types of protocols are used.

    OSI Model Layers

    Physical layer

    The Physical layer deals with the transmission of bits over physical communication channels, such as coaxial cable, twisted pair cable, fiber optic cable or digital territorial circuit. This level is related to the characteristics of physical data transmission media, such as bandwidth, noise immunity, characteristic impedance and others. At the same level, the characteristics of electrical signals transmitting discrete information are determined, for example, the steepness of pulse edges, voltage or current levels of the transmitted signal, type of encoding, and signal transmission speed. In addition, the types of connectors and the purpose of each contact are standardized here.

    Physical layer functions are implemented in all devices connected to the network. On the computer side, the physical layer functions are performed by the network adapter or serial port.

    An example of a physical layer protocol is the 1OBase specification - Ethernet technology, which defines the cable used as Category 3 unshielded twisted pair with a characteristic impedance of 100 Ohms, an RJ-45 connector, a maximum physical segment length of 100 meters, Manchester code for representing data in the cable, as well as some other characteristics of the environment and electrical signals.

    Data Link Layer

    On physical level bits are simply sent. This does not take into account that in some networks in which communication lines are used (shared) alternately by several pairs of interacting computers, the physical transmission medium may be occupied. Therefore, one of the tasks of the Data Link layer is to check the availability of the transmission medium. Another task of the link layer is to implement error detection and correction mechanisms. To do this, the link layer groups bits into sets called frames (frames). The link layer ensures that each frame is transmitted correctly by placing a special sequence of bits at the beginning and end of each frame to distinguish it, and also calculates checksum, processing all the bytes of the frame in a certain way and adding a checksum to the frame. When a frame arrives over the network, the receiver again calculates the checksum of the received data and compares the result with the checksum from the frame. If they match, the frame is considered correct and accepted. If the checksums do not match, an error is recorded. The link layer can not only detect errors, but also correct them by retransmitting damaged frames. It should be noted that the error correction function is not mandatory for the data link layer, so some protocols at this level do not have it, for example, Ethernet and frame relay.

    The link layer protocols used in local networks contain a certain structure of connections between computers and methods for addressing them. Although the data link layer provides frame delivery between any two nodes on a local network, it does this only in a network with a very specific connection topology, precisely the topology for which it was designed. Typical topologies supported by LAN link layer protocols include bus, ring, and star, as well as structures derived from them using bridges and switches. Examples of link layer protocols are Ethernet, Token Ring, FDDI, lOOVG-AnyLAN.

    In local area networks, link layer protocols are used by computers, bridges, switches, and routers. In computers, link layer functions are implemented through the joint efforts of network adapters and their drivers.

    IN global networks, which rarely have a regular topology, the data link layer often provides the exchange of messages only between two neighboring computers connected by an individual communication line. Examples of point-to-point protocols (as such protocols are often called) are the widely used PPP and LAP-B protocols. In such cases, network layer facilities are used to deliver messages between end nodes across the entire network. This is how X.25 networks are organized. Sometimes in global networks, it is difficult to isolate the link layer functions in their pure form, since they are combined with network layer functions in the same protocol. Examples of this approach include ATM and frame relay technology protocols.

    In general, the link layer is a very powerful and complete set of functions for sending messages between network nodes. In some cases, link layer protocols turn out to be self-sufficient transport vehicles and can allow application layer protocols or applications to work directly on top of them, without involving means of the network and transport layers. For example, there is an implementation of the SNMP network management protocol directly over Ethernet, although by default this protocol runs over network protocol IP and UDP transport protocol. Naturally, the use of such an implementation will be limited - it is not suitable for composite networks of different technologies, for example, Ethernet and X.25, and even for a network in which Ethernet is used in all segments, but there are loop-like connections between the segments. But in a two-segment Ethernet network connected by a bridge, the implementation of SNMP over the data link layer will be quite workable.

    However, to ensure high-quality transportation of messages in networks of any topology and technology, the functions of the link layer are not enough, therefore, in the OSI model, the solution to this problem is assigned to the next two layers - network and transport.

    Network layer

    The Network layer serves to form a unified transport system , uniting several networks, and these networks can use completely different principles for transmitting messages between end nodes and have an arbitrary connection structure. The functions of the network layer are quite diverse. Let's start considering them using the example of combining local networks.

    Local network link layer protocols ensure data delivery between any nodes only in a network with the appropriate standard topology, for example, a hierarchical star topology. This is a very strict limitation that does not allow building networks with a developed structure, for example, networks that combine several enterprise networks in single network, or highly reliable networks in which there are redundant connections between nodes. It would be possible to make link layer protocols more complex to support looping redundant connections, but the principle of separation of responsibilities between layers leads to a different solution. In order, on the one hand, to maintain the simplicity of data transfer procedures for standard topologies, and on the other hand, to allow the use of arbitrary topologies, an additional network layer is introduced.

    At the network level the term itself net endowed with specific meaning. In this case, a network is understood as a collection of computers connected to each other in accordance with one of the standard typical topologies and using one of the link layer protocols defined for this topology to transmit data.

    Within the network, data delivery is ensured by the appropriate data link layer, but data delivery between networks is handled by the network layer, which supports the ability the right choice message transmission route even in the case when the structure of connections between the component networks has a character different from that adopted in link layer protocols.

    Networks are connected to each other by special devices called routers. Router - This is a device that collects information about the topology of internetwork connections and, based on it, forwards network layer packets to the destination network. To transmit a message from a sender located on one network to a recipient located on another network, you need to make a certain number of transit transmissions between networks, or hops (from hop - jump), each time choosing the appropriate route. Thus, a route is a sequence of routers through which a packet passes.

    In Fig. Figure 1.27 shows four networks connected by three routers. There are two routes between nodes A and B of this network: the first through routers 1 and 3, and the second through routers 1, 2 and 3.

    The problem of choosing the best path is called routing, and its solution is one of the main tasks of the network level. This problem is complicated by the fact that the shortest path is not always the best. Often the criterion for choosing a route is the transmission time of data along this route; it depends on the capacity of the communication channels and the intensity of the schedule, which can change over time. Some routing algorithms try to adapt to changes in load, while others make decisions based on averages over time. long time. The route can be selected based on other criteria, such as transmission reliability.

    In general, the functions of the network level are broader than the functions of message transmission over connections with a non-standard structure, which we have now examined using the example of combining several local networks. The network layer also solves coordination problems different technologies, simplifying addressing in large networks and creating reliable and flexible barriers to unwanted traffic between networks.

    Network layer messages are usually called packages (packets). When organizing packet delivery at the network level, the concept of “network number” is used. In this case, the recipient's address consists of a major part - the network number and a minor part - the node number in this network. All nodes on the same network must have the same high part of the address, so the term “network” at the network level can be given another, more formal definition: a network is a collection of nodes whose network address contains the same network number.

    At the network layer, two types of protocols are defined. First type - network protocols (routedprotocols) - implement the promotion of packets through the network. These are the protocols that are usually meant when people talk about network layer protocols. However, another type of protocol is often included in the network layer, called routing information exchange protocols or simply routing protocols (routing protocols). Using these protocols, routers collect information about the topology of internetwork connections. Network layer protocols are implemented by software modules of the operating system, as well as software and hardware of routers.

    Another type of protocol operates at the network layer, which is responsible for mapping the host address used at the network layer to the local network address. Such protocols are often called address resolution protocols - Address Resolution Protocol, ARP. Sometimes they are classified not as a network layer, but as a channel layer, although the subtleties of the classification do not change their essence.

    Examples of network layer protocols are the TCP/IP stack IP Internetwork Protocol and the Novell IPX stack Internetwork Protocol.

    Transport layer

    On the way from the sender to the recipient, packets may be corrupted or lost. While some applications have their own error handling, there are others that prefer to deal with a reliable connection right away. . The Transport layer provides applications or upper layers of the stack - application and session - with the transfer of data with the degree of reliability that they require. The OSI model defines five classes of service provided by the transport layer. These types of services are distinguished by the quality of the services provided: urgency, the ability to restore interrupted communications , the presence of means for multiplexing multiple connections between different application protocols through a common transport protocol, and most importantly, the ability to detect and correct transmission errors, such as distortion, loss and duplication of packets.

    The choice of transport layer service class is determined, on the one hand, by the extent to which the problem of ensuring reliability is solved by the applications and protocols of higher levels than the transport one, and on the other hand, this choice depends on how reliable the data transportation system is in network provided by the layers located below the transport - network, channel and physical. So, for example, if the quality of communication channels is very high and the likelihood of errors not detected by lower-level protocols is small, then it is reasonable to use one of the lightweight transport layer services that are not burdened with numerous checks, handshaking, and other techniques for increasing reliability. If the vehicles of the lower levels are initially very unreliable, then it is advisable to turn to the most developed transport layer service, which works using maximum means to detect and eliminate errors - using preliminary establishment of a logical connection, control of message delivery by checksums and cyclic numbering packages, setting delivery timeouts, etc.

    As a rule, all protocols, starting from the transport layer and above, are implemented by software of the end nodes of the network - components of their network operating systems. Examples of transport protocols include the TCP and UDP protocols of the TCP/IP stack and the SPX protocol of the Novell stack.

    The protocols of the lower four layers are generally called network transport or transport subsystem, since they completely solve the problem of transporting messages with a given level of quality in composite networks with arbitrary topologies and various technologies. The remaining three upper levels solve the problem of providing application services based on the existing transport subsystem.

    Session layer

    The Session layer provides dialogue control: it records which party is active in present moment, provides synchronization facilities. The latter allow you to insert checkpoints into long transfers, so that in case of failure you can go back to the last checkpoint, rather than starting all over again. In practice, few applications use the session layer, and it is rarely implemented as separate protocols, although the functions of this layer are often combined with the functions of the application layer and implemented in a single protocol.

    Representative level

    The Presentation layer deals with the form of presentation of information transmitted over the network, without changing its content. Due to the presentation layer, information transmitted by the application layer of one system is always understandable to the application layer of another system. With the help of this layer, application layer protocols can overcome syntactic differences in data representation or differences in character codes, such as ASCII and EBCDIC codes. At this level, encryption and decryption of data can be performed, thanks to which the secrecy of data exchange is ensured for all application services at once. An example of such a protocol is the Secure Socket Layer (SSL) protocol, which provides secure messaging for the application layer protocols of the TCP/IP stack.

    Application layer

    The Application layer is really just a set of various protocols through which network users access shared resources such as files, printers, or hypertext Web pages, and also organize their collaboration, for example, using the protocol email. The unit of data that the application layer operates on is usually called message (message).

    There is a very wide variety of application layer services. Let us take as an example at least a few of the most common implementations of file services: NCP in operating system Novell NetWare, SMB on Microsoft Windows NT, NFS, FTP and TFTP included in the TCP/IP stack.

    Network-dependent and network-independent levels

    Functions at all layers of the OSI model can be classified into one of two groups:

    either to functions that depend on a specific technical implementation of the network, or to functions that are oriented to work with applications.

    The three lower layers - physical, data link and network - are network-dependent, that is, the protocols of these levels are closely related to the technical implementation of the network and the communication equipment used. For example, switching to FDDI equipment means full shift physical and data link layer protocols in all network nodes.

    The three upper layers - application, representative and session - are application-oriented and have little dependence on the technical features of network construction. The protocols at these layers are not affected by any changes in the network topology, replacement of equipment, or transition to another network technology. Thus, the transition from Ethernet to high-speed lOOVG-AnyLAN technology will not require any changes in software that implements the functions of the application, representative and session levels.

    The transport layer is an intermediate layer, it hides all the details of the functioning of the lower layers from the upper ones. This allows you to develop applications that do not depend on technical means direct transport of messages.

    In Fig. 1.28 shows the levels of the OSI model , on which various network elements operate. A computer with a network OS installed on it interacts with another computer using protocols of all seven levels. Computers carry out this interaction indirectly through various communication devices: hubs, modems, bridges, switches, routers, multiplexers. Depending on the type, a communication device can operate either only at the physical layer (repeater), or at the physical and link level (bridge), or at the physical, link and network layer, sometimes also capturing the transport layer (router).

    In Fig. Figure 1.29 shows the correspondence of the functions of various communication devices to the levels of the OSI model .

    The OSI model, although very important, is only one of many communication models. These models and their associated protocol stacks may differ in the number of layers, their functions, message formats, services supported at the upper layers, and other parameters.

    To coordinate the operation of network devices from different manufacturers To ensure the interaction of networks that use different signal propagation environments, a reference model of open systems interaction (OSI) has been created. The reference model is built on a hierarchical principle. Each level provides services to the higher level and uses the services of the lower level.

    Data processing begins at the application level. After this, the data passes through all layers of the reference model, and is sent through the physical layer to the communication channel. At reception, reverse processing of the data occurs.

    The OSI reference model introduces two concepts: protocol And interface.

    A protocol is a set of rules on the basis of which the layers of various open systems interact.

    An interface is a set of means and methods of interaction between elements of an open system.

    The protocol defines the rules for interaction between modules of the same level in different nodes, and the interface - between modules of adjacent levels in the same node.

    There are a total of seven layers of the OSI reference model. It's worth noting that real stacks use fewer layers. For example, the popular TCP/IP uses only four layers. Why is this so? We'll explain a little later. Now let’s look at each of the seven levels separately.

    OSI Model Layers:

    • Physical level. Determines the type of data transmission medium, physical and electrical characteristics interfaces, type of signal. This layer deals with bits of information. Examples of physical layer protocols: Ethernet, ISDN, Wi-Fi.
    • Data link level. Responsible for access to the transmission medium, error correction, and reliable data transmission. At the reception The data received from the physical layer is packed into frames and then their integrity is checked. If there are no errors, then the data is transferred to the network layer. If there are errors, the frame is discarded and a request for retransmission is generated. The data link layer is divided into two sublayers: MAC (Media Access Control) and LLC (Local Link Control). MAC regulates access to shared space physical environment. LLC provides network layer service. Switches operate at the data link layer. Examples of protocols: Ethernet, PPP.
    • Network layer. Its main tasks are routing - determining the optimal data transmission path, logical addressing of nodes. In addition, this level may be tasked with troubleshooting network problems (ICMP protocol). The network layer works with packets. Examples of protocols: IP, ICMP, IGMP, BGP, OSPF).
    • Transport layer. Designed to deliver data without errors, losses and duplication in the sequence in which they were transmitted. Performs end-to-end control of data transmission from sender to recipient. Examples of protocols: TCP, UDP.
    • Session level. Manages the creation/maintenance/termination of a communication session. Examples of protocols: L2TP, RTCP.
    • Executive level. Converts data to the required form, encryption/encoding, compression.
    • Application layer. Provides interaction between the user and the network. Interacts with client-side applications. Examples of protocols: HTTP, FTP, Telnet, SSH, SNMP.

    After getting acquainted with the reference model, let's look at the TCP/IP protocol stack.

    There are four layers defined in the TCP/IP model. As can be seen from the figure above, one TCP/IP layer can correspond to several layers of the OSI model.

    TCP/IP model levels:

    • Level network interfaces. Corresponds to the two lower layers of the OSI model: data link and physical. Based on this, it is clear that this level determines the characteristics of the transmission medium (twisted pair, optical fiber, radio), type of signal, coding method, access to the transmission medium, error correction, physical addressing (MAC addresses). In the TCP/IP model, the Ethrnet protocol and its derivatives (Fast Ethernet, Gigabit Ethernet) operate at this level.
    • Interconnection layer. Corresponds to the network layer of the OSI model. Takes over all its functions: routing, logical addressing (IP addresses). The IP protocol operates at this level.
    • Transport layer. Corresponds to the transport layer of the OSI model. Responsible for delivering packets from source to destination. At this level, two protocols are used: TCP and UDP. TCP is more reliable than UDP by creating pre-connection requests for retransmission when errors occur. However, at the same time, TCP is slower than UDP.
    • Application layer. Its main task is to interact with applications and processes on hosts. Examples of protocols: HTTP, FTP, POP3, SNMP, NTP, DNS, DHCP.

    Encapsulation is a method of packaging a data packet in which independent packet headers are abstracted from the headers of lower levels by including them in higher levels.

    Let's look at a specific example. Let's say we want to get from a computer to a website. To do this, our computer must prepare an http request to obtain the resources of the web server on which the site page we need is stored. At the application level, an HTTP header is added to the browser data. Next, at the transport layer, a TCP header is added to our packet, containing the sender and recipient port numbers (port 80 for HTTP). At the network layer, an IP header is generated containing the IP addresses of the sender and recipient. Immediately before transmission, an Ethrnet header is added at the link layer, which contains the physical (MAC addresses) of the sender and recipient. After all these procedures, the packet in the form of bits of information is transmitted over the network. At the reception, the reverse procedure occurs. The web server at each level will check the corresponding header. If the check is successful, the header is discarded and the packet moves to the upper level. Otherwise, the entire packet is discarded.


    Subscribe to our

    I'll start by defining how it is accepted. The OSI model is theoretical ideal model data transmission over the network. This means that in practice you will never find an exact match to this model, this is the standard that the developers adhere to network programs and manufacturers network equipment in order to maintain the compatibility of their products. You can compare this with people’s ideas about an ideal person - you won’t find it anywhere, but everyone knows what to strive for.


    I would like to immediately point out one nuance - I will call what is transmitted over the network within the OSI model data, which is not entirely correct, but in order not to confuse the novice reader with the terms, I made a compromise with my conscience.


    Below is the best known and most understood diagram of the OSI model. There will be more pictures in the article, but I propose to consider the first one as the main one:



    The table consists of two columns, at the initial stage we are only interested in the right one. We will read the table from bottom to top (how else :)). In fact, this is not my whim, but I do it for the convenience of assimilation of information - from simple to complex. Let's go!


    The right side of the above table shows from bottom to top the path of data transmitted over the network (for example, from your home router to your computer). Clarification - OSI levels from bottom to top, then this will be the data path on the receiving side, if from top to bottom, then vice versa - on the sending side. I hope it's clear for now. To completely dispel doubts, here is another diagram for clarity:



    To trace the path of data and the changes that occur with it across levels, it is enough to imagine how it moves along the blue line in the diagram, first moving from top to bottom through the OSI levels from the first computer, then from bottom to top to the second. Now let's look at each of the levels in more detail.


    1) Physical(physical) - this includes the so-called “data transmission medium”, i.e. wires, optical cable, radio wave (in case of wireless connections) and the like. For example, if your computer is connected to the Internet via cable, then the quality of data transmission at the first, physical level is determined by the wires, contacts at the end of the wire, contacts of the connector of your computer’s network card, as well as internal electrical diagrams on computer boards. Network engineers have the concept of a “physics problem” - this means that the specialist considered a physical layer device to be the culprit for the “non-transmission” of data, for example, it was broken somewhere network cable, or low level signal.


    2) Channel(datalink) - this is much more interesting. To understand the link layer, we will first have to understand the concept of the MAC address, since it will be the main character in this chapter :). The MAC address is also called the “physical address” or “hardware address”. It is a set of 12 characters in hexadecimal number system divided by 6 octets dash or colon, for example 08:00:27:b4:88:c1. It is needed for unambiguous identification network device online. In theory, a MAC address is globally unique, i.e. Such an address cannot exist anywhere in the world and it is “sewn into” the network device at the production stage. However, there are simple ways to change it to an arbitrary one, and besides, some unscrupulous and little-known manufacturers are not above riveting, for example, a batch of 5000 network cards with exactly the same MAC. Accordingly, if at least two such “acrobat brothers” appear on the same local network, conflicts and problems will begin.


    So, at the data link level, the data is processed by a network device, which is interested in only one thing - our notorious MAC address, i.e. he is interested in the delivery addressee. Link-level devices include, for example, switches (aka switches) - they store in their memory the MAC addresses of network devices with which they have a direct, direct connection and, when receiving data on their receiving port, check the MAC addresses in the data with the MAC -addresses available in memory. If there are matches, then the data is transmitted to the recipient, the rest are simply ignored.


    3) Network(network) is a “sacred” level, understanding the operating principle of which for the most part makes a network engineer such. Here the “IP address” already rules with an iron hand, here it is the basis of the foundations. Thanks to the presence of an IP address, it becomes possible to transfer data between computers that are not part of the same local network. Transferring data between different local networks is called routing, and devices that allow this to be done are called routers (they are also routers, although in recent years the concept of a router has been greatly distorted).


    So, an IP address - without going into details, it is a certain set of 12 digits in the decimal ("regular") number system, divided into 4 octets, separated by a dot, which is assigned to a network device when connecting to the network. Here we need to go a little deeper: for example, many people know the address from the series 192.168.1.23. It is quite obvious that there are no 12 digits here. However, if you write the address in full format, everything falls into place - 192.168.001.023. We won’t dig even deeper at this stage, since IP addressing is a separate topic for telling and showing.


    4) Transport layer(transport) - as the name suggests, it is needed specifically for delivering and sending data to the recipient. Drawing an analogy with our long-suffering mail, the IP address is the actual delivery or receipt address, and the transport protocol is the postman who can read and knows how to deliver the letter. Protocols are different, for different purposes, but they have the same meaning - delivery.


    The transport layer is the last one that network engineers are mostly interested in, system administrators. If all 4 lower levels worked as they should, but the data did not reach its destination, then the problem needs to be looked for already in software specific computer. The protocols of the so-called upper levels are of great concern to programmers and sometimes to system administrators (if he is involved in maintaining servers, for example). Therefore, further I will briefly describe the purpose of these levels. In addition, if you look at the situation objectively, most often in practice the functions of several upper layers of the OSI model are taken over by one application or service, and it is impossible to say unambiguously where it should be assigned.


    5) Session(session) - controls the opening and closing of a data transfer session, checks access rights, controls the synchronization of the beginning and end of the transfer. For example, if you download a file from the Internet, then your browser (or whatever you are downloading through) sends a request to the server on which the file is located. At this point, session protocols are turned on, which ensure successful downloading of the file, after which, in theory, they are automatically turned off, although there are options.


    6) Executive(presentation) - prepares data for processing by the final application. For example, if this text file, then you need to check the encoding (so that you don’t get any “kryakozyabrs”), perhaps unpack it from the archive.... but here what I wrote about earlier is clearly visible - it’s very difficult to separate where the executive level ends and where the next one begins :


    7) Applied(Application) - as the name implies, the level of applications that use the received data and we see the result of the work of all levels of the OSI model. For example, you are reading this text because you opened it in the correct encoding, in the required font etc. your browser.


    And now that we have at least a general understanding of the technology of the process, I consider it necessary to talk about bits, frames, packets, blocks and data. If you remember, at the beginning of the article I asked you not to pay attention to the left column in the main table. So, her time has come! Now we will go through all the layers of the OSI model again and see how simple bits (zeros and ones) turn into data. We will also go from bottom to top, so as not to disrupt the sequence of assimilation of the material.


    On physical level we have a signal. It can be electrical, optical, radio wave, etc. So far these are not even bits, but the network device analyzes the received signal and converts it into zeros. This process is called "hardware conversion". Further, already inside the network device, the bits are combined into (eight bits in one byte), processed and transmitted to the data link layer.


    On channel level we have the so-called frame. Roughly speaking, this is a pack of bytes, from 64 to 1518 in one pack, from which the switch reads the header, which contains the MAC addresses of the recipient and sender, as well as technical information. Seeing the MAC address match in the header and in your switching table(memory), the switch transmits frames with such matches to the destination device


    On network level, to all this goodness, the IP addresses of the recipient and sender are also added, which are extracted from the same header and this is called plastic bag.


    On transport At the level, the packet is addressed to the corresponding protocol, the code of which is indicated in the header service information and is given for servicing to protocols of the upper levels, for which this is already full-fledged data, i.e. information in a form that is digestible and usable by applications.


    This will be seen more clearly in the diagram below: