WO2018099308A1 - Method and apparatus for supporting address changes, and storage medium - Google Patents

Method and apparatus for supporting address changes, and storage medium Download PDF

Info

Publication number
WO2018099308A1
WO2018099308A1 PCT/CN2017/112377 CN2017112377W WO2018099308A1 WO 2018099308 A1 WO2018099308 A1 WO 2018099308A1 CN 2017112377 W CN2017112377 W CN 2017112377W WO 2018099308 A1 WO2018099308 A1 WO 2018099308A1
Authority
WO
WIPO (PCT)
Prior art keywords
address
connection
peer device
change
message
Prior art date
Application number
PCT/CN2017/112377
Other languages
French (fr)
Chinese (zh)
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 WO2018099308A1 publication Critical patent/WO2018099308A1/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/50Address allocation
    • H04L61/5007Internet 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5053Lease time; Renewal aspects

Definitions

  • the present invention relates to the field of data communication technologies, and in particular, to a method, an apparatus, and a storage medium for supporting address changes.
  • IP Internet Protocol
  • TCP Transmission Control Protocol
  • IP addresses are sometimes changeable. For example, when a mobile terminal switches between a mobile network and WIFI, the IP address changes. For example, devices with higher security requirements are usually periodically. Update the IP address it uses to improve its ability to defend against attacks. According to the related technology, when the IP address changes, the connection established by using the pre-change IP address cannot be maintained and disconnected, which may result in interruption of data transmission. If you want to continue to complete the previously unfinished operation, you need to establish a new connection with the changed IP address to restart the data transfer.
  • an embodiment of the present invention provides a method, an apparatus, and a storage medium for supporting address change.
  • the embodiment of the invention provides a method for supporting address change, including: constructing with a peer device Establishing a connection using the first IP address; actively using the connection of the first IP address to actively negotiate with the peer device to change the IP address of the connection to a second IP address; when the negotiation is completed, The connected IP address is changed from the first IP address to the second IP address.
  • the initiating the negotiation with the peer device to change the IP address of the connection to the second IP address includes: sending, by using the connection, an IP address change request packet to the peer device, where the IP The address change request message includes: a second IP address.
  • the initiating the negotiation with the peer device to change the IP address of the connection to the second IP address further includes: receiving an IP from the peer device for responding to the IP address change request packet An address change response message; and sending an IP address change confirmation message to the peer device.
  • the method further includes: after the changing the IP address of the connection from the first IP address to the second IP address, sending the first keep-alive message to the peer device; The first IP address is deleted when the second keep-alive message or the keep-alive confirmation message of the first keep-alive message is sent by the peer device.
  • the method further includes: receiving a notification that the IP address of the connection is changed to the second IP address; and performing the active and the peer device when detecting that the allowed IP address is changed according to the notification The step of negotiating changing the IP address of the connection to the second IP address.
  • connection is a TCP connection.
  • An embodiment of the present invention provides a method for supporting address change, including: establishing a connection with a peer device using a first IP address; and accepting, by the peer device, changing the IP address of the connection to a second IP address.
  • negotiation wherein the second IP address is provided by the peer device; and when the negotiation is completed, changing the IP address of the connection from the first IP address to the second IP address.
  • the negotiating, by the peer device, to change the IP address of the connection to the second IP address includes: receiving an IP address change request packet from the peer device, where the IP address
  • the change request message includes: the second IP address; and the IP address change response message is returned to the peer device according to the IP address change request message; and the IP address change confirmation sent by the peer device is received. a packet; wherein, when the IP address change confirmation message is received, the negotiation is completed.
  • the method further includes: after changing the IP address of the connection from the first IP address to the second IP address, sending a first keep-alive message to the peer device, or receiving When the second keep-alive packet is sent from the peer device, the keep-alive acknowledgement packet of the second keep-alive packet is sent to the peer device.
  • connection is a TCP connection.
  • An embodiment of the present invention provides an apparatus for supporting address change, including: a connection module configured to establish a connection with a peer device using a first IP address; and a negotiation module configured to use the first IP address Connecting, actively negotiating with the peer device to change the IP address of the connection to a second IP address; and the address update module is configured to change the IP address of the connection by the first IP address when the negotiation is completed Is the second IP address.
  • the negotiation module is configured to: send an IP address change request message to the peer device by using the connection, where the IP address change request message includes: a second IP address; and receiving from the peer end And an IP address change response message of the device for responding to the IP address change request message; and sending an IP address change confirmation message to the peer device.
  • the method further includes: a sending module, configured to send the first keep-alive report to the peer device after the address update module changes the connected IP address from the first IP address to the second IP address
  • the processing module is configured to delete the first IP address when receiving the second keep-alive message sent by the peer device or the keep-alive confirmation message of the first keep-alive message.
  • the negotiation module is configured to detect whether an IP address change is allowed when a notification that the IP address of the connection is changed to a second IP address, and when the change of the allowed IP address is detected, The peer device negotiates to change the IP address of the connection to the second IP address.
  • An embodiment of the present invention provides an apparatus for supporting address change, including: a connection module configured to establish a connection with a peer device using a first IP address; a negotiation module; configured to accept the originating device to initiate the Changing the connected IP address to a negotiation of the second IP address, wherein the second IP address is provided by the peer device; and an address update module configured to: when the negotiation is completed, the IP address of the connection is The first IP address is changed to the second IP address.
  • the negotiation module is configured to: receive an IP address change request message from the peer device, where the IP address change request message includes: the second IP address; And the IP address change request message is sent to the peer device, and the IP address change acknowledgement message sent by the peer device is received; and the IP address change confirmation report is received.
  • the text indicates that the negotiation is completed.
  • the transceiver module is further configured to send the first security to the peer device after the address update module changes the IP address of the connection from the first IP address to the second IP address. And a keepalive acknowledgement message of the second keepalive message is sent to the peer device when receiving the second keepalive message from the peer device.
  • Embodiments of the present invention provide a storage medium having stored thereon a computer program that, when executed by a processor, implements the steps of any of the above methods.
  • the connection in the case that the connection is not disconnected, the connection is used to negotiate with the peer device to change the IP address of the connection from the first IP address to the second IP address, so that the IP address is implemented without interrupting the connection. Smooth changes.
  • FIG. 1 is a schematic flow chart of a first embodiment of a method for supporting address change according to an embodiment of the present invention
  • FIG. 2 is a schematic flow chart of an embodiment of step 102 in FIG. 1;
  • FIG. 3 is a schematic flow chart of a second embodiment of a method for supporting address change according to an embodiment of the present invention
  • FIG. 4 is a schematic flow chart of a third embodiment of a method for supporting address change according to an embodiment of the present invention.
  • FIG. 5 is a schematic flow chart of an embodiment of step 402 in FIG. 4;
  • FIG. 6 is a schematic flowchart diagram of a fourth embodiment of a method for supporting address change according to an embodiment of the present invention.
  • FIG. 7 is a schematic flowchart diagram of a fifth embodiment of a method for supporting address change according to an embodiment of the present invention.
  • FIG. 8 is a structural diagram showing a first embodiment of an apparatus for supporting address change according to an embodiment of the present invention. intention;
  • FIG. 9 is a schematic structural diagram of a second embodiment of an apparatus for supporting address change according to an embodiment of the present invention.
  • FIG. 10 is a schematic structural diagram of a third embodiment of an apparatus for supporting address change according to an embodiment of the present invention.
  • FIG. 1 is a schematic flowchart of a first embodiment of a method for supporting address change according to the present invention.
  • the embodiment of FIG. 1 is an illustration from the originating end of the address change. Specifically, it includes the following steps:
  • Step 101 Establish a connection with the peer device using the first IP address.
  • Step 102 Proactively negotiate with the peer device to change the connected IP address to the second IP address.
  • Step 103 When the negotiation is completed, the connected IP address is changed from the first IP address to the second IP address.
  • the established connection may be, for example, a TCP connection.
  • TCP establishes a connection through three-way handshake negotiation.
  • the application layer data can be reliably transmitted on the TCP.
  • the connected quaternary group (source IP address, source port, destination) is identified.
  • the IP address and destination port) remain unchanged.
  • the source IP address and the destination IP address in the quaternary are the IP addresses of the two ends of the TCP connection, which are usually assigned to the terminal through static configuration or dynamic protocols (such as DHCP and DHCPv6 protocols); the source port and the destination port are two TCP connections.
  • the identifier of the end application one is usually a well-known port (such as 80 port identification HTTP protocol), and the other is usually a port randomly assigned in a non-known port interval to distinguish different instances of the same application.
  • the IP addresses of the two ends of the connection are fixed, and the first IP address here is the IP address of the local device.
  • the IP address of the peer device remains unchanged. change.
  • the local device can periodically update its IP address, for example, periodically triggering step 102.
  • the local device can also trigger the above step 102 at any time.
  • the local device includes: an IP address change processing unit and an IP address change negotiation unit
  • the IP address change processing unit may periodically change the IP address used by the local device, and change the negotiation unit to the IP address.
  • a related notification is sent to notify the IP address change negotiation unit to change the IP address of the current connection.
  • the notification may include: an IP address currently used (first IP address) and an IP address to be changed (second IP address).
  • step 102 it may be detected first whether the IP address change is allowed. If the allowed IP address change is detected, the device negotiates with the peer device; otherwise, the IP change is rejected. In general, step 102 can detect whether it is currently in an address change state to decide whether to negotiate with the peer device, or step 102 can detect whether the second IP address is legal to determine whether to negotiate with the peer device.
  • the connection in the case that the connection is not disconnected, the connection is used to negotiate with the peer device to change the IP address of the connection to the second IP address, so that the IP address can be smoothly changed without interrupting the connection, thereby ensuring the application. (such as data transfer applications) will not be interrupted due to changes in IP addresses.
  • step 102 As shown in FIG. 2, it is a schematic flowchart of an embodiment of step 102, which includes:
  • Step 201 Send an IP address change request message to the peer device, where the IP address change request message includes: a second IP address.
  • the pre-changed IP address (ie, the second IP address) is notified to the peer device by using the IP address change request message.
  • Step 202 Receive an IP address change response message from the peer device for responding to the IP address change request message.
  • Step 203 Send an IP address change confirmation message to the peer device.
  • the IP address change request packet, the IP address change response packet, and the IP address change confirmation packet are packets for IP change negotiation between the local end and the peer device.
  • the local and the opposite The packet of the IP address negotiation negotiation between the end devices may further include: an IP address change rejection packet. For example, when the peer device receives the IP address change request packet of the local end, if the current location does not allow the IP address to change, the peer device can return the IP address change rejection packet.
  • the packet carrying the IP change negotiation between the local end and the peer device carries an address change flag, and is used to mark the packet as a packet related to the address change negotiation.
  • a message format with an address change flag can be as shown in Table 1:
  • the address change option is carried in the packet of the IP address negotiation between the local device and the peer device.
  • the address change option is used to negotiate the address change at both ends of the connection.
  • the format of the packet is as shown in Table 2:
  • the subtype is used to distinguish the type of the packet, for example, one of a request message, a response message, a rejection message, and an acknowledgement message.
  • FIG. 3 it is a schematic flowchart of a second embodiment of the method for supporting address change according to the present invention.
  • the method further includes:
  • Step 304 Send a first keep-alive message to the peer device.
  • Step 305 Delete the first IP address when receiving the second keep-alive message or the keep-alive confirmation message of the first keep-alive message sent by the peer device.
  • the step 304 is to send a first keep alive message to the peer device by using the connection whose address is changed to the second IP address, so that the local end has successfully switched the connected IP address to the second IP address. If the second keepalive packet or the keepalive acknowledgement packet is received by the peer device, the peer end successfully switches the connected IP address to the second IP address. An IP address is deleted to indicate that the connected IP address has been completely switched to the second IP address.
  • the keepalive message may be sent to the peer end to verify whether the other party successfully switches.
  • the method for supporting the address change of the present invention is described from the end that actively initiates the change of the IP address, and the passive end, that is, the peer device side in the foregoing embodiment, is used for the present invention.
  • the method of supporting address change is explained.
  • FIG. 4 it is a schematic flowchart of a third embodiment of a method for supporting address change according to the present invention. It includes:
  • Step 401 Establish a connection with the peer device using the first IP address.
  • Step 402 Accept the negotiation initiated by the peer device to change the connected IP address to the second IP address, where the second IP address is provided by the peer device.
  • Step 403 When the negotiation is completed, the connected IP address is changed from the first IP address to the second IP address.
  • step 402 is as shown in FIG. 5, which includes:
  • Step 501 Receive an IP address change request message from the peer device, where the IP address change request message includes: a second IP address.
  • Step 502 Reply to the IP address change response packet to the peer device according to the IP address change request packet.
  • Step 503 Receive an IP address change confirmation message sent by the peer device.
  • the negotiation may be completed.
  • step 502 according to the IP address change request message, first check whether the address change is allowed, and if yes, return the IP address change response message, otherwise return the IP address change rejection message.
  • FIG. 6 is a schematic flow chart of a fourth embodiment of a method for supporting address change according to the present invention.
  • the method further includes:
  • Step 604 Send a first keep-alive message to the peer device, or send a keep-alive confirmation message of the second keep-alive message to the peer device when receiving the second keep-alive message from the peer device. Text.
  • the first keep-alive message or the keep-alive confirmation message is transmitted on the connection using the second IP address, so as to confirm that the peer device has successfully switched the connected IP address to the second IP address.
  • the peer device when the connection using the first IP address is kept disconnected, the peer device negotiates to change the IP address of the connection to the second IP address, so that the IP address is smoothly changed without interrupting the connection.
  • the foregoing describes the method for supporting address change from the two ends of the connection respectively.
  • FIG. 7 a detailed embodiment of the method for supporting address change according to the present invention is further illustrated; wherein, for ease of understanding, the connection is made.
  • the two ends are respectively described by the server and the client, and the server is used as the initiator of the IP address change, and the client is used as the passive terminal for description.
  • Step 701 The server establishes a TCP connection with the client.
  • connection may be a TCP connection and is based on the first IP address, where the first IP address refers to the address of the server.
  • the IP address of the server is variable.
  • the IP address of the client remains fixed, so the client's IP address is not specified. That is to say, the second IP address mentioned later also refers to the IP address of the server.
  • Step 702 Receive a notification of an IP address change.
  • the IP address of the server may be periodically changed.
  • the IP address change processing unit in the server periodically changes the IP address.
  • the negotiation processing unit in the server is notified, and the notified information includes the currently used IP address (first IP address), and the IP address (second IP address) to be changed.
  • Step 703 Send an IP address change request message to the client.
  • the IP address change request packet carries the foregoing address change flag and address change option. Among them, the subtype in the address change option is set to 1, and the updated IP address is set to the second IP address.
  • the retransmission timer may be started. That is to say, after step 703, if the reply of the opposite end is not received within the preset time, the retransmission operation is performed. Also, you can set the number of major retransmissions at the same time. After the maximum number of retransmissions is reached, the reply from the peer is still not received, indicating that the address change failed.
  • the client before sending an IP address change request packet to the client, it can detect whether the IP address change is allowed. If yes, the IP address change request packet is sent, otherwise it is not sent. Specifically, the current first IP address in the notification can be used to find the current TCP connection using the first IP address, and then check whether the TCP connection can change the address (for example, detecting whether the TCP is in the address change state or jumping). Whether the address is legal, etc.), if possible, continue with the subsequent steps, otherwise the address change is rejected.
  • Step 704 The client replies to the IP address change response message.
  • the IP address change response message may carry the foregoing address change flag and address change option, and set the subtype in the address change option to 2.
  • the client can also initiate an address change response retransmission timer and set the retransmission time and the maximum number of retransmissions. After the maximum number of retransmissions is reached, the server does not receive a reply, which may be regarded as a failure of the address change.
  • the client can detect whether the TCP connection allows address change before replying to the IP address change response message. If yes, send an IP address change response message; if not, return an IP address change rejection message.
  • the IP address change reject message may carry the foregoing address change flag and address change option, and set the subtype in the address change option to 3.
  • Step 705 The server replies to the IP address confirmation message.
  • the server receives the IP address change response packet, indicating that the peer device agrees to change the address, and then can reply the IP address change confirmation packet.
  • Step 706 The server updates the address of the TCP connection to the second IP address.
  • Step 707 After receiving the IP address confirmation message, the client updates the IP address of the TCP connection to the second IP address.
  • Step 708 The server sends a keep-alive message to the client.
  • the keep-alive message is transmitted on the new connection (the server address is the second IP address).
  • Step 709 The client returns a keep-alive confirmation message to the server.
  • Step 710 The server deletes the first IP address.
  • the two ends of the TCP carry the address change flag and the ground.
  • the address change request, the response, and the acknowledgement packet of the address change option negotiate the address change, so that both ends of the TCP connection can simultaneously switch the IP address to the changed IP address, so that the TCP connection remains intact, and the application data transmission is not Interrupted.
  • FIG. 8 it is a schematic structural diagram of a first embodiment of an apparatus 800 for supporting address change according to the present invention.
  • the device supporting the address change may be an initiator of the address change, such as the foregoing server. It includes:
  • the connection module 801 is configured to establish a connection with the peer device using the first IP address.
  • the negotiation module 802 is configured to actively change the IP address of the connection to a second IP address by negotiating with the peer device by using the connection of the first IP address.
  • the address update module 803 is configured to change the IP address of the connection from the first IP address to the second IP address when the negotiation is completed.
  • the negotiation module 801 is configured to send an IP address change request message to the peer device by using the connection, where the IP address change request message includes: a second IP address; and receiving from the peer device And an IP address change response message for responding to the IP address change request message; and sending an IP address change confirmation message to the peer device.
  • the present embodiment is an apparatus embodiment corresponding to the embodiment of FIG. 1 and FIG. 2, and thus the related detailed description has been described above, and details are not described herein.
  • FIG. 9 it is a schematic structural diagram of a second embodiment of the apparatus 800 for supporting address change according to the present invention.
  • the modules shown in the embodiment of FIG. 8 it also includes:
  • the sending module 804 is configured to: after the address update module changes the connected IP address from the first IP address to the second IP address, send the first keep-alive message to the peer device;
  • the processing module 805 is configured to delete the first IP address when receiving the second keep-alive message sent by the peer device or the keep-alive confirmation message of the first keep-alive message.
  • the embodiment is an apparatus embodiment corresponding to the foregoing embodiment of FIG. 3, and the related details have been previously described, and details are not described herein.
  • connection module 801, the negotiation module 802, and the sending module 804 can be implemented by a processor in the device 800 supporting the address change in combination with the communication interface;
  • the management module 805 can be implemented by a processor in the device 800 that supports address changes. That is, the apparatus 800 supporting address change according to an embodiment of the present invention includes: a processor and a memory for storing a computer program executable on the processor,
  • processor is configured to perform the steps of the above method when the computer program is run.
  • the processor is connected to the communication interface to implement interaction with the peer device.
  • FIG. 10 it is a schematic structural diagram of a third embodiment of the apparatus 100 for supporting address change according to the present invention.
  • the device 100 supporting the address change is mainly configured to passively accept one end of the address change, such as the aforementioned client. It includes:
  • the connection module 101 is configured to establish a connection with the peer device using the first IP address.
  • the negotiation module 102 is configured to accept, by the peer device, a negotiation of changing the IP address of the connection to a second IP address, where the second IP address is provided by the peer device;
  • the address update module 103 is configured to change the IP address of the connection from the first IP address to the second IP address when the negotiation is completed.
  • the negotiation module 102 is configured to receive an IP address change request packet from the peer device, where the IP address change request packet includes: the second IP address; Receiving a message, replying to the peer device with an IP address change response message; and receiving an IP address change confirmation message sent by the peer device; wherein, when receiving the IP address change confirmation message, indicating The negotiation is completed.
  • this embodiment is an apparatus embodiment corresponding to the foregoing embodiments of FIG. 4 and FIG. 5, and thus the related details have been described above, and are not described herein.
  • the apparatus 100 for supporting address change further includes: a transceiver module 104 configured to change, at the address update module, the IP address of the connection from the first IP address to the second After the IP address, the first keepalive message is sent to the peer device, or when the second keepalive message from the peer device is received, the second keepalive is sent to the peer device The keepalive confirmation message of the message.
  • a transceiver module 104 configured to change, at the address update module, the IP address of the connection from the first IP address to the second After the IP address, the first keepalive message is sent to the peer device, or when the second keepalive message from the peer device is received, the second keepalive is sent to the peer device The keepalive confirmation message of the message.
  • connection module 101, the negotiation module 102, and the transceiver module 104 can be implemented by a processor in the device 100 supporting address change in conjunction with a communication interface;
  • address update module 103 can be implemented by a processor in the device 800 that supports address changes.
  • the apparatus 800 supporting address change includes: a processor and a memory for storing a computer program executable on the processor,
  • processor is configured to perform the steps of the above method when the computer program is run.
  • the processor is connected to the communication interface to implement interaction with the peer device.
  • each module involved in the present invention is a logic module.
  • a logical unit may be a physical unit, a part of a physical unit, or multiple physical units. Combined implementation.
  • the present embodiment does not introduce a unit that is not closely related to solving the technical problem proposed by the present invention, but this does not mean that there are no other units in the present embodiment.
  • the storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
  • an embodiment of the present invention provides a storage medium on which a computer program is stored, and when the computer program is executed by a processor, the steps of the foregoing method are implemented.
  • the solution provided by the embodiment of the present invention uses the connection to negotiate with the peer device to change the IP address of the connection from the first IP address to the second IP address, thereby implementing the connection without interrupting the connection.

