CN103812957B - ARP record management method and apparatus - Google Patents

ARP record management method and apparatus Download PDF

Info

Publication number
CN103812957B
CN103812957B CN201210455618.8A CN201210455618A CN103812957B CN 103812957 B CN103812957 B CN 103812957B CN 201210455618 A CN201210455618 A CN 201210455618A CN 103812957 B CN103812957 B CN 103812957B
Authority
CN
China
Prior art keywords
arp
address
records
priority
response message
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.)
Active
Application number
CN201210455618.8A
Other languages
Chinese (zh)
Other versions
CN103812957A (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.)
Pinghu Xinna Communication Technology 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 CN201210455618.8A priority Critical patent/CN103812957B/en
Publication of CN103812957A publication Critical patent/CN103812957A/en
Application granted granted Critical
Publication of CN103812957B publication Critical patent/CN103812957B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Small-Scale Networks (AREA)

Abstract

The embodiment of the present invention provides a kind of ARP record management method and apparatus.Wherein, method includes:At least two ARP records are obtained, the ARP records include:The priority of IP address, MAC Address and the IP address with mapping relations;The IP address at least two ARP records is identical;Target ARP records are only stored, the target ARP records are the records of the priority at least two ARP records with highest IP address.The embodiment of the present invention can solve address conflict issues during shared floating IP address by the priority of the ARP IP address recorded.

Description

