CN103441931B - A kind of file transmitting method and device - Google Patents

A kind of file transmitting method and device Download PDF

Info

Publication number
CN103441931B
CN103441931B CN201310373501.XA CN201310373501A CN103441931B CN 103441931 B CN103441931 B CN 103441931B CN 201310373501 A CN201310373501 A CN 201310373501A CN 103441931 B CN103441931 B CN 103441931B
Authority
CN
China
Prior art keywords
equipment
arp
address
request message
arp request
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
CN201310373501.XA
Other languages
Chinese (zh)
Other versions
CN103441931A (en
Inventor
任强
张潇潇
程徐彬
庞博
熊玉定
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201310373501.XA priority Critical patent/CN103441931B/en
Publication of CN103441931A publication Critical patent/CN103441931A/en
Application granted granted Critical
Publication of CN103441931B publication Critical patent/CN103441931B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Small-Scale Networks (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

A kind of file transmitting method, including:First equipment sent ARP request message before the IP messages that need to be forwarded are received, so that the second equipment for receiving the ARP request message sends arp reply message to first equipment;First equipment receives the arp reply message that second equipment sends.Using the method, first equipment just sent ARP request message before the IP messages that need to be forwarded are received, need not be when the ability temporary query ARP when needing to turn transmitting IP packet, ARP request message is retransmited when searching less than ARP, such that it is able to reduce the break period in IP message repeating process.

Description

A kind of file transmitting method and device
Technical field
The present invention relates to the communications field, more particularly to a kind of file transmitting method and device.
Background technology
Carrying out Internet protocol(Internet Protocol, IP)When message is forwarded, equipment is sent to by IP messages Receiving device smoothly is transmitted to, under conditions of the IP address of known receiving device, in addition it is also necessary to which the media for obtaining receiving device are visited Ask control(Media Access Control, MAC)Address;Transmission equipment specifically can be by sending address resolution protocol (Address Resolution Protocol, ARP)Request message, obtains the MAC Address of the receiving device, and ARP here please Message is sought for broadcasting packet, all receiving devices in the broadcast domain of the equipment of transmission can receive the ARP request message, Receiving device is after the ARP request message is received, however, it is determined that the purpose IP address of the ARP request message are the receiving device IP address, then to device replied arp reply message is sent, transmission equipment is informed by the MAC Address of itself.
At present, transmission equipment is when needing to turn transmitting IP packet, it is necessary first to search the corresponding ARP of IP messages, this In ARP mapping relations between IP address and MAC Address can be provided, reception can be obtained according to the ARP The MAC Address of equipment, if the transmission equipment cannot find the corresponding ARP of IP messages, just sends ARP request message, Receiving device is after ARP request message is received, however, it is determined that the purpose IP address of the ARP request message are the IP ground of this equipment Location, then to transmission device replied arp reply message.
According to current technology, equipment is sent in the IP messages for needing forwarding to receive, search the corresponding ARP of the IP messages List item, when ARP corresponding less than the IP messages is searched, just sends ARP request message;Due to searching ARP and waiting Treat that the process of arp reply message is required for taking, meanwhile, the IP messages are likely to require could be arrived by the forwarding of multilevel device Up to final receiving device, the forwarding process break period that so may result in message is more long, in some instances it may even be possible to cause packet loss.
The content of the invention
The embodiment of the present invention provides a kind of file transmitting method and device, when being used to reduce the interruption of IP message repeating process Between.
In a first aspect, a kind of file transmitting method, including:
First equipment sent ARP request before the Internet protocol IP message for needing forwarding is received Message;
First equipment receives the arp reply message that second equipment sends.
With reference in a first aspect, in the first possible implementation, first equipment sends ARP request message, bag Include:
The network number that first equipment will determine according to the IP address of the subnet mask of setting and first equipment is made It is purpose IP address, sends ARP request message.
With reference to the first possible implementation of first aspect, in second possible implementation, described first Equipment determines network number according to following steps:
If the number of bits of the network position of the corresponding subnet mask of IP address of first equipment is less than the setting Subnet mask network position number of bits, then first equipment according to setting subnet mask, determine each subnet Network number, wherein each subnet is that the network of the IP address of first equipment mark is divided to obtain;
If the number of bits of the network position of the corresponding subnet mask of IP address of first equipment sets not less than described The number of bits of the network position of fixed subnet mask, then first equipment will set subnet mask and first equipment IP address carry out logic and operation, determine network number.
With reference to second possible implementation of first aspect, in the third possible implementation, the setting Subnet mask network position number of bits be 24.
With reference to the second of first aspect or the third possible implementation, in the 4th kind of possible implementation, institute State the first equipment and the network that the IP address of first equipment is identified is divided into 2m-nIndividual subnet;Wherein, m is the subnet of setting The number of bits of network position in mask, n is two entering for the network position of the corresponding subnet mask of IP address of first equipment Digit processed.
With reference in a first aspect, or first aspect first to fourth kind of possible implementation, in the 5th kind of possible realization In mode, first equipment sends ARP request message, including:
First equipment periodic sends ARP request message;And/or,
First equipment sends ARP request message when it is determined that the IP address of first equipment changes.
Second aspect, a kind of file transmitting method, including:
Second equipment receives the address that the first equipment sent before the Internet protocol IP message for needing forwarding is received Analysis protocol ARP request message;
Second equipment sends arp reply message according to the ARP request message to first equipment.
With reference to second aspect, in the first possible implementation, second equipment is according to the ARP request report Text, arp reply message is sent to first equipment, including:
Second equipment is it is determined that the corresponding network number of source IP address of the ARP request message, sets with described second When the corresponding network number of standby IP address is identical, and/or second equipment is in the subnet mask according to the setting and described The network number that the IP address of the second equipment determines, when the purpose IP address with the ARP request message for receiving are identical, to described first Equipment sends arp reply message.
A kind of third aspect, there is provided packet transmission device, including:
Sending module, for sending address resolution protocol before the Internet protocol IP message for needing forwarding is received ARP request message, so that the second equipment for receiving the ARP request message sends arp reply message to first equipment;
Receiver module, for receiving the arp reply message that second equipment sends.
With reference to the third aspect, in the first possible implementation, the sending module specifically for:
Will according to setting subnet mask and first equipment IP address determine network number as purpose IP address, Send ARP request message.
With reference to the first possible implementation of the third aspect, in second possible implementation, the transmission Module determines network number according to following steps:If the two of the network position of the corresponding subnet mask of IP address of first equipment enter Digit processed is less than the number of bits of the network position of the subnet mask of the setting, then according to the subnet mask of setting, it is determined that often The network number of individual subnet, wherein each subnet are that the network of the IP address mark of first equipment is divided to obtain;If institute State the subnet mask of the number of bits not less than the setting of the network position of the corresponding subnet mask of IP address of the first equipment Network position number of bits, then the IP address of the subnet mask of setting and first equipment is carried out into logic and operation, Determine network number.
With reference to second possible implementation of the third aspect, in the third possible implementation, the setting Subnet mask network position number of bits be 24.
With reference to the second of the third aspect or the third possible implementation, in the 4th kind of possible implementation, institute State sending module and the net that the IP address of first equipment is identified is divided into 2m-nIndividual subnet;Wherein, m is that the subnet for setting is covered The number of bits of network position in code, n is the binary system of the network position of the corresponding subnet mask of IP address of first equipment Digit.
With reference to the third aspect, or the third aspect first to fourth kind of possible implementation, in the 5th kind of possible realization In mode, the sending module specifically for:Cycle sends ARP request message, and/or, it is determined that the IP of first equipment When address changes, ARP request message is sent.
A kind of fourth aspect, there is provided packet transmission device, including:
Receiver module, for receiving what the first equipment sent before the Internet protocol IP message for needing forwarding is received ARP request message, and the ARP request message transmissions that will be received are to sending module;
Sending module, for the ARP request message transmitted according to the receiver module, ARP is sent to first equipment Response message.
With reference to fourth aspect, in the first possible implementation, the sending module specifically for:It is determined that described The corresponding network number of source IP address of ARP request message, when the corresponding network number of IP address with second equipment is identical, And/or the network number of the IP address determination in the subnet mask according to the setting and second equipment, please with the ARP for receiving When asking the purpose IP address of message identical, arp reply message is sent to first equipment.
The method provided using above-mentioned first aspect, the first equipment was just sent before the IP messages for needing forwarding are received ARP request message, it is not necessary to when the ability temporary query ARP when needing to turn transmitting IP packet, when searching less than ARP again ARP request message is sent, such that it is able to reduce the break period in IP message repeating process.
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 The accompanying drawing to be used needed for having technology description is briefly described, it should be apparent that, drawings in the following description are only this Some embodiments of invention, for those of ordinary skill in the art, without having to pay creative labor, may be used also Other accompanying drawings are obtained with according to these accompanying drawings.
Fig. 1 is the file transmitting method flow chart of the embodiment of the present invention one;
Fig. 2 is the file transmitting method flow chart of the embodiment of the present invention two;
Fig. 3 is the method flow diagram for carrying out message transmission of the embodiment of the present invention one;
Fig. 4 is the method flow diagram for carrying out message transmission of the embodiment of the present invention two;
Fig. 5 is the packet transmission device structural representation of the embodiment of the present invention one;
Fig. 6 is the packet transmission device structural representation of the embodiment of the present invention two;
Fig. 7 is the packet transmission device structural representation of the embodiment of the present invention three;
Fig. 8 is the packet transmission device structural representation of the embodiment of the present invention four.
Specific embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete Site preparation is described, it is clear that described embodiment is only a part of embodiment of the invention, rather than whole embodiments.Base Embodiment in the present invention, those of ordinary skill in the art obtained under the premise of creative work is not made it is all its His embodiment, belongs to the scope of protection of the invention.
The first equipment just sent ARP request message before the IP messages for needing forwarding are received in the embodiment of the present invention, Without when the ability temporary query ARP when needing to turn transmitting IP packet, ARP is retransmited when searching less than ARP please Message is sought, such that it is able to reduce the break period in IP message repeating process.
The embodiment of the present invention is described in further detail with reference to Figure of description.
As shown in figure 1, being the file transmitting method flow chart of the embodiment of the present invention one, the method includes:
S101:First equipment sent ARP request message before the IP messages for needing forwarding are received, so as to receive Second equipment of ARP request message sends arp reply message to first equipment;
S102:First equipment receives the arp reply message that the second equipment sends.
In the embodiment of the present invention, the first equipment just sent ARP request message before the IP messages for needing forwarding are received, That is, the first equipment just sends ARP request message when being also not received by needing the IP messages of forwarding, in first equipment Equipment in broadcast domain can receive the ARP request message, and the equipment for receiving the ARP request message can be replied directly Arp reply message, it is also possible to determine whether that the first equipment sends arp reply message according to condition set in advance, here will The equipment for replying arp reply message is referred to as the second equipment, and here, condition set in advance can be the second equipment it is determined that receiving The source IP address of the ARP request message for arriving and the IP address of this equipment reply arp reply message when being in the same network segment, can be with It is the second equipment it is determined that the source IP address of the ARP request message for receiving is in the same network segment with the IP address of this equipment, and The IP address of this equipment is carried out into the network number obtained after logic and operation with the subnet mask of setting, with ARP request message When purpose IP address are identical, arp reply message is replied, herein below will be to the condition of the second device replied APR response messages Elaborate;First equipment is after the arp reply message for receiving the transmission of the second equipment, however, it is determined that need to turn to the second equipment Transmitting IP packet, then can determine the MAC Address of the second equipment according to the arp reply message, then just can be according to determination MAC Address, to the second device forwards message.First equipment can also receive the second equipment transmission arp reply message after, According to the arp reply message, the MAC Address of the second equipment is determined, afterwards, however, it is determined that need to the second device forwards IP messages, Then directly according to the MAC Address of the second equipment for determining, to the second device forwards IP messages.
In specific implementation, the ARP request message sent using the embodiment of the present invention is different from existing ARP request report Text.In the prior art, the equipment of ARP request message is received it is determined that the purpose IP address of the ARP request message are this equipment IP address when, reply arp reply message.And due in the embodiment of the present invention the first equipment send ARP request message when, also It is not absolutely required to turn transmitting IP packet, the IP address of the equipment for receiving IP messages is also not necessarily known naturally.Therefore, the first equipment The particular content of the ARP request message of transmission is also different from the particular content of existing ARP request message naturally.Such as the institute of table one Show, the number of bits that each field and each field included in the ARP messages for being the embodiment of the present invention are occupied.Such as the institute of table two Show, be the embodiment of the present invention ARP messages in each field length and the brief description to each field.The embodiment of the present invention In, can be by the action type of ARP messages(OP)Field value is 5, for representing active ARP request, is different from action type Field value is the ARP request represented by 1.Here active ARP request, expression be receive need forwarding IP messages it The preceding ARP request for just sending.The equipment for receiving the ARP messages for representing active ARP request judges whether to reply arp reply message When, also it is different from the ARP request that action type field value is 1, it is not necessary to which the purpose IP address according to active ARP messages are It is no it is whether consistent with the IP address of this equipment come judge whether reply arp reply message.Equipment can be represented actively receiving After the ARP messages of ARP request, arp reply message is just replied, it is also possible to receiving the ARP messages of expression active ARP request Afterwards, according to the condition of reply arp reply message set in advance, after it is determined that needing to reply arp reply message, then ARP is replied Response message.
0bit 15bit 23bit 31bit
Table one
Table two
Alternatively, the first equipment sends ARP request message, including:
First equipment will be according to the network number of the IP address of the subnet mask of setting and the first equipment determination as purpose IP Address, sends ARP request message.
Here, the subnet mask of the setting is carried out into logic and operation with the IP address of first equipment, you can To the correspondence subnet mask and the network number of the IP address of first equipment, after the subnet mask step-by-step is negated, then IP address with first equipment carries out logic and operation, you can obtain the correspondence subnet mask and first equipment The host number of IP address;Wherein, the subnet mask is made up of network position and main frame position, wherein each network position binary one Mark, each main frame position is identified with Binary Zero;It can be seen from determination mode according to above-mentioned network number, the number of bits of network number It is identical with the number of bits of IP address, is all 32, the network number that will be determined in the embodiment of the present invention is used as purpose IP Address, sends ARP request message.
In specific implementation, ARP was just sent before the IP messages for needing forwarding are not received also due to the first equipment and is asked Message is sought, the first equipment is not aware that when need to E-Packet, also do not known when needing to E-Packet, message is turned Which equipment issued.Therefore, the first equipment send ARP request message purpose IP address and need not be some equipment IP address.Correspondingly, receive the equipment of ARP request message is also without according to the purpose IP address of the ARP request message It is no whether identical with this equipment IP address to determine whether to reply APR response messages.In being embodied at one, can be advance Setting receives the condition of the device replied APR response messages of ARP request message.The condition can be with the mesh of ARP request message IP address it is related, it is also possible to the source IP address to ARP request message is related.Such as, the second equipment can be it is determined that receive The IP address of source IP address and this equipment of ARP request message reply arp reply message when being in the same network segment;Can also be It is determined that the IP address of the source IP address of the ARP request message for receiving and this equipment is in the same network segment, and by the IP of this equipment Address carries out the network number obtained after logic and operation with the subnet mask of setting, the purpose IP address phase with ARP request message Meanwhile, reply arp reply message.Following content and will be to receiving ARP request message in the embodiment of the present invention two The condition of device replied APR response messages elaborates.
In a kind of specific implementation of the invention, the IP address of subnet mask and the first equipment according to setting determines network Number mode can be in the following manner(1)Or mode(2):
Mode(1)Number of bits in the network position of the corresponding subnet mask of the IP address of the first equipment is less than setting During the number of bits of the network position of subnet mask, the first equipment determines the network of each subnet according to the subnet mask of setting Number, wherein each subnet is that the network of the IP address mark of first equipment is divided to obtain.
In specific implementation, the number of bits of the subnet mask of setting can be 24, certainly, the subnet mask of setting Number of bits can also be other digits, set it to 24 simply in specific implementation of the embodiment of the present invention Optional implementation method.
Alternatively, the network that the IP address of the first equipment is identified is divided into 2 by the first equipmentm-nIndividual subnet;Wherein, m is to set The number of bits of network position in fixed subnet mask, n is the network position of the corresponding subnet mask of IP address of the first equipment Number of bits.
In this fashion, when the corresponding subnet mask of the IP address of the first equipment network position number of bits compared with It is few, and the number of bits of main frame position it is more when, show that the user of the network coverage that the IP address of first equipment is identified sets Standby quantity is more, if all these user equipmenies all reply arp reply message after ARP request message is received, can be in short-term It is interior that larger burden is come to the network bandwidth and first equipment belt.By setting a subnet mask in the embodiment of the present invention, In the net of the number of bits less than the subnet mask of the setting of the network position of the corresponding subnet mask of the IP address of the first equipment During the number of bits of network position, the network that the IP address of first equipment is identified is divided into multiple subnets, it is determined that with setting The network number of corresponding each subnet of subnet mask, the network number of each subnet that will be determined respectively is sent out as purpose IP address Send ARP request message;Correspondingly, the second equipment can after ARP request message is received, by the IP address of the second equipment with set Fixed subnet mask carries out logic and operation and determines network number, it is determined that network number with receive ARP request message purpose When IP address is identical, arp reply message is replied, using this sample loading mode, the first equipment receives the quantity of arp reply message every time Greatly reduce, can effectively alleviate the operation caused to the pressure of the network bandwidth and to the first equipment in the short time and bear.Name One specific example is described:
Such as, it is assumed that the IP address of the first equipment is 192.168.10.1, with being represented in binary as 11000000.10101000.00001010.00000001, the binary digit of the network position of the corresponding subnet mask of the IP address Number is 16, i.e., with binary representation, the subnet mask is 11111111.11111111.00000000.00000000, then the IP The network number of the network that address is identified is 192.168.0.0, and the number of bits of the network position of the subnet mask for setting is 24 Position, with binary representation, the subnet mask for setting is 11111111.11111111.11111111.00000000;Sending During ARP request message, can be according to the subnet mask of setting, it is determined that the network that 192.168.0.0 this network number is identified When being divided into multiple subnets, the network number of each subnet, here, the network number of each subnet is the subnet mask of correspondence setting Network number, i.e. in the network number of subnet non-zero number of bits be equal to setting subnet mask network position binary digit Number, here, the network position according to setting is the subnet mask of 24, it is possible to the net for being identified network number 192.168.0.0 Network is divided into 224-16=256 subnets, the network number of each subnet be respectively 192.168.0.0,192.168.1.0, 192.168.2.0 ... 192.168.255.0, afterwards, it is possible to using the network number of each subnet as ARP request message mesh IP address, send ARP request message;IP address is receiving purpose IP address for second equipment of 192.168.20.1 192.168.20.0 after ARP request message, the second equipment by the IP address 192.168.20.1 of the second equipment with setting net Network position determines that network number is 192.168.20.0 after carrying out logic and operation for the subnet mask of 24, with ARP request message Purpose IP address are identical, and the second equipment sends arp reply message to the first equipment.
If use to enter row constraint to the equipment for replying arp reply with upper type, each receives setting for ARP request message It is standby, arp reply message is all replied, most 65536-3 arp reply messages will be received in the first equipment short time, wherein subtracting The 3 IP address respectively host number for going is full 0(Map network number), full F(Correspondence broadcast address)IP address, and originally connect The IP address of mouth.And use with upper type, the corresponding network number of subnet mask of 16 network positions is divided into 256 24 nets The corresponding network number of subnet mask of network position, for the subnet mask that each network position is 24, the first equipment short time is interior most Receive only 256 arp reply messages more, alleviate the fortune caused to the pressure of the network bandwidth and to the first equipment in the short time Row burden.
It should be noted that the second equipment can independently determine whether that the first equipment sends arp reply message.Specific In implementation, the second equipment can use and judge whether to send arp reply message to the first equipment with upper type, it is also possible to not use Judge whether to send arp reply message to the first equipment with upper type.Such as, can be after ARP request message be received directly Arp reply message is replied, can also be it is determined that the source IP address of ARP request message and the IP address of the second equipment belong to same net Arp reply message is replied during section, the source IP address of ARP request message and the IP address category of the second equipment can also be at the same time met In the same network segment, and, the IP address of the second equipment is carried out the network number of logic and operation determination with the subnet mask of setting, with During identical the two conditions of the purpose IP address of the ARP request message of reception, arp reply message is replied.
Mode(2):It is not less than in the number of bits of the network of the corresponding subnet mask of the IP address of the first equipment and sets During the number of bits of the network position of fixed subnet mask:
The IP address of the subnet mask of setting and the first equipment is carried out logic and operation by the first equipment, determines network number.
In this fashion, when the corresponding subnet mask of the IP address of the first equipment network position number of bits compared with It is many, and main frame position number of bits it is less when, show that the number of user equipment of the network coverage that the IP address is identified is less, At this moment, it is not necessary to worry that all these user equipmenies all reply arp reply message after ARP request message is received, can be short Carry out the problem of larger burden in time to the network bandwidth and first equipment belt, therefore, in such a case, it is possible to directly will The IP address of the subnet mask of setting and the first equipment carries out logic and operation, determines network number.Name a specific example Son is described:
Such as, it is assumed that the IP address of the first equipment is 192.168.10.1, with being represented in binary as 11000000.10101000.00001010.00000001, the binary digit of the network position of the corresponding subnet mask of the IP address Number is 24, and the number of bits of the network position of the subnet mask for setting also is 24, then be with network position by the IP address Every of the subnet mask 11111111.11111111.11111111.00000000 of 24 carries out logic and operation, it is determined that making For the network number of the purpose IP address of ARP request message is 11000000.10101000.00001010.00000000(Correspondence ten System 192.168.10.0).Correspondingly, the second equipment is after the ARP request message is received, can use with it is above-mentioned the first The similar mode introduced in mode judges whether to reply arp reply message, such as:
Directly arp reply message can be replied after ARP request message is received;
Can also be replied when it is determined that the source IP address of ARP request message and the IP address of the second equipment belong to the same network segment Arp reply message;
The IP address of the source IP address and the second equipment that can also at the same time meet ARP request message belongs to the same network segment, With, the IP address of the second equipment is carried out the network number of logic and operation determination with the subnet mask of setting, please with the ARP for receiving When seeking identical the two conditions of purpose IP address of message, arp reply message is replied.
Alternatively, in S101, the first equipment sends ARP request message, including:
First equipment periodic sends ARP request message;And/or,
First equipment sends ARP request message when it is determined that the IP address of the first equipment changes.
In the embodiment of the present invention, the first equipment just sends ARP request message when IP messages are also not received by.Specific In implementation, the first equipment can specifically begin to transmission ARP when Interface status switch to normal operating conditions by malfunction please Message is sought, and under normal Interface status, according to the time interval of setting, that is, sends the cycle, send ARP request message, and The arp reply message of the second equipment transmission is received, when the first equipment determines to need to turn transmitting IP packet, you can received with basis Arp reply message determine the MAC Address of the second equipment, and according to the MAC Address for determining, IP messages are transmitted to second and are set It is standby, without when needing for IP messages to be transmitted to the second equipment, then the equipment of temporary query second ARP, searching not Go to send ARP request message again during to ARP, such that it is able to reduce the break period in IP repeating process, improve forwarding effect Rate, and reduce packet loss.
First equipment can also send ARP request message, and receive when it is determined that the IP address of the first equipment changes The arp reply message that second equipment sends, when the first equipment determines to need to turn transmitting IP packet, it is not necessary to which temporary query second sets again Standby ARP, it is possible to which the arp reply message according to having received determines the MAC Address of the second equipment, and IP messages are transmitted to Second equipment, it is also possible to reduce the break period in IP repeating process, improves forward efficiency.
In specific implementation, the transmission opportunity of two above ARP request message can be used in combination;Due to the first equipment IP address when changing, it is necessary to the equipment for replying arp reply message is possible to change, therefore, sent in the cycle While ARP request message, however, it is determined that the IP address of the first equipment changes, even if at this moment according to the transmission cycle of setting, The time for sending ARP request message is also less than, ARP request message is also sent, and after ARP request message is sent, continues basis The transmission cycle of setting sends ARP request message.
As shown in Fig. 2 being the file transmitting method of the embodiment of the present invention two, the method includes:
S201:Second equipment receives the ARP request report that the first equipment sent before the IP messages for needing forwarding are received Text;
S202:Second equipment sends arp reply message according to the ARP request message for receiving to the first equipment.
In specific implementation process, the second equipment is after the ARP request message for receiving the transmission of the first equipment, however, it is determined that should ARP request message is active ARP request message, then send arp reply message to the first equipment;Such as, the second equipment is received The OP fields value of the ARP request message is 5, and according to the agreement with the first equipment, the second equipment determines that the ARP request message is Active ARP request message, then the second equipment can send arp reply message to the first equipment immediately, it is also possible to according to setting in advance Fixed condition, when it is determined that the ARP request message for receiving meets condition set in advance, arp reply report is sent to the first equipment Text.In the embodiment of the present invention, the condition that the second equipment set in advance sends arp reply message can be in following condition Plant or two kinds:
Condition(1):Second equipment it is determined that receive ARP request message the corresponding network number of source IP address, with second When the corresponding network number of IP address of equipment is identical, arp reply message is sent to the first equipment;
Above-mentioned condition(1)Practical significance be:Second equipment is it is determined that the source IP address and the second equipment of ARP request message IP address when belonging to the same network segment, send arp reply message to the first equipment;Such as, the ARP request that the second equipment is received The source IP address of message is 192.168.10.1, and the IP address of the second equipment is 192.168.20.1, the IP address of the second equipment The network position of corresponding subnet mask is 16, then the second equipment is by the source IP address of ARP request message and the IP of the second equipment The corresponding subnet mask in address carries out logic and operation, and the corresponding network number of source IP address for determining ARP request message is 192.168.0.0, the IP address of itself subnet mask corresponding with the IP address is carried out logic and operation by the second equipment simultaneously, Determine that the corresponding network number of IP address of itself is similarly 192.168.0.0, then it is assumed that send the source IP address of ARP request message Belong to the same network segment with the IP address of the second equipment, the second equipment then sends arp reply message to the first equipment.
In specific implementation, the second equipment is also an option that with reference to following condition(2)To judge whether to reply arp reply Message;
Condition(2):The network number that second equipment determines in the subnet mask and the IP address of the second equipment according to setting, with When the purpose IP address of the ARP request message of reception are identical, arp reply message is sent to the first equipment;
Such as, the purpose IP address of the ARP request message that the second equipment is received are 192.168.20.0, the second equipment IP address is 192.168.20.1, and the network position of the subnet mask of setting is 24, then the second equipment is covered according to the subnet of setting The network number that the IP address of code and the second equipment determines is 192.168.20.0, the purpose IP ground with the ARP request message for receiving Location is identical, and the second equipment determines to send arp reply message to the first equipment.
In specific implementation, above-mentioned first equipment determines network according to the subnet mask of setting and the IP address of the first equipment Number first way, during with second condition combination here, it is possible to reduce receive arp reply report in the first equipment short time The quantity of text, effectively alleviates in the short time and the operation that the pressure and the first equipment of the network bandwidth are caused is born.Concrete reason is It is described when the mode of above-mentioned the first determination network number is introduced, is repeated no more here.
As shown in figure 3, being the method flow diagram for carrying out message transmission of the embodiment of the present invention one.The method includes:
S301:First equipment is according to the subnet mask for setting, it is determined that being drawn in the network for identifying the IP address of the first equipment When being divided into multiple subnets, the network number of each subnet;Wherein, the corresponding subnet mask of the IP address of the first equipment network position Number of bits of the number of bits less than the network position of the subnet mask of setting.
Here, the quantity of multiple subnets of division is 2m-nIt is individual.Wherein, m be setting subnet mask in network position two enter Digit processed, n is the number of bits of the network position of the corresponding subnet mask of IP address of the first equipment;The subnet mask of setting The number of bits of network position can be 24.
S302:, when Interface status are normal, the network number of each subnet that will be determined respectively is used as purpose IP for first equipment Address, sends ARP request message.
In specific implementation, the first equipment can be according to the agreement with the second equipment, the OP of the ARP request message that will be sent Field value is 5, and represent transmission is active ARP request message, and for being different from existing ARP request message, expression is not The ARP of ability acquisition request IP message sinks when needing to turn transmitting IP packet, but in order to active obtaining receives ARP request The ARP of the equipment of message.
S303:Second equipment receives the ARP request message that the first equipment sends.
S304:Second equipment according to receive ARP request message, it is determined that the ARP request message source IP address correspondence Network number, network number corresponding with the IP address of the second equipment is identical, and in the subnet mask and the second equipment according to setting IP address determine network number, with receive ARP request message purpose IP address it is identical when, to the first equipment send ARP Response message.
S305:First equipment receives the arp reply message that the second equipment sends.
Using the embodiment of the present invention one, the break period in IP message repeating process can be not only reduced, can also reduced The quantity of arp reply message is received in first equipment short time, is effectively alleviated in the short time to the pressure of the network bandwidth and the The operation burden that one equipment is caused.
As shown in figure 4, be the method flow diagram for carrying out message transmission of the embodiment of the present invention two, including:
S401:The IP address of the subnet mask of setting and first equipment is carried out logic and operation by the first equipment, it is determined that Network number;Wherein, the son of the number of bits not less than setting of the network position of the corresponding subnet mask of the IP address of the first equipment The number of bits of the network position of net mask.
Here, the number of bits of the network position of the subnet mask of setting can be 24.
S402:, when Interface status are normal, used as purpose IP address, sending ARP please for the network number that will be determined for first equipment Seek message.
S403:Second equipment receives the ARP request message that the first equipment sends.
S404:Second equipment according to receive ARP request message, it is determined that the ARP request message source IP address correspondence Network number, when corresponding with the IP address of the second equipment network number is identical, arp reply message is sent to the first equipment.
S405:First equipment receives the arp reply message that the second equipment sends.
A kind of message hair corresponding with file transmitting method is additionally provided based on same inventive concept, in the embodiment of the present invention Send device, because the principle of the device solve problem is similar to embodiment of the present invention file transmitting method, therefore the device reality The implementation of the method for may refer to is applied, part is repeated and is repeated no more.
As shown in figure 5, being the packet transmission device structural representation of the embodiment of the present invention one, the device includes:
Sending module 51, for sending ARP request report before the IP messages for needing forwarding are received Text, so that the second equipment for receiving ARP request message sends arp reply message to the first equipment;
Receiver module 52, for receiving the arp reply message that the second equipment sends.
Alternatively, sending module 51 specifically for:
The network number that will be determined according to the IP address of the subnet mask of setting and the first equipment sends as purpose IP address ARP request message.
Alternatively, sending module 51 determines network number with specific reference to following steps:If the IP address of the first equipment is corresponding The number of bits of the network position of the subnet mask of the number of bits less than setting of the network position of subnet mask, then according to setting Subnet mask, determine the network number of each subnet, wherein each subnet is that the network of the IP address mark of the first equipment is drawn Get;If the subnet of the number of bits not less than setting of the network position of the corresponding subnet mask of the IP address of the first equipment The number of bits of the network position of mask, then carry out logic and operation by the IP address of the subnet mask of setting and the first equipment, Determine network number.
Alternatively, the number of bits of the network position of the subnet mask for setting is 24.
Alternatively, the net that the IP address of the first equipment is identified is divided into 2 by sending module 51m-nIndividual subnet;Wherein, m is to set The number of bits of network position in fixed subnet mask, n is the network position of the corresponding subnet mask of IP address of the first equipment Number of bits.
Alternatively, sending module 51 specifically for:Cycle sends ARP request message;And/or, it is determined that first equipment When IP address changes, ARP request message is sent.
As shown in fig. 6, being the packet transmission device structural representation of the embodiment of the present invention two, the device includes:
Receiver module 61, for receiving the address resolution that the first equipment sent before the IP messages for needing forwarding are received Agreement ARP request message, and the ARP request message transmissions that will be received are to sending module 62;
Sending module 62, for the ARP request message transmitted according to receiver module 61, arp reply is sent to the first equipment Message.
Alternatively, sending module 62 specifically for:It is determined that the corresponding network number of the source IP address of ARP request message, with When the corresponding network number of IP address of the second equipment is identical, and/or on the IP ground of the subnet mask according to setting and the second equipment The network number that location determines, when the purpose IP address with the ARP request message for receiving are identical, arp reply report is sent to the first equipment Text.
As shown in fig. 7, the packet transmission device structural representation of the embodiment of the present invention three, the device includes:
Processor 71, for before the IP messages for needing the first device forwards are received, it is determined that needing to the second equipment The ARP request message of transmission, and the ARP request message transmissions that will be determined are to emitter 72;
Emitter 72, for the ARP request message of the transmission of transmission processe device 71, so as to receive the of ARP request message Two equipment send arp reply message to the first equipment;
Receiver 73, for receiving the arp reply message that the second equipment sends.
Alternatively, processor 71 specifically for:
The network number that will be determined according to the IP address of the subnet mask of setting and the first equipment is as needs to emitter 72 The purpose IP address of the ARP request message of transmission.
Alternatively, processor 71 according to following steps specifically for determining network number:If the IP address correspondence of the first equipment Subnet mask network position subnet mask of the number of bits less than setting network position number of bits, then according to setting Fixed subnet mask, determines the network number of each subnet, and wherein each subnet is the network to the IP address mark of the first equipment What division was obtained;If the son of the number of bits not less than setting of the network position of the corresponding subnet mask of the IP address of the first equipment The number of bits of the network position of net mask, then carry out logical AND fortune by the IP address of the subnet mask of setting and the first equipment Calculate, determine network number.
Alternatively, the number of bits of the network position of the subnet mask for setting is 24.
Alternatively, the net that the IP address of the first equipment is identified is divided into 2 by processor 71m-nIndividual subnet;Wherein, m is setting Subnet mask in network position number of bits, n be the corresponding subnet mask of IP address of the first equipment network position two System digit.
Alternatively, emitter 72 specifically for:Cycle sends ARP request message;And/or, it is determined that the IP of the first equipment When address changes, ARP request message is sent.
As shown in figure 8, being the packet transmission device structural representation of the embodiment of the present invention four, the device includes:
Receiver 81, for receiving the ARP request report that the first equipment sent before the IP messages for needing forwarding are received Text, and the ARP request message transmissions that will be received are to processor 82;
Processor 82, for the ARP request message transmitted according to receiver 81, it is determined that needing what is sent to the first equipment Arp reply message, and the arp reply message transmissions that will be determined are to emitter 83;
Emitter 83, for the arp reply message transmitted to the first equipment transmission processe device 82.
Alternatively, processor 82 specifically for:It is determined that the corresponding network number of the source IP address of ARP request message, with place When the corresponding network number of IP address of the second equipment where reason device 82 is identical, it is determined that needing the ARP sent to the first equipment to answer Answer message;And/or, in the network number that the subnet mask and the IP address of second equipment according to setting determine, with reception When the purpose IP address of ARP request message are identical, it is determined that needing the arp reply message sent to the first equipment.
It should be understood by those skilled in the art that, embodiments of the invention can be provided as method, system or computer program Product.Therefore, the present invention can be using the reality in terms of complete hardware embodiment, complete software embodiment or combination software and hardware Apply the form of example.And, the present invention can be used and wherein include the computer of computer usable program code at one or more Usable storage medium(Including but not limited to magnetic disk storage, CD-ROM, optical memory etc.)The computer program of upper implementation is produced The form of product.
The present invention is with reference to method according to embodiments of the present invention, device(System)And the flow of computer program product Figure and/or block diagram are described.It should be understood that every first-class during flow chart and/or block diagram can be realized by computer program instructions The combination of flow and/or square frame in journey and/or square frame and flow chart and/or block diagram.These computer programs can be provided The processor of all-purpose computer, special-purpose computer, Embedded Processor or other programmable data processing devices is instructed to produce A raw machine so that produced for reality by the instruction of computer or the computing device of other programmable data processing devices The device of the function of being specified in present one flow of flow chart or multiple one square frame of flow and/or block diagram or multiple square frames.
These computer program instructions may be alternatively stored in can guide computer or other programmable data processing devices with spy In determining the computer-readable memory that mode works so that instruction of the storage in the computer-readable memory is produced and include finger Make the manufacture of device, the command device realize in one flow of flow chart or multiple one square frame of flow and/or block diagram or The function of being specified in multiple square frames.
These computer program instructions can be also loaded into computer or other programmable data processing devices so that in meter Series of operation steps is performed on calculation machine or other programmable devices to produce computer implemented treatment, so as in computer or The instruction performed on other programmable devices is provided for realizing in one flow of flow chart or multiple flows and/or block diagram one The step of function of being specified in individual square frame or multiple square frames.
, but those skilled in the art once know basic creation although preferred embodiments of the present invention have been described Property concept, then can make other change and modification to these embodiments.So, appended claims are intended to be construed to include excellent Select embodiment and fall into having altered and changing for the scope of the invention.
Obviously, those skilled in the art can carry out various changes and modification without deviating from essence of the invention to the present invention God and scope.So, if these modifications of the invention and modification belong to the scope of the claims in the present invention and its equivalent technologies Within, then the present invention is also intended to comprising these changes and modification.

Claims (14)

1. a kind of file transmitting method, it is characterised in that including:
First equipment sent ARP request report before the Internet protocol IP message for needing forwarding is received Text;Wherein, the ARP request message is active ARP request message, and for being different from existing ARP request message, expression is not The ARP of ability acquisition request IP message sinks when needing to turn transmitting IP packet, but in order to active obtaining receives ARP request The ARP of the equipment of message, the equipment for receiving active ARP request message need not be according to the active ARP request message Purpose IP address it is whether whether consistent with the IP address of this equipment come judge whether reply arp reply message;
First equipment receives the arp reply message that the second equipment sends, and described second is carried in the arp reply message The ARP of equipment.
2. the method for claim 1, it is characterised in that first equipment sends ARP request message, including:
First equipment will be according to the network number of the IP address of the subnet mask of setting and first equipment determination as mesh IP address, send the ARP request message.
3. method as claimed in claim 2, it is characterised in that first equipment determines network number according to following steps:
If the son of the number of bits less than the setting of the network position of the corresponding subnet mask of IP address of first equipment Net mask network position number of bits, then first equipment according to setting subnet mask, determine the net of each subnet Network number, wherein each subnet are that the network of the IP address mark of first equipment is divided to obtain;
If the number of bits of the network position of the corresponding subnet mask of IP address of first equipment is not less than the setting Subnet mask network position number of bits, then first equipment by set subnet mask and first equipment IP Address carries out logic and operation, determines network number.
4. method as claimed in claim 3, it is characterised in that the number of bits of the network position of the subnet mask of the setting It is 24.
5. the method as described in claim 3 or 4, it is characterised in that first equipment is by the IP address of first equipment The network of mark is divided into 2m-nIndividual subnet;Wherein, m is the number of bits of network position in the subnet mask for setting, and n is described The number of bits of the network position of the corresponding subnet mask of IP address of the first equipment.
6. the method as described in Claims 1 to 4 is any, it is characterised in that first equipment sends ARP request message, bag Include:
First equipment periodic sends ARP request message;And/or,
First equipment sends ARP request message when it is determined that the IP address of first equipment changes.
7. a kind of file transmitting method, it is characterised in that including:
Second equipment receives the address resolution that the first equipment sent before the Internet protocol IP message for needing forwarding is received Agreement ARP request message;Wherein, the ARP request message is active ARP request message, for being different from existing ARP request Message, ability expression is not the ARP of the acquisition request IP message sinks when needing to turn transmitting IP packet, but in order to actively obtain The ARP of the equipment for receiving ARP request message is taken, the equipment for receiving active ARP request message need not be according to this actively The purpose IP address of ARP request message it is whether whether consistent with the IP address of this equipment come judge whether reply arp reply message;
Second equipment sends arp reply message, the arp reply according to the ARP request message to first equipment The ARP of second equipment is carried in message.
8. method as claimed in claim 7, it is characterised in that second equipment according to the ARP request message, to described First equipment sends arp reply message, including:
Second equipment it is determined that the corresponding network number of source IP address of the ARP request message, with second equipment When the corresponding network number of IP address is identical, and/or second equipment is in the subnet mask and second equipment according to setting IP address determine network number, with receive ARP request message purpose IP address it is identical when, to first equipment send Arp reply message.
9. a kind of packet transmission device, it is characterised in that including:
Sending module, for being described first to set before the Internet protocol IP message that first equipment that receives needs forwarding Preparation send ARP request message, wherein, the ARP request message is active ARP request message, for distinguishing In existing ARP request message, expression is not the ARP table of the ability acquisition request IP message sinks when needing to turn transmitting IP packet , but the ARP of the equipment for active obtaining reception ARP request message, the equipment for receiving active ARP request message Need not judge to be according to whether whether the purpose IP address of active request ARP messages consistent with the IP address of the first equipment No reply arp reply message;
Receiver module, for receiving the arp reply message that the second equipment sends, carries described the in the arp reply message The ARP of two equipment.
10. device as claimed in claim 9, it is characterised in that the sending module specifically for:
The network number that will be determined according to the IP address of the subnet mask of setting and first equipment sends as purpose IP address ARP request message.
11. devices as claimed in claim 10, it is characterised in that the sending module determines network with specific reference to following steps Number:If the subnet of the number of bits less than the setting of the network position of the corresponding subnet mask of IP address of first equipment The number of bits of the network position of mask, then according to the subnet mask of setting, determine the network number of each subnet, wherein per height Net is that the network of the IP address mark of first equipment is divided to obtain;If the corresponding son of IP address of first equipment The number of bits of the network position of net mask will then set not less than the number of bits of the network position of the subnet mask of the setting Fixed subnet mask and the IP address of first equipment carry out logic and operation, determine network number.
12. device as described in claim 9~11 is any, it is characterised in that the sending module specifically for:Cycle sends ARP request message;And/or, when it is determined that the IP address of first equipment changes, send ARP request message.
A kind of 13. packet transmission devices, it is characterised in that including:
Receiver module, the forward direction for receiving the protocol IP message that the first equipment is interconnected between the network for needing forwarding is received The ARP request message that second equipment sends, and the ARP request message transmissions that will be received are to sending module;Its In, the ARP request message is active ARP request message, and for being different from existing ARP request message, expression is not to need Turn the ARP of ability acquisition request IP message sinks during transmitting IP packet, but in order to active obtaining receives ARP request report The ARP of the equipment of text, the equipment for receiving active ARP request message need not be according to the mesh of the active ARP request message IP address it is whether whether consistent with the IP address of this equipment come judge whether reply arp reply message;
Sending module, for the ARP request message transmitted according to the receiver module, arp reply is sent to first equipment Message, carries the ARP of second equipment in the arp reply message.
14. devices as claimed in claim 13, it is characterised in that the sending module specifically for:It is determined that the ARP please The corresponding network number of source IP address of message is sought, when the corresponding network number of IP address with second equipment is identical, and/or The network number that the IP address of subnet mask and second equipment according to setting determines, the mesh with the ARP request message for receiving IP address it is identical when, to first equipment send arp reply message.
CN201310373501.XA 2013-08-23 2013-08-23 A kind of file transmitting method and device Active CN103441931B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310373501.XA CN103441931B (en) 2013-08-23 2013-08-23 A kind of file transmitting method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310373501.XA CN103441931B (en) 2013-08-23 2013-08-23 A kind of file transmitting method and device

Publications (2)

Publication Number Publication Date
CN103441931A CN103441931A (en) 2013-12-11
CN103441931B true CN103441931B (en) 2017-06-20

Family

ID=49695597

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310373501.XA Active CN103441931B (en) 2013-08-23 2013-08-23 A kind of file transmitting method and device

Country Status (1)

Country Link
CN (1) CN103441931B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104750014B (en) * 2013-12-27 2017-08-11 施耐德电器工业公司 A large amount of plogrammable-controller applications/firmware upgrade methods
CN106209642A (en) * 2016-06-30 2016-12-07 杭州迪普科技有限公司 A kind of method and device turning transmitting IP packet
CN111770194B (en) * 2020-07-13 2024-04-26 太仓市同维电子有限公司 Method for actively triggering down-hanging equipment to send arp
CN114157602B (en) * 2021-11-03 2023-08-25 杭州迪普科技股份有限公司 Method and device for processing message

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101141308A (en) * 2007-10-15 2008-03-12 清华大学 Topology discovering method of IP backbone network
CN101227399A (en) * 2008-01-31 2008-07-23 华为技术有限公司 Message transmission method, system and forwarding node
CN101330530A (en) * 2008-07-02 2008-12-24 北京亿阳信通软件研究院有限公司 Method and apparatus for managing IP address segment
CN102655473A (en) * 2011-03-03 2012-09-05 华为技术有限公司 Communication method, equipment and system

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2615782A4 (en) * 2010-09-09 2016-11-30 Nec Corp Computer system and communication method in computer system
CN102546849B (en) * 2010-12-30 2014-10-08 华为技术有限公司 Detection method for IP (Internet Protocol) address conflict and network equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101141308A (en) * 2007-10-15 2008-03-12 清华大学 Topology discovering method of IP backbone network
CN101227399A (en) * 2008-01-31 2008-07-23 华为技术有限公司 Message transmission method, system and forwarding node
CN101330530A (en) * 2008-07-02 2008-12-24 北京亿阳信通软件研究院有限公司 Method and apparatus for managing IP address segment
CN102655473A (en) * 2011-03-03 2012-09-05 华为技术有限公司 Communication method, equipment and system

Also Published As

Publication number Publication date
CN103441931A (en) 2013-12-11

Similar Documents

Publication Publication Date Title
EP3496346B1 (en) Data message forwarding method and apparatus
CN103441931B (en) A kind of file transmitting method and device
CN103828440A (en) Providing communication path information in hybrid networks
CN102047702A (en) Methods and apparatus for communicating and/or using discovery information
CN111830844B (en) Intelligent equipment control method and device and intelligent home control panel
CN104584673A (en) Method and apparatus for selecting preferred parent node in wireless sensor network
JP2022520466A (en) Transmission resource detection method, transmission resource determination method and communication equipment
WO2024104284A1 (en) Nwdaf-based management and decision-making method for computing resources
CN106713522A (en) Wireless fidelity (Wi-Fi) connection method and mobile terminal
KR20160111991A (en) Method, device and apparatus for determining downlink parameter
CN105721612A (en) Data transmission method and device
JP2020503772A (en) Data transmission method, transmitting device and receiving device
CN112583547A (en) Method and equipment for determining and configuring mapping relation between TCI state and DMRS (demodulation reference signal)
CN104717640B (en) A kind of implementation method of the wireless communication based on positioning
CN103905392B (en) DynamicHost sets protocol DHCP server selection method, apparatus and system
CN110933758B (en) Interference coordination method and device, and base station
CN103634877B (en) Without the management method of access point in the network of access controller and access point apparatus
CN107623555B (en) Method and device for realizing universal communication simulation platform
CN104618335A (en) Message exchange method and interface processing platform
TW201940003A (en) Terminal, base station, and method for communications between the terminal and the base station and for accessing a network
CN107613456B (en) Information management method and equipment based on Internet of things
CN107708142B (en) Grouping method, device and system for access device AP
CN104105160B (en) Method for discovering equipment, base station and user equipment
TW201931809A (en) Data transmission method and apparatus and computer storage medium
CN108989173A (en) A kind of method and device of message transmissions

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