CN108377671A - Handle the method and computer equipment of message - Google Patents

Handle the method and computer equipment of message Download PDF

Info

Publication number
CN108377671A
CN108377671A CN201680004271.1A CN201680004271A CN108377671A CN 108377671 A CN108377671 A CN 108377671A CN 201680004271 A CN201680004271 A CN 201680004271A CN 108377671 A CN108377671 A CN 108377671A
Authority
CN
China
Prior art keywords
message
service
network interface
interface card
port number
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.)
Granted
Application number
CN201680004271.1A
Other languages
Chinese (zh)
Other versions
CN108377671B (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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Publication of CN108377671A publication Critical patent/CN108377671A/en
Application granted granted Critical
Publication of CN108377671B publication Critical patent/CN108377671B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/30Peripheral units, e.g. input or output ports
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/64Hybrid switching systems
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/25Routing or path finding in a switch fabric
    • H04L49/253Routing or path finding in a switch fabric using establishment or release of connections between ports

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention discloses a kind of methods and computer equipment of processing message.This method includes:Obtain the first processor core mark of service binding;It is identified according to the first processor core, and the mapping relation information configured, determines corresponding first local port number of the service, wherein the mapping relation information includes the mapping relations of processor core mark and port numbers;First local port number is written to the source port number field of the message to be sent of the service;The message to be sent is sent to network interface card transmit queue.The method and computer equipment of the processing message of the embodiment of the present invention, can improve the forward efficiency of message.

Description

Handle the method and computer equipment of message Technical field
The present invention relates to information technology fields, and more particularly, to a kind of method and computer equipment for handling message.
Background technique
Present network interface card is towards intelligent development, there has been provided based on specifying the routing function of field domain in packet network head, and brings significant performance boost.
In network interface card initialization, queue (queue) number that network interface card can be specified to use, and to each queue one index.When network interface card receives message, the queue of assigned indexes is forwarded the packet to according to forwarding flow table.The field domain of general forwarding flow table, including movement (Action) field after source Internet protocol (Internet Protocol, IP) and destination IP, the masks such as source port number and destination port number and matching field, and hit.For example, Action can be with are as follows: " Direct to queue i ", wherein i is the index of queue queue.
When sending message, the port numbers of use can be the either end slogan in port range (for example, 0-65535) at client and server end.However, forwarding the item number of flow table much smaller than port numbers quantity due to being limited to medium and power consumption.Therefore, according to either end slogan, network interface card may can not be matched to corresponding list item when forwarding the packet to receiving queue, to will lead to the forward efficiency for influencing message.
Summary of the invention
The embodiment of the invention provides a kind of methods and computer equipment for handling message, can be improved the forward efficiency of message.
In a first aspect, providing a kind of method for handling message, comprising:
Obtain the first processor core mark of service binding;
It is identified according to the first processor core, and the mapping relation information of configuration, determines corresponding first local port number of the service, wherein the mapping relation information includes the mapping relations of processor core mark and port numbers;
First local port number is written to the source port number field of the message to be sent of the service;
Network interface card transmit queue is sent by the message to be sent.
The method of the processing message of the embodiment of the present invention, is bound by that will service with processor core mark, and The corresponding port numbers of the service are determined according to this, the message to be sent of the service is handled according to the port numbers, network interface card can be made to forward the message to be received of the service to corresponding network interface card queue according to the port numbers, so as to improve the forward efficiency of message.
In some possible implementations, which includes processor core mark, the mapping relations of network interface card receiving queue and port numbers.
In some possible implementations, the mapping relations of processor core mark, network interface card receiving queue and port numbers can be the mapping relations of processor core mark and network interface card receiving queue and the mapping relations of network interface card receiving queue and port numbers.
In some possible implementations, each corresponding multiple port numbers of processor core mark.
In some possible implementations, a processor core mark can correspond to multiple network interface card queues, and a network interface card queue can correspond to multiple port numbers.
In some possible implementations, first local port number is determined, comprising:
It is identified in corresponding multiple port numbers from the first processor core, selects first local port number.
In some possible implementations, this method further include:
Configure the mapping relation information.
In some possible implementations, this method further include:
The message to be received of the service is obtained from the corresponding network interface card receiving queue of first local port number, wherein the message to be received is forwarded to the corresponding network interface card receiving queue of first local port number according to the destination slogan in the message to be received by network interface card.
In some possible implementations, which includes the linking request message of client;
Before the first processor core mark of the acquisition service binding, this method further include:
The service and first processor core mark are bound.
It is bound by that will service with processor core mark, can know the corresponding processor core of service in advance, so as to service and protocol stack all corresponds on same processor core, and then raising is to the treatment effeciency of the message of service.
In some possible implementations, which includes that the link of server end receives message;
Before the first processor core mark of the acquisition service binding, this method further include:
According to the listening port number of the service and the mapping relation information, the service and first processor core mark are bound;
The linking request message of the service is obtained from the corresponding network interface card receiving queue of the listening port number.
It is bound by that will service with processor core mark, can know the corresponding processor core of service in advance, so as to service and protocol stack all corresponds on same processor core, and then raising is to the treatment effeciency of the message of service.
In some possible implementations, network interface card can E-Packet according to forwarding flow table to specified network interface card queue.
In some possible implementations, forwarding flow table can be generated according to the mapping relation information.
In some possible implementations, the message to be received of the service can be forwarded to corresponding receiving queue according to first local port number by network interface card, so as to realize effective forwarding to message.
In some possible implementations, port numbers include TCP or UDP port number.
Second aspect provides a kind of method for handling message, comprising:
According to the listening port number of service, and the mapping relation information of configuration, the service and first processor core mark are bound, wherein the mapping relation information includes the mapping relations of processor core mark and port numbers;
The message to be received of the service is obtained from the first network interface card receiving queue, wherein the first network interface card receiving queue is that first processor core identifies corresponding network interface card receiving queue.
The method of the processing message of the embodiment of the present invention, it is bound by that will service with processor core mark, on the one hand network interface card can be made to forward the packet to corresponding network interface card queue, to improve the forward efficiency of message, on the other hand service and protocol stack can all be corresponded on same processor core, to improve the treatment effeciency to the message of service.
In some possible implementations, this method further include:
The listening port number is written to the source port number field of the message to be sent of the service;
Network interface card transmit queue is sent by the message to be sent.
In some possible implementations, listening port number is UDP port number.
The third aspect provides a kind of host, the module of the method in any possible implementation including executing first aspect or first aspect, alternatively, executing the module of the method in any possible implementation of second aspect or second aspect.
Fourth aspect, provide a kind of host, the host includes processor and memory, the memory is for storing instruction, the processor is for executing the instruction, and when which executes the instruction of memory storage, the execution is so that the processor executes any possible implementation of first aspect or first aspect, alternatively, the method in any possible implementation of second aspect or second aspect.
5th aspect, provides a kind of computer equipment, comprising:
Host, first processor core for obtaining service binding identifies, it is identified according to the first processor core, and the mapping relation information of configuration, determine corresponding first local port number of the service, wherein the mapping relation information includes the mapping relations of processor core mark and port numbers, the message to be sent is sent network interface card transmit queue by the source port number field that first local port number is written to the message to be sent of the service;And
Network interface card, for sending the message to be sent in the network interface card transmit queue.
The computer equipment of the embodiment of the present invention, it is bound by that will service with processor core mark, and the corresponding port numbers of the service are determined according to this, the message to be sent of the service is handled according to the port numbers, network interface card can be made to forward the message to be received of the service to corresponding network interface card queue according to the port numbers, so as to improve the forward efficiency of message.
In some possible implementations, which includes processor core mark, the mapping relations of network interface card receiving queue and port numbers.
In some possible implementations, each corresponding multiple port numbers of processor core mark.
In some possible implementations, which is specifically used for, and identifies in corresponding multiple port numbers from the first processor core, selects first local port number.
In some possible implementations, which is also used to, and configures the mapping relation information.
In some possible implementations, the network interface card is also used to, the message to be received of the service is received, the destination slogan in the message to be received is first local port number, and the message to be received is forwarded to the corresponding network interface card receiving queue of first local port number according to the destination slogan;
The host is also used to, and obtains the message to be received from the corresponding network interface card receiving queue of first local port number.
In some possible implementations, which is client device, which includes linking request message;
The host is also used to, and the service and first processor core mark are bound.
In some possible implementations, which is server, which includes receiving message;
The host is also used to, and according to the listening port number of the service and the mapping relation information, the service and first processor core mark are bound;
The network interface card is also used to, and receives the linking request message of the service, and the destination slogan in the linking request message is the listening port number, and the message to be received is forwarded to the corresponding network interface card receiving queue of the listening port number according to the destination slogan;
The host is also used to, and obtains the linking request message from the corresponding network interface card receiving queue of the listening port number.
6th aspect, provides a kind of computer equipment, comprising:
Host, for the listening port number according to service, and the mapping relation information of configuration, the service and first processor core mark are bound, wherein, which includes the mapping relations of processor core mark and port numbers, and the message to be received of the service is obtained from the first network interface card receiving queue, wherein, which is that first processor core identifies corresponding network interface card receiving queue;
Network interface card, for receiving the message to be received, the destination slogan in the message to be received is the listening port number, and the message to be received is forwarded to the first network interface card receiving queue according to the destination slogan.
The computer equipment of the embodiment of the present invention, it is bound by that will service with processor core mark, on the one hand network interface card can be made to forward the packet to corresponding network interface card queue, to improve the forward efficiency of message, on the other hand service and protocol stack can all be corresponded on same processor core, to improve the treatment effeciency to the message of service.
In some possible implementations, which is also used to, which is written to the source port number field of the message to be sent of the service, sends network interface card transmit queue for the message to be sent;
The network interface card is also used to, and sends the message to be sent in the network interface card transmit queue.
In some possible implementations, which is server.
In some possible implementations, listening port number is UDP port number.
7th aspect, provides a kind of computer equipment, host and network interface card including the third aspect or fourth aspect.
Eighth aspect, a kind of computer-readable medium is provided, for storing computer program, which includes any possible implementation for executing first aspect or first aspect, alternatively, the instruction of the method in any possible implementation of second aspect or second aspect.
Detailed description of the invention
Fig. 1 is the schematic diagram of the computer equipment of the technical solution application of the embodiment of the present invention.
Fig. 2 is the schematic diagram of the processor core mark of the embodiment of the present invention, the mapping relations of network interface card queue and port numbers.
Fig. 3 is the schematic flow chart of the method for the processing message of one embodiment of the invention.
Fig. 4 is the schematic flow chart of the method for the processing message of another embodiment of the present invention.
Fig. 5 is the schematic flow chart of the method for the processing message of another embodiment of the invention.
Fig. 6 is the schematic flow chart of the method for the processing message of another embodiment of the invention.
Fig. 7 is the schematic flow chart of the method for the processing message of another embodiment of the invention.
Fig. 8 is the schematic flow chart of the method for the processing message of another embodiment of the invention.
Fig. 9 is the schematic block diagram of the computer equipment of the embodiment of the present invention.
Specific embodiment
Fig. 1 is the schematic diagram of the computer equipment of the technical solution application of the embodiment of the present invention.
As shown in Figure 1, computer equipment 100 may include processor 111, memory 112 and network interface card 120.
Processor 111 and memory 112 may be collectively referred to as host 110 again.Message can be sent to other equipment by network interface card 120 by host 110 (for example, application in host 110).
Processor 111 may include multiple processor cores (Core).Memory 112 may include memory and other memories.
Network interface card 120 supports more network interface card queues, can be also simply referred to as queue.Queue includes transmit queue and receiving queue.The queue of network interface card 120 can be configured at memory 112, such as in memory.Network interface card 120 can the address based on queue from obtaining message to be sent in transmit queue or the received message of network interface card be forwarded in receiving queue.
In some possible implementations, network interface card 120 can E-Packet according to the mask and matching domain of destination IP and port in packet network packet header to specified network interface card queue.
In some possible implementations, network interface card 120 can E-Packet according to forwarding flow table to specified network interface card queue.Forwarding flow table can be configured in network interface card 120, can also be configured in the accessible memory of network interface card 120.
In some possible implementations, mapping relations are configured between processor core mark (CoreID), network interface card queue and port numbers.Forwarding flow table can be generated according to the mapping relations.
Fig. 2 shows the schematic diagrames of the mapping relations of processor core mark, network interface card queue and port numbers.
As shown in Fig. 2, since port numbers quantity is relatively more, each network interface card queue and the corresponding multiple port numbers of processor core mark.This multiple port numbers is referred to as the port resource pond of network interface card queue or processor core mark.
It should be understood that the corresponding relationship between network interface card queue and processor core mark can be it is one-to-one may not be one-to-one, the embodiment of the present invention does not limit this.
It should also be understood that the embodiment of the present invention closes processor core mark, network interface card queue and the mapping of port numbers The concrete form of system is without limitation, it can specifically show as the mapping relations of a three together, can also show as two mapping relations between the two, such as, it can be processor core mark and the mapping relations of network interface card queue and the mapping relations of network interface card queue and port numbers.
In embodiments of the present invention, on the basis of above-mentioned mapping relations, service and CoreID are bound, can be determined according to binding relationship service corresponding port numbers in this way.Determining port numbers can correspond to specific network interface card queue in this manner, consequently facilitating network interface card E-Packets, can improve the forward efficiency of message.
It should be understood that, service in the embodiment of the present invention can be transmission control protocol (Transmission Control Protocol, TCP)/User Datagram Protocol (User Data Protocol, UDP it) services, port numbers can be TCP/UDP port numbers, but the embodiment of the present invention does not limit this.
Fig. 3 shows the schematic flow chart of the method 300 of the processing message of the embodiment of the present invention.This method 300 can be executed by host.The host can be the host in client device, the host being also possible in server.For client, the message to be sent of service can be the data message after linking request message and link foundation;For server end, the message to be sent of service can be the data message received after message and link foundation.Wherein, linking request message can be the message for requesting to establish communication connection with server end of client transmission.Receiving message can be the message for communicating to connect with client foundation that server end is sent to client.
310, obtain the first processor core mark of service binding.
In embodiments of the present invention, service and CoreID are bound.In this way, subsequent can determine according to the CoreID of binding services corresponding port numbers, and then handle the message of the service.
Optionally, for client, the service and CoreID can be bound before creation services associated links category socket (Socket);It, can be before or after creating the service associated monitorings class socket by the service and CoreID binding for server.
320, it is identified according to the first processor core, determines corresponding first local port number of the service.
It is identified according to the first processor core of service binding, can choose the corresponding local port number of the service (being expressed as the first local port number).First local port number is also the port numbers of the associated Socket of the service, i.e., the subsequent packet of the Socket can be transmitted according to first local port number.
Optionally, in an embodiment of the invention, it can be identified according to the first processor core, and the mapping relation information of configuration, determine first local port number.
According to the mapping relation information of configuration, it can choose the first processor core and identify corresponding port numbers, as first local port number.
Optionally, which can be pre-configured in memory.The mapping relation information can be obtained by the application in host.
Optionally, which may include the mapping relations of processor core mark and port numbers.
Optionally, which may include processor core mark, the mapping relations of network interface card receiving queue and port numbers.
Optionally, which may include processor core mark and the mapping relations of network interface card receiving queue and the mapping relations of network interface card receiving queue and port numbers.
Optionally, each processor core mark can correspond to multiple port numbers.
For example, the mapping relation information may include mapping relations as shown in Figure 2.
It should be understood that the embodiment of the present invention is not defined the concrete form of the mapping relation information and content, that is to say, that the mapping relation information can also use other mapping relations.
Optionally, in the case where each processor core identifies corresponding multiple port numbers, it can be identified in corresponding multiple port numbers from the first processor core, select first local port number.
330, the message to be sent of the service is handled according to first local port number.
First local port number is the destination slogan of the source port number of the message to be sent of the service and the message to be received of the subsequent service.
Specifically, when sending the message to be sent, which can be written the source port number field of the message to be sent by host;And network interface card transmit queue is sent by the message to be sent.Network interface card again sends the message to be sent in the network interface card transmit queue.
Optionally, in the message to be received of the receipt of subsequent service, host can obtain the message to be received of the service from the corresponding network interface card receiving queue of first local port number, wherein, which is forwarded to the corresponding network interface card receiving queue of first local port number according to the destination slogan in the message to be received by network interface card.
Specifically, the source port number of the message to be sent of the service is first local port number, correspondingly, the destination slogan in the message to be received of the service is just first local port number.In this way, the message to be received can be forwarded to the corresponding network interface card receiving queue of first local port number according to the destination slogan in the message to be received by network interface card, and host can obtain the message to be received of the service from the corresponding network interface card receiving queue of first local port number.
Optionally, the forwarding flow table of network interface card can be configured based on above-mentioned mapping relation information.For example, the corresponding network interface card queue of multiple port numbers.According to the range of port numbers, the mask and matching domain of forwarding flow table item can be calculated.For example, if some range of port number are as follows: 1024-2047;Then wherein it is segmented Mask are as follows: 0100-0000-0000 (1024) -> 0111-1111-1111 (2047).Therefore the matching domain that corresponding forwarding flow table item can be calculated is 0100-0000-0000, mask 0111-1111-1111.
Optionally, complete matched list item can also be set, when all list items all mismatch in forwarding flow table, is finally matched by this list item.
The method of the processing message of the embodiment of the present invention, it is bound by that will service with processor core mark, and the corresponding port numbers of the service are determined according to this, the message to be sent of the service is handled according to the port numbers, network interface card can be made to forward the message to be received of the service to corresponding network interface card queue according to the port numbers, so as to improve the forward efficiency of message.
The process flow at client and server end is described in detail separately below.
Optionally, in an embodiment of the invention, for client, which includes the linking request message of client.
In this case, as shown in figure 4, before step 310, this method 300 can also include:
302, service and first processor core mark are bound.
Specifically, client when needing chaining service, will create the associated links category socket of the service, need to select a port number.In embodiments of the present invention, by one CoreID of the service binding, that is, bind the processor core (Core) of the service and the process for running the service.It in client, is not limited in the selection of Core, it can random selection Core.It is then possible to the corresponding local port number of the service, i.e. Socket port numbers be determined according to the CoreID of service binding, further according to the corresponding local port number transmissions links request message of the service.
It is bound by that will service with processor core mark, can know the corresponding processor core of service in advance, so as to service and protocol stack all corresponds on same processor core, and then raising is to the treatment effeciency of the message of service.
The process flow of client is described from the angle of software module below.It should be understood that the process of software module is process in logic, these processes can actually be executed by the processor in host, be described from the angle of software module only to facilitate understanding the technical solution of the embodiment of the present invention.
Fig. 5 is the schematic diagram of the process flow of the client shown in the angle from software module.
501, using creation links category Socket.
Using being referred to as application program.Applying in client is needing to obtain service, that is, when needing with application communication in server, needs to create links category Socket.For example, using the application programming interface (Application Programming Interface, API) that call operation system provides, the Socket of creation TCP link.
502, TCP/UDP protocol stack modules judge whether service binds Core.
TCP/UDP protocol stack module is the module for carrying out the processing of TCP/UDP protocol stack.It should be understood that the process or thread due to applying, applying are all corresponding with service, service is also possible to apply with Core binding, process apply or thread and Core binding.For example, the CoreID that TCP/UDP protocol stack module is bound by the API query service that operating system provides.If inquiring corresponding CoreID, 505 are thened follow the steps, it is no to then follow the steps 503.
503, TCP/UDP protocol stack modules feed back to apply and need to bind Core.
For example, TCP/UDP protocol stack module, feeds back to application by error message and needs to bind a Core.
504, using by one Core of service binding.
505, TCP/UDP protocol stack modules, notice Flow-Director management module obtain port numbers.
In embodiments of the present invention, shunting (Flow-Director) management module can be used for configuring network interface card queue, mapping relation information etc..
For example, TCP/UDP protocol stack module informs the CoreID of Flow-Director management module service binding, notice Flow-Director management module obtains Socket port numbers, that is, services corresponding port numbers.
506, Flow-Director management modules obtain port numbers according to binding CoreID and mapping relation information.
For example, mapping relations of the Flow-Director management module according to binding CoreID and preset CoreID, network interface card queue and port numbers, obtain Socket port numbers.
507, TCP/UDP protocol stack modules handle link request message according to the port numbers.
For example, the source port number field of the linking request message is written in the port numbers by TCP/UDP protocol stack module, and network interface card transmit queue is sent by the linking request message.
Subsequent server is when sending the message of the service, by port numbers port numbers as a purpose, in this way, the network interface card of client can forward the packet to corresponding receiving queue according to the destination slogan, so as to realize effective forwarding to message.
Optionally, in another embodiment, for server end, which includes that the link of server end receives message.
In this case, as shown in fig. 6, before step 310, this method 300 can also include:
304, according to the listening port number of service, the service and first processor core mark are bound;
305, the linking request report of the service is obtained from the corresponding network interface card receiving queue of the listening port number Text.
Specifically, server end when monitoring linking request, needs to create the associated monitoring class Socket of service, wherein listening port number is port numbers known to client.That is, the listening port number is destination slogan when client sends link request message.Server end binds the service and CoreID according to the listening port number.For example, the service and CoreID are bound according to the listening port number and the mapping relation information of configuration.
It is bound by that will service with processor core mark, can know the corresponding processor core of service in advance, so as to service and protocol stack all corresponds on same processor core, and then raising is to the treatment effeciency of the message of service.
In addition, server end can also know the corresponding network interface card receiving queue of linking request message according to the listening port number.The network interface card of server end is in the linking request message for receiving client, and according to the destination slogan in linking request message, i.e. linking request message is forwarded to corresponding network interface card receiving queue by the listening port number.The host of server end can obtain the linking request message from the corresponding network interface card receiving queue of the listening port number.
The linking request message is being got, after receiving linking request, next server end can be sent to client receives message and data message.At this moment, server end is it needs to be determined that next transmission port number, i.e., above-mentioned first local port number.Server end can determine first local port number according to the CoreID of the service binding, receive message and subsequent data message further according to the first local port number transmissions links.
Fig. 7 is the schematic diagram of the process flow of the server end shown in the angle from software module.
701, class Socket is monitored using creation.
Using the API that call operation system provides, class Socket is monitored in creation.
702, TCP/UDP protocol stack modules obtain the CoreID that service should be bound to Flow-Director management module.
TCP/UDP protocol stack module transmits listening port number to Flow-Director management module, obtains the CoreID that the service should be bound.
703, Flow-Director management modules obtain corresponding CoreID according to listening port number.
For example, Flow-Director management module according to listening port number and preset mapping relation information, obtains corresponding CoreID, i.e. the CoreID that should bind of the service, and feed back to TCP/UDP protocol stack module.
704, TCP/UDP protocol stack modules judge whether service binds Core.
For example, whether the CoreID for the API query service binding that TCP/UDP protocol stack module is provided by operating system is that empty (not binding) executes 705, otherwise execute 706 if it is sky.
The Core that 705, TCP/UDP protocol stack modules feed back service binding to Flow-Director management module.
The CoreID that should be bound is fed back to application by 706, TCP/UDP protocol stack modules.
Using being bound or exited current process.
707, TCP/UDP protocol stack modules notify Flow-director management module to obtain data transmission terminal slogan.
When there is client active link [HTML] server end, after which receives linking request, TCP/UDP protocol stack module notifies the CoreID of Flow-director management module service binding, to obtain data transmission terminal slogan.
708, Flow-director management modules return to the corresponding port numbers of the CoreID according to the CoreID and preset mapping relation information of binding.
709, TCP/UDP protocol stack modules handle the message of the service according to the port numbers.
TCP/UDP protocol stack module is handled according to the port numbers receives message and subsequent data message.For example, the source port number field of message is written in the port numbers by TCP/UDP protocol stack module, and network interface card transmit queue is sent by message.
Subsequent client is when sending the message of the service to server end, by port numbers port numbers as a purpose, in this way, the network interface card of server end can forward the packet to corresponding receiving queue according to the destination slogan, so as to realize effective forwarding to message.
It should be understood that in server end, such as udp protocol, can not also reselection transmission port number, i.e., above-mentioned first local port number, but use listening port number always.Under be described faced with this situation.
Fig. 8 shows the schematic flow chart of the method 800 of the processing message of another embodiment of the present invention.This method 800 can be executed by host.The host can be the host in server.
810, according to the listening port number of service, the service and first processor core mark are bound.
Listening port number is port numbers known to client.Server end can bind the service and CoreID according to the listening port number.
It is alternatively possible to according to the listening port number, and the mapping relation information of configuration, the service and first processor core mark are bound.Explanation about the mapping relation information may refer to previous embodiment, for sake of simplicity, details are not described herein.
820, the message to be received of the service is obtained from the first network interface card receiving queue, wherein the first network interface card receiving queue is that first processor core identifies corresponding network interface card receiving queue.
It will service with after processor core mark binding, server end can know the message to be received of the service, the i.e. corresponding network interface card receiving queue of request message of client transmission.The network interface card of server end is in the request message for receiving client, and according to the destination slogan in request message, i.e. request message is forwarded to corresponding network interface card receiving queue, i.e., above-mentioned first network interface card receiving queue by the listening port number.The host of server end can obtain the message to be received from the first network interface card receiving queue.
Optionally, server end can also send the message to be sent of the service according to the listening port number, i.e., the response message of the service is sent to client.Specifically, which can be written the source port number field of the message to be sent of the service by the host of server end;Network interface card transmit queue is sent by the message to be sent.Network interface card again sends the message to be sent in the network interface card transmit queue.
The method of the processing message of the embodiment of the present invention, it is bound by that will service with processor core mark, on the one hand network interface card can be made to forward the packet to corresponding network interface card queue, to improve the forward efficiency of message, on the other hand service and protocol stack can all be corresponded on same processor core, to improve the treatment effeciency to the message of service.
It should be understood that, in various embodiments of the present invention, magnitude of the sequence numbers of the above procedures are not meant that the order of the execution order, and the execution sequence of each process should be determined by its function and internal logic, and the implementation process of the embodiments of the invention shall not be constituted with any limitation.
It should also be understood that the specific example in the embodiment of the present invention is intended merely to that those skilled in the art is helped to more fully understand the embodiment of the present invention, the range for the embodiment that is not intended to limit the present invention.
The method that processing message according to an embodiment of the present invention has been described in detail above, is described below computer equipment according to an embodiment of the present invention.
Fig. 9 shows the schematic block diagram of the computer equipment 900 of the embodiment of the present invention.
As shown in figure 9, the computer equipment 900 may include host 910 and network interface card 920.
Host 910, first processor core for obtaining service binding identifies, and the mapping relation information of configuration, it is identified according to the first processor core, determine corresponding first local port number of the service, wherein the mapping relation information includes the mapping relations of processor core mark and port numbers, the message to be sent is sent network interface card transmit queue by the source port number field that first local port number is written to the message to be sent of the service.
Network interface card 920, for sending the message to be sent in the network interface card transmit queue.
The computer equipment of the embodiment of the present invention is bound by that will service with processor core mark, and according to this It determines the corresponding port numbers of the service, the message to be sent of the service is handled according to the port numbers, network interface card can be made to forward the message to be received of the service to corresponding network interface card queue according to the port numbers, so as to improve the forward efficiency of message.
Optionally, in an embodiment of the invention, which includes processor core mark, the mapping relations of network interface card receiving queue and port numbers.
Optionally, in an embodiment of the invention, each corresponding multiple port numbers of processor core mark.
Optionally, in an embodiment of the invention, which is specifically used for, and identifies in corresponding multiple port numbers from the first processor core, selects first local port number.
Optionally, in an embodiment of the invention, which is also used to, and configures the mapping relation information.
Optionally, in an embodiment of the invention, the network interface card 920 is also used to, receive the message to be received of the service, destination slogan in the message to be received is first local port number, and the message to be received is forwarded to the corresponding network interface card receiving queue of first local port number according to the destination slogan;
The host 910 is also used to, and obtains the message to be received from the corresponding network interface card receiving queue of first local port number.
Optionally, in an embodiment of the invention, which is client device, which includes linking request message;
The host 910 is also used to, and the service and first processor core mark are bound.
Optionally, in an embodiment of the invention, which is server, which includes receiving message;
The host 910 is also used to, and according to the listening port number of the service and the mapping relation information, the service and first processor core mark are bound;
The network interface card 920 is also used to, and receives the linking request message of the service, and the destination slogan in the linking request message is the listening port number, and the message to be received is forwarded to the corresponding network interface card receiving queue of the listening port number according to the destination slogan;
The host 910 is also used to, and obtains the linking request message from the corresponding network interface card receiving queue of the listening port number.
In another embodiment, host 910, for the listening port number according to service, and the mapping relation information of configuration, the service and first processor core mark are bound, wherein, the mapping relation information includes the mapping relations of processor core mark and port numbers, the message to be received of the service is obtained from the first network interface card receiving queue, wherein the first network interface card receiving queue is first processor core mark pair The network interface card receiving queue answered;
Network interface card 920, for receiving the message to be received, the destination slogan in the message to be received is the listening port number, and the message to be received is forwarded to the first network interface card receiving queue according to the destination slogan.
The computer equipment of the embodiment of the present invention, it is bound by that will service with processor core mark, on the one hand network interface card can be made to forward the packet to corresponding network interface card queue, to improve the forward efficiency of message, on the other hand service and protocol stack can all be corresponded on same processor core, to improve the treatment effeciency to the message of service.
Optionally, which is also used to, which is written to the source port number field of the message to be sent of the service, sends network interface card transmit queue for the message to be sent;
The network interface card 920 is also used to, and sends the message to be sent in the network interface card transmit queue.
It should be understood that the computer equipment 900 of the embodiment of the present invention, host 910 and network interface card 920 can execute the corresponding process in aforementioned embodiment of the present invention method, for sake of simplicity, details are not described herein.
It should be understood that host 910 may include processor and memory.Memory is for storing program, and processor is for executing program, for executing the method in the aforementioned embodiment of the present invention.
It should be understood that in embodiments of the present invention, term "and/or" is only a kind of incidence relation for describing affiliated partner, indicate may exist three kinds of relationships.For example, A and/or B, can indicate: individualism A exists simultaneously A and B, these three situations of individualism B.In addition, character "/" herein, typicallys represent the relationship that forward-backward correlation object is a kind of "or".
Those of ordinary skill in the art may be aware that, unit and algorithm steps described in conjunction with the examples disclosed in the embodiments of the present disclosure, it can be realized with electronic hardware, computer software, or a combination of the two, in order to clearly illustrate the interchangeability of hardware and software, each exemplary composition and step are generally described according to function in the above description.These functions are implemented in hardware or software actually, the specific application and design constraint depending on technical solution.Professional technician can use different methods to achieve the described function each specific application, but such implementation should not be considered as beyond the scope of the present invention.
It is apparent to those skilled in the art that for convenience of description and succinctly, system, the specific work process of device and unit of foregoing description can refer to corresponding processes in the foregoing method embodiment, details are not described herein.
In several embodiments provided herein, it should be understood that disclosed systems, devices and methods may be implemented in other ways.For example, Installation practice described above is only to show Meaning property, for example, the division of the unit, only a kind of logical function partition, there may be another division manner in actual implementation, such as multiple units or components can be combined or can be integrated into another system, or some features can be ignored or not executed.In addition, shown or discussed mutual coupling, direct-coupling or communication connection can be through some interfaces, the indirect coupling or communication connection of device or unit, be also possible to electricity, the connection of mechanical or other forms.
The unit as illustrated by the separation member may or may not be physically separated, and component shown as a unit may or may not be physical unit, it can and it is in one place, or may be distributed over multiple network units.It can select some or all of unit therein according to the actual needs to realize the purpose of the embodiment of the present invention.
In addition, the functional units in various embodiments of the present invention may be integrated into one processing unit, it is also possible to each unit and physically exists alone, is also possible to two or more units and is integrated in one unit.Above-mentioned integrated unit both can take the form of hardware realization, can also realize in the form of software functional units.
If the integrated unit is realized in the form of SFU software functional unit and when sold or used as an independent product, can store in a computer readable storage medium.Based on this understanding, technical solution of the present invention substantially the part that contributes to existing technology in other words, or all or part of the technical solution can be embodied in the form of software products, the computer software product is stored in a storage medium, it uses including some instructions so that a computer equipment (can be personal computer, server or the network equipment etc.) it performs all or part of the steps of the method described in the various embodiments of the present invention.And storage medium above-mentioned includes: USB flash disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), the various media that can store program code such as magnetic or disk.
The above description is merely a specific embodiment, but scope of protection of the present invention is not limited thereto.

