Message processing method and device thereof
Technical field
The present invention relates to communication technical field, particularly relate to a kind of message processing method and device thereof.
Background technology
The function of the general equal holding load equilibrium group of switch of current main-stream, equilibrium composition is basis equalization group and advanced equalization group.Basis equalization group take port as balanced group of member, and advanced equalization group is is member with basis equalization group balanced group, and cannot ports having member in advanced equalization group.The balanced group of basic load is similar to the port trunking of switch, and difference is: a port can join multiple balanced group simultaneously, and a port can only join an aggregation group.Advanced equalization group comprises multiple basis equalization group, after message is come in from advanced equalization group, and can in a data of each basis equalization group repeating.
Load balancing group (is generally route exchange device as safe shunting device, as switch or router) characteristic, as shown in Figure 1, common occupation mode is: safe shunting device is linked in the backbone network of user by optical splitter, when safe shunting device receives the flow of coming from the light splitting of prime equipment or mirror image, to the coupling of flow be carried out according to the configuration of ACL (Access Control List, Access Control List (ACL)) and carry out respective handling according to matching value.Wherein, directly abandon the message not mating any ACL, the message for coupling ACL is then redirected or is mirrored to port (for basis equalization group) or is redirected or is mirrored to balanced group (for advanced equalization group).After message is directed or is mirrored to basis equalization group, export in load balancing mode between each port of equilibrium group.This completes the process of a flow introducing, shunting, load balancing, carry out the process such as detection analysis and supervision for rear class device for flow amount.
Wherein, message is in equilibrium group, according to the header of message, as source MAC (Medium Access Control, media access control layer) address, target MAC (Media Access Control) address, source IP address, object IP address, TCP (Transmission Control Protocol, transmission control protocol)/UDP (User Datagram Protocol, user datagram protocol) port numbers etc., carry out HASH calculating (HASH is a kind of hashing algorithm), then select port according to HASH calculated value and forward the packet away.
Inventor is realizing in process of the present invention, finds that prior art at least exists following defect:
Carry out HASH calculating to heading information in equilibrium group after, reality has carried out certain classification to flow, but these classification values are not effectively taken in downlink traffic, are not namely effectively utilized by follow-up equipment.
Summary of the invention
The invention provides a kind of message processing method and device thereof, in order to solve the problem that balanced group of value of carrying out HASH calculating to message information effectively cannot be utilized by follow-up equipment.
Message processing method provided by the invention, be applied to the route exchange device of holding load equilibrium group, the method comprises:
After the route switching of holding load equilibrium group receives message, calculate the HASH value of this message, and according to the mapping relations of preset message HASH value and VLAN ID, obtain the VLAN ID corresponding with the HASH value of this message;
The VLAN ID got adds in described message by described route exchange device, and by described message repeating to two-layer switching equipment, forwards this message to make this two-layer switching equipment according to the VLAN ID in the VLAN forwarding-table item of configuration on it and this message.
The route exchange device of holding load equilibrium group provided by the invention, comprising:
Configuration module, for configuring and the mapping relation information of stored messages HASH value and VLAN ID;
Balanced group module, for after receiving message, calculates the HASH value of this message, and according to the message HASH value of configuration on it and the mapping relations of VLAN ID, obtains the VLAN ID corresponding with the HASH value of this message;
Message processing module (MPM), for the VLAN got ID is added in described message, and give the two-layer switching equipment with this equipment connection by designated port by described message repeating, forward this message to make this two-layer switching equipment according to the VLAN ID in the VLAN forwarding-table item of configuration on it and this message.
The Advantageous Effects of technique scheme of the present invention comprises:
The route exchange device supporting equilibrium to organize to make downstream route exchange device, according to VLAN ID, data are transmitted to corresponding server from the outbound port of corresponding VLAN, thus realizes data distribution in being carried on by the VLAN ID that HASH value is corresponding and E-Packeting.Compared with prior art, for supporting the route exchange device of balanced group, the requirement of this equipment to port number is reduced.
Another kind of message processing method provided by the invention, is applied to the route exchange device of holding load equilibrium group, and the routing device of described support equilibrium group is configured with the mapping relations of HASH value and Database Identification, the method comprises:
After the route switching that holding load equilibrium is organized receives message, calculate the HASH value of this message, and according to the message HASH value of configuration on it and the mapping relations of Database Identification, obtain the Database Identification corresponding with the HASH value of this message;
The Database Identification got adds in described message by described route exchange device, and according to the HASH value of described message by message described in port repeat corresponding in balanced group, utilize corresponding this message of database processing to make upstream device according to the Database Identification in this message.
The route exchange device of holding load equilibrium group provided by the invention, comprising:
Configuration module, for configuring the mapping relation information with stored messages HASH value and Database Identification;
Balanced group module, for after receiving message, calculates the HASH value of this message, and according to the message HASH value of configuration on it and the mapping relations of Database Identification, obtains the Database Identification corresponding with the HASH value of this message;
Message processing module (MPM), for the Database Identification got is added in described message, and according to the port repeat corresponding from balanced group of the HASH value of described message message, utilize corresponding this message of database processing to make upstream device according to the Database Identification in this message.
The Advantageous Effects of technique scheme of the present invention comprises:
During Database Identification corresponding for HASH calculated value is carried on and E-Packets by the route exchange device of the balanced group of support, index corresponding database to make the server in downstream according to this Database Identification and process.Compared with prior art, for server, save the Message processing expense of this equipment.
Accompanying drawing explanation
Fig. 1 is balanced group application schematic diagram in prior art;
Fig. 2 is one of balanced group application restriction schematic diagram in prior art;
Fig. 3 is balanced group application restriction schematic diagram two in prior art;
Fig. 4 is the schematic flow sheet of the embodiment of the present invention one;
Fig. 5 is the network architecture schematic diagram of the embodiment of the present invention one;
Fig. 6 is the schematic flow sheet of the embodiment of the present invention two;
Fig. 7 is the network architecture schematic diagram of the embodiment of the present invention two;
The structural representation of the route exchange device that Fig. 8 provides for the embodiment of the present invention;
The structural representation of another route exchange device that Fig. 9 provides for the embodiment of the present invention.
Embodiment
Due in existing load balancing group technique, support that the HASH value being used for load balancing calculating cannot be applied to follow-up equipment by the route exchange device of balanced group, under thus causing certain application scenarios, efficiency is short of to some extent.
As shown in Figure 2, on the one hand, when equilibrium group outbound port is more, can, supporting the access interface that the route exchange device of equilibrium group (the safe shunting device R1 of support equilibrium group in figure) upper consumption is a large amount of, require higher to the port density that equipment R1 supports.On the other hand, as shown in Figure 3, after flow is divided to each system, each System Take the treatment and analysis of a few class data.Such as, in existing realization, server will according to information such as the source MAC of data message, target MAC (Media Access Control) address, source IP address, object IP address, source port number, destination slogans, inquire about different databases respectively, like this, server is posed a big pressure, for especially true IPV6, is equivalent to the HASH computing completed being repeated equipment R1.
For the problems referred to above, the embodiment of the present invention proposes the Message processing mechanism based on equilibrium group, in order to solve the problem that balanced group of value of carrying out HASH calculating to message information effectively cannot be utilized by follow-up equipment.Below in conjunction with accompanying drawing, the embodiment of the present invention is described in detail.
See Fig. 4 and Fig. 5, it is the Message processing schematic flow sheet based on equilibrium group that the embodiment of the present invention one provides.By the present embodiment, can reduce and support that the port of the route exchange device of balanced group takies.
The network architecture of the present embodiment can be as shown in Figure 5, wherein, support that the route exchange device of balanced group (is expressed as the safe shunting device R1 supporting balanced group in figure, hereinafter referred to as equipment R1) be connected with two-layer switching equipment and (in figure, be expressed as Layer 2 switch S1, hereinafter referred to as equipment S1), be connected with each server under equipment S1.Equipment R1 is configured with message HASH calculated value and VLAN (Virtual Local Area Network, VLAN) mapping relations table, this table is embodied in the mapping relations of HASH key and VLAN-TAG (i.e. VLAN ID), equipment S1 is configured with VLAN forwarding-table item.
Based on this mapping relations table, the flow process of the present embodiment mainly comprises step 401 ~ 403:
Step 401, the inbound port of equipment R1 receives the message of upstream equipment transmission and after ACL fits through, carries out HASH calculating to the customizing messages of this message.
In concrete enforcement, equipment R1 according to the customizing messages of heading, as source MAC, target MAC (Media Access Control) address, source IP address, object IP address or TCP/UDP port numbers etc., can carry out HASH calculating, obtains the HASH value HASH key of message.
Step 402, equipment R1 is according to the HASH calculated value of configuration on it and the mapping relations table of VLAN-TAG, search the VLAN-TAG corresponding with the HASH key of this message, this VLAN-TAG is made an addition to this message, and forward this message by the outbound port of setting to equipment S1.
In concrete enforcement, can be corresponding with one or more appointment outbound port by different HASH key, by different flow HASH to this designated port.The outbound port of this setting can be a port in this balanced group, also can be multiple equilibrium group a port sharing.
Step 403, after the inbound port of equipment S1 receives this message, determines corresponding VLAN according to the VLAN-TAG in this message, determines corresponding outbound port according to corresponding VLAN forwarding-table item, and this message is transmitted to corresponding server from this outbound port.
In order to further illustrate above-mentioned flow process, below to divide stream packet to be specifically described according to the source IP address of message.When not using the present embodiment, source IP address is the HASH key of IP1 is key1, the outbound port that key1 is corresponding is the PORT1 being connected to server 1, by that analogy, like this, the message coming from IP1 is divided to server 1, and the message coming from IP2 is diverted to server 2, and the message coming from IP3 is diverted to server 3.In order to realize identical shunting effect, in the present embodiment, equipment R1 configuring message HASH calculated value as shown in table 1 and the mapping relations table of VLAN, equipment S1 configures VLAN forwarding-table item as shown in table 2:
The mapping relations of table 1, HASH calculated value and VLAN-TAG
HASH key |
Key1 |
Key2 |
Key3 |
VLAN-TAG |
TAG1 |
TAG2 |
TAG3 |
Outbound port |
PORT 5 |
PORT 5 |
PORT 5 |
The corresponding relation of table 2, VLAN and outbound port
VLAN-TAG |
VLAN1 |
VLAN 2 |
VLAN 3 |
PORT |
PORT 1 |
PORT 2 |
PORT 3 |
Wherein, Key1 is the HASH calculated value of IP1, and the outbound port of VLAN1 on equipment S1 that TAG1 the is corresponding port that to be PORT1, PORT1 be between equipment S1 and server 1, the corresponding relation of other IP address and VLAN outbound port by that analogy.
Like this, equipment R1 is receiving after source IP address is the message of IP1, Key1 is calculated according to IP1, corresponding TAG1 is found according to table 1, TAG1 is added to this message, as the outer TAG of this message, to enable equipment S1 mate corresponding VLAN according to this TAG, then this message is transmitted to equipment S1 from the port PO RT5 of this equipment by equipment R1.Equipment S1 is after receiving this message, and according to the TAG in this message, obtained the outbound port PORT1 of corresponding VLAN by the VLAN forwarding-table item inquired about on it, then bullet falls this TAG in message, and message is transmitted to server 1 from PORT1 processes.In like manner, being the message of IP2 for source IP address, being then transmitted to server 2 by PORT2 and processing, is the message of IP3 for source IP address, be then transmitted to server 3 by PORT3 and process.
Below only describe for the source IP address of message as Divergence Accordance, for the source IP address of message and tcp port number, or target ip address, or source MAC, or destination-mac address etc. is the situation of Divergence Accordance, its relevant configuration and handling process similar.
Description according to above the present embodiment can be found out, support that the VLAN ID (namely above-mentioned VLAN-TAG) that HASH value is corresponding is written in the head field E-Packeted by the route exchange device of balanced group, and by data HASH to same port repeat to two of downstream layers of route exchange device, to make these two layers of route exchange devices, according to VLAN ID, data are transmitted to corresponding server from the outbound port of corresponding VLAN, thus realize data distribution.Compared with prior art, for supporting the route exchange device of balanced group, the requirement of this equipment to port number is reduced.
See Fig. 6 and Fig. 7, it is the Message processing schematic flow sheet based on equilibrium group that the embodiment of the present invention two provides.By the present embodiment, the Message processing expense of upstream device can be reduced.
The network architecture of the present embodiment as shown in Figure 7, wherein, can support that the route exchange device of balanced group (being expressed as the safe shunting device R1 supporting balanced group in figure, hereinafter referred to as equipment R1) is connected with each server.Database adopts distributed deployment, and e.g., the database storing same type data can be distributed on each server, and the database storing same categorical data is assigned identical type identification.Equipment R1 is configured with the mapping relations table of message HASH calculated value and MAC Address, server 3 is configured with the mapping relations table of MAC Address and Service Database.
Based on above-mentioned mapping relations table, the flow process of the present embodiment mainly comprises step 601 ~ 603:
Step 601, the inbound port of equipment R1 receives the message of upstream equipment transmission and after ACL fits through, carries out HASH calculating to the customizing messages of this message.
During concrete enforcement, equipment R1 according to the customizing messages of heading, as source MAC, target MAC (Media Access Control) address, source IP address, object IP address or TCP/UDP port numbers etc., can carry out HASH calculating, obtains the HASH value HASH key of message.
Step 602, equipment R1 is according to the HASH calculated value of configuration on it and the mapping relations table of MAC Address, search the MAC Address corresponding with the HASH value of this message, this MAC Address is made an addition to this message as target MAC (Media Access Control) address, and according to HASH value, the outbound port that this message is corresponding in equilibrium group is forwarded.
Step 603, after the inbound port of server receives this message, according to the target MAC (Media Access Control) address in this message, utilizes corresponding Service Database to process this message.
Usually, various flows can HASH be different HASH key, like this, different HASH key is mapped as different MAC Address, and different MAC Address corresponds to different Service Databases, just can realize that various flows is mapped to different Service Databases and process.The present embodiment by setting up the mapping relations of HASH value and MAC Address on the route exchange device supporting balanced group, and according to these mapping relations, MAC Address corresponding for the HASH value with message being carried on message repeating to server as target MAC (Media Access Control) address, server just can according to the target MAC (Media Access Control) address fast mapping in message to the corresponding enterprising row relax of Service Database.And the message forwarded by existing balanced group technique is not owing to carrying the target MAC (Media Access Control) address in the present embodiment, therefore server analytic message header is again needed, calculate as information such as source MAC, target MAC (Media Access Control) address, source IP address, object IP address, source port, destination interfaces, thus match corresponding database.
In order to further illustrate above-mentioned flow process, below server 3 to be configured with the implementation procedure that 3 Service Databases describe this flow process.When not using the present embodiment, on server 3, corresponding IP1, IP2 and IP3 are configured with 3 Service Databases, it is IP1, IP2 and the message of IP3 (after namely carrying out HASH computing according to source IP address to message and be diverted to the port repeat be connected with server 3) that certain port of server 3 can receive source IP address, server 3 receives analytic message head after message, according to the source IP address parsed, message is mapped to corresponding database and processes.In order to realize identical shunting effect, in the present embodiment, set up the corresponding relation of MAC Address and Service Database, be equivalent to, with MAC Address identification service database, equipment R1 configure message HASH calculated value as shown in table 3 and the mapping relations table of MAC Address:
The mapping relations table of table 3, HASH calculated value and target MAC (Media Access Control) address
HASH key |
Key1 |
Key2 |
Key3 |
MAC |
MAC1 |
MAC 2 |
MAC 3 |
Outbound port |
PORT3 |
PORT3 |
PORT3 |
Wherein, Key1 is the HASH calculated value of IP1, and MAC1 is corresponding with database 1, and the corresponding relation of other HASHKey and MAC Address by that analogy.
Like this, equipment R1 is receiving after source IP address is the message of IP1, Key1 is calculated according to IP1, corresponding MAC1 is found according to table 3, this MAC Address is added to this message as target MAC (Media Access Control) address, to enable server mate corresponding Service Database 1 according to this object MAC, message is transmitted to server 3 (the equal corresponding outbound port PORT3 of HASH key1, key2 and key3) from the port PO RT3 of connection server 3 according to HASH value with the mapping relations of outbound port by equipment R1.Server 3, after receiving this message, indexes corresponding Service Database 1 according to the target MAC (Media Access Control) address MAC1 in this message and processes.In like manner, for source IP address be the message of IP2 after being diverted to server 3, server 3 indexes database 2 and processes, for source IP address be the message of IP3 after being diverted to server 3, server 3 indexes database 3 and processes.
Below only describe for the source IP address of message as Divergence Accordance, for the source IP address of message and tcp port number, or target ip address, or source MAC, or destination-mac address etc. is the situation of Divergence Accordance, its relevant configuration and handling process similar.
In addition, it is that example describes that message HASH value is mapped as target MAC (Media Access Control) address by the present embodiment, in fact, also can directly by the HASH value of message, or HASH value is mapped as other information and it can be used as and the identification information of identification database can be carried in message and send to upstream device (upstream device should be able to be resolved the Database Identification information of carrying in this message and can be carried out respective handling), also can realize the technique effect of the present embodiment.
Description according to above the present embodiment can be found out, support that MAC Address corresponding for HASH calculated value is written in the head field E-Packeted by the route exchange device of balanced group, index corresponding database to make the server in downstream according to this MAC Address and process.Compared with prior art, for server, save the Message processing expense of this equipment.
It should be noted that, above-described embodiment one and embodiment two can be combined.
Based on identical technical conceive, the embodiment of the present invention additionally provides a kind of route exchange device.
See Fig. 8, be the structural representation of the route exchange device that the embodiment of the present invention provides, the balanced group of this equipment holding load, can be applicable to the flow process shown in Fig. 4.This equipment can comprise:
Configuration module 801, for configuring and storing the mapping relation information of HASH value and VLAN ID;
Balanced group module 802, for after receiving message, calculates the HASH value of this message, and according to the message HASH value of configuration on it and the mapping relations of VLAN ID, obtains the VLAN ID corresponding with the HASH value of this message;
Message processing module (MPM) 803, for the VLAN got ID is added in described message, and give the two-layer switching equipment with this equipment connection by designated port by described message repeating, forward this message to make this two-layer switching equipment according to the VLAN ID in the VLAN forwarding-table item of configuration on it and this message.Wherein, described preassigned port can be port in load balancing group or the port shared by multiple equilibrium group.
See Fig. 9, be the structural representation of the route exchange device that the embodiment of the present invention provides, the balanced group of this equipment holding load, can be applicable to the flow process shown in Fig. 6.This equipment can comprise
Configuration module 901, for configuring and store the mapping relation information of HASH value and Database Identification;
Balanced group module 902, for after receiving message, calculates the HASH value of this message, and according to the message HASH value of configuration on it and the mapping relations of Database Identification, obtains the Database Identification corresponding with the HASH value of this message;
Message processing module (MPM) 903, for the Database Identification got is added in described message, and according to the port repeat corresponding from balanced group of the HASH value of described message message, utilize corresponding this message of database processing to make upstream device according to the Database Identification in this message.
Wherein, Database Identification can be MAC Address, and for identification database, Database Identification can be carried on the target MAC (Media Access Control) address field of message by message processing module (MPM) 903.
Through the above description of the embodiments, those skilled in the art can be well understood to the mode that the present invention can add required general hardware platform by software and realize, and can certainly pass through hardware, but in a lot of situation, the former is better execution mode.Based on such understanding, technical scheme of the present invention can embody with the form of software product the part that prior art contributes in essence in other words, this computer software product is stored in a storage medium, comprising some instructions in order to make a station terminal equipment (can be mobile phone, personal computer, server, or the network equipment etc.) perform method described in each embodiment of the present invention.
The above is only the preferred embodiment of the present invention; it should be pointed out that for those skilled in the art, under the premise without departing from the principles of the invention; can also make some improvements and modifications, these improvements and modifications also should look protection scope of the present invention.