CN102780602B - Method and device for data transmission - Google Patents

Method and device for data transmission Download PDF

Info

Publication number
CN102780602B
CN102780602B CN201210268770.5A CN201210268770A CN102780602B CN 102780602 B CN102780602 B CN 102780602B CN 201210268770 A CN201210268770 A CN 201210268770A CN 102780602 B CN102780602 B CN 102780602B
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.)
Active
Application number
CN201210268770.5A
Other languages
Chinese (zh)
Other versions
CN102780602A (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

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, a kind of data transmission method of specific design and device.
Background technology
At present, in the Local network communication of network communication protocol stack (TCP/IP, Transmission Control Protocol/InternetProtocol), data message is transmitted by message.When message transmits on network, be that route is carried out in agreement (IP, the Internet Protocol) address by interconnecting between network.Therefore the IP address of each network equipment should be unique, to avoid repeating to cause network conflict, ensures that network service normally runs.
But in concrete practice, the scene of network application is complicated and changeable, under some application scenarios, there will be the situation that multiple webserver has identical IP address, at this moment client needs and server continues the words that communicate, just there will be conflict, cause networking abnormal.
Summary of the invention
Embodiments provide a kind of data transmission method and device, can occur in a network continuing communication in the network equipment of multiple identical ip addresses, ensure that network normally runs.
A kind of data transmission method, comprising:
Conversion equipment is set up at least one VLAN (VLAN, Virtual Local AreaNetwork) interface, and described VLAN interface and VLAN identify one_to_one corresponding;
Receive the data message that network equipment sends and/or the data message receiving client device transmission, if described data message is from network equipment, then conversion equipment is changed according to the source IP address of the first mapping table to described data message, by the data message forwarding after conversion source IP address to client device; Described first mapping table is preserved described VLAN interface and is preset the corresponding relation replacing source IP address;
If described data message is from client device, then conversion equipment is changed the object IP address to described data message according to the second mapping table and the 3rd mapping table, by the data message forwarding behind conversion object IP address to network equipment; Wherein, described second mapping table preserves the corresponding relation of the object IP address that described VLAN interface and client-requested are accessed; Described 3rd mapping table preserves the corresponding relation of described VLAN interface and default replacement object IP address.
A kind of data transmission device, comprising:
Dispensing unit, for setting up at least one VLAN interface on conversion equipment, described VLAN interface and VLAN identify one_to_one corresponding;
First receiving element, for receiving the data message that network equipment sends;
First converting unit, for according to the first mapping table, changes the source IP address of the described data message received from described first receiving element; Described first mapping table preserves the described VLAN interface that described dispensing unit is set up, with the corresponding relation of the replacement source IP address preset;
First retransmission unit, for by the data message forwarding after change source IP address in described first converting unit to client device;
Second receiving element, for receiving the data message that client device sends;
Second converting unit, for changing according to the second mapping table and the 3rd mapping table object IP address to the described data message received from described second receiving element; Wherein, described second mapping table preserves the described VLAN interface that described dispensing unit is set up, and accesses the corresponding relation of object IP address with client-requested; Described 3rd mapping table preserves the described VLAN interface that described dispensing unit is set up, with the corresponding relation replacing object IP address;
Second retransmission unit, for by the data message forwarding after change object IP address in described second converting unit to network equipment.
As can be seen from the above technical solutions, the embodiment of the present invention has the following advantages:
The invention provides a kind of data transmission method and device, by the VLAN interface arranged on conversion equipment, when receiving the data message that network equipment sends, source IP address in data message is changed by the first mapping table according to presetting, then by the data message forwarding after conversion to client device; When receiving the data message that client device sends, according to the second mapping table preset and the 3rd mapping table, the object IP address in data message is changed, by the data message forwarding after conversion to network equipment.When the appearance identical ip addresses of the multiple equipment of network side, the proper communication of network equipment and client device can be ensured, avoids network conflict.
Accompanying drawing explanation
In order to be illustrated more clearly in the technical scheme in the embodiment of the present invention, be briefly described to the accompanying drawing used required in embodiment below, apparently, accompanying drawing in the following describes is some embodiments of the present invention, for those of ordinary skill in the art, under the prerequisite not paying creative work, other accompanying drawing can also be obtained according to these accompanying drawings.
The flow chart of a kind of data transmission method that Fig. 1 provides for the embodiment of the present invention one;
The flow chart of a kind of data transmission method that Fig. 2 provides for the embodiment of the present invention two;
The data transmission method schematic diagram that Fig. 3 provides for the embodiment of the present invention three;
The structural representation of a kind of data transmission device that Fig. 4 provides for the embodiment of the present invention four;
The structural representation of the another kind of data transmission device that Fig. 5 provides for the embodiment of the present invention four.
Embodiment
Embodiments provide a kind of data transmission method and device, can occur multiple when there is the network equipment of identical ip addresses in a network, by data-message transmission, network service normally be carried out.
Below in conjunction with the accompanying drawing in the present invention, be clearly and completely described the technical scheme in the present invention, obviously, described embodiment is a part of embodiment of the present invention, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtained under creative work prerequisite, belong to the scope of protection of the invention.
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 present invention one, the method can comprise the following steps:
101, on conversion equipment, set up at least one VLAN interface, described VLAN interface and VLAN identify one_to_one corresponding.
VLAN mark can be assigned on network equipment by VLAN switch, and each network equipment correspondence distributes a VLAN mark.
In an embodiment, conversion equipment adopts linux system to operate.
Ebtables instrument and the patch relevant to system kernel can be installed on conversion equipment, Ebtables is the Ethernet bridge fire compartment wall inside linux system, may be used for the data of filtering data link layer, realize the address transition of data message and carry out the function such as forwarding to data message.
Vconfig instrument is installed, for setting up VLAN interface.Vconfig instrument is the configuration tool that under Linux, 802.1q realizes, and can be used for setting up VLAN interface.
102, conversion equipment receives the message of network equipment transmission and/or the data message of conversion equipment reception client device transmission.
Wherein, 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 sent from network equipment and client device simultaneously, also can timesharing receive.Data message is forwarded by each different VLAN interface on conversion equipment.
103, the data message that judgement receives is from network equipment or client device.If receive the data message that network equipment sends, then perform step 104-105; If receive the data message that client device sends, then perform step 106-107.
Wherein, if the data message received is from network equipment, owing to occurring in network that the IP address of multiple network equipment is all identical, so the source IP address in data message is all identical.Therefore, in order to avoid network conflict, need the source IP address in data message to carry out changing forwarding again.Can be described in detail this in step 104 and step 105.
If the data message received is from client device, the IP address due to network equipment is all identical, but obviously, the object IP address of the message that user is sent by client device is not identical.So the situation that there will be object IP address in message different from network equipment IP address occurs.In order to the network equipment needing access normally can be had access to, avoid network conflict, need the object IP address in data message to carry out changing forwarding again.Can be described in detail this in step 106 and step 107.
104, conversion equipment is changed according to the source IP address of the first mapping table to described data message.
Wherein, the data message sent by network equipment carries described VLAN to identify.Can arrange the first mapping table in advance on conversion equipment, the first mapping table preserves the corresponding relation of described VLAN interface and default replacement source IP address.Because described VLAN interface and VLAN identify one_to_one corresponding, can according to the VLAN carried in data message marking matched go out for the treatment of the VLAN interface of this data message, from the first mapping table pre-set, match replacement source IP address according to the VLAN interface matched again, then the source IP address in data message is converted to default replacement source IP address.
105, DTU (Data Transfer unit) by conversion source IP address after data message forwarding to client device.
After converted source IP address, data message can be forwarded on client device by the VLAN interface matched in step S104.Wherein, the described data message after forwarding no longer carries VLAN mark.
106, conversion equipment is changed the object IP address to described data message according to the second mapping table and the 3rd mapping table.
Wherein, the second mapping table preserves the corresponding relation of described VLAN interface and object IP address; 3rd mapping table preserves described VLAN interface and the corresponding relation replacing object IP address, also namely preserves the corresponding relation of network equipment IP address and VLAN interface.
Wherein, client device send data message in object IP address be the object IP address that user is accessed by client device requests.IP address due to network equipment is all identical, therefore, must change forwarding object IP address.Concrete, object IP address in the data message that can send according to client device, also namely according to the object IP address in data message, corresponding VLAN interface is matched from the second mapping table, again according to this VLAN interface, from the 3rd mapping table, match default replacement object IP address, be finally the replacement object IP address that this is preset by the object IP address transition in data message.
107, by conversion object IP address after data message forwarding to network equipment.
Concrete, according to the VLAN interface matched in step 106, the VLAN mark corresponding to VLAN interface can be matched further.Then the data message behind conversion object IP address is forwarded to by described VLAN interface on the network equipment carrying VLAN mark corresponding to this VLAN interface.
The embodiment of the present invention one provides a kind of data transmission method, the VLAN interface that conversion equipment is arranged and the first default mapping table, the second mapping table and the 3rd mapping table.When receiving the data message that network equipment sends, the source IP address in data message is changed by the first mapping table according to presetting, and the data message after conversion is forwarded to client device by corresponding VLAN interface; When receiving the data message that client device sends, according to the second mapping table preset and the 3rd mapping table, the object IP address in data message is changed, the data message after conversion is transmitted to network equipment by corresponding VLAN interface.There is multiple network equipment in a network when there is identical ip addresses, network equipment and client device proper communication can be made, 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 present invention two, the method can comprise the following steps:
201, VLAN switch is that each network equipment distributes VLAN mark.
Concrete, one end of VLAN switch can connect network equipment, and the other end is connected with conversion equipment.Be understandable that, the step of distributing VLAN mark for each network equipment is foresee steps, in the technical scheme implementation process of the present invention of reality, can perform this step.
202, on conversion equipment, set up at least one VLAN interface, VLAN interface and VLAN identify one_to_one corresponding.
203, first mapping table is set, the second mapping table and the 3rd mapping table are set.
First mapping table preserves the corresponding relation of described VLAN interface and default replacement source IP address.Obviously, the first mapping table can be set in advance on conversion equipment, and when needing to process the data message sent by network equipment, conversion equipment can call the first mapping table and process data message.
Wherein, the second mapping table preserves the corresponding relation of the object IP address that VLAN interface and client-requested are accessed.3rd mapping table preserves described VLAN interface and the corresponding relation replacing object IP address.Obviously, the second mapping table and the 3rd mapping table can be set in advance on conversion equipment, and when needing to process the data message sent by client device, conversion equipment can call the second mapping table and the 3rd mapping table processes described data message.
204, conversion equipment receives the data message of network equipment and/or client device transmission.
205, judge the data message that receives be sent by network equipment or client device sends.If receive the data message that network equipment sends, then perform step 206-209; If receive the data message that client device sends, then perform step 210-214.
206, according to the VLAN carried in data message marking matched go out for the treatment of the VLAN interface of this data message.
Wherein, the data message sent by network equipment can carry described VLAN to identify.Because described VLAN interface and VLAN identify one_to_one corresponding, can according to the VLAN carried in data message marking matched go out in conversion equipment for the treatment of the VLAN interface of this data message.
207, from the first mapping table, default replacement source IP address is matched according to the VLAN interface matched.
208, the source IP address in data message is converted to default replacement source IP address.
Because the IP address of network equipment is identical, therefore, when network equipment sends datagram, the source IP address in data message is identical.Source IP address in data message is converted to default replacement source IP address, can network conflict be avoided.Obviously, the replacement source IP address preset is different, and like this, the data message after conversion source IP address could by normal transmission.
209, by conversion source IP address after data message forwarding to client device.
This step is identical with the step S105 in embodiment one, does not repeat them here.
210, according to the object IP address in the data message of client transmission, from the second mapping table, corresponding VLAN interface is matched.
Wherein, when conversion equipment receives the data message of client device transmission, the object IP address in data message is the object IP address of the request access that user is sent by client device.
211, according to the VLAN interface matched, from the 3rd mapping table, default replacement object IP address is matched.
212, by the object IP address transition in data message be the replacement object IP address that this is preset.
Obviously, in the embodiment of the present invention, also, by client send data message in request access object IP address carry out the IP address converting network equipment to, just can by data message normal transmission on the network equipment of correspondence.
213, corresponding VLAN mark is matched according to described VLAN interface.
214, converted the data message behind object IP address by corresponding VLAN interface by described, be forwarded on the network equipment that carries and match corresponding VLAN mark.
It should be noted that, for said method embodiment, in order to simple description, therefore it is all expressed as a series of combination of actions, but those skilled in the art should know, step 206-209 of the present invention and step 210-214 is not by the restriction of described sequence of movement, because foundation the present invention, step 206-209 and step 210-214 can perform simultaneously, also can perform with any one sequencing.
The embodiment of the present invention two provides a kind of data transmission method, the VLAN interface that conversion equipment is arranged and the first default mapping table, the second mapping table and the 3rd mapping table.When receiving the data message that network equipment sends, the source IP address in data message is changed by the first mapping table according to presetting, and the data message after conversion is forwarded to client device by corresponding VLAN interface; When receiving the data message that client device sends, according to the second mapping table preset and the 3rd mapping table, the object IP address in data message is changed, the data message after conversion is transmitted to network equipment by corresponding VLAN interface.There is multiple network equipment in a network when there is identical ip addresses, network equipment and client device proper communication can be made, avoid network conflict.
For the ease of understanding, the step of a kind of data transmission method of the present invention is described below with an embody rule scene.
Embodiment three:
301, on conversion equipment, install ebtables instrument and vconfig instrument, VLAN interface set up by conversion equipment, VLAN interface and VLAN identify one_to_one corresponding, corresponding relation can be preserved in Table 1 in advance:
Network equipment number VLAN interface VLAN ID
1 eth0.100 100
2 eth0.200 200
... ... ...
Table 1
Wherein, VLAN switch can be adopted to be that each network equipment distributes VLAN mark.
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, and be connected on network equipment by VLAN switch, the conversion equipment other end connects client device.
302, the first mapping table, the second mapping table and the 3rd mapping table is preset.
First mapping table preserves the corresponding relation of described VLAN interface and default replacement source IP address, as shown in table 2:
Network equipment number VLAN interface Replace source IP address
1 eth0.100 192.168.1.2
2 eth0.200 192.168.1.3
... ... ...
Table 2
Second mapping table preserves the corresponding relation of the object IP address that VLAN interface and client-requested are accessed, as shown in Figure 3:
VLAN interface Object IP address
eth0.100 192.168.1.2
eth0.200 192.168.1.3
... ...
Table 3
3rd mapping table preserves described VLAN interface and the corresponding relation replacing object IP address, as shown in table 4:
VLAN interface Replace object 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 of client device transmission.When receiving the data message of network equipment transmission, perform step 304-307; When receiving the data message of client device transmission, perform step 308-312.
Refer to Fig. 3, the data transmission method schematic diagram that Fig. 3 provides for the embodiment of the present invention three.There is the network equipment that two have identical ip addresses in network.As shown in Figure 3, suppose that the IP address of two network equipments is 192.168.1.1, two VLAN marks that VLAN switch distributes to network equipment are respectively 100 and 200.When network equipment sends message, in data message, carry the VLAN mark that VLAN switch distributes.
304, according to table 1, the VLAN carried according to network equipment 1 is designated the data message of 100, and the VLAN interface matched for the treatment of the data message of equipment 1 is eth0.100.The VLAN carried according to network equipment 2 is designated the data message of 200, and the VLAN interface matched for the treatment of the data message of equipment 2 is eth0.200.
305, according to the VLAN interface that step 304 matches, from table 2, match VLAN interface be the replacement object IP address that the data message of eth0.100 is corresponding is 192.168.1.2, and VLAN interface is the replacement object IP address that the data message of eth0.200 is corresponding is 192.168.1.3.
306,192.168.1.2 is converted to by carrying the source IP address that VLAN is designated in the data message of 100; 192.168.1.3 is converted to by carrying the source IP address that VLAN is designated in the data message of 200.
307, converted the data message forwarding of source IP address to client device by above-mentioned two.
Because the IP address of network equipment is identical, therefore, when network equipment sends datagram, the source IP address in data message is identical.Source IP address in data message is converted to default replacement source IP address, can network conflict be avoided.Obviously, the replacement source IP address preset is different, after 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 be sent on client device, ensure that the proper communication of network.
Still there is the network equipment that two have identical ip addresses in network in the data transmission method described by step 308-312.Suppose that the IP address of two network equipments is 192.168.1.1, object IP address in the message that client sends is respectively 192.168.1.2 and 192.168.1.3, namely user is sent datagram by client device, and request access IP address is two network equipments of 192.168.1.2 and 192.168.1.3 respectively.
308, according to the object IP address in data message, from table 3, corresponding VLAN interface is matched.
In the present embodiment, matching that to comprise object IP address be the VLAN interface of the data message of 192.168.1.2 is eth0.100; Matching that to comprise object IP address be the VLAN interface of the data message of 192.168.1.3 is eth0.200.
309, according to the VLAN interface matched, from table 4, default replacement object IP address is matched.
In the present embodiment, to match VLAN interface be the replacement object IP address of the data message of eth0.100 is 192.168.1.1; To match VLAN interface be the replacement object IP address of the data message of eth0.200 is 192.168.1.1.
310, being 192.168.1.1 by comprise object IP address be the object IP address transition of the data message of 192.168.1.2, is 192.168.1.1 by comprise object IP address be the object IP address transition of the data message of 192.168.1.3.
311, corresponding VLAN mark is matched according to described VLAN interface.
From table 1, matching VLAN interface is that the data message of eth0.100 should be sent to and carries VLAN and be designated on the network equipment of 100; VLAN interface is that the data message of eth0.200 should be sent to and carries VLAN and be designated on the network equipment of 200.
312, be that the data message forwarding of 192.168.1.2 is designated on the network equipment of 100 to VLAN by object IP address, now, the object IP address of carrying in data message is 192.168.1.1; Be that the data message forwarding of 192.168.1.3 is designated on the network equipment of 200 to VLAN by object IP address, now, the object IP address of carrying in data message is 192.168.1.1.
Can find out, in this way, even if there is identical network equipment in network, and the object IP address of the data message of client device transmission is different from the IP address of network equipment, also can realize network service, avoid network conflict.
The embodiment of the present invention three provides a kind of data transmission method, the VLAN interface that conversion equipment is arranged and the first default mapping table, the second mapping table and the 3rd mapping table.When receiving the data message that network equipment sends, the source IP address in data message is changed by the first mapping table according to presetting, and the data message after conversion is forwarded to client device by corresponding VLAN interface; When receiving the data message that client device sends, according to the second mapping table preset and the 3rd mapping table, the object IP address in data message is changed, the data message after conversion is transmitted to network equipment by corresponding VLAN interface.There is multiple network equipment in a network when there is identical ip addresses, network equipment and client device proper communication can be made, avoid network conflict.
One of ordinary skill in the art will appreciate that all or part of step realized in above-described embodiment method is that the hardware that can carry out instruction relevant by program completes, described program can be stored in a kind of computer-readable recording medium, the above-mentioned storage medium mentioned can be 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 present invention four, as shown in Figure 4, this device can comprise:
Dispensing unit 40, for setting up at least one VLAN interface on conversion equipment, VLAN interface and VLAN identify one_to_one corresponding;
First receiving element 41, for receiving the data message that network equipment sends;
First converting unit 42, for according to the first mapping table, changes the source IP address of the described data message received from the first receiving element 41; First mapping table preserves the corresponding relation of the dispensing unit 40 described VLAN interface set up and the replacement source IP address preset;
First retransmission unit 43, for by the data message forwarding after change source IP address in the first converting unit 42 to client device;
Second receiving element 44, for receiving the data message that client device sends;
Second converting unit 45, for changing according to the second mapping table and the 3rd mapping table object IP address to the described data message received from the second receiving element 44; Wherein, the second mapping table preserves the described VLAN interface that dispensing unit 40 is set up, and accesses the corresponding relation of object IP address with client-requested; Also the corresponding relation of object IP address in the described VLAN interface and data message that dispensing unit 40 sets up namely is preserved.3rd mapping table preserves the described VLAN interface that dispensing unit 40 is set up, with the corresponding relation of the replacement object IP address of presetting;
Second retransmission unit 46, for by the data message forwarding after change object IP address in the second converting unit 45 to network equipment.
See also Fig. 5, the structural representation of the another kind of data transmission device that Fig. 5 provides for the embodiment of the present invention four.Wherein, the data transmission device shown in Fig. 5 is that data transmission device is as shown in Figure 4 optimized and obtains.In the data transmission device shown in Fig. 5, can also comprise:
VLAN switch (not shown), for described VLAN mark is assigned to network equipment, the corresponding VLAN mark of each network equipment.
First receiving element 41 specifically for: receive network equipment send carry VLAN mark data message.
First converting unit 42 specifically comprises:
First matching unit 420, for the VLAN interface according to the marking matched correspondence of described VLAN of carrying in described data message;
Second matching unit 421, for the VLAN interface of correspondence matched according to the first matching unit 420, from the described default replacement source IP address that described first mapping table coupling is corresponding;
3rd converting unit 422, the source IP address for the data message sent by network equipment is converted to: the replacement source IP address matched in the second matching unit 421.
First forward Unit 43 specifically for: by conversion source IP address after data message be forwarded on client device by the VLAN interface of described correspondence.Wherein, do not carry described VLAN by the described data message after the first forwarding 43 forwarding to identify.
Second receiving element 44 specifically for: receive the data message of object IP address carrying client device requests access that client device sends.
Second converting unit 45 comprises:
3rd matching unit 450, corresponding VLAN interface is mated in the object IP address for the data message sent according to client device from the second mapping table; Namely being equivalent to the object IP address for accessing according to client device requests, from the second mapping table, mating corresponding VLAN interface;
4th matching unit 451, for the VLAN interface of described correspondence matched according to the 3rd matching unit 450, from the replacement object IP address that the 3rd mapping table coupling is corresponding;
4th converting unit 452, the object IP address transition for being accessed by described client device requests is the replacement object IP address that the 4th matching unit 451 matches.
Second retransmission unit 46 comprises:
5th matching unit 460, the VLAN mark that the described VLAN interface coupling for matching according to the 3rd matching unit 450 is corresponding;
3rd retransmission unit 461, for being forwarded to the network equipment of the VLAN mark carrying the correspondence that the 5th matching unit 460 matches by corresponding VLAN interface by the data message behind described conversion object IP address.
The embodiment of the present invention four provides a kind of data transmission device, the VLAN interface that conversion equipment is arranged and the first default mapping table, the second mapping table and the 3rd mapping table.When receiving the data message that network equipment sends, the source IP address in data message is changed by the first mapping table that can be used according to presetting, and the data message after conversion is forwarded to client device by corresponding VLAN interface; When receiving the data message that client device sends, according to the second mapping table preset and the 3rd mapping table, the object IP address in data message is changed, the data message after conversion is transmitted to network equipment by corresponding VLAN interface.There is multiple network equipment in a network when there is identical ip addresses, network equipment and client device proper communication can be made, avoid network conflict.
Above a kind of data transmission method provided by the present invention and device are described in detail, for one of ordinary skill in the art, according to the thought of the embodiment of the present invention, all will change in specific embodiments and applications, in sum, this description should not be construed as limitation of the present invention.

Claims (9)

1. a data transmission method, is characterized in that, comprising:
Conversion equipment is set up at least one VLAN (VLAN, Virtual Local AreaNetwork) interface, and described VLAN interface and VLAN identify one_to_one corresponding;
Receive the data message that network equipment sends and/or the data message receiving client device transmission, wherein, the data message that described network equipment sends carries VLAN mark;
If described data message is from network equipment, then described conversion equipment according to the first mapping table to the agreement (IP interconnected between the source network of described data message, Internet Protocol) address changes, by the data message forwarding after conversion source IP address to client device; Described first mapping table is preserved described VLAN interface and is preset the corresponding relation replacing source IP address;
If described data message is from client device, then described conversion equipment is changed the object IP address to described data message according to the second mapping table and the 3rd mapping table, by the data message forwarding behind conversion object IP address to network equipment; Wherein, described second mapping table preserves the corresponding relation of the object IP address of the data message that described VLAN interface and client send; Described 3rd mapping table preserves the corresponding relation of described VLAN interface and default replacement object IP address;
Wherein, the corresponding VLAN mark of each network equipment;
Describedly according to the first mapping table, conversion is carried out to the source IP address of described data message and comprises:
According to the described VLAN carried in described data message marking matched go out corresponding VLAN interface;
According to the VLAN interface of described correspondence, from the first mapping table, match corresponding described replacement source IP address;
The source IP address of the data message sent by described network equipment is converted to the described replacement source IP address matched;
Described according to the second mapping table and the 3rd mapping table the object IP address to described data message carry out conversion and comprise:
According to the object IP address of the data message that described client device sends, from the second mapping table, match corresponding VLAN interface;
According to the VLAN interface of described correspondence, match corresponding replacement object IP address from the 3rd mapping table;
The object IP address transition of being accessed by described client device requests is described replacement object IP address.
2. data transmission method according to claim 1, is characterized in that,
Described VLAN mark is assigned on network equipment by VLAN switch.
3. data transmission method according to claim 1 and 2, is characterized in that, described by conversion source IP address after data message forwarding comprise to client device:
Data message after conversion source IP address is forwarded on client device by the VLAN interface of described correspondence; Wherein, the described data message after forwarding does not carry described VLAN and identifies.
4. data transmission method according to claim 1 and 2, is characterized in that, described by conversion object IP address after data message forwarding comprise to network equipment:
Corresponding VLAN mark is matched according to described VLAN interface;
By the data message behind described conversion object IP address by corresponding VLAN interface be forwarded to carry described in match on the network equipment of corresponding VLAN mark.
5. a data transmission device, is characterized in that, comprising:
Dispensing unit, for setting up at least one VLAN interface on conversion equipment, described VLAN interface and VLAN identify one_to_one corresponding;
First receiving element, for receiving the data message that network equipment sends; Wherein, the data message that described network equipment sends carries VLAN mark;
First converting unit, for according to the first mapping table, changes the source IP address of the described data message received from described first receiving element; Described first mapping table preserves the described VLAN interface that described dispensing unit is set up, with the corresponding relation of the replacement source IP address preset;
First retransmission unit, for by the data message forwarding after change source IP address in described first converting unit to client device;
Second receiving element, for receiving the data message that client device sends;
Second converting unit, for changing according to the second mapping table and the 3rd mapping table object IP address to the described data message received from described second receiving element; Wherein, described second mapping table preserves the corresponding relation of described VLAN interface that described dispensing unit sets up and the object IP address of data message that client sends; Described 3rd mapping table preserves the described VLAN interface that described dispensing unit is set up, with the corresponding relation replacing object IP address;
Second retransmission unit, for by the data message forwarding after change object IP address in described second converting unit to network equipment;
Wherein, the corresponding VLAN mark of each network equipment;
Described first converting unit specifically comprises:
First matching unit, for the VLAN interface according to the marking matched correspondence of described VLAN of carrying in described data message;
Second matching unit, for the VLAN interface of correspondence matched according to described first matching unit, from the described replacement source IP address that described first mapping table coupling is corresponding;
3rd converting unit, the source IP address for the data message sent by described network equipment is converted to the described replacement source IP address matched in described second matching unit;
Described second converting unit comprises:
3rd matching unit, for the object IP address of data message sent according to described client device, mates corresponding VLAN interface from the second mapping table;
4th matching unit, for the VLAN interface of described correspondence matched according to described 3rd matching unit, from the replacement object IP address that the 3rd mapping table coupling is corresponding;
4th converting unit, the object IP address transition for being accessed by described client device requests is the replacement object IP address that described 4th matching unit matches.
6. data transmission device according to claim 5, is characterized in that, also comprises:
VLAN switch, for being assigned to network equipment by described VLAN mark.
7. the data transmission device according to claim 5 or 6, is characterized in that, described first retransmission unit specifically for:
Data message after conversion source IP address is forwarded on client device by the VLAN interface of described correspondence; Wherein, the described data message after forwarding does not carry described VLAN and identifies.
8. data transmission device according to claim 5, is characterized in that, described second receiving element specifically for:
Receive the data message carrying the object IP address of client device requests access that client device sends.
9. the data transmission device according to claim 5 or 8, is characterized in that, described second retransmission unit comprises:
5th matching unit, the VLAN mark that the described VLAN interface coupling for matching according to described 3rd matching unit is corresponding;
3rd retransmission unit, for being forwarded to the network equipment of the VLAN mark carrying the correspondence that described 5th matching unit matches by described VLAN interface by the data message behind described conversion object IP address.
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 CN102780602A (en) 2012-11-14
CN102780602B true 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)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104168186B (en) * 2014-07-01 2018-01-02 汉柏科技有限公司 A kind of message forwarding method and system based on bridge
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
CN104702713B (en) * 2015-03-26 2018-09-04 新华三技术有限公司 A kind of data message forwarding method and device
CN109873728B (en) * 2017-12-01 2022-03-08 腾讯科技(深圳)有限公司 Terminal testing method and device and storage medium
CN108566445B (en) * 2018-03-15 2020-12-08 华为技术有限公司 Message transmission method and device
CN109922164B (en) * 2019-02-12 2022-07-26 Oppo广东移动通信有限公司 Address translation method and device and computer storage medium

