CN102780602A - Method and device for data transmission - Google Patents

Method and device for data transmission Download PDF

Info

Publication number
CN102780602A
CN102780602A CN2012102687705A CN201210268770A CN102780602A CN 102780602 A CN102780602 A CN 102780602A CN 2012102687705 A CN2012102687705 A CN 2012102687705A CN 201210268770 A CN201210268770 A CN 201210268770A CN 102780602 A CN102780602 A CN 102780602A
Authority
CN
China
Prior art keywords
address
data message
vlan
mapping table
network equipment
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
CN2012102687705A
Other languages
Chinese (zh)
Other versions
CN102780602B (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.)
Shenzhen Gongjin Electronics Co Ltd
Original Assignee
Shenzhen Gongjin Electronics 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 Shenzhen Gongjin Electronics Co Ltd filed Critical Shenzhen Gongjin Electronics Co Ltd
Priority to CN201210268770.5A priority Critical patent/CN102780602B/en
Publication of CN102780602A publication Critical patent/CN102780602A/en
Application granted granted Critical
Publication of CN102780602B publication Critical patent/CN102780602B/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

An embodiment of the invention provides a method and a device for data transmission. Virtual local area network (VLAN) ports, a first mapping table, a second mapping table and a third mapping table are arranged on a conversion device, wherein the first mapping table, the second mapping table and the third mapping table are preset. When data messages sent by a network side device are received, a source IP address in the data messages is converted according to the preset first mapping table, the data messages with the converted source IP address are forwarded to a client device through a corresponding VLAN port. When the data messages sent by the client device are received, a target IP address in the data messages is converted according to the preset second mapping table and the preset third mapping table, and the data messages with the converted target IP address are forwarded to the network side device through a corresponding VLAN port. When a plurality of network side devices existing in a network have the same IP address, the network side device and the client device can communicate with each other normally, and network conflict is avoided.

Description