Landscapes

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

Abstract

Disclosed are a method and apparatus for supporting address changes, and a storage medium. The method comprises: establishing a connection for using a first IP address with a peer end device; by means of the connection for using the first IP address, actively negotiating with the peer end device to change the IP address of the connection to a second IP address; and after the negotiation is completed, changing the IP address of the connection from the first IP address to the second IP address.

Description

支持地址变化的方法、装置及存储介质Method, device and storage medium supporting address change
相关申请的交叉引用Cross-reference to related applications
本申请基于申请号为201611073478.2、申请日为2016年11月29日的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此引入本申请作为参考。The present application is based on a Chinese patent application filed on Jan. 29, 2016, the entire disclosure of which is hereby incorporated by reference.
技术领域Technical field
本发明涉及数据通信技术领域,特别涉及一种支持地址变化的方法、装置及存储介质。The present invention relates to the field of data communication technologies, and in particular, to a method, an apparatus, and a storage medium for supporting address changes.
背景技术Background technique
一些基于互联网协议(IP,Internet Protocol)的连接,诸如传输控制协议(TCP,Transmission Control Protocol),在连接建立之后,IP地址即固定,而不能够变化。如若IP地址变化,则需要重新建立连接。Some Internet Protocol (IP)-based connections, such as the Transmission Control Protocol (TCP), are fixed after the connection is established and cannot be changed. If the IP address changes, you will need to re-establish the connection.
但是,在现代的网络环境中,IP地址有时是可变化的,比如移动终端在移动网络和WIFI之间切换时,IP地址就会变化;又比如,有较高安全性要求的设备通常会定期更新其使用的IP地址以提高其防御攻击的能力。而按照相关的技术,当IP地址发生变化时,使用变化前IP地址建立的连接将无法继续维持而断开,从而会导致数据的传输中断。而如果要继续完成之前未完成的操作,则需要使用变化后的IP地址建立新连接来重新开始传输数据。However, in modern network environments, IP addresses are sometimes changeable. For example, when a mobile terminal switches between a mobile network and WIFI, the IP address changes. For example, devices with higher security requirements are usually periodically. Update the IP address it uses to improve its ability to defend against attacks. According to the related technology, when the IP address changes, the connection established by using the pre-change IP address cannot be maintained and disconnected, which may result in interruption of data transmission. If you want to continue to complete the previously unfinished operation, you need to establish a new connection with the changed IP address to restart the data transfer.
发明内容Summary of the invention
有鉴于此,本发明实施例提供一种支持地址变化的方法、装置及存储介质。In view of this, an embodiment of the present invention provides a method, an apparatus, and a storage medium for supporting address change.
本发明实施例提供了一种支持地址变化的方法,包含:与对端设备建 立使用第一IP地址的连接;通过使用所述第一IP地址的所述连接,主动与所述对端设备协商将所述连接的IP地址变更为第二IP地址;当协商完成时,将所述连接的IP地址由所述第一IP地址变更为所述第二IP地址。The embodiment of the invention provides a method for supporting address change, including: constructing with a peer device Establishing a connection using the first IP address; actively using the connection of the first IP address to actively negotiate with the peer device to change the IP address of the connection to a second IP address; when the negotiation is completed, The connected IP address is changed from the first IP address to the second IP address.
其中,所述主动与所述对端设备协商将所述连接的IP地址变更为第二IP地址,包括:使用所述连接向所述对端设备发送IP地址变化请求报文,其中所述IP地址变化请求报文包括:第二IP地址。The initiating the negotiation with the peer device to change the IP address of the connection to the second IP address includes: sending, by using the connection, an IP address change request packet to the peer device, where the IP The address change request message includes: a second IP address.
其中,所述主动与所述对端设备协商将所述连接的IP地址变更为第二IP地址,还包括:接收来自所述对端设备的用于响应所述IP地址变化请求报文的IP地址变化应答报文;以及向所述对端设备发送IP地址变化确认报文。The initiating the negotiation with the peer device to change the IP address of the connection to the second IP address further includes: receiving an IP from the peer device for responding to the IP address change request packet An address change response message; and sending an IP address change confirmation message to the peer device.
其中,所述方法还包括:在所述将所述连接的IP地址由所述第一IP地址变更为第二IP地址之后,向所述对端设备发送第一保活报文;当接收到所述对端设备发送的第二保活报文或者所述第一保活报文的保活确认报文时,删除所述第一IP地址。The method further includes: after the changing the IP address of the connection from the first IP address to the second IP address, sending the first keep-alive message to the peer device; The first IP address is deleted when the second keep-alive message or the keep-alive confirmation message of the first keep-alive message is sent by the peer device.
其中,所述方法还包括:接收将所述连接的IP地址变化为所述第二IP地址的通知;根据所述通知,检测到允许IP地址变化时,执行所述主动与所述对端设备协商将所述连接的IP地址变更为第二IP地址的步骤。The method further includes: receiving a notification that the IP address of the connection is changed to the second IP address; and performing the active and the peer device when detecting that the allowed IP address is changed according to the notification The step of negotiating changing the IP address of the connection to the second IP address.
其中,所述连接为TCP连接。Wherein the connection is a TCP connection.
本发明实施例提供了一种支持地址变化的方法,包括:与对端设备建立使用第一IP地址的连接;接受所述对端设备发起的将所述连接的IP地址变更为第二IP地址的协商,其中所述第二IP地址由所述对端设备提供;以及当协商完成时,将所述连接的IP地址由所述第一IP地址变更为所述第二IP地址。An embodiment of the present invention provides a method for supporting address change, including: establishing a connection with a peer device using a first IP address; and accepting, by the peer device, changing the IP address of the connection to a second IP address. Negotiation, wherein the second IP address is provided by the peer device; and when the negotiation is completed, changing the IP address of the connection from the first IP address to the second IP address.
其中,所述接受所述对端设备发起的将所述连接的IP地址变更为第二IP地址的协商,包括:接收来自所述对端设备的IP地址变化请求报文,其中所述IP地址变化请求报文包括:所述第二IP地址;根据所述IP地址变化请求报文,向所述对端设备回复IP地址变化应答报文;以及接收所述对端设备发送的IP地址变化确认报文;其中,当接收到所述IP地址变化确认报文,则表明所述协商完成。 The negotiating, by the peer device, to change the IP address of the connection to the second IP address, includes: receiving an IP address change request packet from the peer device, where the IP address The change request message includes: the second IP address; and the IP address change response message is returned to the peer device according to the IP address change request message; and the IP address change confirmation sent by the peer device is received. a packet; wherein, when the IP address change confirmation message is received, the negotiation is completed.
其中,所述方法还包括:将所述连接的IP地址由所述第一IP地址变更为所述第二IP地址之后,向所述对端设备发送第一保活报文,或者当接收到来自所述对端设备的第二保活报文时,向所述对端设备发送所述第二保活报文的保活确认报文。The method further includes: after changing the IP address of the connection from the first IP address to the second IP address, sending a first keep-alive message to the peer device, or receiving When the second keep-alive packet is sent from the peer device, the keep-alive acknowledgement packet of the second keep-alive packet is sent to the peer device.
其中,所述连接为TCP连接。Wherein the connection is a TCP connection.
本发明实施例提供了一种支持地址变化的装置,包含:连接模块,配置为与对端设备建立使用第一IP地址的连接;协商模块,配置为通过使用所述第一IP地址的所述连接,主动与所述对端设备协商将所述连接的IP地址变更为第二IP地址;地址更新模块,配置为当协商完成时,将所述连接的IP地址由所述第一IP地址变更为所述第二IP地址。An embodiment of the present invention provides an apparatus for supporting address change, including: a connection module configured to establish a connection with a peer device using a first IP address; and a negotiation module configured to use the first IP address Connecting, actively negotiating with the peer device to change the IP address of the connection to a second IP address; and the address update module is configured to change the IP address of the connection by the first IP address when the negotiation is completed Is the second IP address.
其中,所述协商模块,配置为:使用所述连接向所述对端设备发送IP地址变化请求报文,其中所述IP地址变化请求报文包括:第二IP地址;接收来自所述对端设备的用于响应所述IP地址变化请求报文的IP地址变化应答报文;以及向所述对端设备发送IP地址变化确认报文。The negotiation module is configured to: send an IP address change request message to the peer device by using the connection, where the IP address change request message includes: a second IP address; and receiving from the peer end And an IP address change response message of the device for responding to the IP address change request message; and sending an IP address change confirmation message to the peer device.
其中,还包括:发送模块,配置为在所述地址更新模块将所述连接的IP地址由所述第一IP地址变更为第二IP地址之后,向所述对端设备发送第一保活报文;以及处理模块,配置为当接收到所述对端设备发送的第二保活报文或者所述第一保活报文的保活确认报文时,删除所述第一IP地址。The method further includes: a sending module, configured to send the first keep-alive report to the peer device after the address update module changes the connected IP address from the first IP address to the second IP address And the processing module is configured to delete the first IP address when receiving the second keep-alive message sent by the peer device or the keep-alive confirmation message of the first keep-alive message.
其中,所述协商模块,配置为当接收到将所述连接的IP地址变化为第二IP地址的通知时,检测是否允许IP地址变化,以及当检测到允许IP地址变化时,主动与所述对端设备协商将所述连接的IP地址变更为第二IP地址。The negotiation module is configured to detect whether an IP address change is allowed when a notification that the IP address of the connection is changed to a second IP address, and when the change of the allowed IP address is detected, The peer device negotiates to change the IP address of the connection to the second IP address.
本发明实施例提供了一种支持地址变化的装置,包括:连接模块,配置为与对端设备建立使用第一IP地址的连接;协商模块;配置为接受所述对端设备发起的将所述连接的IP地址变更为第二IP地址的协商,其中所述第二IP地址由所述对端设备提供;以及地址更新模块,配置为当协商完成时,将所述连接的IP地址由所述第一IP地址变更为所述第二IP地址。An embodiment of the present invention provides an apparatus for supporting address change, including: a connection module configured to establish a connection with a peer device using a first IP address; a negotiation module; configured to accept the originating device to initiate the Changing the connected IP address to a negotiation of the second IP address, wherein the second IP address is provided by the peer device; and an address update module configured to: when the negotiation is completed, the IP address of the connection is The first IP address is changed to the second IP address.
其中,所述协商模块,配置为:接收来自所述对端设备的IP地址变化请求报文,其中所述IP地址变化请求报文包括:所述第二IP地址;根据所 述IP地址变化请求报文,向所述对端设备回复IP地址变化应答报文;以及接收所述对端设备发送的IP地址变化确认报文;其中,当接收到所述IP地址变化确认报文,则表明所述协商完成。The negotiation module is configured to: receive an IP address change request message from the peer device, where the IP address change request message includes: the second IP address; And the IP address change request message is sent to the peer device, and the IP address change acknowledgement message sent by the peer device is received; and the IP address change confirmation report is received. The text indicates that the negotiation is completed.
其中,还包括:收发模块,配置为在所述地址更新模块将所述连接的IP地址由所述第一IP地址变更为所述第二IP地址之后,向所述对端设备发送第一保活报文,或者当接收到来自所述对端设备的第二保活报文时,向所述对端设备发送所述第二保活报文的保活确认报文。The transceiver module is further configured to send the first security to the peer device after the address update module changes the IP address of the connection from the first IP address to the second IP address. And a keepalive acknowledgement message of the second keepalive message is sent to the peer device when receiving the second keepalive message from the peer device.
本发明实施例提供了一种存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现上述任一方法的步骤。Embodiments of the present invention provide a storage medium having stored thereon a computer program that, when executed by a processor, implements the steps of any of the above methods.
本发明实施例的有益效果是:The beneficial effects of the embodiments of the present invention are:
本发明实施例,在保持连接不断开的情况下,利用该连接与对端设备协商将该连接的IP地址由第一IP地址变更为第二IP地址,从而使得无需中断连接就实现IP地址的平滑变化。In the embodiment of the present invention, in the case that the connection is not disconnected, the connection is used to negotiate with the peer device to change the IP address of the connection from the first IP address to the second IP address, so that the IP address is implemented without interrupting the connection. Smooth changes.
附图说明DRAWINGS
图1是根据本发明实施例的支持地址变化的方法的第一实施例的流程示意图;1 is a schematic flow chart of a first embodiment of a method for supporting address change according to an embodiment of the present invention;
图2是图1中的步骤102的实施例的流程示意图;2 is a schematic flow chart of an embodiment of step 102 in FIG. 1;
图3是根据本发明实施例的支持地址变化的方法的第二实施例的流程示意图;3 is a schematic flow chart of a second embodiment of a method for supporting address change according to an embodiment of the present invention;
图4是根据本发明实施例的支持地址变化的方法的第三实施例的流程示意图;4 is a schematic flow chart of a third embodiment of a method for supporting address change according to an embodiment of the present invention;
图5是图4中的步骤402的实施例的流程示意图;FIG. 5 is a schematic flow chart of an embodiment of step 402 in FIG. 4;
图6是根据本发明实施例的支持地址变化的方法的第四实施例的流程示意图;FIG. 6 is a schematic flowchart diagram of a fourth embodiment of a method for supporting address change according to an embodiment of the present invention; FIG.
图7是根据本发明实施例的支持地址变化的方法的第五实施例的流程示意图;FIG. 7 is a schematic flowchart diagram of a fifth embodiment of a method for supporting address change according to an embodiment of the present invention; FIG.
图8根据本发明实施例的支持地址变化的装置的第一实施例的结构示 意图;FIG. 8 is a structural diagram showing a first embodiment of an apparatus for supporting address change according to an embodiment of the present invention; intention;
图9根据本发明实施例的支持地址变化的装置的第二实施例的结构示意图;FIG. 9 is a schematic structural diagram of a second embodiment of an apparatus for supporting address change according to an embodiment of the present invention; FIG.
图10根据本发明实施例的支持地址变化的装置的第三实施例的结构示意图。FIG. 10 is a schematic structural diagram of a third embodiment of an apparatus for supporting address change according to an embodiment of the present invention.
具体实施方式detailed description
为使本发明的目的、技术方案和优点更加清楚,下面将结合附图对本发明的各实施方式进行详细的阐述。然而,本领域的普通技术人员可以理解,在本发明各实施方式中,为了使读者更好地理解本申请而提出了许多技术细节。但是,即使没有这些技术细节和基于以下各实施方式的种种变化和修改,也可以实现本申请各权利要求所要求保护的技术方案。In order to make the objects, technical solutions, and advantages of the present invention more apparent, the embodiments of the present invention will be described in detail below. However, it will be apparent to those skilled in the art that, in the various embodiments of the present invention, numerous technical details are set forth in order to provide the reader with a better understanding of the present application. However, the technical solutions claimed in the claims of the present application can be implemented without these technical details and various changes and modifications based on the following embodiments.
请参考图1,是本发明的支持地址变化的方法的第一实施例的流程示意图。其中,图1的实施例是从地址变化的发起端进行的说明。具体地,其包括如下步骤:Please refer to FIG. 1, which is a schematic flowchart of a first embodiment of a method for supporting address change according to the present invention. The embodiment of FIG. 1 is an illustration from the originating end of the address change. Specifically, it includes the following steps:
步骤101:与对端设备建立使用第一IP地址的连接。Step 101: Establish a connection with the peer device using the first IP address.
步骤102:主动与对端设备协商将连接的IP地址变更为第二IP地址。Step 102: Proactively negotiate with the peer device to change the connected IP address to the second IP address.
步骤103:当协商完成时,将连接的IP地址由第一IP地址变更为第二IP地址。Step 103: When the negotiation is completed, the connected IP address is changed from the first IP address to the second IP address.
其中,在步骤101中,建立的连接例如可以是TCP连接。具体而言,TCP通过三次握手协商建立连接,连接建立后,应用层的数据即可在TCP上实现可靠的传输,在此过程中,标识连接的四元组(源IP地址、源端口、目的IP地址和目的端口)始终保持不变。四元组中的源IP地址和目的IP地址是TCP连接两端的IP地址,通常是通过静态配置或者动态协议(如DHCP和DHCPv6协议)为终端分配的;源端口和目的端口则是TCP连接两端应用的标识,一个通常是知名端口(如80端口标识HTTP协议),另一个通常是在非知名端口区间内随机分配的一个用于区分同一个应用不同实例的端口。 Wherein, in step 101, the established connection may be, for example, a TCP connection. Specifically, TCP establishes a connection through three-way handshake negotiation. After the connection is established, the application layer data can be reliably transmitted on the TCP. In this process, the connected quaternary group (source IP address, source port, destination) is identified. The IP address and destination port) remain unchanged. The source IP address and the destination IP address in the quaternary are the IP addresses of the two ends of the TCP connection, which are usually assigned to the terminal through static configuration or dynamic protocols (such as DHCP and DHCPv6 protocols); the source port and the destination port are two TCP connections. The identifier of the end application, one is usually a well-known port (such as 80 port identification HTTP protocol), and the other is usually a port randomly assigned in a non-known port interval to distinguish different instances of the same application.
其中,当步骤101的连接建立好之后,连接的两端的IP地址即固定,而此处的第一IP地址为本端设备的IP地址,在本实例中,对端设备的IP地址始终保持不变。After the connection in step 101 is established, the IP addresses of the two ends of the connection are fixed, and the first IP address here is the IP address of the local device. In this example, the IP address of the peer device remains unchanged. change.
其中,步骤102中,本端设备可以周期性地更新其IP地址,例如周期性地触发步骤102。当然,本端设备也可以随时触发上述步骤102。举例而言,假设本端设备中包括:IP地址变化处理单元和IP地址变化协商单元,则IP地址变化处理单元可以周期性地改变本端设备所使用的IP地址,并向IP地址变化协商单元发送相关通知,以通知IP地址变化协商单元改变当前的连接的IP地址。其中,该通知中可以包括:当前使用的IP地址(第一IP地址)和将要变化成的IP地址(第二IP地址)。In step 102, the local device can periodically update its IP address, for example, periodically triggering step 102. Of course, the local device can also trigger the above step 102 at any time. For example, if the local device includes: an IP address change processing unit and an IP address change negotiation unit, the IP address change processing unit may periodically change the IP address used by the local device, and change the negotiation unit to the IP address. A related notification is sent to notify the IP address change negotiation unit to change the IP address of the current connection. The notification may include: an IP address currently used (first IP address) and an IP address to be changed (second IP address).
另外,步骤102中,可以先检测是否允许IP地址变化。若检测到允许IP地址变化,才与对端设备协商;否则,拒绝此次IP变化。一般而言,步骤102可以检测当前是否正处在地址变化状态以决定是否与对端设备协商,或者步骤102可以检测第二IP地址是否合法以决定是否与对端设备协商。In addition, in step 102, it may be detected first whether the IP address change is allowed. If the allowed IP address change is detected, the device negotiates with the peer device; otherwise, the IP change is rejected. In general, step 102 can detect whether it is currently in an address change state to decide whether to negotiate with the peer device, or step 102 can detect whether the second IP address is legal to determine whether to negotiate with the peer device.
本实施例,在保持连接不断开的情况下,利用该连接与对端设备协商将该连接的IP地址变更为第二IP地址,从而使得无需中断连接就实现IP地址的平滑变化,从而保证应用(如数据传输应用)不会因IP地址的变更而中断。In this embodiment, in the case that the connection is not disconnected, the connection is used to negotiate with the peer device to change the IP address of the connection to the second IP address, so that the IP address can be smoothly changed without interrupting the connection, thereby ensuring the application. (such as data transfer applications) will not be interrupted due to changes in IP addresses.
如图2所示,是步骤102的实施例的流程示意图,其包括:As shown in FIG. 2, it is a schematic flowchart of an embodiment of step 102, which includes:
步骤201:向对端设备发送IP地址变化请求报文,其中该IP地址变化请求报文包括:第二IP地址。Step 201: Send an IP address change request message to the peer device, where the IP address change request message includes: a second IP address.
在步骤中,通过IP地址变化请求报文将预变更的IP地址(即第二IP地址)通知给对端设备。In the step, the pre-changed IP address (ie, the second IP address) is notified to the peer device by using the IP address change request message.
步骤202:接收来自对端设备的用于响应IP地址变化请求报文的IP地址变化应答报文。Step 202: Receive an IP address change response message from the peer device for responding to the IP address change request message.
步骤203:向对端设备发送IP地址变化确认报文。Step 203: Send an IP address change confirmation message to the peer device.
上述中,IP地址变化请求报文、IP地址变化应答报文和IP地址变化确认报文均为本端和对端设备之间进行IP变更协商的报文。另外,本端和对 端设备之间进行IP变更协商的报文还可以包括:IP地址变化拒绝报文。例如,对端设备在接收到本端的IP地址变化请求报文时,若其当前所处情况不允许IP地址变化,则可以返回IP地址变化拒绝报文。In the above, the IP address change request packet, the IP address change response packet, and the IP address change confirmation packet are packets for IP change negotiation between the local end and the peer device. In addition, the local and the opposite The packet of the IP address negotiation negotiation between the end devices may further include: an IP address change rejection packet. For example, when the peer device receives the IP address change request packet of the local end, if the current location does not allow the IP address to change, the peer device can return the IP address change rejection packet.
其中,在本端和对端设备之间进行IP变更协商的报文携带地址变化标记,用于标记此报文为地址变化协商相关的报文。例如,带有地址变化标记的报文格式可以表1所示:The packet carrying the IP change negotiation between the local end and the peer device carries an address change flag, and is used to mark the packet as a packet related to the address change negotiation. For example, a message format with an address change flag can be as shown in Table 1:
头长度Head length 预留Reserved 地址变化标记Address change tag ……......
表1Table 1
其中,在本端和对端设备之间进行IP变更协商的报文中携带地址变化选项,用于在连接的两端协商地址变化,其格式可以如表2所示:The address change option is carried in the packet of the IP address negotiation between the local device and the peer device. The address change option is used to negotiate the address change at both ends of the connection. The format of the packet is as shown in Table 2:
Figure PCTCN2017112377-appb-000001
Figure PCTCN2017112377-appb-000001
表2Table 2
其中,子类型用于区分报文的类型,例如为请求报文、应答报文、拒绝报文和确认报文中的一种。例如,子类型=1,表示此为IP地址变化请求报文;子类型=2,表示此为IP地址变应答报文;子类型=3表示此为IP地址变化拒绝报文;子类型=4,表示此为IP地址变化确认报文。The subtype is used to distinguish the type of the packet, for example, one of a request message, a response message, a rejection message, and an acknowledgement message. For example, subtype=1 means that this is an IP address change request message; subtype=2 means that this is an IP address change response message; subtype=3 means this is an IP address change rejection message; subtype=4 Indicates that this is an IP address change confirmation message.
如图3所示,是本发明的支持地址变化的方法的第二实施例的流程示意图,其除了与图1中的步骤101~步骤103相同的步骤301~303之外,还包括:As shown in FIG. 3, it is a schematic flowchart of a second embodiment of the method for supporting address change according to the present invention. In addition to the same steps 301-303 as steps 101 to 103 in FIG. 1, the method further includes:
步骤304:向对端设备发送第一保活报文。Step 304: Send a first keep-alive message to the peer device.
步骤305:当接收到对端设备发送的第二保活报文或者第一保活报文的保活确认报文时,删除所述第一IP地址。Step 305: Delete the first IP address when receiving the second keep-alive message or the keep-alive confirmation message of the first keep-alive message sent by the peer device.
其中,步骤304是使用地址变更为第二IP地址的连接来向对端设备发送第一保活(keep alive)报文,以表示本端已成功将连接的IP地址切换为第二IP地址。而步骤305接收到对端设备的第二保活报文或者保活确认报文,则表明对端也成功将连接的IP地址切换为第二IP地址,此时可以将第 一IP地址删除,以表示连接的IP地址已彻底切换为第二IP地址。The step 304 is to send a first keep alive message to the peer device by using the connection whose address is changed to the second IP address, so that the local end has successfully switched the connected IP address to the second IP address. If the second keepalive packet or the keepalive acknowledgement packet is received by the peer device, the peer end successfully switches the connected IP address to the second IP address. An IP address is deleted to indicate that the connected IP address has been completely switched to the second IP address.
本实施例,在将连接的IP地址切换为第二IP地址之后,还可以向对端发送保活报文,以彼此验证对方是否切换成功。In this embodiment, after the connected IP address is switched to the second IP address, the keepalive message may be sent to the peer end to verify whether the other party successfully switches.
上述的图1~3实施例,是从主动发起IP地址变化的一端对本发明的支持地址变化的方法进行了说明,下面从被动的一端,即前述实施例中的对端设备一侧对本发明的支持地址变化的方法进行说明。In the foregoing embodiments of FIG. 1 to FIG. 3, the method for supporting the address change of the present invention is described from the end that actively initiates the change of the IP address, and the passive end, that is, the peer device side in the foregoing embodiment, is used for the present invention. The method of supporting address change is explained.
如图4所示,是本发明的支持地址变化的方法的第三实施例的流程示意图。其包括:As shown in FIG. 4, it is a schematic flowchart of a third embodiment of a method for supporting address change according to the present invention. It includes:
步骤401,与对端设备建立使用第一IP地址的连接。Step 401: Establish a connection with the peer device using the first IP address.
步骤402:接受对端设备发起的将连接的IP地址变更为第二IP地址的协商,其中第二IP地址由对端设备提供。Step 402: Accept the negotiation initiated by the peer device to change the connected IP address to the second IP address, where the second IP address is provided by the peer device.
步骤403:当协商完成时,将连接的IP地址由第一IP地址变更为第二IP地址。Step 403: When the negotiation is completed, the connected IP address is changed from the first IP address to the second IP address.
其中,步骤402的流程如图5所示,其包括:The process of step 402 is as shown in FIG. 5, which includes:
步骤501:接收来自对端设备的IP地址变化请求报文,其中IP地址变化请求报文包括:第二IP地址。Step 501: Receive an IP address change request message from the peer device, where the IP address change request message includes: a second IP address.
步骤502:根据IP地址变化请求报文,向所述对端设备回复IP地址变化应答报文。Step 502: Reply to the IP address change response packet to the peer device according to the IP address change request packet.
步骤503:接收对端设备发送的IP地址变化确认报文。其中,当接收到所述IP地址变化确认报文,则可以表明所述协商完成。Step 503: Receive an IP address change confirmation message sent by the peer device. When the IP address change confirmation message is received, the negotiation may be completed.
其中,在步骤502中,根据IP地址变化请求报文,首先检查是否允许地址变化,若允许则返回IP地址变化应答报文,否则返回IP地址变化拒绝报文。In step 502, according to the IP address change request message, first check whether the address change is allowed, and if yes, return the IP address change response message, otherwise return the IP address change rejection message.
如图6所示,是本发明的支持地址变化的方法的第四实施例的流程示意图。其除了包括与图4的步骤401~步骤403相同的步骤601~步骤603之外,还包括:FIG. 6 is a schematic flow chart of a fourth embodiment of a method for supporting address change according to the present invention. In addition to the steps 601 to 603 which are the same as steps 401 to 403 of FIG. 4, the method further includes:
步骤604:向对端设备发送第一保活报文,或者当接收到来自对端设备的第二保活报文时,向对端设备发送所述第二保活报文的保活确认报文。 Step 604: Send a first keep-alive message to the peer device, or send a keep-alive confirmation message of the second keep-alive message to the peer device when receiving the second keep-alive message from the peer device. Text.
其中,第一保活报文或者保活确认报文是在使用第二IP地址的连接上传送的,以与对端设备彼此确认已成功将连接的IP地址切换至第二IP地址。The first keep-alive message or the keep-alive confirmation message is transmitted on the connection using the second IP address, so as to confirm that the peer device has successfully switched the connected IP address to the second IP address.
本实施例,在保持使用第一IP地址的连接不断开的情况下,配合对端设备协商将该连接的IP地址变更为第二IP地址,从而使得无需中断连接就实现IP地址的平滑变化。In this embodiment, when the connection using the first IP address is kept disconnected, the peer device negotiates to change the IP address of the connection to the second IP address, so that the IP address is smoothly changed without interrupting the connection.
上述分别从连接上的两端分别对支持地址变化的方法进行了说明,下面参考图7,再举例说明本发明的支持地址变化的方法的一详细实施例;其中,为了便于理解,以连接上的两端分别为服务端和客户端为例进行说明,并且以服务端作为IP地址变化的发起端,而客户端作为被动端来进行说明。The foregoing describes the method for supporting address change from the two ends of the connection respectively. Referring to FIG. 7, a detailed embodiment of the method for supporting address change according to the present invention is further illustrated; wherein, for ease of understanding, the connection is made. The two ends are respectively described by the server and the client, and the server is used as the initiator of the IP address change, and the client is used as the passive terminal for description.
如图7所示,其包括如下步骤:As shown in FIG. 7, it includes the following steps:
步骤701:服务端与客户端建立TCP连接。Step 701: The server establishes a TCP connection with the client.
其中,此连接可以为TCP连接,并且基于第一IP地址,其中第一IP地址是指服务端的地址。需要说明的是,在本实施例中,服务端的IP地址可变。而客户端的IP地址固定保持不变,因此不对客户端的IP地址进行特别说明。也就是说,后面提及的第二IP地址也是指服务端的IP地址。Wherein, the connection may be a TCP connection and is based on the first IP address, where the first IP address refers to the address of the server. It should be noted that, in this embodiment, the IP address of the server is variable. The IP address of the client remains fixed, so the client's IP address is not specified. That is to say, the second IP address mentioned later also refers to the IP address of the server.
步骤702:接收到IP地址变化的通知。Step 702: Receive a notification of an IP address change.
其中,服务端的IP地址可以周期性变化,例如由服务端中的IP地址变化处理单元周期性地变化IP地址。并且当IP地址变化周期到达时,通知服务端中的协商处理单元,通知的信息中包括当前使用的IP地址(第一IP地址),将要变化成的IP地址(第二IP地址)。The IP address of the server may be periodically changed. For example, the IP address change processing unit in the server periodically changes the IP address. And when the IP address change period arrives, the negotiation processing unit in the server is notified, and the notified information includes the currently used IP address (first IP address), and the IP address (second IP address) to be changed.
步骤703:向客户端发送IP地址变化请求报文。Step 703: Send an IP address change request message to the client.
其中,IP地址变化请求报文携带前述的地址变化标记和地址变化选项。其中,地址变化选项中的子类型设置为1,更新的IP地址设置为第二IP地址。The IP address change request packet carries the foregoing address change flag and address change option. Among them, the subtype in the address change option is set to 1, and the updated IP address is set to the second IP address.
其中,在步骤703中向客户端发送了地址变化请求报文之后,可以启动重传定时器。也就是说,在步骤703之后,如果预设时间内没有收到对端的回复,则执行重传操作。并且,可以同时设置重大重传次数。当达到最大重传次数后,仍没有收到对端的回复,则说明此次地址变化失败。 After the address change request message is sent to the client in step 703, the retransmission timer may be started. That is to say, after step 703, if the reply of the opposite end is not received within the preset time, the retransmission operation is performed. Also, you can set the number of major retransmissions at the same time. After the maximum number of retransmissions is reached, the reply from the peer is still not received, indicating that the address change failed.
另外,在向客户端发送IP地址变化请求报文之前,可以检测是否允许IP地址变化,若可以,才发送IP地址变化请求报文,否则不发送。具体而言,可以通过通知中的第一IP地址查找当前的使用该第一IP地址的TCP连接,然后检查该TCP连接是否可以进行地址变化(例如检测TCP是否正处于地址变化状态、跳变的地址是否合法等等),若可以则继续执行后续步骤,否则拒绝此次地址变化。In addition, before sending an IP address change request packet to the client, it can detect whether the IP address change is allowed. If yes, the IP address change request packet is sent, otherwise it is not sent. Specifically, the current first IP address in the notification can be used to find the current TCP connection using the first IP address, and then check whether the TCP connection can change the address (for example, detecting whether the TCP is in the address change state or jumping). Whether the address is legal, etc.), if possible, continue with the subsequent steps, otherwise the address change is rejected.
步骤704:客户端回复IP地址变化应答报文。Step 704: The client replies to the IP address change response message.
其中,此IP地址变化应答报文可以携带前述的地址变化标记和地址变化选项,并且将地址变化选项中的子类型设置为2。The IP address change response message may carry the foregoing address change flag and address change option, and set the subtype in the address change option to 2.
同时,客户端还可以启动地址变化应答重传定时器,并设置重传时间和最大重传次数。当达到最大重传次数后,仍没有收到服务端的回复,则可视为本次地址变化失败。At the same time, the client can also initiate an address change response retransmission timer and set the retransmission time and the maximum number of retransmissions. After the maximum number of retransmissions is reached, the server does not receive a reply, which may be regarded as a failure of the address change.
另外,客户端在回复IP地址变化应答报文之前,可以先检测TCP连接是否允许地址变化。若允许,发送IP地址变化应答报文;若不允许,则返回IP地址变化拒绝报文。其中,IP地址变化拒绝报文可以携带前述的地址变化标记和地址变化选项,并且将地址变化选项中的子类型设置为3。In addition, the client can detect whether the TCP connection allows address change before replying to the IP address change response message. If yes, send an IP address change response message; if not, return an IP address change rejection message. The IP address change reject message may carry the foregoing address change flag and address change option, and set the subtype in the address change option to 3.
步骤705:服务端回复IP地址确认报文。Step 705: The server replies to the IP address confirmation message.
其中,服务端收到IP地址变化应答报文,表明对端设备同意进行地址变化,则此时可以回复IP地址变化确认报文。The server receives the IP address change response packet, indicating that the peer device agrees to change the address, and then can reply the IP address change confirmation packet.
步骤706:服务端将TCP连接的地址更新为第二IP地址。Step 706: The server updates the address of the TCP connection to the second IP address.
步骤707:客户端收到IP地址确认报文后,将TCP连接的IP地址更新为第二IP地址。Step 707: After receiving the IP address confirmation message, the client updates the IP address of the TCP connection to the second IP address.
步骤708:服务端向客户端发送保活报文。Step 708: The server sends a keep-alive message to the client.
其中,保活报文是在新的连接上(服务端地址为第二IP地址)上传送的。The keep-alive message is transmitted on the new connection (the server address is the second IP address).
步骤709:客户端向服务端返回保活确认报文。Step 709: The client returns a keep-alive confirmation message to the server.
步骤710:服务端删除第一IP地址。Step 710: The server deletes the first IP address.
本实施例,在IP地址变化时,TCP两端交互携带有地址变化标记和地 址变化选项的地址变化请求、应答、确认报文来协商地址变化,使得TCP连接的两端能同时将IP地址切换到变化后的IP地址上,从而TCP连接保持不断开,应用的数据传输不中断。In this embodiment, when the IP address changes, the two ends of the TCP carry the address change flag and the ground. The address change request, the response, and the acknowledgement packet of the address change option negotiate the address change, so that both ends of the TCP connection can simultaneously switch the IP address to the changed IP address, so that the TCP connection remains intact, and the application data transmission is not Interrupted.
如图8所示,是本发明的支持地址变化的装置800的第一实施例的结构示意图。其中,该支持地址变化的装置可以是地址变化的发起端,例如前述的服务端。其包括:As shown in FIG. 8, it is a schematic structural diagram of a first embodiment of an apparatus 800 for supporting address change according to the present invention. The device supporting the address change may be an initiator of the address change, such as the foregoing server. It includes:
连接模块801,配置为与对端设备建立使用第一IP地址的连接;The connection module 801 is configured to establish a connection with the peer device using the first IP address.
协商模块802,配置为通过使用所述第一IP地址的所述连接,主动与所述对端设备协商将所述连接的IP地址变更为第二IP地址;The negotiation module 802 is configured to actively change the IP address of the connection to a second IP address by negotiating with the peer device by using the connection of the first IP address.
地址更新模块803,配置为当协商完成时,将所述连接的IP地址由所述第一IP地址变更为所述第二IP地址。The address update module 803 is configured to change the IP address of the connection from the first IP address to the second IP address when the negotiation is completed.
其中,协商模块801,具体配置为使用所述连接向所述对端设备发送IP地址变化请求报文,其中所述IP地址变化请求报文包括:第二IP地址;接收来自所述对端设备的用于响应所述IP地址变化请求报文的IP地址变化应答报文;以及向所述对端设备发送IP地址变化确认报文。The negotiation module 801 is configured to send an IP address change request message to the peer device by using the connection, where the IP address change request message includes: a second IP address; and receiving from the peer device And an IP address change response message for responding to the IP address change request message; and sending an IP address change confirmation message to the peer device.
其中,本实施例是与图1和2实施例相对应的装置实施例,因此相关细节描述,已在前述描述,在此不赘述。The present embodiment is an apparatus embodiment corresponding to the embodiment of FIG. 1 and FIG. 2, and thus the related detailed description has been described above, and details are not described herein.
如图9所示,是本发明的支持地址变化的装置800的第二实施例的结构示意图。其除了包括图8实施例所示的模块之外,还包括:As shown in FIG. 9, it is a schematic structural diagram of a second embodiment of the apparatus 800 for supporting address change according to the present invention. In addition to the modules shown in the embodiment of FIG. 8, it also includes:
发送模块804,配置为在所述地址更新模块将所述连接的IP地址由所述第一IP地址变更为第二IP地址之后,向所述对端设备发送第一保活报文;以及The sending module 804 is configured to: after the address update module changes the connected IP address from the first IP address to the second IP address, send the first keep-alive message to the peer device;
处理模块805,配置为当接收到所述对端设备发送的第二保活报文或者所述第一保活报文的保活确认报文时,删除所述第一IP地址。The processing module 805 is configured to delete the first IP address when receiving the second keep-alive message sent by the peer device or the keep-alive confirmation message of the first keep-alive message.
其中,此实施例为与前述图3实施例相对应的装置实施例,相关细节已在前描述,在此不赘述。The embodiment is an apparatus embodiment corresponding to the foregoing embodiment of FIG. 3, and the related details have been previously described, and details are not described herein.
实际应用时,连接模块801、协商模块802及发送模块804可由支持地址变化的装置800中的处理器结合通信接口实现;地址更新模块803及处 理模块805可由支持地址变化的装置800中的处理器实现。也就是说,本发明实施例支持地址变化的装置800包括:处理器和用于存储能够在处理器上运行的计算机程序的存储器,In practical applications, the connection module 801, the negotiation module 802, and the sending module 804 can be implemented by a processor in the device 800 supporting the address change in combination with the communication interface; the address update module 803 and The management module 805 can be implemented by a processor in the device 800 that supports address changes. That is, the apparatus 800 supporting address change according to an embodiment of the present invention includes: a processor and a memory for storing a computer program executable on the processor,
其中,所述处理器配置为运行所述计算机程序时,执行上述方法的步骤。Wherein the processor is configured to perform the steps of the above method when the computer program is run.
这里,所述处理器与所述通信接口连接,以实现与对端设备的交互。Here, the processor is connected to the communication interface to implement interaction with the peer device.
如图10所示,是本发明的支持地址变化的装置100的第三实施例的结构示意图。该支持地址变化的装置100主要配置为被动接受地址变化的一端,如前述的客户端。其包括:As shown in FIG. 10, it is a schematic structural diagram of a third embodiment of the apparatus 100 for supporting address change according to the present invention. The device 100 supporting the address change is mainly configured to passively accept one end of the address change, such as the aforementioned client. It includes:
连接模块101,配置为与对端设备建立使用第一IP地址的连接。The connection module 101 is configured to establish a connection with the peer device using the first IP address.
协商模块102,配置为接受所述对端设备发起的将所述连接的IP地址变更为第二IP地址的协商,其中所述第二IP地址由所述对端设备提供;以及The negotiation module 102 is configured to accept, by the peer device, a negotiation of changing the IP address of the connection to a second IP address, where the second IP address is provided by the peer device;
地址更新模块103,配置为当协商完成时,将所述连接的IP地址由所述第一IP地址变更为所述第二IP地址。The address update module 103 is configured to change the IP address of the connection from the first IP address to the second IP address when the negotiation is completed.
其中,所述协商模块102,具体配置为接收来自所述对端设备的IP地址变化请求报文,其中所述IP地址变化请求报文包括:所述第二IP地址;根据所述IP地址变化请求报文,向所述对端设备回复IP地址变化应答报文;以及接收所述对端设备发送的IP地址变化确认报文;其中,当接收到所述IP地址变化确认报文,则表明所述协商完成。The negotiation module 102 is configured to receive an IP address change request packet from the peer device, where the IP address change request packet includes: the second IP address; Receiving a message, replying to the peer device with an IP address change response message; and receiving an IP address change confirmation message sent by the peer device; wherein, when receiving the IP address change confirmation message, indicating The negotiation is completed.
其中,此实施例是与前述的图4和5实施例相对应的装置实施例,因此相关细节已在前述描述,在此不赘述。Wherein, this embodiment is an apparatus embodiment corresponding to the foregoing embodiments of FIG. 4 and FIG. 5, and thus the related details have been described above, and are not described herein.
另外,如图10所示,该支持地址变化的装置100还包括:收发模块104,配置为在所述地址更新模块将所述连接的IP地址由所述第一IP地址变更为所述第二IP地址之后,向所述对端设备发送第一保活报文,或者当接收到来自所述对端设备的第二保活报文时,向所述对端设备发送所述第二保活报文的保活确认报文。In addition, as shown in FIG. 10, the apparatus 100 for supporting address change further includes: a transceiver module 104 configured to change, at the address update module, the IP address of the connection from the first IP address to the second After the IP address, the first keepalive message is sent to the peer device, or when the second keepalive message from the peer device is received, the second keepalive is sent to the peer device The keepalive confirmation message of the message.
其中,此过程可以参考前述图6实施例的描述,在此不赘述。 For this process, reference may be made to the foregoing description of the embodiment of FIG. 6, and details are not described herein.
实际应用时,连接模块101、协商模块102及收发模块104可由支持地址变化的装置100中的处理器结合通信接口实现;地址更新模块103可由支持地址变化的装置800中的处理器实现。也就是说,本发明实施例支持地址变化的装置800包括:处理器和用于存储能够在处理器上运行的计算机程序的存储器,In practical applications, the connection module 101, the negotiation module 102, and the transceiver module 104 can be implemented by a processor in the device 100 supporting address change in conjunction with a communication interface; the address update module 103 can be implemented by a processor in the device 800 that supports address changes. That is, the apparatus 800 supporting address change according to an embodiment of the present invention includes: a processor and a memory for storing a computer program executable on the processor,
其中,所述处理器配置为运行所述计算机程序时,执行上述方法的步骤。Wherein the processor is configured to perform the steps of the above method when the computer program is run.
这里,所述处理器与所述通信接口连接,以实现与对端设备的交互。Here, the processor is connected to the communication interface to implement interaction with the peer device.
值得一提的是,本发明所涉及到的各模块均为逻辑模块,在实际应用中,一个逻辑单元可以是一个物理单元,也可以是一个物理单元的一部分,还可以以多个物理单元的组合实现。此外,为了突出本发明的创新部分,本实施方式中并没有将与解决本发明所提出的技术问题关系不太密切的单元引入,但这并不表明本实施方式中不存在其它的单元。It is worth mentioning that each module involved in the present invention is a logic module. In practical applications, a logical unit may be a physical unit, a part of a physical unit, or multiple physical units. Combined implementation. In addition, in order to highlight the innovative part of the present invention, the present embodiment does not introduce a unit that is not closely related to solving the technical problem proposed by the present invention, but this does not mean that there are no other units in the present embodiment.
本领域普通技术人员可以理解实现上述实施方式方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的程序可存储于一计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,所述的存储介质可为磁碟、光盘、只读存储记忆体(ROM,Read-Only Memory,)或随机存储记忆体(RAM,Random Access Memory)等。A person skilled in the art can understand that all or part of the process of implementing the foregoing embodiment method can be completed by a computer program to instruct related hardware, and the program can be stored in a computer readable storage medium, the program When executed, the flow of an embodiment of the methods as described above may be included. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
基于此,本发明实施例提供一种存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现上述方法的步骤。Based on this, an embodiment of the present invention provides a storage medium on which a computer program is stored, and when the computer program is executed by a processor, the steps of the foregoing method are implemented.
本领域的普通技术人员可以理解,上述各实施方式是实现本发明的具体实施例,而在实际应用中,可以在形式上和细节上对其作各种改变,而不偏离本发明的精神和范围。A person skilled in the art can understand that the above embodiments are specific embodiments for implementing the present invention, and various changes can be made in the form and details without departing from the spirit and scope of the present invention. range.
工业实用性Industrial applicability
本发明实施例提供的方案,在保持连接不断开的情况下,利用该连接与对端设备协商将该连接的IP地址由第一IP地址变更为第二IP地址,从而使得无需中断连接就实现IP地址的平滑变化。 The solution provided by the embodiment of the present invention, in the case that the connection is not disconnected, uses the connection to negotiate with the peer device to change the IP address of the connection from the first IP address to the second IP address, thereby implementing the connection without interrupting the connection. A smooth change in the IP address.