Claims (18)

  1. A method of processing message characterized by comprising
    Obtain the first processor core mark of service binding;
    It is identified according to the first processor core, and the mapping relation information of configuration, determines corresponding first local port number of the service, wherein the mapping relation information includes the mapping relations of processor core mark and port numbers;
    First local port number is written to the source port number field of the message to be sent of the service;
    Network interface card transmit queue is sent by the message to be sent.
  2. The method according to claim 1, wherein the mapping relation information includes processor core mark, the mapping relations of network interface card receiving queue and port numbers.
  3. Method according to claim 1 or 2, which is characterized in that each corresponding multiple port numbers of processor core mark.
  4. According to the method described in claim 3, it is characterized in that, the determination first local port number, comprising:
    It is identified in corresponding multiple port numbers from the first processor core, selects first local port number.
  5. Method according to claim 1 to 4, which is characterized in that the method also includes:
    The message to be received of the service is obtained from the corresponding network interface card receiving queue of first local port number, wherein, the message to be received is forwarded to the corresponding network interface card receiving queue of first local port number according to the destination slogan in the message to be received by network interface card.
  6. The method according to any one of claims 1 to 5, which is characterized in that the message to be sent includes the linking request message of client;
    Before the first processor core mark for obtaining service binding, the method also includes:
    The service and first processor core mark are bound.
  7. The method according to any one of claims 1 to 5, which is characterized in that the message to be sent includes that the link of server end receives message;
    Before the first processor core mark for obtaining service binding, the method also includes:
    According to the listening port number of the service and the mapping relation information, the service and first processor core mark are bound;
    The linking request report of the service is obtained from the corresponding network interface card receiving queue of the listening port number Text.
  8. A method of processing message characterized by comprising
    According to the listening port number of service, and the mapping relation information of configuration, the service and first processor core mark are bound, wherein the mapping relation information includes the mapping relations of processor core mark and port numbers;
    The message to be received of the service is obtained from the first network interface card receiving queue, wherein the first network interface card receiving queue is that first processor core identifies corresponding network interface card receiving queue.
  9. According to the method described in claim 8, it is characterized in that, the method also includes:
    The listening port number is written to the source port number field of the message to be sent of the service;
    Network interface card transmit queue is sent by the message to be sent.
  10. A kind of computer equipment characterized by comprising
    Host, first processor core for obtaining service binding identifies, it is identified according to the first processor core, and the mapping relation information of configuration, determine corresponding first local port number of the service, wherein the mapping relation information includes the mapping relations of processor core mark and port numbers, the message to be sent is sent network interface card transmit queue by the source port number field that first local port number is written to the message to be sent of the service;And
    Network interface card, for sending the message to be sent in the network interface card transmit queue.
  11. Computer equipment according to claim 10, which is characterized in that the mapping relation information includes processor core mark, the mapping relations of network interface card receiving queue and port numbers.
  12. Computer equipment described in 0 or 11 according to claim 1, which is characterized in that each corresponding multiple port numbers of processor core mark.
  13. Computer equipment according to claim 12, which is characterized in that the host is specifically used for, and identifies in corresponding multiple port numbers from the first processor core, selects first local port number.
  14. Computer equipment described in any one of 0 to 13 according to claim 1, it is characterized in that, the network interface card is also used to, receive the message to be received of the service, destination slogan in the message to be received is first local port number, and the message to be received is forwarded to the corresponding network interface card receiving queue of first local port number according to the destination slogan;
    The host is also used to, and obtains the message to be received from the corresponding network interface card receiving queue of first local port number.
  15. Computer equipment described in any one of 0 to 14 according to claim 1, which is characterized in that The computer equipment is client device, and the message to be sent includes linking request message;
    The host is also used to, and the service and first processor core mark are bound.
  16. Computer equipment described in any one of 0 to 14 according to claim 1, which is characterized in that the computer equipment is server, and the message to be sent includes receiving message;
    The host is also used to, and according to the listening port number of the service and the mapping relation information, the service and first processor core mark are bound;
    The network interface card is also used to, receive the linking request message of the service, destination slogan in the linking request message is the listening port number, and the message to be received is forwarded to the corresponding network interface card receiving queue of the listening port number according to the destination slogan;
    The host is also used to, and obtains the linking request message from the corresponding network interface card receiving queue of the listening port number.
  17. A kind of computer equipment characterized by comprising
    Host, for the listening port number according to service, and the mapping relation information of configuration, the service and first processor core mark are bound, wherein, the mapping relation information includes the mapping relations of processor core mark and port numbers, and the message to be received of the service is obtained from the first network interface card receiving queue, wherein, the first network interface card receiving queue is that first processor core identifies corresponding network interface card receiving queue;
    Network interface card, for receiving the message to be received, the destination slogan in the message to be received is the listening port number, and the message to be received is forwarded to the first network interface card receiving queue according to the destination slogan.
  18. Computer equipment according to claim 17, which is characterized in that the host is also used to, and the listening port number is written to the source port number field of the message to be sent of the service, sends network interface card transmit queue for the message to be sent;
    The network interface card is also used to, and sends the message to be sent in the network interface card transmit queue.
