A kind of method and device of processing diameter protocol message
Technical field
The present invention relates to the communications fields, it particularly relates to a kind of method and apparatus of processing diameter protocol message.
Background technology
Diameter (diameter) agreement (being the upgraded version of RADIUS (remote customer dialing authentication system) agreement) is one
The network application of kind AAA (Authentication, Authorization, Accounting, verification, authorization and accounting) type
Agreement, for functions such as authentication, authorization, accountings.Remote control of the protocol realization for user's access.Since access is controlled
System and the functions such as certification, mandate realize (see Fig. 1) on different devices respectively, so (or other needs are recognized when user logs in
Card or authorize behavior) failure when, it is thus necessary to determine that failure cause.At this moment the message for just needing tracking diameter sessions, with association
Help positioning problems.But in actual commercial environment, while there is the friendship of the diameter protocol messages such as a large amount of certification, mandate
Mutually, the treatment effeciency of system can be influenced by tracking all diameter protocol messages, while artificial screening being needed to go out required report
Text needs take a substantial amount of time and energy, and are unfavorable for the quick positioning of problem.Generally will not include required in response message
Information (such as user account, calling number, IP address, MAC Address information), therefore relevant response message can not be carried out
Tracking.
Invention content
The technical problem to be solved in the present invention is to provide a kind of method and apparatus of processing diameter protocol message, with reality
Now to the tracking of diameter protocol message.
In order to solve the above technical problem, the present invention provides a kind of methods of processing diameter protocol message, including:
Register the characteristic information of diameter protocol message to be tracked;
After receiving diameter protocol message, if judging the characteristic information and registration that the diameter protocol message carries
Characteristic information it is consistent, then record the information of the diameter protocol message.
Further, the above method also has the characteristics that following:
If the diameter protocol message received is request message, in the information for recording the diameter protocol message
During, further include:Preserve the sequence of message number in the diameter protocol message;
If in subsequently received diameter protocol message response message, is then locally searching whether to preserve and be somebody's turn to do
The consistent sequence of message number of sequence of message number in response message, if so, then recording the information of the response message.
Further, the above method also has the characteristics that following:The characteristic information includes one kind or more in following information
Kind:
User account, calling number, media access control address and IP address.
To solve the above-mentioned problems, the present invention also provides a kind of devices of processing diameter protocol message, including:
Registration Module, the characteristic information for registering diameter protocol message to be tracked;
Processing module, after receiving diameter protocol message, if judging what the diameter protocol message carried
Characteristic information is consistent with the characteristic information of registration, then records the information of the diameter protocol message.
Further, above-mentioned apparatus also has the characteristics that following:
The processing module is recording the diameter if the diameter protocol message received is request message
It is additionally operable to during the information of protocol massages, preserves the sequence of message number in the diameter protocol message;In receipt of subsequent
If the diameter protocol message response message arrived, then it is used to search whether to preserve and the report in the response message locally
The consistent sequence of message number of literary sequence number, if so, then recording the information of the response message.
Further, above-mentioned apparatus also has the characteristics that following:The characteristic information includes one kind or more in following information
Kind:
User account, calling number, media access control address and IP address.
The present invention provides a kind of method and apparatus of processing diameter protocol message, can realize to diameter agreements
The tracking of message.
Description of the drawings
Attached drawing is used to provide further understanding of the present invention, and a part for constitution instruction, the reality with the present invention
It applies example to be used to explain the present invention together, not be construed as limiting the invention.In the accompanying drawings:
Fig. 1 is the network diagram of the prior art;
Fig. 2 is the device of the processing diameter protocol message of the embodiment of the present invention;
Fig. 3 is the flow chart of the method for the processing diameter protocol message of the embodiment of the present invention;
Fig. 4 is the flow chart of the specific diameter sessions of tracking of a specific embodiment of the invention.
Specific implementation mode
To make the objectives, technical solutions, and advantages of the present invention clearer, below in conjunction with attached drawing to the present invention
Embodiment be described in detail.It should be noted that in the absence of conflict, in the embodiment and embodiment in the application
Feature mutually can arbitrarily combine.
Fig. 2 is the device of the processing diameter protocol message of the embodiment of the present invention, including:
Registration Module, the characteristic information for registering diameter protocol message to be tracked;
Processing module, after receiving diameter protocol message, if judging what the diameter protocol message carried
Characteristic information is consistent with the characteristic information of registration, then records the information of the diameter protocol message.
Wherein, the processing module is somebody's turn to do if the diameter protocol message received is request message in record
It is additionally operable to during the information of diameter protocol message, preserves the sequence of message number in the diameter protocol message;
If subsequently received diameter protocol message response message, then it is used to search whether to preserve and the response report locally
The consistent sequence of message number of sequence of message number in text, if so, then recording the information of the response message.
Wherein, the characteristic information includes but not limited to one or more in following information:
User account, calling number, media access control address and IP address.
Fig. 3 is the flow chart of the method for the processing diameter protocol message of the embodiment of the present invention, as shown in figure 3, including
Below step:
The characteristic information of S10, registration diameter protocol message to be tracked;
S20, after receiving diameter protocol message, if judge the diameter protocol message carry characteristic information with
The characteristic information of registration is consistent, then records the information of the diameter protocol message.
As shown in Figure 1, device A and equipment B operation are on ip networks, between have diameter protocol message interaction, by setting
Standby A is sent in diameter requests to equipment B, and equipment B responds diameter requests.
Fig. 4 is the flow chart of the specific diameter sessions of tracking of a specific embodiment of the invention, including below step:
Step 101, the user account that Handwork register needs track in device A first (can also be that (media access MAC
Control) information such as address, IP address);
Step 102, device A receive diameter protocol message, judge whether to be request message, if so, turning to step
103, if it is not, then turning to step 105;
Step 103 unpacks diameter request messages, judge in message user account whether the user account with registration
It is identical, if inconsistent, directly abandon;If consistent, step 104 is turned to;
Step 104, the Hop-by-Hop Identifier (sequence of message number) in message, recorded message information are preserved;
In the same diameter sessions, the Hop-by-Hop Identifier values one of request message and response message
It causes, due to being typically free of the characteristic information for needing to track in response message, this method can find out satisfactory response message.
Step 105, for diameter response messages, judge Hop-by-Hop Identifier values and the thing in message
First save value comparison, if there are identical Hop-by-Hop Identifier values, if it does not, directly abandoning;If deposited
In recorded message information.
One of ordinary skill in the art will appreciate that all or part of step in the above method can be instructed by program
Related hardware is completed, and described program can be stored in computer readable storage medium, such as read-only memory, disk or CD
Deng.Optionally, all or part of step of above-described embodiment can also be realized using one or more integrated circuits.Accordingly
Ground, the form that hardware may be used in each module/unit in above-described embodiment are realized, the shape of software function module can also be used
Formula is realized.The present invention is not limited to the combinations of the hardware and software of any particular form.
It these are only the preferred embodiment of the present invention, certainly, the invention may also have other embodiments, without departing substantially from this
In the case of spirit and its essence, those skilled in the art make various corresponding changes in accordance with the present invention
And deformation, but these corresponding change and deformations should all belong to the protection domain of appended claims of the invention.