Claims (18)

  1. 一种支持地址变化的方法,包含:A method to support address changes, including:
    与对端设备建立使用第一IP地址的连接;Establishing a connection with the peer device using the first IP address;
    通过使用所述第一IP地址的所述连接,主动与所述对端设备协商将所述连接的IP地址变更为第二IP地址;Proactively negotiating with the peer device to change the IP address of the connection to a second IP address by using the connection of the first IP address;
    当协商完成时,将所述连接的IP地址由所述第一IP地址变更为所述第二IP地址。When the negotiation is completed, the IP address of the connection is changed from the first IP address to the second IP address.
  2. 根据权利要求1所述的支持地址变化的方法,其中,所述主动与所述对端设备协商将所述连接的IP地址变更为第二IP地址,包括:The method for supporting address change according to claim 1, wherein the actively negotiating with the peer device to change the connected IP address to a second IP address comprises:
    使用所述连接向所述对端设备发送IP地址变化请求报文,其中所述IP地址变化请求报文包括:第二IP地址。Sending an IP address change request message to the peer device by using the connection, where the IP address change request message includes: a second IP address.
  3. 根据权利要求2所述的支持地址变化的方法,其中,所述主动与所述对端设备协商将所述连接的IP地址变更为第二IP地址,还包括:The method for supporting address change according to claim 2, wherein the actively negotiating with the peer device to change the IP address of the connection to the second IP address further includes:
    接收来自所述对端设备的用于响应所述IP地址变化请求报文的IP地址变化应答报文;以及Receiving an IP address change response message from the peer device for responding to the IP address change request message;
    向所述对端设备发送IP地址变化确认报文。Sending an IP address change confirmation message to the peer device.
  4. 根据权利要求1所述的支持地址变化的方法,其中,所述方法还包括:The method for supporting address change according to claim 1, wherein the method further comprises:
    在所述将所述连接的IP地址由所述第一IP地址变更为第二IP地址之后,向所述对端设备发送第一保活报文;After the IP address of the connection is changed from the first IP address to the second IP address, the first keepalive message is sent to the peer device;
    当接收到所述对端设备发送的第二保活报文或者所述第一保活报文的保活确认报文时,删除所述第一IP地址。And deleting the first IP address when receiving the second keep-alive message sent by the peer device or the keep-alive confirmation message of the first keep-alive message.
  5. 根据权利要求1所述的支持地址变化的方法,其中,所述方法还包括:The method for supporting address change according to claim 1, wherein the method further comprises:
    接收将所述连接的IP地址变化为所述第二IP地址的通知;Receiving a notification of changing the IP address of the connection to the second IP address;
    根据所述通知,检测到允许IP地址变化时,执行所述主动与所述对 端设备协商将所述连接的IP地址变更为第二IP地址的步骤。According to the notification, when detecting that the allowed IP address changes, performing the initiative and the pair The step of negotiating the changed IP address of the connection to the second IP address by the end device.
  6. 根据权利要求1所述的支持地址变化的方法,其中,所述连接为传输控制协议TCP连接。The method of supporting address change according to claim 1, wherein said connection is a Transmission Control Protocol (TCP) connection.
  7. 一种支持地址变化的方法,包括:A method to support address changes, including:
    与对端设备建立使用第一IP地址的连接;Establishing a connection with the peer device using the first IP address;
    接受所述对端设备发起的将所述连接的IP地址变更为第二IP地址的协商,其中所述第二IP地址由所述对端设备提供;以及Accepting, by the peer device, a negotiation of changing the IP address of the connection to a second IP address, where the second IP address is provided by the peer device;
    当协商完成时,将所述连接的IP地址由所述第一IP地址变更为所述第二IP地址。When the negotiation is completed, the IP address of the connection is changed from the first IP address to the second IP address.
  8. 根据权利要求7所述的支持地址变化的方法,其中,所述接受所述对端设备发起的将所述连接的IP地址变更为第二IP地址的协商,包括:The method for supporting address change according to claim 7, wherein the accepting the negotiation initiated by the peer device to change the connected IP address to the second IP address comprises:
    接收来自所述对端设备的IP地址变化请求报文,其中所述IP地址变化请求报文包括:所述第二IP地址;Receiving an IP address change request message from the peer device, where the IP address change request message includes: the second IP address;
    根据所述IP地址变化请求报文,向所述对端设备回复IP地址变化应答报文;以及And replying to the peer device with an IP address change response message according to the IP address change request packet;
    接收所述对端设备发送的IP地址变化确认报文;Receiving an IP address change confirmation message sent by the peer device;
    其中,当接收到所述IP地址变化确认报文,则表明所述协商完成。When the IP address change confirmation message is received, it indicates that the negotiation is completed.
  9. 根据权利要求7所述的支持地址变化的方法,其中,所述方法还包括:The method of supporting address change according to claim 7, wherein the method further comprises:
    将所述连接的IP地址由所述第一IP地址变更为所述第二IP地址之后,向所述对端设备发送第一保活报文,或者当接收到来自所述对端设备的第二保活报文时,向所述对端设备发送所述第二保活报文的保活确认报文。After the IP address of the connection is changed from the first IP address to the second IP address, sending a first keep-alive message to the peer device, or receiving a message from the peer device When the second keepalive message is sent, the keepalive acknowledgement message of the second keepalive message is sent to the peer device.
  10. 根据权利要求7所述的支持地址变化的方法,其中,所述连接为传输控制协议TCP连接。The method of supporting address change according to claim 7, wherein said connection is a Transmission Control Protocol (TCP) connection.
  11. 一种支持地址变化的装置,包含:A device that supports address changes, comprising:
    连接模块,配置为与对端设备建立使用第一IP地址的连接; a connection module configured to establish a connection with the peer device using the first IP address;
    协商模块,配置为通过使用所述第一IP地址的所述连接,主动与所述对端设备协商将所述连接的IP地址变更为第二IP地址;The negotiation module is configured to actively change the IP address of the connection to the second IP address by negotiating with the peer device by using the connection of the first IP address;
    地址更新模块,配置为当协商完成时,将所述连接的IP地址由所述第一IP地址变更为所述第二IP地址。The address update module is configured to change the IP address of the connection from the first IP address to the second IP address when the negotiation is completed.
  12. 根据权利要求10所述的支持地址变化的装置,其中,所述协商模块,配置为:The apparatus for supporting address change according to claim 10, wherein the negotiation module is configured to:
    使用所述连接向所述对端设备发送IP地址变化请求报文,其中所述IP地址变化请求报文包括:第二IP地址;Sending an IP address change request message to the peer device by using the connection, where the IP address change request message includes: a second IP address;
    接收来自所述对端设备的用于响应所述IP地址变化请求报文的IP地址变化应答报文;以及Receiving an IP address change response message from the peer device for responding to the IP address change request message;
    向所述对端设备发送IP地址变化确认报文。Sending an IP address change confirmation message to the peer device.
  13. 根据权利要求10所述的支持地址变化的装置,其中,还包括:The device for supporting address change according to claim 10, further comprising:
    发送模块,配置为在所述地址更新模块将所述连接的IP地址由所述第一IP地址变更为第二IP地址之后,向所述对端设备发送第一保活报文;以及a sending module, configured to send the first keep-alive message to the peer device after the address update module changes the IP address of the connection from the first IP address to the second IP address;
    处理模块,配置为当接收到所述对端设备发送的第二保活报文或者所述第一保活报文的保活确认报文时,删除所述第一IP地址。The processing module is configured to delete the first IP address when receiving the second keep-alive message sent by the peer device or the keep-alive confirmation message of the first keep-alive message.
  14. 根据权利要求10所述的支持地址变化的装置,其中,The apparatus for supporting address change according to claim 10, wherein
    所述协商模块,配置为当接收到将所述连接的IP地址变化为第二IP地址的通知时,检测是否允许IP地址变化,以及当检测到允许IP地址变化时,主动与所述对端设备协商将所述连接的IP地址变更为第二IP地址。The negotiation module is configured to detect, when the notification of changing the IP address of the connection is changed to the second IP address, whether the IP address change is allowed, and when the change of the allowed IP address is detected, actively and the opposite end The device negotiates to change the IP address of the connection to the second IP address.
  15. 一种支持地址变化的装置,包括:A device that supports address changes, including:
    连接模块,配置为与对端设备建立使用第一IP地址的连接;a connection module configured to establish a connection with the peer device using the first IP address;
    协商模块;配置为接受所述对端设备发起的将所述连接的IP地址变更为第二IP地址的协商,其中所述第二IP地址由所述对端设备提供;以及a negotiation module, configured to accept, by the peer device, a negotiation to change the IP address of the connection to a second IP address, where the second IP address is provided by the peer device;
    地址更新模块,配置为当协商完成时,将所述连接的IP地址由所述 第一IP地址变更为所述第二IP地址。An address update module configured to: when the negotiation is completed, the IP address of the connection is The first IP address is changed to the second IP address.
  16. 根据权利要求15所述的支持地址变化的装置,其中,所述协商模块,配置为:The apparatus for supporting address change according to claim 15, wherein the negotiation module is configured to:
    接收来自所述对端设备的IP地址变化请求报文,其中所述IP地址变化请求报文包括:所述第二IP地址;Receiving an IP address change request message from the peer device, where the IP address change request message includes: the second IP address;
    根据所述IP地址变化请求报文,向所述对端设备回复IP地址变化应答报文;以及And replying to the peer device with an IP address change response message according to the IP address change request packet;
    接收所述对端设备发送的IP地址变化确认报文;Receiving an IP address change confirmation message sent by the peer device;
    其中,当接收到所述IP地址变化确认报文,则表明所述协商完成。When the IP address change confirmation message is received, it indicates that the negotiation is completed.
  17. 根据权利要求15所述的支持地址变化的装置,其中,还包括:The device for supporting address change according to claim 15, further comprising:
    收发模块,配置为在所述地址更新模块将所述连接的IP地址由所述第一IP地址变更为所述第二IP地址之后,向所述对端设备发送第一保活报文,或者当接收到来自所述对端设备的第二保活报文时,向所述对端设备发送所述第二保活报文的保活确认报文。The transceiver module is configured to send the first keep-alive message to the peer device after the address update module changes the IP address of the connection from the first IP address to the second IP address, or When the second keep-alive message from the peer device is received, the keep-alive confirmation message of the second keep-alive message is sent to the peer device.
  18. 一种存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现权利要求1至6任一项所述方法的步骤,或者实现权利要求7至10任一项所述方法的步骤。 A storage medium having stored thereon a computer program, the computer program being executed by a processor to perform the steps of the method of any one of claims 1 to 6, or the method of any one of claims 7 to 10 step.
