WO2014117475A1 - 通用路由封装协议隧道建立方法、通信设备及通信*** - Google Patents

通用路由封装协议隧道建立方法、通信设备及通信*** Download PDF

Info

Publication number
WO2014117475A1
WO2014117475A1 PCT/CN2013/078803 CN2013078803W WO2014117475A1 WO 2014117475 A1 WO2014117475 A1 WO 2014117475A1 CN 2013078803 W CN2013078803 W CN 2013078803W WO 2014117475 A1 WO2014117475 A1 WO 2014117475A1
Authority
WO
WIPO (PCT)
Prior art keywords
interface
gre
address
protocol
tunnel
Prior art date
Application number
PCT/CN2013/078803
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 WO2014117475A1 publication Critical patent/WO2014117475A1/zh

Links

Classifications

    • 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

Definitions

  • the present invention relates to the field of communications technologies, and in particular, to a general routing encapsulation protocol tunnel establishing method, a communication device, and a communication system. Background technique
  • the generic routing encapsulation (GRE) protocol is a protocol for some network layer protocols, such as Internet Protocol (IP) or Internetwork Packet Exchange Protocol (IPX).
  • IP Internet Protocol
  • IPX Internetwork Packet Exchange Protocol
  • the data is encapsulated so that the encapsulated data messages can be transmitted in another network layer protocol, such as in the IP layer.
  • GRE is a Layer 3 tunneling protocol for virtual private networks (VPNs), that is, a technology called tunnel is used between protocol layers.
  • VPNs virtual private networks
  • a tunnel is a virtual point-to-point connection. It provides a path for the encapsulated data packets to be transmitted through the path.
  • the data packets are encapsulated and decapsulated at both ends of a tunnel.
  • the interworking between the two routers is first implemented through a static route or a dynamic routing protocol, and then a GRE tunnel is created between the two routers, and the source IP address and the destination IP address of the GRE tunnel are specified.
  • the GRE tunnel supports the dynamic routing protocol when transmitting data packets. You need to configure the interface address of the GRE tunnel on the two routers and manually select the source IP address and destination IP address of the interface.
  • the destination IP address of the GRE tunnel that is, the IP address configured by the interface of the tunnel peer device
  • changes dynamically for example, the IP address of the peer device interface is an oint-to-point protocol (oint-to-point protocol
  • oint-to-point protocol oint-to-point protocol
  • the IP address of the peer device interface of the GRE tunnel can be manually modified only by manually changing the IP address of the peer device interface.
  • the IP address of the interface of the peer device oscillates due to the network. Therefore, the destination IP address of the GRE tunnel needs to be changed frequently, and the GRE tunnel cannot be normal. Communication. Summary of the invention
  • the embodiment of the present invention provides a general route encapsulation protocol tunnel establishment method, a communication device, and a communication system, which are used to establish a GRE tunnel by dynamically learning the peer IP address of the GRE tunnel.
  • the present invention provides a method for establishing a general routing encapsulation protocol tunnel, which may include: receiving, by a first device, a first multicast general routing encapsulation protocol GRE protocol notification packet sent by a second interface of the second device by using the first interface
  • the first multicast GRE protocol notification packet carries the Internet Protocol IP address of the second interface, and the GRE tunnel is configured between the first interface and the second interface, where the first interface is The second interface is configured with a GRE tunnel peer address learning function.
  • the IP address of the second interface is recorded as the destination IP address of the GRE tunnel, and the first interface is sent to the second interface by using the first interface.
  • the reply message, the first GRE protocol reply message carries the IP address of the first interface, so that the second interface records the IP address of the first interface as the destination IP address of the GRE tunnel.
  • the method includes: sending, by using the first interface, to the second interface Keeping a message to detect whether the GRE tunnel between the first interface and the second interface remains connected;
  • the second multicast GRE protocol notification packet is sent, where the second multicast GRE notification packet carries the packet.
  • the IP address of the first interface is used to notify the second interface to record the IP address of the first interface carried in the second multicast GRE notification packet as the destination IP address of the GRE tunnel.
  • the first device receives, by using the first interface, the first multicast sent by the second interface of the second device Before the GRE protocol notification packet, the method further includes: activating a GRE tunnel peer address learning function preset on the first interface.
  • the method further includes: if an intermediate device exists between the first device and the second device, Receiving, by the first device, the GRE protocol-related packet sent by the second interface of the second device that is transparently transmitted by the corresponding interface of the intermediate device, or transparently transmitting the message to the device through the corresponding interface of the intermediate device a GRE protocol-related packet sent by the second interface;
  • the GRE dynamic proxy function is configured on the corresponding interface of the intermediate device, so that the intermediate device transparently transmits the received GRE protocol-related packet through the corresponding interface.
  • the present invention provides a communication device, which may include:
  • a receiving unit configured to receive, by using the first interface, a first multicast general routing encapsulation protocol GRE protocol notification packet sent by the second interface of the second device, where the first multicast GRE protocol notification packet carries the second The network protocol IP address of the interface, the GRE tunnel is configured between the first interface and the second interface, and the GRE tunnel peer address learning function is configured on the first interface and the second interface;
  • a recording unit configured to record an IP address of the second interface received by the receiving unit as a destination IP address of the GRE tunnel
  • a sending unit configured to send, by using the first interface, a first GRE protocol reply message to the second interface, where the first GRE protocol reply message carries an IP address of the first interface, so that the The second interface records the IP address of the first interface as the destination IP address of the GRE tunnel.
  • the device further includes: a detecting unit, configured to send a keep-alive message to the second interface by using the first interface, to detect the first interface Whether the GRE tunnel between the second interfaces remains connected;
  • the sending unit is further configured to: if the detecting unit detects that the GRE tunnel between the first interface and the second interface is not connected, send a second multicast GRE protocol notification message, where The second multicast GRE notification packet carries the IP address of the first interface, and is used to notify the second interface to notify the second multicast GRE of the IP address of the first interface carried in the packet. Recorded as the destination IP address of the GRE tunnel.
  • the device further includes: an activation unit, configured to activate a pre-configured GRE tunnel pair of the first interface End address learning function.
  • the receiving unit is further configured to exist between the first device and the second device
  • the intermediate device receives, by the first interface, a GRE protocol-related packet sent by the second interface of the second device that is transparently transmitted by the corresponding interface of the intermediate device;
  • the sending unit is further configured to: if an intermediate device exists between the first device and the second device, transparently transmit a GRE protocol-related packet sent to the second interface by using a corresponding interface of the intermediate device ;
  • the GRE dynamic proxy function is configured on the corresponding interface of the intermediate device, so that the intermediate device transparently transmits the received GRE protocol-related packet through the corresponding interface.
  • the present invention provides a communication system, which may include: a first device and a second device, where the first device is configured to receive, by using the first interface, the first multicast sent by the second interface of the second device.
  • a GRE protocol notification message the first multicast GRE protocol notification message carries an Internet Protocol IP address of the second interface, and a GRE tunnel is configured between the first interface and the second interface.
  • the first interface and the second interface are configured with a GRE tunnel peer address learning function, and the IP address of the second interface is recorded as the destination IP address of the GRE tunnel, and the first interface is used to The second interface sends a first GRE protocol reply message, where the first GRE protocol reply message carries the IP address of the first interface, so that the second interface records the IP address of the first interface as The destination IP address of the GRE tunnel;
  • the second device is configured to send the first multicast GRE protocol notification packet by using a second interface, where the first multicast GRE protocol notification packet carries an IP address of the second interface, and receives the first The first GRE protocol reply message sent by the interface, the first GRE protocol reply message carrying the IP address of the first interface, and recording the IP address of the first interface as the destination of the GRE tunnel IP address.
  • the first device of the first device and the second interface of the second device are configured with the GRE tunnel peer address learning function, and the first device receives the first interface through the first interface.
  • the first multicast GRE protocol notification packet sent by the second interface of the second device, the IP address of the second interface carried in the second interface is recorded as the destination IP address of the GRE tunnel, and the The second interface sends a GRE protocol reply message.
  • a GRE tunnel is established between the first device and the second device.
  • the devices at both ends of the GRE tunnel configured with the GRE tunnel peer learning function automatically negotiate the IP address of the device port and update the changed IP address.
  • the destination IP address of the GRE tunnel is not required to be manually configured, so that the peer device obtains the changed IP address, which solves the problem that the GRE service is unavailable due to frequent IP address changes, and reduces the device configuration cost.
  • FIG. 1 is a schematic structural diagram of a general routing encapsulation protocol tunnel communication system according to an embodiment of the present invention
  • FIG. 2 is a schematic diagram of a general routing encapsulation protocol tunnel establishment method according to an embodiment of the present invention
  • FIG. 3 is a schematic diagram of a general routing encapsulation protocol tunnel establishment according to an embodiment of the present invention
  • Another schematic diagram of the method 4 is a schematic structural diagram of a general-purpose routing encapsulation protocol tunnel communication system in the presence of a l'3 ⁇ 4 device according to an embodiment of the present invention;
  • FIG. 5 is a schematic structural diagram of a communication device according to an embodiment of the present invention.
  • FIG. 6 is another schematic structural diagram of a communication device according to an embodiment of the present invention.
  • FIG. 7 is a schematic structural diagram of hardware of a communication device according to an embodiment of the present invention.
  • FIG. 8 is a schematic diagram of an embodiment of a communication system according to an embodiment of the present invention. detailed description
  • the embodiment of the present invention provides a general route encapsulation protocol tunnel establishing method, a communication device, and a communication system, which are used to automatically negotiate the IP address of a device port at the two ends of the GRE tunnel, thereby reducing device configuration cost and solving the IP address. Frequent changes cause the GRE service to be unavailable.
  • the first device 101 is connected to the second device 102 through the tunnel 103, and the first device 101 and the second device are first implemented by using a static route or a dynamic routing protocol.
  • the tunnels 103 are interconnected by the tunnel 103, and then GRE tunnels are configured at both ends of the tunnel 103 to specify interface addresses of the first device 101 and the second device 102 with respect to the GRE tunnel.
  • the first device and the second device in the embodiment of the present invention are devices that support the GRE tunnel function, and may be routers, switches, firewalls, and the like.
  • the general routing encapsulation protocol tunnel establishment method in the embodiment of the present invention includes:
  • the first device receives the first multicast GRE protocol notification message sent by the second interface of the second device by using the first interface.
  • the first multicast GRE protocol notification packet carries the IP address of the second interface of the second device, and the multicast GRE protocol notification message indicates that the GRE protocol notification message is sent in multicast form.
  • a GRE tunnel is configured between the first interface and the second interface, where the first interface and the second interface are the peer device interfaces of the GRE tunnel, and the first interface and the second interface are The GRE tunnel peer address learning function is configured on the interface.
  • the GRE tunnel peer address learning function means that the devices at both ends of the GRE tunnel can dynamically learn the IP address of the interface of the peer device through the GRE protocol.
  • the first device and The second device serves as the peer device of the GRE tunnel, and the first device sends the GRE protocol carrying the IP address of the first interface to notify the packet, and receives the GRE that carries the IP address of the second interface that is replied by the second device.
  • the protocol replies to the message, or receives the second device to send
  • the multicast GF3 ⁇ 4 protocol notification packet carrying the IP address of the second interface sends a GRE protocol reply packet carrying the IP address of the first interface to the second device, and dynamically learns the IP address of the interface of the peer device.
  • a timer is configured in the first device and the second device, and the timer in the first device enables the first device to periodically send the GRE protocol notification message in the form of multicast through the first interface, in the GRE.
  • the protocol notification packet carries the IP address of the first interface, so that the second interface that receives the multicast GRE protocol notification packet can obtain the IP address of the first interface, thereby notifying the IP address of the first interface.
  • the peer device interface of the GRE tunnel.
  • the timer in the second device may enable the second device to periodically send a GRE protocol notification message in a multicast manner through the second interface, in the GRE protocol notification.
  • the packet carries the IP address of the second interface, so that the first interface that receives the multicast GRE protocol notification packet can obtain the IP address of the second interface, thereby notifying the IP address of the second interface to the GRE tunnel.
  • the peer device interface is configured in the first device and the second device, and the timer in the first device enables the first device to periodically send the GRE protocol
  • the IP address of the second interface is recorded as the destination IP address of the GRE tunnel, and the GRE protocol reply packet is sent to the second interface by using the first interface.
  • the first device records the received IP address of the second interface as the destination IP address of the GRE tunnel, and sends a GRE protocol reply message to the second interface by using the first interface.
  • a GRE tunnel is established with the second device.
  • the first device and the second device are mutually opposite devices of the GRE tunnel. It can be understood that the second interface of the second device has the same receiving and sending as the first interface of the first device.
  • the function of processing >3 ⁇ 4 text is the same as the specific processing principle and implementation principle.
  • the second device may send a multicast GRE protocol notification packet by using the second interface, to notify the first device that is the peer device, where the The IP address of the second interface is changed, so that the first device sends the data by using the changed IP address of the second interface as the destination IP address of the GRE tunnel.
  • the first interface of the first device and the second interface of the second device are configured with the GRE tunnel peer address learning function, and the first device receives the first interface sent by the second interface of the second device by using the first interface.
  • the multicast GRE protocol notification packet records the IP address of the second interface carried in the GRE tunnel as the destination IP address of the GRE tunnel, and sends a GRE protocol reply packet to the second interface through the first interface.
  • a GRE tunnel is established between the first device and the second device. Then, when the IP address of the first device or the second device is dynamically changed, the devices at both ends of the GRE tunnel configured with the GRE tunnel peer learning function automatically negotiate the IP address of the device port and update the changed IP address.
  • the method for establishing a general routing encapsulation protocol tunnel in the embodiment of the present invention includes:
  • the first device activates a GRE tunnel peer address learning function that is pre-configured on the first interface.
  • the first interface of the first device is configured with a GRE tunnel peer address learning function, and the GRE tunnel peer address may be activated by using an activation command. Learning function.
  • the first multicast GRE protocol notification packet sent by the second interface of the second device is received by the first interface.
  • the first multicast GRE protocol notification packet carries the IP address of the second interface, and the multicast GRE protocol notification packet indicates that the GRE protocol notification packet is sent in multicast form, and the first interface and the The GRE tunnel is configured between the second interface, and the GRE tunnel peer address learning function is configured on the first interface and the second interface, and the GRE tunnel peer address learning function is sent to the peer device of the GRE tunnel.
  • the GRE tunnel notification message, and the GRE tunnel notification message sent by the peer device, and the GRE protocol reply message are sent to the peer device.
  • the first device and the second device are both configured with a timer, so that the first device passes the first interface and the second device periodically, for example, 60 seconds through the second interface, to the GRE tunnel in a multicast manner.
  • the corresponding peer device interface sends a multicast GRE protocol notification packet, and the multicast GRE protocol notification packet carries its own IP address, so that the interface that receives the multicast GRE protocol notification packet can obtain the IP address. Therefore, the obtained IP address is notified to the peer device interface of the GRE tunnel.
  • the first device After the first device receives the first multicast GRE protocol notification message sent by the second interface of the second device, the first device determines whether the GRE tunnel peer address learning function is configured on the first interface, and if yes, the step is performed. 302. If not configured, the received first multicast GRE protocol notification packet is not processed, so that the efficiency of processing the first multicast GRE protocol notification packet by the entire system is improved.
  • the GRE tunnel address learning function is configured on the interface of the device in the interface attribute table by querying the interface attribute table saved in the device.
  • the first multicast GRE protocol notification packet is parsed, and the first multicast GRE protocol is verified according to the identity indication field carried therein Notification > 3 ⁇ 4 type of text.
  • the first The flag value of the flag field of the identity field in the packet header of the multicast GRE protocol notification packet is set to 1, indicating that the current packet is a GRE protocol notification packet.
  • the flag field of the identity field in the header of the GRE protocol-related packet is a reserved field, and does not have any identification meaning.
  • the first device verifies that the received packet type is a multicast GRE protocol notification packet, the first device checks the authentication key value (Key) carried in the first multicast GRE protocol notification packet and pre-configures on the first interface. If the authentication key (Key) is the same, if the same, the IP address of the second interface carried in the first multicast GRE protocol notification packet is recorded by the first device and the second device. Establish a GRE tunnel between them.
  • Key the authentication key value
  • the first device sends a GRE protocol reply message to the second interface by using the first interface, where the GRE protocol reply message carries an identity identifier field of the GRE protocol reply message, specifically The flag value of the identity field flag field of the GRE protocol reply message is set to 2.
  • the IP address of the second interface is recorded as the destination IP address of the GRE tunnel, and the GRE protocol reply message is sent to the second interface by using the first interface;
  • the IP address of the second interface is sent as the destination IP address of the GRE tunnel, and the GRE protocol reply packet is sent to the second interface by using the first interface, and the first device and the second device are A GRE tunnel is established between devices.
  • the received first multicast GRE protocol notification packet is discarded and is not processed.
  • the first device After the first device performs the data interaction between the first interface and the second interface of the second device in the GRE tunnel, the first device sends a keep-alive message to the second interface by using the first interface to detect Whether the GRE tunnel between the first interface and the second interface remains connected. Detect whether the communication status of the GRE tunnel is normal.
  • the IP address of the first interface or the IP address of the second interface changes, that is, when the destination IP address of the interface of the device at both ends of the GRE tunnel changes dynamically, the first device can detect the first interface and the second interface. The connections maintained between the interfaces through the GRE tunnel are no longer able to communicate properly.
  • the specific manner of detecting may be: within a preset duration, for example, 30 seconds, the first device detects whether the keep-alive message sent by the second device is received, and the keep-alive message is detecting the first interface and the second interface. Whether to maintain the connection corresponding to the GRE tunnel.
  • the first device may pass through the first interface Sending a keep-alive message to the second interface of the second device by using the GRE tunnel every 30 seconds, if the keep-alive message can reach the second interface, the second device sends a response packet by using the second interface
  • the GRE tunnel between the first interface and the second interface is confirmed to be alive, and a normal GRE tunnel connection is maintained. Otherwise, it may be determined that the connection maintained by the GRE tunnel between the first interface and the second interface fails to communicate normally.
  • the IP address of the first interface is used to notify the second interface to record the IP address of the first interface carried in the second multicast GRE notification packet as the destination IP address of the GRE tunnel. .
  • IP address of the first interface that is carried in the second multicast GRE notification packet may or may not be changed, and the second interface may directly directly use the IP address of the first interface.
  • the address record is the destination IP address of the GRE tunnel.
  • the IP address of the first interface may be changed, or the IP address of the second interface of the second device of the peer device of the GRE tunnel may be changed, and the first interface may not continue with the second interface.
  • the interface remains connected through the GRE tunnel.
  • the address is the destination IP address of the GRE tunnel.
  • the second multicast GRE protocol notifies the IP address of the second interface carried in the packet. Different from the IP address of the second interface carried in the first multicast GRE protocol notification packet, if the IP address of the second interface is changed, the third multicast GRE that the first device will receive The IP address of the second interface carried in the protocol notification packet is used as the destination IP address of the GRE tunnel.
  • the first interface of the first device and the second interface of the second device have the same function of receiving, sending, and processing the message, and the operation performed by the first device in the embodiment of the present invention is performed by using the first interface.
  • the process can also be completed by the second device through the second interface, the specific process being the same.
  • the second interface may be sent The multicast GRE protocol notification packet is sent to notify the IP address of the first device of the peer device that the changed IP address is sent, so that the first device sends the changed IP address as the destination IP address of the GRE tunnel.
  • the first device before the first device sends the multicast GRE tunnel notification message, the first device detects whether the GRE tunnel peer address learning function is configured on the first interface, so that all the GRE tunnel peer address learning functions are not configured.
  • the device interface saves the process of sending the multicast GRE protocol notification message, and improves the efficiency of the system processing the multicast GRE protocol notification message. If yes, the multicast GRE tunnel notification is sent in the form of multicast.
  • the first device verifies the first multicast GRE tunnel notification packet of the received second interface, and increases the correct rate of establishing the GRE tunnel. After the verification, the first device sends the first multicast.
  • the IP address of the second interface in the GRE tunnel notification packet is sent as the destination IP address of the GRE tunnel, and the keepalive message is used to check whether the first interface and the second interface are connected through the GRE tunnel. Then, when the IP address of the first interface is dynamically changed, the first interface and the second interface are not connected through the GRE tunnel, and the first interface and the second interface cannot pass.
  • the GRE tunnel communicates normally, and the first device may send a second multicast GRE tunnel notification message by using the GRE tunnel peer address learning function request, and the first multicast GRE tunnel notification message carries the first The changed IP address of the interface, so that the second interface that receives the second multicast GRE tunnel notification message uses the changed IP address carried in the interface as the destination IP address of the GRE tunnel.
  • Sending data if the first device receives the third multicast GRE protocol notification message sent by the second interface, the second multicast GRE protocol notification message carries the first multicast GRE protocol If the IP address of the second interface is changed, the second IP address of the second interface is received in the third multicast GRE protocol notification packet. The IP address of the interface is used as the destination IP address of the GRE tunnel.
  • the device at both ends of the GRE tunnel automatically negotiates the IP address of the device port. You do not need to manually configure the destination IP address of the GRE tunnel. After the IP address, the problem that the GRE service is unavailable due to frequent IP address changes is solved, and the device configuration cost can be reduced.
  • the intermediate device 403 includes two proxy interfaces, a first proxy interface, and a first device. And a second proxy interface, wherein the first proxy interface communicates with the first interface of the first device 401, and the second proxy interface communicates with the second interface of the second device 402.
  • the intermediate device 403 sends and receives the GRE protocol-related packet sent and received by the first device through the first interface through the first proxy interface, and sends and receives the second device through the second proxy interface.
  • the GRE dynamic proxy function is configured on the proxy interface of the intermediate device.
  • the interface of the intermediate device receives the GRE protocol-related packet, such as the GRE protocol notification packet or the GRE protocol reply packet, the GRE protocol is verified. Whether the key value of the packet is equal to the value of the key configured on the interface of the intermediate device.
  • the GRE protocol-related packet is redirected according to the interface and then sent from the corresponding interface.
  • the intermediate device completes the proxy function, and transparently transmits the received GRE protocol-related packet.
  • the first proxy interface receives the GRE protocol-related packet
  • the first proxy interface and the second proxy interface are one. If the group interface is the same, the first proxy interface does not perform any change on the GRE protocol-related packet, and the GRE protocol-related packet is transparently transmitted from the second proxy interface to the second interface of the second device;
  • the second proxy interface receives the GRE protocol-related packet.
  • the second proxy interface and the first proxy interface are a set of interface pairs, the second proxy interface does not perform any change on the GRE protocol-related packet, and the GRE protocol-related packet is The first proxy interface is transparently transmitted and sent to the first interface of the first device.
  • the GRE dynamic proxy function is configured on the two corresponding interfaces of each intermediate device, and the same bridge is added to form a proxy interface pair, so that the intermediate device can be transparently received through the proxy interface. Go to the GRE protocol related message.
  • one of the intermediate devices can also be designated as an intermediate device of the GRE dynamic proxy, and the GRE dynamic proxy function is configured on the two proxy interfaces of the intermediate device, and joins the same bridge to form And the proxy interface pair is configured to transparently transmit the received GRE protocol related packet by using the proxy interface.
  • the first device and the second device are enabled to communicate via an intermediate device that is a dynamic proxy for the GRE. All the devices in the system know that the intermediate device is an intermediate device configured with the GRE dynamic proxy function. Therefore, only the GRE protocol-related packets are sent to the intermediate device, and the GRE dynamic proxy function does not need to be configured in each intermediate device.
  • the other device performs the other communication process with the second device through the second interface by using the first interface, and FIG. 2 and FIG.
  • the embodiments are the same and will not be described here.
  • the communication device includes: The receiving unit 501 is configured to receive, by using the first interface, a first multicast general routing encapsulation protocol GRE protocol notification packet sent by the second interface of the second device, where the first multicast GRE protocol notification packet carries the A GRE tunnel is configured between the first interface and the second interface, and the GRE tunnel peer address learning function is configured on the first interface and the second interface.
  • the recording unit 502 is configured to record an IP address of the second interface received by the receiving unit as a destination IP address of the GRE tunnel;
  • the sending unit 503 is configured to send, by using the first interface, a first GRE protocol reply message to the second interface, where the first GRE protocol reply message carries an IP address of the first interface, so that the The second interface records the IP address of the first interface as the destination IP address of the GRE tunnel.
  • the receiving unit 501 receives the first multicast general routing encapsulation protocol GRE protocol notification packet sent by the second interface of the second device by using the first interface, where the first multicast GRE protocol notification packet is carried in the packet.
  • the GRE tunnel is configured between the first interface and the second interface, and the GRE tunnel peer address learning function is configured on the first interface and the second interface.
  • the unit 502 records the IP address of the second interface as the destination IP address of the GRE tunnel, and the sending unit 503 sends a first GRE protocol reply message to the second interface by using the first interface, where the first GRE is sent.
  • the protocol reply message carries the IP address of the first interface, so that the second interface records the IP address of the first interface as the destination IP address of the GRE tunnel.
  • the devices at both ends of the GRE tunnel configured with the GRE tunnel peer learning function automatically negotiate the IP address of the device port and update the changed IP address.
  • the destination IP address of the GRE tunnel is not required to be manually configured, so that the peer device obtains the changed IP address, which solves the problem that the GRE service is unavailable due to frequent IP address changes, and reduces the device configuration cost.
  • another embodiment of the communications device in the embodiment of the present invention includes: a receiving unit 601, configured to receive, by using the first interface, a first multicast universal routing encapsulation protocol GRE protocol sent by a second interface of the second device. a notification packet, the first multicast GRE protocol notification packet carries an Internet Protocol IP address of the second interface, and the GRE tunnel is configured between the first interface and the second interface, where the first interface is And the second interface is configured with GRE tunnel peer addressology a recording unit 602, configured to record an IP address of the second interface received by the receiving unit 601 as a destination IP address of the GRE tunnel;
  • the sending unit 603 is configured to send, by using the first interface, a first GRE protocol reply message to the second interface, where the first GRE protocol reply message carries an IP address of the first interface, so that the The second interface records the IP address of the first interface as the destination IP address of the GRE tunnel.
  • the communications device in the embodiment of the present invention may further include:
  • the detecting unit 604 is configured to send a keep-alive message to the second interface by using the first interface, to detect whether the GRE tunnel between the first interface and the second interface remains connected;
  • the sending unit 603 is further configured to: if the detecting unit 604 detects that the GRE tunnel between the first interface and the second interface is not connected, send a second multicast GRE protocol notification packet.
  • the second multicast GRE notification packet carries the IP address of the first interface, and is used to notify the second interface to notify the second interface that is carried in the second multicast GRE notification packet.
  • the IP address is recorded as the destination IP address of the GRE tunnel.
  • the communications device in the embodiment of the present invention may further include:
  • the activation unit 605 is configured to activate a pre-configured GRE tunnel peer address learning function of the first interface.
  • the receiving unit 601 is further configured to: if an intermediate device exists between the first device and the second device, receive, by using the first interface, the second transparent transmission of the corresponding interface of the intermediate device The GRE protocol-related packet sent by the second interface of the device;
  • the sending unit 602 is further configured to: if an intermediate device exists between the first device and the second device, transparently transmit a GRE protocol related report sent to the second interface by using a corresponding interface of the intermediate device Text
  • the GRE dynamic proxy function is configured on the corresponding interface of the intermediate device, so that the intermediate device transparently transmits the received GRE protocol related information through the corresponding interface.
  • the detecting unit 604 sends a keep-alive message to the second interface by using the first interface, to detect whether the GRE tunnel between the first interface and the second interface remains connected. Then, when the IP address of the first interface changes dynamically, the detecting unit 604 can detect the location The GRE tunnel between the first interface and the second interface is disconnected, and the sending unit 603 can send a second multicast GRE tunnel notification, by using the GRE tunnel peer address learning function, in the second multicast.
  • the GRE tunnel notification packet carries the changed IP address of the first interface, so that the second interface that receives the second multicast GRE tunnel notification packet sends the IP address carried in the GRE tunnel as the destination IP address of the GRE tunnel.
  • the second interface of the peer device of the GRE tunnel can also implement the same function as the first interface, so that the devices at both ends of the GRE tunnel can automatically negotiate the IP address of the device port.
  • the destination IP address so that the peer device obtains the changed IP address, solves the problem that the GRE service is unavailable due to frequent IP address changes, and reduces the device configuration cost.
  • the embodiment of the present invention further provides a communication device.
  • the communication device includes: a processor 701, a memory 702, a communication interface 703, and a bus 704.
  • the processor 701, the memory 702, and the communication interface 703 are connected to each other through a bus 704; the bus 704 may be an ISA bus, a PCI bus, or an EISA bus.
  • the bus can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, only one thick line is shown in Figure 7, but it does not mean that there is only one bus or one type of bus.
  • the memory 702 is configured to store a program.
  • the program can include program code, the program code including computer operating instructions.
  • Memory 702 may include high speed RAM memory and may also include non-volatile memory, such as at least one disk memory.
  • the processor 701 executes a program stored in the memory 702, and is configured to receive, by using the first interface, a first multicast general routing encapsulation protocol GRE protocol notification message sent by the second interface of the second device, where the first multicast GRE protocol notification
  • the packet carries the Internet Protocol IP address of the second interface, and the GRE tunnel is configured between the first interface and the second interface, and the first interface and the second interface are configured with a GRE tunnel peer address. Learning function
  • IP address of the second interface is carried in the second interface, so that the second interface records the IP address of the first interface as the destination IP address of the GRE tunnel.
  • the method further includes: sending, by using the first interface, a keep-alive message to the second interface, to detect whether the GRE tunnel between the first interface and the second interface is connected;
  • the GRE tunnel peer address learning function pre-configured by the first interface is also activated.
  • the second device is further configured to receive, by the first interface, the second device of the second device that is transparently transmitted by the corresponding interface of the intermediate device, if the intermediate device exists between the first device and the second device.
  • the GRE protocol-related packet sent by the interface, or the GRE protocol-related packet sent to the second interface is transparently transmitted through the corresponding interface of the intermediate device, where the GRE dynamic proxy is configured on the corresponding interface of the intermediate device.
  • the function of the intermediate device transparently transmits the received GRE protocol related packet through the corresponding interface.
  • the first interface of the communication device and the second interface of the GRE tunnel peer device are configured with the GRE tunnel peer address learning function, and the communication device uses the received IP address of the second interface as the destination IP address of the GRE tunnel.
  • the communication device can send the multicast GRE protocol notification packet in multicast mode through the GRE tunnel peer address learning function, and the changed IP address will be changed.
  • Notifying the second interface to the second interface so that the GRE tunnel peer device uses the changed IP address of the first interface as the destination IP address of the GRE tunnel, so that the device at both ends of the GRE tunnel automatically negotiates the configuration device port.
  • the IP address does not need to be manually configured with the destination IP address of the GRE tunnel, so that the peer device obtains the changed IP address, which solves the problem that the GRE service is unavailable due to frequent IP address changes, and reduces the device configuration cost.
  • the communication system includes:
  • First device 801 and second device 802 are first device 801 and second device 802;
  • the first device 801 is configured to receive, by using the first interface, a first multicast general routing encapsulation protocol GRE protocol notification packet sent by the second interface of the second device 802, where the first multicast GRE protocol notification packet
  • the GRE tunnel is configured to carry the GRE tunnel between the first interface and the second interface, and the GRE tunnel peer address learning function is configured on the first interface and the second interface.
  • the second device 802 is configured to send the first multicast GRE protocol notification packet by using a second interface, where the first multicast GRE protocol notification packet carries an IP address of the second interface, and receives the The first GRE protocol reply message sent by the first interface, the first GRE protocol reply message carrying the IP address of the first interface, and recording the IP address of the first interface as the GRE tunnel Destination IP address.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本发明实施例公开了一种GRE隧道建立方法,用于在GRE隧道两端设备自动协商配置设备端口的IP地址。本发明实施例方法包括:第一设备通过第一接口接收第二设备的第二接口发送的第一组播GRE协议通知报文,其中携带该第二接口的网际协议IP地址,该第一接口与该第二接口之间配置GRE隧道,该第一接口与该第二接口配置有GRE隧道对端地址学习功能,记录该第二接口的IP地址作为该GRE隧道的目的IP地址,并通过该第一接口向该第二接口发送第一GRE协议答复报文,其中携带该第一接口的IP地址,使得该第二接口将该第一接口的IP地址记录为该GRE隧道的目的IP地址。

Description

通用路由封装协议隧道建立方法、 通信设备及通信*** 本申请要求于 2013 年 01 月 29 日提交中国专利局、 申请号为 201310034528.6、 发明名称为"通用路由封装协议隧道建立方法、 通信设备及 通信***"的中国专利申请的优先权, 其全部内容通过引用结合在本申请中。 技术领域
本发明涉及通信技术领域, 尤其涉及一种通用路由封装协议隧道建立方 法、 通信设备及通信***。 背景技术
通用路由封装 ( generic routing encapsulation, 简称 GRE )协议, 是对某 些网络层协议, 如网络之间互连的协议 ( Internet protocol, 简称 IP )或互联网 分组交换协议 ( internetwork packet exchange protocol, 简称 IPX )数据才艮文进 行封装, 使这些被封装的数据报文能够在另一个网络层协议中传输, 如在 IP 层中传输。 GRE是虚拟专用网 ( virtual private network , 简称 VPN )的第三层 隧道协议,即在协议层之间釆用了一种被称之为隧道( Tunnel )的技术。 Tunnel 是一个虚拟的点对点的连接, 提供了一条通路使封装的数据报文能够通过该 通路上传输, 并且在一个 Tunnel的两端分别对数据报文进行封装及解封装。
现有技术中, 首先通过静态路由或者动态路由协议实现两台路由器之间 的互通, 然后在该两台路由器之间创建配置 GRE隧道, 指定该 GRE隧道的 源 IP地址、 目的 IP地址, 为使 GRE隧道在传输数据报文时支持动态路由协 议, 需要在该两台路由器上配置 GRE隧道的接口地址并手动选定该接口的源 IP地址和目的 IP地址。
在上述现有技术中, 当 GRE隧道的目的 IP地址, 即隧道对端设备的接口 配置的 IP 地址动态变化时, 如对端设备接口的 IP 地址是由点对点协议 ( oint-to-point protocol, 简称 PPP )协商得到的 IP地址, 再如手动更改该对 端设备接口的 IP地址,都只能手动修改 GRE隧道的对端设备接口的 IP地址。 特别是对于 3G接口, 由于网络原因会存在对端设备接口的 IP地址振荡的情 况, 使得 GRE隧道的目的 IP地址需要频繁更改, 而造成 GRE隧道无法正常 通信。 发明内容
本发明实施例提供了一种通用路由封装协议隧道建立方法、 通信设备及 通信***, 用以通过动态学习 GRE隧道的对端 IP地址建立 GRE隧道。
第一方面, 本发明提供一种通用路由封装协议隧道建立方法, 可包括: 第一设备通过第一接口接收第二设备的第二接口发送的第一组播通用路 由封装协议 GRE协议通知报文, 所述第一组播 GRE协议通知报文中携带所 述第二接口的网际协议 IP地址,所述第一接口与所述第二接口之间配置 GRE 隧道, 所述第一接口与所述第二接口配置有 GRE隧道对端地址学习功能; 记录所述第二接口的 IP地址作为所述 GRE隧道的目的 IP地址, 并通过 所述第一接口向所述第二接口发送第一 GRE协议答复报文, 所述第一 GRE 协议答复报文中携带所述第一接口的 IP地址, 使得所述第二接口将所述第一 接口的 IP地址记录为所述 GRE隧道的目的 IP地址。
在第一方面的第一种可能的实现方式中, 所述通过所述第一接口向所述 第二接口发送 GRE协议答复报文之后包括: 通过所述第一接口向所述第二接 口发送保活消息, 以检测所述第一接口与所述第二接口之间的所述 GRE隧道 是否保持连接;
若检测到所述第一接口与所述第二接口之间的所述 GRE 隧道未保持连 接, 则发送第二组播 GRE协议通知报文, 所述第二组播 GRE通知报文中携 带所述第一接口的 IP地址,用以通知所述第二接口将所述第二组播 GRE通知 报文中携带的所述第一接口的 IP地址记录为所述 GRE隧道的目的 IP地址。
结合第一方面或第一方面的第一种可能的实现方式, 在第二种可能的实 现方式中, 所述第一设备通过第一接口接收第二设备的第二接口发送的第一 组播 GRE协议通知报文之前, 还包括: 激活所述第一接口预先配置的 GRE 隧道对端地址学习功能。
结合第一方面的第二种可能的实现方式, 在第三种可能的实现方式中, 所述方法还包括: 若所述第一设备与所述第二设备之间存在中间设备, 则所 述第一设备通过第一接口接收所述中间设备的对应接口透传的所述第二设备 的第二接口发送的与 GRE协议相关报文, 或, 通过所述中间设备的对应接口 透传向所述第二接口发送的 GRE协议相关报文; 其中, 所述中间设备的对应接口上配置 GRE动态代理功能, 使得所述中 间设备通过所述对应接口透传接收的 GRE协议相关报文。
第二方面, 本发明提供一种通信设备, 可包括:
接收单元, 用于通过第一接口接收第二设备的第二接口发送的第一组播 通用路由封装协议 GRE协议通知报文, 所述第一组播 GRE协议通知报文中 携带所述第二接口的网际协议 IP地址, 所述第一接口与所述第二接口之间配 置 GRE隧道, 所述第一接口与所述第二接口配置有 GRE隧道对端地址学习 功能;
记录单元, 用于记录所述接收单元接收的所述第二接口的 IP地址作为所 述 GRE隧道的目的 IP地址;
发送单元, 用于通过所述第一接口向所述第二接口发送第一 GRE协议答 复报文,所述第一 GRE协议答复报文中携带所述第一接口的 IP地址,使得所 述第二接口将所述第一接口的 IP地址记录为所述 GRE隧道的目的 IP地址。
在第二方面的第一种可能的实现方式中, 所述设备还包括: 检测单元, 用于通过所述第一接口向所述第二接口发送保活消息, 以检测所述第一接口 与所述第二接口之间的所述 GRE隧道是否保持连接;
所述发送单元, 还用于若所述检测单元检测到所述第一接口与所述第二 接口之间的所述 GRE隧道未保持连接, 则发送第二组播 GRE协议通知报文, 所述第二组播 GRE通知报文中携带所述第一接口的 IP地址,用以通知所述第 二接口将所述第二组播 GRE通知报文中携带的所述第一接口的 IP地址记录为 所述 GRE隧道的目的 IP地址。
结合第二方面或第二方面的第一种可能的实现方式, 在第二种可能的实 现方式中, 所述设备还包括: 激活单元, 用于激活所述第一接口预先配置的 GRE隧道对端地址学习功能。
结合第二方面或第二方面的第二种可能的实现方式, 在第三种可能的实 现方式中, 所述接收单元, 还用于若所述第一设备与所述第二设备之间存在 中间设备, 则通过第一接口接收所述中间设备的对应接口透传的所述第二设 备的第二接口发送的与 GRE协议相关报文;
所述发送单元, 还用于若所述第一设备与所述第二设备之间存在中间设 备, 则通过所述中间设备的对应接口透传向所述第二接口发送的 GRE协议相 关报文; 其中, 所述中间设备的对应接口上配置 GRE动态代理功能, 使得所述中 间设备通过所述对应接口透传接收的 GRE协议相关报文。
第三方面, 本发明提供一种通信***, 可包括: 第一设备和第二设备; 其中, 所述第一设备用于通过第一接口接收第二设备的第二接口发送的 第一组播通用路由封装协议 GRE协议通知报文, 所述第一组播 GRE协议通 知报文中携带所述第二接口的网际协议 IP地址, 所述第一接口与所述第二接 口之间配置 GRE隧道, 所述第一接口与所述第二接口配置有 GRE隧道对端 地址学习功能, 记录所述第二接口的 IP地址作为所述 GRE隧道的目的 IP地 址, 并通过所述第一接口向所述第二接口发送第一 GRE协议答复报文, 所述 第一 GRE协议答复报文中携带所述第一接口的 IP地址,使得所述第二接口将 所述第一接口的 IP地址记录为所述 GRE隧道的目的 IP地址;
所述第二设备用于通过第二接口发送所述第一组播 GRE协议通知报文, 所述第一组播 GRE协议通知报文中携带所述第二接口的 IP地址,接收所述第 一接口发送的所述第一 GRE协议答复报文, 所述第一 GRE协议答复报文中 携带所述第一接口的 IP地址, 记录所述第一接口的 IP地址作为所述 GRE隧 道的目的 IP地址。
从以上技术方案可以看出, 本发明实施例具有以下优点: 第一设备的第 一接口与第二设备的第二接口均配置有 GRE隧道对端地址学习功能, 第一设 备通过第一接口接收第二设备的第二接口发送的第一组播 GRE协议通知报 文, 将其中携带的第二接口的 IP地址记录为所述 GRE隧道的目的 IP地址, 并通过所述第一接口向所述第二接口发送 GRE协议答复报文, 此时, 第一设 备与第二设备之间建立了 GRE隧道。那么, 当第一设备或第二设备的 IP地址 动态变化时, 配置了 GRE隧道对端地址学习功能的 GRE隧道两端设备自动 协商配置设备端口的 IP地址, 更新改变后的 IP地址,从而实现不需要手动配 置 GRE隧道的目的 IP地址, 而使得所述对端设备获取改变后的 IP地址, 解 决了 IP地址频繁变动造成 GRE业务不可用的问题,同时可降低设备配置成本。 附图说明
图 1为本发明实施例中通用路由封装协议隧道通信***结构示意图; 图 2为本发明实施例中通用路由封装协议隧道建立方法的示意图; 图 3为本发明实施例中通用路由封装协议隧道建立方法的另一示意图; 图 4 为本发明实施例中存在中 l'¾设备时通用路由封装协议隧道通信*** 结构示意图;
图 5为本发明实施例中通信设备的结构示意图;
图 6为本发明实施例中通信设备的另一结构示意图;
图 7为本发明实施例中通信设备的硬件结构示意图;
图 8为本发明实施例中通信***的一个实施例示意图。 具体实施方式
本发明实施例提供了一种通用路由封装协议隧道建立方法、 通信设备及 通信***,用于在 GRE隧道两端设备自动协商配置设备端口的 IP地址,可以 降低设备配置成本,并可以解决 IP地址频繁变动造成 GRE业务不可用的问题。
请参阅图 1 , 通用路由封装协议隧道通信***中, 第一设备 101与第二设 备 102的通过隧道 103相连, 首先通过静态路由或者动态路由协议实现所述 第一设备 101与所述第二设备 102的通过所述隧道 103互通,然后在隧道 103 两端配置 GRE隧道, 指定第一设备 101及第二设备 102相对于 GRE隧道的 接口地址。
本发明实施例中的第一设备及第二设备是支持 GRE隧道功能的设备, 可 以是路由器, 也可以是交换机、 防火墙等。
下面介绍本发明实施例中的通用路由封装协议隧道建立方法, 请参阅图 2 , 本发明实施例中的通用路由封装协议隧道建立方法包括:
201、 第一设备通过第一接口接收第二设备的第二接口发送的第一组播 GRE协议通知艮文;
所述第一组播 GRE协议通知报文中携带所述第二设备的第二接口的 IP 地址, 组播 GRE协议通知^艮文表示 GRE协议通知^艮文是以组播形式发送的, 所述第一接口与所述第二接口之间配置了 GRE隧道, 所述第一接口与所述第 二接口互为所述 GRE隧道的对端设备接口, 所述第一接口与所述第二接口配 置了 GRE隧道对端地址学习功能,所述 GRE隧道对端地址学习功能是指 GRE 隧道两端的设备可以通过 GRE协议交互, 动态学习对端设备的接口 IP地址; 也就是, 第一设备和第二设备相互作为所述 GRE隧道的对端设备, 第一设备 通过发送携带第一接口的 IP地址的组播 GRE协议通知报文、接收第二设备回 复的携带第二接口的 IP地址的 GRE协议答复报文,或者,接收第二设备发送 的携带第二接口的 IP地址的组播 GF¾协议通知报文、向第二设备发送携带第 一接口的 IP地址的 GRE协议答复报文,动态学习对端设备的接口的 IP地址。
在第一设备及第二设备内都设置有定时器, 第一设备中的定时器使得所 述第一设备可通过所述第一接口定期以组播的形式发送 GRE协议通知报文, 在 GRE协议通知报文中携带第一接口的 IP地址, 这样接收到组播 GRE协议 通知报文的第二接口可以获取所述第一接口的 IP地址, 从而将所述第一接口 的 IP地址通知到 GRE隧道的对端设备接口, 同样的,所述第二设备中的定时 器可使得所述第二设备通过所述第二接口定期以组播的形式发送 GRE协议通 知报文, 在 GRE协议通知报文中携带第二接口的 IP地址, 这样接收到组播 GRE协议通知报文的第一接口可以获取所述第二接口的 IP地址,从而将所述 第二接口的 IP地址通知到 GRE隧道的对端设备接口。
202、记录所述第二接口的 IP地址作为所述 GRE隧道的目的 IP地址, 并 通过所述第一接口向所述第二接口发送 GRE协议答复报文。
第一设备记录接收的所述第二接口的 IP地址作为所述 GRE隧道的目的 IP地址,并通过所述第一接口向所述第二接口发送 GRE协议答复报文,至此, 在第一设备与第二设备之间建立了 GRE隧道。
本实施例中, 第一设备和第二设备互为所述 GRE隧道的对端设备, 可以 理解的是, 第二设备的第二接口具有与第一设备的第一接口相同的接收、 发 送及处理>¾文的功能, 具体处理过程和实现原理相同。
可选地, 当所述第二接口的 IP地址发生改变时, 所述第二设备可通过第 二接口发送组播 GRE协议通知报文, 以通知作为对端设备的第一设备, 所述 第二接口改变后的 IP地址,使得所述第一设备将所述第二接口改变后的 IP地 址作为 GRE隧道的目的 IP地址发送数据。
本发明实施例中, 第一设备的第一接口与第二设备的第二接口均配置 GRE隧道对端地址学习功能, 第一设备通过第一接口接收第二设备的第二接 口发送的第一组播 GRE协议通知报文 ,将其中携带的第二接口的 IP地址记录 为所述 GRE隧道的目的 IP地址, 并通过所述第一接口向所述第二接口发送 GRE协议答复报文,此时,第一设备与第二设备之间建立了 GRE隧道。那么, 当第一设备或第二设备的 IP地址动态变化时,配置了 GRE隧道对端地址学习 功能的 GRE隧道两端设备自动协商配置设备端口的 IP地址, 更新改变后的 IP地址, 从而实现不需要手动配置 GRE隧道的目的 IP地址, 而使得所述对 端设备获取改变后的 IP地址, 解决了 IP地址频繁变动造成 GRE业务不可用 的问题, 同时可降低设备配置成本。 阅图 3 , 本发明实施例中的通用路由封装协议隧道建立方法包括:
301、 第一设备激活第一接口预先配置的 GRE隧道对端地址学习功能; 第一设备的第一接口预先配置了 GRE隧道对端地址学习功能, 通过激活 指令可以激活所述 GRE隧道对端地址学习功能。
302、 通过第一接口接收第二设备的第二接口发送的第一组播 GRE协议 通知报文;
所述第一组播 GRE协议通知报文中携带所述第二接口的 IP地址, 组播 GRE协议通知报文表示 GRE协议通知报文是以组播形式发送的,所述第一接 口与所述第二接口之间配置 GRE 隧道, 所述第一接口与所述第二接口配置 GRE 隧道对端地址学习功能, 所述 GRE 隧道对端地址学习功能是指向所述 GRE隧道的对端设备发送 GRE隧道通知报文,以及应答所述对端设备发送的 GRE隧道通知艮文、 向所述对端设备发送 GRE协议答复艮文。
在第一设备及第二设备都设置有定时器, 使得所述第一设备通过第一接 口及所述第二设备通过第二接口定期, 例如 60秒, 以组播的形式向所述 GRE 隧道对应的各自的对端设备接口发送组播 GRE协议通知报文, 在组播 GRE 协议通知报文中携带各自的 IP地址,这样接收到组播 GRE协议通知报文的接 口可以获取其中的 IP地址, 从而将获取的 IP地址通知到 GRE隧道的对端设 备接口。
第一设备通过第一接口接收第二设备的第二接口发送的第一组播 GRE协 议通知报文后, 判断第一接口是否配置了 GRE隧道对端地址学习功能, 若配 置了, 则执行步骤 302, 若未配置, 则对接收的所述第一组播 GRE协议通知 报文不作处理, 这样, 提高整个***处理所述第一组播 GRE协议通知报文的 效率。 判断的具体方式可以是通过查询设备中保存的接口属性表, 在所述接 口属性表中记录了设备的接口中是否配置有 GRE隧道地址学习功能。
303、 对所述第一组播 GRE协议通知报文进行验证;
当确定第一设备的第一接口配置 GRE隧道对端地址学习功能, 则解析所 述第一组播 GRE协议通知报文, 根据其中携带的身份标示字段, 验证根据所 述第一组播 GRE协议通知>¾文的类型。 具体地, 在本实施例中, 将所述第一 组播 GRE协议通知报文的报文头中身份标识字段 flag字段的标志值设置为 1 , 表明当前的报文为 GRE协议通知报文。 通常 GRE协议相关报文的报文头中 身份标识字段 flag字段为预留字段, 不具有任何标识意义。
当第一设备验证接收到的报文类型为组播 GRE协议通知报文, 进一步校 验所述第一组播 GRE协议通知报文中携带的验证键值 ( Key )与第一接口上 预先配置的验证键值(Key )是否相同, 若相同, 则通过验证, 记录所述第一 组播 GRE协议通知报文中携带的所述第二接口的 IP地址 ,在第一设备与第二 设备之间建立 GRE隧道。
进一步地, 所述第一设备通过所述第一接口向所述第二接口发送 GRE协 议答复报文, 所述 GRE协议答复报文中携带所述 GRE协议答复报文的身份 标识字段, 具体地, 所述 GRE协议答复报文的身份标识字段 flag字段的标志 值设置为 2。
304、 当验证通过, 记录所述第二接口的 IP地址作为所述 GRE隧道的目 的 IP地址, 并通过所述第一接口向所述第二接口发送 GRE协议答复报文; 第一设备将记录的所述第二接口的 IP地址作为所述 GRE隧道的目的 IP 地址发送数据,并通过所述第一接口向所述第二接口发送 GRE协议答复报文, 至此, 在第一设备与第二设备之间建立了 GRE隧道。
若未通过验证, 则将接收到的所述第一组播 GRE协议通知报文丟弃不作 处理。
305、 通过所述第一接口向所述第二接口发送保活消息, 以检测所述第一 接口与所述第二接口之间的所述 GRE隧道是否保持连接;
第一设备通过第一接口与第二设备的第二接口在所述 GRE隧道中实现数 据交互后, 所述第一设备通过所述第一接口向所述第二接口发送保活消息, 以检测所述第一接口与所述第二接口之间的所述 GRE隧道是否保持连接。 检 测所述 GRE隧道通信状况是否正常。 当第一接口的 IP地址或第二接口的 IP 地址发生改变时, 即 GRE隧道两端设备接口的目的 IP地址动态变化时,第一 设备便可检测到所述第一接口与所述第二接口之间通过 GRE隧道保持的连接 已不能正常通信。
检测的具体方式可以是, 在预置时长内, 例如 30秒, 第一设备检测是否 接收到所述第二设备发送的保活消息, 所述保活消息是检测第一接口与第二 接口间是否保持与 GRE隧道对应的连接。 所述第一设备通过第一接口可以每 隔 30秒通过所述 GRE隧道向所述第二设备的第二接口发送保活消息, 如果 所述保活消息可到达所述第二接口, 所述第二设备通过第二接口发送响应报 文, 便可确认所述第一接口与所述第二接口之间的 GRE隧道是存活的, 保持 正常的 GRE隧道连接。 否则, 则可确定所述第一接口与所述第二接口之间通 过 GRE隧道保持的连接已不能正常通信。
306、 若检测到所述第一接口与所述第二接口之间的所述 GRE隧道未保 持连接, 则发送第二组播 GRE协议通知报文, 所述第二组播 GRE通知报文 中携带所述第一接口的 IP地址,用以通知所述第二接口将所述第二组播 GRE 通知报文中携带的所述第一接口的 IP地址记录为所述 GRE隧道的目的 IP地 址。
需要说明的是,所述第二组播 GRE通知报文中携带的所述第一接口的 IP 地址可能已改变, 也可能未改变, 所述第二接口可直接将所述第一接口的 IP 地址记录为所述 GRE隧道的目的 IP地址。
若所述第一设备检测到第一接口与所述第二接口之间的所述 GRE隧道未 保持连接,所述第一接口与所述第二接口已不能通过所述 GRE隧道正常通信, 则可能是由于所述第一接口的 IP地址发生改变,或,所述 GRE隧道的对端设 备第二设备的第二接口 IP地址发生改变, 而导致所述第一接口无法继续与所 述第二接口通过所述 GRE隧道的保持连接。 则发送第二组播 GRE协议通知 报文,所述第二组播 GRE通知报文中携带 IP地址,用以通知所述第二接口将 所述第二组播 GRE通知 ^艮文中携带的 IP地址作为所述 GRE隧道的目的 IP地 址。
需要说明的是, 若所述第一接口接收到所述第二接口发送的第三组播 GRE协议通知报文,所述第二组播 GRE协议通知报文中携带的第二接口的 IP 地址与所述第一组播 GRE协议通知报文中携带的所述第二接口的 IP地址不 同, 表示第二接口的 IP地址发生了改变, 则第一设备将接收的所述第三组播 GRE协议通知报文中携带的所述第二接口的 IP地址作为所述 GRE隧道的目 的 IP地址。
本实施例中, 第一设备的第一接口与第二设备的第二接口具有相同的接 收、 发送及处理报文的功能, 本发明实施例中的第一设备通过第一接口所执 行的操作过程也可由第二设备通过第二接口完成, 具体过程相同。 那么, 对 于第二设备而言, 当所述第二接口的 IP地址发生改变时, 可通过第二接口发 送组播 GRE协议通知报文,以通知作为对端设备的第一设备改变后的 IP地址, 使得所述第一设备将改变后的 IP地址作为 GRE隧道的目的 IP地址发送数据。 需要说明的是, 第一设备通过第一接口发送组播 GRE隧道通知报文之前, 检 测所述第一接口是否配置 GRE 隧道对端地址学习功能, 这样, 所有未配置 GRE隧道对端地址学习功能的设备接口节省发送组播 GRE协议通知^艮文的处 理过程, 提高***处理组播 GRE协议通知报文的效率, 若是, 则以组播的形 式发送组播 GRE隧道通知 ^艮文。
本发明实施例中, 第一设备对接收到的第二接口的第一组播 GRE隧道通 知报文进行验证, 增加建立 GRE隧道的正确率, 通过验证后第一设备将所述 第一组播 GRE隧道通知报文中的第二接口的 IP地址作为所述 GRE隧道的目 的 IP地址发送数据, 通过保活消息检测所述第一接口与所述第二接口之间是 否通过 GRE隧道保持连接, 那么, 当第一接口的 IP地址动态变化时, 可检测 到所述第一接口与所述第二接口之间通过 GRE隧道未保持连接, 所述第一接 口与所述第二接口已不能通过所述 GRE隧道正常通信,第一设备可通过 GRE 隧道对端地址学习功能请求发送第二组播 GRE隧道通知>¾文, 在所述第二组 播 GRE隧道通知报文中携带所述第一接口改变后的 IP地址,使得接收到所述 第二组播 GRE隧道通知报文的第二接口将其中携带的改变后的 IP地址作为 GRE隧道的目的 IP地址发送数据,若所述第一设备接收到所述第二接口发送 的第三组播 GRE协议通知报文, 所述第二组播 GRE协议通知报文中携带与 所述第一组播 GRE协议通知报文中携带的不同于所述第二接口的 IP地址 ,表 示第二接口的 IP地址发生了改变,则将接收的所述第三组播 GRE协议通知报 文中携带的所述第二接口的 IP地址作为所述 GRE隧道的目的 IP地址, 从而 实现 GRE隧道两端设备自动协商配置设备端口的 IP地址, 不需要手动配置 GRE隧道的目的 IP地址, 而使得所述对端设备获取改变后的 IP地址, 解决 了 IP地址频繁变动造成 GRE业务不可用的问题, 同时可降低设备配置成本。
在实际应用中, 更为常见的应用场景是在所述第一设备与所述第二设备 之间存在中间设备, 请参阅图 4, 中间设备 403包括两个代理接口, 第一代理 接口和第二代理接口, 其中第一代理接口与所述第一设备 401 的第一接口通 信, 第二代理接口与所述第二设备 402的第二接口通信。
具体地, 中间设备 403通过第一代理接口收发所述第一设备通过第一接 口收发的 GRE协议相关报文, 通过第二代理接口收发所述第二设备通过第二 接口收发的 GRE协议相关报文, 在所述第一代理接口和所述第二代理接口上 配置 GRE动态代理功能, 而后将所述第一代理接口和所述第二代理接口加入 同一网桥内, 形成代理接口对, 并保存该代理接口对信息。 由于在中间设备 的代理接口上配置 GRE动态代理功能, 那么, 当中间设备的接口收到 GRE 协议相关报文, 如 GRE协议通知报文、 GRE协议答复报文时, 验证接收到的 GRE协议相关报文的 Key值是否与中间设备的接口上配置的 Key值相等, 若 通过验证, 则将上述 GRE协议相关报文根据接口对信息重定向后从对应接口 发出。 根据该接口对信息, 中间设备完成代理功能, 透传接收到的 GRE协议 相关报文, 例如, 当第一代理接口接收到 GRE协议相关报文, 由于第一代理 接口与第二代理接口是一组接口对, 则第一代理接口不对 GRE协议相关报文 进行任何更改, 将该 GRE协议相关报文从第二代理接口中透传出去, 发送给 第二设备的第二接口; 反之, 当第二代理接口接收到 GRE协议相关报文, 由 于第二代理接口与第一代理接口是一组接口对, 则第二代理接口不对 GRE协 议相关报文进行任何更改, 将该 GRE协议相关报文从第一代理接口中透传出 去, 发送给第一设备的第一接口。
网络中可能存在多个中间设备, 在每个中间设备的两个对应接口上配置 GRE动态代理功能, 并加入同一个网桥, 形成代理接口对, 使得中间设备可 以通过代理接口对, 透传接收到 GRE协议相关报文。
可以理解的, 在多个中间设备, 也可指定其中一个中间设备作为 GRE动 态代理的中间设备, 在所述中间设备的两个代理接口上配置 GRE动态代理功 能, 并加入同一个网桥, 形成代理接口对, 使得所述中间设备通过所述代理 接口对透传接收到的 GRE协议相关报文。 使得所述第一设备和所述第二设备 可以通过作为 GRE动态代理的中间设备进行通信。 ***中所有设备都知道该 中间设备是配置了 GRE动态代理功能的中间设备, 因此, 只向该中间设备发 送 GRE协议相关报文, 而不需要在各个中间设备中均配置 GRE动态代理功
•6匕
匕。
除上述通过代理设备进行代理通信的过程之外, 所述第一设备通过所述 第一接口与所述第二设备通过所述第二接口进行的其他通信过程, 与图 2及 图 3所示实施例相同, 此处不再赘述。
下面详细介绍本发明实施例中的实施图 1至图 4任一实施例中通信设备, 请参阅图 5, 所述通信设备包括: 接收单元 501 ,用于通过第一接口接收第二设备的第二接口发送的第一组 播通用路由封装协议 GRE协议通知报文, 所述第一组播 GRE协议通知报文 中携带所述第二接口的网际协议 IP地址, 所述第一接口与所述第二接口之间 配置 GRE隧道, 所述第一接口与所述第二接口配置有 GRE隧道对端地址学 习功能;
记录单元 502, 用于记录所述接收单元接收的所述第二接口的 IP地址作 为所述 GRE隧道的目的 IP地址;
发送单元 503 , 用于通过所述第一接口向所述第二接口发送第一 GRE协 议答复报文,所述第一 GRE协议答复报文中携带所述第一接口的 IP地址,使 得所述第二接口将所述第一接口的 IP地址记录为所述 GRE隧道的目的 IP地 址。
本发明实施例中通信设备的各功能单元实现功能的具体过程, 请参阅前 述图 2所示实施例中描述的具体内容, 此处不再赘述。
本发明实施例中, 接收单元 501 通过第一接口接收第二设备的第二接口 发送的第一组播通用路由封装协议 GRE协议通知报文, 所述第一组播 GRE 协议通知报文中携带所述第二接口的网际协议 IP地址, 所述第一接口与所述 第二接口之间配置 GRE隧道, 所述第一接口与所述第二接口配置有 GRE隧 道对端地址学习功能, 记录单元 502 记录所述第二接口的 IP地址作为所述 GRE隧道的目的 IP地址,发送单元 503通过所述第一接口向所述第二接口发 送第一 GRE协议答复报文, 所述第一 GRE协议答复报文中携带所述第一接 口的 IP地址, 使得所述第二接口将所述第一接口的 IP地址记录为所述 GRE 隧道的目的 IP地址。 那么, 当第一设备或第二设备的 IP地址动态变化时, 配 置了 GRE隧道对端地址学习功能的 GRE隧道两端设备自动协商配置设备端 口的 IP地址, 更新改变后的 IP地址, 从而实现不需要手动配置 GRE隧道的 目的 IP地址, 而使得所述对端设备获取改变后的 IP地址, 解决了 IP地址频 繁变动造成 GRE业务不可用的问题, 同时可降低设备配置成本。
请参阅图 6, 本发明实施例中的通信设备的另一个实施例包括: 接收单元 601 ,用于通过第一接口接收第二设备的第二接口发送的第一组 播通用路由封装协议 GRE协议通知报文, 所述第一组播 GRE协议通知报文 中携带所述第二接口的网际协议 IP地址, 所述第一接口与所述第二接口之间 配置 GRE隧道, 所述第一接口与所述第二接口配置有 GRE隧道对端地址学 记录单元 602, 用于记录所述接收单元 601接收的所述第二接口的 IP地 址作为所述 GRE隧道的目的 IP地址;
发送单元 603 , 用于通过所述第一接口向所述第二接口发送第一 GRE协 议答复报文,所述第一 GRE协议答复报文中携带所述第一接口的 IP地址,使 得所述第二接口将所述第一接口的 IP地址记录为所述 GRE隧道的目的 IP地 址。
进一步地, 本发明实施例中的通信设备还可以包括:
检测单元 604, 用于通过所述第一接口向所述第二接口发送保活消息, 以 检测所述第一接口与所述第二接口之间的所述 GRE隧道是否保持连接;
所述发送单元 603 ,还用于若所述检测单元 604检测到所述第一接口与所 述第二接口之间的所述 GRE隧道未保持连接, 则发送第二组播 GRE协议通 知报文,所述第二组播 GRE通知报文中携带所述第一接口的 IP地址,用以通 知所述第二接口将所述第二组播 GRE通知报文中携带的所述第一接口的 IP 地址记录为所述 GRE隧道的目的 IP地址。
进一步地, 本发明实施例中的通信设备还可以包括:
激活单元 605 , 用于激活所述第一接口预先配置的 GRE隧道对端地址学 习功能。
进一步地, 所述接收单元 601 , 还用于若所述第一设备与所述第二设备 之间存在中间设备, 则通过第一接口接收所述中间设备的对应接口透传的所 述第二设备的第二接口发送的与 GRE协议相关报文;
所述发送单元 602,还用于若所述第一设备与所述第二设备之间存在中间 设备, 则通过所述中间设备的对应接口透传向所述第二接口发送的 GRE协议 相关报文;
其中, 所述中间设备的对应接口上配置 GRE动态代理功能, 使得所述中 间设备通过所述对应接口透传接收的所述 GRE协议相关 ^艮文。
本发明实施例中通信设备的各功能单元实现功能的具体过程, 请参阅前 述图 2及图 3所示实施例中描述的具体内容, 此处不再赘述。
本发明实施例中, 检测单元 604通过所述第一接口向所述第二接口发送 保活消息, 以检测所述第一接口与所述第二接口之间的所述 GRE隧道是否保 持连接, 那么, 当第一接口的 IP地址动态变化时, 检测单元 604可检测到所 述第一接口与所述第二接口之间的 GRE隧道断开 ,发送单元 603可通过 GRE 隧道对端地址学习功能请求发送第二组播 GRE隧道通知>¾文, 在所述第二组 播 GRE隧道通知报文中携带所述第一接口改变后的 IP地址,使得接收到所述 第二组播 GRE隧道通知报文的第二接口将其中携带的 IP地址作为 GRE隧道 的目的 IP地址发送数据, 同理,所述 GRE隧道的对端设备的第二接口也可实 现与第一接口同样的功能, 从而实现 GRE隧道两端设备自动协商配置设备端 口的 IP地址, 不需要手动配置 GRE隧道的目的 IP地址, 而使得所述对端设 备获取改变后的 IP地址, 解决了 IP地址频繁变动造成 GRE业务不可用的问 题, 同时可降低设备配置成本。
本发明实施例还提供了一种通信设备, 请参阅图 7, 所述通信设备包括: 处理器 701、 存储器 702、 通信接口 703和总线 704。
处理器 701、 存储器 702、 通信接口 703通过总线 704相互连接; 总线 704可以是 ISA总线、 PCI总线或 EISA总线等。 所述总线可以分 为地址总线、 数据总线、 控制总线等。 为便于表示, 图 7中仅用一条粗 线表示, 但并不表示仅有一根总线或一种类型的总线。
存储器 702 , 用于存放程序。 具体地, 程序可以包括程序代码, 所 述程序代码包括计算机操作指令。 存储器 702可能包含高速 RAM存储 器, 也可能还包括非易失性存储器 ( non-volatile memory ) , 例如至少 一个磁盘存储器。
处理器 701执行存储器 702所存放的程序, 用于通过第一接口接收第 二设备的第二接口发送的第一组播通用路由封装协议 GRE协议通知报文, 所 述第一组播 GRE协议通知报文中携带所述第二接口的网际协议 IP地址 ,所述 第一接口与所述第二接口之间配置 GRE隧道, 所述第一接口与所述第二接口 配置有 GRE隧道对端地址学习功能;
记录所述第二接口的 IP地址作为所述 GRE隧道的目的 IP地址, 并通过 所述第一接口向所述第二接口发送第一 GRE协议答复报文, 所述第一 GRE 协议答复报文中携带所述第一接口的 IP地址, 使得所述第二接口将所述第一 接口的 IP地址记录为所述 GRE隧道的目的 IP地址。
进一步地, 还用于通过所述第一接口向所述第二接口发送保活消息, 以 检测所述第一接口与所述第二接口之间的所述 GRE隧道是否保持连接;
若检测到所述第一接口与所述第二接口之间的所述 GRE 隧道未保持连 接, 则发送第二组播 GRE协议通知报文, 所述第二组播 GRE通知报文中携 带所述第一接口的 IP地址,用以通知所述第二接口将所述第二组播 GRE通知 报文中携带的所述第一接口的 IP地址记录为所述 GRE隧道的目的 IP地址。
还用于激活所述第一接口预先配置的 GRE隧道对端地址学习功能。
还用于若所述第一设备与所述第二设备之间存在中间设备, 则所述第一 设备通过第一接口接收所述中间设备的对应接口透传的所述第二设备的第二 接口发送的与 GRE协议相关报文, 或, 通过所述中间设备的对应接口透传向 所述第二接口发送的 GRE协议相关报文, 其中, 所述中间设备的对应接口上 配置 GRE 动态代理功能, 使得所述中间设备通过所述对应接口透传接收的 GRE协议相关报文。
本实施例中, 通信设备的第一接口与 GRE隧道对端设备的第二接口均配 置 GRE隧道对端地址学习功能,通信设备将接收的第二接口的 IP地址作为所 述 GRE隧道的目的 IP地址发送数据, 那么, 当 GRE隧道对端设备的目的 IP 地址动态变化时, 通信设备可通过 GRE隧道对端地址学习功能以组播方式发 送组播 GRE协议通知报文,将改变后的 IP地址通过第一接口通知给第二接口, 以使所述 GRE隧道对端设备将所述第一接口改变后的 IP地址作为 GRE隧道 的目的 IP地址, 从而实现 GRE隧道两端设备自动协商配置设备端口的 IP地 址,不需要手动配置 GRE隧道的目的 IP地址, 而使得所述对端设备获取改变 后的 IP地址, 解决了 IP地址频繁变动造成 GRE业务不可用的问题, 同时可 降低设备配置成本。
下面介绍本发明实施例中的实施图 1至图 4任一实施例中的通信***, 请参阅图 8, 所述通信***包括:
第一设备 801和第二设备 802;
其中, 所述第一设备 801用于通过第一接口接收第二设备 802的第二接 口发送的第一组播通用路由封装协议 GRE协议通知报文,所述第一组播 GRE 协议通知报文中携带所述第二接口的网际协议 IP地址, 所述第一接口与所述 第二接口之间配置 GRE隧道, 所述第一接口与所述第二接口配置有 GRE隧 道对端地址学习功能, 记录所述第二接口的 IP地址作为所述 GRE隧道的目 的 IP地址,并通过所述第一接口向所述第二接口发送第一 GRE协议答复报文, 所述第一 GRE协议答复报文中携带所述第一接口的 IP地址,使得所述第二接 口将所述第一接口的 IP地址记录为所述 GRE隧道的目的 IP地址; 所述第二设备 802用于通过第二接口发送所述第一组播 GRE协议通知报 文,所述第一组播 GRE协议通知报文中携带所述第二接口的 IP地址,接收所 述第一接口发送的所述第一 GRE协议答复报文, 所述第一 GRE协议答复报 文中携带所述第一接口的 IP地址 ,记录所述第一接口的 IP地址作为所述 GRE 隧道的目的 IP地址。
本领域技术人员可以理解实现上述实施例方法中的全部或部分步骤是可 以通过程序来指令相关的硬件完成, 所述的程序可以存储于一种计算机可读 存储介质中, 上述提到的存储介质可以是只读存储器, 磁盘或光盘等。
以上对本发明所提供的一种通用路由封装协议隧道建立方法、 通信设备 及通信***进行了详细介绍, 对于本领域的技术人员, 依据本发明实施例的 思想, 在具体实施方式及应用范围上均会有改变之处, 综上所述, 本说明书 内容不应理解为对本发明的限制。

Claims

权 利 要 求 书
1、 一种通用路由封装协议隧道建立方法, 其特征在于, 包括:
第一设备通过第一接口接收第二设备的第二接口发送的第一组播通用路 由封装协议 GRE协议通知报文, 所述第一组播 GRE协议通知报文中携带所 述第二接口的网际协议 IP地址,所述第一接口与所述第二接口之间配置 GRE 隧道, 所述第一接口与所述第二接口配置有 GRE隧道对端地址学习功能; 记录所述第二接口的 IP地址作为所述 GRE隧道的目的 IP地址, 并通过 所述第一接口向所述第二接口发送第一 GRE协议答复报文, 所述第一 GRE 协议答复报文中携带所述第一接口的 IP地址, 使得所述第二接口将所述第一 接口的 IP地址记录为所述 GRE隧道的目的 IP地址。
2、 根据权利要求 1所述的方法, 其特征在于, 所述通过所述第一接口向 所述第二接口发送 GRE协议答复报文之后包括:
通过所述第一接口向所述第二接口发送保活消息, 以检测所述第一接口 与所述第二接口之间的所述 GRE隧道是否保持连接;
若检测到所述第一接口与所述第二接口之间的所述 GRE 隧道未保持连 接, 则发送第二组播 GRE协议通知报文, 所述第二组播 GRE通知报文中携 带所述第一接口的 IP地址,用以通知所述第二接口将所述第二组播 GRE通知 报文中携带的所述第一接口的 IP地址记录为所述 GRE隧道的目的 IP地址。
3、 根据权利要求 1或 2所述的方法, 其特征在于, 所述第一设备通过第 一接口接收第二设备的第二接口发送的第一组播 GRE协议通知报文之前, 还 包括:
激活所述第一接口预先配置的 GRE隧道对端地址学习功能。
4、 根据权利要求 1至 3任一项所述的方法, 其特征在于, 所述方法还包 括:
若所述第一设备与所述第二设备之间存在中间设备, 则所述第一设备通 过第一接口接收所述中间设备的对应接口透传的所述第二设备的第二接口发 送的与 GRE协议相关报文, 或, 通过所述中间设备的对应接口透传向所述第 二接口发送的 GRE协议相关报文;
其中, 所述中间设备的对应接口上配置 GRE动态代理功能, 使得所述中 间设备通过所述对应接口透传接收的 GRE协议相关报文。
5、 一种通信设备, 其特征在于, 包括:
接收单元, 用于通过第一接口接收第二设备的第二接口发送的第一组播 通用路由封装协议 GRE协议通知报文, 所述第一组播 GRE协议通知报文中 携带所述第二接口的网际协议 IP地址, 所述第一接口与所述第二接口之间配 置 GRE隧道, 所述第一接口与所述第二接口配置有 GRE隧道对端地址学习 功能;
记录单元, 用于记录所述接收单元接收的所述第二接口的 IP地址作为所 述 GRE隧道的目的 IP地址;
发送单元, 用于通过所述第一接口向所述第二接口发送第一 GRE协议答 复报文,所述第一 GRE协议答复报文中携带所述第一接口的 IP地址,使得所 述第二接口将所述第一接口的 IP地址记录为所述 GRE隧道的目的 IP地址。
6、 根据权利要求 5所述的设备, 其特征在于, 所述设备还包括: 检测单元, 用于通过所述第一接口向所述第二接口发送保活消息, 以检 测所述第一接口与所述第二接口之间的所述 GRE隧道是否保持连接;
所述发送单元, 还用于若所述检测单元检测到所述第一接口与所述第二 接口之间的所述 GRE隧道未保持连接, 则发送第二组播 GRE协议通知报文, 所述第二组播 GRE通知报文中携带所述第一接口的 IP地址,用以通知所述第 二接口将所述第二组播 GRE通知报文中携带的所述第一接口的 IP地址记录为 所述 GRE隧道的目的 IP地址。
7、 根据权利要求 5或 6所述的设备, 其特征在于, 所述设备还包括: 激活单元, 用于激活所述第一接口预先配置的 GRE隧道对端地址学习功 能。
8、 根据权利要求 7所述的设备, 其特征在于,
所述接收单元, 还用于若所述第一设备与所述第二设备之间存在中间设 备, 则通过第一接口接收所述中间设备的对应接口透传的所述第二设备的第 二接口发送的与 GRE协议相关报文;
所述发送单元, 还用于若所述第一设备与所述第二设备之间存在中间设 备, 则通过所述中间设备的对应接口透传向所述第二接口发送的 GRE协议相 关报文;
其中, 所述中间设备的对应接口上配置 GRE动态代理功能, 使得所述中 间设备通过所述对应接口透传接收的 GRE协议相关报文。
9、 一种通信***, 其特征在于, 包括:
第一设备和第二设备;
其中, 所述第一设备用于通过第一接口接收第二设备的第二接口发送的 第一组播通用路由封装协议 GRE协议通知报文, 所述第一组播 GRE协议通 知报文中携带所述第二接口的网际协议 IP地址, 所述第一接口与所述第二接 口之间配置 GRE隧道, 所述第一接口与所述第二接口配置有 GRE隧道对端 地址学习功能, 记录所述第二接口的 IP地址作为所述 GRE隧道的目的 IP地 址, 并通过所述第一接口向所述第二接口发送第一 GRE协议答复报文, 所述 第一 GRE协议答复报文中携带所述第一接口的 IP地址,使得所述第二接口将 所述第一接口的 IP地址记录为所述 GRE隧道的目的 IP地址;
所述第二设备用于通过第二接口发送所述第一组播 GRE协议通知报文, 所述第一组播 GRE协议通知报文中携带所述第二接口的 IP地址,接收所述第 一接口发送的所述第一 GRE协议答复报文, 所述第一 GRE协议答复报文中 携带所述第一接口的 IP地址, 记录所述第一接口的 IP地址作为所述 GRE隧 道的目的 IP地址。
PCT/CN2013/078803 2013-01-29 2013-07-04 通用路由封装协议隧道建立方法、通信设备及通信*** WO2014117475A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201310034528.6 2013-01-29
CN201310034528.6A CN103973555A (zh) 2013-01-29 2013-01-29 通用路由封装协议隧道建立方法、通信设备及通信***

Publications (1)

Publication Number Publication Date
WO2014117475A1 true WO2014117475A1 (zh) 2014-08-07

Family

ID=51242617

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2013/078803 WO2014117475A1 (zh) 2013-01-29 2013-07-04 通用路由封装协议隧道建立方法、通信设备及通信***

Country Status (2)

Country Link
CN (1) CN103973555A (zh)
WO (1) WO2014117475A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
SE2050312A1 (en) * 2020-03-23 2021-09-24 Telia Co Ab A method and a system for routing data packets in a network
SE2050610A1 (en) * 2020-05-27 2021-09-28 Telia Co Ab Methods and an apparatus for routing data packets in a network topology

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104683210B (zh) * 2015-03-10 2018-10-09 新华三技术有限公司 一种自动建立隧道的方法和装置
CN109600293B (zh) * 2018-12-24 2021-06-04 青岛海信电子设备股份有限公司 一种gre隧道建立方法及***
CN109710545B (zh) * 2018-12-27 2021-01-15 联想(北京)有限公司 数据传输方法及装置、计算机可读存储介质、计算机***
CN110113202B (zh) * 2019-04-30 2022-02-25 新华三信息安全技术有限公司 一种IPsec诊断方法、装置及本端设备
CN112804129B (zh) * 2019-11-13 2023-11-03 中兴通讯股份有限公司 报文传输方法及***,发送端vpn设备及gre拼接设备
CN111490986B (zh) * 2020-04-05 2022-05-27 杭州迪普科技股份有限公司 用于入侵防御设备的测试***及方法

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040013118A1 (en) * 2002-07-22 2004-01-22 3Com Corporation System and method for GRE heartbeats
CN101119272A (zh) * 2007-08-14 2008-02-06 杭州华三通信技术有限公司 配置gre隧道的方法及路由器
US20090034431A1 (en) * 2007-07-31 2009-02-05 Symbol Technologies, Inc. ENTERPRISE NETWORK ARCHITECTURE FOR IMPLEMENTING A VIRTUAL PRIVATE NETWORK FOR WIRELESS USERS BY MAPPING WIRELESS LANs TO IP TUNNELS
CN101488902A (zh) * 2009-02-25 2009-07-22 杭州华三通信技术有限公司 一种gre隧道的动态建立方法和设备

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090003443A1 (en) * 2007-06-26 2009-01-01 Nokia Corporation Priority-based template matching intra prediction video and image coding
CN101815106B (zh) * 2010-04-16 2013-03-20 杭州华三通信技术有限公司 动态gre隧道建立的方法和设备

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040013118A1 (en) * 2002-07-22 2004-01-22 3Com Corporation System and method for GRE heartbeats
US20090034431A1 (en) * 2007-07-31 2009-02-05 Symbol Technologies, Inc. ENTERPRISE NETWORK ARCHITECTURE FOR IMPLEMENTING A VIRTUAL PRIVATE NETWORK FOR WIRELESS USERS BY MAPPING WIRELESS LANs TO IP TUNNELS
CN101119272A (zh) * 2007-08-14 2008-02-06 杭州华三通信技术有限公司 配置gre隧道的方法及路由器
CN101488902A (zh) * 2009-02-25 2009-07-22 杭州华三通信技术有限公司 一种gre隧道的动态建立方法和设备

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
SE2050312A1 (en) * 2020-03-23 2021-09-24 Telia Co Ab A method and a system for routing data packets in a network
SE543952C2 (en) * 2020-03-23 2021-10-05 Telia Co Ab A method and a system for routing data packets in a network
US11463308B2 (en) 2020-03-23 2022-10-04 Telia Company Ab Method and a system for routing data packets to/from a subnet of a home network to a visited network
SE2050610A1 (en) * 2020-05-27 2021-09-28 Telia Co Ab Methods and an apparatus for routing data packets in a network topology
SE543942C2 (en) * 2020-05-27 2021-09-28 Telia Co Ab Methods and an apparatus for routing data packets in a network topology
US11777851B2 (en) 2020-05-27 2023-10-03 Telia Company Ab Methods and an apparatus for routing data packets in a network topology

Also Published As

Publication number Publication date
CN103973555A (zh) 2014-08-06

Similar Documents

Publication Publication Date Title
WO2014117475A1 (zh) 通用路由封装协议隧道建立方法、通信设备及通信***
US10917262B2 (en) VXLAN packet forwarding method, device, and system
US11184842B2 (en) Conveying non-access stratum messages over ethernet
US9578548B2 (en) System and method for configuring multiple IP connections
CN107836104B (zh) 与机器设备进行互联网络通信的方法和***
US20220078114A1 (en) Method and Apparatus for Providing Service for Traffic Flow
EP3396902B1 (en) Enhancing communication in the control plane of a vxlan
WO2019024880A1 (zh) 发送报文的方法和网络设备
WO2015143802A1 (zh) 业务功能链处理方法及装置
WO2009089713A1 (fr) Procédé de transmission d'un message bfd, procédé et dispositif de détection d'une défaillance de liaison
TW201421232A (zh) 在一冗餘群組中實施故障備援的方法、裝置與電腦程式產品
US11888818B2 (en) Multi-access interface for internet protocol security
CN107078946A (zh) 业务流处理策略的处理方法、装置和***
KR20180051621A (ko) 전기통신 네트워크와 적어도 하나의 사용자 장비 간의 적어도 하나의 통신 교환의 개선된 핸들링을 위한 방법, 전기통신 네트워크, 사용자 장비, 시스템, 프로그램 및 컴퓨터 프로그램 제품
WO2011032417A1 (zh) 发起通信、信息/数据报文的转发及路由配置方法和***
WO2021082803A1 (zh) 路由信息传输方法及装置、数据中心互联网络
EP2832061B1 (en) Pseudowire extended group messaging in a packet switched network
WO2017219868A1 (zh) Arp条目的处理方法及装置
WO2022166932A1 (zh) 一种通信鉴权方法、设备及存储介质
CN107454178B (zh) 数据传输方法及装置
WO2023284231A1 (zh) 报文处理方法和报文处理***
WO2016074354A1 (zh) 共享wifi的方法及***、家庭网关和无线局域网关
WO2021077991A1 (zh) 报文检测方法、连通性协商关系建立方法以及相关设备
WO2018112835A1 (zh) 选择网关的方法、设备和***
WO2014169590A1 (zh) 一种数据业务通信方法、设备及***

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: 13874030

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: 13874030

Country of ref document: EP

Kind code of ref document: A1