This section describes the concept of XPL, the paragraph editing interface, set and route-filter configuration steps, and XPL clauses.
Extended routing-policy language (XPL) is a language used to filter routes and modify route attributes. By modifying route attributes (including reachability), XPL changes the path through which network traffic passes. XPL provides the same functions as routing policies do, but it uses different editing and filtering methods from routing policies. Therefore, XPL can meet different customer requirements.
Table 1 compares XPL and routing policies.
Item |
Key Functions |
Editing Method |
Filtering Method |
User Experience |
---|---|---|---|---|
XPL |
Filters routes and modifies route attributes. |
Line-by-line or paragraph-by-paragraph editing |
Uses sets or single elements to filter routes. |
Users can configure or modify policies as required in a text editor. |
Routing policies |
Filter routes and modify route attributes. |
Line-by-line editing |
Use filters or single elements to filter routes. |
Users must follow strict command configuration rules. |
For details about routing policies, see "Routing Policies" in HUAWEI NetEngine 8000 F SeriesRouter Feature Description — IP Routing.
XPL supports line-by-line editing and paragraph-by-paragraph editing, whereas routing policies support line-by-line editing only. Line-by-line editing is a traditional configuration method, whereas paragraph-by-paragraph editing is an innovative configuration method. Table 2 compares the two methods.
Item |
Applicable to |
Differences |
Help and Error Correction Mechanisms |
---|---|---|---|
Line-by-line editing |
Users who are used to the traditional configuration method or unfamiliar with XPL |
Each command is run in a command view, and one command is presented in one line, which is considered a configuration unit. NOTE:
To modify an existing global variable set, route attribute set, or route-filter through line-by-line editing, enter the specific command view and reconfigure the set or policy. |
The desired command can be suggested using the command association function. If any configuration error occurs, it is reported after the command is configured. |
Paragraph-by-paragraph editing |
Users who are familiar with XPL clause configuration and want to simplify the configuration process |
The paragraph editing UI functions as a text editor, in which users edit XPL clauses. The XPL clauses are committed after a paragraph of them are configured, and each paragraph is considered a configuration unit. |
The command association function is not supported, and complete clauses must be entered in the paragraph editing UI. If any configuration error occurs, it is reported after the configurations of the whole paragraph are committed. |
This section does not detail the line-by-line editing. For details about it, see the set or route-filter configuration process. During line-by-line editing of a set or route-filter, you can run the abort command to cancel the configurations that have not been committed in the current view and return to the system view or run the display this candidate command to check the configurations that have not been committed in the current view.
Paragraph-by-paragraph editing is described in terms of Paragraph Editing Interface and Configuration Procedures of Sets and Route-Filters Using the Paragraph Editing Mode. For details about XPL paragraph editing clauses, see XPL Paragraph Editing Clauses.
The paragraph editing interface functions as a text editor, in which users can edit XPL clauses to configure or modify sets and route-filters.
Common shortcut keys
Shortcut keys can be used in the paragraph editing interface. Table 3 lists common shortcut keys and their functions.
Shortcut Key |
Function |
---|---|
i |
Enters the text editing mode. Sets or route-filters can be configured only in the text editing mode. |
Esc |
Exits from the text editing mode. |
:q! |
Exits from the paragraph editing interface view without saving configurations.
NOTE:
The shortcut key takes effect only after Enter is pressed. |
:wq |
Saves configurations and exits from the paragraph editing interface view.
NOTE:
The shortcut key takes effect only after Enter is pressed. |
Paragraph editing interface views
The following lists the different paragraph editing interface views and the commands used to access them:
Regular expression matching is intensive processing of CPU computing. When a large number of regular expressions are configured in an XPL policy to match a BGP route attribute and the length of the route attribute is long, the processing performance of the XPL policy deteriorates. To improve the processing performance of the routing policy, decrease the number of regular expressions or use a non-regular expression matching command.
It is recommended that a maximum of 100 regular expressions be configured for each policy.
Regular expression matching is intensive processing of CPU computing. When a large number of regular expressions are configured in an XPL policy to match a BGP route attribute and the length of the route attribute is long, the processing performance of the XPL policy deteriorates. To improve the processing performance of the routing policy, decrease the number of regular expressions or use a non-regular expression matching command.
It is recommended that a maximum of 100 regular expressions be configured for each policy.
The regular-expression can be set to a character string in either the aa:nn format or integer format. For example:
The regular ^1:1$ configuration matches routes that carry the community value of 65537 or 1:1.
The regular ^65537$ configuration also matches routes that carry the community value of 65537 or 1:1.
Regular expression matching is intensive processing of CPU computing. When a large number of regular expressions are configured in an XPL policy to match a BGP route attribute and the length of the route attribute is long, the processing performance of the XPL policy deteriorates. To improve the processing performance of the routing policy, decrease the number of regular expressions or use a non-regular expression matching command.
It is recommended that a maximum of 100 regular expressions be configured for each policy.
Route-filters can have only action clauses and can also be empty (configured with only a start clause and an end clause). In this case, the default action refuse is used. If an empty route-filter is specified in another route-filter using a call clause, the empty route-filter does not take effect.
Steps 2 to 5 describe how to configure an if condition branch. One route-filter can have multiple if condition branches, which can be configured in two modes, and both the two modes can be used in the same route-filter.
Regardless of the configuration mode, route filtering continues until finish, break, refuse, or the last if condition branch is implemented.
Configure an end clause using the end-filter command for the route-filter.
The easiest method to configure route-filters to reference route attribute sets is to use the format {element A, element B...}, if ip route-source in { 1.1.1.0 24, 2.2.2.2 32 } then for example. However, if a route-filter needs to reference a set multiple times, configure named route attribute sets.
When advertising, receiving, or importing routes, the router can use XPL based on actual networking requirements to filter routes and modify route attributes. XPL serves the following purposes:
Only routes that match the rules specified in the XPL are advertised.
Only necessary and valid routes are accepted, which reduces the routing table size and improves network security.
Filters and controls imported routes.
A routing protocol may import routes discovered by other routing protocols. XPL ensures that only the routes that meet certain conditions are imported and route attributes of the imported routes are modified to meet the requirements of the protocol.
Attributes of the routes that match the specified route-filter can be modified as required.