Label Routing

From TBwiki
(Difference between revisions)
Jump to: navigation, search
(6. Associate NAPs with the Digitmap and Routeset definition files)
 
(9 intermediate revisions by 5 users not shown)
Line 8: Line 8:
  
 
#A list of numbers (NPA-NXX) for a specific destination is assigned a [[RouteSet|RouteSet]] name. This list can be very large  
 
#A list of numbers (NPA-NXX) for a specific destination is assigned a [[RouteSet|RouteSet]] name. This list can be very large  
##i.e., 514201,514202,514203, ... -> "Montreal, Qc"
+
##i.e., 514201,514202,514203, ... -> Montreal_Qc
 
#The list of routes for the destination is assigned the same [[RouteSet|RouteSet]] name. This list usually is limited to the number of [[NAP|network access points (NAP)]] in the system.  
 
#The list of routes for the destination is assigned the same [[RouteSet|RouteSet]] name. This list usually is limited to the number of [[NAP|network access points (NAP)]] in the system.  
##i.e., Bell, Rogers, Videotron -> "Montreal, Qc"
+
##i.e., Bell, Rogers, Videotron -> Montreal_Qc
  
 
<br> Note: No matter how many destination numbers lead to a given destination, only a limited list of routes are selected. At this point, complex, yet efficient, routing rules can take place.  
 
<br> Note: No matter how many destination numbers lead to a given destination, only a limited list of routes are selected. At this point, complex, yet efficient, routing rules can take place.  
  
<br>  
+
<br>
  
 
== Implementation  ==
 
== Implementation  ==
Line 22: Line 22:
 
<br>  
 
<br>  
  
== Provisioning  ==
+
== Performance ==
 
