Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

Configuring Flat-File Accounting for Layer 2 Wholesale

Flat-file accounting is typically used for recording accounting statistics on logical interfaces for Extensible Subscriber Services Manager (ESSM) business subscribers. However, starting in Junos OS Release 16.1R4, you can also use flat-file accounting to collect and archive various accounting statistics for your Layer 2 wholesale environment. You do this by creating a flat-file profile and applying it to a core-facing physical interface.

You can also configure a flat-file profile to monitor and report Layer 2 multicast statistics; you assign this profile to the logical interface configured on the core-facing physical interface. This approach enables you to have separate accounting files that overlap in content only in the non-statistical, general parameters. The Layer 2 multicast statistics are available only when the encapsulation on the logical interface is ethernet-vpls.

You can configure multiple accounting profiles with different combinations of fields for specific accounting requirements, and then assign the profiles as needed to provisioned interfaces to satisfy the accounting requirements for each interface depending on how the interface is used.

A given flat-file profile can be assigned to both use cases; for example, by specifying all-fields for a global or group level. In this case, the fields you configure appear in the accounting record only if they make sense in the context.

Best Practice:

We recommend you use separate flat-file profiles for Layer 2 wholesale core-facing physical interfaces and ESSM business subscriber logical interfaces.

Some statistics and general parameter fields are available either only for logical interfaces or only for physical interfaces. The accounting-type, line-id, nas-port-id, and vlan-id general parameters are not available for core-facing physical interfaces. Because the core-facing physical interfaces carry Layer 2 cross-connected sessions, no useful IPv6 statistics are available. Accordingly, do not configure the input-v6-bytes, input-v6-packets, output-v6-bytes, or output-v6-packets overall packet fields.

To configure flat-file accounting for a Layer 2 wholesale network:

  1. Create a flat-file profile.
  2. (Optional) Configure the name of the XML schema for the accounting flat file.
  3. Specify the filename for the accounting file.
  4. Specify the general, nonstatistical parameters for the accounting file that are displayed as part of the accounting record header.
    Best Practice:

    We recommend that you include the general parameter all-fields option for both core-facing physical interfaces and, when you are collecting Layer 2 multicast statistics, on the logical interface that represents the physical interface.

  5. Specify the accounting statistics that are collected and recorded in the accounting file for the core-facing physical interface.
    Best Practice:

    We recommend that you include the following statistics fields in flat-file profiles for core-facing physical interfaces:

    • Egress statistics fields: all-fields

    • Ingress statistics fields: all-fields

    • Overall packet fields: input-bytes, input-discards, input-errors, input-packets, output-bytes, output-errors, output-packets

  6. (Optional) For Layer 2 multicast statistics, specify the accounting statistics that are collected and recorded in the accounting file for the logical interface representing the core-facing physical interface.
    Best Practice:

    We recommend that you include the following statistics fields in flat-file profiles for logical interfaces on the core-facing physical interfaces:

    • Layer 2 statistics fields: all-fields

  7. (Optional) Specify the format of the accounting file.
  8. (Optional) Specify the interval at which the Packet Forwarding Engine associated with the interface is polled for the statistics specified in the profile.
    Note:

    When you do not configure this option, the polling interval is 15 minutes.

  9. Configure the maximum size of the accounting file.
  10. Configure one or more archive sites for the files.

    The site-name is any valid FTP or Secure FTP URL. When the file is archived, the router attempts to transfer the file to the archive site. If you have specified more than one site, it tries the first site in the list. If that fails, it tries each site in turn until a transfer succeeds The log file is stored at the archive site with a filename of the format router-name_log-filename_timestamp. The last site in a list is often a local directory, in case no remote site is reachable.

  11. (Optional) Configure the start time for transferring files.
  12. (Optional) Configure how frequently the file is transferred.
    Note:

    When you do not configure this option, the file is transferred every 30 minutes.

  13. (Optional) Configure the maximum number of files (3 through 1000) to save.
    Note:

    When you do not configure this option, a maximum of 10 files are saved.

  14. (Optional) Configure the router to save a backup copy of the accounting file to the /var/log/pfedBackup directory if the normal transfer of the files to the archive sites fails.
    Note:

    When you do not configure this option, the file is saved on failure into the local directory specified as the last site in the list of archive sites.

  15. (Optional) Configure the accounting file to be compressed during transfer to an archive site.
  16. (Optional) Configure the router’s new backup Routing Engine to send its accounting file to the /var/log/pfedBackup directory on the new primary Routing Engine when a change in primary role occurs.
  17. (Optional) Configure the number of days after which accounting files are deleted from the local backup directory.
    Note:

    Files are retained for 1 day if you do not configure this option.

  18. Assign the profile to the relevant interface.

    For the core-facing physical interface:

    For the logical interface representing the core-facing physical interface:

Release History Table
Release
Description
16.1R4
However, starting in Junos OS Release 16.1R4, you can also use flat-file accounting to collect and archive various accounting statistics for your Layer 2 wholesale environment.