Label Routing

From TBwiki
(Difference between revisions)
Jump to: navigation, search
(6. Associate NAPs with the Digitmap and Routeset definition files)
(move configuration content to web portal tutorial guide)
Line 77: Line 77:
 
<br>  
 
<br>  
  
= How to setup Label Routing to create dynamic routes<br> =
+
== Configuration ==
  
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>
+
[[Web_Portal_Tutorial_Guide_v2.6#Label_Routing|Configuration v2.6]]
 
+
#Create default routing scripts and activate routeset script<br>
+
#Create a new file repository (FileDb) for storing the Digitmap and Routeset definition files<br>
+
#Enable Label Routing script and File Db in Gateway configuration<br>
+
#Create Digitmap file and add it to the system<br>
+
#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:
+
  max_allowed_packet = 200MB
+
 
+
Then shutdown and restart the MySql service.
+

Revision as of 08:58, 11 December 2012

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.


Provisioning

Provisioning of large amounts of Routeset definition and digitmaps is accomplished by importing CSV files using the WebPortal.  Those files are being saved in the HA Database.


Routeset Definition

Each NAP in the system must be assigned a routesets_definition CSV file. A routesets_definition file gives the association between NAP and RouteSet names. The association between a NAP and a RouteSet name is in fact a route! ie: Rogers->"Montreal, Qc" Thus, for each RouteSet name<->NAP association, a dynamic route entry gets created.


The routesets_definition file defines a list of RouteSet names, with optional attributes.

  • 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.


The NAP <-> Routeset Definition association is done by setting the NAP dynamic columns named 'routesets_definition'.  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.


Digitmap

Each NAP in the system can be assigned a routesets_digitmap 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 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 <-> Routeset Digitmap association is done by setting the NAP dynamic columns named 'routesets_digitmap'.   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.


Dynamic Routes

When provisioning is complete, dynamic routes can be generated by going in the Routetsets menu item, under Gateway menu Item.

Routesets.png
Generate routes.png


Configuration

Configuration v2.6

Personal tools