CN-116234063-B - Data transmission method and device
Abstract
The invention discloses a data transmission method and device, relates to the field of communication, and solves the problem of shortage of resources of the existing terminal optical cable. The data transmission method is applied to first user front-end equipment in a virtual private network system, the first user front-end equipment accesses a bearing network through a wired link and a first wireless link, and comprises the steps of receiving a data packet sent by user equipment, wherein the data packet comprises a static source address and a target address, the static source address points to the user equipment, the target address points to a receiving end of the data packet, determining a target link for transmitting the data packet, wherein the target link is the wired link and/or the first wireless link, packaging a dynamic source address and a dynamic target address into the data packet based on a GRE protocol under the condition that the target link is the first wireless link to obtain the wireless transmission data packet, distributing the dynamic source address and the dynamic target address by a dynamic IP pool of the first wireless link, and transmitting the wireless transmission data packet into the bearing network through the first wireless link.
Inventors
- ZHAO YU
- LI WENBIN
- PAN GUIXIN
- PENG JIAN
- SUN LIJUN
- LIU XIWU
Assignees
- 中国联合网络通信集团有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20230105
Claims (10)
- 1. A data transmission method, which is applied to a first user front-end equipment in a virtual private network system, wherein the first user front-end equipment accesses a bearer network through a wired link and a first wireless link, the method comprising: Receiving a data packet sent by user equipment, wherein the data packet comprises a static source address and a target address, the static source address points to the user equipment, and the target address points to a receiving end of the data packet; Determining a target link for transmitting the data packet, wherein the target link is the wired link and/or the first wireless link; When the target link is the first wireless link, based on GRE protocol, the dynamic source address and the dynamic target address are packaged in the data packet to obtain a wireless transmission data packet, wherein the dynamic source address and the dynamic target address are distributed by a dynamic IP pool of the first wireless link and respectively point to the starting point and the ending point of the first wireless link; and transmitting the wireless transmission data packet into the bearing network through the first wireless link.
- 2. The data transmission method according to claim 1, wherein in the case where the target link is the first wireless link, the method further comprises: Encapsulating the data packet into a VPN data packet based on a VPN protocol; the method for encapsulating the dynamic source address and the dynamic target address in the data packet based on the GRE protocol to obtain a wireless transmission data packet comprises the following steps: and based on the GRE protocol, the dynamic source address and the dynamic target address are encapsulated in the VPN data packet to obtain a wireless transmission data packet.
- 3. The data transmission method according to claim 2, characterized in that the method further comprises: Detecting a connection state of the wired link and the first wireless link; the determining a target link for transmitting the data packet includes: When the wired link and the first wireless link are connected normally, determining the wired link as the target link; and when the wired link connection fails and the first wireless link connection is normal, determining the first wireless link as the target link.
- 4. The data transmission method according to claim 2, characterized in that the method further comprises: Detecting a connection state of the wired link and the first wireless link; the determining a target link for transmitting the data packet includes: and when the wired link and the first wireless link are connected normally, determining the wired link and the first wireless link as the target link.
- 5. The method of data transmission according to claim 4, further comprising: When the target link is the wired link and the first wireless link, based on GRE protocol, the dynamic source address and the dynamic target address are encapsulated in the data packet to obtain a wireless transmission data packet, and the data packet is encapsulated according to VPN protocol to obtain a wired transmission data packet, wherein the wired transmission data packet and the wireless transmission data packet have the same data packet identification; transmitting the wireless transmission data packet into the bearing network through the first wireless link; and transmitting the wired transmission data packet into the bearing network through the wired link.
- 6. The method of data transmission according to claim 4, further comprising: Under the condition that the target link is the wired link and the first wireless link, based on GRE protocol, the dynamic source address and the dynamic target address are encapsulated in one part of the data packets to obtain wireless transmission data packets; transmitting the wireless transmission data packet into the bearing network through the first wireless link; and transmitting the wired transmission data packet into the bearing network through the wired link.
- 7. The method according to claim 3 or 4, wherein the virtual private network system further comprises a second user head-end device, the second user head-end device accesses the bearer network through a second wireless link, the first user head-end device and the second user head-end device form a VRRP backup group to have the same virtual IP address and different virtual MAC addresses, the user end device is configured with the virtual IP address and a target virtual MAC address, the target virtual address is a virtual MAC address of the first user head-end device or the second user head-end device, and the data packet is sent by the user end device according to the virtual IP address and the target virtual MAC address to reach the first user head-end device or the second user head-end device, and the method further comprises: Updating the target virtual MAC address to the virtual MAC address of the first user front-end equipment when at least one of the wired link and the first wireless link is connected normally; and when the wired connection and the first wireless link are connected with each other and fail, sending a notification message to the second user front-end equipment, wherein the notification message is used for indicating the second user front-end equipment to update the target virtual MAC address to the virtual MAC address of the second user front-end equipment.
- 8. The data transmission method according to claim 3 or 4, wherein the detecting the connection state of the wired link and the first wireless link includes: BFD session is established between the wired link and the first wireless link, and BFD message is sent and received periodically; And if the BFD message of the wired link and/or the first wireless link is not received within the detection time, the wired link and/or the first wireless link which does not receive the BFD message is considered to have connection faults.
- 9. A data transmission device, wherein the data transmission device is applied to a virtual private network system, the data transmission device is in communication connection with a user equipment in the virtual private network system, and is accessed to a carrier network through a wired link and a first wireless link, and the data transmission device comprises: The data receiving module is used for receiving a data packet sent by the user terminal equipment, wherein the data packet comprises a static source address and a target address, the static source address points to the user terminal equipment, and the target address points to a receiving end of the data packet; the link selection module is used for determining a target link for transmitting the data packet, wherein the target link is a wired link and/or a first wireless link; The data encapsulation module is used for encapsulating a dynamic source address and a dynamic target address into the data packet based on GRE protocol to obtain a wireless transmission data packet when the target link is the first wireless link, wherein the dynamic source address and the dynamic target address are distributed by a dynamic IP pool of the first wireless link and respectively point to a starting point and an ending point of the first wireless link; and the data sending module is used for transmitting the wireless transmission data packet into a bearing network through the first wireless link under the condition that the target link is the first wireless link.
- 10. The virtual private network system is characterized by comprising user side equipment and first user front-end equipment, wherein the user side equipment is in communication connection with the first user front-end equipment, and the first user front-end equipment is accessed to a bearing network through a wired link and a first wireless link; The user terminal equipment is used for sending a data packet to the first user front-end equipment, wherein the data packet comprises a static source address and a target address, the static source address points to the user terminal equipment, and the target address points to a receiving end of the data packet; The method comprises the steps of receiving a data packet sent by user terminal equipment by a first user front-end equipment, determining a target link for transmitting the data packet, wherein the target link is a wired link and/or a first wireless link, packaging a dynamic source address and a dynamic target address in the data packet based on a GRE protocol to obtain a wireless transmission data packet when the target link is the first wireless link, distributing the dynamic source address and the dynamic target address by a dynamic IP pool of the first wireless link and pointing to a starting point and an ending point of the first wireless link respectively, and transmitting the wireless transmission data packet into a bearing network through the first wireless link.
Description
Data transmission method and device Technical Field The present invention relates to the field of communications, and in particular, to a data transmission method and apparatus. Background With the development of digital technology, the requirement for accessing the internet is increasing, and the requirement for various aspects of transmission is continuously improved, so that enterprises, hospitals, government departments and the like build a private network. Because the construction cost of constructing a private network by using a special optical cable and a cable is too high and the applicability is low, the technology of constructing a private virtual private network on a common network is widely used. On this basis, reliability of data transmission of the virtual private network is the most of concern. In general, the guarantee of network transmission reliability is dependent on terminal multi-route access. Because of reasons such as planning construction, the optical cable resource expansion difficulty is high, so that the problem of terminal optical cable resource shortage easily occurs. Disclosure of Invention The invention provides a data transmission method and device, which are used for solving the problem of resource shortage of an end optical cable. In order to achieve the above purpose, the invention adopts the following technical scheme: In a first aspect, the present invention provides a data transmission method, applied to a first user front-end device in a virtual private network system, where the first user front-end device accesses a carrier network through a wired link and a first wireless link, and the method includes receiving a data packet sent by a user terminal device, where the data packet includes a static source address and a target address, the static source address points to the user terminal device, and the target address points to a receiving end of the data packet; the method comprises the steps of determining a target link for transmitting data packets, wherein the target link is a wired link and/or a first wireless link, packaging a dynamic source address and a dynamic target address in the data packets based on a GRE protocol under the condition that the target link is the first wireless link to obtain the wireless transmission data packets, distributing the dynamic source address and the dynamic target address by a dynamic IP pool of the first wireless link and pointing to a starting point and an ending point of the first wireless link respectively, and transmitting the wireless transmission data packets into a bearing network through the first wireless link. In the above embodiment, the first user front-end device encapsulates the dynamic source address and the dynamic destination address, and the static source address and the destination address of the first wireless link in the wireless transmission data packet through the GRE protocol. The static source address required by the virtual private network is fixed IP, and the wireless links are mostly dynamically allocated IP, so that the static source address of the data packet and the dynamic source address of the wireless link can be decoupled, the problem that the wireless link is a dynamic address and the virtual private network requires the static address is solved, and the wireless link can also bear the data transmission of the virtual private network. And a wireless link is introduced to carry out data transmission of a virtual private network, so that the problem of resource shortage of an end optical cable is further solved. In one possible implementation manner, in the case that the target link is the first wireless link, the data transmission method further includes encapsulating the data packet into a VPN data packet based on a VPN protocol, encapsulating the dynamic source address and the dynamic target address into the data packet based on a GRE protocol to obtain a wireless transmission data packet, and encapsulating the dynamic source address and the dynamic target address into the VPN data packet based on the GRE protocol to obtain the wireless transmission data packet. In one possible implementation, detecting the connection state of the wired link and the first wireless link, determining the target link for transmitting the data packet includes determining the wired link as the target link when both the wired link and the first wireless link are connected normally, and determining the first wireless link as the target link when the wired link connection fails and the first wireless link is connected normally. In one possible implementation, the data transmission method further comprises detecting connection states of the wired link and the first wireless link, and determining a target link for transmitting the data packet comprises determining the wired link and the first wireless link as the target link when the wired link and the first wireless link are connected normally. In one possible impleme