A kind of data transmission method and device
Technical field
The present invention relates to network communication field, specifically design a kind of data transmission method and device.
Background technology
At present, in the local area network (LAN) communication of network communication protocol stack (TCP/IP, Transmission Control Protocol/Internet Protocol), data message transmits through message.When message transmits on network, be to carry out route through agreement (IP, the Internet Protocol) address that interconnects between the network.Therefore the IP address of each network equipment all should be unique, to avoid repeating to cause network conflict, guarantees that network service normally moves.
But in concrete practice, the scene of network application is complicated and changeable; Under some application scenarios, the situation that a plurality of webservers have identical IP address can appear, and at this moment client need continue to communicate by letter with server; Conflict will occur, cause the networking unusual.
Summary of the invention
The embodiment of the invention provides a kind of data transmission method and device, can in network, occur continuing communication in the network equipment of a plurality of identical ip addresses, guarantees that network normally moves.
A kind of data transmission method comprises:
On conversion equipment, set up at least one VLAN (VLAN, Virtual Local Area Network) interface, said VLAN interface is corresponding one by one with the VLAN sign;
Receive the data message of network equipment transmission and/or receive the data message that client device sends; If said data message is from network equipment; Then conversion equipment is changed the source IP address of said data message according to first mapping table, with the data message forwarding of conversion behind the source IP address to client device; Said first mapping table is preserved said VLAN interface and the preset corresponding relation of replacing source IP address;
If said data message is from client device, then conversion equipment is changed the purpose IP address of said data message according to second mapping table and the 3rd mapping table, with the data message forwarding behind the conversion purpose IP address to network equipment; Wherein, said second mapping table is preserved the corresponding relation of the purpose IP address of said VLAN interface and client-requested visit; Said the 3rd mapping table is preserved the corresponding relation of said VLAN interface and preset replacing purpose IP address.
A kind of data transmission device comprises:
Dispensing unit is used on conversion equipment, setting up at least one VLAN interface, and said VLAN interface is corresponding one by one with the VLAN sign;
First receiving element is used to receive the data message that network equipment sends;
First converting unit is used for according to first mapping table, and the source IP address of the said data message that receives from said first receiving element is changed; Said first mapping table is preserved the said VLAN interface that said dispensing unit is set up, with the corresponding relation of preset replacing source IP address;
First retransmission unit is used for the data message forwarding behind said first converting unit conversion source IP address to client device;
Second receiving element is used to receive the data message that client device sends;
Second converting unit is used for according to second mapping table and the 3rd mapping table the purpose IP address of the said data message that receives from said second receiving element being changed; Wherein, said second mapping table is preserved the said VLAN interface that said dispensing unit is set up, with the corresponding relation of client-requested visit purpose IP address; Said the 3rd mapping table is preserved the said VLAN interface that said dispensing unit is set up, with the corresponding relation of replacement purpose IP address;
Second retransmission unit is used for the data message forwarding behind said second converting unit conversion purpose IP address to network equipment.
Can find out that from above technical scheme the embodiment of the invention has the following advantages:
The present invention provides a kind of data transmission method and device; Through the VLAN interface that on conversion equipment, is provided with; When receiving the data message of network equipment transmission; First mapping table according to preset is changed the source IP address in the data message, and the data message forwarding after will changing again is to client device; When receiving the data message of client device transmission, according to preset second mapping table and the 3rd mapping table the purpose IP address in the data message is changed, give network equipment with the data message forwarding after the conversion.Can when the appearance identical ip addresses of a plurality of equipment of network side, guarantee the proper communication of network equipment and client device, avoid network conflict.
Description of drawings
In order to be illustrated more clearly in the technical scheme in the embodiment of the invention; To do to introduce simply to the accompanying drawing of required use among the embodiment below; Obviously, the accompanying drawing in describing below is some embodiments of the present invention, for those of ordinary skills; Under the prerequisite of not paying creative work, can also obtain other accompanying drawing according to these accompanying drawings.
The flow chart of a kind of data transmission method that Fig. 1 provides for the embodiment of the invention one;
The flow chart of a kind of data transmission method that Fig. 2 provides for the embodiment of the invention two;
The data transmission method schematic diagram that Fig. 3 provides for the embodiment of the invention three;
The structural representation of a kind of data transmission device that Fig. 4 provides for the embodiment of the invention four;
The structural representation of the another kind of data transmission device that Fig. 5 provides for the embodiment of the invention four.
Embodiment
The embodiment of the invention provides a kind of data transmission method and device, in the time of a plurality of network equipment with identical ip addresses can in network, occurring, with the data message transmission, network service is normally carried out.
To combine the accompanying drawing among the present invention below, the technical scheme among the present invention is carried out clear, intactly description, obviously, described embodiment is a part of embodiment of the present invention, rather than whole embodiment.Based on the embodiment among the present invention, those of ordinary skills are not making the every other embodiment that is obtained under the creative work prerequisite, all belong to the scope of the present invention's protection.
Embodiment one:
Please refer to Fig. 1, the flow chart of a kind of data transmission method that Fig. 1 provides for the embodiment of the invention one, this method can may further comprise the steps:
101, on conversion equipment, set up at least one VLAN interface, said VLAN interface is corresponding one by one with the VLAN sign.
The VLAN sign can be assigned on the network equipment by the VLAN switch, and each network equipment is corresponding to distribute a VLAN to identify.
Among the embodiment, conversion equipment adopts linux system to operate.
Ebtables instrument and the patch relevant with system kernel can be installed on conversion equipment; Ebtables is the Ethernet bridge fire compartment wall of linux system the inside; The data that can be used for the filtering data link layer realize the address transition of data message and the data message such as are transmitted at function.
The Vconfig instrument is installed, is used to set up VLAN interface.The Vconfig instrument is the configuration tool that 802.1q realizes under the Linux, can be used for setting up VLAN interface.
102, conversion equipment receives the message of network equipment transmission and/or the data message that conversion equipment receives the client device transmission.
Wherein, the conversion conversion equipment can receive the data message that network equipment sends, and also can receive the data message that client device sends.Certainly, conversion equipment also can receive the message from network equipment and client device transmission simultaneously, also can timesharing receive.Data message is transmitted through each different VLAN interface on the conversion equipment.
103, judge that the data message that receives is from network equipment or client device.If receive the data message that network equipment sends, then execution in step 104-105; If receive the data message that client device sends, then execution in step 106-107.
Wherein, if the data message that receives is from network equipment, all be identical owing to occur the IP address of a plurality of network equipments in the network, so the source IP address in the data message all is identical.Therefore, for fear of network conflict, need the source IP address in the data message be changed again and transmit.In step 104 and step 105, can be described in detail this.
If the data message that receives is from client device, because the IP address of network equipment all is identical, but obviously, the user is inequality through the purpose IP address of the message that client device sent.So the purpose IP address and the network equipment IP address condition of different that can occur in the message take place.In order normal access to arrive the network equipment that needs visit, avoid network conflict, need the purpose IP address in the data message be changed again and transmit.In step 106 and step 107, can be described in detail this.
104, conversion equipment is changed the source IP address of said data message according to first mapping table.
Wherein, carry said VLAN sign on the data message by the network equipment transmission.Can first mapping table be set on conversion equipment in advance, first mapping table is preserved the corresponding relation of said VLAN interface and preset replacing source IP address.Because said VLAN interface is corresponding one by one with the VLAN sign; Can be according to the marking matched VLAN interface that goes out to be used to handle this data message of the VLAN that carries in the data message; From first mapping table that is provided with in advance, match the replacement source IP address according to the VLAN interface that matches again, convert the source IP address in the data message into the preset replacing source IP address then.
105, DTU will be changed data message forwarding behind the source IP address to client device.
After having changed source IP address, can data message be forwarded on the client device through the VLAN interface that matches at step S104.Wherein, the said data message after the forwarding no longer carries the VLAN sign.
106, conversion equipment is changed the purpose IP address of said data message according to second mapping table and the 3rd mapping table.
Wherein, second mapping table is preserved the corresponding relation of said VLAN interface and purpose IP address; The 3rd mapping table is preserved said VLAN interface and the corresponding relation of replacing purpose IP address, also promptly preserves the corresponding relation of network equipment IP address and VLAN interface.
Wherein, the purpose IP address in the data message of client device transmission is the purpose IP address that the user passes through client device request visit.Because the IP address of network equipment all is identical, therefore, must change purpose IP address and transmit.Concrete; Can be according to the purpose IP address in the data message of client device transmission; Also, from second mapping table, match corresponding VLAN interface, again according to this VLAN interface promptly according to the purpose IP address in the data message; From the 3rd mapping table, matching preset replacing purpose IP address, is this preset replacing purpose IP address with the purpose IP address transition in the data message at last.
107, will change data message forwarding behind the purpose IP address to network equipment.
Concrete, can further match the pairing VLAN sign of VLAN interface according to the VLAN interface that in step 106, matches.The data message that to change then behind the purpose IP address is forwarded on the network equipment that carries the corresponding VLAN sign of this VLAN interface through said VLAN interface.
The embodiment of the invention one provides a kind of data transmission method, VLAN interface that on conversion equipment, is provided with and preset first mapping table, second mapping table and the 3rd mapping table.When receiving the data message that network equipment sends, according to the first preset mapping table source IP address in the data message is changed, the VLAN interface of the data message after the conversion through correspondence is forwarded to client device; When receiving the data message that client device sends, according to preset second mapping table and the 3rd mapping table the purpose IP address in the data message is changed, the VLAN interface of the data message after the conversion through correspondence is transmitted to network equipment.When in network, existing a plurality of network equipments to have identical ip addresses, can make network equipment and client device proper communication, avoid network conflict.
Embodiment two:
Please refer to Fig. 2, the flow chart of a kind of data transmission method that Fig. 2 provides for the embodiment of the invention two, this method can may further comprise the steps:
201, the VLAN switch distributes the VLAN sign for each network equipment.
Concrete, an end of VLAN switch can connect network equipment, and the other end is connected with conversion equipment.It is understandable that, be foresee steps for each network equipment distributes the step of VLAN sign, in the technical scheme implementation process of the present invention of reality, can carry out this step.
202, on conversion equipment, set up at least one VLAN interface, VLAN interface is corresponding one by one with the VLAN sign.
203, first mapping table is set, second mapping table and the 3rd mapping table are set.
First mapping table is preserved the corresponding relation of said VLAN interface and preset replacing source IP address.Obviously, first mapping table can be arranged on the conversion equipment in advance, and when needs were handled the data message that is sent by network equipment, conversion equipment can call first mapping table data message is handled.
Wherein, second mapping table is preserved the corresponding relation of the purpose IP address of VLAN interface and client-requested visit.The 3rd mapping table is preserved said VLAN interface and the corresponding relation of replacing purpose IP address.Obviously, second mapping table and the 3rd mapping table can be arranged on the conversion equipment in advance, and when needs were handled the data message that is sent by client device, conversion equipment can call second mapping table and the 3rd mapping table is handled said data message.
204, conversion equipment receives the data message of network equipment and/or client device transmission.
205, judge the data message receive be send by network equipment or client device sends.If receive the data message that network equipment sends, then execution in step 206-209; If receive the data message that client device sends, then execution in step 210-214.
206, according to the marking matched VLAN interface that goes out to be used to handle this data message of the VLAN that carries in the data message.
Wherein, can carry said VLAN sign on the data message by the network equipment transmission.Because it is corresponding one by one that said VLAN interface and VLAN identify, can go out the VLAN interface that is used to handle this data message in the conversion equipment according to the VLAN that carries in the data message is marking matched.
207, from first mapping table, match the preset replacing source IP address according to the VLAN interface that matches.
208, convert the source IP address in the data message into the preset replacing source IP address.
Because the IP address of network equipment is identical, therefore, when network equipment sent datagram literary composition, the source IP address in the data message was identical.Convert the source IP address in the data message into the preset replacing source IP address, can avoid network conflict.Obviously, the preset replacing source IP address has nothing in common with each other, and like this, the data message behind the conversion source IP address could be by normal transmission.
209, will change data message forwarding behind the source IP address to client device.
This step is identical with step S105 among the embodiment one, repeats no more at this.
210,, from second mapping table, match corresponding VLAN interface according to the purpose IP address in the data message of client transmission.
Wherein, when conversion equipment received the data message of client device transmission, the purpose IP address in the data message was the purpose IP address that the user passes through the request visit of client device transmission.
211, according to the VLAN interface that matches, from the 3rd mapping table, match preset replacing purpose IP address.
212, be this preset replacing purpose IP address with the purpose IP address transition in the data message.
Obviously, in the embodiment of the invention, also promptly, in the data message that client is sent the request visit purpose IP address convert the IP address of network equipment to, just can be to the network equipment of correspondence with the data message normal transmission.
213, match corresponding VLAN sign according to said VLAN interface.
214, changed data message behind the purpose IP address through corresponding VLAN interface with said, be forwarded to and carry on the network equipment that matches corresponding VLAN sign.
Need to prove, for said method embodiment, for simple description; So it all is expressed as a series of combination of actions; But those skilled in the art should know that step 206-209 of the present invention and step 210-214 do not receive the restriction of described sequence of movement, because according to the present invention; Step 206-209 and step 210-214 can carry out simultaneously, also can carry out with any one sequencing.
The embodiment of the invention two provides a kind of data transmission method, VLAN interface that on conversion equipment, is provided with and preset first mapping table, second mapping table and the 3rd mapping table.When receiving the data message that network equipment sends, according to the first preset mapping table source IP address in the data message is changed, the VLAN interface of the data message after the conversion through correspondence is forwarded to client device; When receiving the data message that client device sends, according to preset second mapping table and the 3rd mapping table the purpose IP address in the data message is changed, the VLAN interface of the data message after the conversion through correspondence is transmitted to network equipment.When in network, existing a plurality of network equipments to have identical ip addresses, can make network equipment and client device proper communication, avoid network conflict.
For the ease of understanding, the step of a kind of data transmission method of the present invention is described with a concrete application scenarios below.
Embodiment three:
301, ebtables instrument and vconfig instrument are installed on conversion equipment, on conversion equipment, are set up VLAN interface, VLAN interface is corresponding one by one with the VLAN sign, can be kept at corresponding relation in the table 1 in advance:
Network equipment number VLAN interface VLAN?ID
1 eth0.100 100
2 eth0.200 200
?... ... ...
Table 1
Wherein, can adopt the VLAN switch to distribute the VLAN sign for each network equipment.
Wherein, conversion equipment can adopt linux system, and is configured to bridge mode.Concrete, as shown in Figure 3, conversion equipment can a termination VLAN switch, is connected on the network equipment through the VLAN switch, and the conversion equipment other end connects client device.
302, preset first mapping table, second mapping table and the 3rd mapping table.
First mapping table is preserved the corresponding relation of said VLAN interface and preset replacing source IP address, and is as shown in table 2:
Network equipment number VLAN interface The replacement source IP address
1 eth0.100 192.168.1.2
2 eth0.200 192.168.1.3
?... ... ...
Table 2
Second mapping table is preserved the corresponding relation of the purpose IP address of VLAN interface and client-requested visit, and is as shown in Figure 3:
VLAN interface Purpose IP address
eth0.100 192.168.1.2
eth0.200 192.168.1.3
?... ...
Table 3
The 3rd mapping table is preserved said VLAN interface and the corresponding relation of replacing purpose IP address, and is as shown in table 4:
VLAN interface Replacement purpose IP address
eth0.100 192.168.1.1
eth0.200 192.168.1.1
... ...
Table 4
303, conversion equipment receives network equipment and/or receives the data message that client device sends.When receiving the data message that network equipment sends, execution in step 304-307; When receiving the data message that client device sends, execution in step 308-312.
See also Fig. 3, the data transmission method schematic diagram that Fig. 3 provides for the embodiment of the invention three.There to be two network equipments with identical ip addresses in the network is example.As shown in Figure 3, suppose that the IP address of two network equipments is 192.168.1.1, two VLAN signs that the VLAN switch is distributed to network equipment are respectively 100 and 200.When network equipment sends message, carry the VLAN sign that the VLAN switch distributes in the data message.
304, according to table 1, the VLAN that carries according to network equipment 1 is designated 100 data message, and the VLAN interface that matches the data message that is used for treatment facility 1 is eth0.100.The VLAN that carries according to network equipment 2 is designated 200 data message, and the VLAN interface that matches the data message that is used for treatment facility 2 is eth0.200.
305, the VLAN interface that matches according to step 304; The corresponding replacement purpose IP address of data message that from table 2, matches VLAN interface and be eth0.100 is 192.168.1.2, and VLAN interface is that the corresponding replacement purpose IP address of data message of eth0.200 is 192.168.1.3.
306, will carry the source IP address that VLAN is designated in 100 the data message and convert 192.168.1.2 into; Convert 192.168.1.3 into carrying the source IP address that VLAN is designated in 200 the data message.
307, with two above-mentioned data message forwarding of having changed source IP address to client device.
Because the IP address of network equipment is identical, therefore, when network equipment sent datagram literary composition, the source IP address in the data message was identical.Convert the source IP address in the data message into the preset replacing source IP address, can avoid network conflict.Obviously, the preset replacing source IP address has nothing in common with each other, and behind the conversion source IP address, just can not cause network conflict.After conversion, the source IP address of the data message of two network equipment transmissions is no longer identical, and data message just can normally send on the client device, has guaranteed the proper communication of network.
The described data transmission method of step 308-312 is an example there to be two network equipments with identical ip addresses in the network still.The IP address of supposing two network equipments is 192.168.1.1; Purpose IP address in the message that client is sent is respectively 192.168.1.2 and 192.168.1.3; Be the user through the client device literary composition that sends datagram, request visit IP address is two network equipments of 192.168.1.2 and 192.168.1.3 respectively.
308,, from table 3, match corresponding VLAN interface according to the purpose IP address in the data message.
In the present embodiment, match that to comprise purpose IP address be that the VLAN interface of the data message of 192.168.1.2 is eth0.100; Match that to comprise purpose IP address be that the VLAN interface of the data message of 192.168.1.3 is eth0.200.
309, according to the VLAN interface that matches, from table 4, match preset replacing purpose IP address.
In the present embodiment, the replacement purpose IP address that matches VLAN interface and be the data message of eth0.100 is 192.168.1.1; The replacement purpose IP address that matches VLAN interface and be the data message of eth0.200 is 192.168.1.1.
310, will comprise purpose IP address is that the purpose IP address transition of the data message of 192.168.1.2 is 192.168.1.1, and the purpose IP address transition that will comprise purpose IP address and be the data message of 192.168.1.3 is 192.168.1.1.
311, match corresponding VLAN sign according to said VLAN interface.
From table 1, the data message that matches VLAN interface and be eth0.100 should send to and carry VLAN and be designated on 100 the network equipment; VLAN interface is that the data message of eth0.200 should send to and carries VLAN and be designated on 200 the network equipment.
312, be that the data message forwarding of 192.168.1.2 is designated to VLAN on 100 the network equipment with purpose IP address, at this moment, the purpose IP address of carrying in the data message is 192.168.1.1; With purpose IP address is that the data message forwarding of 192.168.1.3 is designated to VLAN on 200 the network equipment, and at this moment, the purpose IP address of carrying in the data message is 192.168.1.1.
Can find out that in this way, even there is identical network equipment in the network, and the purpose IP address of the data message of client device transmission is different with the IP address of network equipment, also can realize network service, has avoided network conflict.
The embodiment of the invention three provides a kind of data transmission method, VLAN interface that on conversion equipment, is provided with and preset first mapping table, second mapping table and the 3rd mapping table.When receiving the data message that network equipment sends, according to the first preset mapping table source IP address in the data message is changed, the VLAN interface of the data message after the conversion through correspondence is forwarded to client device; When receiving the data message that client device sends, according to preset second mapping table and the 3rd mapping table the purpose IP address in the data message is changed, the VLAN interface of the data message after the conversion through correspondence is transmitted to network equipment.When in network, existing a plurality of network equipments to have identical ip addresses, can make network equipment and client device proper communication, avoid network conflict.
One of ordinary skill in the art will appreciate that all or part of step that realizes in the foregoing description method is to instruct relevant hardware to accomplish through program; Described program can be stored in a kind of computer-readable recording medium; The above-mentioned storage medium of mentioning can be a read-only memory, disk or CD etc.
Embodiment four:
Please refer to Fig. 4, the structural representation of a kind of data transmission device that Fig. 4 provides for the embodiment of the invention four, as shown in Figure 4, this device can comprise:
Dispensing unit 40 is used on conversion equipment, setting up at least one VLAN interface, and VLAN interface is corresponding one by one with the VLAN sign;
First receiving element 41 is used to receive the data message that network equipment sends;
First converting unit 42 is used for according to first mapping table, and the source IP address of the said data message that receives from first receiving element 41 is changed; First mapping table is preserved the said VLAN interface of dispensing unit 40 foundation and the corresponding relation of preset replacing source IP address;
First retransmission unit 43 is used for the data message forwarding behind first converting unit, 42 conversion source IP addresss to client device;
Second receiving element 44 is used to receive the data message that client device sends;
Second converting unit 45 is used for according to second mapping table and the 3rd mapping table the purpose IP address of the said data message that receives from second receiving element 44 being changed; Wherein, second mapping table is preserved the said VLAN interface that dispensing unit 40 is set up, with the corresponding relation of client-requested visit purpose IP address; Also promptly preserve the said VLAN interface of dispensing unit 40 foundation and the corresponding relation of the purpose IP address in the data message.The 3rd mapping table is preserved the said VLAN interface that dispensing unit 40 is set up, with the corresponding relation of preset replacing purpose IP address;
Second retransmission unit 46 is used for the data message forwarding behind second converting unit, 45 conversion purpose IP addresses to network equipment.
Please consult Fig. 5, the structural representation of the another kind of data transmission device that Fig. 5 provides for the embodiment of the invention four in the lump.Wherein, data transmission device shown in Figure 5 is to be optimized by data transmission device shown in Figure 4 to obtain.In data transmission device shown in Figure 5, can also comprise:
VLAN switch (not shown) is used for said VLAN sign is assigned to network equipment, the corresponding VLAN sign of each network equipment.
First receiving element 41 specifically is used for: receive the data message that carries the VLAN sign that network equipment sends.
First converting unit 42 specifically comprises:
First matching unit 420, the VLAN interface of the marking matched correspondence of said VLAN that is used for carrying according to said data message;
Second matching unit 421, the VLAN interface of the correspondence that is used for matching according to first matching unit 420 is from the corresponding said preset replacing source IP address of said first mapping table coupling;
The 3rd converting unit 422, the source IP address of the data message that is used for network equipment is sent converts into: the replacement source IP address that matches at second matching unit 421.
First transmits Unit 43 specifically is used for: the VLAN interface of data message through said correspondence that will change behind the source IP address is forwarded to client device.Wherein, do not carry said VLAN sign through the said data message after first forwarding, 43 forwardings.
Second receiving element 44 specifically is used for: the data message of the purpose IP address of the client device request that the carries visit that the reception client device sends.
Second converting unit 45 comprises:
The 3rd matching unit 450, the purpose IP address of the data message that is used for sending according to client device is from the corresponding VLAN interface of second mapping table coupling; Promptly be equivalent to be used for purpose IP address the corresponding VLAN interface of coupling from second mapping table according to client device request visit;
The 4th matching unit 451, the VLAN interface of the said correspondence that is used for matching according to the 3rd matching unit 450 is from the corresponding replacement purpose IP address of the 3rd mapping table coupling;
The 4th converting unit 452, the purpose IP address transition that is used for said client device request visit is the replacement purpose IP address that the 4th matching unit 451 matches.
Second retransmission unit 46 comprises:
The 5th matching unit 460 is used for the corresponding VLAN sign of said VLAN interface coupling that matches according to the 3rd matching unit 450;
The 3rd retransmission unit 461 is used for the VLAN interface of the data message behind the said conversion purpose IP address through correspondence is forwarded to the network equipment of the VLAN sign that carries the correspondence that the 5th matching unit 460 matches.
The embodiment of the invention four provides a kind of data transmission device, VLAN interface that on conversion equipment, is provided with and preset first mapping table, second mapping table and the 3rd mapping table.When receiving the data message that network equipment sends, can be used in according to the first preset mapping table source IP address in the data message is changed, the VLAN interface of the data message after the conversion through correspondence is forwarded to client device; When receiving the data message that client device sends, according to preset second mapping table and the 3rd mapping table the purpose IP address in the data message is changed, the VLAN interface of the data message after the conversion through correspondence is transmitted to network equipment.When in network, existing a plurality of network equipments to have identical ip addresses, can make network equipment and client device proper communication, avoid network conflict.
More than a kind of data transmission method provided by the present invention and device have been carried out detailed introduction; For one of ordinary skill in the art; Thought according to the embodiment of the invention; The part that on embodiment and range of application, all can change, in sum, this description should not be construed as limitation of the present invention.