Citations (4)

* 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

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI389525B (en) * 2010-02-25 2013-03-11 Gemtek Technology Co Ltd System of multiple subnet accessible data transfer and method thereof

Patent Citations (4)

* 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

Also Published As

Publication number Publication date
CN102780602A (en) 2012-11-14

Similar Documents

Publication Publication Date Title
CN102780602B (en) Method and device for data transmission
CN102594711A (en) Message forwarding method and edge device therefor
US10212126B2 (en) System for mediating connection
CN104753697A (en) Method, equipment and system for controlling provisioning of network equipment
CN101883090A (en) Client access method, equipment and system
CN103763407A (en) Method for achieving address resolution protocol proxy through two-layer virtual local area network and local area network system
CN105635332A (en) Method for multiple virtual machines to share IP of single external network
CN107809386B (en) IP address translation method, routing device and communication system
CN102946351A (en) Data transmission method and system
CN104394242A (en) IP (internet protocol) address allocation method and device
CN104980368A (en) Bandwidth guarantee method and apparatus in software defined network (SDN)
KR101455229B1 (en) Relay server and relay communication system
CN104243427A (en) Virtual machine online migration method and data package transmission method and device
CN101459532A (en) Method and apparatus for automatic networking by multi-port equipment
CN105827496B (en) Manage the method and device of PE equipment
CN103401954B (en) The implementation method of virtual DHCP
CN104104749A (en) Method and device for allocating tunnel IP addresses
CN105357332B (en) A kind of method for network address translation and device
CN104333612A (en) Network address translation method and device
US10374834B2 (en) Modular industrial automation appliance and method for transmitting messages via a backplane bus system of the modular industrial automation appliance
JP6995886B2 (en) Layer 3 communication implementation
CN107172229A (en) The collocation method and device of router
WO2019015268A1 (en) Network system and network configuration method thereof
CN110868474B (en) Interconnection network element, network intercommunication method, system, equipment and computer medium
US20160330614A1 (en) Wireless communication device, wireless communication network, and identification-number setting method

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