ARP record management method and apparatus
Technical field
The present embodiments relate to communication technical field, more particularly to a kind of ARP record management method And device.
Background technology
In ethernet networks, in order to message can correctly be transmitted in a network, it must be understood that the destination host of the message Physical address is medium access control(Medium Access Control, hereafter abbreviated with MAC)Address.For example, gateway receives To destination host A to be sent to message, the Internet Protocol of the host A is carried in message(Internet Protocol, Hereafter abbreviated with IP)Address(That is the purpose IP address of the message), it is purpose host A that gateway, which is needed the IP address conversion, MAC Address, message could be correctly sent to destination host A according to the MAC Address.Therefore, every main frame in network all needs An address resolution protocol is stored at itself(Address Resolution Protocol, hereafter abbreviated with ARP)Table, should ARP table is used to record the IP address of every main frame and the mapping relations of MAC Address in network, can will a wherein correspondence The mapping relations of individual main frame are referred to as an ARP record.
For certain main frame, in order to obtain the IP address of other main frames and the mapping relations of MAC Address(Below The mapping relations of abbreviation main frame), generally perform as follows:By taking host A and host B as an example, it is assumed that main frame known to host A B IP address, but the MAC Address of host B is not known, in order to obtain the mapping relations of host B, host A can be in a network An ARP request message is broadcasted, carries the IP address and the IP address of MAC Address and host B of host A oneself(Please as this Seek the purpose IP address of message).Host B is after the request message is received, by storage host A mapping relations, and unicast Arp response message is returned to host A, carries the IP address and MAC Address of host B, such host A has just got host B Mapping relations, follow-up host A directly can carry out message transmissions with host B.
In the message transmissions of prior art, if the message destination host failure to be sent, the purpose IP address of message Message dropping is caused with regard to unreachable;To strengthen the reliability of message transmissions, Floating IP address is devised, i.e. multiple host shares some IP, the IP are referred to as Floating IP address, but the synchronization IP is pertaining only to certain main frame in the multiple host, when possessing the Floating IP address Hostdown after, other main frames in multiple host can possess the Floating IP address, continue to and handle using the Floating IP address as The message of purpose IP address.The multiple host of the shared Floating IP address, can be with when determining which platform main frame to possess the Floating IP address by According to following strategy execution:With two main frames(Main frame 1 and main frame 2)Exemplified by sharing some Floating IP address, enter between two main frames Row heartbeat detection, it is specified that number small main frame possesses the Floating IP address automatically in the case of heartbeat is normal, number big main frame certainly It is dynamic not possess the Floating IP address;The numbering that it is host setting in advance that described numbering, which can be, e.g. 1,2 etc. Arabic numerals are compiled Number, it is assumed that it is that main frame 1 possesses the Floating IP address.Possess and taken in the ARR request messages that the main frame 1 of the Floating IP address can broadcast in a network Mapping relations with the Floating IP address Yu oneself MAC Address, with cause other main frames such as gateway in network receive ARR please The mapping relations between Floating IP address and the MAC Address of main frame 1 are recorded when seeking message, for being sent to the Floating IP address subsequently received Message when message is sent to main frame 1 according to MAC Address.Main frame 1 judges in the ARP request broadcasted in receiving network Purpose IP address in ARP request is one's own floating IP address, can reply arp response message, be carried in response message One's own floating IP address and the MAC Address of oneself.Other main frames that ARP request is sent in network are receiving ARP sound Answer the mapping relations between can record Floating IP address and the MAC Address of main frame 1 after message.
But above-mentioned multiple main frames are likely to occur following problem when sharing Floating IP address:Due between main frame 1 and main frame 2 By heartbeat detection opposite end whether failure, when opposite end is actually normal, for no other reason than that the reason such as heartbeat link failure causes heartbeat Message is obstructed, and so as to cause both sides all to think peer failure, both sides think possess the floating IP address, the i.e. He of main frame 1 Main frame 2 all thinks oneself to possess the Floating IP address, then carries oneself in the ARP request message that both sides can send in a network The mapping relations of MAC Address and the Floating IP address, or both sides can ring to destination address for the ARP request of the floating IP address Answer, the mapping relations of the MAC Address of oneself and the floating IP address are carried in response.And for the receiving terminal of ARP request message Such as gateway, then then recorded when the ARP records of record can be caused constantly to change, such as receiving the mapping relations of main frame 1 Floating IP address is corresponding with the MAC Address of main frame 1, Floating IP address is then recorded when receiving the mapping relations of main frame 2 with the MAC of main frame 2 The mapping relations of the main frame 1 of record before location corresponds to and replaced it;Due to the transmission of message be according to ARP record mapping relations and Forward-path is determined, so that using the Floating IP address as the message of purpose IP address, main frame 1 may be sent to for a moment, again for a moment Main frame 2 is sent to, causes business to occur abnormal, this service exception situation occurred in shared Floating IP address can be referred to as IP Address conflict.
The content of the invention
The embodiment of the present invention provides a kind of ARP record management method and apparatus, with avoiding the occurrence of IP Location conflicts.
On the one hand, the embodiment of the present invention provides a kind of ARP record management method, including:
At least two ARP records are obtained, the ARP records include:IP address with mapping relations, The priority of MAC Address and the IP address;The IP address at least two ARP records is identical;
Target ARP records are only stored, the target ARP records are that have highest IP at least two ARP records The record of the priority of address.
In method as described above, at least two ARP records of acquisition, including:Itself storage The first ARP records and the 2nd ARP records that are got afterwards in the first ARP records, the 2nd ARP record is Carried in the ARP request message that the transmitting terminal received is sent;
After the acquisition at least two ARP records, before the only storage target ARP records, Also include:
By the preferential of the IP address in the priority of the IP address in the 2nd ARP records, with the first ARP records Level is compared;
If the priority of the IP address in the 2nd ARP records, greater than or equal to the IP in the first ARP records The priority of location, it is determined that the 2nd ARP is recorded as the target ARP records;Otherwise, it determines the first ARP is recorded as The target ARP records;
When the 2nd ARP is recorded as the target ARP records, the target ARP that only stores is recorded, including:Using The 2nd ARP records are replaced the first ARP records and stored.
In method as described above, if the purpose IP address that the ARP request message carries is itself IP address;Then
To the transmitting terminal return arp response message, the arp response message carry itself ARP record, it is described itself APR record include:The priority of itself IP address, MAC Address and the IP address.
In method as described above, at least two ARP records of acquisition, including:Itself storage The first ARP records and the 2nd ARP records that are got afterwards in the first ARP records, the 2nd ARP record is Carried in the ARP response message that the transmitting terminal received is sent;
After the reception ARP response message, before the only storage target ARP records, also wrap Include:
It is determined that there is the preferential of highest IP address at least one analysis protocol arp response message received The 2nd ARP records of level, are recorded for the target ARP;
The target ARP that only stores is recorded, including:Using the 2nd ARP of the priority with highest IP address Record, replace the first ARP records.
In method as described above, at least one analysis protocol arp response message for determining to receive The ARP records of priority with highest IP address, including:
If IP in the 2nd ARP records that the ARP response message of receive first carries The priority of location, it is default limit priority, it is determined that first the 2nd ARP is recorded as the target ARP records.
In method as described above, at least one analysis protocol arp response message for determining to receive The ARP records of priority with highest IP address, including:
If IP in the 2nd ARP records that the ARP response message of receive first carries The priority of location, be not default limit priority, then after first arp response message is received, in addition to:
The 2nd ARP records in first arp response message are preserved, and start timer;
If in the range of the timing of the timer, first arp response message is only received, it is determined that the The 2nd ARP in one arp response message is recorded as the target ARP records;
If in the range of the timing of the timer, also received after first arp response message to A few arp response message, it is determined that there is highest in all arp response messages received in the range of the timing IP address priority the 2nd ARP record, as the target ARP record.
Second aspect, the embodiment of the present invention provide a kind of ARP record management method, including:
ARP record is sent, the ARP records include:The IP address of itself with mapping relations, The priority of MAC Address and the IP address of itself, include the purpose IP address of ARP request;
To cause the receiving terminal of the ARP records when getting at least two ARP records with identical IP address, There is the record of the priority of highest IP address at least two ARP records according to determining the priority of the IP address Stored for target ARP records.
As above the method described in second aspect, the transmission ARP records, including:ARP request message is sent, the ARP please Message is asked to carry the first ARP records of itself, and the purpose IP address of the ARP request message is the IP address of itself;Then
After ARP request message is sent, in addition to:
Arp response message is received, the arp response message carries the 2nd ARP and recorded, the IP in the 2nd ARP records IP address during address records with the first ARP is identical;
By the preferential of the IP address in the priority of the IP address in the first ARP records, with the 2nd ARP records Level is compared, if both are identical, it is determined that the transmitting terminal of the arp response message produces IP address conflict with itself.
The third aspect, the embodiment of the present invention also provide a kind of ARP record management device, including:
Acquisition module, for obtaining at least two ARP records, the ARP records include:With mapping The priority of the IP address of relation, MAC Address and the IP address;The IP address at least two ARP records It is identical;
Memory module, for only storing target ARP records, the target ARP records are at least two ARP records The record of priority with highest IP address.
Device as described above, the memory module, is specifically used for:
The priority of IP address during 2nd ARP is recorded, the priority of the IP address in being recorded with the first ARP are compared Compared with;
If the priority of the IP address in the 2nd ARP records, greater than or equal to the IP in the first ARP records The priority of location, it is determined that the 2nd ARP is recorded as the target ARP records;Otherwise, it determines the first ARP is recorded as The target ARP records;
When the 2nd ARP is recorded as the target ARP records, described first is replaced using the 2nd ARP records ARP records are stored.
Device as described above, in addition to:
Respond module, for returning to arp response message to transmitting terminal, the arp response message carries the ARP notes of itself Record, the APR records of itself include:The priority of itself IP address, MAC Address and the IP address.
Device as described above, the acquisition module, is specifically used for:
It is determined that there is the preferential of highest IP address at least one analysis protocol arp response message received The 2nd ARP records of level, are recorded for the target ARP;
The memory module, the 2nd ARP records using the priority with highest IP address are specifically additionally operable to, The first ARP records are replaced to be stored.
Device as described above, the acquisition module, is specifically additionally operable to:
If IP in the 2nd ARP records that the ARP response message of receive first carries The priority of location, it is default limit priority, it is determined that first the 2nd ARP is recorded as the target ARP records.
Device as described above, the acquisition module, is additionally operable to:
If IP in the 2nd ARP records that the ARP response message of receive first carries The priority of location, it is not default limit priority, then:
After first arp response message is received, second in first arp response message is preserved ARP is recorded, and starts timer;
If in the range of the timing of the timer, first arp response message is only received, it is determined that the The 2nd ARP in one arp response message is recorded as the target ARP records;
If in the range of the timing of the timer, also received after first arp response message to A few arp response message, it is determined that there is highest in all arp response messages received in the range of the timing IP address priority the 2nd ARP record, as the target ARP record.
Fourth aspect, the embodiment of the present invention also provide a kind of ARP record management device, including:
Sending module, for sending ARP record, the ARP records include:With mapping relations from The priority of the IP address of body, MAC Address and the IP address of itself, include the purpose IP address of ARP request;
Memory module, the receiving terminal for ARP records are getting at least two ARP with identical IP address During record, there is the preferential of highest IP address at least two ARP records according to determining the priority of the IP address The target ARP records that are recorded as of level are stored.
As above the device described in fourth aspect, in addition to:
Collision detection module, is used for:
Arp response message is received, the arp response message carries the 2nd ARP and recorded, the IP in the 2nd ARP records IP address during address records with the first ARP is identical;
By the preferential of the IP address in the priority of the IP address in the first ARP records, with the 2nd ARP records Level is compared, if both are identical, it is determined that the transmitting terminal of the arp response message produces IP address conflict with itself.
As above the device described in fourth aspect, in addition to:
Respond module, for receiving transmitting terminal ARP request message, and determine what the ARP request message carried When purpose IP address is the IP address of itself, arp response message is sent to the transmitting terminal, and in the arp response message Carry own IP address, MAC Address and IP address priority.
ARP record management method and apparatus provided in an embodiment of the present invention, by obtaining at least two The ARP record of identical IP address, and the priority for including IP address in the ARP records obtained, the present embodiment The record of the priority at least two ARP records with highest IP address is only stored according to the priority of IP address, so as to Can solve the problems, such as IP address conflict caused by occurring double main or how main situations during more collaborative share floating IP address, therefore can keep away Exempt from the service exception situation caused by IP address conflict.
Brief description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing There is the required accompanying drawing used in technology description to be briefly described, it should be apparent that, drawings in the following description are this hairs Some bright embodiments, for those of ordinary skill in the art, without having to pay creative labor, can be with Other accompanying drawings are obtained according to these accompanying drawings.
Fig. 1 is the flow chart of ARP record management embodiment of the method one of the present invention;
Fig. 2 is the flow chart of ARP record management embodiment of the method two of the present invention;
Fig. 3 is the flow chart of ARP record management embodiment of the method three of the present invention;
Fig. 4 is the realization principle frame diagram in Fig. 3 embodiments of the present invention;
Fig. 5 is the schematic diagram of the ARP frame formats in Fig. 3 embodiments of the present invention;
The flow chart of Fig. 6 ARP record management embodiments of the method four of the present invention;
Fig. 7 is the heartbeat detection schematic diagram in ARP record management embodiment of the method for the present invention;
Fig. 8 is more IP address schematic diagrames in ARP record management embodiment of the method for the present invention;
Fig. 9 is the structural representation of ARP record management device embodiment one of the present invention;
Figure 10 is the structural representation of ARP record management device embodiment two of the present invention;
Figure 11 is the structural representation of ARP record management device embodiment three of the present invention;
Figure 12 is the structural representation of ARP record management device embodiment four of the present invention;
Figure 13 is the structural representation of ARP record management device embodiment five of the present invention.
Embodiment
To make the purpose, technical scheme and advantage of the embodiment of the present invention clearer, below in conjunction with the embodiment of the present invention In accompanying drawing, the technical scheme in the embodiment of the present invention is clearly and completely described, it is clear that described embodiment is Part of the embodiment of the present invention, rather than whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art The every other embodiment obtained under the premise of creative work is not made, belongs to the scope of protection of the invention.
The embodiment of the present invention is to solve in ethernet networks, and address conflict when multiple devices share floating IP address is asked IP address, can be uniquely attributed to an equipment therein, to realize message according to the preferential grading of IP address by topic Row correctly transmission.
It is described in detail respectively by the following examples.
Fig. 1 is the flow chart of ARP record management embodiment of the method one of the present invention, what the embodiment provided ARP record management method is the method that receiving device is realized.As shown in figure 1, the method for the present embodiment It can include:
S101, at least two ARP records are obtained, ARP, which is recorded, to be included:IP with mapping relations The priority of address, MAC Address and IP address;IP address at least two ARP records is identical;
Wherein, the ARP records of acquisition can include:For example, it may be what is obtained before current have stored in network and sets APR records in standby, storage is in a network in the ARP address mapping table of any appliance;Or or in sending ending equipment It is sent to what is carried in the APR request messages of receiving device, it includes the IP address of sending ending equipment, MAC Address and connect The IP address of receiving end equipment;Or can also be that receiving device is sent in the APR response messages of sending ending equipment and carried, It includes the IP address of receiving device and the IP address of MAC Address and sending ending equipment.
Wherein, the priority of IP address can be the order of priority that any appliance possesses the IP address, for example, number can be used Word 0,1,2,3 ... represent successively IP address priority by it is high on earth, it will be assumed that priority 0 be limit priority, is secondly 1, then Secondary is 2 etc., i.e. the smaller person of priority value, and priority is higher, and the higher person of priority more preferentially possesses IP address.It is but of the invention The optional arbitrary code of priority of IP address define, such as can also be represented with such as A, B, C, D ... IP address priority by Height is on earth, it will be assumed that the priority highest for the IP address that A is represented.The form of IP address priority of the embodiment of the present invention does not limit System, however it is not limited to only with numeral come define the rank of IP address priority height;Priority rule is not also limited.IP is set The effect of the priority of location is in order that shared IP address is possessed by the equipment of highest priority, in order to convenient to equipment The transmission of message is carried out according to the priority of IP address.
The above-mentioned network equipment be carry out data interaction physical equipment, can be PC, interchanger, router etc. all can To be linked into the physical equipment in network.
Specifically, in the present embodiment, when two collaborative share IP address of transmitting terminal, in the message that they each send ARP records the priority for including respective IP address, and receiving terminal can obtain the ARP records of transmitting terminal, can obtain in ARP records Transmitting terminal IP address priority.
It is illustrated below:
So that gateway obtains the ARP records of multiple servers as an example, when multiple servers share a floating IP address, net The request message for receiving multiple servers is closed, due to carrying the IP address of each server, MAC Address and IP address in message Priority, gateway can obtain the records of the APR with IP address priority of each server.
S102, target ARP records are only stored, target ARP records are that have highest IP address at least two ARP records Priority record.
Wherein, the target ARP records can be in the ARP records of above-mentioned at least two equipment with identical IP address The priority highest ARP records of IP address, priority as escribed above is 0 IP address, sets priority highest one It is standby really to possess the floating IP address.
For example, when receiving device receives request message, what is carried in request message is target ARP records, if this connects ARP records are previously stored with receiving end ARP table, the IP of priority and itself storage during just the ARP newly received is recorded The priority of address is compared, low with the high original priority of replacement of priority, only stores the high target ARP notes of priority Record;If the priority of the former ARP records prestored is high after relatively, do not replace, retain former ARP records.
The ARP record management method that the present embodiment provides, by obtaining at least two identical IP address ARP record, and include the priority of IP address in the ARP records obtained, the equipment of highest priority is most After can really possess floating IP address.When the present embodiment can solve more collaborative share floating IP address according to the priority of IP address Caused by there are double main or how main situations the problem of IP address conflict, therefore the service exception caused by IP address conflict can be avoided Situation.
Fig. 2 is the flow chart of ARP record management embodiment of the method two of the present invention, what the embodiment provided ARP record management method is the method that sending ending equipment corresponding with above-mentioned embodiment illustrated in fig. 1 is realized, As shown in Fig. 2 the method for the present embodiment can include:
S201, ARP record is sent, ARP records can include:The IP of itself with mapping relations The priority of location, MAC Address and the IP address of itself, include the purpose IP address of ARP request;
It is illustrated below:
Specifically, in above-mentioned example, when multiple servers share a floating IP address, multiple servers send request Message carries the priority of the IP address of each server, MAC Address and IP address, i.e. sending ending equipment to gateway in message What is carried in request message is the ARP records of itself.
S202, cause the receiving terminal of ARP records when getting at least two ARP records with identical IP address, The priority for being determined to have highest IP address at least two ARP records according to the priority of IP address is recorded as target ARP records are stored.
Such as above-mentioned example, server sends request message to gateway so that gateway is being got with identical IP address At least two-server two ARP record when, according to the priority of the IP address of each server determine obtain ARP record In have highest IP address priority be recorded as target ARP record stored.For example the priority of server 1 is high, then The only ARP records of storage server 1.
The ARP record management method that the present embodiment provides, is passed through by least two sending ending equipments The ARP record of itself is sent, the ARP records the priority that can include respective IP address, and priority is most High equipment finally can really possess floating IP address.The present embodiment can realize the mapping of the IP address of MAC and highest priority, Solves service exception situation caused by sharing the IP address conflict easily occurred during Floating IP address.
During the network equipment in the present invention communicates, each equipment is either used as transmitting terminal or receiving terminal, and it is reported All recorded in text containing respective ARP, the ARP is recorded in addition to transmitting terminal IP address is carried, and also carries the excellent of transmitting terminal IP address First level.Other side also correspondingly obtains ARP records, not only records MAC Address corresponding to IP address, also records the preferential of IP address Level.The network equipment and also can carry out described in following each embodiment to the update method of the ARP table stored in equipment, In examples below, it is described in detail below with the communication scenes of a gateway and two-server:
Fig. 3 is the flow chart of ARP record management embodiment of the method three of the present invention, and Fig. 4 is Fig. 3 of the present invention Realization principle frame diagram in embodiment, Fig. 5 is the schematic diagram of the ARP frame formats in Fig. 3 embodiments of the present invention, such as Fig. 3-5 institutes Show, the present embodiment is on the basis of above-described embodiment one, and net is described using a gateway and two-server communication process The request message of the reception server is closed, and the technical scheme being managed is recorded to the ARP of the request message of reception.
Concrete scene can be the network of specific small range, also may be used as shown in figure 4, wherein, 10 in Fig. 4 be Ethernet Expand to the network of current routine.Server 1 and server 2 are all configured with identical IP address in Fig. 4, for example, (1.0.0.1), while being configured with different IP address priority, the IP address priority of server 1 is 0, server 2 The IP address priority be 1, it is assumed that priority 0 is higher than priority 1.
As shown in figure 3, the method for the present embodiment can include:
The ARP request message that S301, gateway the reception server are sent, obtain at least two ARP records;
Wherein ARP records include, and gateway itself storage of the present embodiment records for the first ARP;
After the request message of the reception server, recorded what the first ARP records were got afterwards for the 2nd ARP, the 2nd ARP Record is carried in the ARP request message that the transmitting terminal received is sent;
For example, the first ARP that itself is stored in gateway is recorded as IP address and is(1.0.0.1)Priority be 1, i.e., it is corresponding Server 2, the request message of server 1 and server 2 is then received again, corresponds to priority 0 and priority 1 respectively, preferentially The rank of level 0 is high;After reception, gateway can carry out the management of ARP records according to priority in the following step.
Above-mentioned ARP records are stored in the APR tables of each equipment with ARP record frame formats, first below to the present embodiment ARP frame formats are described in detail in.
ARP is Internet Engineering Task group(Internet Engineering Task Force, IETF)The address of definition Analysis protocol, realize and its physical address is obtained by IP address.By taking ethernet environment as an example, in order to correctly be passed to destination host Deliver newspaper text, it is necessary to which 32 IP address conversions of destination host are turned into the MAC Address of 48 Ethernets.This is just needed in interconnection layer It by IP address conversion is respective physical address to have one group of service, and this group of agreement is exactly ARP protocol.Communicating pair equipment is using identical The ARP protocol of ARP frame formats could realize the process being in communication with each other.
As shown in figure 5, ARP frames can include Ethernet stem and data frame part in the embodiment of the present invention.The present embodiment In, in the ARP frame formats of Ethernet, in addition to original parameter, increase transmitting terminal IP address priority parameters, account for a byte.This Sample, in addition to Ethernet stem, the new ARP data frames part of the present embodiment is 29 bytes, and existing ARP data frames part is 28 Individual byte.
Specifically, the ethernet address in ARP frame formats is MAC Address, the first two field in Ethernet stem header It is purpose ethernet address, i.e. MAC Address(6 bytes)And source ethernet address, i.e. source MAC(6 bytes).Destination address It is broadcast address for complete 1 special address.All Ethernet interfaces on cable will receive the data frame of broadcast.
The ethernet frame type of two byte longs represents the type of subsequent data.For ARP request or response, the word The value of section is 0x0806.
Hardware(hardware)And agreement(protocol)For describing each field in ARP packets.For example, one ARP request packet inquiry protocol address(Here it is IP address)Corresponding hardware address(Here it is ethernet mac address).Its In, type of hardware field represents the type of hardware address.Its value is 1, that is, represents ethernet address.Protocol type field represents The protocol address type to be mapped.Its value is 0x0800, that is, represents IP address.The field of ensuing two 1 bytes, hardware Address size and length of protocol address point out the length of hardware address and protocol address respectively, in units of byte.For ether For the ARP request of online IP address or response, their value is respectively 6 and 4.
Operation field OP points out four kinds of action types, and they are ARP requests(It is worth for 1), arp reply(It is worth for 2), RARP please Ask(It is worth for 3)With RARP responses(It is worth for 4), wherein RARP(Reverse Address Resolution Protocol)To be inverse Address resolution protocol.This field is required, because ARP request and the frame type field value of arp reply are identicals.
Ensuing five fields are the hardware address of transmitting terminal(It is ethernet address in this example), transmitting terminal association Discuss address(IP address), the present invention distinctive transmitting terminal IP address priority, purpose ethernet address and purpose IP address.Here There are some duplicate messages:There is the hardware address of transmitting terminal in the data frame header of Ethernet and in ARP request data frame.
Wherein, by taking the ARP records carried in the APR request messages that receiving device receives from sending ending equipment as an example, Also include the priority of the IP address of sending ending equipment in the record.Therefore the transmitting terminal IP address in above-mentioned APR frame formats Priority is exactly the priority of the IP address included in ARP frames of the embodiment of the present invention, be ARP frames of the present invention be different from it is existing The place of ARP frame formats.
It is noted that IP address priority is not limited to be only located at Fig. 5 in ARP frame formats in the embodiment of the present invention Shown position, rank numbering or arbitrary code, level rule are not also limited.
For an ARP request, the every other field in addition to purpose ethernet address has Filling power.When being After system receives the ARP request message that a destination is the machine, it is just filled into hardware address, then with two destinations Two transmitting terminal addresses are replaced in location respectively, and operation field is set to 2, and finally it is sent back to.So every equipment just has The first ARP record of itself initial storage.
The 2nd ARP records in the ARP got records and the first ARP of itself storage are recorded progress by S302, gateway The comparison of the priority of IP address, it is determined that needing the target ARP records stored;
Specifically, receiving device, which receives request message, can check in the ARP table of storage whether have corresponding ARP to remember Record, if not then ARP records are stored, and by the priority of the IP address in the 2nd ARP records, with the first ARP records The priority of IP address be compared;
In above-mentioned example, IP address is during gateway records the 2nd ARP got(1.0.0.1)Priority be 0 2nd ARP of server 1 is recorded and IP address is(1.0.0.1)Priority be 1 server 2 the 2nd ARP record and net The IP address priority for closing itself storage is compared;To determine that target ARP is recorded, that is, use it to update the first ARP records.
S303, according to comparative result, only store target ARP records;
It is preferential greater than or equal to the IP address in the first ARP records if the priority of the IP address in the 2nd ARP records Level, it is determined that the 2nd ARP is recorded as target ARP records;Otherwise, it determines the first ARP is recorded as target ARP records;Store excellent The high ARP records of first level.
Can be specifically that the first ARP is replaced using the 2nd ARP records when the 2nd ARP is recorded as target ARP records Record.
Specifically, the recipient of ARP request can according to the transmission side mac address in the ARP request received and IP Whether location and priority, detecting in the ARP table of the machine has record corresponding to the IP address.If so, judge what is recorded in ARP table Whether IP address priority is higher than sender's IP address priority, if it is, ARP records are not updated, otherwise using sender's IP address priority update ARP is recorded, and records the MAC Address of sender and the mapping relations of IP address, and IP address is preferential Level.
For example, in above-mentioned scene, the priority level of server 1 is 0, the priority 1 of the server 2 stored higher than original, that The 2nd ARP records for being just 0 with the priority level of server 1 replace the first ARP of original and record and stored.
S304, gateway return to arp response message to server, and arp response message carries the ARP records of itself, itself APR records include:The priority of itself IP address, MAC Address and IP address.
Specifically, the purpose IP address that the recipient of ARP request judges in message is the IP address of the machine, sending ARP should Message is answered, transmitting terminal ethernet address is the MAC Address of the machine in message, and transmitting terminal IP address is the IP address of the machine, is sent IP address priority is held as the priority of the IP address set.
For example, gateway is with returning to IP address, MAC Address and the IP of arp response message carrying gateway itself to server The priority of location, after obtaining so as to server, it can be achieved to be communicated with gateway.
The ARP record management method that the present embodiment provides, at least two identical IP are obtained by gateway The ARP record of address, and compared with the ARP records of itself storage, it is determined that needing the target ARP stored Record, so, the priority that gateway can constantly update the IP address of itself storage is highest level, and can be according to the excellent of IP address First level correctly sends message, solves IP address conflict caused by occurring double main or how main situations during more collaborative share floating IP address The problem of, therefore the service exception situation caused by IP address conflict can be avoided.
Fig. 6 is the flow chart of ARP record management embodiment of the method four of the present invention, and the present embodiment describes , it is in the scene shown in Fig. 4, gateway receives response, to obtain after actively request message is sent before ARP records aging Take the ARP of each server to record, realize the technical scheme that continuous renewal is kept to ARP table.
As shown in Figure 4 and Figure 6, the method for the present embodiment can include:
The arp response message that S601, gateway the reception server are sent, obtain at least two ARP records;
At least two ARP records obtained, including:The first ARP records of itself storage and the The 2nd ARP records that one ARP records are got afterwards, the 2nd ARP records are the address resolution sent in the transmitting terminal received Carried in agreement arp response message;
Specifically, to adapt to the change of network, ARP table needs to constantly update.Dynamic mapping in ARP table not has forever Effect, each record have a life cycle, and the record that reaching cannot still refresh life cycle will be deleted from ARP table Remove, this life cycle is referred to as ageing time.It is refreshed if noted down before life cycle is reached, when recalculating aging Between.
Before a Dynamic ARP is recorded into aging, system can be detected first, that is, send the ARP for including the IP address Request message.
For example, the gateway of ARP request side sends the ARP request message for including own IP address, the first ARP records in Fig. 4 For the ARP records of existing former server in gateway, the 2nd ARP for then receiving server is recorded as what gateway received The ARP records of the server of response message in arp reply;
The 2nd ARP records in the ARP got records and the first ARP of itself storage are recorded progress by S602, gateway The comparison of priority, it is determined that needing the target ARP records stored;
It is specific to be to determine at least one analysis protocol arp response message received that there is the excellent of highest IP address The 2nd ARP records of first level, are recorded for target ARP;
For example, in Fig. 4 server 1 highest priority, then be target ARP record;
This step can specifically include:
If IP address in the 2nd ARP records that first ARP response message receiving carries Priority, it is default limit priority, it is determined that first the 2nd ARP is recorded as target ARP records.
Specifically, in above-mentioned example, i.e., ARP should for the IP address of opposite end server in the arp reply that gateway judgement receives The priority of the transmitting terminal IP address in message is answered, to determine the need for continuing waiting for other arp replys.If ARP should The priority for answering middle peer IP address is highest priority 0, then withouts waiting for, directly using the opposite end in the arp reply MAC Address and IP address and IP address priority update ARP records.
Or this step can also specifically include:
If IP address in the 2nd ARP records that first ARP response message receiving carries Priority, it is not default limit priority, then after first arp response message is received, can also includes:
The 2nd ARP records in first arp response message are preserved, and start timer;
If in the range of the timing of timer, first arp response message is only received, it is determined that first ARP The 2nd ARP in response message is recorded as target ARP records;
If in the range of the timing of timer, at least one ARP is also received after first arp response message Response message, it is determined that excellent with highest IP address in all arp response messages received in the range of timing The 2nd ARP records of first level, are recorded as target ARP.
Specifically, in above-mentioned example, if the IP address priority of the opposite end server in response is not that highest is preferential Level 0, then ARP records are not updated, but preserve the arp reply received, and wait the regular hour, such as 500 milliseconds.If Arp reply is received again within the stand-by period, whether the IP address priority for judging opposite end in arp reply is limit priority 0, such as Fruit is directly to update ARP records.If not limit priority 0, judge whether in the arp reply message than currently preserving Peer IP address priority is higher, if higher, the arp reply currently preserved is updated using this arp reply.Stand-by period surpasses Shi Hou, directly using the opposite end MAC Address and IP address and IP address priority update of the arp reply Message Record currently preserved ARP is recorded.
S603, according to comparative result, only store target ARP records;
Such as the 2nd ARP records of the priority with highest IP address can be used, replace the first ARP records.
Within a specified time if can not receive response message, system will be repeated to send, and the number for repeating to send is visited by aging Number is surveyed to determine.If it exceeds the aging detection number set, refreshes this record, this ARP notes still without response message Record will be deleted.
Equally, after ARP records aging, main frame sends ARP probe requests therebies, after receiving arp reply, is done using above-mentioned processing Method renewal ARP records.
In the present embodiment, stand-by period and aging detection number and the number for repeating to send are not limited, can basis Need to set.
The ARP record management method of the embodiment of the present invention, by gateway in certain time constantly to certainly The renewal of the ARP record sheets of body, the correctness and availability of ARP table can be kept.
Further, another characteristic of ARP is referred to as gratuitous ARP (gratuitousARP) in the various embodiments described above, and it refers to Main frame sends ARP and searches the IP address of oneself, i.e., purpose IP address is the IP address of oneself in the ARP request of transmission.Generally, When it occurs to enter during System guides line interface configuration.The effect of gratuitous ARP has two kinds.The first is exactly declaration broadcast Effect, to tell whole broadcast domain, what the MAC Address corresponding to this IP address is at present.Second is to look to broadcast The IP address of oneself is used either with or without other main frame in domain, if used, " IP address conflict " printed words are ejected on interface, With warning system keeper.In all-network equipment(Including computer network interface card)When upgrading, it can all send such free ARP is broadcasted, to declare and confirm either with or without conflict.
The processing of gratuitous ARP, main frame or equipment are sent in ARP request, and transmitting terminal IP address is the machine address, purpose IP Location is also the machine address, and local IP address priority is carried in transmitting terminal IP address priority.Should if receiving ARP Answer, the IP address of answer party is identical with local terminal IP address, and IP address priority is also identical with local terminal IP address priority, then Illustrate there is IP address conflict on network, the alarm for having IP address conflict on network can be produced.If receiving arp reply, answer party Although IP address it is identical from local terminal IP address but IP address priority is different, then the two IP address do not conflict, it is not necessary to produce There is the alarm of IP address conflict on raw network.
Specific coming into force for IP address is realized by ARP protocol, can still use gratuitous ARP first, that is, possess Floating IP address The server of address is by sending ARP request, and the purpose IP address in ARP request is the IP address of oneself, transmitting terminal IP address Also it is the IP address of oneself, the MAC Address of transmitting terminal is the MAC Address of oneself, and the request is gratuitous ARP.Other gateways connect After receiving the ARP request, according to transmitting terminal IP address in message and transmitting terminal MAC Address, ARP table is updated, establishes the IP address With the mapping relations of MAC Address.So, when gateway receives the message for being sent to the IP address, ARP table is inquired about, is obtained corresponding MAC Address, transmit the message to corresponding server.
Further, in the various embodiments described above of the present invention, the step of following heartbeat detections can also be increased, specifically describe such as Under:
Fig. 7 be ARP record management embodiment of the method for the present invention in heartbeat detection schematic diagram, such as Fig. 7 Shown, the present embodiment is that further the heartbeat detection of increase equipment room, the present embodiment can include on the basis of Fig. 3:
Heartbeat detection itself is carried out between another terminal, another terminal is the terminal with itself sharing Floating IP address.
For example, in Fig. 7, further progress heartbeat detection between the two-server of floating IP address is shared, according to certain Tactful ruling any platform server should possess Floating IP address.
Specifically, two-server has a numbering, when heartbeat is normal, small server is numbered with possessing the IP automatically Location, number big server and do not possess the IP address automatically.When there is a server failure, because repeatedly can not receive other side's Heartbeat message, local terminal server think that opposite end is unavailable, and local terminal can possess the Floating IP address.Numbering therein can be arbitrary code, Coding rule is also any.
When at least two-server is communicated, at least two equipment carry out a heartbeat detection at regular intervals, Whether detection connects normal with its other party.Such as client one heartbeat detection data frame of every 5 minutes hairs, service end receive number Represent to pass through according to frame, i.e. communication is normal, otherwise represents that client disconnects, communication connection is abnormal.
The present embodiment is with the embodiment identical shown in Fig. 3, on server 1 and server 2 with being configured with identical IP , there is different IP address priority location, and the IP address priority on server 1 is 0, and the IP address priority on server 2 is 1. server 1 is arranged to(IP:1.0.0.1 priority 0), server 2 is arranged to(IP:1.0.0.1 priority 1), it is assumed that it is preferential 0 rank of level is high, unlike embodiment in above-mentioned Fig. 3, has heartbeat detection between server 1 and server 2, is cut out by heartbeat Certainly which server should possess IP address.The ARP that purpose IP address is the IP address will be responded by possessing the server of IP address Request, the server that ruling does not possess the IP address are not responding to the ARP request that purpose IP address is the IP address.
For the present embodiment when heartbeat detection server 1 and server 2 communicate normal, gateway obtains the corresponding of server 1 The priority of MAC Address and IP address, respective communication will be carried out with server 1.
In the embodiment, the message of ARP request/response is same as the previously described embodiments, also carries the excellent of sender's IP address First level, the processing to IP address priority are also same as the previously described embodiments.
The present embodiment can further be possessed by heartbeat detection IP address by a unique station terminal, can be more effective Avoid producing IP address conflict problem.
Further, the various embodiments described above are only by taking two-server and a gateway device as an example, and only one floating Dynamic IP address, but the present invention is not limited thereto, for example, when there is a multiple servers, while also multiple shared floating IP address when, , can be by the preferential of the different respective different IP of IP address setting when every equipment needs to possess multiple floating IP address Level, the same thought that the present invention can be achieved, is described in detail below in conjunction with Fig. 8.
Fig. 8 be ARP record management embodiment of the method for the present invention in more IP address schematic diagrames, this implementation Example is one server of increase on the basis of Fig. 3 embodiments, and it is multiple that each server, which needs shared floating IP address,.
As shown in figure 8, in the present embodiment, the message format of ARP request/response is identical with the embodiment in Fig. 3, to IP The processing of location priority is also identical.Unlike, the multiple servers of more than two share floating IP address, and with having multiple IP Location, each IP address are corresponding with multiple servers, and simply IP address priority is different.Each server has having for oneself The IP address of limit priority 0, and the IP using the IP address of the limit priority of other servers as the low priority of oneself Address.
Specifically, as shown in figure 8, server 1 is arranged to(IP:1.0.0.1 priority 0, IP:1.0.0.2 priority 1, IP:1.0.0.3 priority 2), server 2 is arranged to(IP:1.0.0.2 priority 0, IP:1.0.0.3 priority 1, IP: 1.0.0.1 priority 2), server 3 is arranged to(IP:1.0.0.3 priority 0, IP:1.0.0.1 priority 1, IP:1.0.0.2 Priority 2), then if in server 1 and abnormal server 2, gateway obtains the corresponding MAC Address of server 3 and more The priority of individual IP address, respective communication will be carried out with 3 each IP address of server.
The present embodiment sets different priority by same equipment to different IP addresses, can be achieved between multiple servers Mutual assistance, any server failure all can take over the business of the server by some other normal servers by.
Fig. 9 is the structural representation of ARP record management device embodiment one of the present invention, as shown in figure 9, The ARP record management device that the present embodiment provides is the device corresponding with the embodiment of the method shown in Fig. 1, The device can include:
Acquisition module 901, it can include for obtaining at least two ARP records, ARP records:Have The priority of the IP address of mapping relations, MAC Address and IP address;IP address at least two ARP records is identical;
Memory module 902, for only storing target ARP records, target ARP records are that have at least two ARP records The record of the priority of highest IP address.
The ARP record management device that the present embodiment provides, at least two phases are obtained by acquisition module ARP with IP address records, and the priority for including IP address in the ARP records obtained, highest priority Equipment finally can really possess floating IP address.The present embodiment can solve more collaborative shares according to the priority of IP address and float Caused by occurring double main or how main situations during IP address the problem of IP address conflict, therefore it can avoid caused by IP address conflict Service exception situation.
Further, the device in above-described embodiment, at least two ARPs that acquisition module 901 obtains Record, can include:The first ARP records of itself storage and the 2nd ARP records got afterwards in the first ARP records, 2nd ARP records are carried in the ARP request message that the transmitting terminal received is sent;
Memory module 902, is specifically used for:
The priority of IP address during 2nd ARP is recorded, the priority of the IP address in being recorded with the first ARP are compared Compared with;
It is preferential greater than or equal to the IP address in the first ARP records if the priority of the IP address in the 2nd ARP records Level, it is determined that the 2nd ARP is recorded as target ARP records;Otherwise, it determines the first ARP is recorded as target ARP records;
When the 2nd ARP is recorded as target ARP records, is recorded using the 2nd ARP and replace the first ARP records.
Acquisition module 901 in above-described embodiment, specifically at least one analysis protocol arp response for determining to receive The 2nd ARP records of the priority with highest IP address in message, are recorded for target ARP;
Memory module 902, specifically it is additionally operable to use the 2nd ARP records of the priority with highest IP address, replaces First ARP is recorded.
Figure 10 is the structural representation of ARP record management device embodiment two of the present invention, such as Figure 10 institutes Show, the ARP record management device that the present embodiment provides, can be with the basis of said apparatus embodiment one Including:Respond module 903, is used for:
Arp response message is returned to transmitting terminal, arp response message carries the ARP records of itself, and the APR records of itself can With including:The priority of itself IP address, MAC Address and IP address.
It is in order to which when upgrading or updating whole network, each equipment is by sending the IP address of itself to set respond module And the priority of IP address, to avoid occurring the IP address conflict problem of " double masters " in system.
Further, the device in the various embodiments described above, acquisition module 901, is specifically additionally operable to:
If IP address in the 2nd ARP records that first ARP response message receiving carries Priority, it is default limit priority, it is determined that first the 2nd ARP is recorded as target ARP records.
Device in each embodiment as described above, acquisition module 901, is additionally operable to:
If IP address in the 2nd ARP records that first ARP response message receiving carries Priority, it is not default limit priority, then:
After first arp response message is received, the 2nd ARP records in first arp response message are preserved, and Start timer;
If in the range of the timing of timer, first arp response message is only received, it is determined that first ARP The 2nd ARP in response message is recorded as target ARP records;
If in the range of the timing of timer, at least one ARP is also received after first arp response message Response message, it is determined that excellent with highest IP address in all arp response messages received in the range of timing The 2nd ARP records of first level, are recorded as target ARP.
Figure 11 is the structural representation of ARP record management device embodiment three of the present invention, such as Figure 11 institutes Show, the ARP record management device of the present embodiment offer and the dress of one corresponding opposite end of said apparatus embodiment Embodiment is put, can be included:
Sending module 1001, for sending ARP record, ARP records can include:With mapping relations The IP address of itself, the priority of MAC Address and the IP address of itself, include the purpose IP address of ARP request;
Memory module 1002, the receiving terminal for causing ARP to record are getting at least two with identical IP address When bar ARP is recorded, the priority with highest IP address at least two ARP records is determined according to the priority of IP address Target ARP records are recorded as to be stored.
The ARP record management device that the present embodiment provides, itself is sent by sending module 1001 ARP records, and makes the equipment of highest priority in network finally can really possess floating IP address.The present embodiment IP address caused by occurring double main or how main situations when can solve more collaborative share floating IP address according to the priority of IP address The problem of conflict, therefore the service exception situation caused by IP address conflict can be avoided.
Figure 12 is the structural representation of ARP record management device embodiment four of the present invention, such as Figure 12 institutes Show, the ARP record management device that the present embodiment provides is on the basis of said apparatus embodiment three, further , the ARP records that the sending module 1001 is sent, it can include:ARP request message is sent, ARP request message carries itself The first ARP records, and the purpose IP address of ARP request message is the IP address of itself;
The device can also include:
Collision detection module 1003, is used for:
Receive arp response message, arp response message carries the 2nd ARP records, the IP address and the in the 2nd ARP records IP address in one ARP records is identical;
The priority of IP address during first ARP is recorded, the priority of the IP address in being recorded with the 2nd ARP are compared Compared with if both are identical, it is determined that the transmitting terminal of arp response message produces IP address conflict with itself.
Figure 13 is the structural representation of ARP record management device embodiment five of the present invention, such as Figure 13 institutes Show, the ARP record management device that the present embodiment provides, can be with the basis of said apparatus example IV Including:
Respond module 1004, for receiving transmitting terminal ARP request message, and determine that the ARP request message is taken When the purpose IP address of band is the IP address of itself, arp response message is sent to the transmitting terminal, and in the arp response report Own IP address, MAC Address and IP address priority are carried in text.
Further, the ARP record management device that the present embodiment provides, can also include:Heartbeat is examined Module 1005 is surveyed, for itself carrying out heartbeat detection between another terminal, another terminal is the end with itself sharing Floating IP address End.
The present embodiment further increases respond module and terminal room heartbeat detection, may be such that IP address by a unique end End is possessed, and avoids producing IP address conflict problem.
The device of the various embodiments described above of the present invention, it is also not necessarily limited to same equipment and only shares a floating IP address, can be to upper Each embodiment is stated further to deform, can be by different IP address when same equipment needs to possess multiple floating IP address Each different IP priority is set, the same thought that the present invention can be achieved, the communication mutual assistance between more equipment is realized, avoids The service exception caused by address conflict or equipment fault.
In summary, the embodiment of the present invention is by setting the IP address priority in ARP records to avoid rushing for IP address It is prominent, specifically in ARP request/response message in addition to transmitting terminal IP address is carried, also carry transmitting terminal IP address priority;Receive To after IP address analysis request, IP address priority is carried in IP address resolution response message, record IP address is removed in ARP table With outside the mapping relations of MAC Address, also recording IP address priority.After arp response message is received, for same IP Location, update ARP table using the arp response of IP address highest priority in the one or more arp responses received.
It can be seen that ARP record management method and apparatus provided in an embodiment of the present invention, are included by obtaining The ARP record of at least two identical IP address of the priority of IP address, can be achieved MAC and highest priority IP address mapping, solve service exception situation caused by the IP address conflict that easily occurs during shared Floating IP address.
Further, the embodiment of the present invention is when new business needs to support Floating IP address, it is not necessary to complicated cluster management Cooperation of the software also without operation layer, it is not necessary to carry out extra software development, directly can be supported by IP layers.
Finally it should be noted that:Various embodiments above is merely illustrative of the technical solution of the present invention, rather than its limitations;To the greatest extent The present invention is described in detail with reference to foregoing embodiments for pipe, it will be understood by those within the art that:Its according to The technical scheme described in foregoing embodiments can so be modified, either which part or all technical characteristic are entered Row equivalent substitution;And these modifications or replacement, the essence of appropriate technical solution is departed from various embodiments of the present invention technology The scope of scheme.

