WO2004084496A1 - Procede de mise en oeuvre de la distribution de la charge dynamique par les passerelles - Google Patents
Procede de mise en oeuvre de la distribution de la charge dynamique par les passerelles Download PDFInfo
- Publication number
- WO2004084496A1 WO2004084496A1 PCT/CN2004/000147 CN2004000147W WO2004084496A1 WO 2004084496 A1 WO2004084496 A1 WO 2004084496A1 CN 2004000147 W CN2004000147 W CN 2004000147W WO 2004084496 A1 WO2004084496 A1 WO 2004084496A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- gateway
- master
- message
- slave
- forwarding list
- Prior art date
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/28—Routing or path finding of packets in data switching networks using route fault recovery
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/58—Association of routers
- H04L45/583—Stackable routers
Definitions
- the present invention relates to the field of data communications, and more specifically, to a method for implementing dynamic load sharing by a gateway of a local area network. Background of the invention
- FIG. 1 is a schematic diagram of the hosts in the local area network connected to the WAN through a gateway.
- all the hosts 101 and 102 are connected to all the gateways 104 and 105 through their local area network 103, and all the gateways 104 and 105 are connected to the WAN 106. , 107 connections, thereby realizing the connection between the host and the WAN.
- these gateways In order to ensure the reliability of data access, these gateways need to have the function of backing up each other; in order to make full use of the processing performance of the gateway and the bandwidth of the LAN exit bandwidth, these gateways are required to have the function of load sharing.
- a virtual router redundancy protocol proposes a backup scheme.
- the host sends data packets through the active gateway. If the active gateway fails, the standby gateway replaces the active gateway to send data. data.
- the backup solution first sets up a virtual IP address and a medium access control (MAC) address for all gateways in the local area network.
- the gateway addresses of all hosts in the local area network point to the virtual IP address, and the host sends the virtual IP address to the virtual IP address.
- ARP Address Resolution Protocol
- the active gateway responds to the host's ARP request with the virtual MAC address as its own MAC address, and the host receives the response from the active gateway.
- ARP Address Resolution Protocol
- the virtual MAC address is used as a destination address to send data to the gateway, and the active gateway receives and forwards the data.
- the active gateway also needs to send data to the host. In this case, if there is no MAC address of the host in the active gateway, the active gateway sends an ARP request to the host through its own IP and MAC address to obtain the host ’s MAC address.
- the active gateway also needs to periodically send VRRP protocol packets to the standby gateway. The standby gateway monitors the status of the active gateway through this message. If the standby gateway does not receive a set number of VRRP protocol packets in a row, the standby gateway It can replace the active gateway to perform services and implement the backup function of the router.
- the VRRP protocol specifically implements load sharing by establishing two VRRP backup groups.
- This load sharing scheme sets all gateways as two VRRP backup groups.
- the gateway 104 can be used as the primary gateway of VRRP backup group 1
- the gateway 105 can be used as the backup gateway of VRRP backup group 1.
- the gateway 105 can be used as the main gateway of VRRP backup group 2.
- 104 serves as a backup gateway for VRRP backup group 2.
- Each VRRP backup group is configured with a virtual IP address and a virtual MAC address.
- all the gateways in each VRRP backup group are equivalent to one IP address and MAC address for the host to the virtual IP address and virtual MAC address.
- Gateway Based on the above settings, if the gateway addresses of a part of the hosts 101 in the local area network 102 are set to point to the virtual IP address of VRRP backup group 1, the hosts 101 pass through the main gateway in the group, that is, the gateway 104 and the WAN 106 or 107. Connect; Set the gateway address of another part of the host 102 as the virtual IP address of VRRP backup group 2, then the part of the host 102 connects to the WAN 106 or 107 through the group's main gateway, that is, the gateway 105, thereby realizing the gateway 104 Load sharing with the gateway 105.
- the gateway backup is implemented in the same way as described above.
- the active gateway in each VRRP backup group needs to periodically send VRJ P protocol packets to the standby gateway.
- the standby gateway monitors the status of the active gateway through this message. After receiving a set number of VRRP protocol packets, the standby gateway performs services instead of the active gateway. Therefore, if one gateway fails, the other gateway becomes the master gateway of the two VRRP backup groups, and all hosts are connected to the WAN through the gateway to implement the backup function of the gateway.
- the main object of the present invention is to provide a method for implementing dynamic load sharing of a gateway, so that all hosts in a local area network can access the WAN through dynamic load sharing of multiple gateways without setting different gateway addresses.
- a further object of the present invention is to ensure the backup function of the gateway.
- the method includes at least the following steps:
- Each load sharing gateway sends a broadcast (ADVERTISE) message carrying the priority of the gateway to other gateways as a master gateway (MASTER);
- All gateways receiving ADVERTISE messages determine whether their priority is greater than the priority carried by all ADVERTISE messages received. If it is greater than that, determine that the gateway is MASTER, otherwise, determine that the gateway is a slave gateway (SLAVE);
- MASTER obtains the weights of all gateways, and allocates the packets forwarded by each gateway according to the weights of all gateways, establishes a forwarding list containing the gateway identifier and related information required by the gateway to process the messages, and stores them in MASTER Forwarding list, and setting the forwarding list in the ADVERTISE message sent to SLAVE;
- Each SLAVE obtains the forwarding list of the gateway through the ADVERTISE message, returns a response (RESPONSE) message carrying the weight to the MASTER, and connects the host corresponding to the forwarding list to the WAN;
- step d The MASTER judges whether all SLAVE RESPONSE packets are received within the preset timer time. If it is, then it is further judged whether the weight of the SLAVE has changed. If it has not changed, it is confirmed that the SLAVE has correctly received the forwarding list. If the weight is changed, or no RESPONSE message is received, step d is performed again.
- the method may further include: the load sharing gateway determines whether it can connect the host to the WAN, and if so, continues to send messages to other gateways; otherwise, the gateway stops sending messages to other gateways.
- step a the weight of the set gateway is set according to the link bandwidth of the gateway to the WAN outbound interface.
- step d the MASTER obtains the weights of all gateways: the MASTER sends an ADVERTISE message to SLAVE to obtain the gateway load sharing weight, and after all SLAVEs receive the MASTER's ADVERTISE message, the feedback carries the load sharing of the gateway Weighted RESPONSE message, MASTER gets from the received RESPONSE message The weight of the gateway.
- the MASTER allocating the message forwarded by each gateway further includes: allocating the message forwarded by each gateway according to the host data and the host message information in the local area network.
- the host message information is address information of a host to which the message belongs, and the gateway in the forwarding list needs to process ⁇ !
- the relevant information of the text is the address information of the host.
- the address information of the host is IP address or MAC address information of the host.
- the host message information is any of message length information, a service type (TOS) domain, a source port domain, a destination port domain, a source IP address, a destination IP address, and an access control list (ACL) rule.
- TOS service type
- ACL access control list
- step d the MASTER setting the forwarding list in the ADVERTISE message is: setting the forwarding lists of all SLAVEs in one ADVERTISE message;
- each SLAVE obtains the forwarding list of the gateway through the ADVERTISE message: Each SLAVE obtains the forwarding list of the gateway from the ADVERTISE message according to the gateway identifier in the forwarding list.
- step d the MASTER setting the forwarding list in the ADVERTISE message is: setting the forwarding lists of all SLAVEs in turn in each ADVERTISE message of MASTEP;
- each SLAVE obtains the forwarding list of the gateway through the ADVERTISE message is: each SLAVE determines whether to obtain the forwarding list from the ADVERTISE message according to the gateway identifier in the forwarding list, and if so, obtains the forwarding list ; Otherwise, no processing is performed.
- the MASTER periodically sends an ADVERTISE message including the priority of the gateway to other gateways.
- the method further includes: SLAVE determines whether the ADVERTISE message of the MASTER is received within a preset timer time, and if received, then Make sure the current MASTER is working normally; if it is not received after the timer expires, It is determined that the current MASTER is abnormal, and the SLAVE sends the ADVERTISE message carrying the priority of the gateway to other gateways as the MASTER, and then step c is performed again;
- the method further includes: the MASTER determines whether it has received an ADVERTISE message sent by another gateway, and if it receives, further judges whether the priority carried in the ADVERTISE message is higher than its own priority If it is higher, it determines that this gateway is SLAVE. If it is not higher, or if it does not receive the ADVERTISE message from other gateways, then it determines that this gateway is MASTER.
- the method may further include: setting a timer for each message in the forwarding list by the MASTER, and clearing the timer if there is a message to be forwarded within the timer setting time; otherwise, deleting the message Message and repeat step d.
- the method may further include: starting a timer in the MASTER. If the timer expires, the MASTER deletes all host message information and re-establishes a forwarding list; otherwise, the timer is cleared.
- the method may further include: after the MASTER obtains the host message information of the newly added LAN, the step d is performed again.
- the method may further include: after the MASTER obtains the host message information of the newly added LAN, the MASTER divides the newly added host message information according to the weight of each gateway, and sends the host message information through an ADVERTISE message. To the original forwarding list corresponding to SLAVE.
- the MASTER further includes: determining whether the SLAVE is a gateway corresponding to the forwarding list, and if not, performing step d again; otherwise, determining whether the weight of the SLAVE is changed A step of.
- the backup group sets a virtual IP address and a virtual MAC address so that the gateway addresses of all hosts point only to the virtual IP address, which solves the problem of setting different virtual IP addresses in the prior art
- MASTER By determining MASTER and SLAVE in the VRRP backup group, MASTER establishes the forwarding list of each gateway according to the SLAVE and host message information in the local area network, so that each gateway forwards the host message through the forwarding list. If SLAVE and host message information If there is a change, the forwarding list is re-established by the MASTER to implement dynamic load sharing between the gateways;
- the MASTER can be re-determined to ensure backup between gateways;
- each gateway By setting each gateway to stop sending packets to other gateways when exiting load sharing, the function of each gateway to implement backup switching is expanded;
- each gateway can also be determined according to the bandwidth of the outbound interface from each gateway to the WAN, so that each gateway can use the egress bandwidth of the LAN more reasonably during load sharing.
- Figure 1 is a schematic diagram of a host in a LAN connecting to a WAN through a gateway;
- FIG. 2 is a flowchart of implementing dynamic load sharing among gateways according to an embodiment of the present invention. Mode of Carrying Out the Invention
- the solution of the present invention is mainly to form a VRRP backup group for all gateways participating in load sharing, and set a virtual IP address and a virtual MAC address for the backup group.
- the gateway addresses of all hosts should correspond to the virtual IP addresses, and from the gateways of the group, Determine the MASTER as the master gateway and SLAVE as the slave gateway.
- the MASTER is based on the weights and bureaus of each gateway.
- the host message information in the local area network establishes and maintains a forwarding list for each gateway to process the host message. Each gateway sends the host message according to the forwarding list to implement load sharing.
- SLAVE monitors the status of the MASTER. Once the MASTER exits the load sharing, all the SLAVE redefines the MASTER, thus implementing the backup function.
- the hosts in the local area network in this embodiment are connected to the WAN through the gateways 104 and 105, and the process of implementing dynamic load sharing between the gateway 104 and the gateway 105 is shown in FIG. 2, corresponding to the following steps:
- Step 201 Set the priorities of the gateways 104 and 105 and the weights of each gateway for load sharing, set timers in each gateway, and set the two gateways as a VRRP backup group.
- the weight of each gateway is determined according to needs. For example, the weight of the gateway can be determined according to the bandwidth of the gateway to the WAN outbound interface. The weight of each gateway can reflect the current link bandwidth of the outbound interface of the WAN. Performing load sharing by size can make more reasonable use of the egress bandwidth of the local area network 5 and can not consider how load sharing is configured when changing the egress bandwidth.
- the priority of the gateway 104 is higher than the priority of the gateway 105.
- the weight of the gateway 104 is set to 3, and the weight of the gateway 105 is 2.
- the virtual IP address of the VRRP backup group is the local network segment. Within a common IP address, the virtual MAC address is a special MAC address, which is uniformly divided by the Institute of Electrical and Electronics Engineers (IEEE).
- Step 202 Each gateway sends a broadcast (ADVERTISE) message to determine MASTER and SLAVE in the gateway.
- ADVERTISE broadcast
- Each gateway initially considers itself a MASTER, and broadcasts the ADVERTISE message to the other gateways when accessing the LAN. This message carries the priority of the gateway. Each gateway receives the ADVERTISE message in the message. Ratio of the carried priority to the priority of the gateway In contrast, if the former has a higher priority, the gateway sets itself as SLAVE and returns a response (RESPONSE) message carrying the weight of the gateway. Otherwise, it considers itself to be the master and periodically sends ADVERTISE messages to each SLAVE.
- Step 203 The MASTER establishes a forwarding list allocated to each gateway by itself according to the host packet information and the weights of all the gateways in the local area network.
- the MASTER needs to set the forwarding list assigned to each gateway.
- the forwarding list needs to set the identity of the corresponding gateway and the message information that the gateway needs to process.
- the MASTER sends the forwarding list to each SLAVE, it also saves the forwarding itself. List.
- a timer can be set for each message in the forwarding list and a time range can be set. If a matching message needs to be sent within the set time range, the timer is reset. If the timer expires and no matching message needs to be forwarded, the host message information is deleted and the forwarding list is reset by MASTER . You can also set a timer on the MASTER and set a time range. After the timer expires, the MASTER deletes all host message information and resets the forwarding list.
- a forwarding list can also be established according to the service type (TOS) domain, source or destination port domain, source or destination IP address, or access control list (ACL) rules of the message. And use this message information as the request information of each message in the forwarding list.
- TOS service type
- ACL access control list
- This embodiment adopts the first method, specifically, according to the weight distribution of the gateway.
- the host in the local area network distributes packets to each gateway in units of the host. Since the ARP request sent by all hosts in the LAN is answered by the MASTER, the gateway 104 as the master knows the MAC addresses and IP addresses of all the hosts.
- the gateway 104 learns that there are 100 hosts in the LAN, the RESPONSE report returned from the gateway 105 It is learned that the weight of the gateway 105 is 2, and the weight of the gateway 104 itself is 3, then 60 hosts can be randomly assigned to the gateway 104, and the MAC addresses or IP address information of these hosts is set to the In the forwarding list, the remaining 40 units are allocated to the gateway 105, and the MAC addresses or IP address information of the remaining hosts are set in the forwarding list allocated to the gateway 105.
- the purpose of setting the MAC address or IP address information of the host in the forwarding list is to be able to use this information as an index so that each gateway can know which hosts need to connect to the local area network through the gateway based on the information.
- the MASTER needs to re-establish the forwarding list, but generally speaking, adding hosts will not cause all SLAVE forwarding lists to change. Therefore, you can set the MASTER to pass only the information of the added host and the information of the gateway that is responsible for sending the host message each time through the ADVERTISE message, instead of the entire forwarding list for the gateway. This can not only reduce the ADVERTISE message to the network The bandwidth is occupied, and the overhead of the gateway processing ADVERTISE 4 text can be reduced.
- Step 204 The MASTER sets the forwarding list of each SLAVE in the ADVERTISE message, sends the forwarding list to each SLAVE by broadcasting the ADVERTISE message, and saves all the forwarding lists in the MASTER. SLAVE returns the RESPONSE message after receiving the forwarding list .
- the gateway 105 Since only the gateway 105 is SLAVE in this embodiment, only the forwarding list allocated to the gateway 105 needs to be set in the ADVERTISE message, and the forwarding list can be sent to the gateway 105. After receiving the forwarding list, the gateway 105 sends the forwarding list to the MASTER. Send carrying this gateway weight RESPONSE message.
- the SLAVE corresponding to the forwarding list determines whether the forwarding list is sent to itself according to the SLAVE information in the forwarding list. If so, obtain the forwarding list from the message, and send it to The MASTER sends a RESPONSE message carrying the weight of the gateway. Otherwise, the forwarding list is discarded.
- Another type can set all SLAVE forwarding lists in an ADVERTISE message.
- Each SLAVE determines which forwarding is based on the SLAVE information in the forwarding list.
- the list is sent to itself, receives its own forwarding list, discards the remaining forwarding lists, and sends a RESPONSE message carrying the weight of the gateway to the MASTER.
- Steps 205 to 207 The MASTER judges whether all SLAVE RESPONSE messages are received within the timer setting time. If received, it further determines whether the weight of the SLAVE has changed. If it has not changed, it confirms that the SLAVE receives and forwards correctly List, each gateway determines and sends a message that needs to be sent by the gateway according to the message-related information in the forwarding list; if the weight is changed or a RESPONSE message is not received, it returns to step 203.
- the host If the host wants to communicate with the WAN, it first initiates an Address Resolution Protocol (ARP) request through the virtual IP address of the VR P backup group.
- ARP Address Resolution Protocol
- the MASTER in the VRRP backup group responds to this ARP request with a virtual MAC address.
- the host uses the virtual MAC address as The destination MAC address uses its own MAC address as the source MAC address to communicate with the gateway.
- all the gateways will receive the packet sent by the host to the VRRP backup group.
- the forwarding list of each gateway is different, only the forwarding list is stored.
- the host information gateway will send Send the 4G text, the remaining gateways will discard the 4G text.
- the present invention sets each gateway as follows: If the gateway exits load sharing, that is, the gateway cannot connect the host to the WAN, the gateway stops sending packets to other gateways. Under normal circumstances, after determining the MASTER and SLAVE, the MASTER will periodically send ADVERTISE messages to each SLAVE. SLAVE returns a RESPONSE message after receiving the ADVERTISE message. If the MASTER does not receive any If a SLAVE RESPONSE message is returned, it is considered that the SLAVE has exited load sharing, and the MASTER needs to re-establish the forwarding list of each gateway according to the existing SLAVE.
- the SLAVE does not receive the MASTER ’s ADVERTISE message after the timer expires, then It is considered that the MASTER has exited load sharing, and each SLAVE re-determines the MASTER in the VRRP backup group, and the new MASTER re-establishes and sends the forwarding list of all gateways, thereby realizing the switch between MASTER and SLAVE and achieving backup Functions. Among them, SLAVE believes that the MASTER has exited load sharing and reselects the MASTER.
- the SLAVE considers that the MASTER has been The load sharing is exited, so the SLAVE considers itself to be the master, and sends the ADVERTISE message carrying its own priority to other gateways in the VRRP backup group. After other gateways receive the ADVERTISE message, they compare the priority carried in the message. Whether it is higher than its own priority, if it is higher, then set itself to SLAVE; otherwise, set itself to MASTER. Of course, if multiple SLAVEs find that the current MASTER has exited load sharing, these SLAVEs are forwarded to Other gateways send ADVERTISE messages, and other gateways also make corresponding judgments based on the priorities carried in the messages.
- SLAVE When SLAVE re-selects MASTER because it thinks there is a problem with the current MASTER, since not all SLAVEs may find that the MASTER has a problem, that is, only One or more SLAVEs send ADVERTISE messages to other masters as the master. At this time, multiple masters may occur. For example, there are four gateways in the current VRRP backup group, and their priorities are 1, 2, 3, and 4, respectively. The gateway with priority 4 is the current master.
- the gateway with the priority of 1 finds that it cannot receive the 4 text sent by the MASTER, then the gateway thinks that there is a problem with the current MASTER, so it sends an ADVERTISE message to other gateways as the MASTER, and the priority is Both the gateways 2 and 3 determine that their own priority is greater than the priority carried in the received ADVERTISE message, so both gateways consider themselves to be the current master. Since the MASTER needs to periodically send ADVERTISE messages to other gateways, and the ADVERTISE message carries the priority of the MASTER, therefore, in order to solve the above problem, the MASTER can determine whether it has received ADVERTISE messages from other MASTERs.
- the waiting time of MASTER and SLAVE can be set as required.
- the gateway exits load sharing may be due to the failure or shutdown of the gateway; or the interface or routing status of the gateway to the WAN has changed, causing the gateway to fail to connect the host to the WAN; of course, there may be other reasons Causes the gateway to exit load sharing.
- a new gateway is added to the VRRP backup group, the new gateway considers itself a MASTER, and sends ADVERTISE packets to the remaining gateways.
- the new gateway also receives ADVERTISE packets from the existing MASTER. If it is an existing MASTER, If the priority of the new gateway is high, the new gateway sets itself as SLAVE and sends a RESPONSE packet to the existing master. If the priority of the new gateway is high, the new gateway considers itself to be the master.
- the VRRP backup group includes all the masters. All gateways set themselves as SLAVE, and The MASTER sends a RESPONSE message. This new MASTER then establishes a forwarding list according to the information of all gateways, and sends it to each SLAVE. Each SLAVE updates its own forwarding list after receiving the new forwarding list.
- the MASTER When the MASTER receives the RESPONSE message, it first determines which SLAVE the message came from. If it is a new SLAVE in the VR P backup group, the MASTER needs to re-establish each forwarding list according to the weights of all gateways in the VRRP backup group, and The forwarding list is sent to each SLAVE. After each SLAVE receives the new forwarding list, it updates the original forwarding list. In order to ensure that all the messages of the host can be sent normally, the forwarding list needs to be sent to the newly added SLAVE.
- the MASTER can determine that the SLAVE has correctly received the forwarding list, that is, the same as the SLAVE
- the host message corresponding to the forwarding list can be sent to the WAN through this SLAVE. If the RESPONSE message received by the MASTER is sent by the original SLAVE, it is judged whether the weight of the SLAVE carried in the RESPONSE message has changed, if there is no change, it is not processed; if the weight is changed , The MASTER needs to re-establish the forwarding list of each gateway in the VRRP backup group according to the weight.
- the method of the invention realizes multi-gateway dynamic load sharing and backup functions, while ensuring that the implementation of these functions is transparent to the hosts in the local area network.
- the hosts in the local area network can implement load sharing and multi-gateway without any special configuration.
- Backup which fully utilizes the bandwidth of the WAN link and the processing capacity of each gateway when implementing load sharing and backup.
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
- Small-Scale Networks (AREA)
Description
一种实现网关动态负载分担的方法
技术领域
本发明涉及数据通信领域, 更确切地说是涉及局域网的网关实现动 态负载分担的方法。 发明背景
局域网对广域网的访问通常通过网关实现。 具体来说, 局域网中的 主机通过自身所在的局域网与连接到广域网的网关连接, 通过该网关实 现与广域网的连接。其中,用于连接局域网与广域网的网关通常有多个。 图 1即为局域网中的主机通过网关与广域网连接的示意图, 图中, 所有 的主机 101、 102通过其所在的局域网 103分别与所有的网关 104、 105 连接, 所有的网关 104、 105与广域网 106、 107连接, 从而实现了主机 与广域网的连接。
对于与广域网连接的网关来说, 为保证数据访问的可靠性, 需要这 些网关具有相互备份的功能; 为充分利用网关处理性能和局域网出口带 宽资源, 又需要这些网关具有负载分担的功能。
针对上述需要, 虚拟路由器冗余协议 (VRRP , Virtual Router Redundancy Protocol )提出了备份方案, 该方案中, 主机通过主用网关 发送数据报文,如果主用网关失效,则备用网关接替主用网关发送数据。 具体来说,该备份方案首先要在局域网中为所有网关设置一个虚拟的 IP 地址和介质访问控制(MAC )地址, 局域网中所有主机的网关地址都指 向该虚拟 IP地址, 主机向该虚拟 IP 地址发送地址解析协议 ( ARP, Address Resolution Protocol )请求时, 主用网关以虚拟 MAC地址作为自 身的 MAC地址来应答主机的 ARP请求,主机收到主用网关的应答信息
后, 以该虚拟 MAC地址作为目的地址向网关发送数据, 主用网关接收 并转发该数据。 主用网关还需要向主机发送数据, 这种情况下, 如果主 用网关中没有该主机的 MAC地址, 则主用网关通过自身的 IP和 MAC 地址向该主机发送 ARP请求, 以获得该主机的 MAC地址。 另外, 主用 网关还需要定时向备用网关发送 VRRP协议报文,备用网关通过该报文 监控主用网关的状态, 如果备用网关连续没有收到设定个数的 VRRP协 议报文, 则备用网关代替主用网关进行服务, 实现路由器的备份功能。
在上述备份方案的基础上, 还可以进一步实现负载分担, 使备用网 关在主用网关正常工作时也承担一部分流量, 以充分利用资源。 VRRP 协议具体是通过建立两个 VRRP备份组来实现负载分担的,该负载分担 方案将所有网关设置为两个 VRRP备份组。 在图 1所示的连接中, 可以 将网关 104作为 VRRP备份组 1的主用网关,将网关 105作为 VRRP备 份组 1的备用网关; 将网关 105作为 VRRP备份组 2的主用网关, 将网 关 104作为 VRRP备份组 2的备用网关。每个 VRRP备份组对应设置一 个虚拟 IP地址和虚拟 MAC地址, 因此,每个 VRRP备份組中的所有网 关对于主机而言, 相当于一个 IP地址和 MAC地址为该虚拟 IP地址和 虚拟 MAC地址的网关。 基于上述设置, 如果将局域网 102中一部分主 机 101的网关地址设定为指向 VRRP备份组 1的虚拟 IP地址, 则该部 分主机 101 通过该组中的主用网关,即网关 104与广域网 106或 107连 接; 将另一部分主机 102的网关地址设定为 VRRP备份组 2的虚拟 IP 地址,则该部分主机 102通过该组的主用网关,即网关 105与广域网 106 或 107连接, 从而实现了网关 104与网关 105的负载分担。
在这个负载分担方案中, 实现网关备份与上述备份的方法相同。 每 个 VRRP备份组中的主用网关需要定时向备用网关发送 VRJ P协议报 文, 备用网关通过该报文监控主用网关的状态, 如果备用网关连续没有
收到设定个数的 VRRP协议报文, 则备用网关代替主用网关进行服务。 因此, 如果一个网关出现故障, 另一个网关则成为两个 VRRP备份组的 主用网关, 所有主机都通过该网关与广域网连接, 从而实现网关的备份 功能。
上述负载分担方案虽然能够同时实现网关的负载分担和备份, 但是 这种方案要求同一局域网中主机的网关地址指向不同 VRRP备份组对应 的虚拟 IP地址, 即主机需要通过不同的网关与广域网连接,这要求用户 对局域网中的主机作不同的设置, 必然会增加用户的工作量。 并且, 在 所有的主机指定网关后, 就把流量分担的模型固定了, 也就是说, 该方 案不能实现动态的负载分担。 如果需要调整各个网关分担流量的比例关 系,则需要更改主机的网关地址,而更改主机网关地址的工作十分繁瑣, 会给用户带来很大的麻烦。 发明内容
有鉴于此, 本发明的主要目的在于提供一种实现网关动态负载分担 的方法, 使局域网中的所有主机不需要设定不同的网关地址, 即可通过 多个网关动态负载分担来访问广域网。
本发明的进一步目的是保证网关的备份功能。
为达到以上目的, 本发明的技术方案是这样实现的: 一种实现网关 动态负载分担的方法, 局域网通过一个以上网关访问广 i或网, 该方法至 少包括以下步骤:
a. 将所有负载分担的网关设置为一个 VRRP备份组, 并设置该备份 组的虚拟 IP地址和虚拟 MAC地址,将局域网中所有主机的网关地址设 置为该虚拟 IP地址,设置每个参与负载分担网关的优先级和负载分担的 权值, 并在每个负载分担网关中设置定时器;
b.每个负载分担网关以主网关(MASTER )的身份向其他网关发送 携带本网关优先级的广播(ADVERTISE )报文;
c 所有收到 ADVERTISE报文的网关判断自身的优先级是否大于收 到的所有 ADVERTISE报文携带的优先级, 如果大于, 则确定本网关为 MASTER, 否则, 确定本网关为从网关 ( SLAVE );
d. MASTER获取所有网关的权值,并根据所有网关的权值分配由每 个网关转发的报文, 建立包含网关标识及该网关所需处理报文的相关信 息的转发列表, 在 MASTER 中保存转发列表, 并将转发列表设置在发 送给 SLAVE 的 ADVERTISE报文中;
e.每个 SLAVE通过 ADVERTISE报文获取本网关的转发列表, 向 MASTER返回携带权值的应答(RESPONSE )报文, 并将该转发列表所 对应的主机连接到广域网;
f. MASTER判断在预先设置的定时器时间内是否收到所有 SLAVE 的 RESPONSE报文, 如果是, 则进一步判断 SLAVE的权值是否改变, 如果没有改变, 则确认该 SLAVE正确接收了转发列表, 如果权值改变, 或没有收到 RESPONSE报文, 则重新执行步驟 d。
该方法可以进一步包括: 所述负载分担网关判断自身是否能够将主 机连接到广域网, 如果是, 则继续向其他网关发送报文; 否则, 该网关 停止向其他网关发送报文。
步骤 a中, 所述设置网关的权值为: 根据网关到广域网出接口的链 路带宽设置。
步驟 d 中, 所述 MASTER获取所有网关的权值为: MASTER向 SLAVE发送用于获取网关负载分担权值的 ADVERTISE报文, 所有的 SLAVE收到 MASTER的 ADVERTISE报文后, 反馈携带本网关负载分 担权值的 RESPONSE报文, MASTER从收到的 RESPONSE报文中获取
网关的权值。
步驟 d中, 所述 MASTER分配由每个网关转发的报文进一步包括:. 根据局域网中主机的数据及主机报文信息分配每个网关转发的报文。
步驟 d中, 所述主机报文信息是报文所属主机的地址信息, 所述转 发列表中的该网关所需处理^!文的相关信息为主机的地址信息。
所述主机的地址信息是主机的 IP地址或 MAC地址信息。
步骤 d中, 所述主机报文信息是报文的长度信息、 服务类型(TOS ) 域、 源端口域、 目的端口域、 源 IP地址、 目的 IP地址和访问控制列表 ( ACL )规则中的任意一种。
步驟 d中,所述 MASTER将转发列表设置在 ADVERTISE报文中为: 将所有 SLAVE的转发列表设置在一个 ADVERTISE报文中;
步骤 e中,所述每个 SLAVE通过 ADVERTISE报文获取本网关的转 发列表为: 每个 SLAVE根据转发列表中的网关标识从该 ADVERTISE 报文中获取本网关的转发列表。
步骤 d中,所述 MASTER将转发列表设置在 ADVERTISE报文中为: 将所有 SLAVE的转发列表依次设置在 MASTEP的每个 ADVERTISE报 文中;
步驟 e中 ,所述每个 SLAVE通过 ADVERTISE报文获取本网关的转 发列表为: 每个 SLAVE 根据转发列表中的网关标识确定是否从该 ADVERTISE报文中获取转发列表 , 如果是, 则获取转发列表; 否则, 不作处理。
所述 MASTER 定时向其他网关发送包含本网关优先级的 ADVERTISE报文; 所述步骤 d之后进一步包括: SLAVE判断在预先设 置的定时器时间内是否收到 MASTER的 ADVERTISE报文, 如果收到, 则确定当前的 MASTER在正常工作; 如果定时器超时后也没有收到,
则确定当前的 MASTER出现异常, 且该 SLAVE以 MASTER的身份向 其他网关发送携带本网关优先级的 ADVERTISE报文, 之后重新执行步 骤 c;
该方法在重新执行步驟 c之后, 进一步包括: MASTER判断自身是 否收到其他网关发送来的 ADVERTISE报文, 如果收到, 则进一步判断 该 ADVERTISE报文中携带的优先级是否高于自身的优先级,如果高于, 则确定本网关为 SLAVE,如果不高于,或者没有收到其他网关发送来的 ADVERTISE报文, 则确定本网关为 MASTER。
该方法可以进一步包括: MASTER在所述转发列表中针对每个报文 信息设置一个定时器, 如果在定时器设定时间内有报文需要转发, 则定 时器清零; 否则, 删除该艮文信息, 并重新执行步骤 d。
该方法可以进一步包括: 启动 MASTER中的定时器,如果定时器超 时, 则 MASTER删除所有的主机报文信息, 并重新建立转发列表; 否 则, 定时器清零。
该方法可以进一步包括: MASTER获取到新加入局域网的主机报 文信息后, 重新执行步驟 d。
该方法还可以进一步包括: MASTER获取到新加入局域网的主机报 文信息后, 将新加入的主机报文信息根据每个网关的权值进行划分, 并 通过 ADVERTISE报文将该主机报文信息发送到对应 SLAVE原有的转 发列表中。
步骤 f中, 所述 MASTER在判断 SLAVE的权值是否改变之前进一 步包括: 判断该 SLAVE是否为转发列表对应的网关, 如果不是, 则重 新执行步骤 d; 否则 , 执行判断该 SLAVE的权值是否改变的步骤。
本发明具有以下效果:
1、 通过将所有负载分担的网关设置为一个 VRRP备份组, 针对该
备份组设置虛拟 IP地址和虚拟 MAC地址,使所有主机的网关地址都只 指向该虚拟 IP地址, 解决了现有技术中需要设置不同的虚拟 IP地址的 问题;
2、 通过确定 VRRP备份组中的 MASTER和 SLAVE, MASTER根 据局域网中的 SLAVE和主机报文信息建立各个网关的转发列表, 使各 个网关通过该转发列表转发主机报文, 如果 SLAVE和主机报文信息有 变化, 则由 MASTER重新建立转发列表, 实现了各个网关之间的动态 负载分担;
3、 通过 SLAVE对 MASTER的监控, 如果当前 MASTER退出负载 分担, 能够重新确定 MASTER, 保证了网关之间的备份;
4、通过设置各个网关为退出负载分担时停止向其他网关发送报文的 模式, 扩大了各个网关实现备份切换的功能; '
5、 还可以根据各个网关到广域网的出接口带宽确定各个网关的权 值, 使各网关在负载分担时能够更合理地利用局域网的出口带宽。 附图简要说明
图 1为局域网中的主机通过网关与广域网连接的示意图;
图 2为本发明实施例中各网关实现动态负载分担的流程图。 实施本发明的方式
下面结合附图及具体实施例对本发明方案作进一步详细的说明。 本发明方案主要是将所有参与负载分担的网关组成一个 VRRP备份 组, 设置针对该备份组的虚拟 IP地址和虚拟 MAC地址, 所有主机的网 关地址对应该虚拟 IP 地址, 并从该组的网关中确定作为主网关的 MASTER和作为从网关的 SLAVE , MASTER根据各个网关的权值和局
域网中的主机报文信息建立并维护各个网关处理主机报文的转发列表, 各个网关根据转发列表发送主机报文, 实现负载分担, SLAVE监控 MASTER的情况,一旦 MASTER退出负载分担,则所有的 SLAVE重新 确定 MASTER, 从而实现备份的功能。
以图 1所示的连接为例, 本实施例局域网中的主机通过网关 104和 105与广域网连接, 实现网关 104和网关 105动态负载分担的流程参见 图 2, 对应以下步骤:
步骤 201、 根据需要设置网关 104和网关 105的优先级, 以及各个 网关进行负载分担的权值, 在每个网关中设置定时器, 将这两个网关设 置为一个 VRRP备份组, 为该备份组设置一个虚拟 IP地址和虚拟 MAC 地址, 并将局域网中所有主机的网关地址设置为虚拟 IP地址。
各个网关的权值根据需要确定, 比如, 可以根据网关到广域网出接 口的带宽确定网关的权值, 则各个网关的权值可以反映当前广域网出接 口的链路带宽, 因此根据各个网关权值的大小进行负载分担可以更合理 地利用局域网的出口带宽 5 并且在改变出口带宽时可以不考虑负载分担 是如何配置的。
本实施例设置网关 104的优先级高于网关 105的优先级, 设置网关 104的权值为 3 , 网关 105的权值为 2,所设置的 VRRP备份组的虚拟 IP 地址即为本局域网网段内一个普通的 IP地址,虛拟 MAC地址是特殊的 MAC地址, 由电气和电子工程师协会 ( IEEE )统一划分。
步骤 202、 各个网关之间通过发送广播(ADVERTISE )报文来确定 网关中的 MASTER和 SLAVE。
每个网关最初都认为自己是 MASTER,在接入局域网时都向其余网 关广播 ADVERTISE报文, 该报文中携带本网关的优先级, 每个网关收 到该 ADVERTISE报文时都将报文中携带的优先级与本网关的优先級比
较, 如果前者的优先级高, 则该网关将自己设置为 SLAVE, 并返回携带 本网关权值的应答(RESPONSE )报文,否则,认为自己就是 MASTER, 定期向各个 SLAVE发送 ADVERTISE报文。
步骤 203、 MASTER根据局域网中的主机报文信息和所有网关的权 值, 建立自身分配给各个网关的转发列表。
MASTER需要设置分配给各个网关的转发列表,转发列表中需要设 置对应网关的标识和该网关所需负责处理的报文信息, MASTER在将该 转发列表发送给各个 SLAVE时, 也在自身保存该转发列表。
为防止因某些报文对应的主机较长时间不发送报文而导致各个网关 负载分担不均衡, 可以为转发列表中的每个报文信息对应设置一个定时 器, 并设定一个时间范围, 如果在设定的时间范围内有匹配的报文需要 发送, 则重置定时器, 如果定时器超时且没有匹配的报文需要转发, 则 删除该主机报文信息, 并由 MASTER重新设置转发列表。 也可以在 MASTER上设置一个定时器, 并设定一个时间范围, 定时器超时后则 MASTER删除所有的主机报文信息, 并重新设置转发列表。
MASTER向各网关分配报文的方法有多种,可以是以主机地址作为 转发列表中各个报文的索引, 将同一主机中的所有报文通过某一个网关 与广域网连接。 由于不同网关的广域网类型和带宽可能不同, 为充分利 用网关, 也可以根据报文的长度建立转发列表, 设置报文长度为转发列 表中报文的索引, 使长度相近的报文通过同一网关与局域网连接。 为更 精确地分配各个网关所处理的业务流, 还可以根据报文的服务类型 ( TOS )域、源或目的端口域、源或目的 IP地址,或访问控制列表( ACL ) 规则来建立转发列表, 并将此报文信息作为转发列表中各个报文的索 I 信息。
本实施例采用的是第一种方法, 具体来说, 是根据网关的权值分配
局域网中的主机, 以主机为单位向各个网关分配报文。 由于局域网中所 有主机发送的 ARP请求都由 MASTER应答, 因此作为 MASTER的网 关 104知道所有主机的 MAC地址和 IP地址,如果网关 104得知局域网 中有 100台主机,并从网关 105返回的 RESPONSE报文中得知网关 105 的权值是 2, 而网关 104自身的权值是 3, 则可以随机分配 60台主机给 网关 104, 并将这些主机的 MAC地址或 IP地址信息设置在分配给自身 的转发列表中, 其余的 40台分配给网关 105, 将其余主机的 MAC地址 或 IP地址信息设置在分配给网关 105的转发列表中。这里,在转发列表 中设置主机的 MAC地址或 IP地址信息的目的是为了能够以该信息为索 引, 使各个网关能够根据该信息得知哪些主机需要通过本网关连接局域 网。
在本实施例的这种方法中, 如果局域网中有新的主机需要通过网关 与广域网连接, 则需要 MASTER重新建立转发列表, 但是由于一般来 说增加主机不会引起所有 SLAVE 的转发列表的改变, 因此可以设置 MASTER每次通过 ADVERTISE报文只携带所增加的主机的信息以及所 要负责发送该主机报文的网关的信息, 而不是针对该网关的整个转发列 表, 这样不仅能够减少 ADVERTISE报文对网络带宽的占用, 而且能够 减少该网关处理 ADVERTISE 4艮文的开销。
步骤 204、 MASTER将各个 SLAVE的转发列表设置在 ADVERTISE 报文中,通过广播 ADVERTISE报文将转发列表发送给各个 SLAVE, 并 在 MASTER 中保存所有的转发列表, SLAVE 收到转发列表后返回 RESPONSE报文。
由于本实施例只有网关 105是 SLAVE, 因此只需将分配给网关 105 的转发列表设置在 ADVERTISE报文中, 即可实现将该转发列表发送给 网关 105, 网关 105收到转发列表后, 向 MASTER发送携带本网关权值
的 RESPONSE报文。
如果局域网中有多个 SLAVE,在 ADVERTISE报文中设置转发列表 的方法有两种: 一种可以将针对每个 SLAVE 的转发列表依次设置在 MASTER发送的多个 ADVERTISE报文中, 通过 MASTER多次发送 ADVERTISE报文将转发列表发送出去,与该转发列表对应的 SLAVE根 据转发列表中的 SLAVE信息判断该转发列表是否是发送给自己的, 如 果是, 则从该报文中获取转发列表, 并向 MASTER发送携带本网关权 值的 RESPONSE报文, 否则, 抛弃该转发列表; 另一种可以将所有 SLAVE的转发列表都设置在一个 ADVERTISE报文中, 各个 SLAVE根 据转发列表中的 SLAVE信息判断哪个转发列表是发送给自己的, 接收 自己的转发列表, 抛弃其余的转发列表, 并向 MASTER发送携带本网 关权值的 RESPONSE报文。
步骤 205~207、 MASTER判断在定时器设定时间内是否收到所有 SLAVE的 RESPONSE报文,如果收到了,则进一步判断该 SLAVE的权 值是否改变, 如果没有改变, 则确认该 SLAVE正确接收转发列表, 各 个网关根据转发列表中的报文相关信息确定并发送需要本网关发送的 报文; 如果权值改变, 或没有收到 RESPONSE报文, 则返回步骤 203。
至此, MASTER分配转发列表的工作完成, 各个网关将负载分担所 有的报文。
主机如果要和广域网通信,则首先通过 VR P备份组的虚拟 IP地址 发起地址解析协议 ( ARP )请求, VRRP备份组中的 MASTER用虚拟 MAC地址应答此 ARP请求, 此后主机将该虚拟 MAC地址作为目的 MAC地址, 以自己的 MAC地址作为源 MAC地址与网关通信, 这样所 有的网关都会收到主机向 VRRP备份組发送的报文, 但是由于各个网关 的转发列表不同, 因此只有转发列表中存储了该主机信息的网关才会发
送该 4艮文, 其余网关将抛弃该 4艮文。
另外, 本发明将各个网关设置为: 如果网关退出负载分担, 即网关 无法将主机与广域网连接, 则该网关停止向其他网关发送报文。 正常情 况下,在确定了 MASTER和 SLAVE后, MASTER会定期向各个 SLAVE 发送 ADVERTISE 报文, SLAVE 在收到 ADVERTISE 报文后返回 RESPONSE报文, 如果 MASTER在自身的定时器超时后也没有收到某 个 SLAVE返回的 RESPONSE报文, 则认为该 SLAVE已经退出负载分 担, MASTER需要根据现有的 SLAVE重新建立各个网关的转发列表; 如果 SLAVE在定时器超时后也没有收到 MASTER的 ADVERTISE报文, 则认为该 MASTER已经退出负载分担, 各个 SLAVE重新确定本 VRRP 备份组中的 MASTER, 由该新的 MASTER重新建立并发送所有网关的 转发列表, 由此实现了 MASTER和 SLAVE之间的切换, 达到了备份的 功能。 其中, 对于 SLAVE认为 MASTER已经退出负载分担, 并重新选 择 MASTER来说, 只要任意一个参与负载分担的 SLAVE在预先设置的 时间内没有收到 MASTER发送来的 ADVERTISE报文, 该 SLAVE则认 为该 MASTER 已经退出了负载分担, 因此该 SLAVE 认为自身为 MASTER, 并向 VRRP备份组中的其他网关发送携带自身优先级的 ADVERTISE报文, 其他网关收到 ADVERTISE报文后, 即比较该报文 携带的优先级是否高于自身的优先级, 如果高于, 则将自身设置为 SLAVE; 否则, 将自身设置为 MASTER, 当然, 如果有多个 SLAVE都 发现当前的 MASTER已经退出了负载分担, 则这些 SLAVE都向其他网 关发送 ADVERTISE报文, 其他网关也根据报文中携带的优先级作相应 的判断。
在因 SLAVE认为当前的 MASTER出现问题而重新选择 MASTER 时, 由于可能不是所有的 SLAVE都发现 MASTER出现问题, 也即, 只
有某一个或几个 SLAVE 以 MASTER 的身份向其他 MASTER发送 ADVERTISE报文, 这时, 可能会出现多个 MASTER的情况。 比如, 当 前的 VRRP备份组中有四个网关, 其优先级分别为 1、 2、 3、 和 4, 则 优先级为 4的网关为当前的 MASTER。在某一时刻,优先级为 1的网关 发现自身无法收到 MASTER发送来的 4艮文, 则该网关认为当前的 MASTER 出现问题, 因此以 MASTER 的身份向其他网关发送 ADVERTISE报文, 结果优先级为 2和 3的网关都确定自身的优先级大 于收到的 ADVERTISE报文所携带的优先级, 因此这两个网关都会认为 自身即为当前的 MASTER。 由于 MASTER需要向其他网关定时发送 ADVERTISE报文,且该 ADVERTISE报文中会携带该 MASTER的优先 级, 因此, 为解决上述问题, 可以由 MASTER判断自身是否收到其他 MASTER 发送来的 ADVERTISE 报文, 如果收到了, 则再判断该 ADVERTISE报文所携带的优先级是否高于自身的优先级, 如果高于, 则确定自身为 SLAVE; 如果不高于, 或者没有收到 ADVERTISE报文, 则确定自身为 MASTER。
还有, 这里 MASTER和 SLAVE所等待时间的长短可以根据需要设 定。 且网关退出负载分担可能是由于该网关出现故障或关机; 也可能是 由于该网关与广域网的接口或路由的状态出现变化 , 导致该网关无法将 主机与广域网连接; 当然,也可能是其他的原因导致网关退出负载分担。
如果该 VRRP备份组中有新的网关加入 , 则该新网关认为自己是 MASTER, 向其余各个网关发送 ADVERTISE报文, 该新网关也会收到 现有 MASTER的 ADVERTISE报文,如果是现有 MASTER的优先级高 , 则该新网关将自己设置为 SLAVE, 并向现有 MASTER发送 RESPONSE 报文;如果新网关的优先级高,则新网关认为自己是 MASTER,该 VRRP 备份組中包括 MASTER的所有的网关都将自己设置为 SLAVE, 并向新
的 MASTER发送 RESPONSE报文, 这个新的 MASTER再根据所有网 关的信息建立转发列表, 并向各个 SLAVE发送, 各个 SLAVE收到新的 转发列表后更新自己的转发列表。
MASTER在收到 RESPONSE报文时, 首先判断该报文来自哪个 SLAVE, 如果是 VR P备份组中新的 SLAVE, 则 MASTER需要根据 VRRP备份组中所有网关的权值重新建立各个转发列表, 并将转发列表 发送给各个 SLAVE, 各个 SLAVE收到新的转发列表后, 更新原有的转 发列表。 为保证主机的所有报文能够正常发送, 需要先向新加入的 SLAVE发送转发列表, 该 SLAVE返回 RESPONSE报文后, MASTER 就可以确定该 SLAVE正确接收了转发列表, 也就是说, 与该 SLAVE中 的转发列表对应的主机报文可以通过该 SLAVE发送到广域网。 如果 MASTER收到的 RESPONSE报文是原有的 SLAVE发送来的, 则判断 RESPONSE报文中携带的该 SLAVE的权值是否发生了变化, 如果没有 变化, 则不作处理; 如果该权值发生了变化, 则 MASTER需要根据该 权值重新建立 VRRP备份組中各个网关的转发列表。
本发明方法在实现多网关动态负载分担和备份功能的同时, 保证这 些功能的实现对局域网内的主机是透明的, 局域网中的主机不需要做任 何特殊配置即可以通过多个网关实现负载分担和备份 , 在实现负载分担 和备份时充分利用了广域网链路的带宽和各个网关的处理能力。
以上所述仅为本发明方案的较佳实施例, 并不用以限定本发明的保 护范围。
Claims
1、一种实现网关动态负载分担的方法,局域网通过一个以上网关访 问广域网, 其特征在于, 该方法至少包括以下步骤:
a. 将所有负载分担的网关设置为一个虚拟路由器冗余协议 VRRP 备份组,并设置该备份组的虚拟 IP地址和虚拟介质访问控制 MAC地址, 将局域网中所有主机的网关地址设置为该虚拟 IP地址,设置每个负载分 担网关的优先级和负载分担的权值, 并在每个负载分担网关中设置定时 器;
b.每个负载分担网关以主网关 MASTER的身份向其他网关发送携 带本网关优先级的广播 ADVERTISE报文;
c 所有收到 ADVERTISE报文的网关判断自身的优先级是否大于收 到的所有 ADVERTISE报文携带的优先级, 如果大于, 则确定本网关为 MASTER, 否则, 确定本网关为从网关 SLAVE;
d. MASTER获取所有网关的权值,并根据所有网关的权值分配由每 个网关转发的报文, 建立包含网关标识及该网关所需处理报文的相关信 息的转发列表, 在 MASTER中保存转发列表, 并将转发列表设置在发 送给 SLAVE 的 ADVERTISE报文中;
e. 每个 SLAVE通过 ADVERTISE报文获取本网关的转发列表, 向 MASTER返回携带权值的应答 RESPONSE报文, 并将该转发列表所对 应的主机连接到广域网;
f. MASTER判断在预先设置的定时器时间内是否收到所有 SLAVE 的 RESPONSE报文, 如果是, 则进一步判断 SLAVE的权值是否改变, 如果权值没有改变, 则确认该 SLAVE正确接收了转发列表, 如果权值 改变, 或没有收到 RESPONSE报文, 则重新执行步骤 d。
2、根据权利要求 1所述的方法, 其特征在于该方法进一步包括: 所
述负载分担网关判断自身是否能够将主机连接到广域网, 如果是, 则继 续向其他网关发送报文; 否则, 该网关停止向其他网关发送报文。
3、根据权利要求 1所述的方法, 其特征在于所述步骤 a中, 所述设 置网关的权值为: 根据网关到广域网出接口的链路带宽设置。
4、 根据权利要求 1所述的方法, 其特征在于所述步骤 d中, 所述 MASTER获取所有网关的权值为: MASTER向 SLAVE发送用于获取网 关负载分担权值的 ADVERTISE报文, 所有的 SLAVE收到 MASTER的 ADVERTISE报文后 ,反馈携带本网关负载分担权值的 RESPONSE报文, MASTER从收到的 RESPONSE报文中获取网关的权值。
5、 根据权利要求 1所述的方法, 其特征在于所述步骤 d中, 所述 MASTER分配由每个网关转发的报文进一步包括:根据局域网中主机的 数据及主机报文信息分配每个网关转发的报文。
6、根据权利要求 5所述的方法, 其特征在于所述步骤 d中 , 所述主 机报文信息是报文所属主机的地址信息, 所述转发列表中的该网关所需 处理^ 1艮文的相关信息为主机的地址信息。
7、根据权利要求 6所述的方法, 其特征在于 3 所述主机的地址信息 是主机的 IP地址或 MAC地址信息。 '
8、根据权利要求 5所述的方法, 其特征在于所述步驟 d中, 所述主 机报文信息是报文的长度信息、服务类型 TOS域、 源端口域、 目的端口 域、 源 IP地址、 目的 IP地址和访问控制列表 ACL规则中的任意一种。 ·
9、 根据权利要求 1所述的方法, 其特征在于所述步骤 d中, 所述 MASTER将转发列表设置在 ADVERTISE报文中为: 将所有 SLAVE的 转发列表设置在一个 ADVERTISE报文中;
步驟 e中,所述每个 SLAVE通过 ADVERTISE报文获取本网关的转 发列表为: 每个 SLAVE根据转发列表中的网关标识从该 ADVERTISE
报文中获取本网关的转发列表。
10、 根据权利要求 1所述的方法, 其特征在于所述步骤 d中, 所述 MASTER将转发列表设置在 ADVERTISE报文中为: 将所有 SLAVE的 转发列表依次设置在 MASTER的每个 ADVERTISE报文中;
步骤 e中,所述每个 SLAVE通过 ADVERTISE报文获取本网关的转 发列表为: 每个 SLAVE 根据转发列表中的网关标识确定是否从该 ADVERTISE报文中获取转发列表, 如果是, 则获取转发列表, 否则, 不作处理。
11、根据权利要求 1所述的方法, 其特征在于, 所述 MASTER定时 向其他网关发送包含本网关优先级的 ADVERTISE报文;
所述步骤 d之后进一步包括: SLAVE判断在预先设置的定时器时间 内是否收到 MASTER的 ADVERTISE报文, 如果收到, 则确定当前的 MASTER在正常工作; 如果定时器超时后也没有收到 , 则确定当前的 MASTER出现异常,且该 SLAVE以 MASTER的身份向其他网关发送携 带本网关优先级的 ADVERTISE报文, 之后重新执行步骤 c;
所述重新执行步骤 c之后, 进一步包括: MASTER判断自身是否收 到其他网关发送来的 ADVERTISE报文, 如果收到, 则进一步判断该 ADVERTISE报文中携带的优先级是否高于自身的优先级, 如果高于, 则确定本网关为 SLAVE, 如果不高于,或者没有收到其他网关发送来的 ADVERTISE报文, 则确定本网关为 MASTER。
12、 根据权利要求 1所述的方法, 其特征在于该方法进一步包括: MASTER在所述转发列表中针对每个报文信息设置一个定时器,如果在 定时器设定时间内有报文需要转发, 则定时器清零; 否则, 删除该报文 信息, 并重新执行步骤 d。
13、 根据权利要求 1所述的方法, 其特征在于该方法进一步包括:
启动 MASTER中的定时器, 如果定时器超时, 则 MASTER删除所有的 主机报文信息, 并重新建立转发列表; 否则, 定时器清零。
14、 根据权利要求 1所述的方法, 其特征在于该方法进一步包括: MASTER获取到新加入局域网的主机报文信息后 , 重新执行步骤 d。
15、 根据权利要求 Γ所述的方法, 其特征在于该方法进一步包括:
MASTER获取到新加入局域网的主机报文信息后,将新加入的主机报文 信息根据每个网关的权值进行划分, 并通过 ADVERTISE报文将该主机 报文信息发送到对应 SLAVE原有的转发列表中。
16、 根据权利要求 1所述的方法, 其特征在于所述步驟 f中, 所述 MASTER在判断 SLAVE 的权值是否改变之前进一步包括: 判断该 SLAVE是否为转发列表对应的网关, 如果不是, 则重新执行步骤 d; 否 则 , 执行判断该 SLAVE的权值是否改变的步骤。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN03121053.8 | 2003-03-21 | ||
CNB031210538A CN100334866C (zh) | 2003-03-21 | 2003-03-21 | 一种实现网关动态负载分担和备份的方法 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2004084496A1 true WO2004084496A1 (fr) | 2004-09-30 |
Family
ID=32997031
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2004/000147 WO2004084496A1 (fr) | 2003-03-21 | 2004-02-26 | Procede de mise en oeuvre de la distribution de la charge dynamique par les passerelles |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN100334866C (zh) |
WO (1) | WO2004084496A1 (zh) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102223365A (zh) * | 2011-06-03 | 2011-10-19 | 杭州华三通信技术有限公司 | 基于ssl vpn网关集群的用户接入方法及其装置 |
US8630183B2 (en) | 2007-10-03 | 2014-01-14 | Hitachi, Ltd. | Packet transfer system |
CN110769078A (zh) * | 2019-10-17 | 2020-02-07 | 广东美的制冷设备有限公司 | 地址分配方法和系统 |
CN111600812A (zh) * | 2020-05-13 | 2020-08-28 | 优刻得科技股份有限公司 | 一种报文的处理方法、处理装置、可读介质和系统 |
CN111835608A (zh) * | 2020-05-21 | 2020-10-27 | 中国第一汽车股份有限公司 | 车辆控制系统及车辆 |
Families Citing this family (34)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1780295B (zh) * | 2004-11-24 | 2010-06-30 | 杭州华三通信技术有限公司 | 一种在弹性分组环上实现冗余路由器协议的方法 |
CN100401689C (zh) * | 2005-10-24 | 2008-07-09 | 华为技术有限公司 | 一种网络资源配置方法 |
CN1968260B (zh) * | 2005-11-17 | 2010-12-01 | 华为技术有限公司 | 在主备用设备之间实现虚拟路由器冗余协议切换的方法 |
CN100417141C (zh) * | 2005-11-29 | 2008-09-03 | 华为技术有限公司 | 一种组播业务实现方法 |
CN1980230B (zh) * | 2005-11-30 | 2011-06-01 | 华为技术有限公司 | 对vrrp组进行管理的方法 |
CN1980224A (zh) * | 2005-12-01 | 2007-06-13 | 华为技术有限公司 | 基于主备网关设备状态切换后业务恢复的方法及系统 |
JP4652285B2 (ja) * | 2006-06-12 | 2011-03-16 | 株式会社日立製作所 | ゲートウェイ選択機能を備えたパケット転送装置 |
EP2068498B1 (en) | 2006-09-25 | 2017-12-13 | Hewlett-Packard Enterprise Development LP | Method and network device for communicating between different components |
CN101022328B (zh) * | 2007-03-26 | 2011-07-20 | 杭州华三通信技术有限公司 | 一种实现冗余网关路径开销动态调整的方法及网关设备 |
CN101052047B (zh) * | 2007-05-22 | 2010-06-09 | 网御神州科技(北京)有限公司 | 一种多防火墙的负载均衡方法及装置 |
CN101102321B (zh) * | 2007-08-10 | 2010-06-02 | 中兴通讯股份有限公司 | 基于三层虚拟专网技术的虚拟路由冗余协议的实现方法 |
CN101141494B (zh) * | 2007-10-12 | 2011-02-02 | 杭州华三通信技术有限公司 | 一种解决负载分担情况下资源分配冲突的方法 |
CN101136926B (zh) * | 2007-10-12 | 2011-08-31 | 杭州华三通信技术有限公司 | 非对称路由情况下的报文转发方法及网络地址转换网关 |
CN101217477B (zh) * | 2008-01-10 | 2010-12-22 | 杭州华三通信技术有限公司 | 实现vrrp备份组中dhcp租约平滑切换的方法、装置和路由器 |
CN101217448B (zh) * | 2008-01-18 | 2013-01-30 | 福建星网锐捷网络有限公司 | 实现网关动态负载分担的方法及系统 |
CN101252427B (zh) * | 2008-02-29 | 2011-08-24 | 中兴通讯股份有限公司 | 与媒体网关的主、备用媒体接口相连的主备路由器的切换方法 |
JP5074290B2 (ja) * | 2008-05-13 | 2012-11-14 | 株式会社日立国際電気 | 冗長切替システム、冗長管理装置およびアプリケーション処理装置 |
CN101316236B (zh) * | 2008-07-23 | 2010-09-22 | 杭州华三通信技术有限公司 | Vrrp备份组负载分担方法及路由器 |
CN101383772B (zh) * | 2008-09-26 | 2011-08-10 | 中兴通讯股份有限公司 | 一种自动发现并建立mac路由信息表的方法及装置 |
CN101621409B (zh) * | 2009-07-22 | 2012-07-18 | 中兴通讯股份有限公司 | 业务控制方法、装置及宽带接入服务器 |
CN101635648B (zh) * | 2009-08-05 | 2011-09-21 | 中兴通讯股份有限公司 | 一种对虚拟冗余路由协议组进行管理及快速切换的方法 |
CN101729427B (zh) * | 2010-01-20 | 2012-03-14 | 杭州华三通信技术有限公司 | 一种多链路负载分担和选路的方法和路由器 |
CN102209064B (zh) * | 2010-03-29 | 2014-10-22 | 杭州华三通信技术有限公司 | 使用vrrp为接入设备提供备份的方法和vrrp网关设备 |
CN102724142B (zh) * | 2011-06-03 | 2015-07-15 | 北京天地互连信息技术有限公司 | 支持IPv6的网关等级判断方法及具有鲁棒性的网关 |
CN102223303A (zh) * | 2011-06-14 | 2011-10-19 | 杭州华三通信技术有限公司 | 一种基于多链接透明互联的负载均衡方法和路由桥 |
CN102404152B (zh) * | 2011-11-29 | 2014-06-04 | 华为技术有限公司 | 识别应答报文的方法及设备 |
CN102882719B (zh) * | 2012-09-26 | 2015-06-17 | 盛科网络(苏州)有限公司 | 实现Openflow交换机系统中控制器冗余备份的方法及系统 |
CN103124240B (zh) * | 2013-02-07 | 2016-03-30 | 北京华为数字技术有限公司 | 网关配置方法、网关设备及网络系统 |
CN103259740B (zh) * | 2013-04-27 | 2017-03-15 | 杭州华三通信技术有限公司 | 一种负载均衡处理方法及装置 |
CN103312605B (zh) * | 2013-05-29 | 2017-06-20 | 华为技术有限公司 | 一种网关设备身份设置的方法及管理网关设备 |
CN103607293B (zh) * | 2013-10-30 | 2017-08-22 | 新华三技术有限公司 | 一种流量保护方法及设备 |
CN104899164B (zh) * | 2014-03-04 | 2023-05-30 | 瑞萨集成电路设计(北京)有限公司 | 集成电路总线的地址寻址方法、集成电路总线设备和系统 |
GB2537703B (en) * | 2014-12-31 | 2021-07-21 | Pismo Labs Technology Ltd | Methods and systems for communications through a slave gateway |
CN113587383B (zh) * | 2021-07-08 | 2023-01-06 | 青岛海信日立空调系统有限公司 | 一种空调系统 |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1359213A (zh) * | 2000-05-24 | 2002-07-17 | 阿尔卡塔尔互联网运行公司 | 用于多协议冗余路由器协议支持的方法和设备 |
JP2003046539A (ja) * | 2001-08-01 | 2003-02-14 | Nec Corp | 負荷分散機能を有するネットワーク中継装置、ネットワーク中継装置の負荷分散方法、及びプログラム |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6091732A (en) * | 1997-11-20 | 2000-07-18 | Cisco Systems, Inc. | Method for configuring distributed internet protocol gateways with lan emulation |
JP2002368776A (ja) * | 2001-06-07 | 2002-12-20 | Sony Corp | 情報処理装置および方法、情報処理システム、記録媒体、並びにプログラム |
-
2003
- 2003-03-21 CN CNB031210538A patent/CN100334866C/zh not_active Expired - Fee Related
-
2004
- 2004-02-26 WO PCT/CN2004/000147 patent/WO2004084496A1/zh active Application Filing
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1359213A (zh) * | 2000-05-24 | 2002-07-17 | 阿尔卡塔尔互联网运行公司 | 用于多协议冗余路由器协议支持的方法和设备 |
JP2003046539A (ja) * | 2001-08-01 | 2003-02-14 | Nec Corp | 負荷分散機能を有するネットワーク中継装置、ネットワーク中継装置の負荷分散方法、及びプログラム |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8630183B2 (en) | 2007-10-03 | 2014-01-14 | Hitachi, Ltd. | Packet transfer system |
CN102223365A (zh) * | 2011-06-03 | 2011-10-19 | 杭州华三通信技术有限公司 | 基于ssl vpn网关集群的用户接入方法及其装置 |
CN110769078A (zh) * | 2019-10-17 | 2020-02-07 | 广东美的制冷设备有限公司 | 地址分配方法和系统 |
CN111600812A (zh) * | 2020-05-13 | 2020-08-28 | 优刻得科技股份有限公司 | 一种报文的处理方法、处理装置、可读介质和系统 |
CN111600812B (zh) * | 2020-05-13 | 2022-10-25 | 优刻得科技股份有限公司 | 一种报文的处理方法、处理装置、可读介质和系统 |
CN111835608A (zh) * | 2020-05-21 | 2020-10-27 | 中国第一汽车股份有限公司 | 车辆控制系统及车辆 |
Also Published As
Publication number | Publication date |
---|---|
CN1533108A (zh) | 2004-09-29 |
CN100334866C (zh) | 2007-08-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2004084496A1 (fr) | Procede de mise en oeuvre de la distribution de la charge dynamique par les passerelles | |
EP3834384B1 (en) | Control plane based configuration for time sensitive networking | |
US5581552A (en) | Multimedia server | |
JP3850391B2 (ja) | VRRP(VirtualRouterRedundancyProtocol)によるルータ・インターフェース・バックアップ実行方法 | |
JP5331163B2 (ja) | Ipアドレス割り当てシステム、dhcpサーバ及びipアドレス割り当て方法 | |
EP2993838B1 (en) | Methods for setting a member identity of gateway device and corresponding management gateway devices | |
WO2004082222A1 (fr) | Procede de communication ayant la fonction de partage de charge de reseau | |
EP1763204B1 (en) | System and method for redundant switches taking into account learning bridge functionality | |
JP3185762B2 (ja) | ネットワークアドレス設定方式 | |
CN106161272B (zh) | 实现vrrp负载均衡的方法和路由设备 | |
US20110320577A1 (en) | System and method for location based address assignment in the distribution of traffic in a virtual gateway | |
WO2012079474A1 (zh) | 地址分配处理方法、装置和系统 | |
WO2009082905A1 (fr) | Procédé système et dispositif commutateur permettant l'établissement dynamique de réseau local virtuel de multidiffusion | |
CN103813340B (zh) | 基于资源池的网络负荷分担方法、ap及系统 | |
WO2007019798A1 (fr) | Procede de sauvegarde de liaison ascendante | |
US11546267B2 (en) | Method for determining designated forwarder (DF) of multicast flow, device, and system | |
WO2011147312A1 (zh) | 一种业务接入路由器的端口备份方法、装置和系统 | |
WO2009003394A1 (fr) | Procédé d'étude d'adresse mac et élément de réseau | |
WO2014179920A1 (zh) | 基于sdn的网络配置方法、装置及系统 | |
CN101562576A (zh) | 一种路由发布方法和设备 | |
JP2003348136A (ja) | ルータ設定方法 | |
WO2018120822A1 (zh) | 一种用户数据锚点迁移的方法、设备和系统 | |
WO2023125271A1 (zh) | 5g用户终端ip地址确认方法、装置及系统 | |
WO2013075598A1 (zh) | 一种用户接入控制的方法、网络设备和系统 | |
WO2023284366A1 (zh) | Dbng-cp的备份方法及装置 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
AK | Designated states |
Kind code of ref document: A1 Designated state(s): AE AG AL AM AT AU AZ BA BB BG BR BW BY BZ CA CH CN CO CR CU CZ DE DK DM DZ EC EE EG ES FI GB GD GE GH GM HR HU ID IL IN IS JP KE KG KP KR KZ LC LK LR LS LT LU LV MA MD MG MK MN MW MX MZ NA NI NO NZ OM PG PH PL PT RO RU SC SD SE SG SK SL SY TJ TM TN TR TT TZ UA UG US UZ VC VN YU ZA ZM ZW |
|
AL | Designated countries for regional patents |
Kind code of ref document: A1 Designated state(s): BW GH GM KE LS MW MZ SD SL SZ TZ UG ZM ZW AM AZ BY KG KZ MD RU TJ TM AT BE BG CH CY CZ DE DK EE ES FI FR GB GR HU IE IT LU MC NL PT RO SE SI SK TR BF BJ CF CG CI CM GA GN GQ GW ML MR NE SN TD TG |
|
121 | Ep: the epo has been informed by wipo that ep was designated in this application | ||
122 | Ep: pct application non-entry in european phase |