Network protocol is a collection of communication rules between all devices on the network (network servers, computers and switches, routers, firewalls, etc.). It stipulates the formats that information must use during communication and the meaning of these formats.
Most networks use a layered architecture, with each layer built on top of the layer below it. The upper layer provides a certain service, and the details of how to implement this service are shielded from the upper layer. The rule for communication between the nth layer on one device and the nth layer on another device is the nth layer. Protocols, there are many protocols in each layer of the network. The protocols of the receiver and the sender at the same layer must be consistent, otherwise one party will not be able to recognize the information sent by the other party. Network protocols enable various devices on the network to exchange information with each other. (Recommended learning:PHP video tutorial)
For example, a microcomputer user in the network communicates with a mainframe operator. Since the character sets used by the two data terminals are different, the operation The commands entered by the users do not recognize each other.
Network protocol refers to a set of rules that must be followed when exchanging information between peer entities communicating with each other in a computer network.
In order to communicate, just like we speak in a certain language, there is also a language between each computer on the network, because different computers must use the same network protocol to communicate.
The network protocol is composed of three elements:
(1) Semantics. Semantics is the interpretation of the meaning of each part of the control information. It specifies what control information needs to be sent, as well as the completed actions and responses.
(2) Grammar. Syntax is the structure and format of user data and control information, as well as the order in which the data appears.
(3) Timing. Chronology is a detailed description of the order in which events occur. (Also known as "synchronization").
People vividly describe these three elements as: semantics represents what to do, syntax represents how to do it, and timing represents the order of doing it.
Due to the complexity of the connections between network nodes, when formulating protocols, complex components are usually decomposed into some simple components and then combined.
The most commonly used composite technology is the hierarchical approach. The hierarchical structure of the network protocol is as follows:
(1) Each layer in the structure stipulates clear services and Interface standards.
(2) Treat the user's application as the highest level.
(3) Except for the top layer, each layer in the middle provides services to the upper layer and is also a user of the lower layer.
(4) The physical communication line is regarded as the lowest layer, which uses parameters transmitted from the highest layer and is the basis for providing services.
For more PHP-related technical articles, please visit thePHP Graphic Tutorialcolumn to learn!
The above is the detailed content of Why do we need network protocols?. For more information, please follow other related articles on the PHP Chinese website!