Claims (8)

  1. A kind of 1. ARP record management method, it is characterised in that including:
    At least two ARP records are obtained, the ARP records include:IP address, MAC with mapping relations Address and the priority of the IP address;The IP address at least two ARP records is identical;
    Target ARP records are only stored, the target ARP records are that have highest IP address at least two ARP records Priority record;
    At least two ARP records obtained, including:First ARP of itself storage is recorded and in institute The 2nd ARP records that the first ARP records are got afterwards are stated, the 2nd ARP records are sent in the transmitting terminal received Carried in ARP request message or the 2nd ARP records are in the address that the transmitting terminal received is sent Carried in analysis protocol arp response message;
    If the 2nd ARP records are carried in the ARP request message that the transmitting terminal received is sent, After the acquisition at least two ARP records, before the only storage target ARP records, in addition to:
    By the preferential grading of the IP address in the priority of the IP address in the 2nd ARP records, with the first ARP records Row compares;
    If the priority of the IP address in the 2nd ARP records, greater than or equal to the IP address in the first ARP records Priority, it is determined that the 2nd ARP is recorded as the target ARP records;Otherwise, it determines the first ARP be recorded as it is described Target ARP is recorded;
    When the 2nd ARP is recorded as the target ARP records, the target ARP that only stores is recorded, including:Using described 2nd ARP records are replaced the first ARP records and stored;
    If the 2nd ARP records are carried in the ARP response message that the transmitting terminal received is sent, After ARP response message is received, before the only storage target ARP records, in addition to:
    It is determined that the priority with highest IP address at least one analysis protocol arp response message received 2nd ARP is recorded, and is recorded for the target ARP;
    The target ARP that only stores is recorded, including:Recorded using the 2nd ARP of the priority with highest IP address, Replace the first ARP records.
  2. 2. according to the method for claim 1, it is characterised in that if what the ARP request message carried Purpose IP address is the IP address of itself;Then:Arp response message is returned to the transmitting terminal, the arp response message carries certainly The ARP records of body, the ARP records of itself include:The priority of itself IP address, MAC Address and the IP address.
  3. 3. according to the method for claim 1, it is characterised in that at least one analysis protocol for determining to receive The ARP records of the priority with highest IP address in arp response message, including:
    If IP address in the 2nd ARP records that the ARP response message of receive first carries Priority, it is default limit priority, it is determined that first the 2nd ARP is recorded as the target ARP records.
  4. 4. according to the method for claim 1, it is characterised in that at least one analysis protocol for determining to receive The ARP records of the priority with highest IP address in arp response message, including:
    If IP address in the 2nd ARP records that the ARP response message of receive first carries Priority, be not default limit priority, then after first arp response message is received, in addition to:
    The 2nd ARP records in first arp response message are preserved, and start timer;
    If in the range of the timing of the timer, first arp response message is only received, it is determined that first The 2nd ARP in the arp response message is recorded as the target ARP records;
    If in the range of the timing of the timer, at least one is also received after first arp response message Individual arp response message, it is determined that there is highest IP in all arp response messages received in the range of the timing The 2nd ARP records of the priority of address, are recorded as the target ARP.
  5. A kind of 5. ARP record management device, it is characterised in that including:
    Acquisition module, for obtaining at least two ARP records, the ARP records include:With mapping relations IP address, the priority of MAC Address and the IP address;The IP address phase at least two ARP records Together;At least two ARP records, including:First ARP of itself storage is recorded and described first The 2nd ARP records that ARP records are got afterwards, the 2nd ARP records are in the address that the transmitting terminal received is sent solution Carried in analysis agreement ARP request message or the 2nd ARP records are the address resolution associations sent in the transmitting terminal received Carried in view arp response message;
    Memory module, for only storing target ARP records, the target ARP records are that have at least two ARP records The record of the priority of highest IP address;
    The memory module, is specifically used for:
    The priority of IP address during 2nd ARP is recorded, compared with the priority of the IP address in the first ARP records;
    If the priority of the IP address in the 2nd ARP records, greater than or equal to the IP address in the first ARP records Priority, it is determined that the 2nd ARP is recorded as the target ARP records;Otherwise, it determines the first ARP be recorded as it is described Target ARP is recorded;
    When the 2nd ARP is recorded as the target ARP records, the first ARP is replaced using the 2nd ARP records and remembered Record is stored;
    The acquisition module, is specifically used for:
    It is determined that the priority with highest IP address at least one analysis protocol arp response message received 2nd ARP is recorded, and is recorded for the target ARP;
    The memory module, the 2nd ARP records using the priority with highest IP address are specifically additionally operable to, are replaced The first ARP records.
  6. 6. device according to claim 5, it is characterised in that also include:
    Respond module, for returning to arp response message to transmitting terminal, the arp response message carries the ARP records of itself, institute Stating the ARP records of itself includes:The priority of itself IP address, MAC Address and the IP address.
  7. 7. device according to claim 5, it is characterised in that the acquisition module, be specifically additionally operable to:
    If IP address in the 2nd ARP records that the ARP response message of receive first carries Priority, it is default limit priority, it is determined that first the 2nd ARP is recorded as the target ARP records.
  8. 8. device according to claim 5, it is characterised in that the acquisition module, be additionally operable to:
    If IP address in the 2nd ARP records that the ARP response message of receive first carries Priority, it is not default limit priority, then:
    After first arp response message is received, the 2nd ARP notes in first arp response message are preserved Record, and start timer;
    If in the range of the timing of the timer, first arp response message is only received, it is determined that first The 2nd ARP in the individual arp response message is recorded as the target ARP records;
    If in the range of the timing of the timer, at least one is also received after first arp response message Individual arp response message, it is determined that there is highest IP in all arp response messages received in the range of the timing The 2nd ARP records of the priority of address, are recorded as the target ARP.
