Fair Usage on MX Series Routers Configuration Wizard Configuration Overview
When you use the fair usage on MX Series routers configuration wizard, the wizard definition file specifies most of the SRC configuration. However, you must provide values for certain parameters in the configuration.
Fair Usage on MX Series Routers Configuration Wizard Definition File
The fair usage on MX Series routers configuration wizard definition file is an .xml file that controls the parameters of the wizard.
The following sample shows the definition file for the fair usage on MX Series routers configuration wizard. The first part of the definition file defines the dialog boxes you use to enter values specific to your environment. The next part of the definition file lists the SRC CLI set commands the wizard invokes.
This file is shown only for reference purposes. Modification of definition files is not supported.
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE cli SYSTEM "configuration-wizard.dtd"> <cli name="fair-usage-mx"> <help>Configure SRC for fair usage MX scenario</help> <step name="src-config"> <step name="src-host-parameters"> <caption>SRC host parameters</caption> <help>SRC host parameters</help> <description> This step collect SRC host parameters that will be used in configuration. The parameters are SRC host names, IP addresses and domain names. </description> <wiz-argument name="src-host-name" mandatory="true"> <help>SRC host name</help> <description>SRC host name.</description> </wiz-argument> <wiz-argument name="src-host-ip" mandatory="true" type="inet"> <help>SRC host IP address</help> <description>SRC host IP address used to communicate with diameter peers and VTA database.</description> </wiz-argument> <wiz-argument name="src-host-domain-name" mandatory="true"> <help>SRC host domain name</help> <description>SRC host domain name used as origin-realm for diameter.</description> </wiz-argument> </step> <step name="vta-db-host-parameters"> <caption>VTA database host and database parameters</caption> <help>VTA database host and database parameters</help> <description> This step collect VTA database host and database parameters that will be used in configuration. The parameters are VTA database host IP addresses, database connection user name and password. </description> <wiz-argument name="vta-database-ip" mandatory="true" type="inet"> <help>VTA database IP address</help> <description>The IP address of the host where VTA database runs.</description> </wiz-argument> <wiz-argument name="vta-database-user" mandatory="true"> <help>VTA database connection user name</help> <description>The user name for VTA to connect to VTA database.</description> </wiz-argument> <wiz-argument name="vta-database-passwd" mandatory="true" type="passwd"> <help>VTA database connection password</help> <description>The password for VTA to connect to VTA database.</description> </wiz-argument> </step> <step name="router-host-parameters"> <caption>Router host parameters</caption> <help>Router host parameters</help> <description> This step collect router host parameters that will be used in configuration. The parameters are router host names, IP addresses and domain names. </description> <wiz-argument name="mx-router-name" mandatory="true"> <help>Router host name</help> <description>Router host name used as diameter peer origin-host and SRC network device name.</description> </wiz-argument> <wiz-argument name="mx-router-ip" mandatory="true" type="inet"> <help>Router IP address</help> <description>Router IP address used for diameter and SRC network device address.</description> </wiz-argument> <wiz-argument name="mx-router-domain-name" mandatory="true"> <help>Router domain name</help> <description>Router domain name used as diameter peer origin-realm.</description> </wiz-argument> <configuration> set system diameter active-peers set system diameter local-address {src-config src-host-parameters src-host-ip} set system diameter origin-host {src-config src-host-parameters src-host-name} set system diameter origin-realm {src-config src-host-parameters src-host-domain-name} set system diameter port 3868 set system diameter protocol tcp set shared network diameter peer {src-config router-host-parameters mx-router-name} active-peer set shared network diameter peer {src-config router-host-parameters mx-router-name} address {src-config router-host-parameters mx-router-ip} set shared network diameter peer {src-config router-host-parameters mx-router-name} connect-timeout 10 set shared network diameter peer {src-config router-host-parameters mx-router-name} origin-host {src-config router-host-parameters mx-router-name} set shared network diameter peer {src-config router-host-parameters mx-router-name} port 3868 set shared network diameter peer {src-config router-host-parameters mx-router-name} protocol tcp set shared network device {src-config router-host-parameters mx-router-name} description 'A MX fair usage device' set shared network device {src-config router-host-parameters mx-router-name} device-type junos-ise set shared network device {src-config router-host-parameters mx-router-name} management-address {src-config router-host-parameters mx-router-ip} set shared network device {src-config router-host-parameters mx-router-name} origin-host {src-config router-host-parameters mx-router-name} set shared network device {src-config router-host-parameters mx-router-name} peers {src-config router-host-parameters mx-router-name} set shared network device {src-config router-host-parameters mx-router-name} virtual-router * sae-connection {src-config src-host-parameters src-host-ip} set policies folder fair-usage-ise group MXCaptivePolicy list captive-list applicability both set policies folder fair-usage-ise group MXCaptivePolicy list captive-list role junos-ise set policies folder fair-usage-ise group MXCaptivePolicy list captive-list rule rule-1 type junos-ise set policies folder fair-usage-ise group MXCaptivePolicy list captive-list rule rule-1 dynamic-profile profile-name src_driven_captive_profile set policies folder fair-usage-ise group MXQuotaPolicy description 'Quota Policy' set policies folder fair-usage-ise group MXQuotaPolicy list quota_list applicability both set policies folder fair-usage-ise group MXQuotaPolicy list quota_list role junos-ise set policies folder fair-usage-ise group MXQuotaPolicy list quota_list rule rule-1 accounting set policies folder fair-usage-ise group MXQuotaPolicy list quota_list rule rule-1 type junos-ise set policies folder fair-usage-ise group MXQuotaPolicy list quota_list rule rule-1 dynamic-profile profile-name src_driven_quota_profile set policies folder fair-usage-ise group MXQuotaPolicy list quota_list rule rule-1 dynamic-profile variables input type any set policies folder fair-usage-ise group MXQuotaPolicy list quota_list rule rule-1 dynamic-profile variables input value ingress_filter_to_use set policies folder fair-usage-ise group MXQuotaPolicy list quota_list rule rule-1 dynamic-profile variables output type any set policies folder fair-usage-ise group MXQuotaPolicy list quota_list rule rule-1 dynamic-profile variables output value egress_filter_to_use set policies folder fair-usage-ise group MXQuotaPolicy local-parameters egress_filter_to_use type any set policies folder fair-usage-ise group MXQuotaPolicy local-parameters ingress_filter_to_use type any set services global service MXQuotaInternet accounting-interim-interval 600 set services global service MXQuotaInternet available set services global service MXQuotaInternet category Internet set services global service MXQuotaInternet description 'MX quota high speed service, supposed to be used as VTA behaving service' set services global service MXQuotaInternet policy-group /fair-usage-ise/MXQuotaPolicy set services global service MXQuotaInternet radius-class MXQuotaInternet set services global service MXQuotaInternet status active set services global service MXQuotaInternet tracking-plug-in quotavta set services global service MXQuotaInternet type normal set services global service MXQuotaLowSpeed accounting-interim-interval 600 set services global service MXQuotaLowSpeed available set services global service MXQuotaLowSpeed category Internet set services global service MXQuotaLowSpeed description 'MX quota low speed service, supposed to be used as VTA misbehaving service' set services global service MXQuotaLowSpeed policy-group /fair-usage-ise/MXQuotaPolicy set services global service MXQuotaLowSpeed radius-class MXQuotaInternet set services global service MXQuotaLowSpeed status active set services global service MXQuotaLowSpeed tracking-plug-in quotavta set services global service MXQuotaLowSpeed type normal set services global service MXCaptive available set services global service MXCaptive description 'MX captive service, supposed to be used as VTA misbehaving service' set services global service MXCaptive policy-group /fair-usage-ise/MXCaptivePolicy set services global service MXCaptive radius-class MXCaptive set services global service MXCaptive status active set services global service MXCaptive tracking-plug-in quotavta set services global service MXCaptive type normal set subscribers retailer fair-usage-mx domain-name fair-usage-mx.com set subscribers retailer fair-usage-mx subscriber-folder local subscriber quota-subscriber-1 common-name One set subscribers retailer fair-usage-mx subscriber-folder local subscriber quota-subscriber-1 surname Quotasubscriber set subscribers retailer fair-usage-mx subscriber-folder local subscriber quota-subscriber-1 subscription MXCaptive activation manual set subscribers retailer fair-usage-mx subscriber-folder local subscriber quota-subscriber-1 subscription MXCaptive status active set subscribers retailer fair-usage-mx subscriber-folder local subscriber quota-subscriber-1 subscription MXQuotaInternet activation automatically-on-login set subscribers retailer fair-usage-mx subscriber-folder local subscriber quota-subscriber-1 subscription MXQuotaInternet status active set subscribers retailer fair-usage-mx subscriber-folder local subscriber quota-subscriber-1 subscription MXQuotaInternet substitution [ 'egress_filter_to_use=\"10m-service\"' 'ingress_filter_to_use=\"10m-service\"' ] set subscribers retailer fair-usage-mx subscriber-folder local subscriber quota-subscriber-1 subscription MXQuotaLowSpeed activation manual set subscribers retailer fair-usage-mx subscriber-folder local subscriber quota-subscriber-1 subscription MXQuotaLowSpeed status active set subscribers retailer fair-usage-mx subscriber-folder local subscriber quota-subscriber-1 subscription MXQuotaLowSpeed substitution [ 'egress_filter_to_use=\"256k-service\"' 'ingress_filter_to_use=\"256k-service\"' ] set slot 0 nic scenario-name OnePopLogin set slot 0 nic snmp-agent set slot 0 sae shared /SAE/fair-usage set shared sae group fair-usage configuration plug-ins name quotavta ejb-adaptor jndi-sae-event-listener vta-Quota/SAEEventListenerBean set shared sae group fair-usage configuration plug-ins name quotavta ejb-adaptor application-server-url {src-config src-host-parameters src-host-ip}:1099 set shared sae group fair-usage configuration plug-ins name quotavta ejb-adaptor ejb-clustering-strategy EJBObjectClustering set shared sae group fair-usage configuration plug-ins name quotavta ejb-adaptor jndi-service-provider org.jnp.interfaces.NamingContextFactory set shared sae group fair-usage configuration plug-ins name nic external corba-object-reference corbaname::{src-config src-host-parameters src-host-ip}:2809/NameService#nicsae/saePort set shared sae group fair-usage configuration plug-ins event-publishers subscriber-tracking [fileAcct quotavta nic ] set shared sae group fair-usage configuration plug-ins event-publishers service-tracking [fileAcct quotavta ] set shared sae group fair-usage subscriber-classifier rule rule-mx target uniqueID=quota-subscriber-1,ou=local,retailerName=fair-usage-mx,o=Users,o=umc set shared sae group fair-usage subscriber-classifier rule rule-mx condition nasPortId==ge-* insert shared sae group fair-usage subscriber-classifier rule rule-mx before rule-1 set slot 0 application-server web virtual-host eth0 alias [ {src-config src-host-parameters src-host-name} {src-config src-host-parameters src-host-ip} ] set shared vta group Quota nic-proxy IdToSaeNicProxy set shared vta group fairusage subscriber-id-solution login-name set shared vta group fairusage action CalcUsage function db-engine-calculate-usage set shared vta group fairusage action CalculateInterim function db-engine-calculate-interim set shared vta group fairusage action DebitAccounts function db-engine-update-accounts set shared vta group fairusage action DebitAccounts parameter script-name DebitQuotaUsage set shared vta group fairusage action GetAccountBalances function db-engine-get-accounts set shared vta group fairusage action SetInterim function sae-set-interim-interval set shared vta group fairusage action SetInterim parameter current-subscriber-only set shared vta group fairusage action StartCaptiveService function sae-start-service set shared vta group fairusage action StartCaptiveService parameter current-subscriber-only set shared vta group fairusage action StartCaptiveService parameter subscription-name MXCaptive set shared vta group fairusage action StartQuotaInternetService function sae-start-service set shared vta group fairusage action StartQuotaInternetService parameter current-subscriber-only set shared vta group fairusage action StartQuotaInternetService parameter subscription-name MXQuotaInternet set shared vta group fairusage action StartQuotaLowSpeedService function sae-start-service set shared vta group fairusage action StartQuotaLowSpeedService parameter current-subscriber-only set shared vta group fairusage action StartQuotaLowSpeedService parameter subscription-name MXQuotaLowSpeed set shared vta group fairusage action StopQuotaInternetService function sae-stop-service set shared vta group fairusage action StopQuotaInternetService parameter current-subscriber-only set shared vta group fairusage action StopQuotaInternetService parameter subscription-name MXQuotaInternet set shared vta group fairusage action StopQuotaLowSpeedService function sae-stop-service set shared vta group fairusage action StopQuotaLowSpeedService parameter current-subscriber-only set shared vta group fairusage action StopQuotaLowSpeedService parameter subscription-name MXQuotaLowSpeed set shared vta group fairusage action TerminateSession function db-engine-terminate-session set shared vta group fairusage database check-valid-connection-sql 'select 1' set shared vta group fairusage database connection-url jdbc:mysql://{src-config vta-db-host-parameters vta-database-ip}:3306/quotavta set shared vta group fairusage database datasource-mapping mySQL set shared vta group fairusage database driver-class com.mysql.jdbc.Driver set shared vta group fairusage database max-pool-size 50 set shared vta group fairusage database min-pool-size 5 set shared vta group fairusage database password {src-config vta-db-host-parameters vta-database-passwd} set shared vta group fairusage database user-name {src-config vta-db-host-parameters vta-database-user} set shared vta group fairusage event-handler GetQuota actions GetAccountBalances set shared vta group fairusage event-handler GetQuota events [ service-start:MXQuotaInternet service-start:MXQuotaLowSpeed service-interim:MXQuotaInternet service-interim:MXQuotaLowSpeed service-stop:MXQuotaInternet service-stop:MXQuotaLowSpeed account-update ] set shared vta group fairusage event-handler GetQuota priority 1 set shared vta group fairusage event-handler RecordUsage actions [ CalcUsage DebitAccounts ] set shared vta group fairusage event-handler RecordUsage events [ service-interim:MXQuotaInternet service-interim:MXQuotaLowSpeed service-stop:MXQuotaInternet service-stop:MXQuotaLowSpeed ] set shared vta group fairusage event-handler RecordUsage priority 5 set shared vta group fairusage event-handler SetInterim actions [ CalculateInterim SetInterim ] set shared vta group fairusage event-handler SetInterim condition 'return <balance_PeriodicQuota>+<balance_BoughtQuota>>0;' set shared vta group fairusage event-handler SetInterim events [ service-start:MXQuotaInternet service-start:MXQuotaLowSpeed service-interim:MXQuotaInternet service-interim:MXQuotaLowSpeed ] set shared vta group fairusage event-handler SetInterim priority 10 set shared vta group fairusage event-handler NoQuota actions [ StopQuotaInternetService StartQuotaLowSpeedService ] set shared vta group fairusage event-handler NoQuota condition 'return <balance_PeriodicQuota>+<balance_BoughtQuota><=0;' set shared vta group fairusage event-handler NoQuota events [ service-start:MXQuotaInternet service-interim:MXQuotaInternet ] set shared vta group fairusage event-handler NoQuota priority 15 set shared vta group fairusage event-handler QuotaRefilled actions [ StopQuotaLowSpeedService StartQuotaInternetService ] set shared vta group fairusage event-handler QuotaRefilled condition 'var newBalance=<balance_BoughtQuota>+<balance_PeriodicQuota>;\n if(<old_balance_PeriodicQuota>==null) <old_balance_PeriodicQuota>=<balance_PeriodicQuota>;\n if(<old_balance_BoughtQuota>==null) <old_balance_BoughtQuota>=<balance_BoughtQuota>;\n return <old_balance_PeriodicQuota>+<old_balance_BoughtQuota><=0&
&newBalance>0;' set shared vta group fairusage event-handler QuotaRefilled events account-update set shared vta group fairusage event-handler QuotaRefilled priority 20 set shared vta group fairusage event-handler EndofBilling actions TerminateSession set shared vta group fairusage event-handler EndofBilling events callback:TERMINATESESSION set shared vta group fairusage event-handler EndofBilling priority 25 set shared vta group fairusage processor db-engine record-balance-change set shared vta group fairusage processor db-engine account BoughtQuota initial-balance 0 set shared vta group fairusage processor db-engine account BoughtQuota initial-status Inactive set shared vta group fairusage processor db-engine account PeriodicQuota initial-balance 100000000000 set shared vta group fairusage processor db-engine account PeriodicQuota initial-status Active set shared vta group fairusage processor db-engine account-update-script DebitQuotaUsage script ' var newPeriodicBalance=0;\n var newBoughtBalance=0;\n if(<currentUsage>=<balance_PeriodicQuota>){\n newPeriodicBalance=<balance_PeriodicQuota>-<currentUsage>;\n newBoughtBalance=<balance_BoughtQuota>;\n }\n else if(<currentUsage><=(<balance_PeriodicQuota>+<balance_BoughtQuota>)){\n newBoughtBalance=<balance_BoughtQuota>-(<currentUsage>
-<balance_PeriodicQuota>);\n newPeriodicBalance=0;\n }\n if(newPeriodicBalance!=<balance_PeriodicQuota>){\n <balance_PeriodicQuota>=newPeriodicBalance;\n <lastUpdateTime_PeriodicQuota>=<currentTime>;\n }\n if(newBoughtBalance!=<balance_BoughtQuota>){\n <balance_BoughtQuota>=newBoughtBalance;\n <lastUpdateTime_BoughtQuota>=<currentTime>;\n }' set shared vta group fairusage processor db-engine service MXQuotaInternet interim-interval-function 'return Math.min(7200,Math.max(900, (<balance_PeriodicQuota>+<balance_BoughtQuota>)/250000));' set shared vta group fairusage processor db-engine service MXQuotaInternet usage-metric-function 'return Math.min(7200,Math.max(900, (<balance_PeriodicQuota>+<balance_BoughtQuota>)/250000));' set shared vta group fairusage processor db-engine service MXQuotaLowSpeed interim-interval-function 'return Math.min(7200,Math.max(900, (<balance_PeriodicQuota>+<balance_BoughtQuota>)/250000));' set shared vta group fairusage processor db-engine service MXQuotaLowSpeed usage-metric-function 'return Math.min(7200,Math.max(900, (<balance_PeriodicQuota>+<balance_BoughtQuota>)/250000));' set shared vta group fairusage queue max-concurrency 50 set shared vta group fairusage queue max-queue-size 100000 </configuration> </step> </step> </cli>
The following sections describe which parameters are predefined by the wizard and which parameters require your input.
Configuration Provided by the Fair Usage on MX Series Routers Configuration Wizard
The fair usage on MX Series routers configuration wizard configures the SRC components and configuration trees described in Table 1. Most of the SRC configuration is defined by the wizard definition file. Some parameters are configured based on your inputs to the configuration wizard interface.
Table 1: SRC Configuration Parameters Supplied by the Fair Usage on MX Series Routers Configuration Wizard
SRC Component or Configuration Tree | Description |
---|---|
Web application server (appsvr) | The wizard configures the Web application server, web virtual host eth0 alias, based on the input you provide for the src-host-name and src-host-ip parameters. |
Diameter application | The wizard configures the Diameter application based on the values you enter for the following SRC host parameters in the wizard interface:
|
Diameter peer | The wizard configures the Diameter peer parameters for the MX Series router based on the values you enter for the following router host parameters:
For the connection to the Diameter peer, the wizard uses TCP, port 3868, and specifies the connection as active. |
NIC | The wizard configures the NIC to use the OnePopLogin scenario. |
SAE | The wizard uses the SAE group name “fair-usage”, which must exist before invoking the wizard. If the group “fair-usage” does not exist, you must create it by committing set slot 0 sae shared /SAE/fair-usage. Because the wizard uses a single-step configuration commit process, it is not possible to commit the local and shared SAE configurations simultaneously. The wizard configures the following parameters for the SAE:
|
VTA | Services—The wizard configures an SRC VTA group called “fair-usage” and two services. The high-speed service, called MXQuotaInternet, operates at 10 Mbps and is activated when the subscriber logs in. The MXQuotaInternet service continues to run until the subscriber’s quota is exhausted. When the quota is exhausted, the subscriber is switched to the low-speed service called MXQuotaLowSpeed, which operates at 256 Kbps. The real service behavior depends on the MX Series router firewall filter configuration. External MySQL database—The wizard requires an external MySQL database, which you must configure. The wizard configures basic parameters for the external database based on the values you specify in the wizard VTA database host and database parameters dialog box. The database connection-url is based on the value you enter for the vta-database-ip parameter. The username and password are based on the values you enter for vta-database-user and vta-database-pass. If you want to use a database other than MySQL, you must customize the configuration using the SRC CLI after you commit the configuration using the wizard. SRC VTA NIC proxy—The wizard uses the IdToSaeNicProxy NIC proxy, which uses the subscriber ID to locate the SAE when NIC resolution is needed. The wizard also configures the NIC to use the OnePopLogin scenario. Event Handlers—The wizard configures event handlers so that when there is no quota left for a subscriber, its MXQuotaInternet service is stopped and the MXQuotaLowSpeed service is started. When the subscriber’s quota is refilled, the MXQuotaLowSpeed service is stopped and the MXQuotaInternet service is restarted. db-engine processor—The wizard configures the db-engine processor with some initial balance in the PeriodQuota account. The SRC VTA quota account is debited according to the DebitQuotaUsage script. Actions—The wizard configures actions to retrieve account balances, debit accounts, calculate usage, and start and stop services. |
Policies | The wizard creates a policy folder named “fair-usage-ise” and two policies. The service policy named “MXQuotaPolicy” uses a dynamic profile named “src_driven_quota_profile”. The policy named “MXCaptivePolicy” uses a dynamic profile named “src_driven_captive_profile.” |
Services | The wizard configures two services. The high-speed service, called MXQuotaInternet, operates at 10 Mbps and is activated when the subscriber logs in. The MXQuotaInternet service continues to run until the subscriber’s quota is exhausted. When the quota is exhausted, the subscriber is switched to the low-speed service called MXQuotaLowSpeed, which operates at 256 Kbps. Both of the services use quota as the tracking plug-in. |
Subscribers | The wizard configures one subscriber named “quota-subscriber-1” that subscribes to both the MXQuotaInternet and the MXQuotaLowSpeed services. |
shared network device (configuration tree) | The shared network device configuration tree sets up the MX Series router so that it can be managed by the SAE. The wizard specifies the router as a junos-ise type device and adds “A MX fair usage device” as the device description. The management-address assigned by the wizard is based on the value you enter for the mx-router-ip parameter. The origin-host assigned by the wizard is based on the value you enter for the mx-router-name parameter. The wizard specifies the router as a peer to the SAE based on the value you enter for the mx-router-name. The wizard specifies the IP address of the SAE that manages the router based on the value you enter for the src-host-ip parameter. |
Required Input Parameters for the Fair Usage on MX Series Routers Configuration Wizard
The fair usage on MX Series routers configuration wizard requires you to input certain parameters that are specific to your environment. When you run the wizard, you are prompted to enter these parameters. Table 2 describes these parameters in detail.
Table 2: Input Parameters Required by the Fair Usage on MX Series Routers Configuration Wizard
Type of Parameters | Parameters |
---|---|
SRC host parameters |
|
Database host and database parameters used by the SRC VTA | The wizard configures the SRC VTA component to use an external MySQL database, but it does not configure the external database. You must deploy the database on a separate host and create the database by using the “vta-database-mysql.sql” file, which is included with the SRC software. The wizard requires you to enter the following parameters for the external database used by the SRC VTA:
|
Router host parameters | The wizard does not configure the MX Series router. The wizard prompts you to enter values to define the MX Series router as a Diameter peer. The wizard requires you to enter the following parameters for the router host:
You must manually configure the rest of the configuration for the MX Series router. Certain router configuration parameters, such as dynamic profiles, must be consistent between the SRC configuration and the router configuration. The MX Series router configuration described in this section is for reference only. A sample MX Series router configuration that can work with the
SRC configuration created by the fair usage on MX Series routers configuration
wizard is provided in a text file in the format of the Junos OS configuration.
The sample configuration contains everything under the fair-usage
group. The configuration configures IP dynamic interfaces for Dynamic
Host Configuration Protocol (DHCP) access. You must edit the interface
names that are used for DHCP access in this sample configuration.
The sample configuration file is |