CN101166176B - Method for Realizing Dynamic Load Balancing in Session Initiation Protocol Distributed System - Google Patents
Method for Realizing Dynamic Load Balancing in Session Initiation Protocol Distributed System Download PDFInfo
- Publication number
- CN101166176B CN101166176B CN2006100632276A CN200610063227A CN101166176B CN 101166176 B CN101166176 B CN 101166176B CN 2006100632276 A CN2006100632276 A CN 2006100632276A CN 200610063227 A CN200610063227 A CN 200610063227A CN 101166176 B CN101166176 B CN 101166176B
- Authority
- CN
- China
- Prior art keywords
- message
- request
- node
- load balance
- protocol
- Prior art date
- Legal status (The legal status 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 status listed.)
- Active
Links
Images
Landscapes
- Data Exchanges In Wide-Area Networks (AREA)
- Telephonic Communication Services (AREA)
Abstract
一种实现会话发起协议分布式系统中动态负载均衡的方法,SIP实体发起SIP请求消息,ILBU收到SIP报文并根据报文地址或端口号将报文发送到某一PLBU处理节点;PLBU对SIP消息进行解码,判断是对话内、外请求还是响应,分别进行不同的处理。采用本发明方法可以改进现有固定式HASH算法的缺陷,同时保持分发过程本身的无状态特性。系统内的节点无论增减或者调整系统的分发策略均不影响该会话的消息处理,从而大大提高系统的可靠性、可伸缩性。
A method for implementing dynamic load balancing in a session initiation protocol distributed system. A SIP entity initiates a SIP request message, and the ILBU receives the SIP message and sends the message to a certain PLBU processing node according to the message address or port number; The SIP message is decoded, and it is judged whether it is an internal or external request or a response, and different processing is performed respectively. By adopting the method of the invention, the defect of the existing fixed HASH algorithm can be improved, and at the same time, the stateless characteristic of the distribution process itself can be maintained. Whether the number of nodes in the system increases or decreases or the distribution strategy of the system is adjusted will not affect the message processing of the session, thus greatly improving the reliability and scalability of the system.
Description
技术领域technical field
本发明涉及SIP(SESSION INITIATION PROTOCOL,会话发起协议)分布式系统中的负载均衡。The invention relates to load balancing in a SIP (SESSION INITIATION PROTOCOL, session initiation protocol) distributed system.
背景技术Background technique
SIP是一类多媒体通信控制协议,目前已经在软交换、IMS(IP MULTIMEDIASUBSYSTEM,IP多媒体子系统)等网络中广泛应用。SIP采用文本编码方式,利用跟踪分析,但同时也造成其消息体量过大,给处于核心位置的SIP服务器带来了沉重的负担。SIP is a kind of multimedia communication control protocol, which has been widely used in networks such as softswitch and IMS (IP MULTIMEDIASUBSYSTEM, IP Multimedia Subsystem). SIP adopts text encoding method and uses tracking analysis, but at the same time, it also causes the message volume to be too large, which brings a heavy burden to the SIP server at the core.
大型系统中一般采用分布式系统处理,对于无呼叫状态服务器而言,其负载均衡相对简单,而对于SoftSwitch、CSCF(CALL SESSION CONTROL FUNCTION,呼叫会话控制功能)这些有呼叫状态的SIP服务器来说负载均衡是一个复杂的问题。在分析SIP分布式处理之前,我们可以根据分布式负载均衡的功能划分,将SIP分布式处理节点分为三个逻辑实体:1)ILBU(ILBU:IP Load-Balance Unit,IP负载均衡单元),2)PLBU(PROTOCOL LOAD BALANCE UNIT,协议负载均衡单元),3)PPU(PROTOCOL PROCESS UNIT,协议处理单元)。Large-scale systems generally use distributed system processing. For servers without call status, the load balancing is relatively simple, but for SIP servers with call status, such as SoftSwitch and CSCF (CALL SESSION CONTROL FUNCTION, call session control function), the load Equilibrium is a complex issue. Before analyzing SIP distributed processing, we can divide SIP distributed processing nodes into three logical entities according to the function of distributed load balancing: 1) ILBU (ILBU: IP Load-Balance Unit, IP Load-Balance Unit), 2) PLBU (PROTOCOL LOAD BALANCE UNIT, protocol load balancing unit), 3) PPU (PROTOCOL PROCESS UNIT, protocol processing unit).
一般来说分布式方案有三种:Generally speaking, there are three types of distributed schemes:
一是基于用户的分布式处理,也就是采用用户标识作为负载均衡的关键字,它的缺点是系统的负载均衡部件必须要存储用户的状态,当系统容量较大时,入口的负载均衡部件往往需要多个,在多个节点之间同步状态开销过大。One is user-based distributed processing, that is, user IDs are used as keywords for load balancing. Its disadvantage is that the system load balancing components must store user status. When the system capacity is large, the entrance load balancing components often Multiple nodes are required, and the overhead of synchronizing state among multiple nodes is too large.
二是采用不同的IP地址或传输层端口来标识不同的处理节点号,例如采用5060端口作为SIP节点的知名端口,每一个节点再各分配一个唯一的端口,当SIP消息经过本节点时,根据内部复杂均衡算法为其分配一个节点,然后节点进行Record-Route操作记录下本节点的端口号,对方网元收到200OK后将按照新的端口发送请求,这一方法的缺点是当采用有连接传输时,上游SIP网元必须要与本端重建连接,增加了底层的开销。The second is to use different IP addresses or transport layer ports to identify different processing node numbers. For example, port 5060 is used as the well-known port of the SIP node, and each node is assigned a unique port. When the SIP message passes through the node, according to The internal complex balance algorithm allocates a node for it, and then the node performs the Record-Route operation to record the port number of the node, and the other network element will send the request according to the new port after receiving 200 OK. The disadvantage of this method is that when using the connection During transmission, the upstream SIP network element must re-establish the connection with the local end, which increases the overhead of the bottom layer.
三是采用每个SIP消息中必备的头字段或参数作为负载均衡HASH的关键字(比如Call-ID)其实现方式如图2所示,包括以下步骤:The third is to adopt the necessary header fields or parameters in each SIP message as the keyword (such as Call-ID) of the load balancing HASH. Its implementation is as shown in Figure 2, including the following steps:
步骤201,外部SIP实体发起INVITE请求,ILBU收到该请求;
步骤202,ILBU根据源、目的IP地址或端口号及实现的负载均衡策略获得一个PLBU的节点号;Step 202, the ILBU obtains a node number of a PLBU according to the source, destination IP address or port number and the implemented load balancing strategy;
步骤203,ILBU将该请求发送到该PLBU节点;
步骤204,PLBU根据SIP请求的呼叫标识(Call-ID)进行HASH处理,结合本Step 204, PLBU carries out HASH processing according to the calling identification (Call-ID) of SIP request, in conjunction with this
地节点信息,得到可用的PPU节点号。to obtain the available PPU node number.
步骤205,PLBU将消息发往该PPU;
步骤206,PPU处理完SIP INVITE请求消息后将消息转发出去;
步骤207~208,被叫用户对请求应答,应答消息经ILBU到达PLBU;Steps 207-208, the called user responds to the request, and the response message arrives at the PLBU via the ILBU;
步骤209,PLBU根据呼叫标识HASH得到PPU节点号;Step 209, the PLBU obtains the PPU node number according to the call identification HASH;
步骤210-211,应答消息经PPU、ILBU转发给主叫用户;Step 210-211, the response message is forwarded to the calling user through PPU and ILBU;
步骤212~213,用户发起对话内消息经ILBU到达PLBU;Steps 212-213, the user initiates a message in the dialogue and reaches the PLBU via the ILBU;
步骤214,PLBU根据呼叫标识号进行HASH,得到PPU节点号;Step 214, PLBU carries out HASH according to call identification number, obtains PPU node number;
步骤215,PLBU将消息转发给PPU。Step 215, PLBU forwards the message to PPU.
上述各步骤描述了SIP分布式系统内采用固定HASH算法的一次基本流程,所有的SIP消息必须首先经过ILBU->PLBU进行消息预解码,得到每一个呼叫恒定不变的成分(如Call-ID)进行HASH取模得到应该处理的节点号,模数为系统总节点总数,这样负载均衡部件可以实现无状态工作,系统吞吐量及可靠性大大提高。同时这一方案的缺点也显而易见,由于呼叫处理是有状态的,同一个呼叫必须在一个节点中进行处理,当系统中增加节点或因故障减少节点时,HASH模数发生变化,已经建立的通话后续SIP消息无法保证分发到同一节点进行处理,也无法实现动态负载均衡。比如某一呼叫Call-ID=C1,HASH(C1)=18,系统总节点数为5,那么该呼叫的处理节点为18Mod 5+1=4,在该呼叫保持阶段系统增加了一个节点,总节点数变为6,那么后续消息被错误的发往节点1(18Mod 6+1)(因为假定节点号从1开始编号,取模后需要加1,18mod 6=0),致使该呼叫不能正常继续或释放。实际系统中分发器可能采用一定的负载均衡策略,但在不存储每一个呼叫状态的条件下,上述缺陷仍然存在。The above steps describe a basic process of using a fixed HASH algorithm in the SIP distributed system. All SIP messages must first go through ILBU->PLBU for message pre-decoding to obtain the constant components of each call (such as Call-ID) Perform HASH modulus to obtain the node number that should be processed. The modulus is the total number of nodes in the system. In this way, the load balancing component can realize stateless work, and the system throughput and reliability are greatly improved. At the same time, the disadvantages of this solution are also obvious. Since the call processing is stateful, the same call must be processed in one node. When a node is added to the system or a node is reduced due to a failure, the HASH modulus changes, and the established call Subsequent SIP messages cannot be guaranteed to be distributed to the same node for processing, nor can dynamic load balancing be achieved. Such as a call Call-ID=C1, HASH(C1)=18, and the total number of nodes in the system is 5, then the processing node of the call is 18Mod 5+1=4, and the system adds a node in the call holding phase, the total The number of nodes becomes 6, then the follow-up message is wrongly sent to node 1 (18Mod 6+1) (because it is assumed that the node number starts from 1, and 1 needs to be added after taking the modulus, 18mod 6 = 0), which makes the call abnormal Continue or release. In the actual system, the distributor may adopt a certain load balancing strategy, but the above defects still exist under the condition of not storing the state of each call.
发明内容Contents of the invention
本发明要解决的技术问题是提供一种分布式SIP系统中实现动态负载均衡的方法,既不需本地存储任何状态,又可以适应增删节点及动态负载均衡的要求。The technical problem to be solved by the present invention is to provide a method for realizing dynamic load balancing in a distributed SIP system, which does not need to store any state locally, and can adapt to the requirements of adding and deleting nodes and dynamic load balancing.
本发明一种实现会话发起协议分布式系统中动态负载均衡的方法,包括以下步骤:A method for realizing dynamic load balancing in a session initiation protocol distributed system of the present invention comprises the following steps:
1.1、外部会话发起协议(SIP)实体发起会话发起协议(SIP)请求消息,IP负载均衡单元(ILBU)收到会话发起协议(SIP)报文并根据报文地址或端口号将报文发送到协议负载均衡单元(PLBU);1.1, the external Session Initiation Protocol (SIP) entity initiates the Session Initiation Protocol (SIP) request message, and the IP Load Balancing Unit (ILBU) receives the Session Initiation Protocol (SIP) message and sends the message to Protocol Load Balancing Unit (PLBU);
1.2、协议负载均衡单元(PLBU)对会话发起协议(SIP)消息进行解码,判断该消息是对话内、外请求还是响应,分别进行不同的处理;1.2. The Protocol Load Balancing Unit (PLBU) decodes the Session Initiation Protocol (SIP) message, judges whether the message is an internal or external request or response to the dialogue, and performs different processing respectively;
1.2.1、如果是对话外请求,对会话发起协议(SIP)呼叫中必须携带且保持不变的值(A1)进行散列计算(HASH)得到协议处理单元(PPU)节点号并发送到相应节点进行处理;该节点处理完毕后在被叫方响应的头部中返回的特定值中添加一个扩展参数(B1),参数中包括对本节点号的编码,并标识为本节点所添加;协议处理单元(PPU)转发或主动发起的请求在响应消息与请求消息中必须相同的标识(C1)中记录其节点号;1.2.1. If it is an out-of-dialog request, perform hash calculation (HASH) on the value (A1) that must be carried in the Session Initiation Protocol (SIP) call and remain unchanged to obtain the protocol processing unit (PPU) node number and send it to the corresponding The node performs processing; after the node is processed, an extended parameter (B1) is added to the specific value returned in the header of the called party's response. The parameter includes the code for the node number and is identified as being added by the node; protocol processing The request forwarded or initiated by the unit (PPU) records its node number in the same identification (C1) in the response message and the request message;
1.2.2、如果非对话外请求,转下一步处理;1.2.2. If it is not an out-of-dialogue request, proceed to the next step;
1.3如果是对话内请求,根据将所述扩展参数(B1)确定的节点号进行分发,如该节点不可用,则请求失败;如果非对话内请求,转下一步处理;1.3 If it is a request within the dialogue, distribute it according to the node number determined by the extended parameter (B1). If the node is unavailable, the request fails; if it is not a request within the dialogue, proceed to the next step;
1.4对于响应消息,则取所述在响应消息与请求消息中必须相同的标识(C1)进行解码得到节点号,根据解码后的节点号进行分发,如该节点不可用,则请求失败。1.4 For the response message, take the identification (C1) that must be the same in the response message and the request message to decode to obtain the node number, and distribute according to the decoded node number. If the node is unavailable, the request fails.
当系统为UDP承载时,系统的协议负载均衡单元(PLBU)、协议处理单元(PPU)可以合并设置,初始分发限定在本节点。When the system bears UDP, the protocol load balancing unit (PLBU) and protocol processing unit (PPU) of the system can be combined and set, and the initial distribution is limited to this node.
在上述方案中,所述会话发起协议(SIP)呼叫中必须携带且保持不变的值可以是呼叫标识(Call-ID);所述被叫方响应的头部中返回的特定值可以是路由记录(Record-Route)请求的路由(Route)字段;所述在响应消息与请求消息中必须相同的标识可以是经由(Via)头部中的部分参数。In the above solution, the value that must be carried and remains unchanged in the session initiation protocol (SIP) call may be the call identification (Call-ID); the specific value returned in the header of the called party response may be the route Record (Record-Route) the route (Route) field of the request; the identification that must be the same in the response message and the request message may be part of the parameters in the Via (Via) header.
在一个更具体的方案中,本发明包括以下步骤:In a more specific scheme, the present invention comprises the following steps:
步骤301,外部会话发起协议(SIP)实体发起邀请(INVITE)请求,IP负载均衡单元(ILBU)收到该请求;
步骤302,IP负载均衡单元(ILBU)根据源、目的IP地址或端口号及实现的负载均衡策略获得一个协议负载均衡单元(PLBU)的节点号;Step 302, the IP load balancing unit (ILBU) obtains the node number of a protocol load balancing unit (PLBU) according to the source, destination IP address or port number and the load balancing strategy realized;
步骤303,IP负载均衡单元(ILBU)将该请求发送到该协议负载均衡单元(PLBU);
步骤304,协议负载均衡单元(PLBU)判断INVITE消息类型,若为初始INVITE,则根据会话发起协议(SIP)请求的呼叫标识(Call-ID)或会话发起协议(SIP)消息中请求统一资源标识符(Request-URI)中携带的用户标识进行HASH处理,结合本地节点信息,得到可用的协议处理单元(PPU)节点号;否则根据Route头部的分发参数解码得到协议处理单元节点号;Step 304, the protocol load balancing unit (PLBU) judges the INVITE message type, if it is an initial INVITE, then request a uniform resource identifier according to the call identification (Call-ID) requested by the session initiation protocol (SIP) or the session initiation protocol (SIP) message The user ID carried in the Request-URI is subjected to HASH processing, combined with the local node information, to obtain the available protocol processing unit (PPU) node number; otherwise, the protocol processing unit node number is obtained by decoding the distribution parameters in the Route header;
步骤305,协议负载均衡单元(PLBU)将消息发往该协议处理单元(PPU);
步骤306,协议处理单元(PPU)处理完会话发起协议(SIP)INVITE请求消息后、转发消息之前,在转发请求的VIA中及插入的路由记录(Record-Route)中的一个扩展参数共两处标记自己的节点号,前者是为了方便响应消息的分发处理,后者则是解决请求消息的分发Step 306, after the protocol processing unit (PPU) has processed the session initiation protocol (SIP) INVITE request message and before forwarding the message, there are two extended parameters in the VIA of the forwarding request and in the inserted route record (Record-Route). Mark your own node number, the former is to facilitate the distribution and processing of response messages, and the latter is to solve the distribution of request messages
步骤307协议处理单元(PPU)将消息转发出去;Step 307: the protocol processing unit (PPU) forwards the message;
步骤308~309,被叫用户对请求应答,应答消息经IP负载均衡单元(ILBU)到达协议负载均衡单元(PLBU);Steps 308-309, the called user responds to the request, and the response message arrives at the protocol load balancing unit (PLBU) via the IP load balancing unit (ILBU);
步骤310,协议负载均衡单元(PLBU)根据应答消息中的VIA头部字段的内容解码得到协议处理单元(PPU)节点号;Step 310, the protocol load balancing unit (PLBU) obtains the protocol processing unit (PPU) node number according to the content decoding of the VIA header field in the response message;
步骤311~312,应答消息经协议处理单元(PPU)、IP负载均衡单元(ILBU)转发给主叫用户;Steps 311-312, the response message is forwarded to the calling user through the protocol processing unit (PPU) and the IP load balancing unit (ILBU);
步骤313~314,用户发起对话内消息经IP负载均衡单元(ILBU)到达协议负载均衡单元(PLBU);Steps 313-314, the user initiates a message in the dialogue and reaches the protocol load balancing unit (PLBU) via the IP load balancing unit (ILBU);
步骤315,协议负载均衡单元(PLBU)根据请求中首个路由(TOP Route)头部字段(此字段为协议处理单元(PPU)在初始INVITE中插入的路由记录(Record-Route)字段转换而来)中的扩展参数得到协议处理单元(PPU)节点号;Step 315, the protocol load balancing unit (PLBU) is converted from the first route (TOP Route) header field in the request (this field is the route record (Record-Route) field inserted by the protocol processing unit (PPU) in the initial INVITE) ) in the extended parameter obtains the protocol processing unit (PPU) node number;
步骤316,协议负载均衡单元(PLBU)将消息转发给协议处理单元(PPU)。Step 316, the protocol load balancing unit (PLBU) forwards the message to the protocol processing unit (PPU).
采用本发明方法可以改进现有固定式HASH算法的缺陷,同时保持分发过程本身的无状态特性,比如当会话已经建立后是需要该会话的所有后续消息必须在该节点处理,若此时某个其它节点因故障退出服务、或需手动增加节点将使系统中总的节点数目变化,从而导致固定HASH算法得出的节点号发生变化,使已经建立的会话其后续消息分发产生紊乱。而采用本发明实际上相当于将一个会话相关的消息看做一个任务,从第一条消息根据某个特征分配处理资源,一旦分配了处理节点,便为该会话贴上标签,后续消息根据标签进行分发,而不再根据初始的任务分配关键字进行分发,这样就可以保证会话一旦建立(处理节点已分配),只要该节点不停机,系统内的节点无论增减或者调整系统的分发策略均不影响该会话的消息处理,从而大大提高系统的可靠性、可伸缩性。Adopting the method of the present invention can improve the defects of the existing fixed HASH algorithm while maintaining the stateless characteristics of the distribution process itself. If other nodes exit the service due to failure, or need to manually add nodes, the total number of nodes in the system will change, resulting in changes in the node number obtained by the fixed HASH algorithm, which will cause confusion in the subsequent message distribution of established sessions. However, using the present invention is actually equivalent to treating a session-related message as a task, allocating processing resources from the first message according to a certain feature, once a processing node is allocated, labeling the session, and subsequent messages according to the label distribution, instead of distribution according to the initial task assignment keywords, so that once the session is established (the processing node has been assigned), as long as the node does not shut down, no matter whether the nodes in the system increase or decrease or the distribution strategy of the system is adjusted The message processing of the session is not affected, thereby greatly improving the reliability and scalability of the system.
附图说明Description of drawings
图1是分布式SIP系统的逻辑框架图;Fig. 1 is a logical frame diagram of a distributed SIP system;
图2是现有技术中采用固定HASH算法的分布式SIP系统中的负载均衡算法流程图;Fig. 2 is the load balancing algorithm flowchart in the distributed SIP system that adopts fixed HASH algorithm in the prior art;
图3是本发明实施例分布式SIP系统中的负载均衡算法流程图。FIG. 3 is a flowchart of a load balancing algorithm in a distributed SIP system according to an embodiment of the present invention.
具体实施方式Detailed ways
图1是分布式SIP系统的逻辑框架图,示出了ILBU(IP负载均衡部件)、PLBU(协议负载均衡部件)、PPU(协议处理部件)等逻辑节点及其连接关系。实际系统设计时可以根据系统节点数量、采用的负载均衡算法或部件特性将上述三个逻辑功能进行组合、归并,部署在2个或1个物理节点中实现。如ILBU采用通用网络处理器实现,很难对SIP消息进行解码,则ILBU必须独立设置;当系统规模较小时为了节省成本,可以将PLBU与PPPU合并设置。Fig. 1 is a logical frame diagram of a distributed SIP system, showing logical nodes such as ILBU (IP load balancing unit), PLBU (protocol load balancing unit), PPU (protocol processing unit) and their connections. In the actual system design, the above three logical functions can be combined and merged according to the number of system nodes, the load balancing algorithm adopted or the characteristics of the components, and deployed in two or one physical node for implementation. If ILBU is implemented by a general-purpose network processor, it is difficult to decode SIP messages, then ILBU must be set independently; when the system scale is small, in order to save costs, PLBU and PPPU can be combined and set.
图2是现有技术中采用固定HASH算法的分布式SIP系统中的负载均衡算法流程图,在背景技术部分已有详细介绍。FIG. 2 is a flowchart of a load balancing algorithm in a distributed SIP system using a fixed HASH algorithm in the prior art, which has been introduced in detail in the background technology section.
本发明利用了SIP协议的三种特性:a)在一次SIP呼叫中存在某些值是必须携带且保持不变的,比如Call-ID;b)被叫方可以在响应的某个头部中返回特定的值,而这个值对方必须在后续消息的某个字段中不变地带回来,如响应中的Record-Route请求的Route字段;c)在一个SIP事务中,响应消息中的某些标识必须与请求消息中相同,如Via头部中的部分参数。The present invention utilizes three characteristics of the SIP protocol: a) there are certain values that must be carried and remain unchanged in a SIP call, such as Call-ID; Return a specific value, and this value must be brought back unchanged by the other party in a certain field of the subsequent message, such as the Route field of the Record-Route request in the response; c) In a SIP transaction, certain identifiers in the response message Must be the same as in the request message, such as some parameters in the Via header.
本发明的步骤为:The steps of the present invention are:
1、外部SIP实体发起SIP请求消息,ILBU收到消息。1. The external SIP entity initiates a SIP request message, and the ILBU receives the message.
2、ILBU收到SIP报文根据报文地址或端口号将报文发送到PLBU。2. ILBU receives the SIP message and sends the message to PLBU according to the message address or port number.
3、PLBU对SIP消息进行解码,判断该消息是对话内、外请求还是响应分别进行不同的处理:3. The PLBU decodes the SIP message, and judges whether the message is an internal or external request or response to the dialogue and performs different processing:
如果是对话外请求,根据符合特性a)的SIP消息成分A1进行HASH得到PPU节点号并发送到相应节点进行处理,该节点SIP进行处理完毕后在具备特性b)的头部中添加一个扩展参数B1(形式任意,只要符合SIP协议编码、语法要求,如did=?),参数中包括对本节点号的编码,并标识为本节点所添加。PPU转发或主动发起的请求在符合特性c)的某一标识C1中(如Via的branch或其它私有参数)记录其节点号。If it is an out-of-dialogue request, perform HASH according to the SIP message component A1 that meets the characteristic a) to obtain the PPU node number and send it to the corresponding node for processing. After the SIP processing of the node, an extended parameter is added to the header with characteristic b). B1 (any form, as long as it conforms to the coding and syntax requirements of the SIP protocol, such as did=?), the parameter includes the coding of the node number, and is marked as added by the node. The request forwarded or initiated by the PPU records its node number in a certain identifier C1 (such as branch of Via or other private parameters) conforming to characteristic c).
如果非对话外请求,转下一步处理。If it is not an out-of-dialogue request, proceed to the next step.
4、如果是对话内请求,根据将B1分发参数确定的节点号进行分发,如该节点不可用,则请求失败。如果非对话内请求,转下一步处理。4. If it is an intra-dialog request, distribute according to the node number determined by the B1 distribution parameter. If the node is unavailable, the request fails. If it is not requested in the dialog, go to the next step.
5、对于响应消息,则取C1进行解码得到节点号,根据解码后的节点号进行分发,如该节点不可用,则请求失败。5. For the response message, take C1 to decode to obtain the node number, and distribute according to the decoded node number. If the node is unavailable, the request fails.
本发明能带来以下优点:The present invention can bring following advantage:
a)动态负载均衡。利用SIP协议的特性在初始请求中记录下系统实际为其分配的节点号,保证了已经建立的SIP呼叫不再受负载均衡函数更改的影响,初始呼叫SIP消息以A1的散列值分配一个处理节点k,后续的消息分发均使用消息中携带的节点k信息,此时如修改以A1为关键字HASH分发表只会影响新到达的呼叫,对已建立的呼叫没有不良影响。采用该算法的系统可以根据系统当前的性能度量结果动态修改系统分发表,从而实现了系统动态负载均衡。a) Dynamic load balancing. Use the characteristics of the SIP protocol to record the node number actually assigned by the system in the initial request, ensuring that the established SIP call is no longer affected by the change of the load balancing function, and the initial call SIP message is assigned a processing with the hash value of A1 Node k, the subsequent message distribution uses the node k information carried in the message. At this time, modifying the HASH distribution table with A1 as the key will only affect the newly arrived call, and have no adverse effect on the established call. The system using this algorithm can dynamically modify the system distribution table according to the current performance measurement results of the system, thus realizing the dynamic load balancing of the system.
b)容错:由于会话一旦建立,本发明中即通过返回的参数确定了处理节点,后续消息中必然携带节点信息,因此会话后续消息可以利用此信息找到原始会话处理节点,不会因为节点增减造成分发错误,因此即具备以下容错特性:n-节点的分布式系统检测节点k失效,此时将所有应分发到该节点的A1的模值均匀分布到其它n-1个节点上,故障期间携带k节点信息的对话内SIP消息均被正确丢弃,初始SIP消息被分发到其它节点之上;故障恢复后,系统重新调整A1分发表,新的呼叫可以到达节点k,而呼叫后续消息则仍然在原有节点上处理。b) Fault tolerance: once the session is established, the processing node is determined by the returned parameters in the present invention, and the subsequent message must carry node information, so the subsequent message of the session can use this information to find the original session processing node, and will not increase or decrease due to the node Causes distribution errors, so it has the following fault-tolerant characteristics: the n-node distributed system detects that node k fails, and at this time, all the modulus values of A1 that should be distributed to this node are evenly distributed to other n-1 nodes. The SIP message in the dialogue carrying the information of node k is correctly discarded, and the initial SIP message is distributed to other nodes; after the fault recovers, the system readjusts the A1 distribution table, and the new call can reach node k, while the call follow-up message remains Processed on the original node.
图3是本发明一个具体实施例的流程图。Fig. 3 is a flowchart of a specific embodiment of the present invention.
步骤301,外部SIP实体发起INVITE请求,ILBU收到该请求;
步骤302,ILBU根据源、目的IP地址或端口号及实现的负载均衡策略获得一个PLBU的节点号;Step 302, the ILBU obtains a node number of a PLBU according to the source, destination IP address or port number and the implemented load balancing strategy;
步骤303,ILBU将该请求发送到该PLBU;
步骤304,PLBU判断INVITE消息类型,若为初始INVITE则根据SIP请求的呼叫标识(Call-ID)进行HASH处理,结合本地节点信息,得到可用的PPU节点号(也可以根据初始SIP消息中Request-URI中携带的用户标识HASH得到节点号)。否则根据Route头部的分发参数解码得到协议处理单元节点号。Step 304, PLBU judges the INVITE message type, if it is initial INVITE then carries out HASH processing according to the call identification (Call-ID) of SIP request, in conjunction with local node information, obtains available PPU node number (also can according to Request-ID in the initial SIP message The user identification HASH carried in the URI obtains the node number). Otherwise, the node number of the protocol processing unit is obtained by decoding the distribution parameter in the Route header.
步骤305,PLBU将消息发往该PPU;
步骤306,PPU处理完SIP INVITE请求消息后、转发消息之前,在转发请求的VIA中及插入的Record-Route(路由记录)中的一个扩展参数共两处标记自己的节点号,前者是为了方便响应消息的分发处理,后者则是解决请求消息的分发Step 306, after the PPU has processed the SIP INVITE request message, before forwarding the message, in the VIA of the forwarding request and an extended parameter in the inserted Record-Route (route record), there are two places to mark the node number of oneself, the former is for convenience The distribution processing of the response message, the latter is to solve the distribution of the request message
步骤307PPU将消息转发出去;Step 307PPU forwards the message;
步骤308~309,被叫用户对请求应答,应答消息经ILBU到达PLBU;Steps 308-309, the called user responds to the request, and the response message arrives at the PLBU via the ILBU;
步骤310,PLBU根据应答消息中的VIA头部字段的内容解码得到呼叫处理PPU节点号;Step 310, the PLBU obtains the call processing PPU node number according to the content decoding of the VIA header field in the response message;
步骤311~312,应答消息经PPU、ILBU转发给主叫用户;Steps 311-312, the response message is forwarded to the calling user via PPU and ILBU;
步骤313~314,用户发起对话内消息经ILBU到达PLBU;Steps 313-314, the user initiates a message in the dialogue and reaches the PLBU via the ILBU;
步骤315,PLBU根据请求中TOP Route头部字段(此字段为PPU在初始INVITE中插入的Record-Route字段转换而来)中的扩展参数得到PPU节点号;Step 315, the PLBU obtains the PPU node number according to the extended parameter in the TOP Route header field (this field is converted from the Record-Route field inserted by the PPU in the initial INVITE) in the request;
步骤316,PLBU将消息转发给PPU。In step 316, the PLBU forwards the message to the PPU.
Claims (4)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN2006100632276A CN101166176B (en) | 2006-10-19 | 2006-10-19 | Method for Realizing Dynamic Load Balancing in Session Initiation Protocol Distributed System |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN2006100632276A CN101166176B (en) | 2006-10-19 | 2006-10-19 | Method for Realizing Dynamic Load Balancing in Session Initiation Protocol Distributed System |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN101166176A CN101166176A (en) | 2008-04-23 |
| CN101166176B true CN101166176B (en) | 2010-12-08 |
Family
ID=39334649
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN2006100632276A Active CN101166176B (en) | 2006-10-19 | 2006-10-19 | Method for Realizing Dynamic Load Balancing in Session Initiation Protocol Distributed System |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN101166176B (en) |
Families Citing this family (11)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101808039B (en) * | 2010-03-29 | 2013-10-02 | 成都市华为赛门铁克科技有限公司 | Method for processing data messages and processing server |
| CN102202066B (en) * | 2011-06-24 | 2014-12-24 | 烽火通信科技股份有限公司 | Session initiation protocol (SIP) message distribution system, device and method |
| US9319459B2 (en) * | 2011-09-19 | 2016-04-19 | Cisco Technology, Inc. | Services controlled session based flow interceptor |
| CN104683253A (en) * | 2013-11-27 | 2015-06-03 | 北京大唐高鸿数据网络技术有限公司 | Dynamic load balancing method for unified communication system |
| CN105573996A (en) * | 2014-10-09 | 2016-05-11 | 阿里巴巴集团控股有限公司 | Database processing method, database processing device and database processing system |
| CN108076149B (en) * | 2017-12-15 | 2021-07-23 | 杭州迪普科技股份有限公司 | Session maintaining method and device |
| CN111147674B (en) * | 2018-11-02 | 2023-09-01 | 北京京东尚科信息技术有限公司 | A method and device for load balancing in a call center |
| CN110113303B (en) * | 2019-03-25 | 2021-07-09 | 国家计算机网络与信息安全管理中心 | SIP protocol stack load balancing system and method in telecommunication network IMS |
| CN112217843B (en) | 2019-07-09 | 2023-08-22 | 阿里巴巴集团控股有限公司 | Service unit switching method, system and equipment |
| CN110913010B (en) * | 2019-12-05 | 2021-12-31 | 杭州东信北邮信息技术有限公司 | SIP service cluster system and implementation method |
| CN119561932B (en) * | 2024-11-22 | 2025-10-31 | 东方通信股份有限公司 | A method for dynamic scaling up and down of SIP calls based on route consistency detection |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1512729A (en) * | 2002-12-31 | 2004-07-14 | 联想(北京)有限公司 | Method for network equipment self adaption load equalization |
| CN1595906A (en) * | 2003-12-17 | 2005-03-16 | 浪潮电子信息产业股份有限公司 | Single address traffic distributor of cluster network |
| WO2005050946A1 (en) * | 2003-10-30 | 2005-06-02 | Hewlett-Packard Development Company, L.P. | Method and apparatus for load-balancing |
-
2006
- 2006-10-19 CN CN2006100632276A patent/CN101166176B/en active Active
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1512729A (en) * | 2002-12-31 | 2004-07-14 | 联想(北京)有限公司 | Method for network equipment self adaption load equalization |
| WO2005050946A1 (en) * | 2003-10-30 | 2005-06-02 | Hewlett-Packard Development Company, L.P. | Method and apparatus for load-balancing |
| CN1595906A (en) * | 2003-12-17 | 2005-03-16 | 浪潮电子信息产业股份有限公司 | Single address traffic distributor of cluster network |
Also Published As
| Publication number | Publication date |
|---|---|
| CN101166176A (en) | 2008-04-23 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US8874762B2 (en) | Session initiation protocol adaptor | |
| US9794332B2 (en) | Method and apparatus for load balancing in network based telephony application | |
| US8086709B2 (en) | Method and apparatus for distributing load on application servers | |
| US8881167B2 (en) | Load balancing in network based telephony applications | |
| CN101185305B (en) | Call forwarding in an IP multimedia subsystem (IMS) | |
| US20080228926A1 (en) | Methods, media, and systems for balancing session initiation protocol server load | |
| US20090287846A1 (en) | Method and Apparatus for Load Balancing in Network Based Telephony Based On Call Length | |
| US8964524B2 (en) | Method of routing an SIP message in the event of unavailability of intermediate nodes | |
| US8798095B2 (en) | Method and apparatus for call processing for SIP and ISUP interworking | |
| WO2019223167A1 (en) | Method, apparatus and device for obtaining sip server address and storage medium | |
| US8423652B2 (en) | Service templates for an IP multimedia subsystem | |
| CN101166176B (en) | Method for Realizing Dynamic Load Balancing in Session Initiation Protocol Distributed System | |
| US10601880B2 (en) | Conference reconstruction in SIP networks | |
| CN113162865A (en) | Load balancing method, server and computer storage medium | |
| US8654770B2 (en) | Method of setting up a call in an internet protocol multimedia subsystem network | |
| US8972586B2 (en) | Bypassing or redirecting a communication based on the failure of an inserted application | |
| US9392027B2 (en) | Message handling in an IP multimedia subsystem | |
| CN100558109C (en) | Method and system for implementing load balancing based on session initiation protocol | |
| JP5941434B2 (en) | Cluster system of session border controller, cluster system of application server, and SIP dialog generation method thereof | |
| CN1875603B (en) | Method and apparatus for load-balancing | |
| CN102469066B (en) | Message processing method and device | |
| US8630163B1 (en) | Server driven endpoint re-homing | |
| US20150326734A1 (en) | Sbc for cloud environment and method for operating sbc | |
| CN1885859B (en) | Method for supporting combined circuit domain call and Internet multimedia subsystem dialogue | |
| CN120151330A (en) | Communication method, system, device and readable medium |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| C06 | Publication | ||
| PB01 | Publication | ||
| C10 | Entry into substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| C14 | Grant of patent or utility model | ||
| GR01 | Patent grant |