CN109286575B - Message priority configuration method, device and network equipment - Google Patents

Message priority configuration method, device and network equipment Download PDF

Info

Publication number
CN109286575B
CN109286575B CN201811151191.6A CN201811151191A CN109286575B CN 109286575 B CN109286575 B CN 109286575B CN 201811151191 A CN201811151191 A CN 201811151191A CN 109286575 B CN109286575 B CN 109286575B
Authority
CN
China
Prior art keywords
priority
type
network device
equipment
network
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811151191.6A
Other languages
Chinese (zh)
Other versions
CN109286575A (en
Inventor
杨超
田明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Maipu Communication Technology Co Ltd
Original Assignee
Maipu Communication Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Maipu Communication Technology Co Ltd filed Critical Maipu Communication Technology Co Ltd
Priority to CN201811151191.6A priority Critical patent/CN109286575B/en
Publication of CN109286575A publication Critical patent/CN109286575A/en
Application granted granted Critical
Publication of CN109286575B publication Critical patent/CN109286575B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/24Traffic characterised by specific attributes, e.g. priority or QoS
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/50Queue scheduling
    • H04L47/62Queue scheduling characterised by scheduling criteria
    • H04L47/625Queue scheduling characterised by scheduling criteria for service slots or service orders
    • H04L47/6275Queue scheduling characterised by scheduling criteria for service slots or service orders based on priority

Abstract

The embodiment of the application provides a method, a device and network equipment for configuring message priority. The method comprises the following steps: starting and operating a target protocol belonging to a TCP type protocol in the network equipment; configuring the message priority of a first destination port corresponding to a target protocol in network equipment as a high priority, wherein the first destination port is a port for receiving messages based on the target protocol when the network equipment is used as server-side equipment; establishing a TCP connection corresponding to a target protocol between the network equipment and another network equipment; judging whether the network equipment is used as client equipment or not; and if so, configuring the message priority of a second destination port corresponding to the target protocol in the network equipment as high priority, wherein the second destination port is a port used for receiving the message based on the target protocol from another network equipment when the network equipment is used as client equipment. Thus, bidirectional priority guarantees can be provided for protocol-specific messages of a TCP connection.

Description

Message priority configuration method, device and network equipment
Technical Field
The present application relates to the field of communications technologies, and in particular, to a method, an apparatus, and a network device for configuring a message priority.
Background
The message priority refers to the degree of priority processing of the message, and the higher the priority is, the higher the priority can be processed preferentially. Generally, messages to be preferentially processed in a network are all messages of various Protocol types, such as Telnet, BGP (Border Gateway Protocol), and the like. Once the high priority of these messages is not guaranteed, a related network failure may occur. The first step of ensuring that the messages have high priority is to ensure that the network device is on the hardware level, and then on the software level.
Currently, for some specific packets belonging to a TCP type protocol, priority guarantee is performed by matching their specific TCP port numbers. That is, since the message of the specific TCP type protocol is sent to the server device and the fixed port corresponding to the protocol, the priority of the protocol message can be guaranteed by setting the message with the destination port as the fixed port as the high-priority message in the server device. However, since some hardware chips support matching to TCP destination ports, matching of source port numbers is often ignored. Moreover, although the ports of the server-side devices corresponding to the protocol packets are all fixed, the ports of the corresponding client-side devices are randomly allocated. Therefore, according to the current method, only the priority of the protocol packet can be guaranteed when the network device is used as the server-side device, but the priority of the protocol packet cannot be guaranteed when the network device is used as the client-side device.
Content of application
The embodiment of the application aims to provide a message priority configuration method, a message priority configuration device and network equipment.
In a first aspect, an embodiment of the present application provides a method for configuring a priority of a packet, where the method is applied to a network device, and the method includes: starting and operating a target protocol belonging to a TCP type protocol in the network equipment; configuring the message priority of a first destination port corresponding to the target protocol in the network equipment as a high priority, wherein the first destination port is a port for receiving the message based on the target protocol when the equipment type of the network equipment is server-side equipment; establishing a TCP connection corresponding to the target protocol between the network equipment and another network equipment; judging whether the equipment type of the network equipment is client equipment or not; when the device type of the network device is the client device, configuring the message priority of a second destination port corresponding to the target protocol in the network device as the high priority, where the second destination port is a port used for receiving a message based on the target protocol from another network device when the network device is the client device, and where the device type of the another network device is the server device when the device type of the network device is the client device. When the network device is used as a server-side device, the priority of the message of the first destination port, which is configured in the network device and used for receiving the message sent by the client-side device, is high, so that the priority of the message based on the target protocol when the network device is used as the server-side device can be ensured. When the network device is used as the client device, the priority of the message of the second destination port, which is configured in the network device and used for receiving the message sent by the server device, is high, so that the priority of the message based on the target protocol when the network device is used as the client device can be ensured. Therefore, under the condition that the hardware chip does not support TCP source port matching, the bidirectional priority of a specific protocol message for TCP connection can be ensured through the configuration.
Further, with reference to the embodiment provided by the first aspect, the determining whether the device type of the network device is a client device includes: obtaining a type of socket created in the network device based on the TCP connection; judging whether the device type of the network device is the client device or not based on the type of the socket; when the type of the socket is not the service type, the device type of the network device is the client device. Whether the network equipment is a client side can be judged according to the type of the socket corresponding to the TCP connection, and whether the message priority of the second destination port is configured to be high priority or not is further determined.
Further, with reference to the embodiment provided in the first aspect, after configuring the packet priority of the second destination port as the high priority, the method further includes: the network equipment sends a request message based on the target protocol to the other network equipment through the second destination port based on the TCP connection; and the network equipment receives a response message sent by the other network equipment based on the request message through the second destination port based on the TCP connection, and processes the response message according to the high priority.
Further, with reference to the embodiment provided in the first aspect, after configuring the packet priority of the second destination port as the high priority, the method further includes: judging whether the TCP connection is disconnected; judging whether the equipment type of the network equipment is still the client equipment; and when the TCP connection is disconnected and the equipment type of the network equipment is still the client equipment, configuring the message priority of the second destination port as a common priority. When the TCP connection between the network device as the client device and another network device is disconnected, the configuration that the message priority of the second destination port in the network device is high priority can be cancelled, so that unnecessary occupation of hardware resources is reduced, and the hardware resources are more reasonably distributed.
Further, with reference to the embodiment provided in the first aspect, after configuring that the packet priority of the first destination port corresponding to the target protocol in the network device is a high priority, the method further includes: and configuring the message priority of the first destination port as a common priority. When the target protocol needs to be closed, the configuration that the message priority of the first target port in the network equipment is high priority can be cancelled, so that unnecessary occupation of hardware resources is reduced, and the hardware resources are conveniently distributed more reasonably.
In a second aspect, an embodiment of the present application provides a packet priority configuration apparatus, which is applied to a network device, and the apparatus includes: the starting module is used for starting and operating a target protocol belonging to a TCP type protocol in the network equipment; the first configuration module is used for configuring the message priority of a first destination port corresponding to the target protocol in the network equipment to be high priority, wherein the first destination port is a port for receiving the message based on the target protocol when the equipment type of the network equipment is server-side equipment; the connection establishing module is used for establishing the TCP connection corresponding to the target protocol between the network equipment and the other network equipment; the judging module is used for judging whether the equipment type of the network equipment is the client equipment or not; a second configuration module, configured to configure, when the device type of the network device where the network device is located is the client device, a packet priority of a second destination port corresponding to the target protocol in the network device to be the high priority, where the second destination port is a port, when the network device where the network device is located is the client device, for receiving a packet based on the target protocol from another network device, and when the device type of the network device where the network device is located is the client device, the device type of the another network device is the server device.
Further, with reference to the embodiment provided by the second aspect, the manner for the determining module to determine whether the device type of the network device is the client device includes: obtaining a type of a socket created in the network device based on the TCP connection; judging whether the equipment type of the network equipment is the client equipment or not based on the type of the socket; when the type of the socket is not the service type, the device type of the network device is the client device.
Further, in combination with the embodiments provided by the second aspect above, the apparatus further includes: a communication module, configured to send a request packet based on the target protocol to the another network device through the second destination port based on the TCP connection; the communication module is further configured to receive, based on the TCP connection, a response packet sent by the other network device based on the request packet through the second destination port, and process the response packet according to the high priority.
Further, in combination with the embodiment provided by the second aspect, the connection establishing module is further configured to determine whether the TCP connection is disconnected; the judging module is further configured to judge whether the device type of the network device is still the client device; the second configuration module is further configured to configure the message priority of the second destination port as a normal priority when the TCP connection is disconnected and the device type of the network device in which the TCP connection is located is still the client device.
Further, in combination with the embodiment provided by the second aspect, the first configuration module is further configured to configure the packet priority of the first destination port to be a common priority.
In a third aspect, an embodiment of the present application provides a network device, including: the processor and the readable storage medium, wherein the readable storage medium stores executable computer instructions, and the executable computer instructions are read and executed by the processor to execute the message priority configuration method.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained from the drawings without inventive effort.
Fig. 1 is a flowchart illustrating a method for configuring a priority of a packet according to an embodiment of the present application.
Fig. 2 is a flowchart illustrating sub-steps included in step S140 in fig. 1.
Fig. 3 is a second schematic flowchart of a message priority configuration method according to an embodiment of the present application.
Fig. 4 is a third schematic flowchart of a message priority configuration method according to an embodiment of the present application.
Fig. 5 is a communication diagram of a network device according to an embodiment of the present application.
Fig. 6 is a block diagram illustrating a message priority configuration apparatus according to an embodiment of the present application.
Fig. 7 is a second block diagram of a message priority configuration apparatus according to an embodiment of the present application.
Icon: 200-message priority configuration means; 210-a start-up module; 220-a first configuration module; 230-a connection establishment module; 240-a judgment module; 250-a second configuration module; 260-communication module.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. The components of the embodiments of the present application, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present application without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures. Meanwhile, in the description of the present application, the terms "first", "second", and the like are used only for distinguishing the description, and are not to be construed as indicating or implying relative importance.
Before the inventor of the present application proposes the technical solution in the embodiment of the present application, because hardware chips of a network device have different implementation manners in terms of message priority guarantee, some chips support matching based on a TCP destination port, and ignore matching supporting a source port. Although for some specific TCP protocol messages, the matching destination port number is configured as the protocol number when initializing according to the current practice, the priority of the protocol message when the network device is used as a client device cannot be guaranteed on the chips. This may lead to a weak connection of the protocol between the network device as the client device and another network device as the server device, and once congestion occurs in the network, the protocol connection is very easy to be terminated due to no high priority guarantee, which may seriously affect the network service quality.
The main reasons for this are: when the network device is used as a client device, the received protocol packet is sent by another network device which is used as a server device, the source port number of the protocol packet is a fixed port number of the protocol packet, the destination port number is randomly allocated to the network device which is used as the client device, and the destination port number cannot be predicted before the establishment of the TCP connection, so that the protocol packet cannot be preconfigured during initialization by using the current general method. In order to solve the above problems, the current evasive measures are to make network devices using such chips unable to serve as client devices and only serve as server devices on the basis of ensuring high-priority TCP protocols, but this will greatly limit the use scenarios of such network devices, and further seriously affect the network layout.
The defects existing in the above solutions are the results obtained after the inventor has practiced and studied carefully, so the discovery process of the above problems and the solutions proposed by the following embodiments of the present application for the above problems should be the contribution of the inventor to the present application in the process of the present application.
Referring to fig. 1, fig. 1 is a schematic flow chart of a method for configuring a priority of a message according to an embodiment of the present application. The method is applied to the network equipment. The method includes steps S110 to S150. The following describes a specific flow of the method for configuring message priority in detail.
Step S110, a target protocol belonging to a TCP type protocol in the network device is enabled and operated.
The network device comprises at least one protocol of the TCP type. After receiving a starting operation for starting a protocol, the network device takes the protocol corresponding to the starting operation as a target protocol, starts and runs the target protocol, and starts the target protocol. And the target protocol corresponding to the opening operation is a TCP type protocol, and the target protocol is a protocol used by the network equipment for subsequent communication with other network equipment.
Step S120, configuring the message priority of the first destination port corresponding to the target protocol in the network device as a high priority.
Since the port numbers of the protocol packets of some TCP type protocols (i.e. the port numbers of the protocol packets received by the server side device) are fixed, after determining the target protocol, the network device may determine the first destination port corresponding to the target protocol, and then set the packet priority of the first destination port in the network device to be a high priority. And when the first destination port is the network equipment, the equipment type is server-side equipment, and the first destination port is a port for receiving the message based on the target protocol. Therefore, if the network device serves as a server-side device, when receiving a packet based on the target protocol sent by another network device through the first destination port, the network device may process the packet according to the high priority set for the packet of the first destination port, thereby ensuring the priority of the packet based on the target protocol when the network device serves as a server-side device.
Step S130, a TCP connection corresponding to the target protocol is established between the network device and another network device.
In this embodiment, after completing configuring the message priority of the first destination port in the network device, a TCP connection corresponding to the target protocol may be established between the network device and another network device, so that communication may be performed subsequently based on the TCP connection. When the TCP connection is established, a port number in the client device is randomly allocated as a second destination port number corresponding to the target protocol. Optionally, if a network device is used as a client device, the network device may establish the TCP connection with the first destination port of another network device through the second destination port.
When a TCP connection is established between two network devices, the device type of one network device is the client device, and the device type of the other network device is the server device. Generally, the device type of the network device that first initiates the TCP connection request is the client device. For example, a network device a sends a TCP connection to another network device based on a manual operation, or a network device a automatically tries to connect to another network device under an internal mechanism, and at this time, the network device a serves as the client device. The establishment process of the TCP connection is prior art and will not be described in detail herein.
Before step S140 is executed, it may be determined whether the TCP connection is successful, and if so, step S140 is executed. If not, the subsequent steps are not executed.
Step S140, determining whether the device type of the network device is a client device.
Due to the arrangement, the priority of the message based on the target protocol can be ensured only when the equipment type of the network equipment is the server-side equipment. Therefore, it is necessary to determine whether the device type of the network device is a client device to determine whether to perform the subsequent steps.
Referring to fig. 2, fig. 2 is a flowchart illustrating sub-steps included in step S140 in fig. 1. Step S140 may include substeps S141 and substep S142.
Substep S141, obtaining a type of socket created based on the TCP connection in the network device.
And a substep S142, determining whether the device type of the network device is the client device based on the type of the socket.
In this embodiment, in the process of establishing a TCP connection, the network device creates a socket (socket) corresponding to the TCP connection. The socket is divided into two types, one type is a service type and is responsible for monitoring connection; the other is the client, which is responsible for opening a connection to the server. Therefore, whether the device type of the network device is the client device can be judged based on the type of the socket corresponding to the TCP connection in the network device. When the type of the socket is not the service type, the device type of the network device is the client device. And when the type of the socket is the service type, indicating that the device type of the network device is the server-side device.
When the device type of the network device is the client device, in the embodiment of the present application, step S150 is executed, that is: and configuring the message priority of a second destination port corresponding to the target protocol in the network equipment as the high priority.
In this embodiment, after the device type of the network device is the client device and the TCP connection is established with another network device, a second destination port number randomly allocated for the TCP connection is obtained. And then setting the priority of the message of the second destination port in the network equipment as the client equipment as the high priority. The second destination port is a port used for receiving a packet based on the target protocol from another network device when the network device is used as the client device. And when the device type of the network device is the client device, the device type of the other network device is the server device. Therefore, if the network device serves as the client device, when receiving the packet based on the target protocol sent by the server device through the second destination port, the network device may process the packet according to the high priority set to the second destination port, thereby ensuring the priority of the packet based on the target protocol when the network device serves as the client device.
For a target protocol of a TCP type protocol that requires high priority guarantee, the target protocol corresponds to a fixed port number (i.e., the port number of a port used for receiving a protocol packet when the network device is used as a server-side device), and only when the network device starts and operates the target protocol, the network device is configured to give high priority to a packet based on the target protocol and having a target port number as the fixed port number. If the device type of the network device is the server-side device, after the TCP connection of the target protocol is established, the hardware configuration action in the priority aspect is not required to be performed. If the device type of the network device is the client device, after the TCP connection of the target protocol is successfully established, the port number of the local terminal of the TCP connection established with the opposite terminal through the target protocol (i.e. the port number of the port for receiving the protocol packet when the network device is used as the client device) is obtained, and then the configuration hardware gives high priority to the packet whose destination port number is the port number of the local terminal. Therefore, the problem that when the network equipment is used as TCP client equipment due to hardware, the high priority of the protocol message cannot be ensured by a mode of pre-configuring the protocol number can be solved. And the robustness of the TCP connection of the high-priority protocol when the network equipment is used as client equipment is further ensured, so that the network is more stable.
Referring to fig. 3, fig. 3 is a second schematic flow chart of a method for configuring message priority according to an embodiment of the present application. After step S150, the method may further include step S160 and step S170.
Step S160, the network device sends a request packet based on the target protocol to the another network device through the second destination port based on the TCP connection.
Step S170, the network device receives, through the second destination port, a response packet sent by the other network device based on the request packet based on the TCP connection, and processes the response packet according to the high priority.
In this embodiment, after the configuration is completed, the network device serving as the client device may send a request packet to another network device serving as a server device through the second destination port. The destination port number of the request message is a port number fixed by the destination protocol (i.e. the port number of the first destination port). And the other network equipment receives the request message at the first destination port and processes the request message according to the set high priority. Then, the other network device sends a response message to the network device through the first destination port, the response message uses the target protocol, and the destination port number of the response message is the port number of the second destination port. And after receiving the response message through the second destination port, the network equipment processes the response message according to the configured high priority.
Referring to fig. 4, fig. 4 is a third schematic flowchart of a method for configuring a message priority according to an embodiment of the present application. After step S150, the method may further include step S180, step S190, and step S210.
And step S180, judging whether the TCP connection is disconnected.
Step S190, determining whether the device type of the network device is still the client device.
When the TCP connection is disconnected and the device type of the network device is still the client device, the embodiment of the present application executes step S210, that is: and configuring the message priority of the second destination port as a common priority.
In this embodiment, if the TCP connection is not disconnected, it indicates that the network device is still communicating with another network device, and at this time, step S180 and step S190 do not need to be executed. When the TCP is disconnected, if the device type of the network device is the server device, the network device serving as the server device does not configure the message priority of the second destination port as the high priority, so that the network device serving as the server device does not need to execute step S210. The TCP connection is disconnected, which means that the network device and another network do not communicate through the TCP connection, and at this time, if the device type of the network device is the client device, the packet priority of the second destination port may be configured as a normal priority, so as to cancel configuring the packet priority of the second destination port as the high priority, thereby recovering the hardware priority configuration resource.
Referring again to fig. 4, after step S120, the method may further include step S220.
Step S220, configuring the message priority of the first destination port as a common priority.
In this embodiment, after receiving a shutdown operation for shutting down a target protocol, the packet priority of the first destination port may be configured as a normal priority, so as to cancel configuring the packet priority of the first destination port as the high priority, thereby recovering hardware priority configuration resources.
Through the arrangement, no matter the equipment type of the network equipment is the server-side equipment or the client-side equipment, the high priority of the TCP protocol message can be guaranteed, and the hardware priority configuration resources can be recycled when the TCP connection is disconnected or the target protocol is closed. By the arrangement, the network equipment can use the high-priority guarantee resource of the hardware as required, and the requirement of actual service on high priority is met.
In this embodiment, if the protocol that needs to guarantee the high-priority packet belongs to the non-TCP type protocol, at least one protocol packet that does not belong to the TCP type protocol may be configured in advance as the high priority when the network device is initialized (i.e., before step S110). For example, an ARP (Address Resolution Protocol) message may be set to have a high priority in this manner. Thus, the priority of the message based on some non-TCP type protocols can be ensured.
The following describes the message priority configuration method by way of example.
Referring to fig. 5, fig. 5 is a communication diagram of a network device according to an embodiment of the present disclosure. In a communication scenario, both network devices execute the message priority configuration method. For a protocol F belonging to the TCP type protocol that needs to be given a high priority, the protocol number (or port number, i.e., the fixed port number corresponding to the protocol F) of the protocol F is d 1. In this embodiment, when the network device is initialized, the message with the destination port number d1 is not given high priority in advance. When the protocol F function is turned on (i.e., enabled and running), the network device A, B is configured to give high priority to messages with destination port d 1. After completing configuring that the priority of the packet with the destination port d1 is high, the protocol F establishes a TCP connection between the network devices A, B, where the device type of one party is a server device and the device type of the other party is a client device. For example, the network device a serves as a client device, the network device B serves as a server device, and the network device a randomly allocates a port number to perform protocol F communication with the network device B, that is, the protocol F corresponds to the port numbers d1 and s 1. The destination port number in the protocol F message sent by the subsequent network device B to the network device a is s 1. Since the network device a is a client device, the packet with the destination port number s1 is set to a high priority.
When the TCP connection of protocol F is broken, network device a cancels the high priority of the message with destination port number s 1. When the protocol F function is turned off, the network device A, B cancels the high priority of the message with the destination port number d 1.
The method and the device can guarantee the bidirectional priority of the specific protocol message connected by the TCP under the condition that a hardware chip does not support TCP source port matching. According to the prior art, only the priority of the protocol message when the network equipment is used as the server-side equipment can be ensured, and the priority of the protocol message when the network equipment is used as the client-side equipment can also be ensured through the scheme. Different from the way that several priority messages are configured when the device is initialized in the prior art, the scheme configures high priority guarantee according to service requirements, for example, BGP (Border Gateway Protocol) is started to configure a message with a destination port number of 179 as a high priority message, and Telnet service is started to configure a message with a destination port number of 23 as a high priority message, thereby reducing unnecessary occupation of corresponding hardware resources and enabling the hardware resources to be more reasonably allocated.
Referring to fig. 6, fig. 6 is a block diagram illustrating an embodiment of a message priority configuration apparatus 200 according to the present application. The message priority configuration apparatus 200 is applied to a network device. The message priority configuration apparatus 200 may include an initiating module 210, a first configuration module 220, a connection establishing module 230, a determining module 240, and a second configuration module 250.
The starting module 210 is configured to enable and run a target protocol belonging to a TCP type protocol in a network device.
A first configuration module 220, configured to configure a message priority of a first destination port, corresponding to the target protocol, in the network device to be a high priority, where the first destination port is a port for receiving a message based on the target protocol when the device type of the network device is a server-side device.
A connection establishing module 230, configured to establish a TCP connection corresponding to the target protocol between the network device and another network device.
The determining module 240 is configured to determine whether the device type of the network device is a client device.
Optionally, the manner of determining, by the determining module 240, whether the device type of the network device is the client device includes:
obtaining a type of a socket created in the network device based on the TCP connection;
judging whether the equipment type of the network equipment is the client equipment or not based on the type of the socket;
when the type of the socket is not the service type, the device type of the network device is the client device.
A second configuration module 250, configured to configure, when the device type of the network device is the client device, a packet priority of a second destination port corresponding to the target protocol in the network device to be the high priority, where the second destination port is a port for receiving a packet based on the target protocol from another network device when the network device is the client device, and the device type of the another network device is the server device when the network device is the client device.
Referring to fig. 7, fig. 7 is a second block diagram of a message priority configuration apparatus 200 according to an embodiment of the present application. The message priority configuration apparatus 200 may further include a communication module 260.
A communication module 260, configured to send, through the second destination port, a request packet based on the target protocol to the another network device based on the TCP connection.
The communication module 260 is further configured to receive, based on the TCP connection, a response packet sent by the another network device based on the request packet through the second destination port, and process the response packet according to the high priority.
In this embodiment, the connection establishing module 230 is further configured to determine whether the TCP connection is disconnected. The determining module 240 is further configured to determine whether the device type of the network device is still the client device. The second configuration module 250 is further configured to configure the message priority of the second destination port as a normal priority when the TCP connection is disconnected and the device type of the network device in which the TCP connection is located is still the client device.
The first configuring module 220 is further configured to configure the message priority of the first destination port to be a common priority.
In this embodiment, for the specific description of the packet priority configuration apparatus 200, refer to the description of the packet priority configuration method above, which is not described herein again.
The embodiment of the present application further provides a network device, where the network device includes a processor and a readable storage medium, where the readable storage medium stores an executable computer instruction, and the executable computer instruction is read by the processor and executed to execute the packet priority configuration method.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, apparatus, or computer program product. Accordingly, embodiments of the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
Embodiments of the present application are described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
To sum up, the embodiment of the present application provides a method, an apparatus, and a network device for configuring a message priority. The method comprises the steps of firstly starting and operating a target protocol belonging to a TCP type protocol in network equipment, and then configuring a message of a first target port corresponding to the target protocol in the network equipment as a high-priority message. The first destination port is a port for receiving a packet based on the target protocol when the network device is used as a server-side device. Then, a TCP connection corresponding to the target protocol is established between the network device and another network device. And after the TCP connection is successfully established, judging whether the network equipment is used as client equipment or not. And if the network equipment is used as client equipment, configuring the message of the second destination port corresponding to the target protocol in the network equipment as the high-priority message. And the second destination port is a port used for receiving a message based on the target protocol from another network device serving as a server-side device when the network device serves as a client device. Therefore, the problem that the high priority of the protocol message cannot be guaranteed in the prior art by a mode of pre-configuring the protocol number can be solved.
Further, after the TCP connection is disconnected, the message of the second destination port in the network device serving as the client device may be configured as a normal priority message, so as to cancel the previous high priority configuration on the second destination port. When the target protocol is not needed to be used, the message of the first destination port in the network device can be configured to be the common priority message, so that the previous high-priority configuration on the first destination port can be cancelled. Through the setting, the hardware resource configuration of the message priority can be carried out according to the actual service configuration condition, and the resource waste possibly caused by the pre-configuration is reduced.
The above description is only a preferred embodiment of the present application and is not intended to limit the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (11)

1. A method for configuring message priority is applied to network equipment, and is characterized in that the method comprises the following steps:
starting and operating a target protocol belonging to a TCP type protocol in the network equipment;
configuring the message priority of a first destination port corresponding to the target protocol in the network equipment as a high priority, wherein the first destination port is a port for receiving the message based on the target protocol when the equipment type of the network equipment is server-side equipment;
establishing a TCP connection corresponding to the target protocol between the network equipment and another network equipment;
judging whether the equipment type of the network equipment is client equipment or not;
when the device type of the network device is the client device, configuring the message priority of a second destination port corresponding to the target protocol in the network device as the high priority, where the second destination port is a port used for receiving a message based on the target protocol from another network device when the network device is the client device, and where the device type of the another network device is the server device when the device type of the network device is the client device.
2. The method of claim 1, wherein the determining whether the device type of the network device is a client device comprises:
obtaining a type of socket created in the network device based on the TCP connection;
judging whether the device type of the network device is the client device or not based on the type of the socket;
when the type of the socket is not the service type, the device type of the network device is the client device.
3. The method of claim 1, wherein after configuring the packet priority of the second destination port as the high priority, the method further comprises:
the network equipment sends a request message based on the target protocol to the other network equipment through the second destination port based on the TCP connection;
and the network equipment receives a response message sent by the other network equipment based on the request message through the second destination port based on the TCP connection, and processes the response message according to the high priority.
4. The method of claim 1, wherein after configuring the packet priority of the second destination port as the high priority, the method further comprises:
judging whether the TCP connection is disconnected;
judging whether the equipment type of the network equipment is still the client equipment;
and when the TCP connection is disconnected and the equipment type of the network equipment is still the client equipment, configuring the message priority of the second destination port as a common priority.
5. The method according to claim 1, wherein after configuring the packet priority of the first destination port corresponding to the target protocol in the network device as a high priority, the method further comprises:
and configuring the message priority of the first destination port as a common priority.
6. A message priority configuration device is applied to network equipment, and is characterized in that the device comprises:
the starting module is used for starting and operating a target protocol belonging to a TCP type protocol in the network equipment;
the first configuration module is used for configuring the message priority of a first destination port corresponding to the target protocol in the network equipment to be high priority, wherein the first destination port is a port for receiving the message based on the target protocol when the equipment type of the network equipment is server-side equipment;
the connection establishing module is used for establishing the TCP connection corresponding to the target protocol between the network equipment and the other network equipment;
the judging module is used for judging whether the equipment type of the network equipment is the client equipment or not;
a second configuration module, configured to configure, when the device type of the network device where the network device is located is the client device, a packet priority of a second destination port corresponding to the target protocol in the network device to be the high priority, where the second destination port is a port, when the network device where the network device is located is the client device, for receiving a packet based on the target protocol from another network device, and when the device type of the network device where the network device is located is the client device, the device type of the another network device is the server device.
7. The apparatus of claim 6, wherein the determining module determines whether the device type of the network device is a client device by:
obtaining a type of a socket created in the network device based on the TCP connection;
judging whether the equipment type of the network equipment is the client equipment or not based on the type of the socket;
when the type of the socket is not the service type, the device type of the network device is the client device.
8. The apparatus of claim 6, further comprising:
a communication module, configured to send a request packet based on the target protocol to the another network device through the second destination port based on the TCP connection;
the communication module is further configured to receive, based on the TCP connection, a response packet sent by the other network device based on the request packet through the second destination port, and process the response packet according to the high priority.
9. The apparatus of claim 6,
the connection establishing module is further used for judging whether the TCP connection is disconnected;
the judging module is further configured to judge whether the device type of the network device is still the client device;
the second configuration module is further configured to configure the message priority of the second destination port as a normal priority when the TCP connection is disconnected and the device type of the network device in which the TCP connection is located is still the client device.
10. The apparatus of claim 6,
the first configuration module is further configured to configure the message priority of the first destination port to be a common priority.
11. A network device, comprising:
a processor and a readable storage medium storing executable computer instructions that when read and executed by the processor perform the message priority configuration method of any of claims 1-5.
CN201811151191.6A 2018-09-29 2018-09-29 Message priority configuration method, device and network equipment Active CN109286575B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811151191.6A CN109286575B (en) 2018-09-29 2018-09-29 Message priority configuration method, device and network equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811151191.6A CN109286575B (en) 2018-09-29 2018-09-29 Message priority configuration method, device and network equipment

Publications (2)

Publication Number Publication Date
CN109286575A CN109286575A (en) 2019-01-29
CN109286575B true CN109286575B (en) 2021-12-17

Family

ID=65182361

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811151191.6A Active CN109286575B (en) 2018-09-29 2018-09-29 Message priority configuration method, device and network equipment

Country Status (1)

Country Link
CN (1) CN109286575B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113873041B (en) * 2021-09-30 2024-03-01 迈普通信技术股份有限公司 Message transmission method, device, network equipment and computer readable storage medium
CN116095019B (en) * 2022-08-19 2024-03-26 荣耀终端有限公司 Route processing method, device, equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1913486A (en) * 2005-08-10 2007-02-14 中兴通讯股份有限公司 Method and device for strengthening safety of protocol message
CN103634228A (en) * 2013-11-25 2014-03-12 华为技术有限公司 Network message transmission method and equipment
CN107426113A (en) * 2017-09-13 2017-12-01 迈普通信技术股份有限公司 Message method of reseptance and the network equipment

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1913486A (en) * 2005-08-10 2007-02-14 中兴通讯股份有限公司 Method and device for strengthening safety of protocol message
CN103634228A (en) * 2013-11-25 2014-03-12 华为技术有限公司 Network message transmission method and equipment
CN107426113A (en) * 2017-09-13 2017-12-01 迈普通信技术股份有限公司 Message method of reseptance and the network equipment

Also Published As

Publication number Publication date
CN109286575A (en) 2019-01-29

Similar Documents

Publication Publication Date Title
CN112738834A (en) MESH networking network emergency management method and electronic equipment
CN112221121A (en) Application software networking acceleration method and device and storage medium
JP2005506797A (en) Method for establishing an IPOA channel based default maintenance channel
KR101139836B1 (en) Method and system for two-phase mechanism for discovering web services based management service
CN109286575B (en) Message priority configuration method, device and network equipment
CN109040295B (en) Method and device for determining abnormal disconnection, terminal and storage medium
US10148764B2 (en) Backup wide area network connection for access points and routers
CN102957623B (en) A kind of maintaining method of neighborhood of border gate protocol and equipment
JP2006129355A (en) Information processor, data transmission system, data transmission method, and program for performing the data transmission method on the information processor
CN113726581B (en) Method and device for restoring factory configuration of network equipment and network equipment
WO2017215435A1 (en) Radio-resource-control connection method, apparatus, and terminal
JP2011044955A (en) Setting change method by network manager equipment and program, control method and program of network equipment, network manager equipment, and network equipment
CN103685398A (en) Communication connection establishment method and communication system
US11128558B2 (en) Automatic routing configuration between hosts and network layer devices
CN112787893A (en) Remote diagnosis method, device, electronic equipment and storage medium
CN104378449A (en) Virtual IP realization method
CN111130886A (en) Network port switching method and device, board card and network port switching system
US10069671B2 (en) Method and apparatus for processing abnormality of application proxy client
CN112866309B (en) Communication method and device
CN112398731B (en) Method for processing message and first network equipment
CN112512134A (en) Communication tunnel establishment method, device, equipment and storage medium
CN113259468B (en) Network equipment configuration method and device
CN106936798B (en) Service authentication method and device
US20190312929A1 (en) Information synchronization method and device
CN112104506B (en) Networking method, networking device, server and readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant