en:dpi:dpi_bestpractice:qs_rateplans [Документация VAS Experts]

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
en:dpi:dpi_bestpractice:qs_rateplans [2020/08/26 10:43] lexx26en:dpi:dpi_bestpractice:qs_rateplans [2023/08/28 14:52] (current) – removed elena.krasnobryzh
Line 1: Line 1:
-====== 3 Quick start: share the channel between subscribers according to their plans ====== 
-{{indexmenu_n>3}} 
-====== Introduction ====== 
-This manual is a step by step instruction on configuring one of the ways to integrate the VAS Experts DPI with billing in order to support an interaction with subscribers billing plans.\\ 
-**Note:** the manual is suitable for version [[en:dpi:dpi_components:platform:dpi_update:start|2.1 "Polar Bear"]] and higher. 
-====== Subscriber's bandwidth control according to the billing plan ====== 
-We use an option [[en:dpi:dpi_options:opt_bandwidth_mgmt:start|Channel sharing between subscribers]] to set the subscriber's bandwidth according to his billing plan. 
- 
-1. We create the file with protocols' groups description that we intend to exclude from the common traffic and their assigned priorities /etc/dpi/protocols.dscp 
- 
-First, we make a file protocols.txt 
-<code> 
-  http    cs0 
-  https   cs0 
-  dns     cs0 
-  default cs1 
-</code> 
-Here 
-cs0 - corresponds to priority 0 and class 0 respectively\\ 
-cs1 - to priority 1, class1\\ 
-The classes defined in this way can be used in billing plans descriptions. They allow to set up individual limitations for them. Additionally, the prioritization of protocols within a bandwidth will be arranged according to these classes. 
- 
-Second, convert it to dscp format that DPI can read: 
-<code> 
-cat protocols.txt|lst2dscp /etc/dpi/protocols.dscp 
-</code> 
- 
-2. We create a configuration file that describes subscriber's parameters for DPI for each of the billing plans. It is convenient to use the same name for the billing plan in billing and for DPI configuration file that defines settings for this plan. 
- 
-For example: settings for billing plan 10 Mb. The billing name is "rate_10M". 
- 
-First, we create a file rate_10M.cfg: 
-<code> 
-htb_inbound_root=rate 10mbit 
-htb_inbound_class0=rate 1mbit ceil 10mbit 
-htb_inbound_class1=rate 1mbit ceil 10mbit 
-htb_inbound_class2=rate 8bit ceil 10mbit 
-htb_inbound_class3=rate 8bit ceil 10mbit 
-htb_inbound_class4=rate 8bit ceil 10mbit 
-htb_inbound_class5=rate 8bit ceil 10mbit 
-htb_inbound_class6=rate 8bit ceil 10mbit 
-htb_inbound_class7=rate 8bit ceil 10mbit 
-htb_root=rate 10mbit 
-htb_class0=rate 1mbit ceil 10mbit 
-htb_class1=rate 1mbit ceil 10mbit 
-htb_class2=rate 8bit ceil 10mbit 
-htb_class3=rate 8bit ceil 10mbit 
-htb_class4=rate 8bit ceil 10mbit 
-htb_class5=rate 8bit ceil 10mbit 
-htb_class6=rate 8bit ceil 10mbit 
-htb_class7=rate 8bit ceil 10mbit 
-</code> 
-Notes: 
-   * htb_class2-7 - are not used as they are not defined. The upper limit is indicated for a future just in case they would be defined; 
-   * 8 bit - is the minimal bandwidth. 0 is prohibited to use here, this value is reserved. 
- 
-3. We connect subscribers' [[en:dpi:dpi_components:platform:dpi_admin:admin_db:start#Activating the built-in database|database UDR]] in order to preserve our settings (to be made later) on DPI reboot. 
-<code> 
-udr=1 
-</code> 
-and restart DPI. 
- 
-4. Now we integrate DPI with billing: 
- 
-The integration method depends on billing's ability to control equipment by events or not.  
- 
-4а. Billing can control equipment by events: creation of a new subscriber, billing plan change, blocking. 
- 
-In this case: we select the equipment controlled by SSH/RSH((The additional SW compatible with OS Linux can be installed on DPI. It allows to expand remote control capabilities: for example telnet server.)) or by execution of local scripts. Then we add the commands to attach or change a billing plan into configurations of the respective commands or scripts: 
-<code> 
-fdpi_ctrl load --policing ${rateplan}.cfg --ip ${ip_address} 
-или 
-fdpi_ctrl load --policing ${rateplan}.cfg --login ${login} 
-</code> 
-Here 
-${rateplan} - is the variable: billing assigns it the subscriber's billing plan name: rate_10M\\ 
-${ip_address} - billing assigns here IP address 192.168.0.1 of the subscriber (for subscribers with a fixed IP)\\ 
-${login} - billing assigns here login name of the subscriber dom1kv2 (for subscribers with dynamic IP, multiple IPs or in case we control by login) 
- 
-4b. Billing can not control equipment by events. 
- 
-We configure a scheduled output of data from billing by crontab. The list of subscribers with respective billing plan is saved to files named as  billing_plan_name.lst. This list may contain IP or login. Then we start loading of these data into DPI. 
-<code> 
-fdpi_ctrl load --policing rate_10M.cfg --file rate_10M.lst 
-fdpi_ctrl load --policing rate_20M.cfg --file rate_20M.lst 
-... 
-or (for all at once) 
-for rateplan in *.cfg; do fdpi_ctrl load --policing "$rateplan" --file "${rateplan%%.*}".lst; done 
-</code> 
- 
-==== Subscriber's blocking by negative balance of his account and his placing into Captive Portal is arranged similarly. The Captive Portal allows to charge the subscriber's account. ==== 
- 
-5. We create a description of the billing plan blocked.cfg for restricted or blocked subscribers. Only cs0 traffic is allowed (check the list in paragraph 1): 
-<code> 
-htb_inbound_root=rate 10mbit 
-htb_inbound_class0=rate 10mbit ceil 10mbit 
-htb_inbound_class1=rate 8bit ceil 8bit 
-htb_inbound_class2=rate 8bit ceil 8bit 
-htb_inbound_class3=rate 8bit ceil 8bit 
-htb_inbound_class4=rate 8bit ceil 8bit 
-htb_inbound_class5=rate 8bit ceil 8bit 
-htb_inbound_class6=rate 8bit ceil 8bit 
-htb_inbound_class7=rate 8bit ceil 8bit 
-htb_root=rate 10mbit 
-htb_class0=rate 10mbit ceil 10mbit 
-htb_class1=rate 8bit ceil 8bit 
-htb_class2=rate 8bit ceil 8bit 
-htb_class3=rate 8bit ceil 8bit 
-htb_class4=rate 8bit ceil 8bit 
-htb_class5=rate 8bit ceil 8bit 
-htb_class6=rate 8bit ceil 8bit 
-htb_class7=rate 8bit ceil 8bit 
-</code> 
- 
-6. Next, we create a list of sites that are available in Captive Portal mode. We can skip this step in case only the own portal pages are available. Please find more details in description of [[en:dpi:dpi_options:opt_capture:start|"White list"]] option. 
- 
-7. We indicate the name or the address of the Captive Portal in configuration file /etc/dpi/fastdpi.cfg 
-<code> 
-cp_server=192.168.0.1 
-</code> 
-Next, we restart DPI: service fastdpi restart 
- 
-8. To place a subscriber into Captive Portal(( In case the events based control is not supported: we save lists of blocked and unblocked subscribers into files blocked.lst and unblocked.lst)) 
-<code> 
-fdpi_ctrl load --policing blocked.cfg --ip ${ip_address} 
-fdpi_ctrl load --service 5 --ip ${ip_address} 
-</code> 
- 
-9. Here we disactivate Captive Portal and restore his billing plan after receiving his payment: 
- 
-<code> 
-fdpi_ctrl load --policing ${rateplan}.cfg --ip ${ip_address} 
-fdpi_ctrl del --service 5 --ip ${ip_address} 
-</code> 
- 
-~~DISCUSSION|Please help us to improve our documentation. Let us know if you found an error or something is unclear.~~