CN201680004271.1A 2016-11-28 2016-11-28 Method and computer equipment for processing message Active CN108377671B (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2016/107521 WO2018094743A1 (en) 2016-11-28 2016-11-28 Method for processing packet, and computer device

Publications (2)

Publication Number Publication Date
CN108377671A true CN108377671A (en) 2018-08-07
CN108377671B CN108377671B (en) 2020-11-20

Family

ID=62194612

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201680004271.1A Active CN108377671B (en) 2016-11-28 2016-11-28 Method and computer equipment for processing message

Country Status (2)

Country Link
CN (1) CN108377671B (en)
WO (1) WO2018094743A1 (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110768999A (en) * 2019-10-31 2020-02-07 杭州迪普科技股份有限公司 Method and device for detecting illegal external connection of equipment
CN111917735A (en) * 2020-07-12 2020-11-10 中信银行股份有限公司 Communication message generation and processing method and device and electronic equipment
CN114448916A (en) * 2021-12-24 2022-05-06 锐捷网络股份有限公司 TIPC message processing method, device, equipment and storage medium
CN114979286A (en) * 2022-05-11 2022-08-30 咪咕文化科技有限公司 Access control method, device and equipment for container service and computer storage medium
CN115037708A (en) * 2022-08-10 2022-09-09 深圳星云智联科技有限公司 Message processing method, system, device and computer readable storage medium
CN115118685A (en) * 2022-08-30 2022-09-27 无锡沐创集成电路设计有限公司 Data packet processing method, device, system, electronic device and medium
CN116055586A (en) * 2022-08-15 2023-05-02 荣耀终端有限公司 Fragment message matching method, router and storage medium

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111049750B (en) * 2019-12-05 2022-12-09 东软集团股份有限公司 Message forwarding method, system and equipment
CN111756649A (en) * 2020-05-29 2020-10-09 浪潮电子信息产业股份有限公司 Data transmission method, device, equipment and computer readable storage medium
CN114205185B (en) * 2020-09-16 2023-03-24 厦门网宿有限公司 Proxy method and device for control message
CN112162901A (en) * 2020-09-21 2021-01-01 东软集团股份有限公司 Method, system, storage medium and electronic device for determining CPU utilization rate
CN113938400B (en) * 2021-08-27 2023-06-27 曙光网络科技有限公司 Method, apparatus and storage medium for managing and maintaining flow table
CN114978953B (en) * 2022-07-27 2022-10-21 北京立华莱康平台科技有限公司 Network card identification method and device and computer readable medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101626324A (en) * 2009-08-19 2010-01-13 杭州华三通信技术有限公司 Forwarding path detection method and forwarding path detection device
CN102483707A (en) * 2009-06-22 2012-05-30 思杰系统有限公司 Systems and methods for retaining source ip in a load balancing mutli-core environment
CN102549984A (en) * 2009-05-05 2012-07-04 思杰系统有限公司 Systems and methods for packet steering in a multi-core architecture
CN103841018A (en) * 2012-11-26 2014-06-04 华为技术有限公司 Content centric network multiport forwarding method and router
US20140204954A1 (en) * 2013-01-22 2014-07-24 Verax Technology Holdings, Inc. Communications gateway for transmitting and receiving information associated with at least one service class
CN105991473A (en) * 2015-03-30 2016-10-05 杭州迪普科技有限公司 Data stream forwarding method and data stream forwarding device

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090097492A1 (en) * 2007-10-12 2009-04-16 Telefonaktiebolaget Lm Ericsson (Publ) Support of triple play services in user devices
CN101299773A (en) * 2008-06-02 2008-11-05 华为技术有限公司 Method, processor and system for implementing network address conversion

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102549984A (en) * 2009-05-05 2012-07-04 思杰系统有限公司 Systems and methods for packet steering in a multi-core architecture
CN102483707A (en) * 2009-06-22 2012-05-30 思杰系统有限公司 Systems and methods for retaining source ip in a load balancing mutli-core environment
CN101626324A (en) * 2009-08-19 2010-01-13 杭州华三通信技术有限公司 Forwarding path detection method and forwarding path detection device
CN103841018A (en) * 2012-11-26 2014-06-04 华为技术有限公司 Content centric network multiport forwarding method and router
US20140204954A1 (en) * 2013-01-22 2014-07-24 Verax Technology Holdings, Inc. Communications gateway for transmitting and receiving information associated with at least one service class
CN105991473A (en) * 2015-03-30 2016-10-05 杭州迪普科技有限公司 Data stream forwarding method and data stream forwarding device

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110768999A (en) * 2019-10-31 2020-02-07 杭州迪普科技股份有限公司 Method and device for detecting illegal external connection of equipment
CN111917735A (en) * 2020-07-12 2020-11-10 中信银行股份有限公司 Communication message generation and processing method and device and electronic equipment
CN114448916A (en) * 2021-12-24 2022-05-06 锐捷网络股份有限公司 TIPC message processing method, device, equipment and storage medium
CN114979286A (en) * 2022-05-11 2022-08-30 咪咕文化科技有限公司 Access control method, device and equipment for container service and computer storage medium
CN114979286B (en) * 2022-05-11 2023-09-19 咪咕文化科技有限公司 Access control method, device, equipment and computer storage medium for container service
CN115037708A (en) * 2022-08-10 2022-09-09 深圳星云智联科技有限公司 Message processing method, system, device and computer readable storage medium
CN115037708B (en) * 2022-08-10 2022-11-18 深圳星云智联科技有限公司 Message processing method, system, device and computer readable storage medium
CN116055586A (en) * 2022-08-15 2023-05-02 荣耀终端有限公司 Fragment message matching method, router and storage medium
CN116055586B (en) * 2022-08-15 2023-09-01 荣耀终端有限公司 Fragment message matching method, router and storage medium
CN115118685A (en) * 2022-08-30 2022-09-27 无锡沐创集成电路设计有限公司 Data packet processing method, device, system, electronic device and medium
CN115118685B (en) * 2022-08-30 2022-11-25 无锡沐创集成电路设计有限公司 Data packet processing method, device, system, electronic device and medium

Also Published As

Publication number Publication date
WO2018094743A1 (en) 2018-05-31
CN108377671B (en) 2020-11-20

Similar Documents

Publication Publication Date Title
CN108377671A (en) Handle the method and computer equipment of message
US10868767B2 (en) Data transmission method and apparatus in optoelectronic hybrid network
CN110266713A (en) Intranet and extranet communication means, device, system and proxy server and storage medium
CN105553977B (en) Processing, sending method and the device of request message
EP3217609B1 (en) Data transmission method and system
US10127067B2 (en) Method and computing device for selecting protocol stack for virtual machines
CN101848235B (en) Real-time multimedia data P2P transmission scheme for supporting NAT traversal
JP2017520214A (en) Method, apparatus and system for flow entry configuration
CN109479028A (en) Network interface card calculates equipment and data package processing method
CN105915658A (en) Data calling method for acquiring client IP address and data transmission method
CN104301249A (en) Method and device for issuing software defined network (SDN) flow table
CN110120897A (en) Link detection method, apparatus, electronic equipment and machine readable storage medium
CN101355492A (en) Routing method and system for access protocol of simple objects as well as relevant equipment
CN102315918B (en) Method and device for intercommunicating TCP (Transmission Control Protocol) connection with SCTP (Stream Control Transmission Protocol) connection
CN107786448B (en) Method and device for establishing forwarding path of service flow
CN106161249B (en) The processing method and processing device of PPPoE message
KR20160113671A (en) Data packet processing method and device based on parallel protocol stack instances
CN104780106B (en) More example implementation methods and device
CN103944875A (en) Data exchanging method and data exchanging system
CN104468645A (en) Control method, electronic equipment, and information transmission method and device
US9455911B1 (en) In-band centralized control with connection-oriented control protocols
CN103368841A (en) Message forwarding method and device thereof
US20150350138A1 (en) Controller, message delivery system, message delivery method, and program
CN108781215A (en) Network service implementing method, service controller and communication system
CN110247998A (en) A kind of IPv4/IPv6 data transmission processing method and system

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