Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
en:dpi:dpi_components:platform:dpi_vlan_recode:start [2023/08/29 07:27] – edrudichgmailcom | en:dpi:dpi_components:platform:dpi_vlan_recode:start [Unknown date] (current) – removed - external edit (Unknown date) 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== VLAN Translation ====== | ||
- | {{indexmenu_n> | ||
- | In version 9.4, the ability to translate VLAN has been added: the incoming VLAN of the packet is replaced with the specified outgoing VLAN. | ||
- | VLAN translation is specified in ''/ | ||
- | < | ||
- | # subs VLAN inet VLAN | ||
- | 123 1123 | ||
- | 124 1124 | ||
- | 125 1125 | ||
- | # and so on. | ||
- | </ | ||
- | Each line defines the correspondence of the incoming and outgoing VLAN. | ||
- | A line starting with ''#'' | ||
- | |||
- | The translation text file must be converted to a binary file ''/ | ||
- | < | ||
- | cat vlan_translation.txt|vlan2bin / | ||
- | </ | ||
- | |||
- | The reverse conversion from binary to text is performed by the bin2vlan utility: | ||
- | < | ||
- | bin2vlan / | ||
- | </ | ||
- | |||
- | VLAN translation mode is enabled simply by the presence of the file ''/ | ||
- | |||
- | When VLAN translation is enabled, it applies to any mode of DPI operation, not just BRAS mode. | ||
- | |||
- | When VLAN traslation is enabled, DPI works as follows: | ||
- | * packet from the Subscriber to the Internet (subs -> inet): searches the translation table for the incoming VLAN of the packet (subs VLAN); if VLAN is found, replaces it with outgoing inet VLAN. In the example above, subs VLAN=123 will be replaced with inet VLAN=1123. | ||
- | * packet inet -> subs: searches the translation table for the incoming VLAN of the packet (inet VLAN); if VLAN is found, replaces it with outgoing subs VLAN. In the example above, inet VLAN=1124 will be replaced with subs VLAN=124. | ||
- | * If the incoming VLAN is not found in the translation table, it is not changed (this situation is not an error). Thus, the translation table does not have to be complete and list all VLANs. | ||
- | * For a passthrough packet (for example, if the AS flag is set to pass), VLAN translation is not applied. | ||
- | |||
- | VLAN translation is applied only to the packets with one VLAN-tag. For Q-in-Q, translation is not applied. If the packet does not have a VLAN tag, translation is also not applied - the packet is sent "as it is", unchanged. | ||
- | |||
- | The correspondence must be one-to-one; the following settings are not valid: | ||
- | < | ||
- | # subs VLAN inet VLAN | ||
- | # Error: two subs VLAN (64 and 65) are translated into one VLAN=200 | ||
- | 64 200 | ||
- | 65 200 | ||
- | |||
- | # Similar error: inet VLAN 202 and 203 are translated into one subs VLAN=2067 | ||
- | 2067 202 | ||
- | 2067 203 | ||
- | # ... | ||
- | </ | ||
- | |||
- | At the end of the file, you can add default translation recordings: | ||
- | < | ||
- | # subs VLAN inet VLAN | ||
- | 123 1123 | ||
- | 124 1124 | ||
- | 125 1125 | ||
- | # then list all the other translations ... | ||
- | |||
- | # Statement " | ||
- | # There can be only one such statement in a file! | ||
- | * 4012 | ||
- | |||
- | # Statement " | ||
- | # There can be only one such statement in a file! | ||
- | 2089 * | ||
- | |||
- | # End of translation file | ||
- | </ | ||
- | |||
- | ==== Compatibility with L2 BRAS/BNG mode ==== | ||
- | {{anchor: | ||
- | VLAN translation is also used in the L2 BRAS/BNG mode; taking into account the fact that L2 BRAS/BNG VLAN is already able to perform [[en: | ||
- | |||
- | The VLAN translation table is used in L2 BRAS/BNG when terminating sub-> | ||
- | - if the subscriber is not an L2 subscriber (subscriber' | ||
- | - if VLAN termination is disabled ('' | ||
- | - in the [[en: | ||
- | - in the [[dpi: | ||
- | |||
- | In other words, in '' | ||
- | |||
- | When the inet-> | ||
- | |||
- | |||
- | ==== CLI-commands ==== | ||
- | {{anchor: | ||
- | There are several [[en: | ||
- | |||
- | < | ||
- | fdpi_cli vlan translation | ||
- | </ | ||
- | Lists the current translation tables subs-> | ||
- | |||
- | < | ||
- | fdpi_cli vlan translation reload | ||
- | </ | ||
- | Immediate download of file ''/ | ||
- | DPI checks for the existence and modification of the file ''/ | ||
- | |||
- | |||
- | < | ||
- | fdpi_cli vlan translation test [subs|inet] < | ||
- | </ | ||
- | Checking VLAN translation on the specified route: | ||
- | * '' | ||
- | * '' | ||
- | Examples: | ||
- | < | ||
- | # which VLAN < | ||
- | fdpi_cli vlan translation test subs 123 | ||
- | # command output: | ||
- | VLAN=123 translation subs-> | ||
- | |||
- | # which VLAN < | ||
- | fdpi_cli vlan translation test inet 1124 | ||
- | # command output: | ||
- | VLAN=1124 translation inet-> | ||
- | |||
- | # If there is no translation for the specified VLAN, the command will respond with an error: | ||
- | No translation for VLAN=666 for subs-> | ||
- | |||
- | </ |