Claims (15)

1. a data transmission method is characterized in that, comprising:
On conversion equipment, set up at least one VLAN (VLAN, Virtual Local Area Network) interface, said VLAN interface is corresponding one by one with the VLAN sign;
Receive the data message of network equipment transmission and/or receive the data message that client device sends; If said data message is from network equipment; Then conversion equipment is according to the agreement (IP that interconnects between the source network of first mapping table to said data message; Internet Protocol) change the address, with the data message forwarding of conversion behind the source IP address to client device; Said first mapping table is preserved said VLAN interface and the preset corresponding relation of replacing source IP address;
If said data message is from client device, then conversion equipment is changed the purpose IP address of said data message according to second mapping table and the 3rd mapping table, with the data message forwarding behind the conversion purpose IP address to network equipment; Wherein, said second mapping table is preserved the corresponding relation of the purpose IP address of the data message that said VLAN interface and client send; Said the 3rd mapping table is preserved the corresponding relation of said VLAN interface and preset replacing purpose IP address.
2. data transmission method according to claim 1 is characterized in that,
Said VLAN sign is assigned on the network equipment by the VLAN switch, the corresponding VLAN sign of each network equipment.
3. data transmission method according to claim 2 is characterized in that, the data message that said conversion equipment receives the network equipment transmission comprises:
Conversion equipment receives the data message that carries said VLAN sign that network equipment sends.
4. data transmission method according to claim 3 is characterized in that, saidly comprises according to the source IP address conversion of first mapping table to said data message:
Go out corresponding VLAN interface according to the said VLAN that carries in the said data message is marking matched;
According to the VLAN interface of said correspondence, from first mapping table, match corresponding said replacement source IP address;
The source IP address of the data message that said network equipment is sent converts the said replacement source IP address that matches into.
5. data transmission method according to claim 4 is characterized in that, said data message forwarding to the client device that will change behind the source IP address comprises:
The VLAN interface of data message behind the conversion source IP address through said correspondence is forwarded on the client device; Wherein, the said data message after the forwarding does not carry said VLAN sign.
6. data transmission method according to claim 2 is characterized in that, the said purpose IP address of said data message the conversion according to second mapping table and the 3rd mapping table comprises:
The purpose IP address of the data message that sends according to said client device matches corresponding VLAN interface from second mapping table;
According to the VLAN interface of said correspondence, match corresponding replacement purpose IP address from the 3rd mapping table;
With the purpose IP address transition of said client device request visit is said replacement purpose IP address.
7. data transmission method according to claim 6 is characterized in that, said data message forwarding to the network equipment that will change behind the purpose IP address comprises:
Match corresponding VLAN sign according to said VLAN interface;
The VLAN interface of data message behind the said conversion purpose IP address through correspondence be forwarded to carry on the said network equipment that matches corresponding VLAN sign.
8. a data transmission device is characterized in that, comprising:
Dispensing unit is used on conversion equipment, setting up at least one VLAN interface, and said VLAN interface is corresponding one by one with the VLAN sign;
First receiving element is used to receive the data message that network equipment sends;
First converting unit is used for according to first mapping table, and the source IP address of the said data message that receives from said first receiving element is changed; Said first mapping table is preserved the said VLAN interface that said dispensing unit is set up, with the corresponding relation of preset replacing source IP address;
First retransmission unit is used for the data message forwarding behind said first converting unit conversion source IP address to client device;
Second receiving element is used to receive the data message that client device sends;
Second converting unit is used for according to second mapping table and the 3rd mapping table the purpose IP address of the said data message that receives from said second receiving element being changed; Wherein, said second mapping table is preserved the corresponding relation of the purpose IP address of the said VLAN interface of said dispensing unit foundation and the data message that client is sent; Said the 3rd mapping table is preserved the said VLAN interface that said dispensing unit is set up, with the corresponding relation of replacement purpose IP address;
Second retransmission unit is used for the data message forwarding behind said second converting unit conversion purpose IP address to network equipment.
9. data transmission device according to claim 8 is characterized in that, also comprises:
The VLAN switch is used for said VLAN sign is assigned to network equipment, the corresponding VLAN sign of each network equipment.
10. data transmission device according to claim 9 is characterized in that, said first receiving element specifically is used for:
Receive the data message that carries said VLAN sign that network equipment sends.
11. data transmission device according to claim 10 is characterized in that, said first converting unit specifically comprises:
First matching unit, the VLAN interface of the marking matched correspondence of said VLAN that is used for carrying according to said data message;
Second matching unit, the VLAN interface of the correspondence that is used for matching according to said first matching unit is from the corresponding said replacement source IP address of said first mapping table coupling;
The 3rd converting unit, the source IP address of the data message that is used for said network equipment is sent converts the said replacement source IP address that matches at said second matching unit into.
12. data transmission device according to claim 11 is characterized in that, said first retransmission unit specifically is used for:
The VLAN interface of data message behind the conversion source IP address through said correspondence is forwarded on the client device; Wherein, the said data message after the forwarding does not carry said VLAN sign.
13. data transmission device according to claim 9 is characterized in that, said second receiving element specifically is used for:
The data message of the purpose IP address of the client device request that the carries visit that the reception client device sends.
14. data transmission device according to claim 13 is characterized in that, said second converting unit comprises:
The 3rd matching unit is used for the purpose IP address according to the data message of said client device transmission, the corresponding VLAN interface of coupling from second mapping table;
The 4th matching unit, the VLAN interface of the said correspondence that is used for matching according to said the 3rd matching unit is from the corresponding replacement purpose IP address of the 3rd mapping table coupling;
The 4th converting unit, the purpose IP address transition that is used for said client device request visit is the replacement purpose IP address that said the 4th matching unit matches.
15. data transmission device according to claim 14 is characterized in that, said second retransmission unit comprises:
The 5th matching unit is used for the corresponding VLAN sign of said VLAN interface coupling that matches according to said the 3rd matching unit;
The 3rd retransmission unit is used for the data message behind the said conversion purpose IP address is forwarded to through said VLAN interface the network equipment of the VLAN sign that carries the correspondence that said the 5th matching unit matches.
CN201210268770.5A 2012-07-31 2012-07-31 Method and device for data transmission Active CN102780602B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210268770.5A CN102780602B (en) 2012-07-31 2012-07-31 Method and device for data transmission

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210268770.5A CN102780602B (en) 2012-07-31 2012-07-31 Method and device for data transmission