PCT/CN2017/112377 2016-11-29 2017-11-22 Method and apparatus for supporting address changes, and storage medium WO2018099308A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201611073478.2 2016-11-29
CN201611073478.2A CN108124023A (en) 2016-11-29 2016-11-29 Support the method and device of address change

Publications (1)

Publication Number Publication Date
WO2018099308A1 true WO2018099308A1 (en) 2018-06-07

Family

ID=62225874

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/112377 WO2018099308A1 (en) 2016-11-29 2017-11-22 Method and apparatus for supporting address changes, and storage medium

Country Status (2)

Country Link
CN (1) CN108124023A (en)
WO (1) WO2018099308A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112231679A (en) * 2020-09-29 2021-01-15 新华三信息安全技术有限公司 Terminal equipment verification method and device and storage medium
CN115996210A (en) * 2023-03-23 2023-04-21 湖南盾神科技有限公司 Address port hopping method of source variable mode

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107547692B (en) * 2017-09-30 2020-12-15 烽火通信科技股份有限公司 Method and device for configuring IP address and port number between dual systems
CN109710545B (en) * 2018-12-27 2021-01-15 联想(北京)有限公司 Data transmission method and device, computer readable storage medium and computer system
CN114401305A (en) * 2021-12-13 2022-04-26 国家电投集团数字科技有限公司 Communication connection method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101127778A (en) * 2007-09-11 2008-02-20 中兴通讯股份有限公司 A method for dynamic update of flow control transmission protocol address list
CN102299836A (en) * 2011-09-16 2011-12-28 北京星网锐捷网络技术有限公司 Method and device for accessing access equipment
CN103152272A (en) * 2013-02-26 2013-06-12 杭州华三通信技术有限公司 Method and equipment for maintaining border gateway protocol (BGP) neighborship
WO2016045065A1 (en) * 2014-09-25 2016-03-31 Nokia Solutions And Networks Oy Tcp connection establishment and handover

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101127778A (en) * 2007-09-11 2008-02-20 中兴通讯股份有限公司 A method for dynamic update of flow control transmission protocol address list
CN102299836A (en) * 2011-09-16 2011-12-28 北京星网锐捷网络技术有限公司 Method and device for accessing access equipment
CN103152272A (en) * 2013-02-26 2013-06-12 杭州华三通信技术有限公司 Method and equipment for maintaining border gateway protocol (BGP) neighborship
WO2016045065A1 (en) * 2014-09-25 2016-03-31 Nokia Solutions And Networks Oy Tcp connection establishment and handover

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
WEN, ZEHU: "A method for Dynamically Switching IP Addresses for TCP Connection", SCIENCE & TECHNOLOGY, 31 December 2011 (2011-12-31), pages 633 - 634, ISSN: 1001-9960 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112231679A (en) * 2020-09-29 2021-01-15 新华三信息安全技术有限公司 Terminal equipment verification method and device and storage medium
CN112231679B (en) * 2020-09-29 2023-03-28 新华三信息安全技术有限公司 Terminal equipment verification method and device and storage medium
CN115996210A (en) * 2023-03-23 2023-04-21 湖南盾神科技有限公司 Address port hopping method of source variable mode

