CN101789895A - Method and device for sending/receiving data packets - Google Patents

Method and device for sending/receiving data packets Download PDF

Info

Publication number
CN101789895A
CN101789895A CN200910004310A CN200910004310A CN101789895A CN 101789895 A CN101789895 A CN 101789895A CN 200910004310 A CN200910004310 A CN 200910004310A CN 200910004310 A CN200910004310 A CN 200910004310A CN 101789895 A CN101789895 A CN 101789895A
Authority
CN
China
Prior art keywords
message
communication
intermodule
token
communication example
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
CN200910004310A
Other languages
Chinese (zh)
Other versions
CN101789895B (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
Priority to CN200910004310XA priority Critical patent/CN101789895B/en
Publication of CN101789895A publication Critical patent/CN101789895A/en
Application granted granted Critical
Publication of CN101789895B publication Critical patent/CN101789895B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention provides a method and a device for sending/receiving data packets, belonging to the technical field of communication. The method comprises the following steps: mapping a communication example in each module to a communication channel; requesting packet tokens; distributing the packet tokens for the packets in the communication example in each module according to the data volume of the packets need to be sent by the communication example in each module; and sending/receiving the packets of the distributed packet tokens in the communication example in each module. The embodiment has the benefits that as the distribution of the packet tokens is adopted and the control of sending and receiving of the packets is carried out by taking the communication example in each module as the particle size, the embodiment can overcome the problem of being incapable of realizing congestion awareness when scheduling based on the component-level particle size, further balance loads of all the communication channels and save the unnecessary communication cost to the maximum extent.

Description

A kind of method of transmission/receiving data packets and device
Technical field
The present invention in particular to the communication technology between the networking products that carry out the data message transmitting-receiving, is a kind of method and device of transmission/receiving data packets relevant for communication technical field specifically.
Background technology
Mostly existing network service is to adopt the socket data message to carry out.Socket briefly is exactly a kind of agreement of two sides of communication, finishes communication process with the correlation function in the socket.When application layer was carried out data communication by transport layer, TCP and UDP can run into the problem that concurrent service is provided for a plurality of program process simultaneously.A plurality of TCP connect or a plurality of program process may need by same Transmission Control Protocol port transmission data.In order to distinguish different program process and to be connected, many computer-operated device provide the interface that is called socket (Socket) alternately for application program and ICP/IP protocol.
Distinguish between the different application process network service be connected, mainly contain 3 parameters: the port numbers of the purpose IP address of communication, the transport layer protocol of use (TCP or UDP) and use.Application layer can be passed through sockets interface with transport layer, distinguishes the communication from different application process or network connection, realizes the concurrent service of transfer of data.
Socket can regard as two programs and carry out the end points of communication in connecting, and a program writes a segment information among the Socket, and this Socket sends to this segment information among the another one Socket, and this segment information can be sent in other programs.
Shown in Figure 1 is the communication mechanism schematic diagram of existing asynchronous distributed device, as shown in Figure 1, existing asynchronous distributed device is to utilize more independently module entity inter-module such as application software or protocol stack asynchronous message communication mechanism for example of function ratio, Socket business datum Flow Control based on the application module granularity, this application module granularity is meant with the minimum unit object of application module integral body as data-flow-control, and further refinement.
In realizing process of the present invention, the inventor finds that there are the following problems in the prior art: existing this utilization in the inter-module asynchronous message communication mechanism, for a Socket module, have a plurality of upper application module (APP) and share use, and usually there are a plurality of independent examples that use Service Sources in each application module inside.Existing inter-module asynchronous message flow-control mechanism can only recognize the component level granularity, be that flow-control mechanism can only control to the said modules rank, when the load of Socket data, services heavier, and when having the burst concussion, because the service of the SOCKET in most of existing apparatus all is to realize at kernel, call by device and to receive and dispatch message, operating means can not carry out special scheduling to transmission and the reception of SOCKET, normally get earlier first, so can influence each other between each Socket communication instance that same application module inside is created, can't accomplish load balancing, thereby have influence on the normal operation of applied business.
Summary of the invention
Embodiments of the invention are to propose in view of the above problems, and the purpose of embodiments of the invention is, a kind of method and device of transmission/receiving data packets is provided, to avoid influencing each other between the communication instance that same application module inside created.
To achieve these goals, embodiments of the invention provide a kind of method that sends datagram, and this method may further comprise the steps: each intermodule communication example is mapped to each communication port; For described each intermodule communication example sends the message token request, with the request message token; To send the data volume of message according to described message token request and each intermodule communication example, the message in described each intermodule communication example is distributed described message token; The communication port that is shone upon by each described intermodule communication example sends the message that is assigned with described message token in the corresponding described intermodule communication example.
To achieve these goals, embodiments of the invention also provide a kind of method of receiving data packets, and described method comprises: each intermodule communication example is mapped to each communication port; For described each intermodule communication example sends the message token request, with the request message token; The data volume of the message that will receive according to described message token request and each intermodule communication example is distributed described message token to the message in described each intermodule communication example; The communication port that is shone upon by each described intermodule communication example receives the message that is assigned with described message token in the corresponding described intermodule communication example.
To achieve these goals, embodiments of the invention provide a kind of device that sends datagram again, and this device comprises: map unit is used for each intermodule communication example is mapped to a communication port respectively; The token request unit is used to described each intermodule communication example to send the message token request, with the request message token; The channel management unit is used for the data volume of the message that will send according to described message token request and each intermodule communication example, and the message in described each intermodule communication example is distributed described message token; Transmitting element is used for sending by the communication port that each intermodule communication example is shone upon the message of the described message token of being assigned with of corresponding described intermodule communication example.
To achieve these goals, embodiments of the invention provide a kind of device of receiving data packets in addition, and described device comprises: map unit is used for each intermodule communication example is mapped to a communication port respectively; The token request unit is used to described each intermodule communication example to send the message token request, with the request message token; The channel management unit is used for the data volume of the message that will send according to described message token request and each intermodule communication example, and the message in described each intermodule communication example is distributed described message token; Receiving element is used for receiving by the communication port that each intermodule communication example is shone upon the message of the described message token of being assigned with of corresponding described intermodule communication example.
The beneficial effect of the embodiment of the invention is, allot the message token and be the control that granularity is carried out packet sending and receiving because adopted with the intermodule communication example, so overcome when dispatching based on the component level granularity can't perceiving congestion problem, thereby unnecessary communication overhead has been saved in the balanced load of each communication port to greatest extent.
Description of drawings
Accompanying drawing described herein is used to provide the further understanding to the embodiment of the invention, constitutes the application's a part, does not constitute limitation of the invention.In the accompanying drawings:
Shown in Figure 1 is the communication mechanism schematic diagram of existing asynchronous distributed device;
Shown in Figure 2 is the flow chart of the method that sends datagram of the embodiment of the invention 1;
Shown in Figure 3 is the flow chart of the dispatching communication passage of the embodiment of the invention 2;
Shown in Figure 4 is the flow chart of the method that sends datagram of the embodiment of the invention 3;
The schematic diagram that sends datagram with other granularity of communication instance level of the embodiment of the invention 3 that shown in Figure 5 is;
Shown in Figure 6 is the structured flowchart of the device that sends datagram of the embodiment of the invention 4;
Shown in Figure 7 is the structured flowchart of the device that sends datagram of the embodiment of the invention 5;
Signaling diagram in the device that sends datagram of the embodiment of the invention 5 that shown in Figure 8 is.
Embodiment
For the purpose, technical scheme and the advantage that make the embodiment of the invention is clearer,, the present invention is described in further details below in conjunction with execution mode and accompanying drawing.At this, exemplary embodiment of the present invention and explanation thereof are used to explain the present invention, but not as a limitation of the invention.
Embodiment 1
The flow chart of the method that sends datagram of embodiments of the invention 1 that shown in Figure 2 is, shown in Figure 3 be the signaling diagram that sends datagram of embodiments of the invention 1.Shown in Fig. 2,3, setting out of embodiments of the invention 1 send the method for data message to comprise:
S201: each intermodule communication example is mapped to communication port at transmitting terminal, wherein this communication port be as the application module of transmitting terminal and as between the application module of receiving terminal before communicating the communication port set up of dynamic negotiation, can use an ID (IDentity) or name to identify, above-mentioned intermodule communication example is corresponding one by one with described communication port and can discharge after communication back is confirmed by the user finishing.
S202: for described each intermodule communication example sends the message token request, with the request message token, in present embodiment 1, this message token is to be used for controlling the number of a communication port data traffic or the sign of size, for example: after communication port is set up, transmitting terminal and receiving terminal are consulted the number of the message token in the described communication port, according to the current ability of receiving terminal (the i.e. number of the message that can handle simultaneously or size, the number or the size of message that perhaps can buffer memory) to each communication port assignment message token, concrete number is by the present load and the ability decision of receiving terminal, and the quantity of the message token that arrives for each intermodule communication example request when for example receiving terminal is set up a plurality of intermodule communication example just less.
S203: according to the data volume of the message that will send in described message token request and each intermodule communication example, it is the number of message or the bit of message (bit) number, message in described each intermodule communication example is distributed described message token, for example, if each intermodule communication example has been assigned with 10 message tokens, then when the message number to be sent in the intermodule communication example surpasses 10 preceding 10 just can be assigned to the message token, and the message number when being lower than 10 the described message in this intermodule communication example can be assigned to the message token, and the message that just residue is not assigned to the message token as yet in each intermodule communication example of transmitting terminal after receiving terminal receives and handle message that transmitting terminal sends and the message token of returning this message continues to distribute the message token of being returned to transmitting terminal by described receiving terminal.
S204: the communication port that is shone upon by each described intermodule communication example sends the message that is assigned to described message token in the corresponding described intermodule communication example to receiving terminal respectively at transmitting terminal.
Promptly in the embodiment of the invention 1, send message at transmitting terminal according to the message token, message of every transmission, all need at first to obtain a message token, this mode of obtaining token can be divided into according to number and the dual mode that obtains according to bit number, promptly be meant that according to number a message obtains a token, and be meant big or small assignment message token according to message according to bit number, for example the message of 10k is the message token of 10k with regard to the size of distributing an expression message.After having distributed the message token for the message in the intermodule communication example, just send the message that has been assigned to the message token, and receive this message and finish the message that the message token that this message is assigned to after receive handling is not assigned to the message token between returning to the corresponding intermodule communication example of transmitting terminal or redistributing to the corresponding module at transmitting terminal in the communication instance as yet at receiving terminal, and when all message tokens of predetermined quantity have been assigned with and have not reclaimed a message token, just can not continue the assignment message token again.
At this moment, unallocated message to the message token just continues to wait in described each intermodule communication example, the message that has been assigned to the message token in described intermodule communication example sends and finishes reception by receiving terminal and (for example handle the back, receiving terminal at first is stored in the message that receives in the middle of the buffer memory, and receive processing one by one) after corresponding intermodule communication example is returned the message token, just can carry out the transmission of message when being assigned with the message token after this return again.
Therefore, if can not in time receive and handle the message that is assigned to the message token at receiving terminal, then the message token is with depleted, can't continue to send between respective modules the message that residue in the communication instance is not assigned to the message token at transmitting terminal, and can fail at transmitting terminal application message token, follow-uply also can't continue to send more messages, thereby reach the effect of flow control to receiving terminal at transmitting terminal.
In addition, those skilled in the art should be easy to expect, though in the foregoing description 1, be that example is illustrated to send message at transmitting terminal, but can change an angle fully and be applied to the situation that receives message at receiving terminal, promptly give the message assignment message token that will receive, and receive the message that is assigned with the message token successively at receiving terminal.
In the embodiment of the invention 1, owing to be to replace the mode that sends message with application module as the least unit of data-flow-control in the mode that sends message according to the dispatching communication passage, therefore can control the process that sends message more subtly, can not influence each other thereby can make between each communication instance.
Embodiment 2
The embodiment of the invention 2 is with the difference of the foregoing description 1, in above-mentioned steps S204, message token distribution condition in the communication port that is shone upon according to each intermodule communication example is dispatched the communication port that each intermodule communication example is shone upon, so that the load balancing of each communication instance.
Promptly, in the embodiment of the invention 2, at first judge the number of the message token that has been assigned with in the communication port that each intermodule communication example shone upon, when the number diversity ratio of the message token that is assigned with in judging each communication port is big, be that message token in some communication port distributes, and the message token that is not assigned with in other communication ports is also surplus when a lot, will the dispatching communication passage, so that the load balancing of each communication instance, the i.e. preferential message that sends and handle the communication port that has distributed the message token.
Shown in Figure 3 is the flow chart of the dispatching communication passage of the embodiment of the invention 2.As shown in Figure 3, the step of the dispatching communication passage of the embodiment of the invention 2 comprises:
S301: judge the distribution condition of the message token in each communication port, judge promptly how many message tokens distributes in each communication port, number of for example having distributed or the bit number that has distributed;
S302: according to described each communication port of distribution condition scheduling of the message token in described each communication port, so that the load balancing of each communication instance, i.e. preferential transmission and processing have distributed the message of the communication port of message token.
In the embodiment of the invention 2, suppose to exist 10 communication ports of 10 intermodule communication example mappings, and the message token number that each communication port can be assigned with is 100.
The message token number that has been assigned with in judging one of them communication port 1 is 20, and the message token number that has been assigned with in other communication port 2~communication ports 10 is 100, be that the message token is when distributing, illustrate that then the intermodule communication example transmission message of communication port 1 and the speed of finishing dealing with will be apparently higher than other communication port 2~communication ports 10, obviously the load between these communication port 1~communication ports 10 is unbalanced, just dispatch each communication port and make load balancing between these communication ports this moment, promptly sends messages and receiving terminal is handled by the above-mentioned communication port 2~communication port 10 of priority scheduling.
In the embodiment of the invention 2, coming the dispatching communication passage according to the distribution condition of message token also can be to carry out according to the bit number that the message token is assigned with.Promptly come the assignment message token according to the size of data of the message that will send, the bit number of for example total message token is 10M, and the size of the message that send is 10k, and then the message token quantity of distributing for this message is 10k, and remaining message token is 10230k.
In like manner, after judging the distribution condition of message token in each communication port, remaining message token quantity is 10230k in for example finding communication port 1, and in other communication port 2~communication ports 10 remaining message token quantity be 0k, when promptly all assigning, will dispatch each communication port and make load balancing between these communication ports, make by the above-mentioned communication port 2~communication port 10 of priority scheduling promptly that message preferentially is sent out and makes receiving terminal to handle in this letter passage 2~communication port 10.
In the invention described above embodiment 2, owing to be to be that granularity is concentrated and to be carried out balance dispatching with the intermodule communication example, and maximum token number and scheduling by each communication port of global configuration, therefore can control the load that each intermodule communication example sends message, can be so that the load balancing of each intermodule communication example.
Embodiment 3
Shown in Figure 4 is the flow chart of the method that sends datagram of the embodiment of the invention 3.Present embodiment 3 is with the difference of the foregoing description 1, can priority be set to each intermodule communication example.In the embodiment of the invention 3, describe as the intermodule communication example with the socket communication example, yet the embodiment of the invention be not limited thereto, the intermodule communication example can also comprise process communication example etc.
As shown in Figure 4, the method that sends datagram of embodiments of the invention 3 comprises:
S401: each socket communication example is provided with priority at transmitting terminal;
S402: the communication port that respectively each socket communication example is mapped to respective priority according to set priority at transmitting terminal;
S403: the quantity of setting the message token is a predetermined value, the quantities of messages that can send when wherein the communication port that in the embodiment of the invention 2 each socket communication example is shone upon is dispatched is subjected to the control of the quantity of described message token, promptly after the message token distributes, just can not send message again, have only behind the assignment message token to send message;
S404: for described each socket communication example sends the message token request, with the request message token;
S405: according to the data volume of the message that will send in the quantity of described message token request and described message token and each the socket communication example, to the described message token of described each socket communication example allocation;
S406: the flow-control information that obtains described each socket communication example, it is the loading condition (as CPU usage and EMS memory occupation) of each socket communication example, in the embodiment of the invention 3, can judge the loading condition of each socket communication example by the distribution condition of corresponding message token, for example when the message token distributes the Flow Control back-pressure is described then, promptly load is overweight;
S407: judge whether that according to the flow-control information of each socket communication example the Flow Control back-pressure (promptly judges according to above-mentioned flow-control information whether described message token distributes, if distributing, described message token just shows the Flow Control back-pressure), if judged result is for being, execution in step S408 then, if judged result is not, then execution in step S409;
S408: thus stop in all socket communication examples message assignment message token, promptly since the Flow Control back-pressure do not have unnecessary message token to distribute;
S409: continue the message assignment message token in each socket communication example, and make communication port that the socket communication example is shone upon by each intermodule communication example according to the priority that is provided with in step S401 send the message that has been assigned with the message token in the corresponding described intermodule communication example, promptly the message in the communication port that priority is high preferentially is sent out;
S410: the quantity of described message token is upgraded with the preset time cycle, be that receiving terminal can be held consultation according to the number and the channel management unit of the ability that self can handle message or energy while buffer memory message, to determine quantity to the message token of each socket communication example allocation, for example when the communication port number of setting up between receiving terminal and the transmitting terminal is few, therefore the sum of the message token that distributes in each socket communication example of increase that can be relative can hold consultation with preset time cycle and channel management unit according to the demand of self at receiving terminal and upgrade the quantity of described message token.
Wherein, step S410 step not necessarily in the above-described embodiments can be optional as the case may be.
In the embodiment of the invention 3, giving the sum of the message token of the message distribution in each intermodule communication example is a predetermined value, promptly the number according to the communication port of the receiving ability of receiving terminal and foundation decides, when the communication port of being set up is many corresponding each intermodule communication example allocation to the sum of message token with regard to relative lacking.
The schematic diagram that sends datagram with other granularity of communication instance level of the embodiment of the invention 3 that shown in Figure 5 is.As shown in Figure 5, not that (APP1~APP4) carries out the transmission of message to each application module of scheduling, but by each communication port of scheduling, sending socket communication example 1~socket communication example 8 (is the message among the SockId1~SockId8) among Fig. 5.
In the embodiment of the invention 3, alleviate the influence of the concussion of business load by the back-pressure of tiny granularity (being other granularity of communication instance level).In addition for the employed communication port of each socket communication example, adopt the token Flow Control, the quantities of messages that can send or receive during each socket communication example scheduling is controlled by token quantity, and all after dates of regular hour carry out quantity to token to be upgraded, guarantee that in certain unit interval all the Socket communication instance that need carry out data transmit-receive can in time be handled, avoid being influenced by individual other big flow example.
Simultaneously, in the embodiment of the invention 3, owing to be before Socket communication instance transmission/reception service request, come to provide to the user whether the aware communications passage is congested, promptly to be defined as communication port when no longer for Socket communication instance assignment message token congested by the assignment message token, avoid the user to apply in advance and resource that buffer memory is unnecessary (need not to apply in advance the internal memory of the Socket data message that will send).
And,, thereby make things convenient for adjusting and the control of user for dispatching effect because the embodiment of the invention 3 is supported a plurality of priority settings.For example, be used for receiving the socket communication example of keep alive message, can be tied on the higher communication port of priority, unnecessary route oscillation takes place when avoiding high capacity for OSPF.
Embodiment 4
Shown in Figure 6 is the structured flowchart of the device that sends datagram of the embodiment of the invention 4.In the embodiment of the invention 4, describe as the intermodule communication example with the socket communication example, yet the embodiment of the invention be not limited thereto, the intermodule communication example can also comprise process communication example etc.
In addition, this device that sends datagram can be gateway, core router etc. in the embodiment of the invention 4.In the embodiment of the invention 4, the process that sends datagram is to occur in as between each application module in the devices such as gateway, core router.
As shown in Figure 6, the device that sends datagram of the embodiment of the invention 4 comprises: map unit 601 is used on transmitting terminal each socket communication example being mapped to a communication port respectively; Token request unit 602 is used to described each socket communication example to send the message token request, with the request message token; Channel management unit 603 is used for the data volume of the message that will send according to described message token request and each socket communication example, and the message in described each socket communication example is distributed described message token; Transmitting element 604, the communication port that is used for being shone upon by each socket communication example sends the message of the described message token of being assigned with of corresponding described intermodule communication example respectively to receiving terminal at transmitting terminal.
Be to adopt the mode of dispatching to replace the mode of dispatching in embodiments of the invention 4 based on assembly based on the socket communication example.Its communicating pair can adopt a cover support balance dispatching (balance dispatching is exactly that finger is when receiving the data that a plurality of transmitting terminals send, the data of can each transmitting terminal of uniform treatment sending, do not have certain transmitting terminal to take the problem of all communication resources) communication interface, this communication interface comprises two parts: 1, transmission interface, apply for token and message internal memory before being used to send data, and the success back sends; 2, receiving interface is used for to communication module registered callbacks function, and when message need receive, this function was called.
In the embodiment of the invention 4, transmitting element 604 sends message according to the message token, and message of transmitting element 604 every transmissions all need obtain a message token by token request unit 602, this mode of obtaining token can be divided into two kinds, according to number with according to bit number.Channel management unit 603 is behind the intact message token of the socket communication example allocation of transmitting terminal, whenever finish and just give back a message token after a message in the communication instance sends and the affirmation receiving terminal is finished dealing with, and when channel management unit 603 all message tokens of predetermined number are distributed when not reclaiming a message token, just can not continue the assignment message token again.
This moment, unallocated message in the communication instance of message token just continued to wait for, Deng before communication instance in message send and finish handle backward channel administrative unit 603 and return the message tokens after, just can carry out the transmission of message when being assigned with the message token after this return again.
Therefore, if can not in time receive and handle the message that is assigned to the message token at receiving terminal, then the message token is with depleted, can't continue to send in the corresponding socket communication example message that residue is not assigned to the message token at transmitting terminal, and can fail at transmitting terminal application message token, follow-uply also can't continue to send more messages, thereby reach the effect of flow control to receiving terminal at transmitting terminal.
In addition, those skilled in the art should be easy to expect, though in the foregoing description 4, be that example is illustrated to send message at transmitting terminal, but can change an angle fully and be applied to the situation that receives message at receiving terminal, promptly give the message assignment message token that will receive, and receive the message that is assigned with the message token successively at receiving terminal.
For example, the device of the receiving data packets of the embodiment of the invention 4 comprises: map unit is used for respectively each socket communication example being mapped to a communication port on receiving terminal; The token request unit is used to described each socket communication example to send the message token request, with the request message token; The channel management unit is used for the data volume of the message that will receive according to described message token request and each socket communication example, and the message in described each socket communication example is distributed described message token; Receiving element is used for the message that is assigned with described message token of the corresponding described intermodule communication example that the communication port that shone upon by each socket communication example sends at the receiving terminal receiving end/sending end.
In the embodiment of the invention 4, owing to be to replace the mode that sends/receive message with application module as the least unit of data-flow-control in the mode that sends/receive message according to the dispatching communication passage, therefore can control the transmission/receiving course of message thinlyyer, can not influence each other thereby can make between each communication instance.
Embodiment 5
Shown in Figure 7 is the structured flowchart of the device that sends datagram of the embodiment of the invention 5.This device that sends datagram can be gateway, core router etc. in the embodiment of the invention 5.In the embodiment of the invention 4, the process that sends datagram is to occur in as between each application module in the devices such as gateway, core router.
As shown in Figure 7, the device that sends datagram of the embodiment of the invention 5 comprises: priority is provided with unit 701, is used at transmitting terminal each intermodule communication example being provided with priority; Map unit 702 is used for respectively each intermodule communication example being mapped at transmitting terminal according to set priority the communication port of respective priority; Token request unit 704 is used to described each intermodule communication example to send the message token request, with the request message token; Token quantity setup unit 703 is used to set the quantity of described message token, and making this quantity is a predetermined value; Channel management unit 705 is used for the data volume according to the message of the quantity of described message token request and described message token and the intermodule communication example that each will send, and the message in described each intermodule communication example is distributed described message token; Transmitting element 706 is used for according to set priority, and the communication port that is shone upon by each intermodule communication example sends the message that is assigned with described message token in the corresponding described intermodule communication example to receiving terminal respectively at transmitting terminal; Updating block 708 is used for the preset time cycle quantity of described message token being upgraded.
In the embodiment of the invention 5, described transmitting element 706 also comprises: judging unit 707, the message token distribution condition of the communication port that is used for judging that described each intermodule communication example is shone upon, described channel management unit 705 also is used for dispatching the communication port that described each intermodule communication example is shone upon according to described message token distribution condition, so that the load balancing of each communication instance.
In the embodiment of the invention 5, described intermodule communication example can be the socket communication example, also can be process communication example or other communication instance.
In the embodiment of the invention 5, the number of the message token that has been assigned with in the communication port that described judging unit 707 each intermodule communication example of judgement are shone upon, when the number diversity ratio of the message token that is assigned with of judging each communication port is big, the message token that is some communication port distributes, and the message token that is not assigned with of other communication ports is also surplus when a lot, described channel management unit will be dispatched the communication port that each intermodule communication example is shone upon, so that the load balancing of each communication instance, the promptly preferential message that sends and handle in the intermodule communication example that has been assigned with the message token.
And the embodiment of the invention 5 is same with the foregoing description 2, and token quantity setup unit can be that number also can be a bit number for the quantity of the message token that each communication port sets.
In addition, those skilled in the art should be easy to expect, though in the foregoing description 5, be that example is illustrated to send message at transmitting terminal, but can change an angle fully and be applied to the situation that receives message at receiving terminal, promptly give the message assignment message token that will receive, and receive the message that is assigned with the message token successively at receiving terminal.
For example, the device of the receiving data packets of the embodiment of the invention 5 comprises: priority is provided with the unit, is used at receiving terminal each intermodule communication example being provided with priority; Map unit is used for each intermodule communication example being mapped at receiving terminal according to set priority the communication port of respective priority; The token request unit is used to described each intermodule communication example to send the message token request, with the request message token; Token quantity setup unit is used to set the quantity of described message token, and making this quantity is a predetermined value; The channel management unit is used for the data volume of the message that quantity and each intermodule communication example according to described message token request and described message token will receive, and the message in described each intermodule communication example is distributed described message token; Receiving element is used for according to described priority, the message that be assigned with described message token of communication port in the corresponding described intermodule communication example that the receiving terminal receiving end/sending end is sent that is shone upon by each intermodule communication example; Updating block is used for the preset time cycle quantity of described message token being upgraded.
In the device of the receiving data packets of the embodiment of the invention 5, described receiving element also comprises: judging unit, the message token distribution condition of the communication port that is used for judging that described each intermodule communication example is shone upon, described channel management unit also is used for dispatching the communication port that described each intermodule communication example is shone upon according to described message token distribution condition, so that the load balancing of each communication instance.
Signaling diagram in the device that sends datagram of the embodiment of the invention 5 that shown in Figure 8 is.As shown in Figure 8, in the use of the device that sends datagram of the embodiment of the invention 5, sending direction recipient request message token, and have only when obtaining could to apply for the message internal memory behind the message token, thereby and the encapsulated message transmission, when not obtaining the message token, then be judged as the Flow Control back-pressure, could continue to transmit messages literary composition etc. after the back-pressure releasing, saved the resource of transmit leg, transmit leg can obtain back-pressure and remove notice, and need not regularly, retry sends message.
In the embodiment of the invention 5, even at same Socket inside modules socket communication example when larger (as there being 8k socket communication example), can guarantee well also that data traffic is less but socket communication example (as being used to send the protocol heart-beat message) that importance is high in time obtains scheduling, guarantee the stability of overlying roaduay by protocol application.
And, avoid interfering with each other and occlusive effects of the appearance of a plurality of application modules when same Socket module requested service; Avoid the mutual obstruction between inner each Socket communication instance of same application module.
Can be provided with by priority simultaneously, make different Socket communication instance communicate scheduling according to priority.
In addition, in the invention described above embodiment 5, owing to be to be that granularity is concentrated and to be carried out balance dispatching with the intermodule communication example, and pass through number or the bit number and the scheduling of the maximum message segment token of each communication port of global configuration, therefore can control the load that each intermodule communication example sends message, can be so that the load balancing of each intermodule communication example.
In addition in the above-described embodiments, for receiving terminal, in like manner can be according to the number of the message that will receive or the bit number assignment message token of message, and receive only the message that has distributed the message token at receiving terminal.The beneficial effect of the embodiment of the invention is, allot the message token and according to the method for dispatching communication passage because adopted, so overcome when dispatching based on assembly can't perceiving congestion problem, thereby unnecessary communication overhead has been saved in the balanced load of each communication port to greatest extent.
Above-described embodiment; purpose of the present invention, technical scheme and beneficial effect are further described; institute is understood that; the above only is the specific embodiment of the present invention; and be not intended to limit the scope of the invention; within the spirit and principles in the present invention all, any modification of being made, be equal to replacement, improvement etc., all should be included within protection scope of the present invention.

Claims (16)

1. a method that sends datagram is characterized in that, this method may further comprise the steps:
Each intermodule communication example is mapped to each communication port;
For described each intermodule communication example sends the message token request, with the request message token;
To send the data volume of message according to described message token request and each intermodule communication example, the message in described each intermodule communication example is distributed described message token;
The communication port that is shone upon by each described intermodule communication example sends the message that is assigned with described message token in the corresponding described intermodule communication example.
2. the method that sends datagram according to claim 1 is characterized in that, before the described message token of described distribution, described method also comprises:
The quantity of setting described message token is a predetermined value, and the quantities of messages that each intermodule communication example can send is subjected to the control of the quantity of described message token,
Wherein, the quantity of described message token is number or bit number.
3. the method that sends datagram according to claim 2 is characterized in that, also comprises:
The quantity of described message token is upgraded with the preset time cycle.
4. the method that sends datagram according to claim 1 is characterized in that, the described step that each intermodule communication example is mapped to each communication port also comprises:
Described each intermodule communication example is provided with priority, each intermodule communication example is mapped to the communication port of respective priority according to set priority;
The step correspondence of the message that is assigned with described message token in the corresponding described intermodule communication example of described transmission comprises:
According to set priority, the communication port that is shone upon by each described intermodule communication example sends the message that is assigned with described message token in the corresponding described intermodule communication example.
5. the method that sends datagram according to claim 1 is characterized in that, the step of the message that is assigned with described message token in each described intermodule communication example of described transmission also comprises:
Dispatch described communication port according to the distribution condition of message token, so that the load balancing of each communication instance.
6. according to any described method that sends datagram in the claim 1 to 5, it is characterized in that described intermodule communication example comprises: socket communication example and process communication example.
7. the method for a receiving data packets is characterized in that, described method comprises:
Each intermodule communication example is mapped to each communication port;
For described each intermodule communication example sends the message token request, with the request message token;
The data volume of the message that will receive according to described message token request and each intermodule communication example is distributed described message token to the message in described each intermodule communication example;
The communication port that is shone upon by each described intermodule communication example receives the message that is assigned with described message token in the corresponding described intermodule communication example.
8. the method for receiving data packets according to claim 7 is characterized in that,
The described step that each intermodule communication example is mapped to each communication port also comprises:
Described each intermodule communication example is provided with priority, each intermodule communication example is mapped to the communication port of respective priority according to set priority;
The step correspondence of the message that is assigned with described message token in the corresponding described intermodule communication example of described reception comprises:
According to set priority, the communication port that is shone upon by each described intermodule communication example receives the message that is assigned with described message token in the corresponding described intermodule communication example.
9. the method for receiving data packets according to claim 7 is characterized in that,
The step of the message that is assigned with described message token in each described intermodule communication example of described reception also comprises:
Dispatch described communication port according to the distribution condition of message token, so that the load balancing of each communication instance.
10. a device that sends datagram is characterized in that, described device comprises:
Map unit is used for each intermodule communication example is mapped to a communication port respectively;
The token request unit is used to described each intermodule communication example to send the message token request, with the request message token;
The channel management unit is used for the data volume of the message that will send according to described message token request and each intermodule communication example, and the message in described each intermodule communication example is distributed described message token;
Transmitting element is used for sending by the communication port that each intermodule communication example is shone upon the message of the described message token of being assigned with of corresponding described intermodule communication example.
11. the device that sends datagram according to claim 10 is characterized in that, described device also comprises:
Token quantity setup unit is used for setting the quantity of the message token of described each communication port, and making this quantity is a predetermined value,
And the quantities of messages that each intermodule communication example sends is subjected to the control of the quantity of described message token,
Wherein, the quantity of described message token is number or bit number.
12. the device that sends datagram according to claim 11 is characterized in that, also comprises:
Updating block is used for the preset time cycle quantity of described message token being upgraded;
Priority is provided with the unit, is used for described each intermodule communication example is provided with priority;
Described map unit is used for according to set priority each intermodule communication example being mapped to the communication port of respective priority.
13. the device that sends datagram according to claim 10 is characterized in that, described transmitting element also comprises:
Judging unit, the distribution condition of the message token of the communication port that is used for judging that described each intermodule communication example is shone upon,
Described channel management unit also is used for dispatching the communication port that described each intermodule communication example is shone upon according to the distribution condition of described message token, so that the load balancing of each communication instance.
14. the device of a receiving data packets is characterized in that, described device comprises:
Map unit is used for each intermodule communication example is mapped to a communication port respectively;
The token request unit is used to described each intermodule communication example to send the message token request, with the request message token;
The channel management unit is used for the data volume of the message that will send according to described message token request and each intermodule communication example, and the message in described each intermodule communication example is distributed described message token;
Receiving element is used for receiving by the communication port that each intermodule communication example is shone upon the message of the described message token of being assigned with of corresponding described intermodule communication example.
15. the device of receiving data packets according to claim 14 is characterized in that, described device also comprises:
Updating block is used for the preset time cycle quantity of described message token being upgraded;
Priority is provided with the unit, is used for described each intermodule communication example is provided with priority;
Described map unit is used for according to set priority the intermodule communication example being corresponded to the communication port of respective priority.
16. the device of receiving data packets according to claim 14 is characterized in that, described receiving element also comprises:
Judging unit, the distribution condition of the message token of the communication port that is used for judging that described each intermodule communication example is shone upon,
Described channel management unit also is used for dispatching the communication port that described each intermodule communication example is shone upon according to the distribution condition of described message token, so that the load balancing of each communication instance.
CN200910004310XA 2009-01-24 2009-01-24 Method and device for sending/receiving data packets Expired - Fee Related CN101789895B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN200910004310XA CN101789895B (en) 2009-01-24 2009-01-24 Method and device for sending/receiving data packets

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN200910004310XA CN101789895B (en) 2009-01-24 2009-01-24 Method and device for sending/receiving data packets

Publications (2)

Publication Number Publication Date
CN101789895A true CN101789895A (en) 2010-07-28
CN101789895B CN101789895B (en) 2012-12-12

Family

ID=42532958

Family Applications (1)

Application Number Title Priority Date Filing Date
CN200910004310XA Expired - Fee Related CN101789895B (en) 2009-01-24 2009-01-24 Method and device for sending/receiving data packets

Country Status (1)

Country Link
CN (1) CN101789895B (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101931556A (en) * 2010-08-04 2010-12-29 浪潮(北京)电子信息产业有限公司 Method and device for managing data packet transmission in high-speed transmission system
CN102055679A (en) * 2011-01-28 2011-05-11 中国人民解放军国防科学技术大学 Message scheduling method for power consumption control in forwarding engine
CN102118314A (en) * 2011-02-28 2011-07-06 华为技术有限公司 Flow management method and management device
CN102457537A (en) * 2010-10-19 2012-05-16 阿里巴巴集团控股有限公司 Communication method of transmission control protocol (TCP) and server
CN103678005A (en) * 2013-12-31 2014-03-26 税友软件集团股份有限公司 Load balancing control method and device
CN109218376A (en) * 2017-07-07 2019-01-15 中国移动通信集团江西有限公司 The method, device and equipment of data processing
CN109245981A (en) * 2018-10-25 2019-01-18 浙江中控技术股份有限公司 A kind of dispatching method and system of field bus communication
CN110868359A (en) * 2019-11-15 2020-03-06 中国人民解放军国防科技大学 Network congestion control method

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7535929B2 (en) * 2001-10-25 2009-05-19 Sandeep Singhai System and method for token-based PPP fragment scheduling
US7623543B2 (en) * 2004-03-19 2009-11-24 Fujitsu Limited Token-controlled data transmissions in communication networks

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101931556A (en) * 2010-08-04 2010-12-29 浪潮(北京)电子信息产业有限公司 Method and device for managing data packet transmission in high-speed transmission system
CN102457537A (en) * 2010-10-19 2012-05-16 阿里巴巴集团控股有限公司 Communication method of transmission control protocol (TCP) and server
CN102457537B (en) * 2010-10-19 2015-11-25 阿里巴巴集团控股有限公司 A kind of communication means of transmission control protocol and server
CN102055679A (en) * 2011-01-28 2011-05-11 中国人民解放军国防科学技术大学 Message scheduling method for power consumption control in forwarding engine
CN102055679B (en) * 2011-01-28 2012-09-19 中国人民解放军国防科学技术大学 Message scheduling method for power consumption control in forwarding engine
CN102118314A (en) * 2011-02-28 2011-07-06 华为技术有限公司 Flow management method and management device
CN103678005B (en) * 2013-12-31 2015-04-22 税友软件集团股份有限公司 Load balancing control method and device
CN103678005A (en) * 2013-12-31 2014-03-26 税友软件集团股份有限公司 Load balancing control method and device
CN109218376A (en) * 2017-07-07 2019-01-15 中国移动通信集团江西有限公司 The method, device and equipment of data processing
CN109245981A (en) * 2018-10-25 2019-01-18 浙江中控技术股份有限公司 A kind of dispatching method and system of field bus communication
CN109245981B (en) * 2018-10-25 2021-06-22 浙江中控技术股份有限公司 Scheduling method and system for field bus communication
CN110868359A (en) * 2019-11-15 2020-03-06 中国人民解放军国防科技大学 Network congestion control method
CN110868359B (en) * 2019-11-15 2023-03-24 中国人民解放军国防科技大学 Network congestion control method

Also Published As

Publication number Publication date
CN101789895B (en) 2012-12-12

Similar Documents

Publication Publication Date Title
CN101789895B (en) Method and device for sending/receiving data packets
CN108075987B (en) Multi-path data transmission method and device
AU2013351670B2 (en) Business scheduling method and apparatus and convergence device
EP3840512A1 (en) Sidelink resource allocation method and terminal
EP2116039B1 (en) Method and apparatus to support voip calls in an ieee 802.16 interface
CN103476062B (en) Data flow scheduling method, equipment and system
CN107733689A (en) Dynamic weighting polling dispatching strategy process based on priority
KR102275579B1 (en) Method and apparatus for providing differentiated transmitting services
CN112350952B (en) Controller distribution method and network service system
CN102047745A (en) Allocating resources within a communication system
JP2006197605A (en) Automated back-haul network management for supporting control traffic and bearer traffic multiplexed in radio communication system
US9043468B2 (en) Method and arrangement for network resource management
CN101729324B (en) Resource configuration method and household base station configuration server
CN112351083A (en) Service processing method and network service system
CN109729122B (en) Method and device for determining Ethernet MAC address
CN103475595A (en) System and method for overload control of Parlay X gateway
JP2008034947A (en) Load balanced call processing system
JP2001211175A (en) System for managing internet connection
WO2022218304A1 (en) Message forwarding method, apparatus and system, and computer-readable storage medium
CN102769566B (en) A kind of Multi-stage scheduling system configuration, variation and device
EP3381217A1 (en) Flexible mapping of logical end-points
CN107889152B (en) Multi-air-interface communication method and device
CN107113186A (en) The method and public service entity of data transfer in unified machine to machine system
CN109257227B (en) Coupling management method, device and system in data transmission
US10616792B2 (en) Communications system and networking method of application driven network, and controller

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20121212

Termination date: 20170124