CN103441931A - Message sending method and device - Google Patents

Message sending method and device Download PDF

Info

Publication number
CN103441931A
CN103441931A CN201310373501XA CN201310373501A CN103441931A CN 103441931 A CN103441931 A CN 103441931A CN 201310373501X A CN201310373501X A CN 201310373501XA CN 201310373501 A CN201310373501 A CN 201310373501A CN 103441931 A CN103441931 A CN 103441931A
Authority
CN
China
Prior art keywords
equipment
address
request message
network
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.)
Granted
Application number
CN201310373501XA
Other languages
Chinese (zh)
Other versions
CN103441931B (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

Images

Landscapes

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

Abstract

Disclosed are a message sending method and device. The message sending method comprises the following steps that an address resolution protocol (ARP) request message is sent by first equipment before an IP message needing forwarding is received by the first equipment to ensure that an ARP response message is sent to the first equipment by second equipment receiving the ARP request message; the ARP response sent by the second equipment is received by the first equipment. Due to the adoption of the method, the first equipment sends the ARP request message before receiving the IP message needing forwarding, an ARP table entry can be temporarily searched before the IP message needs forwarding and the ARP request message can be sent before the ARP table entry can not be found, and therefore the break period in the IP message forwarding process can be reduced.

Description

A kind of file transmitting method and device
Technical field
The present invention relates to the communications field, relate in particular to a kind of file transmitting method and device.
Background technology
Carrying out Internet protocol (Internet Protocol, IP) during message repeating, if transmitting apparatus will be transmitted to receiving equipment smoothly by the IP message, under the condition of the IP address of known receiving equipment, also need the media interviews of obtaining receiving equipment to control (Media Access Control, MAC) address; Transmitting apparatus specifically can be by sending address resolution protocol (Address Resolution Protocol, ARP) request message, obtain the MAC Address of this receiving equipment, the ARP request message here is broadcasting packet, all receiving equipments in the broadcast domain of transmitting apparatus can receive this ARP request message, receiving equipment is after receiving this ARP request message, if determine the IP address that the purpose IP address of this ARP request message is this receiving equipment, to transmitting apparatus, reply the arp reply message, with the MAC Address by self, inform transmitting apparatus.
At present, when transmitting apparatus forwards the IP message at needs, at first need to search the ARP list item that this IP message is corresponding, the ARP list item here can provide the mapping relations between IP address and MAC Address, can obtain the MAC Address of receiving equipment according to this ARP list item, if this transmitting apparatus can't find the ARP list item that this IP message is corresponding, just send the ARP request message, receiving equipment is after receiving the ARP request message, if determine the IP address that the purpose IP address of this ARP request message is this equipment, to transmitting apparatus, reply the arp reply message.
According to current technology, when transmitting apparatus forwards at needs the IP message received, search the ARP list item that this IP message is corresponding, when searching the ARP list item corresponding less than this IP message, just send the ARP request message; Owing to searching the ARP list item and waiting for that the process of arp reply message all needs consuming time, simultaneously, this IP message likely needs could arrive final receiving equipment through the forwarding of multilevel device, will cause like this forwarding process of message longer break period, even may cause packet loss.
Summary of the invention
The embodiment of the present invention provides a kind of file transmitting method and device, in order to reduce the break period of IP message repeating process.
First aspect, a kind of file transmitting method comprises:
The first equipment sent the ARP request message before receiving the Internet protocol IP message that needs to forward;
Described the first equipment receives the arp reply message that described the second equipment sends.
In conjunction with first aspect, in the first, in possible implementation, described the first equipment sends the ARP request message, comprising:
Described the first equipment will be definite according to the IP address of the subnet mask of setting and described the first equipment network number as purpose IP address, send the ARP request message.
The possible implementation in conjunction with the first of first aspect, at the second, in possible implementation, described the first equipment is determined network number according to following steps:
If the number of bits of the network position of the subnet mask that the IP address of described the first equipment is corresponding is less than the number of bits of network position of the subnet mask of described setting, described the first equipment is according to the subnet mask of setting, determine the network number of each subnet, wherein each subnet is that the network of the IP address designation of described the first equipment is divided and obtained;
If the number of bits of the network position of the subnet mask that the IP address of described the first equipment is corresponding is not less than the number of bits of network position of the subnet mask of described setting, described the first equipment carries out logic and operation by the IP address of the subnet mask of setting and described the first equipment, determines network number.
The possible implementation in conjunction with the second of first aspect, at the third, in possible implementation, the number of bits of the network position of the subnet mask of described setting is 24.
In conjunction with second or the third possible implementation of first aspect, in the 4th kind of possible implementation, described the first equipment is divided into 2 by the network of the IP address designation of described the first equipment m-nindividual subnet; Wherein, m is the number of bits of network position in the subnet mask of setting, the number of bits of the network position of the subnet mask that the IP address that n is described the first equipment is corresponding.
In conjunction with first aspect, or first to fourth kind of possible implementation of first aspect, in the 5th kind of possible implementation, described the first equipment sends the ARP request message, comprising:
Described the first equipment periodic sends the ARP request message; And/or,
When described the first equipment changes in the IP address of determining described the first equipment, send the ARP request message.
Second aspect, a kind of file transmitting method comprises:
The second equipment receives the first equipment and is receiving the ARP request message sent before the Internet protocol IP message that needs to forward;
Described the second equipment, according to described ARP request message, sends the arp reply message to described the first equipment.
In conjunction with second aspect, in the first, in possible implementation, described the second equipment, according to described ARP request message, sends the arp reply message to described the first equipment, comprising:
Described the second equipment is at network number corresponding to source IP address of determining described ARP request message, when the network number corresponding with the IP address of described the second equipment is identical, and/or described the second equipment is at the definite network number in the IP address of the subnet mask according to described setting and described the second equipment, when identical with the purpose IP address of the ARP request message received, to described the first equipment, send the arp reply message.
The third aspect, provide a kind of packet transmission device, comprising:
Sending module, for before receiving the Internet protocol IP message that needs to forward, sending the ARP request message, send the arp reply message so that receive the second equipment of described ARP request message to described the first equipment;
Receiver module, the arp reply message sent for receiving described the second equipment.
In conjunction with the third aspect, in the first in possible implementation, described sending module specifically for:
Network number that will be definite according to the IP address of the subnet mask of setting and described the first equipment, as purpose IP address, sends the ARP request message.
The possible implementation in conjunction with the first of the third aspect, at the second in possible implementation, described sending module is determined network number according to following steps: if the number of bits of the network position of subnet mask corresponding to the IP address of described the first equipment is less than the number of bits of network position of the subnet mask of described setting, according to the subnet mask of setting, determine the network number of each subnet, wherein each subnet is that the network of the IP address designation of described the first equipment is divided and obtained; If the number of bits of the network position of the subnet mask that the IP address of described the first equipment is corresponding is not less than the number of bits of network position of the subnet mask of described setting, logic and operation is carried out in the IP address of the subnet mask of setting and described the first equipment, determine network number.
The possible implementation in conjunction with the second of the third aspect, at the third, in possible implementation, the number of bits of the network position of the subnet mask of described setting is 24.
In conjunction with second or the third possible implementation of the third aspect, in the 4th kind of possible implementation, described sending module is divided into 2 by the net of the IP address designation of described the first equipment m-nindividual subnet; Wherein, m is the number of bits of network position in the subnet mask of setting, the number of bits of the network position of the subnet mask that the IP address that n is described the first equipment is corresponding.
In conjunction with the third aspect, or first to fourth kind of possible implementation of the third aspect, in the 5th kind of possible implementation, described sending module sends the ARP request message specifically for: cycle, and/or, while changing in the IP address of determining described the first equipment, send the ARP request message.
Fourth aspect, provide a kind of packet transmission device, comprising:
Receiver module, receiving for receiving the first equipment the ARP request message sent before the Internet protocol IP message that needs to forward, and the ARP request message of reception be transferred to sending module;
Sending module, for the ARP request message according to described receiver module transmission, send the arp reply message to described the first equipment.
In conjunction with fourth aspect, in the first in possible implementation, described sending module specifically for: determining the network number corresponding to source IP address of described ARP request message, when the network number corresponding with the IP address of described the second equipment is identical, and/or at the definite network number in the IP address of the subnet mask according to described setting and described the second equipment, when identical with the purpose IP address of the ARP request message received, to described the first equipment, send the arp reply message.
The method that adopts above-mentioned first aspect to provide, the first equipment just sent the ARP request message before receiving the IP message that needs to forward, needn't by the time when forwarding the IP message, just inquire about by needs the ARP list item temporarily, send again the ARP request message when searching less than the ARP list item, thereby can reduce the break period in IP message repeating process.
The accompanying drawing explanation
In order to be illustrated more clearly in the embodiment of the present invention or technical scheme of the prior art, below will the accompanying drawing of required use in embodiment or description of the Prior Art be briefly described, apparently, accompanying drawing in the following describes is only some embodiments of the present invention, for those of ordinary skills, under the prerequisite of not paying creative work, can also obtain according to these accompanying drawings other accompanying drawing.
The file transmitting method flow chart that Fig. 1 is the embodiment of the present invention one;
The file transmitting method flow chart that Fig. 2 is the embodiment of the present invention two;
The method flow diagram that carries out the message transmission that Fig. 3 is the embodiment of the present invention one;
The method flow diagram that carries out the message transmission that Fig. 4 is the embodiment of the present invention two;
The packet transmission device structural representation that Fig. 5 is the embodiment of the present invention one;
The packet transmission device structural representation that Fig. 6 is the embodiment of the present invention two;
The packet transmission device structural representation that Fig. 7 is the embodiment of the present invention three;
The packet transmission device structural representation that Fig. 8 is the embodiment of the present invention four.
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 clearly and completely described, obviously, described embodiment is only a part of embodiment of the present invention, rather than whole embodiment.Embodiment based in the present invention, those of ordinary skills, not making under the creative work prerequisite the every other embodiment obtained, belong to the scope of protection of the invention.
In the embodiment of the present invention, the first equipment just sent the ARP request message before receiving the IP message that needs to forward, and needn't by the time when needs forward the IP message, just inquire about the ARP list item temporarily, send again the ARP request message when searching less than the ARP list item, thereby can reduce the break period in IP message repeating process.
Below in conjunction with Figure of description, the embodiment of the present invention is described in further detail.
As shown in Figure 1, be the file transmitting method flow chart of the embodiment of the present invention one, the method comprises:
S101: the first equipment sent the ARP request message before receiving the IP message that needs to forward, so that receive the second equipment of ARP request message, to described the first equipment, sent the arp reply message;
S102: the first equipment receives the arp reply message that the second equipment sends.
In the embodiment of the present invention, the first equipment just sent the ARP request message before receiving the IP message that needs to forward, be also, the first equipment just sends the ARP request message when also not receiving the IP message that needs forwarding, equipment in the broadcast domain of this first equipment can receive this ARP request message, the equipment that receives this ARP request message can directly be replied the arp reply message, also can determine whether to send the arp reply message to the first equipment according to predefined condition, here the equipment that will reply the arp reply message is called the second equipment, here, reply arp reply message when predefined condition can be the second equipment in the IP address of the source IP address of determining the ARP request message received and this equipment in the same network segment, can also be the second equipment in the IP address of the source IP address of determining the ARP request message received and this equipment in the same network segment, and the subnet mask of the IP address of this equipment and setting is carried out to the network number obtained after logic and operation, when identical with the purpose IP address of ARP request message, reply the arp reply message, following content will elaborate to the condition of the second device replied APR response message, after the arp reply message that the first equipment sends at second equipment that receives, if determine and need to, to the second device forwards IP message, can, according to this arp reply message, determine the MAC Address of the second equipment, then just can be according to definite MAC Address, to the second device forwards message.After the arp reply message that the first equipment also can send at second equipment that receives, according to this arp reply message, determine the MAC Address of the second equipment, afterwards, need to be to the second device forwards IP message if determine, the MAC Address of the second equipment that directly basis is determined, to the second device forwards IP message.
In concrete enforcement, the ARP request message that adopts the embodiment of the present invention to send is different from existing ARP request message.In prior art, during IP address that the equipment that receives the ARP request message is this equipment in the purpose IP address of determining this ARP request message, reply the arp reply message.And due to the first equipment in the embodiment of the present invention when sending the ARP request message, also might not need to forward the IP message, also naturally not necessarily know the IP address of the equipment of reception IP message.The particular content of the ARP request message that therefore, the first equipment sends also is different from the particular content of existing ARP request message naturally.As shown in Table 1, the number of bits that each field comprised in the ARP message for the embodiment of the present invention and each field are occupied.As shown in Table 2, the length for each field in the ARP message of the embodiment of the present invention reaches the brief description to each field.In the embodiment of the present invention, can be 5 by the action type of ARP message (OP) field value, be 1 represented ARP request for meaning initiatively ARP request, being different from action type field value.The active ARP request here, expression is the ARP request just sent before the IP message that needs to forward receiving.Receive while meaning that initiatively the equipment of the ARP message of ARP request judges whether to reply the arp reply message, also be different from ARP that action type field value is 1 request, do not need whether with whether the IP address of this equipment is consistent, to judge whether to reply the arp reply message according to the purpose IP address of this active ARP message.Equipment can be after receiving the ARP message that means initiatively ARP request, just reply the arp reply message, also can be after receiving the ARP message that means initiatively ARP request, condition according to predefined reply arp reply message, after determining that needs are replied the arp reply message, then reply the arp reply message.
0bit 15bit 23bit 31bit
Figure BDA0000371502550000081
Table one
Figure BDA0000371502550000082
table two
Alternatively, the first equipment sends the ARP request message, comprising:
The first equipment will be definite according to the IP address of the subnet mask of setting and the first equipment network number as purpose IP address, send the ARP request message.
Here, logic and operation is carried out in the IP address of the subnet mask of described setting and described the first equipment, can obtain the network number of the IP address of corresponding described subnet mask and described the first equipment, by after described subnet mask step-by-step negate, carry out logic and operation with the IP address of described the first equipment again, can obtain the host number of the IP address of corresponding described subnet mask and described the first equipment; Wherein, described subnet mask is comprised of network position and main frame position, and wherein each network position identifies with binary one, and each main frame position identifies with Binary Zero; Known according to definite mode of above-mentioned network number, the number of bits of network number is identical with the number of bits of IP address, is all 32, in the embodiment of the present invention, using definite network number as purpose IP address, sends the ARP request message.
In concrete enforcement, because the first equipment did not just send the ARP request message before also not receiving the IP message that needs to forward, the first equipment does not also know when need to E-Packet, do not know when needs E-Packet, forward the packet to which equipment yet.The purpose IP address of the ARP request message that therefore, the first equipment sends also needs not be the IP address of some equipment.Correspondingly, the equipment that receives the ARP request message does not need to determine whether to reply the APR response message according to whether whether the purpose IP address of this ARP request message identical with the IP address of this equipment yet.In concrete an enforcement, can preset the condition of the device replied APR response message that receives the ARP request message.This condition can be relevant to the purpose IP address of ARP request message, also can be relevant to the source IP address of ARP request message.Such as, the second equipment can be in the IP address of the source IP address of determining the ARP request message received and this equipment reply arp reply message during in the same network segment; Can also be in the IP address of the source IP address of determining the ARP request message receive and this equipment in the same network segment, and the subnet mask of the IP address of this equipment and setting is carried out to the network number obtained after logic and operation, when identical with the purpose IP address of ARP request message, reply the arp reply message.Below content and in the embodiment of the present invention two, will the condition of the device replied APR response message that receives the ARP request message be elaborated.
In a kind of concrete enforcement of the present invention, according to the subnet mask of setting and the IP address of the first equipment, determine that the mode of network number can be following mode (1) or mode (2):
When the number of bits of the network position of the subnet mask that mode (1) is corresponding in the IP address of the first equipment is less than the number of bits of network position of subnet mask of setting, the first equipment is according to the subnet mask of setting, determine the network number of each subnet, wherein each subnet is that the network of the IP address designation of described the first equipment is divided and obtained.
In concrete enforcement, the number of bits of the subnet mask of setting can be 24, certainly, the number of bits of the subnet mask of setting can also be other figure place, and being set is 24 the just optional execution modes of the embodiment of the present invention in concrete enforcement.
Alternatively, the first equipment is divided into 2 by the network of the IP address designation of the first equipment m-nindividual subnet; Wherein, m is the number of bits of network position in the subnet mask of setting, the number of bits of the network position of the subnet mask that the IP address that n is the first equipment is corresponding.
In this mode, when the number of bits of the network position of subnet mask corresponding to the IP address of the first equipment less, and the number of bits of main frame position is when more, the subscriber equipment quantity that shows the network coverage that the IP address of this first equipment identifies is more, if all these subscriber equipmenies are all replied the arp reply message after receiving the ARP request message, can bring larger burden to the network bandwidth and this first equipment at short notice.Pass through to set a subnet mask in the embodiment of the present invention, when in the IP address of the first equipment, the number of bits of the network position of corresponding subnet mask is less than the number of bits of network position of subnet mask of this setting, the network of the IP address designation of this first equipment is divided into to a plurality of subnets, determine the network number of each subnet corresponding with the subnet mask of setting, the network number of each subnet that will determine respectively, as purpose IP address, sends the ARP request message; Correspondingly, the second equipment can be after receiving the ARP request message, the subnet mask of the IP address of the second equipment and setting is carried out to logic and operation and determine network number, when definite network number is identical with the purpose IP address of the ARP request message of reception, reply the arp reply message, adopt this sample loading mode, the quantity that the first equipment receives the arp reply message at every turn greatly reduces, and can effectively alleviate in the short time the pressure of the network bandwidth and the operation burden that the first equipment is caused.Below be described for a specific example:
Such as, the IP address of supposing the first equipment is 192.168.10.1, be shown 11000000.10101000.00001010.00000001 with binary form, the number of bits of the network position of the subnet mask that this IP address is corresponding is 16, by this subnet mask of binary representation, be 11111111.11111111.00000000.00000000, the network of network that this IP address identifies number is 192.168.0.0, the number of bits of the network position of the subnet mask of setting is 24, by the subnet mask of this setting of binary representation, be 11111111.11111111.11111111.00000000, when sending the ARP request message, can be according to the subnet mask of setting, determine when the network that this network number of 192.168.0.0 is identified is divided into a plurality of subnet, the network number of each subnet, here, the network number of each subnet is the network number of the corresponding subnet mask of setting,, in the network number of subnet, non-zero number of bits equals the number of bits of the network position of the subnet mask set, here, the subnet mask that is 24 according to the network position of setting, the network that just network number 192.168.0.0 can be identified is divided into 2 24-16=256 subnets, the network number of each subnet is respectively 192.168.0.0,192.168.1.0,192.168.2.0 ... 192.168.255.0, afterwards, purpose IP address that just can be using the network number of each subnet as the ARP request message, send the ARP request message, the second equipment that the IP address is 192.168.20.1 is after receiving the ARP request message that purpose IP address is 192.168.20.0, the subnet mask that the second equipment is 24 by the network position of the IP address 192.168.20.1 of the second equipment and setting carries out determining that network number is 192.168.20.0 after logic and operation, identical with the purpose IP address of ARP request message, the second equipment sends the arp reply message to the first equipment.
If do not adopt with upper type, the equipment of replying arp reply is not retrained, each receives the equipment of ARP request message, all reply the arp reply message, the first equipment will receive maximum 65536-3 arp reply messages in the short time, it is the corresponding broadcast address of full 0 (map network number), full F(that 3 IP addresses that wherein deduct are respectively host number) the IP address, and the IP address of this interface.And adopt with upper type, by the subnet mask of 16 network positions, corresponding network number is divided into the network number corresponding to subnet mask of 256 24 network positions, the subnet mask that is 24 for each network position, the first equipment receives only at most 256 arp reply messages in the short time, alleviated in the short time the pressure of the network bandwidth and the operation burden that the first equipment is caused.
It should be noted that, whether the second equipment can send the arp reply message to the first equipment by Autonomous determination.In concrete enforcement, the second equipment can adopt with upper type and judge whether to send the arp reply message to the first equipment, also can not adopt with upper type and judge whether to send the arp reply message to the first equipment.Such as, can after receiving the ARP request message, directly reply the arp reply message, reply the arp reply message in the time of can also belonging to the same network segment in the IP address of the source IP address of determining the ARP request message and the second equipment, can also meet at the same time the source IP address of ARP request message and the IP address of the second equipment and belong to the same network segment, with, the subnet mask of the IP address of the second equipment and setting is carried out to the definite network number of logic and operation, during with purpose IP address identical this two conditions of the ARP request message received, reply the arp reply message.
Mode (2): when the number of bits of the network position of corresponding subnet mask is not less than the number of bits of network position of subnet mask of setting in the IP address of the first equipment:
The first equipment carries out logic and operation by the IP address of the subnet mask of setting and the first equipment, determines network number.
In this mode, when the number of bits of the network position of subnet mask corresponding to the IP address of the first equipment more, and the number of bits of main frame position is when less, the subscriber equipment quantity that shows the network coverage that this IP address identifies is less, at this moment, just needn't worry that all these subscriber equipmenies all reply the arp reply message after receiving the ARP request message, can bring at short notice the problem of larger burden to the network bandwidth and this first equipment, therefore, in this case, can directly logic and operation be carried out in the IP address of the subnet mask of setting and the first equipment, determine network number.Below be described for a specific example:
Such as, the IP address of supposing the first equipment is 192.168.10.1, be shown 11000000.10101000.00001010.00000001 with binary form, the number of bits of the network position of the subnet mask that this IP address is corresponding is 24, and the number of bits of the network position of the subnet mask of setting is also 24, every of the subnet mask 11111111.11111111.11111111.00000000 that is 24 by this IP address and network position is carried out logic and operation, the network number of definite purpose IP address as the ARP request message is the corresponding decimal system 192.168.10.0 of 11000000.10101000.00001010.00000000().Correspondingly, the second equipment, after receiving this ARP request message, can adopt to the similar mode of introducing in above-mentioned first kind of way and judge whether to reply the arp reply message, such as:
Can after receiving the ARP request message, directly reply the arp reply message;
Reply the arp reply message in the time of also can belonging to the same network segment in the IP address of the source IP address of determining the ARP request message and the second equipment;
Can also meet at the same time the source IP address of ARP request message and the IP address of the second equipment and belong to the same network segment, with, the subnet mask of the IP address of the second equipment and setting is carried out to the definite network number of logic and operation, during with purpose IP address identical this two conditions of the ARP request message received, reply the arp reply message.
Alternatively, in S101, the first equipment sends the ARP request message, comprising:
The first equipment periodic sends the ARP request message; And/or,
When the first equipment changes in the IP address of determining the first equipment, send the ARP request message.
In the embodiment of the present invention, the first equipment just sends the ARP request message when also not receiving the IP message.In concrete enforcement, the first equipment specifically can just start to send the ARP request message when Interface status transfers normal operating conditions to by malfunction, and under normal Interface status, according to the time interval of setting, send the cycle, send the ARP request message, and receive the arp reply message that the second equipment sends, when the first equipment determines that needs forward the IP message, can determine according to the arp reply message received the MAC Address of the second equipment, and according to definite MAC Address, give the second equipment by the IP message repeating, and needn't be when needs are given the second equipment by the IP message repeating, inquire about again the ARP list item of the second equipment temporarily, remove again to send the ARP request message when searching less than the ARP list item, thereby can reduce the break period in the IP repeating process, improve forward efficiency, and minimizing packet loss.
When the first equipment can also change in the IP address of determining the first equipment, send the ARP request message, and receive the arp reply message that the second equipment sends, when the first equipment determines that needs forward the IP message, needn't inquire about again the ARP list item of the second equipment temporarily, just can determine according to the arp reply message received the MAC Address of the second equipment, by the IP message repeating, give the second equipment, also can reduce the break period in the IP repeating process, improve forward efficiency.
In concrete enforcement, the transmission of above two ARP request messages can be combined with opportunity; While changing due to the IP address of the first equipment, need the equipment of replying the arp reply message just likely to change, therefore, when the cycle sends the ARP request message, if determine, the IP address of the first equipment changes, even at this moment according to the transmission cycle of setting, also be less than the time that sends the ARP request message, also send the ARP request message, and, after sending the ARP request message, continue to send the ARP request message according to the transmission cycle of setting.
As shown in Figure 2, be the file transmitting method of the embodiment of the present invention two, the method comprises:
S201: the second equipment receives the first equipment and is receiving the ARP request message sent before the IP message that needs to forward;
S202: the second equipment, according to the ARP request message received, sends the arp reply message to the first equipment.
In specific implementation process, after the ARP request message that the second equipment sends at first equipment that receives, if determine, this ARP request message is active ARP request message, sends the arp reply message to the first equipment; Such as, the OP field value of this ARP request message that the second equipment receives is 5, according to the agreement with the first equipment, the second equipment determines that this ARP request message is for active ARP request message, the second equipment can send the arp reply message to the first equipment immediately, also can, according to predefined condition, when determining that the ARP request message received meets predefined condition, to the first equipment, send the arp reply message.In the embodiment of the present invention, the condition that predefined the second equipment sends the arp reply message can be one or both in following condition:
Condition (1): the second equipment, at network number corresponding to source IP address of determining the ARP request message received, when the network number corresponding with the IP address of the second equipment is identical, sends the arp reply message to the first equipment;
The practical significance of above-mentioned condition (1) is: when the second equipment belongs to the same network segment in the IP address of the source IP address of determining the ARP request message and the second equipment, to the first equipment, send the arp reply message, such as, the source IP address of the ARP request message that the second equipment receives is 192.168.10.1, the IP address of the second equipment is 192.168.20.1, the network position of the subnet mask that the IP address of the second equipment is corresponding is 16, the subnet mask that the second equipment is corresponding with the IP address of the second equipment by the source IP address of ARP request message is carried out logic and operation, network number corresponding to source IP address of determining the ARP request message is 192.168.0.0, the second equipment simultaneously by the Yu GaiIP address, IP address of self corresponding subnet mask carry out logic and operation, network number corresponding to IP address of determining self is similarly 192.168.0.0, think that the source IP address of transmission ARP request message and the IP address of the second equipment belong to the same network segment, the second equipment sends the arp reply message to the first equipment.
In concrete enforcement, the second equipment can also be selected, in conjunction with following condition (2), to judge whether to reply the arp reply message;
Condition (2): the second equipment, at the subnet mask according to setting and the definite network number in IP address of the second equipment, when identical with the purpose IP address of the ARP request message received, sends the arp reply message to the first equipment;
Such as, the purpose IP address of the ARP request message that the second equipment receives is 192.168.20.0, the IP address of the second equipment is 192.168.20.1, the network position of the subnet mask of setting is 24, the second equipment is 192.168.20.0 according to the subnet mask of setting and the definite network number in IP address of the second equipment, identical with the purpose IP address of the ARP request message received, the second equipment is determined to the first equipment transmission arp reply message.
In concrete enforcement, above-mentioned the first equipment is determined the first kind of way of network number according to the IP address of the subnet mask of setting and the first equipment, when the second condition here is combined, can reduce the first equipment receives arp reply message quantity in the short time, effectively alleviate the interior operation burden that pressure and first equipment of the network bandwidth are caused of short time.Concrete reason is described introducing when above-mentioned the first is determined the mode of network number, repeats no more here.
As shown in Figure 3, be the method flow diagram that carries out the message transmission of the embodiment of the present invention one.The method comprises:
S301: the first equipment, according to the subnet mask of setting, is determined when the network of the IP address designation by the first equipment is divided into a plurality of subnet the network number of each subnet; Wherein, the number of bits of the network position of subnet mask corresponding to the IP address of the first equipment is less than the number of bits of network position of the subnet mask of setting.
Here, the quantity of a plurality of subnets of division is 2 m-nindividual.Wherein, m is the number of bits of network position in the subnet mask of setting, the number of bits of the network position of the subnet mask that the IP address that n is the first equipment is corresponding; The number of bits of the network position of the subnet mask of setting can be 24.
S302: the first equipment is when Interface status is normal, and the network number of each subnet that will determine respectively, as purpose IP address, sends the ARP request message.
In concrete enforcement, the first equipment can be according to the agreement with the second equipment, by the OP field value of the ARP request message of transmission, be 5, what mean transmission is active ARP request message, for being different from existing ARP request message, mean it is not the ARP list item of acquisition request IP message sink just when needs forward the IP message, but receive the ARP list item of the equipment of ARP request message for active obtaining.
S303: the second equipment receives the ARP request message that the first equipment sends.
S304: the second equipment is according to the ARP request message received, at network number corresponding to source IP address of determining this ARP request message, the network number corresponding with the IP address of the second equipment is identical, and at the subnet mask according to setting and the definite network number in IP address of the second equipment, when identical with the purpose IP address of the ARP request message received, to the first equipment, send the arp reply message.
S305: the first equipment receives the arp reply message that the second equipment sends.
Adopt the embodiment of the present invention one, not only can reduce the break period in IP message repeating process, can also reduce the first equipment receives arp reply message quantity in the short time, effectively alleviate the interior operation burden that pressure and first equipment of the network bandwidth are caused of short time.
As shown in Figure 4, the method flow diagram that carries out the message transmission for the embodiment of the present invention two comprises:
S401: the first equipment carries out logic and operation by the IP address of the subnet mask of setting and this first equipment, determines network number; Wherein, the number of bits of the network position of subnet mask corresponding to the IP address of the first equipment is not less than the number of bits of network position of the subnet mask of setting.
Here, the number of bits of the network position of the subnet mask of setting can be 24.
S402: the first equipment, when Interface status is normal, using definite network number as purpose IP address, sends the ARP request message.
S403: the second equipment receives the ARP request message that the first equipment sends.
S404: the second equipment, according to the ARP request message received, at network number corresponding to source IP address of determining this ARP request message, when the network number corresponding with the IP address of the second equipment is identical, sends the arp reply message to the first equipment.
S405: the first equipment receives the arp reply message that the second equipment sends.
Based on same inventive concept, a kind of packet transmission device corresponding with file transmitting method also is provided in the embodiment of the present invention, because the principle of this device solves problem is similar to embodiment of the present invention file transmitting method, therefore the enforcement of this device can, referring to the enforcement of method, repeat part and repeat no more.
As shown in Figure 5, be the packet transmission device structural representation of the embodiment of the present invention one, this device comprises:
Sending module 51, for before receiving the IP message that needs to forward, sending the ARP request message, send the arp reply message so that receive the second equipment of ARP request message to the first equipment;
Receiver module 52, the arp reply message sent for receiving the second equipment.
Alternatively, sending module 51 specifically for:
Network number that will be definite according to the IP address of the subnet mask of setting and the first equipment, as purpose IP address, sends the ARP request message.
Alternatively, sending module 51 is specifically determined network number according to following steps: if the number of bits of the network position of subnet mask corresponding to the IP address of the first equipment is less than the number of bits of network position of the subnet mask of setting, according to the subnet mask of setting, determine the network number of each subnet, wherein each subnet is that the network of the IP address designation of the first equipment is divided and obtained; If the number of bits of the network position of the subnet mask that the IP address of the first equipment is corresponding is not less than the number of bits of network position of the subnet mask of setting, logic and operation is carried out in 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 of setting is 24.
Alternatively, sending module 51 is divided into 2 by the net of the IP address designation of the first equipment m-nindividual subnet; Wherein, m is the number of bits of network position in the subnet mask of setting, the number of bits of the network position of the subnet mask that the IP address that n is the first equipment is corresponding.
Alternatively, sending module 51 sends the ARP request message specifically for: cycle; And/or, while changing in the IP address of determining the first equipment, send the ARP request message.
As shown in Figure 6, be the packet transmission device structural representation of the embodiment of the present invention two, this device comprises:
Receiver module 61, receiving for receiving the first equipment the ARP request message sent before the IP message that needs to forward, and the ARP request message of reception be transferred to sending module 62;
Sending module 62, for the ARP request message according to receiver module 61 transmission, send the arp reply message to the first equipment.
Alternatively, sending module 62 specifically for: determining the network number corresponding to source IP address of ARP request message, when the network number corresponding with the IP address of the second equipment is identical, and/or at the subnet mask according to setting and the definite network number in IP address of the second equipment, when identical with the purpose IP address of the ARP request message received, to the first equipment, send the arp reply message.
As shown in Figure 7, the packet transmission device structural representation of the embodiment of the present invention three, this device comprises:
Processor 71, for before receiving the IP message that needs the first device forwards, determine the ARP request message that need to send to the second equipment, and definite ARP request message be transferred to transmitter 72;
Transmitter 72, for the ARP request message of sending processor 71 transmission, send the arp reply message so that receive the second equipment of ARP request message to the first equipment;
Receiver 73, the arp reply message sent for receiving the second equipment.
Alternatively, processor 71 specifically for:
Network number that will be definite according to the IP address of the subnet mask of setting and the first equipment is as the purpose IP address of the ARP request message that need to transmit to transmitter 72.
Alternatively, processor 71 is specifically for determining network number according to following steps: if the number of bits of the network position of subnet mask corresponding to the IP address of the first equipment is less than the number of bits of network position of the subnet mask of setting, according to the subnet mask of setting, determine the network number of each subnet, wherein each subnet is that the network of the IP address designation of the first equipment is divided and obtained; If the number of bits of the network position of the subnet mask that the IP address of the first equipment is corresponding is not less than the number of bits of network position of the subnet mask of setting, logic and operation is carried out in 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 of setting is 24.
Alternatively, processor 71 is divided into 2 by the net of the IP address designation of the first equipment m-nindividual subnet; Wherein, m is the number of bits of network position in the subnet mask of setting, the number of bits of the network position of the subnet mask that the IP address that n is the first equipment is corresponding.
Alternatively, transmitter 72 sends the ARP request message specifically for: cycle; And/or, while changing in the IP address of determining the first equipment, send the ARP request message.
As shown in Figure 8, be the packet transmission device structural representation of the embodiment of the present invention four, this device comprises:
Receiver 81, receiving for receiving the first equipment the ARP request message sent before the IP message that needs to forward, and the ARP request message of reception be transferred to processor 82;
Processor 82, for the ARP request message according to receiver 81 transmission, determine the arp reply message that need to send to the first equipment, and by definite arp reply message transmissions to transmitter 83;
Transmitter 83, for the arp reply message to the first equipment sending processor 82 transmission.
Alternatively, processor 82 specifically for: determining the network number corresponding to source IP address of ARP request message, when the network number corresponding with the IP address of second equipment at processor 82 places is identical, determining the arp reply message that need to send to the first equipment; And/or, at the subnet mask according to setting and the definite network number in IP address of described the second equipment, when identical with the purpose IP address of the ARP request message received, determine the arp reply message that need to send to the first equipment.
Those skilled in the art should understand, embodiments of the invention can be provided as method, system or computer program.Therefore, the present invention can adopt complete hardware implementation example, implement software example or in conjunction with the form of the embodiment of software and hardware aspect fully.And the present invention can adopt the form that wherein includes the upper computer program of implementing of computer-usable storage medium (including but not limited to magnetic disc store, CD-ROM, optical memory etc.) of computer usable program code one or more.
The present invention describes with reference to flow chart and/or the block diagram of method, device (system) and computer program according to the embodiment of the present invention.Should understand can be in computer program instructions realization flow figure and/or block diagram each flow process and/or the flow process in square frame and flow chart and/or block diagram and/or the combination of square frame.Can provide these computer program instructions to the processor of all-purpose computer, special-purpose computer, Embedded Processor or other programmable data processing device to produce a machine, make the instruction of carrying out by the processor of computer or other programmable data processing device produce for realizing the device in the function of flow process of flow chart or a plurality of flow process and/or square frame of block diagram or a plurality of square frame appointments.
These computer program instructions also can be stored in energy vectoring computer or the computer-readable memory of other programmable data processing device with ad hoc fashion work, make the instruction be stored in this computer-readable memory produce the manufacture that comprises command device, this command device is realized the function of appointment in flow process of flow chart or a plurality of flow process and/or square frame of block diagram or a plurality of square frame.
These computer program instructions also can be loaded on computer or other programmable data processing device, make and carry out the sequence of operations step to produce computer implemented processing on computer or other programmable devices, thereby the instruction of carrying out on computer or other programmable devices is provided for realizing the step of the function of appointment in flow process of flow chart or a plurality of flow process and/or square frame of block diagram or a plurality of square frame.
Although described the preferred embodiments of the present invention, once those skilled in the art obtain the basic creative concept of cicada, can make other change and modification to these embodiment.So claims are intended to all changes and the modification that are interpreted as comprising preferred embodiment and fall into the scope of the invention.
Obviously, those skilled in the art can carry out various changes and modification and not break away from the spirit and scope of the present invention the present invention.Like this, if within of the present invention these are revised and modification belongs to the scope of the claims in the present invention and equivalent technologies thereof, the present invention also is intended to comprise these changes and modification interior.

Claims (14)

1. a file transmitting method, is characterized in that, comprising:
The first equipment, before receiving the Internet protocol IP message that needs to forward, sends the ARP request message;
Described the first equipment receives the arp reply message that described the second equipment sends.
2. the method for claim 1, is characterized in that, described the first equipment sends the ARP request message, comprising:
Described the first equipment will be definite according to the IP address of the subnet mask of setting and described the first equipment network number as purpose IP address, send described ARP request message.
3. method as claimed in claim 2, is characterized in that, described the first equipment is determined network number according to following steps:
If the number of bits of the network position of the subnet mask that the IP address of described the first equipment is corresponding is less than the number of bits of network position of the subnet mask of described setting, described the first equipment is according to the subnet mask of setting, determine the network number of each subnet, wherein each subnet is that the network of the IP address designation of described the first equipment is divided and obtained;
If the number of bits of the network position of the subnet mask that the IP address of described the first equipment is corresponding is not less than the number of bits of network position of the subnet mask of described setting, described the first equipment carries out logic and operation by the IP address of the subnet mask of setting and described the first equipment, determines network number.
4. method as claimed in claim 3, is characterized in that, the number of bits of the network position of the subnet mask of described setting is 24.
5. method as described as claim 3 or 4, is characterized in that, described the first equipment is divided into 2 by the network of the IP address designation of described the first equipment m-nindividual subnet; Wherein, m is the number of bits of network position in the subnet mask of setting, the number of bits of the network position of the subnet mask that the IP address that n is described the first equipment is corresponding.
6. described method as arbitrary as claim 1~4, is characterized in that, described the first equipment sends the ARP request message, comprising:
Described the first equipment periodic sends the ARP request message; And/or,
When described the first equipment changes in the IP address of determining described the first equipment, send the ARP request message.
7. a file transmitting method, is characterized in that, comprising:
The second equipment receives the first equipment and is receiving the ARP request message sent before the Internet protocol IP message that needs to forward;
Described the second equipment, according to described ARP request message, sends the arp reply message to described the first equipment.
8. method as claimed in claim 7, is characterized in that, described the second equipment, according to described ARP request message, sends the arp reply message to described the first equipment, comprising:
Described the second equipment is at network number corresponding to source IP address of determining described ARP request message, when the network number corresponding with the IP address of described the second equipment is identical, and/or described the second equipment is at the definite network number in the IP address of the subnet mask according to described setting and described the second equipment, when identical with the purpose IP address of the ARP request message received, to described the first equipment, send the arp reply message.
9. a packet transmission device, is characterized in that, comprising:
Sending module, for before receiving the Internet protocol IP message that needs to forward, sending the ARP request message, send the arp reply message so that receive the second equipment of described ARP request message to described the first equipment;
Receiver module, the arp reply message sent for receiving described the second equipment.
10. device as claimed in claim 9, is characterized in that, described sending module specifically for:
Network number that will be definite according to the IP address of the subnet mask of setting and described the first equipment, as purpose IP address, sends the ARP request message.
11. device as claimed in claim 10, it is characterized in that, described sending module is specifically determined network number according to following steps: if the number of bits of the network position of subnet mask corresponding to the IP address of described the first equipment is less than the number of bits of network position of the subnet mask of described setting, according to the subnet mask of setting, determine the network number of each subnet, wherein each subnet is that the network of the IP address designation of described the first equipment is divided and obtained; If the number of bits of the network position of the subnet mask that the IP address of described the first equipment is corresponding is not less than the number of bits of network position of the subnet mask of described setting, logic and operation is carried out in the IP address of the subnet mask of setting and described the first equipment, determine network number.
12. described device as arbitrary as claim 9~11, is characterized in that, described sending module sends the ARP request message specifically for: cycle; And/or, while changing in the IP address of determining described the first equipment, send the ARP request message.
13. a packet transmission device, is characterized in that, comprising:
Receiver module, receiving for receiving the first equipment the ARP request message sent before the protocol IP message interconnected between the network that needs to forward, and the ARP request message of reception be transferred to sending module;
Sending module, for the ARP request message according to described receiver module transmission, send the arp reply message to described the first equipment.
14. device as claimed in claim 13, it is characterized in that, described sending module specifically for: determining the network number corresponding to source IP address of described ARP request message, when the network number corresponding with the IP address of described the second equipment is identical, and/or at the definite network number in the IP address of the subnet mask according to described setting and described the second equipment, when identical with the purpose IP address of the ARP request message received, to described the first equipment, send the 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 true CN103441931A (en) 2013-12-11
CN103441931B 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)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104750014A (en) * 2013-12-27 2015-07-01 施耐德电器工业公司 Method of upgrading applications/firmware of large number of programmable logic controllers (PLC)
CN106209642A (en) * 2016-06-30 2016-12-07 杭州迪普科技有限公司 A kind of method and device turning transmitting IP packet
CN111770194A (en) * 2020-07-13 2020-10-13 太仓市同维电子有限公司 Method for actively triggering lower-hanging equipment to send arp
CN114157602A (en) * 2021-11-03 2022-03-08 杭州迪普科技股份有限公司 Method and device for processing message