Also Published As

Publication number Publication date
CN108124023A (en) 2018-06-05

Similar Documents

Publication Publication Date Title
WO2018099308A1 (en) Method and apparatus for supporting address changes, and storage medium
ES2374341T3 (en) METHOD, SYSTEM AND DEVICE FOR PROCESSING ACCESS REQUEST INFORMATION.
ES2637069T3 (en) Network proxy implementation method and device
EP3163799B1 (en) Network device and method for sending bgp information
EP3276891B1 (en) Techniques for establishing a communication connection between two network entities via different network flows
US20170149738A1 (en) Virtual Private Network Implementation Method and Client Device
TWI599201B (en) Network system and method for establishing data connection
CN107529229B (en) Data transmission method, device and system
WO2014117475A1 (en) Method for establishing general router encapsulation tunnel, communication device and communication system
WO2018121528A1 (en) Packet processing
WO2019120160A1 (en) Method and device for data storage, and distributed storage system
EP4181436B1 (en) Data processing method and apparatus, related device and storage medium
WO2015172629A1 (en) Message transmission method, apparatus and system
CN107707689A (en) A kind of DHCP message processing method, Dynamic Host Configuration Protocol server and gateway device
US9888001B2 (en) Methods, systems, and computer readable media for negotiating diameter capabilities
WO2017219868A1 (en) Arp entry processing method and apparatus
US10999379B1 (en) Liveness detection for an authenticated client session
WO2017161866A1 (en) Network connection method and device
CN107454178B (en) Data transmission method and device
JP2014146876A (en) Message distribution system and message distribution method
JP2018508161A (en) SCTP connection reestablishing method and apparatus, and storage medium
US20160381147A1 (en) Information transmission method and apparatus
CN103516601A (en) Method, device and system for route transmission
US10382274B2 (en) System and method for wide area zero-configuration network auto configuration
WO2016206299A1 (en) Session keep-alive method and device

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

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

Country of ref document: EP

Kind code of ref document: A1