CN201210455618.8A 2012-11-14 2012-11-14 ARP record management method and apparatus Active CN103812957B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210455618.8A CN103812957B (en) 2012-11-14 2012-11-14 ARP record management method and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210455618.8A CN103812957B (en) 2012-11-14 2012-11-14 ARP record management method and apparatus

Publications (2)

Publication Number Publication Date
CN103812957A CN103812957A (en) 2014-05-21
CN103812957B true CN103812957B (en) 2018-02-13

Family

ID=50709149

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210455618.8A Active CN103812957B (en) 2012-11-14 2012-11-14 ARP record management method and apparatus

Country Status (1)

Country Link
CN (1) CN103812957B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104158707B (en) * 2014-08-29 2017-10-17 新华三技术有限公司 A kind of method and apparatus for detecting and handling cluster fissure
CN104601365B (en) * 2014-12-05 2019-05-07 新华三技术有限公司 A kind of node device monitoring method and device
CN109218458B (en) * 2017-07-07 2022-05-27 中兴通讯股份有限公司 Writing method and device of MAC address and computer readable storage medium
CN109743726B (en) * 2018-12-05 2021-11-23 江苏鑫软图无线技术股份有限公司 Method for sharing static terminal in LTE system roaming scene
CN113746945B (en) 2020-05-30 2023-09-12 华为技术有限公司 Reverse address resolution method and electronic equipment
CN114024932B (en) * 2021-10-29 2024-08-20 济南浪潮数据技术有限公司 Node access control method, node access management method, device and medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1607772A (en) * 2003-10-14 2005-04-20 华为技术有限公司 Method for realizing data transfer backup through address interpretation protocol messages
CN1855916A (en) * 2005-04-20 2006-11-01 大唐移动通信设备有限公司 Method and system for realizing virtual IP protocol
CN1929324A (en) * 2006-10-17 2007-03-14 杭州华为三康技术有限公司 Master-salve switching method and system for mutual backup device
CN101026591A (en) * 2007-04-13 2007-08-29 杭州华为三康技术有限公司 Network address confilict user inter-access method and route repeating device
CN101401366A (en) * 2006-03-20 2009-04-01 富士通株式会社 Relay device, communication system, communication method, and computer program

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101052896B1 (en) * 2004-07-26 2011-07-29 엘지전자 주식회사 Network Setting Device and Method
CN101917287B (en) * 2010-08-04 2012-03-14 杭州华三通信技术有限公司 Fault processing method and fault detecting system of IRF (Intelligent Resilient Framework)

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1607772A (en) * 2003-10-14 2005-04-20 华为技术有限公司 Method for realizing data transfer backup through address interpretation protocol messages
CN1855916A (en) * 2005-04-20 2006-11-01 大唐移动通信设备有限公司 Method and system for realizing virtual IP protocol
CN101401366A (en) * 2006-03-20 2009-04-01 富士通株式会社 Relay device, communication system, communication method, and computer program
CN1929324A (en) * 2006-10-17 2007-03-14 杭州华为三康技术有限公司 Master-salve switching method and system for mutual backup device
CN101026591A (en) * 2007-04-13 2007-08-29 杭州华为三康技术有限公司 Network address confilict user inter-access method and route repeating device