Citations (6)

* 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
WO2012088884A1 (en) * 2010-12-30 2012-07-05 华为技术有限公司 Method and network device for detecting ip address conflict
CN102655473A (en) * 2011-03-03 2012-09-05 华为技术有限公司 Communication method, equipment and system
CN103081418A (en) * 2010-09-09 2013-05-01 日本电气株式会社 Computer system and communication method in computer system

Patent Citations (6)

* 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
CN103081418A (en) * 2010-09-09 2013-05-01 日本电气株式会社 Computer system and communication method in computer system
WO2012088884A1 (en) * 2010-12-30 2012-07-05 华为技术有限公司 Method and network device for detecting ip address conflict
CN102655473A (en) * 2011-03-03 2012-09-05 华为技术有限公司 Communication method, equipment and system

Cited By (6)

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

Also Published As

Publication number Publication date
CN103441931B (en) 2017-06-20

Similar Documents

Publication Publication Date Title
CN102571587B (en) Method and equipment for forwarding messages
US8457553B2 (en) Removal of ambiguities in forming new piconet controller (PNC) when the current PNC controller is suddenly unavailable
CN104301238A (en) Message processing method, device and system
JP2019521538A (en) Technology for assigning short addresses to network devices
CN103441931A (en) Message sending method and device
EP2506498A1 (en) Provisioning device, and method of setting network parameter in provisioning network
CN105451165A (en) Near field communication method and device based on multiple protocols
JP7046983B2 (en) Packet transmission method and equipment
US8208401B2 (en) Method of managing address spaces of incommunicable nodes in ZigBee network
CN104753789A (en) Message forwarding method and system
CN103634214A (en) Route information generating method and device
CN103209185B (en) A kind of transmitting message at optical interface and device
CN108574635B (en) Routing priority configuration method, device and controller
CN106537955A (en) Data transmission method and device
CN104125150A (en) Protocol message processing method, device and system
CN104703211A (en) A virtualization accessing method and apparatus
CN103312614A (en) Multicast message processing method, line card and communication device
CN104618335A (en) Message exchange method and interface processing platform
CN114499777B (en) Data transmission method for cluster unmanned system
JP2018527809A (en) Green Power for high-density, large-scale networks (proxy table scaling)
CN106209641A (en) A kind of method, system and device of Message processing
CN105785854A (en) Master-slave system control method and master-slave system
CN102340553B (en) Method and device for allocating and determining IP addresses
CN113364635B (en) Ad hoc network bandwidth adjusting method, device and system
CN108462657B (en) Method and equipment for acquiring resources and information of SDN (software defined network) of different operators

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