+
Provisioning of large amounts of Routeset definition and digitmaps is accomplished by importing [http://en.wikipedia.org/wiki/Comma-separated_values CSV] files using the WebPortal. &nbsp;Those files are being saved in the HA Database.
+
  
 +
Typically, there are only a few hundred labels (e.g. countries/states/regions/providers/cities identifiers) but there are hundred thousands and millions of actual numbers pointing to those labels.  Each label will correspond to a dynamic route associating it to a destination NAP.  The biggest portion of the data comes from the digitmap files.  These million digit maps are loaded into binary trees when a configuration is applied allowing longest match algorithm to be performed with constant delay regardless of the number of digit map entries in memory.  The only performance impact is upon the "Apply configuration" time, not on the call processing flow.  Here are a few samples of configuration loading time on a TMG3200 running release 2.7:
 
<br>  
 
<br>  
 
=== Routeset Definition  ===
 
 
Each [[NAP]] in the system must be assigned a routesets_definition [http://en.wikipedia.org/wiki/Comma-separated_values CSV] file. A routesets_definition file gives the association between [[NAP|NAP]] and [[RouteSet|RouteSet]] names. The association between a [[NAP]] and a [[RouteSet|RouteSet]] name is in fact a route! ie: Rogers-&gt;"Montreal, Qc" Thus, for each [[RouteSet]] name&lt;-&gt;[[NAP]] association, a dynamic route entry gets created.
 
 
<br> The routesets_definition file defines a list of [[RouteSet|RouteSet]] names, with optional attributes.<br>
 
 
*One mandatory column: routeset_name (label)
 
*Supplementary columns are used to provide optional and custom attributes to dynamically created routes
 
 
  routeset_name,  cost,    custom_1
 
"Montreal, Qc", "0.24",  "custom_val"
 
 
 
In the above example, routes are created with custom attributes found in the second and third columns. Each custom attribute must be defined by adding a custom column in the gateway Route table.
 
 
<br>The [[NAP]] &lt;-&gt;&nbsp;Routeset Definition association is done&nbsp;by setting the [[NAP]] dynamic columns named 'routesets_definition'. &nbsp;More than one [[NAP]] can point to the same 'routesets_definition' file. This file must be imported in the database using the File Db view in the Toolpack Web Portal.<br>
 
 
 
<br>  
 
<br>  
 
+
{| cellspacing="1" cellpadding="1" border="1" style="text-align:center"
=== Digitmap  ===
+
 
+
Each [[NAP]] in the system can be assigned a routesets_digitmap [http://en.wikipedia.org/wiki/Comma-separated_values CSV] file. It is usual that all NAP uses the same routesets_digitmap file. A routesets_digitmap file gives the association between numbers and [[RouteSet|RouteSet]] names.
+
 
+
*Three mandatory columns: route_set_name, called and calling
+
 
+
  called,calling,routeset_name
+
403200,      ,"Calgary, AB"
+
514201,      ,"Montreal, Qc"
+
514202,      ,"Montreal, Qc"
+
514203,      ,"Montreal, Qc"
+
 
+
The [[NAP]] &lt;-&gt;&nbsp;Routeset Digitmap association is done&nbsp;by setting the [[NAP]] dynamic columns named 'routesets_digitmap'. &nbsp; This file must be imported in the database using the File Db view in the Toolpack Web Portal.
+
 
+
This implementation was tested with 1 million digitmap entries and the file can be gzipped to reduce size before importing it in the File Db.
+
 
+
<br>
+
 
+
== Dynamic Routes  ==
+
 
+
When provisioning is complete, dynamic routes can be generated by going in the Routetsets menu item, under Gateway menu Item.
+
 
+
{| width="200" cellspacing="1" cellpadding="1" border="0"
+
 
|-
 
|-
| valign="top" | [[Image:Routesets.png|left]]
+
! scope="col" | ''' Nb of digitmap entries '''
| valign="top" | [[Image:Generate routes.png|left]]
+
! scope="col" | ''' Uncompressed digitmap filesize '''
 +
! scope="col" | ''' Apply configuration time (s) '''<br>
 +
|-
 +
| Not used<br>
 +
| -<br>
 +
| ~6s<br>
 +
|-
 +
| 250k <br>
 +
| 4.4MB<br>
 +
| ~7s<br>
 +
|-
 +
| 500k <br>
 +
| 8.8MB<br>
 +
| ~8s<br>
 +
|-
 +
| 5M <br>
 +
| 88MB<br>
 +
| ~17s<br>
 
|}
 
|}
 
 
<br>  
 
<br>  
 +
Note that digit map files can be gzipped to reduce size before importing them in the File Db.
  
= How to setup Label Routing to create dynamic routes<br>  =
+
== Configuration  ==
 
+
*[[Toolpack:Call_Routes_Settings_D#Label_Routing|Label routing for v3.0]]
Setting up label routing is simple, since it is using pre-defined scripts, all available from the web portal. It is done in 8 steps:<br>
+
*[[Toolpack:Call_Routes_Settings_C#Label_Routing|Label routing for v2.10]]
 
+
*[[Toolpack:Call_Routes_Settings_B#Label_Routing|Label routing for v2.9]]
#Create default routing scripts and activate routeset script<br>
+
*[[Toolpack:Call_Routes_Settings_A#Label_Routing|Label routing for v2.8]]
#Create a new file repository (FileDb) for storing the Digitmap and Routeset definition files<br>
+
<div class="mw-collapsible mw-collapsed" data-collapsetext="other versions" data-expandtext="Click here for other versions" style="width: 400px;">
#Enable Label Routing script and File Db in Gateway configuration<br>
+
*[[Web_Portal_Tutorial_Guide_v2.7#Label_Routing|Label routing for v2.7]]
#Create Digitmap file and add it to the system<br>
+
*[[Web_Portal_Tutorial_Guide_v2.6#Label_Routing|Label routing for v2.6]]
#Create Routeset definition file and add it to the system<br>
+
#Associate NAPs with the Digitmap and Routeset definition files<br>
+
#Generate Dynamic Routing table<br>
+
#Activate Configuration<br>
+
 
+
<br>
+
 
+
=== 1. Create default routing scripts and activate routeset script<br> ===
+
 
+
From the Web portal go to <br>
+
<pre>Gateway -&gt; Routing Script -&gt; Create New Script
+
</pre>
+
*Name: Label_Routing<br>
+
*Select "Create default script files"
+
*Create<br>
+
 
+
To activate the routeset script:
+
 
+
*Click on "Examples Scripts"
+
*Edit "routesets_routing.rb"<br>
+
*Select "Load on Startup"
+
*Save<br>
+
 
+
[[Image:Load_on_startup.png]]
+
 
+
You must also deactivate the simple_routing script:
+
 
+
*Click on "Examples Scripts"
+
*Edit "simple_routing.rb"
+
*Unselect "Load on Startup"
+
*Save<br>
+
 
+
[[Image:Routeset_routing_enabled.png]]<br>
+
 
+
It is also possible to add the Label routing to any Routing Scripts this way:
+
 
+
[[Adding Label Routing to any Routing Script|Adding Label Routing to any Script]]  
+
 
+
<br>
+
 
+
== 2. Create a new file repository (FileDb) for storing the Digitmap and Routeset definition files<br>  ==
+
<pre>Gateway -&gt; FileDb -&gt; Create New File Db
+
</pre>
+
*Name: Route_file
+
*Create<br>
+
 
+
[[Image:Create_file_db.png]]<br>
+
 
+
== 3. Enable Label Routing script and File Db in Gateway configuration<br>  ==
+
<pre>Gateway -&gt; Configurations
+
 
+
Use Script -&gt; Label_Routing
+
 
+
FileDb -&gt; Route_file
+
</pre>
+
[[Image:Gateway_config_routeset_routing.png]]
+
 
+
== <br>4. Create Digitmap file and add it to the system<br>  ==
+
 
+
The Digitmap file is using CSV format. Create a file with the desired numbers (DIDs) for your system. For example:
+
<pre>called,calling,routeset_name
+
403200,      ,"Calgary, AB"
+
514201,      ,"Montreal, Qc"
+
514202,      ,"Montreal, Qc"
+
514203,      ,"Montreal, Qc"
+
</pre>
+
To add it to the system:<br>
+
<pre>Gateway -&gt; FileDb -&gt; Import New Digitmap
+
</pre>
+
Browse for your file and Import<br>
+
 
+
[[Image:Digitmap_association.png]]<br>
+
 
+
== 5. Create Routeset definition file and add it to the system<br>  ==
+
 
+
The Routeset definition file is also using CSV format. Create a file with the desired Labels and optional custom parameters:<br>
+
<pre>routeset_name, prio
+
"Montreal, Qc","2"
+
"Calgary, AB", "3"
+
</pre>
+
To add it to the system:  
+
<pre>Gateway -&gt; FileDb -&gt; Import New Digitmap</pre>
+
Browse for your file and Import
+
 
+
== <br>6. Associate NAPs with the Digitmap and Routeset definition files<br>  ==
+
 
+
Add the routesets digitmap and Routeset definition NAP dynamic columns
+
<pre>Gateway-&gt;Configurations-&gt;Naps menu</pre>  
+
*Click the 'Create New Nap Column' link
+
*Name = routesets_digitmap
+
*Type attributes = dbfile
+
*Create<br>
+
*Click the 'Create New Nap Column' link again<br>
+
 
+
*Name = routesets_definition
+
*Type attributes = dbfile
+
*Create<br>
+
 
+
Associate the NAPs with the definition files:
+
 
+
*Edit the NAP that will have the association
+
*Routesets_definition -&gt;&nbsp;Select routeset_definition
+
*Routesets_digitmap -&gt;&nbsp;Select Digitmap
+
*Save
+
 
+
[[Image:Associate_NAP_With_Files.png]]<br>
+
 
+
== 7. Generate Dynamic Routing table  ==
+
<pre>Gateway -&gt; Configurations -&gt; Routesets
+
</pre>
+
*Routing Database -&gt;&nbsp;Click on Generate
+
 
+
== 8. Activate Configuration<br>  ==
+
<pre>Systems -&gt; System_1 (Edit) -&gt; Activate Configuration
+
</pre>
+
<br>
+
 
+
= Increasing MySql limits =
+
In order to store big digitmap files, the configuration of the MySql server needs to be changed.
+
Edit the following file:
+
On windows:
+
c:\Program Files\MySQL\MySQL Server 5.1\my.ini
+
On linux:
+
/etc/my.cnf
+
 
+
Add the following variable under the [mysqld] section:
+
  max_allowed_packet = 200MB
+
  
Also add the following variable under the [mysqldump] section:
+
</div>
  max_allowed_packet = 200MB
+
  
Then shutdown and restart the MySql service.
+
== Useful links ==
 +
*[[Tmedia_Routing|Tmedia Routing]]

Latest revision as of 02:07, 10 February 2020

Label Routing is an algorithm that combines Digit Analyzer and the concept of RouteSet. It is implemented as a RoutingScript in Toolpack Gateway.  This algorithm allows complex routing rules, as normally available with RoutingScript, but on a very large number of destination numbers.


Contents

Concept

The concept behind label routing is quite simple.

  1. A list of numbers (NPA-NXX) for a specific destination is assigned a RouteSet name. This list can be very large
    1. i.e., 514201,514202,514203, ... -> Montreal_Qc
  2. The list of routes for the destination is assigned the same RouteSet name. This list usually is limited to the number of network access points (NAP) in the system.
    1. i.e., Bell, Rogers, Videotron -> Montreal_Qc


Note: No matter how many destination numbers lead to a given destination, only a limited list of routes are selected. At this point, complex, yet efficient, routing rules can take place.


Implementation

As previously mentioned, routeset (label) routing is implemented as a RoutingScript. It was written as an optional filter, and can be used in any existing scripts. This filter is a before_filter, and reduces the amount of routes the routing script will work with.


Performance

Typically, there are only a few hundred labels (e.g. countries/states/regions/providers/cities identifiers) but there are hundred thousands and millions of actual numbers pointing to those labels. Each label will correspond to a dynamic route associating it to a destination NAP. The biggest portion of the data comes from the digitmap files. These million digit maps are loaded into binary trees when a configuration is applied allowing longest match algorithm to be performed with constant delay regardless of the number of digit map entries in memory. The only performance impact is upon the "Apply configuration" time, not on the call processing flow. Here are a few samples of configuration loading time on a TMG3200 running release 2.7:

Nb of digitmap entries Uncompressed digitmap filesize Apply configuration time (s)
Not used
-
~6s
250k
4.4MB
~7s
500k
8.8MB
~8s
5M
88MB
~17s


Note that digit map files can be gzipped to reduce size before importing them in the File Db.

Configuration

Useful links

Personal tools