Publications (2)

Publication Number Publication Date
CN102780602A true CN102780602A (en) 2012-11-14
CN102780602B CN102780602B (en) 2015-07-08

Family

ID=47125364

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210268770.5A Active CN102780602B (en) 2012-07-31 2012-07-31 Method and device for data transmission

Country Status (1)

Country Link
CN (1) CN102780602B (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104052670A (en) * 2014-07-04 2014-09-17 华为技术有限公司 Communication method and system
CN104168186A (en) * 2014-07-01 2014-11-26 汉柏科技有限公司 Message forwarding method and system based on network bridge
CN104483878A (en) * 2014-12-09 2015-04-01 中国航空工业集团公司第六三一研究所 Communication transmission method for calibration tool
CN104702713A (en) * 2015-03-26 2015-06-10 杭州华三通信技术有限公司 Method and device for forwarding data message
CN108566445A (en) * 2018-03-15 2018-09-21 华为技术有限公司 A kind of message transmitting method and device
CN109873728A (en) * 2017-12-01 2019-06-11 腾讯科技(深圳)有限公司 A kind of terminal test method, device and storage medium
CN109922164A (en) * 2019-02-12 2019-06-21 Oppo广东移动通信有限公司 A kind of address conversion method, device and computer storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1614942A (en) * 2003-11-06 2005-05-11 北京佳讯飞鸿电气有限责任公司 Method for soluting IP address conflicts in network communication
CN101043430A (en) * 2006-06-20 2007-09-26 华为技术有限公司 Method for converting network address between equipments
CN101262504A (en) * 2008-05-13 2008-09-10 杭州华三通信技术有限公司 A method, device and system for source and destination IP address translation
US20110206052A1 (en) * 2010-02-25 2011-08-25 Gemtek Technology Co., Ltd Data transfer system enabling access to multiple subnets and method thereof
CN102301681A (en) * 2009-01-30 2011-12-28 思科技术公司 Media streaming through a network address translation (nat) device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1614942A (en) * 2003-11-06 2005-05-11 北京佳讯飞鸿电气有限责任公司 Method for soluting IP address conflicts in network communication
CN101043430A (en) * 2006-06-20 2007-09-26 华为技术有限公司 Method for converting network address between equipments
CN101262504A (en) * 2008-05-13 2008-09-10 杭州华三通信技术有限公司 A method, device and system for source and destination IP address translation
CN102301681A (en) * 2009-01-30 2011-12-28 思科技术公司 Media streaming through a network address translation (nat) device
US20110206052A1 (en) * 2010-02-25 2011-08-25 Gemtek Technology Co., Ltd Data transfer system enabling access to multiple subnets and method thereof

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104168186A (en) * 2014-07-01 2014-11-26 汉柏科技有限公司 Message forwarding method and system based on network bridge
CN104168186B (en) * 2014-07-01 2018-01-02 汉柏科技有限公司 A kind of message forwarding method and system based on bridge
CN104052670A (en) * 2014-07-04 2014-09-17 华为技术有限公司 Communication method and system
CN104052670B (en) * 2014-07-04 2017-12-22 华为技术有限公司 A kind of communication means and system
CN104483878A (en) * 2014-12-09 2015-04-01 中国航空工业集团公司第六三一研究所 Communication transmission method for calibration tool
CN104702713A (en) * 2015-03-26 2015-06-10 杭州华三通信技术有限公司 Method and device for forwarding data message
CN109873728A (en) * 2017-12-01 2019-06-11 腾讯科技(深圳)有限公司 A kind of terminal test method, device and storage medium
CN109873728B (en) * 2017-12-01 2022-03-08 腾讯科技(深圳)有限公司 Terminal testing method and device and storage medium
CN108566445A (en) * 2018-03-15 2018-09-21 华为技术有限公司 A kind of message transmitting method and device
CN108566445B (en) * 2018-03-15 2020-12-08 华为技术有限公司 Message transmission method and device
CN109922164A (en) * 2019-02-12 2019-06-21 Oppo广东移动通信有限公司 A kind of address conversion method, device and computer storage medium
CN109922164B (en) * 2019-02-12 2022-07-26 Oppo广东移动通信有限公司 Address translation method and device and computer storage medium

Also Published As

Publication number Publication date
CN102780602B (en) 2015-07-08

Similar Documents

Publication Publication Date Title
CN102780602A (en) Method and device for data transmission
CN102859973B (en) Method, apparatus and system for address resolution
EP2645679B1 (en) Method and apparatus for message transmission
CN103763407A (en) Method for achieving address resolution protocol proxy through two-layer virtual local area network and local area network system
CN103338161A (en) Method and equipment for realizing cross-equipment aggregation
CN102647355A (en) LACP (Link Aggregation Control Protocol) consultation processing method, relay node and system
CN103841023A (en) Data forwarding method and device
CN102209121A (en) Method and device for intercommunication between Internet protocol version 6 (IPv6) network and Internet protocol version 4 (IPv4) network
CN105847108B (en) Communication means and device between container
CN100581177C (en) Method and system for obtaining internet protocol address and establishing operation maintenance link
CN102325197A (en) Method for communication between intranet equipment and internet equipment and network address transformation equipment
CN103763207A (en) In-band control connection establishment method and device in SDN
US10382391B2 (en) Systems and methods for managing network address information
CN102447748A (en) Method, equipment and system for allocating outer Internet protocol IP addresses during network address translation (NAT)
CN104584640A (en) Layer 2 address management in 3 address only capable access points in networks with relays
WO2009053894A3 (en) A system and method for generating functional addresses
CN104185192A (en) Access method of management device and related equipment
KR101455229B1 (en) Relay server and relay communication system
CN102333027A (en) Traffic load sharing realization method based on virtual router redundancy protocol extend (VRRPE) backup group and realization apparatus thereof
CN107547665A (en) A kind of method, equipment and the system of dhcp address distribution
CN104283783A (en) Gateway equipment message transmitting method and device in plug and play network
CN104702713A (en) Method and device for forwarding data message
CN102710527A (en) Switch and management server supporting flexible expansion of services
JP5668954B2 (en) Relay server and relay communication system
CN102202103A (en) Method, system and device for accessing network equipment

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant