WO2018059284A1 - 一种数据传输的方法及网络设备 - Google Patents

一种数据传输的方法及网络设备 Download PDF

Info

Publication number
WO2018059284A1
WO2018059284A1 PCT/CN2017/102386 CN2017102386W WO2018059284A1 WO 2018059284 A1 WO2018059284 A1 WO 2018059284A1 CN 2017102386 W CN2017102386 W CN 2017102386W WO 2018059284 A1 WO2018059284 A1 WO 2018059284A1
Authority
WO
WIPO (PCT)
Prior art keywords
address
packet
network
private network
destination address
Prior art date
Application number
PCT/CN2017/102386
Other languages
English (en)
French (fr)
Inventor
肖寒
孙成浩
梁军
Original Assignee
阿里巴巴集团控股有限公司
肖寒
孙成浩
梁军
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 阿里巴巴集团控股有限公司, 肖寒, 孙成浩, 梁军 filed Critical 阿里巴巴集团控股有限公司
Publication of WO2018059284A1 publication Critical patent/WO2018059284A1/zh
Priority to US16/364,064 priority Critical patent/US11233766B2/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/09Mapping addresses
    • H04L61/25Mapping addresses of the same type
    • H04L61/2503Translation of Internet protocol [IP] addresses
    • H04L61/2514Translation of Internet protocol [IP] addresses between local and global IP addresses
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/09Mapping addresses
    • H04L61/25Mapping addresses of the same type
    • H04L61/2503Translation of Internet protocol [IP] addresses
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/09Mapping addresses
    • H04L61/10Mapping addresses of different types
    • H04L61/106Mapping addresses of different types across networks, e.g. mapping telephone numbers to data network addresses
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/46Interconnection of networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/46Interconnection of networks
    • H04L12/4633Interconnection of networks using encapsulation techniques, e.g. tunneling
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/46Interconnection of networks
    • H04L12/4641Virtual LANs, VLANs, e.g. virtual private networks [VPN]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/66Arrangements for connecting between networks having differing types of switching systems, e.g. gateways
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/09Mapping addresses
    • H04L61/25Mapping addresses of the same type
    • H04L61/2503Translation of Internet protocol [IP] addresses
    • H04L61/2521Translation architectures other than single NAT servers
    • H04L61/2535Multiple local networks, e.g. resolving potential IP address conflicts
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/09Mapping addresses
    • H04L61/25Mapping addresses of the same type
    • H04L61/2503Translation of Internet protocol [IP] addresses
    • H04L61/256NAT traversal
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/09Mapping addresses
    • H04L61/25Mapping addresses of the same type
    • H04L61/2503Translation of Internet protocol [IP] addresses
    • H04L61/2592Translation of Internet protocol [IP] addresses using tunnelling or encapsulation

Definitions

  • the solution relates to the field of communications, and in particular to a method and a network device for data transmission.
  • each user's address within the network can be customized in the address range within the relevant specification. Since the address space in the VPC is freely planned by the user and the address resources are freely controlled by the user, the cloud service provider avoids invading the address space of the user in the VPC by occupying the network address in the VPC. In this case, the cloud service provider cannot provide a certain service to the user by setting a unified IP address in the VPC network, especially the basic service such as NTP (Network Time Protocol).
  • NTP Network Time Protocol
  • the server provider generally requires the user to obtain various basic services by accessing the designated public network address.
  • This solution has the following problems: the user needs to purchase the public network address by himself, and bear the expenses of various public network traffic.
  • the purpose of the solution is to provide a data transmission method and a network device, which can prevent a user from using public network traffic to obtain a service provided by a private network to a certain extent.
  • the embodiment of the present solution provides a data transmission method, including:
  • performing address translation on the first destination address to obtain the second destination address includes:
  • the found destination address is determined as the second destination address.
  • generating the second packet according to the second destination address and the first packet includes:
  • converting the first format to the second format includes:
  • the first header information includes at least an internal source address, an internal destination address, and a virtual network identifier. And an external source address and an external destination address; the second header information includes at least a source address and a destination address;
  • the source address carried in the second header information is an address of the network device, and the carried destination address is the Second destination address.
  • sending the second packet to the outside of the virtual private network where the virtual private network user is located includes:
  • the aspect as described above and any possible implementations further provide an implementation in which the specified address does not belong to a range of addresses that the specified network has configured.
  • an implementation manner is further provided, where the virtual private network is a VPC network.
  • the first format is a VXLAN format
  • the second format is a VLAN format
  • an implementation manner is further provided, where the first destination address and the second destination address correspond to the same server.
  • the server is an NTP server or an encryption server.
  • the embodiment of the present solution further provides a data transmission method, including:
  • the embodiment of the present solution further provides a data transmission method, including:
  • the second source address is a specified address, and the specified address does not belong to a configured address range of a virtual private network where the virtual private network user is located;
  • the performing address translation on the first source address, and obtaining the second source address includes:
  • the found source address is determined as the second source address.
  • generating the second packet according to the second source address and the first packet includes:
  • converting the first format to the second format includes:
  • the first header information includes at least a source address and a destination address
  • the second header includes at least an internal source address, an internal destination address, a virtual network identifier, an external source address, and an external destination address;
  • the source address carried in the second header information is an address of the network device, and the carried destination address is the Second destination address.
  • the aspect as described above and any possible implementations further provide an implementation in which the specified address does not belong to a range of addresses that the specified network has configured.
  • an implementation manner is further provided, where the virtual private network is a VPC network.
  • the foregoing aspect and any possible implementation manner further provide an implementation manner, where the first format is a VLAN format, and the second format is a VXLAN format.
  • an implementation manner is further provided, where the first source address and the second source address correspond to the same server.
  • the server is an NTP server or an encryption server.
  • the embodiment of the present solution further provides a data transmission method, including:
  • the second source address is a specified address in the second type of network, and the specified address does not belong to the virtual private network where the virtual private network user is located. Address range
  • the embodiment of the present solution further provides a network device, including:
  • the receiving unit is configured to receive the first packet sent by the user of the virtual private network, where the first destination address carried by the first packet is a specified address, and the specified address does not belong to the virtual private network where the virtual private network user is located.
  • Configured address range
  • a converting unit configured to perform address translation on the first destination address to obtain a second destination address
  • a generating unit configured to generate a second packet according to the second destination address and the first packet
  • a sending unit configured to send the second packet to the outside of the virtual private network where the virtual private network user is located.
  • the embodiment of the present solution further provides a network device, including:
  • a receiving unit configured to receive a first packet sent by a user in the first type of network, where the first destination address carried by the first packet is a specified address in the second type network, and the specified address does not belong to the first
  • a converting unit configured to perform address translation on the first destination address to obtain a second destination address
  • a generating unit configured to generate a second packet according to the second destination address and the first packet
  • a sending unit configured to send the second packet to the second type network.
  • the embodiment of the present solution further provides a network device, including:
  • a receiving unit configured to receive a first packet sent by the network device, where the first packet carries a first source address
  • a conversion unit configured to perform address translation on the first source address to obtain a second source address;
  • the second source address is a specified address, and the specified address does not belong to a configured address of a virtual private network where the virtual private network user is located range;
  • a generating unit configured to generate a second packet according to the second source address and the first packet
  • a sending unit configured to send the second packet to the inside of the virtual private network where the virtual private network user is located.
  • the embodiment of the present solution further provides a network device, including:
  • a receiving unit configured to receive a first packet sent by a device in the second type of network, where the first packet carries a first source address
  • a conversion unit configured to perform address translation on the first destination address to obtain a second source address, where the second source address is a specified address in the second type of network, where the specified address does not belong to the virtual private network user
  • a generating unit configured to generate a second packet according to the second destination address and the first packet
  • a sending unit configured to send the second packet to the inside of the virtual private network where the virtual private network user is located.
  • the data transmission method and the network device provided by the embodiment of the present invention enable a user in the virtual private network to obtain a service provided by the corresponding server only by providing a private network of the service service, so that the virtual private network is internal. Users do not need to access services other than the private network to obtain services, thus saving traffic for users.
  • FIG. 1 is a schematic diagram of a network architecture provided by an embodiment of the present disclosure
  • FIG. 2 is a basic schematic diagram of data transmission provided by an embodiment of the present disclosure
  • FIG. 3 is a flowchart of a method for data transmission according to an embodiment of the present disclosure
  • FIG. 4 is a flowchart of another method for data transmission according to an embodiment of the present disclosure.
  • FIG. 5 is a flowchart of another method for data transmission according to an embodiment of the present disclosure.
  • FIG. 6 is a flowchart of another method for data transmission according to an embodiment of the present disclosure.
  • FIG. 7 is a flowchart of another method for data transmission according to an embodiment of the present disclosure.
  • FIG. 8 is a flowchart of another method for data transmission according to an embodiment of the present disclosure.
  • FIG. 9 is a flowchart of another method for data transmission according to an embodiment of the present disclosure.
  • FIG. 10 is a flowchart of another method for data transmission according to an embodiment of the present disclosure.
  • FIG. 11 is a flowchart of another method for data transmission according to an embodiment of the present disclosure.
  • FIG. 12 is a schematic flowchart of a method for performing data transmission in a specific scenario according to an embodiment of the present disclosure
  • FIG. 13 is a schematic flowchart of a method for performing data transmission in a specific scenario according to an embodiment of the present disclosure
  • FIG. 14 is a schematic diagram of a basic principle of data transmission according to an embodiment of the present disclosure.
  • FIG. 15 is a schematic diagram of another basic data transmission provided by an embodiment of the present disclosure.
  • FIG. 16 is a schematic flowchart of data transmission according to an embodiment of the present disclosure.
  • FIG. 17 is a schematic flowchart of a data transmission implemented by an encryption service according to an embodiment of the present disclosure.
  • FIG. 18 is a structural block diagram of a network device for data transmission according to an embodiment of the present disclosure.
  • FIG. 19 is a structural block diagram of a network device for data transmission according to an embodiment of the present disclosure.
  • FIG. 20 is a structural block diagram of a network device for data transmission according to an embodiment of the present disclosure.
  • FIG. 21 is a structural block diagram of a network device for data transmission according to an embodiment of the present disclosure.
  • FIG. 22 is a structural block diagram of a network device for data transmission according to an embodiment of the present disclosure.
  • the embodiment of the solution is applicable to a system architecture in which multiple types of networks are jointly formed.
  • each type of network is built without a clear intervention relationship, and its internal network address can be set independently.
  • Each type of network can be connected by an address translation device.
  • a virtual private network for example, a VPC, etc.
  • a private network for example, according to coverage, it can be divided into a local area network and a wide area network, etc., and can be divided into a computer room and a server group according to actual construction scenarios.
  • the system architecture of the three types of networks, such as group, enterprise intranet, and public network (for example, the Internet, etc.) is shown in Figure 1.
  • Each type of network communicates through a gateway.
  • Each gateway is generally configured with address translation and routing forwarding. And other functions.
  • FIG. 2 the basic communication process that can be implemented can be as shown in FIG. 2, including:
  • Step 1 The user inside the virtual private network initiates an initial request message and sends the request message to the gateway of the virtual private network.
  • VTEP VXLAN tunneling terminal, VXLAN Tunneling End Point
  • Step 2 When different packet formats are used between the virtual private network connected to the gateway and the private network, the gateway needs to format the received request packet to adapt to the transmission format in the private network.
  • Step 3 At the same time that the gateway performs format conversion, it also needs to find the actual address of the destination device in the private network according to the destination address in the request packet.
  • Step 4 The gateway encapsulates according to the actual address and the request content of the request packet according to the transport format suitable for the private network.
  • Step 5 The gateway forwards the encapsulated packet according to the path planned in the route.
  • the destination device in the private network After receiving the request message, the destination device in the private network performs corresponding processing according to the content of the request, and returns the processing result to the user.
  • the return process belongs to the reverse process of the foregoing steps 1 to 5, and will not be described again here.
  • the embodiment of the present solution provides a data transmission method, which is applicable to virtual
  • the network device may be a gateway, a server load balancing (SLB), and the like.
  • the method is as shown in FIG. 3, and includes:
  • the first destination address is a server address that is configured to the user in the virtual private network according to the actual situation, and is generally different from the actual network address of the server in the private network.
  • the specified address does not belong to a configured address range of the virtual private network where the virtual private network user is located.
  • the specified address mentioned here can be understood as belonging to the network address in the foregoing private network.
  • the network traffic is also assumed.
  • the specified address can be configured to provide a server (eg, NTP server or cryptographic server) address for the underlying service (eg, NTP, cryptographic service, etc.).
  • the service network is also connected to other private networks and can communicate with other private networks, it is necessary to prevent the user's access to the aforementioned basic services from flowing to other private networks.
  • the specified address does not belong to the address range configured by one or more specified networks of other private networks.
  • the first packet can be understood as a request message for obtaining a basic service.
  • the destination address carried in the packet does not belong to the address range of the virtual private network. Therefore, the packet flows to the network outside the virtual private network through the gateway. In the architecture shown in Figure 1, the first packet is sent. Flowed from the virtual private network to the private network).
  • the embodiment of the solution does not limit the use of the first packet and the specified address, and the two
  • the purpose of the application may also be to provide other business services to the user.
  • the second destination address is corresponding to the first destination address, and is used to indicate the actual network address of the server in the private network, so the second destination address and the first destination address correspond to the same server.
  • the destination address is changed. Therefore, the content of the first packet needs to be formatted or repackaged to generate a second packet.
  • the method for data transmission provided by the embodiment of the present invention enables a user in a virtual private network to obtain a service provided by a corresponding server only by providing a private network for providing a service service, so that users inside the virtual private network do not need to be Save traffic for users by accessing other networks than private networks to obtain services.
  • the embodiment of the present invention provides a corresponding implementation process for how to perform the conversion from the first destination address to the second destination address, that is, the specific implementation process of the foregoing step 102, as shown in FIG. 4, includes:
  • the virtual network identifier is the identifier information of the virtual private network where the user is located, and is used to distinguish different virtual private networks.
  • the virtual network identifier is introduced in the process of finding the destination address, in order to distinguish different types of users.
  • this is only an example.
  • the virtual network identifier may also be used for other purposes.
  • the found destination address is determined as the second destination address.
  • IPv4 address ranges commonly used in private networks include 10.0.0.0 to 10.255.255.255, 172.16.0.0 to 172.31.255.255, and 192.168.0.0 to 192.168.255.255. Therefore, the second destination address mentioned here can be selected from these three segments.
  • the specified address may be selected from the address range of 100.64.0.0 to 100.64.0.10. This range of addresses is typically used in private networks and is generally not configured on other networks except the private network.
  • the first destination address (ie, the designated address) and the second destination address can be configured as 100.64.10.10 and 10.10.10.101, respectively. This requires adding a mapping relationship 100.64.10.10 and VNI ⁇ ->10.10.10.101 to the address mapping table.
  • the first message and the second message mentioned above may have different message formats.
  • the solution of the solution provides a corresponding solution for such a situation, that is, a possible implementation of the foregoing step 103
  • For the method refer to the content shown in Figure 5, including:
  • the first format described herein refers to the packet format supported by the virtual private network where the user is located
  • the second format refers to the packet format supported by the private network.
  • the corresponding first format should generally conform to VXLANVXLAN ((Virtual Extensible LAN).
  • VXLANVXLAN Virtual Extensible LAN
  • the corresponding second format should generally conform to the VLAN ( Virtual LAN (Virtual Local Area Network).
  • VLAN Virtual LAN (Virtual Local Area Network).
  • the corresponding format conversion method can be configured.
  • the embodiment of the present solution does not specifically limit the format of the packets used by different networks.
  • the main contents of the VXLAN packet format are shown in Table 1 below.
  • the main contents of the VLAN packet format are shown in Table 2 below.
  • the content shown above is only a part of the content of the corresponding message, and other necessary information such as a MAC address may be set according to actual transmission needs.
  • FIG. 6 The implementation process of the foregoing steps 1031 and 1032, the related method flow is shown in FIG. 6, and includes:
  • the first header information carries the internal source address, the internal destination address, the virtual network identifier, the external source address, and the external destination address, and the second header information only needs to include the source address and the destination address, so During the format change, the internal source IP carried in the VXLAN packet is used as the source IP address of the VLAN packet, and the internal destination IP address carried in the VXLAN packet is reserved as the destination IP address of the VLAN packet.
  • the other IP addresses and virtual network identifiers in the VXLAN message are not preserved during the format conversion process.
  • the source IP address and the destination IP address carried in the VLAN packet obtained by the format conversion are only used to be used by the internal user of the virtual private network. Therefore, the second packet header information needs to be carried.
  • the destination address is the second destination address, so that the message can be transmitted to the correct target device, and the source address carried is the address of the network device, so that the feedback message can be correctly received by the network device.
  • a routing table related to the foregoing second destination address needs to be configured in advance on the gateway between the virtual private network and the private network, so as to receive the second destination address.
  • the packet can be forwarded directly.
  • the solution in this embodiment provides a corresponding solution for the case.
  • the next hop device is located outside the virtual private network where the virtual private network user is located.
  • routing tables mentioned here generally need to be pre-configured, or the gateway can complete the configuration through self-learning.
  • the embodiment of the present solution further provides a data transmission method, which is also applicable to the architecture shown in FIG. 8.
  • the method includes:
  • step 201 to step 204 can be understood as a reverse flow of the process described in steps 101 to 104. For example, if step 101 to step 104 realize that the user requests the basic service from the private network server, then step 201 to step 204 implements the response process of the server to the user request.
  • the first source address is substantially the same as the foregoing second destination address, and is used to indicate the actual network address of the server in the private network, and the second source address and the first destination address (ie, the aforementioned specified address) are The same, used to represent the users provided to the virtual private network. server address.
  • first packet and the second packet described herein are both packets sent by the server to the user, which are different from the first packet and the second packet described in the foregoing. .
  • the embodiment of the present invention provides a corresponding implementation process for how to perform the conversion from the first destination address to the second destination address, that is, the specific implementation process of the foregoing step 202, as shown in FIG. 9, includes:
  • determining the source address that is found is the second source address.
  • the solution of the present solution provides a corresponding solution for the case that the foregoing step 203 can be implemented as shown in FIG. 10, including:
  • the first format described herein refers to the packet format supported by the private network
  • the second format refers to the packet format supported by the virtual private network where the user is located.
  • the private network is a virtual local area network
  • the corresponding first format should generally conform to the VLAN.
  • the virtual private network is a VPC
  • the corresponding second format should generally conform.
  • VXLAN and VLAN packet format is taken as an example, and the implementation of the foregoing steps 2031 and 2032 is specifically described in the embodiment of the present embodiment.
  • the related method flow is as shown in FIG.
  • Step 20311 Replace the first header information that meets the first format in the first packet with the second header information that conforms to the second format.
  • the first header information includes at least a source address and a destination address; and the second header information includes at least an internal source address, an internal destination address, a virtual network identifier, an external source address, and an external destination address.
  • the second packet header information and the packet information are encapsulated to obtain the second packet.
  • the source address carried in the second header information is an address of the network device, and the carried destination address is the second destination address.
  • steps 20311 and 20321 can be understood as the reverse process of steps 10311 and 10321, that is, the packet is converted and re-encapsulated from the VLAN format to the VXLAN format.
  • the above is a description of the flow of traffic from the private network side to the user side in the virtual private network.
  • the implementation process can be understood as the reverse process corresponding to the step of traffic flowing from the user side to the private network side in the virtual private network.
  • Types, packet formats in various networks, specified address restrictions, message forwarding methods, etc. can be cross-referenced, so do not do too much Chen Said.
  • VPCs there are two different VPCs, each supporting VXLAN, VPC1111111 and VPC222222, user A in VPC111111, and user B in VPC222222.
  • the source address of user A in VPC1111111 is 192.168.1.100, the external source address is 10.10.10.11, and the virtual network identifier is 1111111.
  • the source address of user A in VPC2222222 is 192.168.1.100, the external source address is 10.10.10.10, and the virtual network identifier is 2222222.
  • the gateway address of the gateway VPC-GW between the VPC and the private network (supporting VLAN) is 10.10.10.100.
  • the address notified to the user A and the user B by the NTP server is 100.64.10.10, and the actual address in the private network is 10.10.10.101.
  • the implementation process of the user-side related method of the traffic flowing from the private network side to the virtual private network refers to the packet forwarding process shown in FIG. 12, and the process includes:
  • the packet header of the packet 1 carries an external source address 10.10.10.11, an external destination address 10.10.10.100, a virtual network identifier 1111111, an internal source address of 192.168.1.100, and an internal destination address of 100.64.10.10.
  • the packet header of packet 2 carries an external source address of 10.10.10.10 and an external destination address. 10.10.10.100, virtual network identifier 222222, internal source address 192.168.1.100, internal destination address 100.64.10.10.
  • the VPC-GW converts the received packet 1 and the packet 2 into a VXLAN format to a VLAN format to obtain a packet 3 and a packet 4.
  • the header of message 3 carries the active address 10.10.10.11 and the destination address 10.10.10.101.
  • the packet header of message 4 carries the active address 10.10.10.10 and the destination address 10.10.10.101.
  • the VPC-GW sends the packet 3 and the packet 4 to the NTP server according to the routing information recorded in the routing table.
  • the implementation process of the traffic from the user side to the private network side in the virtual private network is as follows: Referring to the packet forwarding process shown in FIG. 13, the process includes:
  • the NTP server returns the message 5 of the response message 3 and the message 6 of the response message 4 to the VPC-GW.
  • the packet header of message 5 carries the active address 10.10.10.101 and the destination address 10.10.10.11.
  • the header of message 6 carries the active address 10.10.10.101 and the destination address 10.10.10.10.
  • the VPC-GW After the VPC-GW receives the packet 5 and the packet 6, the VPC-GW converts the received packet 5 and the packet 6 into a VXLAN format, and obtains the packet 7 and the packet 8.
  • the packet header of the packet 7 carries an external source address 10.10.10.100, an external destination address 10.10.10.11, a virtual network identifier 1111111, an internal source address of 100.64.10.10, and an internal destination address of 192.168.1.100.
  • the packet header of the packet 8 carries an external source address 10.10.10.100, an external destination address 10.10.10.10, a virtual network identifier 222222, and an internal source address 100.64.10.10. Address 192.168.1.100.
  • the VPC-GW sends the message 7 to the user A, and sends the message 8 to the user B.
  • the setting of the network address of each network device, the selection of the message format supported by each network, and the results before and after the format conversion are not limited, but are schematic descriptions, and other applicable technologies may be combined.
  • the embodiment of the present solution is not limited to the networking architecture of the virtual private network, the private network, and the public network, and may be applicable to other network architectures of various types. Therefore, the embodiment of the present solution provides a general design scheme for data transmission, which is applied to a packet forwarding device between two networks.
  • Figure 14 The method applicable to the service request process is shown in Figure 14, which includes:
  • 501 Receive a first packet sent by a user in the first type of network, where the first destination address carried by the first packet is a specified address in the second type network, and the specified address does not belong to the first type network.
  • the configured address range does not belong to the configured range of addresses of the third type of network.
  • the second source address is a specified address in the second type network, and the specified address does not belong to the virtual private network user.
  • the embodiment of the present solution further provides a method flow provided by the VPC sending end, an SLB, and a cloud server as the interactive device, as shown in FIG. 16 .
  • the VPC sender includes: a VPC virtual machine and a VTEP. It can be understood that the three-party interaction process is applicable to the interaction between any VPC sender, any SLB, and any cloud server.
  • a VPC is a private cloud space that a user rents on a public cloud.
  • the virtualized technology forms a private server space in the cloud, which carries the user's application service, called an application server or a VPC virtual.
  • VPC virtual machines use network isolation technology to ensure the security of user data in their respective leased application servers. Users can deploy service-associated application services on the virtual machines of their respective application servers, and perform business process processing on each VPC virtual machine in the cloud. For example, the banking system may not need to provide the database and the service processing server, but deploy the money transfer service in the VPC virtual machine in the cloud, and the VPC virtual machine carrying the transfer service and the cloud server jointly implement the transfer business.
  • Each VPC virtual machine has its own IP address, just like a physical physical machine. In this embodiment, the IP of the VPC virtual machine is 192.168.1.100.
  • VTEP is a VLAN tunneling terminal. It is a VxLan-enabled device implemented by hardware or software. It can be used as an intermediate layer to encapsulate and decapsulate VxLan packets.
  • VNI virtual network identifier
  • IP virtual network identifier
  • VTEP encapsulates the VxLan header according to the virtual network identifier VNI and IP. Encapsulation of the original request packet issued by the paired application server.
  • the VPC sender receives the data packet returned by the cloud server, the data packet needs to be decapsulated by the VTEP to obtain the VxLan message, and the destination IP address of the VNI and the inner layer packet is obtained to determine the destination.
  • the VPC virtual machine sends the inner layer message to the destination VPC virtual machine.
  • the IP address of the VTEP is 10.10.10.11
  • the corresponding virtual network identifier is 1111111.
  • the SLB is a server load scheduler that can perform load balancing and cross-network access for multiple servers by forwarding requests.
  • the SLB can be either a hardware entity or a virtual device on a hardware entity.
  • the SLB can communicate with the cloud server network or with the VTEP.
  • the internal IP of the private network of the SLB corresponding to the VPC user is pre-configured for the SLB, and the internal IP of the private network of the SLB is used to enable the SLB to interact with the application server in the VPC network to enable interaction between the two. Just like communicating on the same private network.
  • the SLB also needs to store the correspondence between the actual network address of the cloud server and the server address configured to the VPC user, so that the SLB can normally forward the data communication between the VPC user and the cloud server.
  • the IP address of the SLB is 10.10.10.100.
  • the cloud server is a device that provides various cloud services to users. It can handle various user requests forwarded by SLB.
  • the actual IP address is 10.10.10.101, and the IP address configured for the VPC user is 100.64.10.10.
  • the method flow includes:
  • the s1, VPC virtual machine sends an original request packet to request a service from the cloud server.
  • the source IP address in the original request packet is the IP address (192.168.1.100) of the VPC virtual machine in the VPC sender, and the destination IP address is the private network internal IP address (100.64.10.10) of the cloud server pre-configured to the VPC user.
  • VTEP encapsulates the original request packet based on the VxLan protocol, and constructs a Vxlan packet.
  • the header of the Vxlan packet carries the external source address (the internal IP address of the private network of VTEP 10.10.10.11), the external destination address (the internal IP address of the private network of SLB 10.10.10.100), the virtual network identifier 1111111, and the internal source address (VPC virtual machine).
  • the IP address in the VPC network is 192.168.1.100), and the internal destination address (the IP address of the cloud server configured to the user is 100.64.10.10).
  • VTEP will send the request packet to the SLB.
  • the s4 and the SLB parse the request packet.
  • the request packet is converted from the VxLAN format to the VLAN format.
  • the SLB parses the original request packet from it, and modifies the source IP in the original request packet to the IP address of the SLB itself (10.10.10.100), and the destination IP address to the IP address of the cloud server (10.10.10.101).
  • the content of the data packet in the original request packet remains unchanged, forming a forwarding request packet, and sending the forwarding request packet to the cloud server.
  • S5 sends a forwarding request packet to the cloud server.
  • the cloud server After obtaining the request packet forwarded by the SLB, the cloud server processes the data in the data packet accordingly, and generates an original response packet.
  • the SLB After receiving the original response packet sent by the cloud server, the SLB parses the original response packet.
  • the response packet is converted from the VLAN format to the VxLAN format.
  • the SLB modifies the address content
  • the source IP in the original response packet is modified to the IP address of the cloud server (100.64.10.10)
  • the destination IP is modified to the IP address of the VPC virtual machine.
  • the address (192.168.1.100) the data packet in the original response packet remains unchanged, forming a forwarding response packet.
  • the forwarding response packet is encapsulated together with information such as the virtual network identifier VNI (1111111) to obtain a VxLan packet.
  • the header of the Vxlan packet carries an external source address (the private network internal IP address of the SLB 10.10.10.100), and the external destination address (VTEP)
  • the internal IP address of the private network is 10.10.10.11)
  • the virtual network ID is 1111111
  • the internal source address the IP address of the cloud server configured to the user is 100.64.10.10
  • the internal destination address the IP address of the VPC virtual machine in the VPC network is 192.168.1.100).
  • the SLB sends the forwarding response packet to the VTEP.
  • the VTEP After receiving the encapsulated forwarding response packet, the VTEP decapsulates the packet, and determines the VPC virtual machine according to the VNI and the destination IP obtained after the decapsulation.
  • S11 and VTEP send the response packet obtained by decapsulation to the VPC virtual machine to implement the interaction process between the entire application server and the cloud server.
  • the embodiment of the present solution further provides a method flow provided by the VPC sending end, an SLB, and a cloud encryption machine as an interactive device, as shown in FIG. 17 .
  • the VPC sender includes: a VPC virtual machine and a VTEP. It can be understood that the three-party interaction process is applicable to the interaction between any VPC sender, any SLB, and any cloud encryption machine.
  • the IP of the VPC virtual machine is 192.168.1.100.
  • the IP address of the TEP is 10.10.10.11, and the corresponding virtual network ID is 1111111.
  • the IP address of the SLB is 10.10.10.100.
  • the actual IP address of the cloud encryption machine is 10.10.10.101, and the IP address configured for the VPC user is 100.64.10.10.
  • the TTL server sends the original to-be-encrypted request packet to request the encryption service from the cloud encryption machine.
  • the source IP in the original to-be-encrypted request packet is the IP address (192.168.1.100) of the VPC virtual machine in the VPC sender, and the destination IP is the private network internal IP address of the cloud encryption machine pre-configured to the VPC user (100.64. 10.10).
  • VTEP encapsulates the original to-be-encrypted request packet based on the VxLan protocol, and constructs a Vxlan packet.
  • the header of the Vxlan packet carries the external source address (the internal IP address of the private network of VTEP 10.10.10.11), the external destination address (the internal IP address of the private network of SLB 10.10.10.100), the virtual network identifier 1111111, and the internal source address (VPC virtual machine).
  • the IP address in the VPC network is 192.168.1.100), and the internal destination address (the IP address of the cloud encryption machine configured to the user is 100.64.10.10).
  • VTEP sends the request packet to be encrypted to the SLB.
  • the t4 and the SLB parse the data packet.
  • the request packet to be encrypted is converted into a VLAN format by the VxLAN format.
  • the SLB parses the original to-be-encrypted request packet, and modifies the source IP in the original to-be-encrypted request packet to the IP address of the SLB itself (10.10.10.100), and changes the destination IP address to the IP address of the cloud encryption machine. (10.10.10.101), the content of the data packet in the original to-be-encrypted request packet remains unchanged, forming a forwarding packet to be encrypted, and transmitting the to-be-encrypted request forwarding packet to the cloud encryption machine.
  • the SLB sends a request packet to be encrypted to the cloud encryption machine.
  • the cloud encryption device After receiving the to-be-encrypted request forwarding packet forwarded by the SLB, the cloud encryption device performs corresponding encryption processing on the data in the data packet, and generates an original encrypted packet.
  • T7 Send the original encrypted packet to the SLB according to the internal IP address of the SLB's own private network.
  • t8 and SLB After t8 and SLB receive the original encrypted packet sent by the cloud encryption machine, they are parsed. Convert the original encrypted packet from VLAN format to VxLAN format.
  • the SLB modifies the address content
  • the source IP in the original encrypted packet is modified to the IP address of the cloud encryption machine (100.64.10.10), and the destination IP is modified to the IP address of the VPC virtual machine (192.168.1.100).
  • the packets in the original encrypted packet remain unchanged, forming a forward encrypted packet.
  • the forwarding encryption packet is encapsulated together with information such as the virtual network identifier VNI (1111111) to obtain a VxLan packet.
  • the header of the Vxlan packet carries an external source address (the internal IP address of the SLB private network 10.10.10.100), and the external destination address (VTEP)
  • the internal IP address of the private network is 10.10.10.11)
  • the virtual network identifier is 1111111
  • the internal source address the IP address of the cloud encryption machine configured to the user is 100.64.10.10
  • the internal destination address the IP address of the VPC virtual machine in the VPC network is 192.168. 1.100).
  • SLB sends the encrypted data forwarding packet to the VTEP.
  • the VTEP After receiving the encapsulated encrypted data forwarding packet, the VTEP decapsulates the encapsulated packet, and determines the VPC virtual machine according to the VNI and the destination IP obtained after the decapsulation.
  • T11 and VTEP send the decapsulated encrypted data packet to the VPC virtual machine to implement the interaction process between the entire application server and the cloud encryption machine.
  • t1 to t11 are only one example for the encryption process, and the implementation flow for other services can also refer to the steps described herein.
  • the embodiment of the present solution further provides a network device, which is used to implement the foregoing method processes, and
  • the composition is shown in Figure 18 and includes:
  • the receiving unit 71 is configured to receive the first packet sent by the user of the virtual private network, where the first destination address carried by the first packet is a specified address, and the specified address does not belong to the virtual private network where the virtual private network user is located.
  • the configured address range is configured to be
  • the converting unit 72 is configured to perform address translation on the first destination address to obtain a second destination address.
  • the generating unit 73 is configured to generate a second packet according to the second destination address and the first packet.
  • the sending unit 74 is configured to send the second packet to the outside of the virtual private network where the virtual private network user is located.
  • the converting unit 72 is specifically configured to parse the first packet to obtain an internal destination address and a virtual network identifier, determine the first destination address according to the internal destination address, and, according to the Determining, by the virtual network identifier, network identifier information of the virtual private network where the virtual private network user is located; searching, in the pre-configured address mapping table, a destination address corresponding to the first destination address and the network identifier information; When the destination address corresponding to the first destination address and the network identifier information is found, the found destination address is determined as the second destination address.
  • the generating unit 73 is configured to: when the first packet conforms to the first format, convert the first format into the second format; according to the second format, The packet information carried in the first packet and the second destination address are encapsulated to obtain the second packet.
  • the generating unit 73 is configured to: replace, by the first packet, the first header information that conforms to the first format with the second header information that meets the second format, where the first The header information includes at least an internal source address, an internal destination address, a virtual network identifier, an external source address, and an external destination address; the second header information includes at least a source address and a destination address; and the second header information and the packet are The information is encapsulated to obtain the second packet; the source address carried in the second header information is an address of the network device, and the carried destination address is the second destination address.
  • the sending unit 74 is specifically configured to determine, according to the second destination address and a routing table, a next hop device, where the next hop device is located outside the virtual private network where the virtual private network user is located; Sending the second packet to the next hop device.
  • the specified address does not belong to a configured address range of the specified network.
  • the specified address belongs to an address range of 100.64.0.0 to 100.64.0.10.
  • the virtual private network is a VPC network.
  • the first format is a VXLAN format
  • the second format is a VLAN format
  • a network device is also provided in the embodiment of the present solution, and the composition thereof is as shown in FIG. 19, and includes:
  • the receiving unit 81 is configured to receive the first packet sent by the user in the first type of network, where the first destination address carried by the first packet is a specified address in the second type network, and the specified address does not belong to the The address range of the first type of network has been configured, and it does not belong to the configured address range of the third type network;
  • the converting unit 82 is configured to perform address translation on the first destination address to obtain a second destination address.
  • the generating unit 83 is configured to generate a second packet according to the second destination address and the first packet.
  • the sending unit 84 is configured to send the second packet to the second type network.
  • the embodiment of the present solution further provides a network device, which is composed as shown in FIG. 20, and includes:
  • the receiving unit 91 is configured to receive a first packet sent by the network device, where the first packet carries a first source address.
  • the converting unit 92 is configured to perform address translation on the first source address to obtain a second source address, where the second source address is a specified address, and the specified address does not belong to a virtual private network where the virtual private network user is located. Address range.
  • the generating unit 93 is configured to generate a second packet according to the second source address and the first packet.
  • the sending unit 94 is configured to send the second packet to the inside of the virtual private network where the virtual private network user is located.
  • the converting unit 92 is further configured to parse the first packet to obtain the first source address, and search for a first source address in the pre-configured address mapping table.
  • Source address when the source address corresponding to the first source address is found, the found source address is determined as the second source address.
  • the generating unit 93 is specifically configured to convert the first format into the second format when the first packet conforms to the first format, and according to the second format, The packet information carried in the first packet is encapsulated with the second source address to obtain the second packet.
  • the generating unit 93 is further configured to: replace, by the first packet, the first header information that meets the first format in the first packet with the second header information that meets the second format.
  • the information includes at least a source address and a destination address;
  • the second header information includes at least an internal source address, an internal destination address, a virtual network identifier, an external source address, and an external destination address;
  • the second packet header information and the packet information are encapsulated to obtain the second packet;
  • the source address carried in the second header information is an address of the network device, and the carried destination address is the second address. Destination address.
  • the specified address does not belong to a configured address range of the specified network.
  • the specified address belongs to an address range of 100.64.0.0 to 100.64.0.10.
  • the virtual private network is a VPC network.
  • the first format is a VLAN format
  • the second format is a VXLAN format
  • the embodiment of the present solution further provides a network device, as shown in FIG. 21, including:
  • the receiving unit 1001 is configured to receive a first packet sent by a device in the second type of network, where the first packet carries a first source address.
  • the converting unit 1002 is configured to perform address translation on the first destination address to obtain a second source address, where the second source address is a specified address in the second type network, where the specified address does not belong to the virtual private network user.
  • the generating unit 1003 is configured to generate a second packet according to the second destination address and the first packet.
  • the sending unit 1004 is configured to send the second packet to the inside of the virtual private network where the virtual private network user is located.
  • the network device for data transmission provided by the embodiment of the present invention enables a user in the virtual private network to obtain a service provided by the corresponding server only by providing a private network for providing the service service, so that the user inside the virtual private network does not Traffic needs to be saved for users by accessing other networks than the private network to obtain services.
  • the embodiment of the present solution further provides a possible implementation manner, as shown in FIG. 22, which is a simplified block diagram of the network device 110.
  • the network device 110 can include a processor 1101 coupled to one or more data storage tools, which can include a storage medium 1102 and a memory unit 1103.
  • Network device 110 may also include an input interface 1104 and an output interface 1105 for communicating with another device or system.
  • the program code executed by the CPU of the processor 1101 can be stored in the memory unit 1102 or the storage medium 1103.
  • the processor 1101 in the network device 110 invokes the above program code to perform the subordinate steps:
  • the processor 1101 is configured to receive, by using the input interface 1104, a first packet sent by a user of the virtual private network, where the first destination address carried by the first packet is a specified address, and the specified address does not belong to the The address range of the virtual private network where the virtual private network user is located; performing address translation on the first destination address to obtain a second destination address; generating a second report according to the second destination address and the first packet And sending, by the output interface 1105, the second packet to the outside of the virtual private network where the virtual private network user is located.
  • the processor 1101 is further configured to: parse the first packet to obtain an internal destination address and a virtual network identifier; determine the first destination address according to the internal destination address, and, Determining, according to the virtual network identifier, network identifier information of the virtual private network where the virtual private network user is located; searching, in the pre-configured address mapping table, a destination address that corresponds to the first destination address and the network identifier information; When the destination address corresponding to the first destination address and the network identifier information is found, the found destination address is determined as the second destination address.
  • the processor 1101 is further configured to: when the first packet conforms to the first format, convert the first format into the second format; according to the second format, First report Encapsulating the packet information carried in the text and the second destination address to obtain the second packet.
  • the processor 1101 is further configured to replace the first header information in the first packet that conforms to the first format with the second header information that conforms to the second format, where the first header is The information includes at least an internal source address, an internal destination address, a virtual network identifier, an external source address, and an external destination address; the second header information includes at least a source address and a destination address; and the second header information and the packet information Encapsulating, obtaining the second packet; the source address carried in the second header information is an address of the network device, and the carried destination address is the second destination address.
  • the processor 1101 is further configured to determine, according to the second destination address and a routing table, a next hop device, where the next hop device is located outside the virtual private network where the virtual private network user is located; And transmitting, by the output interface 1105, the second packet to the next hop device.
  • the specified address does not belong to a configured address range of the specified network.
  • the specified address belongs to an address range of 100.64.0.0 to 100.64.0.10.
  • the virtual private network is a VPC network.
  • the first format is a VXLAN format
  • the second format is a VLAN format
  • the processor 1101 is further configured to receive, by using the input interface 1104, a first packet sent by a user in the first type of network, where the first destination carried by the first packet
  • the address is a specified address in the network of the second type, the specified address does not belong to the configured address range of the first type network, and does not belong to the configured address range of the third type network; Performing address translation to obtain a second destination address; generating a second packet according to the second destination address and the first packet; and using the output interface 1105
  • the second message is sent to the second type of network.
  • the processor 1101 is further configured to receive, by using the input interface 1104, a first packet sent by the network device, where the first packet carries a first source address, and the first source address is configured. Performing address translation to obtain a second source address; the second source address is a specified address, and the specified address does not belong to a configured address range of the virtual private network where the virtual private network user is located; according to the second source address and the The first packet generates a second packet, and the second packet is sent to the virtual private network where the virtual private network user is located through the output interface 1105.
  • the processor 1101 is further configured to parse the first packet to obtain the first source address, and search for a first source address corresponding to the first source address in a pre-configured address mapping table. a source address; when the source address corresponding to the first source address is found, determining the found source address as the second source address.
  • the processor 1101 is further configured to: when the first packet conforms to the first format, convert the first format into the second format; according to the second format, The packet information carried in the first packet and the second source address are encapsulated to obtain the second packet.
  • the processor 1101 is further configured to replace the first header information in the first packet that conforms to the first format with the second header information that conforms to the second format, where the first packet header
  • the information includes at least a source address and a destination address;
  • the second header information includes at least an internal source address, an internal destination address, a virtual network identifier, an external source address, and an external destination address;
  • the second header information and the packet information Encapsulating, obtaining the second packet;
  • the source address carried in the second header information is an address of the network device, and the carried destination address is the second destination address.
  • the specified address does not belong to a configured address range of the specified network.
  • the specified address belongs to an address range of 100.64.0.0 to 100.64.0.10.
  • the virtual private network is a VPC network.
  • the first format is a VLAN format
  • the second format is a VXLAN format
  • the processor 1101 is further configured to receive, by using the input interface 1104, a first packet sent by a device in a second type of network, where the first packet carries a first source. Addressing: performing address translation on the first destination address to obtain a second source address; the second source address is a specified address in the second type of network, and the specified address does not belong to the virtual private network where the virtual private network user is located.
  • the configured address range is generated according to the second destination address and the first packet, and the second packet is sent to the virtual private user of the virtual private network by using the output interface 1105. Sended internally by the network.
  • the network device for data transmission provided by the embodiment of the present invention enables a user in the virtual private network to obtain a service provided by the corresponding server only by providing a private network for providing the service service, so that the user inside the virtual private network does not Traffic needs to be saved for users by accessing other networks than the private network to obtain services.
  • the storage medium may be a read-only memory (ROM), or may be readable and writable, such as a hard disk or a flash memory.
  • the memory unit can be a random access memory (RAM).
  • the memory unit can be physically integrated with the processor or integrated in memory or built as a separate unit.
  • the processor is a control center of the above device (the device is the server or the client), and provides processing means for executing instructions, performing an interrupt operation, providing a timing function, and A variety of other features.
  • the processor includes one or more central processing units (CPUs), such as CPU 0 and CPU 1 shown in FIG.
  • the above device includes one or more processors.
  • the processor can be a single core (single CPU) processor or a multi-core (multi-CPU) processor.
  • a component such as a processor or memory, which is described as being used to perform a task, can be implemented as a general-purpose component that is temporarily used to perform a task at a given time or as a specific component that is specifically designed to perform the task.
  • the term "processor,” as used herein, refers to one or more devices, circuits, and/or processing cores for processing data, such as computer program instructions.
  • Program code executed by the CPU of the processor may be stored in a memory unit or a storage medium. Alternatively, the program code stored in the storage medium may be copied into the memory unit for execution by the CPU of the processor.
  • the processor can execute at least one core (eg, LINUXTM, UNIXTM, WINDOWSTM, ANDROIDTM, IOSTM), which is known to be controlled by controlling the execution of other programs or processes, controlling communication with peripheral devices, and controlling the use of computer device resources. The operation of the above equipment.

Abstract

本方案实施例提供了一种数据传输的方法,应用于通信技术领域。该方法通过对提供服务的服务器地址进行特定设置,使得虚拟私有网络内的用户只需能够提供业务服务的私有网络,就能够获取各项由相应服务器提供的服务,使得虚拟私有网络内部的用户不需要通过访问除私有网络外的其它网络来获取服务,从而为用户节省了流量。

Description

一种数据传输的方法及网络设备 技术领域
本方案涉及通信领域,尤其涉及一种数据传输的方法及网络设备。
背景技术
在VPC(virtual private cloud,虚拟私有云)网络中,每个用户的在网络内的地址是可以在相关规范内的地址范围进行自定义设置。由于VPC内的地址空间由用户自由规划、地址资源由用户自由控制,因此,云服务提供商都会避免通过占用VPC内的网络地址来随便侵入用户在VPC内的地址空间。这样的话,云服务提供商无法通过在VPC网络内部设置一个统一的IP地址为用户提供某种服务,特别是基础服务如NTP(Network Time Protocol,网络时间协议)。
目前为了提供前述各个基础服务时,服务器提供商一般会要求用户通过访问指定的公网地址来获取各项基础服务。这种方案存在如下问题:需要用户自行购买公网地址,同时承担各项公网流量的费用。
发明内容
本方案的目的在于提供一种数据传输的方法及网络设备,能够在一定程度上避免用户使用公网流量获取私有网络提供的服务。
第一方面,本方案实施例提供了一种数据传输的方法,包括:
接收虚拟私有网络用户发送的第一报文,所述第一报文携带的第一目的地址为指定地址,所述指定地址不属于所述虚拟私有网络用户所在虚拟私有网络已配置的地址范围;
对所述第一目的地址进行地址转换,得到第二目的地址;
根据所述第二目的地址以及所述第一报文,生成第二报文;
将所述第二报文向与所述虚拟私有网络用户所在虚拟私有网络外部发送。
如上所述的方面和任一可能的实现方式,进一步提供一种实现方式,所述对所述第一目的地址进行地址转换,得到第二目的地址包括:
对所述第一报文进行解析,得到内部目的地址和虚拟网络标识;
根据所述内部目的地址,确定所述第一目的地址,以及,根据所述虚拟网络标识确定所述虚拟私有网络用户所在虚拟私有网络的网络标识信息;
在预配置的地址映射表中查找与所述第一目的地址以及所述网络标识信息共同对应的目的地址;
当查找到与所述第一目的地址以及所述网络标识信息共同对应的目的地址时,则将查找到的目的地址确定为所述第二目的地址。
如上所述的方面和任一可能的实现方式,进一步提供一种实现方式,所述根据所述第二目的地址以及所述第一报文,生成第二报文包括:
当所述第一报文符合第一格式时,将所述第一格式转化为所述第二格式;
按照所述第二格式,将所述第一报文携带的报文信息和所述第二目的地址进行封装,得到所述第二报文。
如上所述的方面和任一可能的实现方式,进一步提供一种实现方式,所述当所述第一报文符合第一格式时,将所述第一格式转化为所述第二格式包括:
将所述第一报文中符合第一格式的第一报头信息替换为符合第二格式的第二包头信息;其中,所述第一报头信息至少包括内部源地址、内部目的地址、虚拟网络标识、外部源地址和外部目的地址;所述第二包头信息至少包括源地址和目的地址;
则所述按照所述第二格式,将所述第一报文携带的报文信息和所述第二目的地址进行封装,得到所述第二报文包括:
将所述第二包头信息和所述报文信息进行封装,得到所述第二报文;所述第二包头信息中携带的源地址为所述网络设备的地址,携带的目的地址为所述第二目的地址。
如上所述的方面和任一可能的实现方式,进一步提供一种实现方式,所述将所述第二报文向与所述虚拟私有网络用户所在虚拟私有网络外部发送包括:
根据所述第二目的地址以及路由表,确定下一跳设备,所述下一跳设备位于所述虚拟私有网络用户所在虚拟私有网络外部;
将所述第二报文向所述下一跳设备发送。
如上所述的方面和任一可能的实现方式,进一步提供一种实现方式,所述指定地址不属于指定网络已配置的地址范围。
如上所述的方面和任一可能的实现方式,进一步提供一种实现方式,所述指定地址属于100.64.0.0至100.64.0.10的地址范围中。
如上所述的方面和任一可能的实现方式,进一步提供一种实现方式,所述虚拟私有网络为VPC网络。
如上所述的方面和任一可能的实现方式,进一步提供一种实现方式, 所述第一格式为VXLAN格式,所述第二格式为VLAN格式。
如上所述的方面和任一可能的实现方式,进一步提供一种实现方式,所述第一目的地址和所述第二目的地址对应于同一服务器。
如上所述的方面和任一可能的实现方式,进一步提供一种实现方式,所述服务器为NTP服务器或加密服务器。
第二方面,本方案实施例还提供了一种数据传输的方法,包括:
接收第一类网络内用户发送的第一报文,所述第一报文携带的第一目的地址为第二类网络内的指定地址,所述指定地址不属于所述第一类网络已配置的地址范围,同时也不属于第三类网络已配置的地址范围;
对所述第一目的地址进行地址转换,得到第二目的地址;
根据所述第二目的地址以及所述第一报文,生成第二报文;
将所述第二报文向与第二类网络发送。
第三方面,本方案实施例还提供了一种数据传输的方法,包括:
接收网络设备发送的第一报文,所述第一报文携带有第一源地址;
对所述第一源地址进行地址转换,得到第二源地址;所述第二源地址为指定地址,所述指定地址不属于虚拟私有网络用户所在虚拟私有网络已配置的地址范围;
根据所述第二源地址以及所述第一报文,生成第二报文;
将所述第二报文向与所述虚拟私有网络用户所在虚拟私有网络内部发送。
如上所述的方面和任一可能的实现方式,进一步提供一种实现方式,所述对所述第一源地址进行地址转换,得到第二源地址包括:
对所述第一报文进行解析,得到所述第一源地址;
在预配置的地址映射表中查找与所述第一源地址对应的源地址;
当查找到与所述第一源地址对应的源地址时,则将查找到的源地址确定为所述第二源地址。
如上所述的方面和任一可能的实现方式,进一步提供一种实现方式,所述根据所述第二源地址以及所述第一报文,生成第二报文包括:
当所述第一报文符合第一格式时,将所述第一格式转化为所述第二格式;
按照所述第二格式,将所述第一报文携带的报文信息和所述第二源地址进行封装,得到所述第二报文。
如上所述的方面和任一可能的实现方式,进一步提供一种实现方式,所述当所述第一报文符合第一格式时,将所述第一格式转化为所述第二格式包括:
将所述第一报文中符合第一格式的第一报头信息替换为符合第二格式的第二包头信息;其中,所述第一包头信息至少包括源地址和目的地址;所述第二报头信息至少包括内部源地址、内部目的地址、虚拟网络标识、外部源地址和外部目的地址;
则所述按照所述第二格式,将所述第一报文携带的报文信息和所述第二目的地址进行封装,得到所述第二报文包括:
将所述第二包头信息和所述报文信息进行封装,得到所述第二报文;所述第二包头信息中携带的源地址为所述网络设备的地址,携带的目的地址为所述第二目的地址。
如上所述的方面和任一可能的实现方式,进一步提供一种实现方式,所述指定地址不属于指定网络已配置的地址范围。
如上所述的方面和任一可能的实现方式,进一步提供一种实现方式,所述指定地址属于100.64.0.0至100.64.0.10的地址范围中。
如上所述的方面和任一可能的实现方式,进一步提供一种实现方式,所述虚拟私有网络为VPC网络。
如上所述的方面和任一可能的实现方式,进一步提供一种实现方式,所述第一格式为VLAN格式,所述第二格式为VXLAN格式。
如上所述的方面和任一可能的实现方式,进一步提供一种实现方式,所述第一源地址和所述第二源地址对应于同一服务器。
如上所述的方面和任一可能的实现方式,进一步提供一种实现方式,所述服务器为NTP服务器或加密服务器。
第四方面,本方案实施例还提供了一种数据传输的方法,包括:
接收第二类网络内设备发送的第一报文,所述第一报文携带有第一源地址;
对所述第一目的地址进行地址转换,得到第二源地址;所述第二源地址为第二类网络内的指定地址,所述指定地址不属于虚拟私有网络用户所在虚拟私有网络已配置的地址范围;
根据所述第二目的地址以及所述第一报文,生成第二报文;
将所述第二报文向与所述虚拟私有网络用户所在虚拟私有网络内部发送。
第五方面,本方案实施例还提供了一种网络设备,包括:
接收单元,用于接收虚拟私有网络用户发送的第一报文,所述第一报文携带的第一目的地址为指定地址,所述指定地址不属于所述虚拟私有网络用户所在虚拟私有网络已配置的地址范围;
转换单元,用于对所述第一目的地址进行地址转换,得到第二目的地址;
生成单元,用于根据所述第二目的地址以及所述第一报文,生成第二报文;
发送单元,用于将所述第二报文向与所述虚拟私有网络用户所在虚拟私有网络外部发送。
第六方面,本方案实施例还提供了一种网络设备,包括:
接收单元,用于接收第一类网络内用户发送的第一报文,所述第一报文携带的第一目的地址为第二类网络内的指定地址,所述指定地址不属于所述第一类网络已配置的地址范围,同时也不属于第三类网络已配置的地址范围;
转换单元,用于对所述第一目的地址进行地址转换,得到第二目的地址;
生成单元,用于根据所述第二目的地址以及所述第一报文,生成第二报文;
发送单元,用于将所述第二报文向与第二类网络发送。
第七方面,本方案实施例还提供了一种网络设备,包括:
接收单元,用于接收网络设备发送的第一报文,所述第一报文携带有第一源地址;
转换单元,用于对所述第一源地址进行地址转换,得到第二源地址;所述第二源地址为指定地址,所述指定地址不属于虚拟私有网络用户所在虚拟私有网络已配置的地址范围;
生成单元,用于根据所述第二源地址以及所述第一报文,生成第二报文;
发送单元,用于将所述第二报文向与所述虚拟私有网络用户所在虚拟私有网络内部发送。
第八方面,本方案实施例还提供了一种网络设备,包括:
接收单元,用于接收第二类网络内设备发送的第一报文,所述第一报文携带有第一源地址;
转换单元,用于对所述第一目的地址进行地址转换,得到第二源地址;所述第二源地址为第二类网络内的指定地址,所述指定地址不属于虚拟私有网络用户所在虚拟私有网络已配置的地址范围;
生成单元,用于根据所述第二目的地址以及所述第一报文,生成第二报文;
发送单元,用于将所述第二报文向与所述虚拟私有网络用户所在虚拟私有网络内部发送。
本方案实施例所提供的数据传输的方法及网络设备,使得虚拟私有网络内的用户只需能够提供业务服务的私有网络,就能够获取各项由相应服务器提供的服务,使得虚拟私有网络内部的用户不需要通过访问除私有网络外的其它网络来获取服务,从而为用户节省了流量。
附图说明
为了更清楚地说明本方案实施例的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本方案的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其它的附图。
图1为本方案实施例提供的一种网络架构示意图;
图2为本方案实施例提供的一种数据传输的基本原理图;
图3为本方案实施例提供的一种数据传输的方法流程图;
图4为本方案实施例提供的另一种数据传输的方法流程图;
图5为本方案实施例提供的另一种数据传输的方法流程图;
图6为本方案实施例提供的另一种数据传输的方法流程图;
图7为本方案实施例提供的另一种数据传输的方法流程图;
图8为本方案实施例提供的另一种数据传输的方法流程图;
图9为本方案实施例提供的另一种数据传输的方法流程图;
图10为本方案实施例提供的另一种数据传输的方法流程图;
图11为本方案实施例提供的另一种数据传输的方法流程图;
图12为本方案实施例提供的在具体场景下进行数据传输的方法流程示意图;
图13为本方案实施例提供的在具体场景下进行数据传输的方法流程示意图;
图14为本方案实施例提供的一种数据传输的基本原理图;
图15为本方案实施例提供的另一种数据传输的基本原理图;
图16为本方案实施例提供的一种数据传输的流程示意图;
图17为本方案实施例提供的基于加密服务实现的一种数据传输的流程示意图;
图18为本方案实施例提供的一种用于数据传输的网络设备的组成框图;
图19为本方案实施例提供的一种用于数据传输的网络设备的组成框图;
图20为本方案实施例提供的一种用于数据传输的网络设备的组成框图;
图21为本方案实施例提供的一种用于数据传输的网络设备的组成框图;
图22为本方案实施例提供的一种用于数据传输的网络设备的组成框图。
具体实施方式
以下结合附图对本方案的原理和特征进行描述,所举实施例只用于解释本方案,并非用于限定本方案的范围。对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,根据本方案精神所获得的所有实施例,都属于本方案的保护范围。
本方案实施例适用于多种类型网络共同组建的系统架构中。在该系统架构中,各类型网络搭建时没有明确的干预关系,可以独立设置其内部的网络地址。每种类型的网络之间可通过地址转换设备衔接。
由虚拟私有网络(例如,VPC等)、私有网络(例如,按照覆盖范围可以分为局域网和广域网等,按照实际搭建场景可以分为机房、服务器群 组、企业级内网等)及公用网络(例如,Internet等)三类网络搭建的系统架构如图1所示,各个类型网络之间通过网关进行通信,各个网关一般配置有地址转换及路由转发等功能。基于前述如图1所示架构,其可实现的基本通信流程可如图2所示,包括:
步骤1:虚拟私有网络内部的用户发起初始的请求报文,并将该请求报文发送至该虚拟私有网络的网关。
值得说明的是,在虚拟私用网络内部,根据实际网络配置需要,还可以为用户提供用于报文转发、封装与解封装等功能的转发设备,例如VTEP(VXLAN隧道终端,VXLAN Tunneling End Point)。由该转发设备代理用户与虚拟私用网络外部进行通信。
步骤2:该在网关所连接的虚拟私有网络和前述私有网络之间使用不同的报文格式时,网关需要对接收到的请求报文进行格式转换,以适应私有网络中的传输格式。
步骤3:该网关进行格式转换的同时,还需要根据请求报文中的目的地址查找目的设备在私有网络中的实际地址。
步骤4:该网关依据实际地址和请求报文的请求内容,按照适合私有网络中的传输格式进行封装。
步骤5:该网关将封装后的报文按照路由中规划的路径进行转发。
私有网络中的目的设备在接收到该请求报文后会根据请求内容进行相应处理,同时将处理结果返回给该用户。该返回流程属于前述步骤1至5的逆过程,在此不再赘述了。
基于前述描述,本方案实施例提供了一种数据传输的方法,适用于虚 拟私有网络与私有网络之间的网络设备上,该网络设备可以是网关、SLB(Server Load Balancing,服务器负载均衡)等,该方法流程如图3所示,包括:
101、接收虚拟私有网络用户发送的第一报文,所述第一报文携带的第一目的地址为指定地址。
其中,第一目的地址为根据实际情况配置给虚拟私有网络内用户的服务器地址,一般与服务器在私有网络中的实际网络地址不相同。
其中,所述指定地址不属于所述虚拟私有网络用户所在虚拟私有网络已配置的地址范围。此处提到的指定地址可理解为是归属于前述私有网络中的网络地址,为避免需要用户自行购买包括公网在内的除私有网络外的其它网络中的地址,同时承担各项网络流量的费用的问题出现,可将该指定地址配置为提供相应基础性服务(例如,NTP,加密服务等)的服务器(例如,NTP服务器或加密服务器)地址。进一步补充说明的是,若业务网络还连接于其它私有网络且可以与其它私有网络进行通信,则需要避免用户的对于前述各类基础性服务的访问流量流向其它私有网络,因此,此时也可以同时要求指定地址不属于其它私有网络某一或多个指定网络已配置的地址范围。
相应的,第一报文可以理解为是用于获取基础性服务的请求报文。由于该报文内携带的目的地址不属于虚拟私有网络内部的地址范围,因此,该报文会经由网关流向虚拟私有网络外部的网络中(在图1所示的架构中,第一报文会由虚拟私有网络流向私有网络中)。
当然,本方案实施例对于第一报文和指定地址的用途不作限定,二者 的用途也可以是为用户提供其它业务服务。
102、对所述第一目的地址进行地址转换,得到第二目的地址。
第二目的地址为与第一目的地址相对应,用于指示服务器在私有网络中的实际网络地址,因此第二目的地址和第一目的地址对应于同一服务器。
103、根据所述第二目的地址以及所述第一报文,生成第二报文。
由于目的地址发生变化,因此需要对第一报文的内容重新进行格式转换或重新打包等操作,以生成第二报文。
104、将所述第二报文向与所述虚拟私有网络用户所在虚拟私有网络外部发送。
本方案实施例所提供的数据传输的方法,使得虚拟私有网络内的用户只需能够提供业务服务的私有网络,就能够获取各项由相应服务器提供的服务,使得虚拟私有网络内部的用户不需要通过访问除私有网络外的其它网络来获取服务,从而为用户节省了流量。
由于本发明实施例中对于指定地址的独立设置,因此需要在前述网络设备中配置地址映射表,以存储指定地址和该指定地址所指向的服务器在私有网络中的实际地址之间的对应关系。结合该地址映射表的配置,本发明实施例针对如何从第一目的地址到第二目的地址进行转换提供了相应的实现流程,即前述步骤102的具体实现流程,如图4所示,包括:
1021、对所述第一报文进行解析,得到内部目的地址和虚拟网络标识。
其中,虚拟网络标识即用户所在的虚拟私有网络的标识信息,用于区分不同的虚拟私有网络。
1022、根据所述内部目的地址,确定所述第一目的地址,以及,根据 所述虚拟网络标识确定所述虚拟私有网络用户所在虚拟私有网络的网络标识信息。
1023、在预配置的地址映射表中查找与所述第一目的地址以及所述网络标识信息共同对应的目的地址。
由于并不是所有用户都有权使用基础性服务,因此,在查找该目的地址的过程中引入虚拟网络标识,其目的是为了区分不同类型的用户。当然这只是一个示例,在其它可能的实现方式中也可以处于其它目的来引入该虚拟网络标识,本方案实施例对此不作限定。
1024、当查找到与所述第一目的地址以及所述网络标识信息共同对应的目的地址时,则将查找到的目的地址确定为所述第二目的地址。
目前,私有网络中常用的IPv4地址范围包括10.0.0.0至10.255.255.255,172.16.0.0至172.31.255.255以及192.168.0.0至192.168.255.255。因此,此处提到的第二目的地址可以从这三段中选择。而针对目前IPv4地址范围的分配情况来说,在本方案实施例中,指定地址可以从100.64.0.0至100.64.0.10的地址范围中选择。该地址范围通常使用在私有网络中,同时一般不会被配置在除私有网络的其它网络上。
因此,第一目的地址(即指定地址)和第二目的地址可以被分别配置为100.64.10.10和10.10.10.101。这样就需要在地址映射表中添加一条映射关系100.64.10.10和VNI<—>10.10.10.101。
由于在不同类型的网络可能会基于不同的通信协议进行配置,因此前文提到的第一报文和第二报文可能具有不同的报文格式。本方案实施例针对这样的情况提供了相应的解决方案,即前述步骤103的一种可能的实现 方式,可参照图5所示内容,包括:
1031、当所述第一报文符合第一格式时,将所述第一格式转化为所述第二格式。
1032、按照所述第二格式,将所述第一报文携带的报文信息和所述第二目的地址进行封装,得到所述第二报文。
此处描述的第一格式是指用户所在的虚拟私有网络所支持的报文格式,第二格式是指私有网络所支持的报文格式。例如,当虚拟私有网络为VPC时,则对应的第一格式一般应符合VXLANVXLAN((Virtual Extensible LAN虚拟可扩展局域网)。当私有网络为虚拟局域网时,则对应的第二格式一般应符合VLAN(Virtual LAN,虚拟局域网)。当不同网络类型存在不同报文格式的时候,可以配置相应的格式转换方法,本方案实施例对于不同网络是使用的报文格式不作具体限定。
VXLAN报文格式主要内容如下表1所示。
外部源IP 外部目的IP 虚拟网络标识 内部源IP 外部源IP 报文信息
例如,
10.10.10.11 10.10.10.100 1111111 192.168.1.100 100.64.10.10 abc
VLAN报文格式主要内容如下表2所示。
源地址 目的地址 报文信息
例如,
10.10.10.11 10.10.10.101 abc
以上示出的内容仅为相应报文的一部分内容,根据实际传输需要还可能设置有MAC地址等其它必要信息。
以前述VXLAN和VLAN报文格式为例,本方案实施例将在此具体描 述前述步骤1031和1032的实现过程,相关方法流程如图6所示,包括:
10311、将所述第一报文中符合第一格式(VXLAN)的第一报头信息替换为符合第二格式(VLAN)的第二包头信息。
由于所述第一报头信息会携带内部源地址、内部目的地址、虚拟网络标识、外部源地址和外部目的地址,而所述第二包头信息只需要包括源地址和目的地址即可,因此在该格式转变的过程中,将保留VXLAN报文内携带的内部源IP作为VLAN报文的源IP,同时保留VXLAN报文内携带的内部目的IP作为VLAN报文的目的IP。而VXLAN报文内的其它IP地址和虚拟网络标识则在格式转换的过程中不予保留。
10321、将所述第二包头信息和所述报文信息进行封装,得到所述第二报文。
在依照第二格式进行封装时,由于格式转换后得到的VLAN报文携带的源IP和目的IP只是配置给虚拟私有网络内部用户进行使用的地址,因此还需要将所述第二包头信息中携带的目的地址为所述第二目的地址,以便能够将报文传输至正确的目标设备,而携带的源地址为所述网络设备的地址,以便反馈报文可以由该网络设备正确接收到。
另外,为了实现对于前述第二报文正确且快速的转发,需要预先在虚拟私有网络与私有网络之间的网关上配置与前述第二目的地址相关的路由表,以便接收到向第二目的地址发送的报文时,可以直接进行转发,本方案实施例针对这样的情况提供了相应的解决方案,即前述步骤104的一种可能的实现方式,可参照图7所示内容,包括:
1041、根据所述第二目的地址以及路由表,确定下一跳设备。
由于第二目的地址为私有网络中的服务器地址,因此所述下一跳设备会位于所述虚拟私有网络用户所在虚拟私有网络外部。
此处提及的路由表一般需要进行预先配置,或由网关通过自学习完成配置。
1042、将所述第二报文向所述下一跳设备发送。
以上为流量从虚拟私有网络中的用户侧流向私有网络侧的步骤说明,以下将会描述从私有网络侧流向虚拟私有网络中的用户侧的步骤。
本方案实施例还提供了一种数据传输的方法,也可以适用于如图8所示架构中,该方法包括:
201、接收私有网络中的网络设备发送的第一报文,所述第一报文携带有第一源地址。
202、对所述第一源地址进行地址转换,得到第二源地址。
203、根据所述第二源地址以及所述第一报文,生成第二报文。
204、将所述第二报文向与所述虚拟私有网络用户所在虚拟私有网络内部发送。
步骤201至步骤204的实现流程可以理解为是与步骤101至步骤104所描述流程的逆向流程,例如,若步骤101至步骤104实现了用户向私有网络服务器请求基础性服务,那么步骤201至步骤204就实现了服务器对用户请求的答复流程。
因此,第一源地址与前述第二目的地址实际上是相同的,都用于表示服务器在私有网络中的实际网络地址,而第二源地址与前述第一目的地址(即前述指定地址)是相同的,都用于表示提供给虚拟私有网络内用户的 服务器地址。
此处需要补充说明的是,此处描述的第一报文和第二报文均为服务器侧下发至用户侧的报文,与前文描述的第一报文和第二报文并不相同。
由于本发明实施例中对于指定地址的独立设置,因此需要在前述网络设备中配置地址映射表,以存储指定地址和该指定地址所指向的服务器在私有网络中的实际地址之间的对应关系。结合该地址映射表的配置,本发明实施例针对如何从第一目的地址到第二目的地址进行转换提供了相应的实现流程,即前述步骤202的具体实现流程,如图9所示,包括:
2021、对所述第一报文进行解析,得到所述第一源地址。
2022、在预配置的地址映射表中查找与所述第一源地址对应的源地址。
2023、当查找到与所述第一源地址对应的源地址时,则将查找到的源地址确定为所述第二源地址。
与前述步骤1021至1024是互为逆向过程,其详细实现可参照于前,本方案实施例在此不再赘述。
由于在不同类型的网络可能会基于不同的通信协议进行配置,因此前文提到的第一报文和第二报文可能具有不同的报文格式。本方案实施例针对这样的情况提供了相应的解决方案,即前述步骤203的一种可能的实现方式,可参照图10所示内容,包括:
2031、当所述第一报文符合第一格式时,将所述第一格式转化为所述第二格式。
2032、按照所述第二格式,将所述第一报文携带的报文信息和所述第二目的地址进行封装,得到所述第二报文。
此处描述的第一格式是指私有网络所支持的报文格式,第二格式是指用户所在的虚拟私有网络所支持的报文格式。例如,当私有网络为虚拟局域网时,则对应的第一格式一般应符合VLAN。当虚拟私有网络为VPC时,则对应的第二格式一般应符合。
以前述VXLAN和VLAN报文格式为例,结合前述表1及表2,本方案实施例将在此具体描述前述步骤2031和2032的实现过程,相关方法流程如图11所示,包括:
20311、将所述第一报文中符合第一格式的第一报头信息替换为符合第二格式的第二包头信息。
其中,所述第一包头信息至少包括源地址和目的地址;所述第二报头信息至少包括内部源地址、内部目的地址、虚拟网络标识、外部源地址和外部目的地址。
20321、将所述第二包头信息和所述报文信息进行封装,得到所述第二报文。
所述第二包头信息中携带的源地址为所述网络设备的地址,携带的目的地址为所述第二目的地址。
步骤20311及20321其实现的流程可以理解为是步骤10311和10321的逆向过程,即将报文由VLAN格式向VXLAN格式进行转换和再封装。
以上为流量从私有网络侧流向虚拟私有网络中的用户侧的步骤描述,其实现流程可以理解为是流量从虚拟私有网络中的用户侧流向私有网络侧的步骤相对应的逆过程,因此对于网络类型、各类网络内的报文格式、指定地址限定、报文转发方法等内容可互相参照理解,在此就不作过多陈 述。
下文将结合示例来直观阐述前述流量从私有网络侧流向虚拟私有网络中的用户侧相关方法的实现过程,以及,流量从虚拟私有网络中的用户侧流向私有网络侧相关方法的实现过程。
在该示例中,存在两个不同的VPC,均支持VXLAN,VPC1111111和VPC222222,VPC111111内存在用户A,VPC222222内存在用户B。
用户A在VPC1111111内的源地址为192.168.1.100,对外源地址为10.10.10.11,虚拟网络标识为1111111。
用户A在VPC2222222内的源地址为192.168.1.100,对外源地址为10.10.10.10,虚拟网络标识为2222222。
VPC与私有网络(支持VLAN)之间的网关VPC-GW的网关地址为10.10.10.100。
NTP服务器通知给用户A和用户B的地址为100.64.10.10,在私有网络中的实际地址为10.10.10.101。
基于前述限定,流量从私有网络侧流向虚拟私有网络中的用户侧相关方法的实现过程参照图12所示报文转发流程,该流程包括:
301、用户A向VPC-GW发送的报文1和用户B向VPC-GW发送的报文2。
报文1的包头携带有外部源地址10.10.10.11,外部目的地址10.10.10.100,虚拟网络标识1111111,内部源地址192.168.1.100,内部目的地址100.64.10.10。
报文2的包头携带有外部源地址10.10.10.10,外部目的地址 10.10.10.100,虚拟网络标识222222,内部源地址192.168.1.100,内部目的地址100.64.10.10。
302、VPC-GW分别将接收到的报文1和报文2进行VXLAN格式到VLAN格式的转换,得到报文3和报文4。
报文3的包头携带有源地址10.10.10.11,目的地址10.10.10.101。
报文4的包头携带有源地址10.10.10.10,目的地址10.10.10.101。
303、VPC-GW将报文3和报文4根据路由表记载的路由信息向NTP服务器发送。
基于前述限定,流量从虚拟私有网络中的用户侧流向私有网络侧相关方法的实现过程,参照图13所示报文转发流程,该流程包括:
401、NTP服务器将应答报文3的报文5和应答报文4的报文6返回给VPC-GW。
报文5的包头携带有源地址10.10.10.101,目的地址10.10.10.11。
报文6的包头携带有源地址10.10.10.101,目的地址10.10.10.10。
402、VPC-GW接收到报文5和报文6后,VPC-GW分别将接收到的报文5和报文6进行VLAN格式到VXLAN格式的转换,得到报文7和报文8。
报文7的包头携带有外部源地址10.10.10.100,外部目的地址10.10.10.11,虚拟网络标识1111111,内部源地址100.64.10.10,内部目的地址192.168.1.100。
报文8的包头携带有外部源地址10.10.10.100,外部目的地址10.10.10.10,虚拟网络标识222222,内部源地址100.64.10.10,内部目的 地址192.168.1.100。
403、VPC-GW分别将报文7发送至用户A,以及,将报文8发送至用户B。
以上示例中对于各网络设备网络地址的设定、各网络支持的报文格式的选择,格式转换的前后结果均不作限定,只是示意性的说明,其它可适用的技术均可结合于此。
结合前述描述可以推断出,本方案实施例并不局限于虚拟私有网络、私有网络及公共网络的组网架构中,还可以适用于其它多种类型构成的网络架构中。因此,本方案实施例提供了一种数据传输的总设计方案,应用于某两个网络间的报文转发设备上。
适用于服务请求流程的方法如图14所示,包括:
501、接收第一类网络内用户发送的第一报文,所述第一报文携带的第一目的地址为第二类网络内的指定地址,所述指定地址不属于所述第一类网络已配置的地址范围,同时也不属于第三类网络已配置的地址范围。
502、对所述第一目的地址进行地址转换,得到第二目的地址。
503、根据所述第二目的地址以及所述第一报文,生成第二报文。
504、将所述第二报文向与第二类网络发送。
适用于服务请求应答流程的方法如图15所示,包括:
601、接收第二类网络内设备发送的第一报文,所述第一报文携带有第一源地址。
602、对所述第一源地址进行地址转换,得到第二源地址;所述第二源地址为第二类网络内的指定地址,所述指定地址不属于虚拟私有网络用户 所在虚拟私有网络已配置的地址范围。
603、根据所述第二源地址以及所述第一报文,生成第二报文。
604、将所述第二报文向与所述虚拟私有网络用户所在虚拟私有网络内部发送。
另外,本方案实施例还提供以一个VPC发送端、一个SLB、一台云端服务器为交互设备所实现的本方案提供的方法流程,其如图16所示。其中,VPC发送端中包含有:VPC虚拟机、VTEP。可以理解的是,该三方交互流程适用于任意个VPC发送端、任意个SLB和任意个云端服务器之间的交互。
VPC是用户在公有云上租用的私有云空间,通过虚拟化技术在云端形成用户私有的服务器空间,其承载有用户的应用服务,叫做应用服务器或VPC虚拟。
VPC虚拟机借助网络隔离技术,保障用户数据在各自所租用的应用服务器中的安全性。用户可将业务关联的应用服务部署在各自的应用服务器的虚拟机之上,由云端各个VPC虚拟机进行业务流程处理。例如,银行系统可以不必再自备数据库与业务处理服务器,而将转账业务部署在云端的VPC虚拟机中,由承载了转账业务的VPC虚拟机与云端服务器共同实现转账业务。各个VPC虚拟机与物理实体机一样,也具备各自的IP地址。在本实施例中,VPC虚拟机的IP为192.168.1.100。
VTEP是VLAN隧道终端,其是由硬件或软件予以实现的支持VxLan的设备,可以作为一个中间层来对VxLan报文进行封装和解封装。对于VPC发送端来说,VTEP根据虚拟网络标识VNI、IP来封装VxLan头,完 成对应用服务器发出的原始请求包的封装。同理,当VPC发送端接收由云端服务器返回的数据包时,该数据包也需要经由VTEP进行解封装,得到VxLan报文,进行获取到VNI和内层报文的目的IP地址,确定出目的VPC虚拟机,以将内层报文发送到该目的VPC虚拟机。在本实施例中VTEP的IP地址为:10.10.10.11,相应的虚拟网络标识为1111111。
SLB为服务器负载调度器,其可以通过对请求进行转发来完成多台服务器的负载均衡以及跨网络访问。SLB既可以是硬件实体,也可以是硬件实体上的虚拟装置,SLB既可以与云端服务器网络进行通信,也可以与VTEP进行通信。通常,SLB选定后,为SLB预先配置好VPC用户对应的SLB的私有网络内部IP,该SLB的私有网络内部IP用于使SLB与VPC网络内的应用服务器进行交互,以使两者的交互如同在同一私有网络中进行通讯。该SLB还需要存储有云端服务器的实际网络地址与配置给VPC用户的服务器地址之间的对应关系,以使得SLB能够正常转发将VPC用户与云端服务器之间的数据通信。该SLB的IP地址为10.10.10.100。
云端服务器为为用户提供各项云服务的设备。可处理由SLB转发过来的各项用户请求。其实际IP地址为10.10.10.101,而配置给VPC用户的IP地址为100.64.10.10。
基于前述设定,该方法流程包括:
s1、VPC虚拟机发送原始请求包,以向所述云端服务器请求服务。
其中,原始请求包中的源IP是VPC发送端中VPC虚拟机的IP地址(192.168.1.100),目的IP是与预先配置给VPC用户的云端服务器的私有网络内部IP地址(100.64.10.10)。
s2、VTEP基于VxLan协议对原始请求包进行封装,构造得到Vxlan包。
Vxlan数据包的包头携带外部源地址(VTEP的私有网络内部IP地址10.10.10.11),外部目的地址(SLB的私有网络内部IP地址10.10.10.100),虚拟网络标识1111111,内部源地址(VPC虚拟机的在VPC网络内的IP地址192.168.1.100),内部目的地址(配置给用户的云端服务器IP地址100.64.10.10)。
s3、VTEP将请求数据包向SLB发送。
s4、SLB接收到该请求数据包后,对其进行解析。将该请求数据包由VxLAN格式转换为VLAN格式。
在此步骤中,SLB从中解析出原始请求包,并将原始请求包中的源IP修改为SLB自身的IP地址(10.10.10.100)、将目的IP地址修改为云端服务器的IP(10.10.10.101),原始请求包中的数据包内容保持不变,形成转发请求包,并将该转发请求包发送给云端服务器。
s5、SLB向云端服务器发送转发请求包。
s6、云端服务器获取到SLB转发的请求包后,对其中数据包内的数据进行相应处理,并生成原始响应包。
s7、根据SLB自身的私有网络内部IP地址将该原始响应包发送到SLB。
s8、SLB接收到云端服务器发送的原始响应包后,对其进行解析。将该响应数据包由VLAN格式转换为VxLAN格式。
在该步骤中,SLB对其中的地址内容进行修改,将原始响应包中源IP修改为云端服务器的IP(100.64.10.10)、目的IP修改为VPC虚拟机的IP 地址(192.168.1.100),原始响应包中的数据包保持不变,形成转发响应包。再将该转发响应包连同虚拟网络标识VNI(1111111)等信息一起封装得到VxLan包该Vxlan数据包的包头携带外部源地址(SLB的私有网络内部IP地址10.10.10.100),外部目的地址(VTEP的私有网络内部IP地址10.10.10.11),虚拟网络标识1111111,内部源地址(配置给用户的云端服务器IP地址100.64.10.10),内部目的地址(VPC虚拟机的在VPC网络内的IP地址192.168.1.100)。
s9、SLB将转发响应数据包发送给VTEP。
s10、VTEP接收到封装后的转发响应数据包后,对其进行解封装,并根据解封装后得到的VNI和目的IP,确定VPC虚拟机。
s11、VTEP将解封装得到的响应数据包发送给VPC虚拟机,实现整个应用服务器与云端服务器的交互过程。
另外,在为VPC用户提供加密服务的过程中,本方案实施例还提供以一个VPC发送端、一个SLB、一台云端加密机为交互设备所实现的本方案提供的方法流程,其如图17所示。其中,VPC发送端中包含有:VPC虚拟机、VTEP。可以理解的是,该三方交互流程适用于任意个VPC发送端、任意个SLB和任意个云端加密机之间的交互。
在该实施例中,VPC虚拟机的IP为192.168.1.100。TEP的IP地址为:10.10.10.11,相应的虚拟网络标识为1111111。
SLB的IP地址为10.10.10.100。
云端加密机实际IP地址为10.10.10.101,配置给VPC用户的IP地址为100.64.10.10。
基于此处的设定,相应的方法流程如下,包括:
t1、VPC虚拟机发送原始待加密请求包,以向所述云端加密机请求加密服务。
其中,原始待加密请求包中的源IP是VPC发送端中VPC虚拟机的IP地址(192.168.1.100),目的IP是与预先配置给VPC用户的云端加密机的私有网络内部IP地址(100.64.10.10)。
t2、VTEP基于VxLan协议对原始待加密请求包进行封装,构造得到Vxlan包。
Vxlan数据包的包头携带外部源地址(VTEP的私有网络内部IP地址10.10.10.11),外部目的地址(SLB的私有网络内部IP地址10.10.10.100),虚拟网络标识1111111,内部源地址(VPC虚拟机的在VPC网络内的IP地址192.168.1.100),内部目的地址(配置给用户的云端加密机IP地址100.64.10.10)。
t3、VTEP将待加密请求数据包向SLB发送。
t4、SLB接收到该待加密请求数据包后,对其进行解析。将该待加密请求数据包由VxLAN格式转换为VLAN格式。
在此步骤中,SLB从中解析出原始待加密请求包,并将原始待加密请求包中的源IP修改为SLB自身的IP地址(10.10.10.100)、将目的IP地址修改为云端加密机的IP(10.10.10.101),原始待加密请求包中的数据包内容保持不变,形成待加密请求转发包,并将该待加密请求转发包发送给云端加密机。
t5、SLB向云端加密机发送待加密请求转发包。
t6、云端加密机获取到SLB转发的待加密请求转发包后,对其中数据包内的数据进行相应加密处理,并生成原始加密包。
t7、根据SLB自身的私有网络内部IP地址将该原始加密包发送到SLB。
t8、SLB接收到云端加密机发送的原始加密包后,对其进行解析。将该原始加密包由VLAN格式转换为VxLAN格式。
在该步骤中,SLB对其中的地址内容进行修改,将原始加密包中源IP修改为云端加密机的IP(100.64.10.10)、目的IP修改为VPC虚拟机的IP地址(192.168.1.100),原始加密包中的数据包保持不变,形成转发加密包。再将该转发加密包连同虚拟网络标识VNI(1111111)等信息一起封装得到VxLan包该Vxlan数据包的包头携带外部源地址(SLB的私有网络内部IP地址10.10.10.100),外部目的地址(VTEP的私有网络内部IP地址10.10.10.11),虚拟网络标识1111111,内部源地址(配置给用户的云端加密机IP地址100.64.10.10),内部目的地址(VPC虚拟机的在VPC网络内的IP地址192.168.1.100)。
t9、SLB将加密数据转发包发送给VTEP。
t10、VTEP接收到封装后的加密数据转发包后,对其进行解封装,并根据解封装后得到的VNI和目的IP,确定VPC虚拟机。
t11、VTEP将解封装得到的加密数据包发送给VPC虚拟机,实现整个应用服务器与云端加密机的交互过程。
前述t1至t11仅是针对加密过程的一种示例,对于其它服务的实现流程也可参照此处描述的步骤。
本方案实施例还提供了一种网络设备,用以实现前述各方法流程,其 组成如图18所示,包括:
接收单元71,用于接收虚拟私有网络用户发送的第一报文,所述第一报文携带的第一目的地址为指定地址,所述指定地址不属于所述虚拟私有网络用户所在虚拟私有网络已配置的地址范围。
转换单元72,用于对所述第一目的地址进行地址转换,得到第二目的地址。
生成单元73,用于根据所述第二目的地址以及所述第一报文,生成第二报文。
发送单元74,用于将所述第二报文向与所述虚拟私有网络用户所在虚拟私有网络外部发送。
可选的是,所述转换单元72具体用于对所述第一报文进行解析,得到内部目的地址和虚拟网络标识;根据所述内部目的地址,确定所述第一目的地址,以及,根据所述虚拟网络标识确定所述虚拟私有网络用户所在虚拟私有网络的网络标识信息;在预配置的地址映射表中查找与所述第一目的地址以及所述网络标识信息共同对应的目的地址;当查找到与所述第一目的地址以及所述网络标识信息共同对应的目的地址时,则将查找到的目的地址确定为所述第二目的地址。
可选的是,所述生成单元73,具体用于当所述第一报文符合第一格式时,将所述第一格式转化为所述第二格式;按照所述第二格式,将所述第一报文携带的报文信息和所述第二目的地址进行封装,得到所述第二报文。
可选的是,所述生成单元73,具体用于将所述第一报文中符合第一格式的第一报头信息替换为符合第二格式的第二包头信息;其中,所述第一 报头信息至少包括内部源地址、内部目的地址、虚拟网络标识、外部源地址和外部目的地址;所述第二包头信息至少包括源地址和目的地址;将所述第二包头信息和所述报文信息进行封装,得到所述第二报文;所述第二包头信息中携带的源地址为所述网络设备的地址,携带的目的地址为所述第二目的地址。
可选的是,所述发送单元74,具体用于根据所述第二目的地址以及路由表,确定下一跳设备,所述下一跳设备位于所述虚拟私有网络用户所在虚拟私有网络外部;将所述第二报文向所述下一跳设备发送。
可选的是,所述指定地址不属于指定网络已配置的地址范围。
可选的是,所述指定地址属于100.64.0.0至100.64.0.10的地址范围中。
可选的是,所述虚拟私有网络为VPC网络。
可选的是,所述第一格式为VXLAN格式,所述第二格式为VLAN格式。
本方案实施例中还提供了一种网络设备,其组成如图19所示,包括:
接收单元81,用于接收第一类网络内用户发送的第一报文,所述第一报文携带的第一目的地址为第二类网络内的指定地址,所述指定地址不属于所述第一类网络已配置的地址范围,同时也不属于第三类网络已配置的地址范围;
转换单元82,用于对所述第一目的地址进行地址转换,得到第二目的地址;
生成单元83,用于根据所述第二目的地址以及所述第一报文,生成第二报文;
发送单元84,用于将所述第二报文向与第二类网络发送。
本方案实施例还提供了一种网络设备,其组成如图20所示,包括:
接收单元91,用于接收网络设备发送的第一报文,所述第一报文携带有第一源地址。
转换单元92,用于对所述第一源地址进行地址转换,得到第二源地址;所述第二源地址为指定地址,所述指定地址不属于虚拟私有网络用户所在虚拟私有网络已配置的地址范围。
生成单元93,用于根据所述第二源地址以及所述第一报文,生成第二报文。
发送单元94,用于将所述第二报文向与所述虚拟私有网络用户所在虚拟私有网络内部发送。
可选的是,所述转换单元92,还具体用于对所述第一报文进行解析,得到所述第一源地址;在预配置的地址映射表中查找与所述第一源地址对应的源地址;当查找到与所述第一源地址对应的源地址时,则将查找到的源地址确定为所述第二源地址。
可选的是,所述生成单元93具体用于当所述第一报文符合第一格式时,将所述第一格式转化为所述第二格式;按照所述第二格式,将所述第一报文携带的报文信息和所述第二源地址进行封装,得到所述第二报文。
可选的是,所述生成单元93还具体用于将所述第一报文中符合第一格式的第一报头信息替换为符合第二格式的第二包头信息;其中,所述第一包头信息至少包括源地址和目的地址;所述第二报头信息至少包括内部源地址、内部目的地址、虚拟网络标识、外部源地址和外部目的地址;将所 述第二包头信息和所述报文信息进行封装,得到所述第二报文;所述第二包头信息中携带的源地址为所述网络设备的地址,携带的目的地址为所述第二目的地址。
可选的是,所述指定地址不属于指定网络已配置的地址范围。
可选的是,所述指定地址属于100.64.0.0至100.64.0.10的地址范围中。
可选的是,所述虚拟私有网络为VPC网络。
可选的是,所述第一格式为VLAN格式,所述第二格式为VXLAN格式。
本方案实施例还提供了一种网络设备,如图21所示,包括:
接收单元1001,用于接收第二类网络内设备发送的第一报文,所述第一报文携带有第一源地址。
转换单元1002,用于对所述第一目的地址进行地址转换,得到第二源地址;所述第二源地址为第二类网络内的指定地址,所述指定地址不属于虚拟私有网络用户所在虚拟私有网络已配置的地址范围。
生成单元1003,用于根据所述第二目的地址以及所述第一报文,生成第二报文。
发送单元1004,用于将所述第二报文向与所述虚拟私有网络用户所在虚拟私有网络内部发送。
本方案实施例所提供的数据传输的网络设备,使得虚拟私有网络内的用户只需能够提供业务服务的私有网络,就能够获取各项由相应服务器提供的服务,使得虚拟私有网络内部的用户不需要通过访问除私有网络外的其它网络来获取服务,从而为用户节省了流量。
另外,针对网络设备的实现,本方案实施例还提供了一种可能的实现方式,如图22所示,为网络设备110的简化框图。该网络设备110可以包括与一个或多个数据存储工具连接的处理器1101,该数据存储工具可以包括存储介质1102和内存单元1103。网络设备110还可以包括输入接口1104和输出接口1105,用于与另一装置或系统进行通信。被处理器1101的CPU执行的程序代码可存储在内存单元1102或存储介质1103中。
网络设备110中的处理器1101调用上述程序代码,以执行下属各步骤:
所述处理器1101,用于通过所述输入接口1104接收虚拟私有网络用户发送的第一报文,所述第一报文携带的第一目的地址为指定地址,所述指定地址不属于所述虚拟私有网络用户所在虚拟私有网络已配置的地址范围;对所述第一目的地址进行地址转换,得到第二目的地址;根据所述第二目的地址以及所述第一报文,生成第二报文;通过所述输出接口1105将所述第二报文向与所述虚拟私有网络用户所在虚拟私有网络外部发送。
可选的是,所述处理器1101,还用于对所述第一报文进行解析,得到内部目的地址和虚拟网络标识;根据所述内部目的地址,确定所述第一目的地址,以及,根据所述虚拟网络标识确定所述虚拟私有网络用户所在虚拟私有网络的网络标识信息;在预配置的地址映射表中查找与所述第一目的地址以及所述网络标识信息共同对应的目的地址;当查找到与所述第一目的地址以及所述网络标识信息共同对应的目的地址时,则将查找到的目的地址确定为所述第二目的地址。
可选的是,所述处理器1101,还用于当所述第一报文符合第一格式时,将所述第一格式转化为所述第二格式;按照所述第二格式,将所述第一报 文携带的报文信息和所述第二目的地址进行封装,得到所述第二报文。
可选的是,所述处理器1101,还用于将所述第一报文中符合第一格式的第一报头信息替换为符合第二格式的第二包头信息;其中,所述第一报头信息至少包括内部源地址、内部目的地址、虚拟网络标识、外部源地址和外部目的地址;所述第二包头信息至少包括源地址和目的地址;将所述第二包头信息和所述报文信息进行封装,得到所述第二报文;所述第二包头信息中携带的源地址为所述网络设备的地址,携带的目的地址为所述第二目的地址。
可选的是,所述处理器1101,还用于根据所述第二目的地址以及路由表,确定下一跳设备,所述下一跳设备位于所述虚拟私有网络用户所在虚拟私有网络外部;以及通过所述输出接口1105将所述第二报文向所述下一跳设备发送。
可选的是,所述指定地址不属于指定网络已配置的地址范围。
可选的是,所述指定地址属于100.64.0.0至100.64.0.10的地址范围中。
可选的是所述虚拟私有网络为VPC网络。
可选的是所述第一格式为VXLAN格式,所述第二格式为VLAN格式。
另外,在其它可能的实现方式中,所述处理器1101,还用于通过所述输入接口1104接收第一类网络内用户发送的第一报文,所述第一报文携带的第一目的地址为第二类网络内的指定地址,所述指定地址不属于所述第一类网络已配置的地址范围,同时也不属于第三类网络已配置的地址范围;对所述第一目的地址进行地址转换,得到第二目的地址;根据所述第二目的地址以及所述第一报文,生成第二报文;通过所述输出接口1105将所述 第二报文向与第二类网络发送。
基于如图22所示组成,所述处理器1101还用于通过输入接口1104接收网络设备发送的第一报文,所述第一报文携带有第一源地址;对所述第一源地址进行地址转换,得到第二源地址;所述第二源地址为指定地址,所述指定地址不属于虚拟私有网络用户所在虚拟私有网络已配置的地址范围;根据所述第二源地址以及所述第一报文,生成第二报文;通过输出接口1105将所述第二报文向与所述虚拟私有网络用户所在虚拟私有网络内部发送。
可选的是,所述处理器1101,还用于对所述第一报文进行解析,得到所述第一源地址;在预配置的地址映射表中查找与所述第一源地址对应的源地址;当查找到与所述第一源地址对应的源地址时,则将查找到的源地址确定为所述第二源地址。
可选的是,所述处理器1101,还用于当所述第一报文符合第一格式时,将所述第一格式转化为所述第二格式;按照所述第二格式,将所述第一报文携带的报文信息和所述第二源地址进行封装,得到所述第二报文。
可选的是,所述处理器1101,还用于将所述第一报文中符合第一格式的第一报头信息替换为符合第二格式的第二包头信息;其中,所述第一包头信息至少包括源地址和目的地址;所述第二报头信息至少包括内部源地址、内部目的地址、虚拟网络标识、外部源地址和外部目的地址;将所述第二包头信息和所述报文信息进行封装,得到所述第二报文;所述第二包头信息中携带的源地址为所述网络设备的地址,携带的目的地址为所述第二目的地址。
可选的是,所述指定地址不属于指定网络已配置的地址范围。
可选的是,所述指定地址属于100.64.0.0至100.64.0.10的地址范围中。
可选的是,所述虚拟私有网络为VPC网络。
可选的是,所述第一格式为VLAN格式,所述第二格式为VXLAN格式。
另外,在其它可能的实现方式中,所述处理器1101,还用于通过所述输入接口1104接收第二类网络内设备发送的第一报文,所述第一报文携带有第一源地址;对所述第一目的地址进行地址转换,得到第二源地址;所述第二源地址为第二类网络内的指定地址,所述指定地址不属于虚拟私有网络用户所在虚拟私有网络已配置的地址范围;根据所述第二目的地址以及所述第一报文,生成第二报文;通过所述输出接口1105将所述第二报文向与所述虚拟私有网络用户所在虚拟私有网络内部发送。
本方案实施例所提供的数据传输的网络设备,使得虚拟私有网络内的用户只需能够提供业务服务的私有网络,就能够获取各项由相应服务器提供的服务,使得虚拟私有网络内部的用户不需要通过访问除私有网络外的其它网络来获取服务,从而为用户节省了流量。
上述实施例中,存储介质可以是只读存储器(Read-Only Memory,ROM),或是可读写的,例如硬盘、闪存。内存单元可为随机存取存储器(Random Access Memory,RAM)。内存单元可与处理器物理集成或集成在存储器中或构建为单独的单元。
处理器为上述设备(该设备为上述服务器或者上述客户端)的控制中心,并提供处理装置,用于执行指令,进行中断操作,提供计时功能以及 多种其他功能。可选地,处理器包括一个或多个中央处理单元(CPU),例如图12中示出的CPU 0和CPU 1。上述设备中包括一个或者多个的处理器。处理器可为单核(单CPU)处理器或多核(多CPU)处理器。除非另有声明,描述为用于执行任务的例如处理器或存储器的部件可实现为通用部件,其暂时用于在给定时间执行任务,或实现为专门制造用于执行该任务的特定部件。此处所用的术语“处理器”指一个或多个装置,电路和/或处理核,用于处理数据,例如计算机程序指令。
被处理器的CPU执行的程序代码可存储在内存单元或存储介质中。可选地,存储在存储介质中的程序代码可以被复制入内存单元以便处理器的CPU执行。处理器可执行至少一个内核(例如LINUXTM、UNIXTM、WINDOWSTM、ANDROIDTM、IOSTM),众所周知,该内核用于通过控制其他程序或过程的执行、控制与外围装置的通信以及控制计算机设备资源的使用来控制上述设备的操作。
以上所述仅为本方案的较佳实施例,并不用以限制本方案,凡在本方案的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本方案的保护范围之内。

Claims (27)

  1. 一种数据传输的方法,其特征在于,应用于网络设备,包括:
    接收虚拟私有网络用户发送的第一报文,所述第一报文携带的第一目的地址为指定地址,所述指定地址不属于所述虚拟私有网络用户所在虚拟私有网络已配置的地址范围;
    对所述第一目的地址进行地址转换,得到第二目的地址;
    根据所述第二目的地址以及所述第一报文,生成第二报文;
    将所述第二报文向与所述虚拟私有网络用户所在虚拟私有网络外部发送。
  2. 根据权利要求1所述的方法,其特征在于,所述对所述第一目的地址进行地址转换,得到第二目的地址包括:
    对所述第一报文进行解析,得到内部目的地址和虚拟网络标识;
    根据所述内部目的地址,确定所述第一目的地址,以及,根据所述虚拟网络标识确定所述虚拟私有网络用户所在虚拟私有网络的网络标识信息;
    在预配置的地址映射表中查找与所述第一目的地址以及所述网络标识信息共同对应的目的地址;
    当查找到与所述第一目的地址以及所述网络标识信息共同对应的目的地址时,则将查找到的目的地址确定为所述第二目的地址。
  3. 根据权利要求2所述的方法,其特征在于,所述根据所述第二目的地址以及所述第一报文,生成第二报文包括:
    当所述第一报文符合第一格式时,将所述第一格式转化为所述第二格 式;
    按照所述第二格式,将所述第一报文携带的报文信息和所述第二目的地址进行封装,得到所述第二报文。
  4. 根据权利要求3所述的方法,其特征在于,所述当所述第一报文符合第一格式时,将所述第一格式转化为所述第二格式包括:
    将所述第一报文中符合第一格式的第一报头信息替换为符合第二格式的第二包头信息;其中,所述第一报头信息至少包括内部源地址、内部目的地址、虚拟网络标识、外部源地址和外部目的地址;所述第二包头信息至少包括源地址和目的地址;
    则所述按照所述第二格式,将所述第一报文携带的报文信息和所述第二目的地址进行封装,得到所述第二报文包括:
    将所述第二包头信息和所述报文信息进行封装,得到所述第二报文;所述第二包头信息中携带的源地址为所述网络设备的地址,携带的目的地址为所述第二目的地址。
  5. 根据权利要求4所述的方法,其特征在于,所述将所述第二报文向与所述虚拟私有网络用户所在虚拟私有网络外部发送包括:
    根据所述第二目的地址以及路由表,确定下一跳设备,所述下一跳设备位于所述虚拟私有网络用户所在虚拟私有网络外部;
    将所述第二报文向所述下一跳设备发送。
  6. 根据权利要求5所述的方法,其特征在于,所述指定地址不属于指定网络已配置的地址范围。
  7. 根据权利要求6所述的方法,其特征在于,所述指定地址属于 100.64.0.0至100.64.0.10的地址范围中。
  8. 根据权利要求7所述的方法,其特征在于,所述虚拟私有网络为VPC网络。
  9. 根据权利要求8所述的方法,其特征在于,所述第一格式为VXLAN格式,所述第二格式为VLAN格式。
  10. 根据权利要求9所述的方法,其特征在于,所述第一目的地址和所述第二目的地址对应于同一服务器。
  11. 根据权利要求10所述的方法,其特征在于,所述服务器为网络时间协议NTP服务器或加密服务器。
  12. 一种数据传输的方法,其特征在于,包括:
    接收第一类网络内用户发送的第一报文,所述第一报文携带的第一目的地址为第二类网络内的指定地址,所述指定地址不属于所述第一类网络已配置的地址范围,同时也不属于第三类网络已配置的地址范围;
    对所述第一目的地址进行地址转换,得到第二目的地址;
    根据所述第二目的地址以及所述第一报文,生成第二报文;
    将所述第二报文向与第二类网络发送。
  13. 一种数据传输的方法,其特征在于,包括:
    接收网络设备发送的第一报文,所述第一报文携带有第一源地址;
    对所述第一源地址进行地址转换,得到第二源地址;所述第二源地址为指定地址,所述指定地址不属于虚拟私有网络用户所在虚拟私有网络已配置的地址范围;
    根据所述第二源地址以及所述第一报文,生成第二报文;
    将所述第二报文向与所述虚拟私有网络用户所在虚拟私有网络内部发送。
  14. 根据权利要求13所述的方法,其特征在于,所述对所述第一源地址进行地址转换,得到第二源地址包括:
    对所述第一报文进行解析,得到所述第一源地址;
    在预配置的地址映射表中查找与所述第一源地址对应的源地址;
    当查找到与所述第一源地址对应的源地址时,则将查找到的源地址确定为所述第二源地址。
  15. 根据权利要求13所述的方法,其特征在于,所述根据所述第二源地址以及所述第一报文,生成第二报文包括:
    当所述第一报文符合第一格式时,将所述第一格式转化为所述第二格式;
    按照所述第二格式,将所述第一报文携带的报文信息和所述第二源地址进行封装,得到所述第二报文。
  16. 根据权利要求15所述的方法,其特征在于,所述当所述第一报文符合第一格式时,将所述第一格式转化为所述第二格式包括:
    将所述第一报文中符合第一格式的第一报头信息替换为符合第二格式的第二包头信息;其中,所述第一包头信息至少包括源地址和目的地址;所述第二报头信息至少包括内部源地址、内部目的地址、虚拟网络标识、外部源地址和外部目的地址;
    则所述按照所述第二格式,将所述第一报文携带的报文信息和所述第二目的地址进行封装,得到所述第二报文包括:
    将所述第二包头信息和所述报文信息进行封装,得到所述第二报文;所述第二包头信息中携带的源地址为所述网络设备的地址,携带的目的地址为所述第二目的地址。
  17. 根据权利要求15所述的方法,其特征在于,所述指定地址不属于指定网络已配置的地址范围。
  18. 根据权利要求17所述的方法,其特征在于,所述指定地址属于100.64.0.0至100.64.0.10的地址范围中。
  19. 根据权利要求18所述的方法,其特征在于,所述虚拟私有网络为VPC网络。
  20. 根据权利要求19所述的方法,其特征在于,所述第一格式为VLAN格式,所述第二格式为VXLAN格式。
  21. 根据权利要求20所述的方法,其特征在于,所述第一源地址和所述第二源地址对应于同一服务器。
  22. 根据权利要求21所述的方法,其特征在于,所述服务器为NTP服务器或加密服务器。
  23. 一种数据传输的方法,其特征在于,包括:
    接收第二类网络内设备发送的第一报文,所述第一报文携带有第一源地址;
    对所述第一目的地址进行地址转换,得到第二源地址;所述第二源地址为第二类网络内的指定地址,所述指定地址不属于虚拟私有网络用户所在虚拟私有网络已配置的地址范围;
    根据所述第二目的地址以及所述第一报文,生成第二报文;
    将所述第二报文向与所述虚拟私有网络用户所在虚拟私有网络内部发送。
  24. 一种网络设备,其特征在于,包括:
    接收单元,用于接收虚拟私有网络用户发送的第一报文,所述第一报文携带的第一目的地址为指定地址,所述指定地址不属于所述虚拟私有网络用户所在虚拟私有网络已配置的地址范围;
    转换单元,用于对所述第一目的地址进行地址转换,得到第二目的地址;
    生成单元,用于根据所述第二目的地址以及所述第一报文,生成第二报文;
    发送单元,用于将所述第二报文向与所述虚拟私有网络用户所在虚拟私有网络外部发送。
  25. 一种网络设备,其特征在于,包括:
    接收单元,用于接收第一类网络内用户发送的第一报文,所述第一报文携带的第一目的地址为第二类网络内的指定地址,所述指定地址不属于所述第一类网络已配置的地址范围,同时也不属于第三类网络已配置的地址范围;
    转换单元,用于对所述第一目的地址进行地址转换,得到第二目的地址;
    生成单元,用于根据所述第二目的地址以及所述第一报文,生成第二报文;
    发送单元,用于将所述第二报文向与第二类网络发送。
  26. 一种网络设备,其特征在于,包括:
    接收单元,用于接收网络设备发送的第一报文,所述第一报文携带有第一源地址;
    转换单元,用于对所述第一源地址进行地址转换,得到第二源地址;所述第二源地址为指定地址,所述指定地址不属于虚拟私有网络用户所在虚拟私有网络已配置的地址范围;
    生成单元,用于根据所述第二源地址以及所述第一报文,生成第二报文;
    发送单元,用于将所述第二报文向与所述虚拟私有网络用户所在虚拟私有网络内部发送。
  27. 一种网络设备,其特征在于,包括:
    接收单元,用于接收第二类网络内设备发送的第一报文,所述第一报文携带有第一源地址;
    转换单元,用于对所述第一目的地址进行地址转换,得到第二源地址;所述第二源地址为第二类网络内的指定地址,所述指定地址不属于虚拟私有网络用户所在虚拟私有网络已配置的地址范围;
    生成单元,用于根据所述第二目的地址以及所述第一报文,生成第二报文;
    发送单元,用于将所述第二报文向与所述虚拟私有网络用户所在虚拟私有网络内部发送。
PCT/CN2017/102386 2016-09-27 2017-09-20 一种数据传输的方法及网络设备 WO2018059284A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US16/364,064 US11233766B2 (en) 2016-09-27 2019-03-25 Data transmission method and network device

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610854615.X 2016-09-27
CN201610854615.XA CN107872542B (zh) 2016-09-27 2016-09-27 一种数据传输的方法及网络设备

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US16/364,064 Continuation US11233766B2 (en) 2016-09-27 2019-03-25 Data transmission method and network device

Publications (1)

Publication Number Publication Date
WO2018059284A1 true WO2018059284A1 (zh) 2018-04-05

Family

ID=61752196

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/102386 WO2018059284A1 (zh) 2016-09-27 2017-09-20 一种数据传输的方法及网络设备

Country Status (4)

Country Link
US (1) US11233766B2 (zh)
CN (1) CN107872542B (zh)
TW (1) TWI744359B (zh)
WO (1) WO2018059284A1 (zh)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109995759A (zh) * 2019-03-04 2019-07-09 平安科技(深圳)有限公司 一种物理机接入vpc的方法及相关装置
CN113098954A (zh) * 2021-03-30 2021-07-09 平安科技(深圳)有限公司 报文转发方法、装置、计算机设备和存储介质
CN113630316A (zh) * 2020-05-06 2021-11-09 华为技术有限公司 一种数据传输方法及通信装置
US11233766B2 (en) 2016-09-27 2022-01-25 Alibaba Group Holding Limited Data transmission method and network device

Families Citing this family (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108650182B (zh) * 2018-04-20 2020-09-25 腾讯科技(深圳)有限公司 网络通信方法、系统、装置、设备及存储介质
CN110753072B (zh) * 2018-07-24 2022-06-03 阿里巴巴集团控股有限公司 负载均衡系统、方法、装置及设备
CN110875884B (zh) * 2018-08-31 2023-10-31 阿里巴巴集团控股有限公司 一种流量迁移系统、一种数据处理方法及装置
CN110611625B (zh) * 2018-11-27 2020-11-06 新华三技术有限公司 网络设备及应用于网络设备的逻辑装置
JP7293728B2 (ja) * 2019-03-01 2023-06-20 日本電気株式会社 パケットカプセル化方法およびパケットカプセル化装置
CN110535747B (zh) * 2019-09-09 2021-11-02 杭州迪普信息技术有限公司 报文处理设备和方法
CN111371685B (zh) * 2020-02-28 2022-06-17 北京百度网讯科技有限公司 数据处理、IPv6挂载方法和装置
CN111786888B (zh) * 2020-03-24 2022-08-09 北京京东尚科信息技术有限公司 一种接口隔离方法和装置
CN111767091B (zh) * 2020-07-01 2023-12-05 百度在线网络技术(北京)有限公司 小程序获取用户信息的方法、装置、电子设备和存储介质
US11336515B1 (en) * 2021-01-06 2022-05-17 Cisco Technology, Inc. Simultaneous interoperability with policy-aware and policy-unaware data center sites
CN114679370B (zh) * 2021-05-20 2024-01-12 腾讯云计算(北京)有限责任公司 一种服务器托管方法、装置、系统及存储介质
CN113595891B (zh) * 2021-08-18 2022-11-25 北京金山云网络技术有限公司 数据通信方法、装置和电子设备
CN114448667B (zh) * 2021-12-23 2023-08-08 天翼云科技有限公司 一种数据传输方法、装置及设备

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060182103A1 (en) * 2005-02-16 2006-08-17 Phantom Technologies, Llc. System and method for routing network messages
CN104639363A (zh) * 2013-11-13 2015-05-20 财团法人资讯工业策进会 用于在虚拟区域网络中管理云端装置的管理伺服器及其管理方法
CN105122231A (zh) * 2013-01-02 2015-12-02 加速系统有限责任公司 提供ReNAT通信环境的系统和方法
CN105491082A (zh) * 2014-09-16 2016-04-13 华为技术有限公司 远程资源访问方法和交换设备

Family Cites Families (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3038650B2 (ja) * 1997-04-28 2000-05-08 日本電気株式会社 移動体パケット通信システムのインターネット通信方法と装置
JP4460195B2 (ja) * 2001-08-06 2010-05-12 株式会社日立製作所 パケット転送装置およびルーティング制御装置
US7260097B2 (en) * 2002-01-30 2007-08-21 Nortel Networks Limited Label control method and apparatus for virtual private LAN segment networks
US7978716B2 (en) * 2003-11-24 2011-07-12 Citrix Systems, Inc. Systems and methods for providing a VPN solution
US8194674B1 (en) * 2007-12-20 2012-06-05 Quest Software, Inc. System and method for aggregating communications and for translating between overlapping internal network addresses and unique external network addresses
CN101567831B (zh) * 2008-04-21 2011-11-16 成都市华为赛门铁克科技有限公司 局域网之间发送、接收信息的方法和装置以及通信的系统
CN101729388B (zh) * 2008-10-22 2012-01-25 华为技术有限公司 一种实现网络地址转换的方法、媒体网关和网络系统
CN101447956B (zh) * 2009-01-13 2012-01-04 杭州华三通信技术有限公司 一种跨网闸的通信方法和通信系统
CN103581348A (zh) * 2012-07-24 2014-02-12 深圳市腾讯计算机系统有限公司 网络地址转换方法及转换系统
CN103780467B (zh) * 2012-10-19 2017-04-26 华为技术有限公司 通信连接方法、通信装置及通信系统
CN105591863B (zh) * 2014-10-20 2019-11-26 中兴通讯股份有限公司 一种实现虚拟私有云网络与外部网络互通的方法和装置
CN105515874B (zh) * 2015-12-26 2019-04-23 华为技术有限公司 在虚拟私有云中部署网络的方法和相关装置与系统
CN105721306B (zh) * 2016-02-04 2019-03-15 杭州数梦工场科技有限公司 一种配置信息的传输方法和装置
CN107872542B (zh) 2016-09-27 2021-05-04 阿里巴巴集团控股有限公司 一种数据传输的方法及网络设备

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060182103A1 (en) * 2005-02-16 2006-08-17 Phantom Technologies, Llc. System and method for routing network messages
CN105122231A (zh) * 2013-01-02 2015-12-02 加速系统有限责任公司 提供ReNAT通信环境的系统和方法
CN104639363A (zh) * 2013-11-13 2015-05-20 财团法人资讯工业策进会 用于在虚拟区域网络中管理云端装置的管理伺服器及其管理方法
CN105491082A (zh) * 2014-09-16 2016-04-13 华为技术有限公司 远程资源访问方法和交换设备

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11233766B2 (en) 2016-09-27 2022-01-25 Alibaba Group Holding Limited Data transmission method and network device
CN109995759A (zh) * 2019-03-04 2019-07-09 平安科技(深圳)有限公司 一种物理机接入vpc的方法及相关装置
CN113630316A (zh) * 2020-05-06 2021-11-09 华为技术有限公司 一种数据传输方法及通信装置
CN113630316B (zh) * 2020-05-06 2022-12-06 华为技术有限公司 一种数据传输方法及通信装置
CN113098954A (zh) * 2021-03-30 2021-07-09 平安科技(深圳)有限公司 报文转发方法、装置、计算机设备和存储介质
CN113098954B (zh) * 2021-03-30 2022-10-25 平安科技(深圳)有限公司 报文转发方法、装置、计算机设备和存储介质

Also Published As

Publication number Publication date
TWI744359B (zh) 2021-11-01
US11233766B2 (en) 2022-01-25
TW201815131A (zh) 2018-04-16
US20190222552A1 (en) 2019-07-18
CN107872542A (zh) 2018-04-03
CN107872542B (zh) 2021-05-04

Similar Documents

Publication Publication Date Title
WO2018059284A1 (zh) 一种数据传输的方法及网络设备
CN112470436B (zh) 用于提供多云连通性的系统、方法、以及计算机可读介质
US11283650B2 (en) Method for sending virtual extensible local area network packet, computer device, and computer readable medium
US10778464B2 (en) NSH encapsulation for traffic steering establishing a tunnel between virtual extensible local area network (VxLAN) tunnel end points (VTEPS) using a NSH encapsulation header comprising a VxLAN header whose VNI field has been replaced by an NSH shim
US20200059976A1 (en) IoT DEVICE CONNECTIVITY, DISCOVERY, AND NETWORKING
US20150358232A1 (en) Packet Forwarding Method and VXLAN Gateway
US9374323B2 (en) Communication between endpoints in different VXLAN networks
CN103200069B (zh) 一种报文处理的方法和设备
WO2018054177A1 (zh) 云间通信方法及相关设备、云间通信配置方法及相关设备
WO2021073565A1 (zh) 业务服务提供方法及系统
WO2017137008A1 (zh) 一种虚拟网络设备及相关方法
WO2019205952A1 (zh) 一种信息处理方法及装置
WO2014201974A1 (zh) 业务路由报文处理方法、装置及网络系统
WO2021000827A1 (zh) 数据传输链路建立方法、装置以及计算机可读存储介质
WO2021073555A1 (zh) 业务服务提供方法及系统、远端加速网关
WO2017113300A1 (zh) 路由确定方法、网络配置方法以及相关装置
US10020954B2 (en) Generic packet encapsulation for virtual networking
EP3313031B1 (en) Sdn-based arp realization method and apparatus
WO2021174943A1 (zh) 数据转发方法、装置、设备和存储介质
WO2018049691A1 (zh) 一种会话保持方法、设备及存储介质
CN109246016B (zh) 跨vxlan的报文处理方法和装置
CN112968965B (zh) Nfv网络节点的元数据服务方法、服务器及存储介质
WO2017036384A1 (zh) 运营商边缘设备及数据转发方法
TW202249466A (zh) 封包轉發控制協定(pfcp)會話負載平衡器運作系統及其運作方法
WO2022001666A1 (zh) 建立vxlan隧道的方法及相关设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17854734

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17854734

Country of ref document: EP

Kind code of ref document: A1