Several commonly used network protocols [transfer]

Source [On the Road] Garden Friends: https://www.cnblogs.com/liyanbin/p/5951869.html

1. OSI model

Name Hierarchy Function

Physical layer 1 implements the physical connection between the computer system and the network

Data link layer 2 packs and unpacks data to form information frames

Network layer 3 provides routing of data through

Transport Layer 4 provides transfer order information and responses

Session Layer 5 establishing and aborting connections

Presentation Layer 6 Data Conversion, Confirmation of Data Format

Application layer 7 provides user program interface

Second, the agreement level

 

Common protocols and hierarchical relationships in the network

 

1. Process/Application Protocol

Usually the most extensive protocol, each protocol in this layer consists of two parts: client program and service program. Programs work through server-client interaction. Common protocols are: Telnet, FTP, SMTP, HTTP, DNS, etc.

2. Host-host layer protocol

Establish and maintain connections to ensure the security of data transmission between hosts. There are two main protocols in this layer:

TCP (Transmission Control Protocol: Transmission Control Protocol; connection-oriented, reliable transmission

UDP (User Datagram Protocol): User Datagram Protocol; connectionless, unreliable transmission

3. Internet layer protocol

Responsible for data transmission, routing between different networks and systems, fragmentation and reassembly of data packets, and device addressing. These layers include the following protocols:

IP (Internet Protocol): Internet protocol, responsible for providing datagram services between TCP/IP hosts, encapsulating data and generating protocol headers, the basis of TCP and UDP protocols.

ICMP (Internet Control Message Protocol): Internet Control Message Protocol. The ICMP protocol is actually a subsidiary protocol of the IP protocol. The IP protocol uses it to exchange error packets and other network conditions with other hosts or routers. The ICMP packets carry control information and fault recovery information.

ARP (Address Resolution Protocol) protocol: Address Resolution Protocol.

RARP (Reverse Address Resolution Protocol): Reverse Address Resolution Protocol.

The full name of OSI (Open System Interconnection) The OSI seven-layer structure of the network Friday, March 28, 2008 14:18 (1) Physical layer - Physical 
This is the lowest layer of the entire OSI reference model, and its task is to provide the physical connection of the network . Therefore, the physical layer is built on the physical medium (rather than logical protocols and sessions), and it provides mechanical and electrical interfaces. It mainly includes cables, physical ports and auxiliary equipment, such as twisted pair, coaxial cable, wiring equipment (such as network cards, etc.), RJ-45 interface, serial port and parallel port, etc., all work at this level in the network. 
The services provided by the physical layer include: physical connection, physical service data unit serialization (the bit order received by the receiving physical entity is the same as the bit order sent by the transmitting physical entity) and data circuit identification.

(2) Data link layer - The 
Data Link layer is based on the physical transmission capability and transmits data in units of frames. Its main task is to carry out data encapsulation and the establishment of data links. In the encapsulated data information, the address segment contains the addresses of the sending node and the receiving node, the control segment is used to indicate the type of the data connection frame, the data segment contains the actual data to be transmitted, and the error control segment is used to detect errors in the transmission frame. 
The protocols that can be used at the data link layer are SLIP, PPP, X.25, and frame relay. Common hubs and low-end switch network devices work at this level, as do dial-up devices such as Modem. Switches working at this level are commonly known as "layer 2 switches". 
Specifically, the functions of the data link layer include: establishment and release of data link connections, formation of data link data units, splitting, delimitation and synchronization of data link connections, sequence and flow control, and error detection and recovery, etc. aspect.

(3) Network layer - The 
Network layer belongs to a higher level in OSI. From its name, it can be seen that it solves the communication problem between the network and the network, that is, the Internet, rather than the same network segment. thing. The main function of the network layer is to provide routing, that is, to select the best path to reach the target host, and transmit data packets along this path. In addition, the network layer should also be able to eliminate network congestion, with the ability of flow control and congestion control. The routers in the network boundary work at this level, and now the higher-end switches can also work directly at this level, so they also provide routing functions, commonly known as "layer 3 switches". 
The functions of the network layer include establishing and tearing down network connections, routing and relaying, multiplexing of network connections, segmentation and chunking, service selection, and flow control.

(4) Transport layer - The 
Transport layer solves the problem of data transmission quality between networks, and it belongs to a higher level. The transport layer is used to improve the quality of service of the network layer and provide reliable end-to-end data transmission. As often said, QoS is the main service of this layer. This layer mainly involves the network transmission protocol, which provides a set of network data transmission standards, such as the TCP protocol. 
The functions of the transport layer include: mapping transport addresses to network addresses, multiplexing and segmentation, establishment and release of transport connections, segmentation and reassembly, and chunking and chunking. 
According to the main nature of the services provided by the transport layer, the transport layer services can be divided into the following three categories: 
Type A: The network connection has an acceptable error rate and an acceptable failure notification rate (the rate at which the network connection is disconnected and reset occurs) , Class A services are reliable network services, generally referring to virtual circuit services. 
Class C: The network connection has an unacceptable error rate. Class C has the worst quality of service, providing datagram services or radio packet-switched networks. 
Class B: The network connection has an acceptable error rate and an unacceptable failure notification rate. Class B services are between Class A and Class C, and most of them provide Class B services in the WAN and the Internet.

The division of network service quality is based on user requirements. If the user requirements are relatively high, a network may be classified as type C; otherwise, a network may be classified as type B or even type A. For example, for an e-mail system, a network that loses one packet per week might count as Type A; the same network might only count as Type C for a banking system.

(5) Session layer - The Senssion 
session layer uses the transport layer to provide session services. The session may be a user logging in to a host through the network, or a session being established for transferring files. 
The functions of the session layer mainly include: mapping session connection to transport connection, data transfer, recovery and release of session connection, session management, token management and activity management.

(6) Presentation layer - Presentation 
layer is used for data management representation, such as ASCII and EBCDIC for text files, 1S or 2S complement representation for numbers. If the communicating parties use different data representation methods, they cannot understand each other. The presentation layer is used to mask this difference. 
The functions of the presentation layer mainly include: data syntax conversion, syntax representation, presentation connection management, data encryption and data compression.

(7) Application layer - Application 
This is the highest layer of the OSI reference model. It also solves the highest layer, that is, the problem in the process of program application, which directly faces the specific application of the user. The application layer contains the protocols and functions required by user applications to perform communication tasks, such as e-mail and file transfer. In this layer, protocols such as FTP, SMTP, and POP in the TCP/IP protocol are fully applied. 
The predecessor of SNMP (Simple Network Management Protocol, Simple Network Management Protocol) is Simple Gateway Monitoring Protocol (SGMP), which is used to manage communication lines. Subsequently, people have made great changes to SGMP, especially adding SMI and MIB in line with Internet definition: Architecture, the improved protocol is the famous SNMP. The goal of SNMP is to manage the software and hardware platforms produced by many manufacturers on the Internet, so SNMP is also greatly influenced by the Internet standard network management framework. Now SNMP has come out to the third version of the protocol, and its functions have been greatly enhanced and improved.

The architecture of SNMP is designed around the following four concepts and goals: keep the software cost of the management agent (agent) as low as possible; keep the function of remote management to the maximum extent, so as to make full use of the network resources of the Internet; the architecture must There is room for expansion; maintain the independence of SNMP and do not depend on specific computers, gateways and network transmission protocols. In recent improvements, the goal of ensuring the security of the SNMP system itself has been added. 
OSPF (Open Shortest Path First) is an interior gateway protocol (Interior Gateway Protocol, IGP for short), which is used for routing decisions within a single autonomous system (AS). As opposed to RIP, OSPF is a link-state routing protocol, while RIP is a distance vector routing protocol.
RIP (Routing Information Protocol) is an interior gateway protocol (Interior Gateway Protocol, IGP for short) that is used earlier and is more commonly used. It is suitable for small networks of the same type and is a typical distance-vector (distance-vector) protocol. For documentation, see RFC1058, RFC1723. 
RIP exchanges routing information by broadcasting UDP packets, and sends routing information updates every 30 seconds. RIP provides hop count (hop count) as a measure to measure routing distance, and hop count is the number of routers a packet must pass through to reach its destination. If there are two unequal speed or different bandwidth routers to the same destination, but the hop count is the same, then RIP considers the two routes to be equidistant. The maximum number of hops supported by RIP is 15, that is, the maximum number of routers to be passed between the source and destination networks is 15. The hop number of 16 means that
CSMA/CD (Carrier Sense Multiple Access/Collision Detect)
is unreachable, that is, carrier sense multiple access. /Conflict detection method
1. Basics:
It is a contention-type media access control protocol. It originated from the contention protocol adopted by the ALOHA network developed by the University of Hawaii in the United States, and has been improved to have a higher medium utilization rate than the ALOHA protocol. 
The advantages of the CSMA/CD control method are: the
principle is relatively simple, and the technology is easy to implement. Each workstation in the network is in an equal position, and no centralized control is required, and no priority control is provided. However, when the network load increases, the sending time increases and the sending efficiency drops sharply.
CSMA/CD is applied to the data link layer in the ISO7 layer.
Its working principle is: before sending data, it monitors whether the channel is free, and if it is free, it sends data immediately. When sending data, it continues to monitor while sending. If a conflict is detected , then stop sending data immediately. Wait for a period of time, and then try again. 
2. Advanced chapter:
CSMA/CD control procedure:
the core problem of the control procedure: to solve the problems that may occur in the transmission of data by broadcasting on the public channel ( Mainly the problem of data collision)
The control process includes four processing contents: listening, sending, detection, and conflict processing
(1) Listening:
Through a special detection mechanism, listen to whether there is data on the bus before the site is ready to send transmit (is the line busy)?
If it is "busy", it enters into the "backoff" processing program described later, and further repeats the listening operation.
If it is "idle", a certain algorithm principle ("X insist" algorithm) decides how to send.
(2) Send:
When it is determined to send, the data is sent to the bus through the sending mechanism.
(3) Detection:
After the data is sent, data collision may also occur. Therefore, it is necessary to send and receive data at the same time to determine whether there is a conflict. (Refer to Figure 5P127)
(4) Conflict handling:
  After confirming that a conflict occurs, enter the conflict handling procedure. There are two conflict situations:
   ① The line is found to be busy during listening
② The data collision is found during sending
① If the line is found to be busy during listening, wait for a delay and then listen again. If it is still busy, continue to delay and wait until it can be sent. If the time of each delay is inconsistent, the backoff algorithm determines the delay value.
② If a data collision is found during the sending process, the blocking information is sent first to strengthen the conflict, and then the listening work is performed to wait for the next re-send (the method is the same as ①)

 The most representative bit-oriented protocols are IBM's Synchronous Data Link Control (SDLC), and the International Standards Organization's ISO (International Standards Organization) HDLC (High Level Data Link Control). ), the Advanced Data Communications Control Procedure ADCP (Advanced Data Communications Control Procedure) of the American National Standards Institute (American National Standard ds Institute). The characteristics of these protocols are that a frame of data transmitted can be any bit, and it relies on an agreed-upon bit combination pattern instead of a specific character to mark the start and end of a frame, so it is called a "bit-oriented" protocol.


  two. Fragmentation of frame information A frame of information of

  SDLC/HDLC includes the following fields (Field), and all fields are transmitted from the least significant bit. 
  1. SDLC/HDLC mark character 
  SDLC/HDLC agreement stipulates, all information transmission must start with a mark character, and end with the same character. This flag character is 01111110, called the flag field (F). A complete unit of information is formed from the start mark to the end mark, which is called a frame. All information is transmitted in frames, and flag characters provide the boundaries of each frame. The receiver can detect the beginning and end of the frame by searching for "01111110" to establish frame synchronization. 
  2. Address Field and Control Field
  After the flag field, there can be an address field A (Address) and a control field C (Control1). The address field is used to specify the address of the secondary station with which to communicate. The control field may specify several commands. The SDLC specifies that the A and C fields are 8 bits wide. HDLC allows the A field to be of any length, and the C field to be 8-bit or 16-bit. The receiver must check the first bit of each address byte, if it is "0", it is followed by another address byte; if it is "1", this byte is the last address byte. Similarly, if the first bit of the first byte of the control field is "0", there is a second control field byte, otherwise there is only one byte. 
  3. The information field 
  follows the control field is the information field I (Information). The I field contains the data to be transmitted and is also called the data field. Not every frame has to have an information field. That is, the information field can be 0, and when it is 0, this frame is mainly a control command. 
  4. The frame check field 
  is followed by the two-byte frame check field. The frame check field is called the FC (Frame Check) field, and the check sequence FCS (Frame check Sequence). Both SDLC/HDLC use 16-bit cyclic redundancy check code CRC (Cyclic Redundancy Code), and its generator polynomial is CCITT polynomial X^16+X^12+X^5+1. Except for the flag field and the automatically inserted "0" bit, all information participates in the CRC calculation. The CRC encoder adds redundant supervisory bits to each code group when sending the code group. When receiving, the decoder can correct the error codes within the error correction range, and check the error codes within the error correction range, but cannot correct them. Multi-bit errors beyond the scope of calibration and error correction will not be detected by calibration.

  three. Two technical problems in practical application 

   1 . "0" bit insertion/deletion technique
   As mentioned above, the SDLC/HDLC protocol stipulates that 01111110 is used as the flag byte, but it is entirely possible that there are characters of the same pattern in the information field. In order to distinguish it from the flag, the "0" bit is inserted and the Remove technology. The specific method is that when the sender sends all information (except the flag byte), as long as it encounters 5 consecutive "1"s, it will automatically insert a "0". When the receiver is receiving data (except the flag byte), if the continuous When five "1"s are received, the following "0" is automatically deleted to restore the original form of the information. This "0" bit insertion and deletion process is done automatically by hardware, which is easier to implement than the above character-oriented "data transparency". 
   2. Abnormal end of SDLC/HDLC 
   If there is an error in the sending process, the SDLC/HDLC protocol uses an abnormal end (Abort) character, or a failure sequence, to invalidate the frame. In the HDLC procedure, 7 consecutive "1"s are used as fail characters, while in SDLC the fail character is 8 consecutive "1"s. Of course the "0" bit insertion/deletion technique is not used in the failure sequence. 
   The SDLC/HDLC protocol stipulates that data gaps are not allowed within a frame. Between two frames of information, the transmitter can continuously output a sequence of flag characters, or it can output a continuous high level, which is called an idle (Idle) signal.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324706600&siteId=291194637