CN100426789C - High-speed message transmitting method with high reliability - Google Patents

High-speed message transmitting method with high reliability Download PDF

Info

Publication number
CN100426789C
CN100426789C CNB2004100871545A CN200410087154A CN100426789C CN 100426789 C CN100426789 C CN 100426789C CN B2004100871545 A CNB2004100871545 A CN B2004100871545A CN 200410087154 A CN200410087154 A CN 200410087154A CN 100426789 C CN100426789 C CN 100426789C
Authority
CN
China
Prior art keywords
message
network interface
receives
interrupt process
interruption
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.)
Expired - Fee Related
Application number
CNB2004100871545A
Other languages
Chinese (zh)
Other versions
CN1770730A (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 CNB2004100871545A priority Critical patent/CN100426789C/en
Publication of CN1770730A publication Critical patent/CN1770730A/en
Application granted granted Critical
Publication of CN100426789C publication Critical patent/CN100426789C/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The present invention discloses a method for quickly forwarding messages. The present invention comprises the steps that timer interruption is started according to timer interruption frequency which is arranged in advance; in the process of timer interruption processing, the messages are received from a network interface; if the message are received, the messages are forwarded; after the messages received from the network interface are forwarded, whether the current time achieves a prearranged end time of the timer interruption processing is judged; if the current time achieves a prearranged end time of the timer interruption processing, the interruption processing is ended. The present invention can be independent of an operating system and ensure high-speed forwarding performance. Besides, the occupation of a CPU of the present invention can be expected and is not relevant to the flow rate of the messages of networks, and the reliability is high.

Description

A kind of high-speed message transmitting method of high reliability
Invention field
The present invention relates in the network application to realize the method that the high speed of message is transmitted reliably.
Background technology
In the network application such as router, media gateway etc., the message that often needs to realize high speed is transmitted, thereby reaches the purpose that improves throughput.In order to realize this purpose, common pass-through mode comprises the employing special chip, and for example application-specific integrated circuit (ASIC) (ASIC) perhaps adopts network processing unit, realizes that the high speed of message is transmitted.
For consideration to cost, service flexibility etc., need on common CP U, both handle upper-layer protocol or other necessary application software under a lot of situations, handle the quick forwarding of message again, reduce cost the purpose of increase service flexibility etc. thereby reach.
In this case, be to handle as a task the quick forwarding of message is the same with upper-layer protocol or other application software.Utilize the task scheduling ability of operating system, realize transmitting fast and the same CPU of other task sharings.
But above-mentioned prior art has following shortcoming:
1, for the system that does not support preemption scheduling, this set can cause quick forwarding task in time reasonably not dispatched, and causes the time-delay of forwarding, shake bigger than normal, even unacceptable.In addition, this also requires other tasks to want initiatively, discharge CPU in time, has in fact increased the coupling between the disparate modules, has increased the difficulty of whole system.
2, for the system that supports preemption scheduling, though can dispatch quick forwarding as a high-priority task, the granularity of scheduling generally is limited.Because the shake size is linear correlation with the scheduling granularity basically.Require the very little occasion of message shake for media gateway etc., certainly will exigent scheduling granularity, for example 1 millisecond.So frequent scheduling has greatly increased the expense of CPU, has caused a large amount of wastes of disposal ability, thereby has increased system cost.
In the prior art, the quick pass-through mode of another kind of message is the quick forwarding of adopting the message interrupt mode.
In this method, forwarding module carries out in interrupt service routine fast.When the message that receives reaches some (being assumed to be x), perhaps receive at least one message, in follow-up a period of time, (be assumed to be the y millisecond, can utilize the overtime timer setting) and do not receive new message, then produce interruption, thereby trigger the processing of quick forwarding module by hardware.Because priority of interrupt is very high,, reduced the coupling with other tasks, no matter and whether operating system adopts not preemptive type task scheduling so fast the priority of forwarding module is guaranteed.In addition, the message amount x that produce to interrupt by control, and the value of setting of overtime timer y, i.e. the interruption frequency of Controlled CPU roughly, thereby on the basis that guarantees quick forwarding performance, the utilance of raising CPU.
The shortcoming of this method is that the occupancy of CPU is closely related with the network message discharge model.Under the situation that has a large amount of burst messages on the network, when especially malicious attack taking place, the occupancy of CPU can reach capacity, and causes system action to expect, even crashes.
Summary of the invention
In order to solve above-mentioned prior art problems, the purpose of this invention is to provide method reliably a kind of and that carry out the message forwarding apace.
To achieve these goals, packet fast forwarding method of the present invention comprises:
Interrupt frequency according to predefined timer and start the timer interruption;
In the timer Interrupt Process, receive message from network interface;
The message that receives is transmitted processing, judges whether to finish current Interrupt Process, judge whether that wherein the step that end interrupt is handled comprises:
According to occupancy, determine the finish time of timer Interrupt Process to CPU;
After the message that receives from described network interface is transmitted processing, judge whether current time arrives the finish time of timer Interrupt Process;
If arrive the finish time of timer Interrupt Process, then end interrupt is handled.
The present invention can not rely on operating system, guarantees quick forwarding performance.And the present invention can expect to taking of CPU, and is not relevant with message flow on the network, the reliability height.
Description of drawings
Fig. 1 is that the method according to this invention is carried out the flow chart that message is transmitted processing fast.
Embodiment
Followingly embodiments of the invention are described in detail with reference to accompanying drawing.
Method of the present invention is to adopt the mode of regularly interrupting on CPU, the quick forwarding of realization message.This mode one side is in timely, the forwarding fast that operating system are not almost had realize under the situation about relying on message, simultaneously, avoided prior art to adopt the shortcoming of interrupt service routine, the operational mode of CPU, occupancy are always predictable, and it is not relevant with the network message discharge model, on the basis of improving cpu busy percentage, strengthened the reliability of system greatly.
The specific embodiment of the invention can be transmitted the process of processing according to message of the present invention fast referring to shown in Figure 1.At first, the frequency (for example 1 millisecond) that timer interrupts is set according to actual needs,, on CPU, starts timer and interrupt according to the interruption frequency of setting.
When the timer interrupt handling routine begins, obtain the moment (step S1) of current system.
Subsequently, according to the desired CPU usage upper limit of quick forwarding module (for example 60%), determine this interrupt must end process system time Tend return condition (step S2).Concrete mode can be the system time T during according to current interrupt, and obtains:
Tend=T+ (time between interruptions) * 60%.
For example, for the interruption of adopting 1 millisecond, Tend is for interrupting the T+0.6 millisecond zero hour.
Next, at first attempt receiving N message (step S3) from a network interface (for example network interface 1).Further, judge whether to receive message (step S4).
If judge and received N predetermined message, then these messages are handled, for example transmit or pass to other software module of system fast; If the message number P<N that receives, then only need to handle P the message of receiving and get final product (step S5).
After handling the message of receiving, obtain the current time Tnow of system (step S6).
Judge that whether this current moment Tnow surpasses or equal Tend (step S7)
If current time Tnow surpasses or equals Tend, then this EOI discharges CPU.
In addition, in above-mentioned steps S3,, or in step S7, judge Tnow, then attempt receiving M predetermined message (step S3 ') from another network interface less than Tend if do not receive message within the predetermined time.After this step S4 '-S7 ' and above-mentioned steps S4-S7 are similar, repeat no more.
Need explanation, setting up of N and M is in order further to improve the efficient of software processes in the last example.Under the simplest situation, can be 1 with the equal value of N, M.As long as after receiving a message, just can handle, can accelerate the processing speed of message like this.
According to a preferred embodiment of the invention a, in order to improve cpu busy percentage, can increase a Rule of judgment that withdraws from this interruption.If promptly the message that receives into from last interface is less than predetermined M, then directly withdraw from interruption, discharge CPU, and no matter Tnow this moment may be also much smaller than Tend.Such benefit is an interface of having avoided CPU meaningless ground scan empty in interruption, the waste disposal ability.
In addition, there is the example of two network interfaces in the system of only having enumerated in the above-mentioned example, obviously can increase and decrease port number according to actual conditions in the practical application, or adopts other resource scheduling algorithms, realizes the network interface processing priority that needs.
Though below described the present invention in conjunction with specific embodiments, these specify not is limitation of the present invention.Those skilled in the art can make various modifications and conversion to the present invention under the situation that does not break away from the spirit and scope of the present invention.They are all in the protection range of appended claim.

Claims (8)

1. a packet fast forwarding method is characterized in that,
Interrupt frequency according to predefined timer and start the timer interruption;
In the timer Interrupt Process, receive message from network interface;
The message that receives is transmitted processing, judges whether to finish current Interrupt Process, judge whether that wherein the step that end interrupt is handled comprises:
According to occupancy, determine the finish time of timer Interrupt Process to CPU;
After the message that receives from described network interface is transmitted processing, judge whether current time arrives the finish time of timer Interrupt Process;
If arrive the finish time of timer Interrupt Process, then end interrupt is handled.
2. method according to claim 1 is characterized in that, determine the timer Interrupt Process the finish time Tend method comprise:
If the system time during current the interruption is T, then
The occupancy of Tend=T+ (time between interruptions) * CPU.
3. according to each described method of claim 1-2, it is characterized in that, further comprise, if after judging that the message of current network interface is transmitted the processing end, still the finish time of no show timer Interrupt Process, then receive message and transmit processing from next network interface.
4. method according to claim 3 is characterized in that, the step of the message that receives being transmitted processing comprises:
If the current network interface has been received N predetermined message, then these messages are transmitted;
If message number P<N that the current network interface is received then only handles P the message of receiving.
5. method according to claim 3 is characterized in that, the step of the message that receives being transmitted processing comprises: when receiving a message, just the message of this reception is transmitted processing.
6. method according to claim 3 is characterized in that, further comprises: if the message that receives into from last interface is less than predetermined number, then directly withdraw from interruption.
7. method according to claim 4 is characterized in that, further comprises: if the message that receives into from last interface is less than predetermined number, then directly withdraw from interruption.
8. method according to claim 5 is characterized in that, further comprises: if the message that receives into from last interface is less than predetermined number, then directly withdraw from interruption.
CNB2004100871545A 2004-11-01 2004-11-01 High-speed message transmitting method with high reliability Expired - Fee Related CN100426789C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2004100871545A CN100426789C (en) 2004-11-01 2004-11-01 High-speed message transmitting method with high reliability

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2004100871545A CN100426789C (en) 2004-11-01 2004-11-01 High-speed message transmitting method with high reliability

Publications (2)

Publication Number Publication Date
CN1770730A CN1770730A (en) 2006-05-10
CN100426789C true CN100426789C (en) 2008-10-15

Family

ID=36751738

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2004100871545A Expired - Fee Related CN100426789C (en) 2004-11-01 2004-11-01 High-speed message transmitting method with high reliability

Country Status (1)

Country Link
CN (1) CN100426789C (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104967580B (en) * 2009-09-27 2019-01-11 中兴通讯股份有限公司 The method and device sent for realizing ether network packet
CN106888173B (en) * 2017-02-21 2019-11-29 武汉虹旭信息技术有限责任公司 Universal efficient message communication system and its method

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1414747A (en) * 2002-05-08 2003-04-30 华为技术有限公司 Method of implementing base data message receiving
WO2003055247A2 (en) * 2001-12-13 2003-07-03 Matsushita Electric Industrial Co., Ltd. Communications device, method and program for receiving process execution, and computer-readable recording medium having same program recorded thereon
WO2004030399A1 (en) * 2002-09-27 2004-04-08 Nokia Corporation Multicast data transfer

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2003055247A2 (en) * 2001-12-13 2003-07-03 Matsushita Electric Industrial Co., Ltd. Communications device, method and program for receiving process execution, and computer-readable recording medium having same program recorded thereon
CN1414747A (en) * 2002-05-08 2003-04-30 华为技术有限公司 Method of implementing base data message receiving
WO2004030399A1 (en) * 2002-09-27 2004-04-08 Nokia Corporation Multicast data transfer

Also Published As

Publication number Publication date
CN1770730A (en) 2006-05-10

Similar Documents

Publication Publication Date Title
CN2794054Y (en) Data life limited timer device for reinforcing special channel transmission
CN100450081C (en) Method and system for carrying out flow-control
US8305886B2 (en) Controlling congestion detection in HSDPA systems
FI116185B (en) downtime
CN1725732A (en) Message speed limit method
CN101027915A (en) Communications system and method for load management
WO2001071991A1 (en) Load regulation
CN100442713C (en) Method for increasing communication link layer protocol efficiency
WO2006047056A1 (en) Method and computer program for selecting an inactivity timeout interval based on last data direction
CN100502347C (en) Method and apparatus for facilitating dormant mode, packet data mobile handoffs
CN1751532A (en) Method and apparatus for using a traffic channel for communications of control data in a wireless communication system
CN101888610A (en) Method, system and device for realizing short message service
EP0903670A1 (en) Improved peripheral device control in data processing systems
CN1863164A (en) Method for controlling reverse congestion of ABIS interface and transceiver base station
CN100426789C (en) High-speed message transmitting method with high reliability
KR20080066731A (en) Method of selective dormant data session reactivation
CN1691617A (en) Method of flow control in communication system
CN1568046A (en) A method for detection and maintenance of service link in mobile network
EP1583338B1 (en) The method of controlling the user calling load in soft switch system
CN101179831A (en) Congestion control system between base station and wireless network controller
CN1505359A (en) Method and a system for managing the changing of resources in a communications network
CN101631353B (en) Method and device for managing status packet data unit
US5917806A (en) Method and apparatus for adaptively balancing communication traffic in a radio communication system to control congestion
CN101854660B (en) Congestion control method and device
CN1266883C (en) Method for controlling network port flow

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
C17 Cessation of patent right
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20081015

Termination date: 20121101