Also Published As

Publication number Publication date
CN103812957A (en) 2014-05-21

Similar Documents

Publication Publication Date Title
CN103812957B (en) ARP record management method and apparatus
US11528226B2 (en) Network validation with dynamic tunneling
CN101577722B (en) Method for realizing MAC forced forwarding function and device
EP2383934B1 (en) Ip session liveness monitoring method and system, home gateway and network equipment
US9917724B2 (en) Access method and system of customer premise equipment, and broadband network gateway
CN103636167B (en) Station opening configuration method in base station, base station, and server
CN101442443B (en) Network management system and implementing method for SNMP traversing NAT
CN102215273B (en) Method and device for providing external network access for internal network user
CN104320502B (en) Terminating gateway IP address distribution method, the method for data transfer, MME and system
US20120311185A1 (en) Data transmission based on address translation
CN102355479A (en) Method and equipment for forwarding traffic of multi-NAT (network address translation) gateway
CN102594943B (en) Method and device for realizing address resolution protocol (ARP) interception
CN101662411A (en) Method and device for IPv4 host computer to access IPv6 network server
CN101567861B (en) Data synchronization method and application system between heterogeneous application systems
CN101227265B (en) Method for data synchronization among client ends in equipment monitoring system
CN106470251A (en) Domain name analytic method and virtual DNS authority server
CN1319338C (en) Method for soluting IP address conflicts in network communication
CN110351373A (en) A kind of long-distance monitoring method and device in power station
CN102821172B (en) Method, equipment and system for obtaining address of SIP (session initiation protocol) register server
CN1487706B (en) Method, system and control process for enterprise to communicate timely
CN113132218A (en) Home gateway access method, device, system processor and storage medium
CN102572012A (en) Message processing method, switchboard and system
CN109951493A (en) A kind of network intercommunication method, device, equipment and storage medium
CN104579809B (en) The detection method and equipment of a kind of stacking splitting
CN100438448C (en) Method and device for implementing network call after network failure

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20191213

Address after: 510000 unit 2414-2416, building, No. five, No. 371, Tianhe District, Guangdong, China

Patentee after: Guangdong Gaohang Intellectual Property Operations Co., Ltd.

Address before: 518129 Bantian HUAWEI headquarters office building, Longgang District, Guangdong, Shenzhen

Patentee before: Huawei Technologies Co., Ltd.

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20191230

Address after: 314200 floor 5, neinan building, No.8, Chuangxin Road, Xindai Town, Pinghu City, Jiaxing City, Zhejiang Province

Patentee after: Pinghu Xinna Communication Technology Co., Ltd.

Address before: 510000 unit 2414-2416, building, No. five, No. 371, Tianhe District, Guangdong, China

Patentee before: Guangdong Gaohang Intellectual Property Operations Co., Ltd.

TR01 Transfer of patent right