home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1997 December / Internet_Info_CD-ROM_Walnut_Creek_December_1997.iso / rfc / rfc2063 < prev    next >
Text File  |  1996-12-31  |  89KB  |  2,076 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7. Network Working Group                                        N. Brownlee
  8. Request for Comments: 2063                    The University of Auckland
  9. Category: Experimental                                          C. Mills
  10.                                             BBN Systems and Technologies
  11.                                                                  G. Ruth
  12.                                                   GTE Laboratories, Inc.
  13.                                                             January 1997
  14.  
  15.  
  16.                 Traffic Flow Measurement:  Architecture
  17.  
  18. Status of this Memo
  19.  
  20.    This memo defines an Experimental Protocol for the Internet
  21.    community.  This memo does not specify an Internet standard of any
  22.    kind.  Discussion and suggestions for improvement are requested.
  23.    Distribution of this memo is unlimited.
  24.  
  25. Abstract
  26.  
  27.    This document describes an architecture for the measurement and
  28.    reporting of network traffic flows, discusses how this relates to an
  29.    overall network traffic flow architecture, and describes how it can
  30.    be used within the Internet.  It is intended to provide a starting
  31.    point for the Realtime Traffic Flow Measurement Working Group.
  32.  
  33. Table of Contents
  34.  
  35.  1 Statement of Purpose and Scope                                     2
  36.  2 Traffic Flow Measurement Architecture                              4
  37.    2.1 Meters and Traffic Flows . . . . . . . . . . . . . . . . . .   4
  38.    2.2 Interaction Between METER and METER READER . . . . . . . . .   6
  39.    2.3 Interaction Between MANAGER and METER  . . . . . . . . . . .   6
  40.    2.4 Interaction Between MANAGER and METER READER . . . . . . . .   7
  41.    2.5 Multiple METERs or METER READERs . . . . . . . . . . . . . .   7
  42.    2.6 Interaction Between MANAGERs (MANAGER - MANAGER) . . . . . .   8
  43.    2.7 METER READERs and APPLICATIONs . . . . . . . . . . . . . . .   8
  44.  3 Traffic Flows and Reporting Granularity                            9
  45.    3.1 Flows and their Attributes . . . . . . . . . . . . . . . . .   9
  46.    3.2 Granularity of Flow Measurements . . . . . . . . . . . . . .  11
  47.    3.3 Rolling Counters, Timestamps, Report-in-One-Bucket-Only  . .  13
  48.  4 Meters                                                            15
  49.    4.1 Meter Structure  . . . . . . . . . . . . . . . . . . . . . .  15
  50.    4.2 Flow Table . . . . . . . . . . . . . . . . . . . . . . . . .  17
  51.    4.3 Packet Handling, Packet Matching . . . . . . . . . . . . . .  17
  52.    4.4 Rules and Rule Sets  . . . . . . . . . . . . . . . . . . . .  21
  53.    4.5 Maintaining the Flow Table . . . . . . . . . . . . . . . . .  24
  54.    4.6 Handling Increasing Traffic Levels . . . . . . . . . . . . .  25
  55.  
  56.  
  57.  
  58. Brownlee, et. al.             Experimental                      [Page 1]
  59.  
  60. RFC 2063         Traffic Flow Measurement: Architecture     January 1997
  61.  
  62.  
  63.  5 Meter Readers                                                     26
  64.    5.1 Identifying Flows in Flow Records  . . . . . . . . . . . . .  26
  65.    5.2 Usage Records, Flow Data Files . . . . . . . . . . . . . . .  27
  66.    5.3 Meter to Meter Reader:  Usage Record Transmission. . . . . .  27
  67.  6 Managers                                                          28
  68.    6.1 Between Manager and Meter:  Control Functions  . . . . . . .  28
  69.    6.2 Between Manager and Meter Reader:  Control Functions   . . .  29
  70.    6.3 Exception Conditions . . . . . . . . . . . . . . . . . . . .  31
  71.    6.4 Standard Rule Sets   . . . . . . . . . . . . . . . . . . . .  32
  72.  7 APPENDICES                                                        33
  73.    7.1 Appendix A: Network Characterisation . . . . . . . . . . . .  33
  74.    7.2 Appendix B: Recommended Traffic Flow Measurement Capabilities 34
  75.    7.3 Appendix C: List of Defined Flow Attributes  . . . . . . . .  35
  76.    7.4 Appendix D: List of Meter Control Variables  . . . . . . . .  36
  77.  8 Acknowledgments                                                   36
  78.  9 References                                                        37
  79. 10 Security Considerations                                           37
  80. 11 Authors' Addresses                                                37
  81.  
  82. 1 Statement of Purpose and Scope
  83.  
  84.    This document describes an architecture for traffic flow measurement
  85.    and reporting for data networks which has the following
  86.    characteristics:
  87.  
  88.      - The traffic flow model can be consistently applied to any
  89.        protocol/application at any network layer (e.g.  network,
  90.        transport, application layers).
  91.  
  92.      - Traffic flow attributes are defined in such a way that they are
  93.        valid for multiple networking protocol stacks, and that traffic
  94.        flow measurement implementations are useful in MULTI-PROTOCOL
  95.        environments.
  96.  
  97.      - Users may specify their traffic flow measurement requirements
  98.        in a simple manner, allowing them to collect the flow data they
  99.        need while ignoring other traffic.
  100.  
  101.      - The data reduction effort to produce requested traffic flow
  102.        information is placed as near as possible to the network
  103.        measurement point.  This reduces the volume of data to be
  104.        obtained (and transmitted across the network for storage),
  105.        and minimises the amount of processing required in traffic
  106.        flow analysis applications.
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114. Brownlee, et. al.             Experimental                      [Page 2]
  115.  
  116. RFC 2063         Traffic Flow Measurement: Architecture     January 1997
  117.  
  118.  
  119.    The architecture specifies common metrics for measuring traffic
  120.    flows.  By using the same metrics, traffic flow data can be exchanged
  121.    and compared across multiple platforms.  Such data is useful for:
  122.  
  123.      - Understanding the behaviour of existing networks,
  124.  
  125.      - Planning for network development and expansion,
  126.  
  127.      - Quantification of network performance,
  128.  
  129.      - Verifying the quality of network service, and
  130.  
  131.      - Attribution of network usage to users.
  132.  
  133.    The traffic flow measurement architecture is deliberately structured
  134.    so that specific protocol implementations may extend coverage to
  135.    multi-protocol environments and to other protocol layers, such as
  136.    usage measurement for application-level services.  Use of the same
  137.    model for both network- and application-level measurement may
  138.    simplify the development of generic analysis applications which
  139.    process and/or correlate any or all levels of traffic and usage
  140.    information.  Within this docuemt the term 'usage data' is used as a
  141.    generic term for the data obtained using the traffic flow measurement
  142.    architecture.
  143.  
  144.    This document is not a protocol specification.  It specifies and
  145.    structures the information that a traffic flow measurement system
  146.    needs to collect, describes requirements that such a system must
  147.    meet, and outlines tradeoffs which may be made by an implementor.
  148.  
  149.    For performance reasons, it may be desirable to use traffic
  150.    information gathered through traffic flow measurement in lieu of
  151.    network statistics obtained in other ways.  Although the
  152.    quantification of network performance is not the primary purpose of
  153.    this architecture, the measured traffic flow data may be used as an
  154.    indication of network performance.
  155.  
  156.    A cost recovery structure decides "who pays for what." The major
  157.    issue here is how to construct a tariff (who gets billed, how much,
  158.    for which things, based on what information, etc).  Tariff issues
  159.    include fairness, predictability (how well can subscribers forecast
  160.    their network charges), practicality (of gathering the data and
  161.    administering the tariff), incentives (e.g.  encouraging off-peak
  162.    use), and cost recovery goals (100% recovery, subsidisation, profit
  163.    making).  Issues such as these are not covered here.
  164.  
  165.    Background information explaining why this approach was selected is
  166.    provided by 'Traffic Flow Measurement:  Background' RFC [1].
  167.  
  168.  
  169.  
  170. Brownlee, et. al.             Experimental                      [Page 3]
  171.  
  172. RFC 2063         Traffic Flow Measurement: Architecture     January 1997
  173.  
  174.  
  175. 2 Traffic Flow Measurement Architecture
  176.  
  177.    A traffic flow measurement system is used by network Operations
  178.    personnel for managing and developing a network.  It provides a tool
  179.    for measuring and understanding the network's traffic flows.  This
  180.    information is useful for many purposes, as mentioned in section 1
  181.    (above).
  182.  
  183.    The following sections outline a model for traffic flow measurement,
  184.    which draws from working drafts of the OSI accounting model [2].
  185.    Future extensions are anticipated as the model is refined to address
  186.    additional protocol layers.
  187.  
  188. 2.1 Meters and Traffic Flows
  189.  
  190.    At the heart of the traffic measurement model are network entities
  191.    called traffic METERS. Meters count certain attributes (such as
  192.    numbers of packets and bytes) and classify them as belonging to
  193.    ACCOUNTABLE ENTITIES using other attributes (such as source and
  194.    destination addresses).  An accountable entity is someone who (or
  195.    something which) is responsible for some activitiy on the network.
  196.    It may be a user, a host system, a network, a group of networks, etc,
  197.    depending on the granularity specified by the meter's configuration.
  198.  
  199.    We assume that routers or traffic monitors throughout a network are
  200.    instrumented with meters to measure traffic.  Issues surrounding the
  201.    choice of meter placement are discussed in the 'Traffic Flow
  202.    Measurement:  Background' RFC [1].  An important aspect of meters is
  203.    that they provide a way of succinctly aggregating entity usage
  204.    information.
  205.  
  206.    For the purpose of traffic flow measurement we define the concept of
  207.    a TRAFFIC FLOW, which is an artificial logical equivalent to a call
  208.    or connection.  A flow is a portion of traffic, delimited by a start
  209.    and stop time, that was generated by a particular accountable entity.
  210.    Attribute values (source/destination addresses, packet counts, byte
  211.    counts, etc.)  associated with a flow are aggregate quantities
  212.    reflecting events which take place in the DURATION between the start
  213.    and stop times.  The start time of a flow is fixed for a given flow;
  214.    the end time may increase with the age of the flow.
  215.  
  216.    For connectionless network protocols such as IP there is by
  217.    definition no way to tell whether a packet with a particular
  218.    source/destination combination is part of a stream of packets or not
  219.    - each packet is completely independent.  A traffic meter has, as
  220.    part of its configuration, a set of 'rules' which specify the flows
  221.    of interest, in terms of the values of their attributes.  It derives
  222.    attribute values from each observed packet, and uses these to decide
  223.  
  224.  
  225.  
  226. Brownlee, et. al.             Experimental                      [Page 4]
  227.  
  228. RFC 2063         Traffic Flow Measurement: Architecture     January 1997
  229.  
  230.  
  231.    which flow they belong to.  Classifying packets into 'flows' in this
  232.    way provides an economical and practical way to measure network
  233.    traffic and ascribe it to accountable entities.
  234.  
  235.    Usage information which is not deriveable from traffic flows may also
  236.    be of interest.  For example, an application may wish to record
  237.    accesses to various different information resources or a host may
  238.    wish to record the username (subscriber id) for a particular network
  239.    session.  Provision is made in the traffic flow architecture to do
  240.    this.  In the future the measurement model will be extended to gather
  241.    such information from applications and hosts so as to provide values
  242.    for higher-layer flow attributes.
  243.  
  244.    As well as FLOWS and METERS, the traffic flow measurement model
  245.    includes MANAGERS, METER READERS and ANALYSIS APPLICAIONS, which are
  246.    explained in following sections.  The relationships between them are
  247.    shown by the diagram below.  Numbers on the diagram refer to sections
  248.    in this document.
  249.  
  250.                     MANAGER
  251.                    /       \
  252.               2.3 /         \ 2.4
  253.                  /           \
  254.                 /             \                       ANALYSIS
  255.            METER   <----->   METER READER  <----->   APPLICATION
  256.                      2.2                     2.7
  257.  
  258.  
  259.  
  260.   - MANAGER: A traffic measurement manager is an application which
  261.     configures 'meter' entities and controls 'meter reader' entities.
  262.     It uses the data requirements of analysis applications to determine
  263.     the appropriate configurations for each meter, and the proper
  264.     operation of each meter reader.  It may well be convenient to
  265.     combine the functions of meter reader and manager within a single
  266.     network entity.
  267.  
  268.   - METER: Meters are placed at measurement points determined by
  269.     network Operations personnel.  Each meter selectively records
  270.     network activity as directed by its configuration settings.  It can
  271.     also aggregate, transform and further process the recorded activity
  272.     before the data is stored.  The processed and stored results are
  273.     called the 'usage data.'
  274.  
  275.   - METER READER: A meter reader reliably transports usage data from
  276.     meters so that it is available to analysis applications.
  277.  
  278.  
  279.  
  280.  
  281.  
  282. Brownlee, et. al.             Experimental                      [Page 5]
  283.  
  284. RFC 2063         Traffic Flow Measurement: Architecture     January 1997
  285.  
  286.  
  287.   - ANALYSIS APPLICATION: An analysis application processes the usage
  288.     data so as to provide information and reports which are useful for
  289.     network engineering and management purposes.  Examples include:
  290.  
  291.       -  TRAFFIC FLOW MATRICES, showing the total flow rates for
  292.          many of the possible paths within an internet.
  293.  
  294.       -  FLOW RATE FREQUENCY DISTRIBUTIONS, indicating how flow
  295.          rates vary with time.
  296.  
  297.       -  USAGE DATA showing the total traffic volumes sent and
  298.          received by particular hosts.
  299.  
  300.    The operation of the traffic measurement system as a whole is best
  301.    understood by considering the interactions between its components.
  302.    These are described in the following sections.
  303.  
  304. 2.2 Interaction Between METER and METER READER
  305.  
  306.    The information which travels along this path is the usage data
  307.    itself.  A meter holds usage data in an array of flow data records
  308.    known as the FLOW TABLE. A meter reader may collect the data in any
  309.    suitable manner.  For example it might upload a copy of the whole
  310.    flow table using a file transfer protocol, or read the records in the
  311.    current flow set one at a time using a suitable data transfer
  312.    protocol.  Note that the meter reader need not read complete flow
  313.    data records, a subset of their attribute values may well be
  314.    sufficient.
  315.  
  316.    A meter reader may collect usage data from one or more meters.  Data
  317.    may be collected from the meters at any time.  There is no
  318.    requirement for collections to be synchronized in any way.
  319.  
  320. 2.3 Interaction Between MANAGER and METER
  321.  
  322.    A manager is responsible for configuring and controlling one or more
  323.    meters.  At the time of writing a meter can only be controlled by a
  324.    single manager; in the future this restriction may be relaxed.  Each
  325.    meter's configuration includes information such as:
  326.  
  327.   - Flow specifications, e.g.  which traffic flows are to be measured,
  328.     how they are to be aggregated, and any data the meter is required
  329.     to compute for each flow being measured.
  330.  
  331.   - Meter control parameters, e.g.  the maximum size of its flow table,
  332.     the 'inactivity' time for flows (if no packets belonging to a flow
  333.     are seen for this time the flow is considered to have ended, i.e.
  334.     to have become idle).
  335.  
  336.  
  337.  
  338. Brownlee, et. al.             Experimental                      [Page 6]
  339.  
  340. RFC 2063         Traffic Flow Measurement: Architecture     January 1997
  341.  
  342.  
  343.   - Sampling rate.  Normally every packet will be observed.  It may
  344.     sometimes be necessary to use sampling techniques to observe only
  345.     some of the packets.  (Sampling algorithms are not prescribed by
  346.     the architecture; it should be noted that before using sampling one
  347.     should verify the statistical validity of the algorithm used).
  348.     Current experience with the measurement architecture shows that a
  349.     carefully-designed and implemented meter compresses the data such
  350.     that in normal LANs and WANs of today sampling is really not
  351.     needed.
  352.  
  353. 2.4 Interaction Between MANAGER and METER READER
  354.  
  355.    A manager is responsible for configuring and controlling one or more
  356.    meter readers.  A meter reader may only be controlled by a single
  357.    manager.  A meter reader needs to know at least the following for
  358.    every meter is is collecting usage data from:
  359.  
  360.   - The meter's unique identity, i.e.  its network name or address.
  361.  
  362.   - How often usage data is to be collected from the meter.
  363.  
  364.   - Which flow records are to be collected (e.g.  all active flows, the
  365.     whole flow table, flows seen since a given time, etc.).
  366.  
  367.   - Which attribute values are to be collected for the required flow
  368.     records (e.g.  all attributes, or a small subset of them)
  369.  
  370.    Since redundant reporting may be used in order to increase the
  371.    reliability of usage data, exchanges among multiple entities must be
  372.    considered as well.  These are discussed below.
  373.  
  374. 2.5 Multiple METERs or METER READERs
  375.  
  376.  
  377.                  -- METER READER A --
  378.                 /         |          \
  379.                /          |           \
  380.        =====METER 1     METER 2=====METER 3    METER 4=====
  381.                            \           |          /
  382.                             \          |         /
  383.                              -- METER READER B --
  384.  
  385.  
  386.    Several uniquely identified meters may report to one or more meter
  387.    readers.  The diagram above gives an example of how multiple meters
  388.    and meter readers could be used.
  389.  
  390.  
  391.  
  392.  
  393.  
  394. Brownlee, et. al.             Experimental                      [Page 7]
  395.  
  396. RFC 2063         Traffic Flow Measurement: Architecture     January 1997
  397.  
  398.  
  399.    In the diagram above meter 1 is read by meter reader A, and meter 4
  400.    is read by meter reader B. Meters 1 and 4 have no redundancy; if
  401.    either fails, usage data for their network segments will be lost.
  402.  
  403.    Meters 2 and 3, however, measure traffic on the same network segment.
  404.    One of them may fail leaving the other collecting the segment's usage
  405.    data.  Meters 2 and 3 are read by meter reader A and by meter reader
  406.    B.  If one meter reader fails, the other will continue collecting
  407.    usage data.
  408.  
  409.    The architecture does not require multiple meter readers to be
  410.    synchronized.  In the situation above meter readers A and B could
  411.    both collect usage data at the same intervals, but not neccesarily at
  412.    the same times.  Note that because collections are asynchronous it is
  413.    unlikely that usage records from two different meter readers will
  414.    agree exactly.
  415.  
  416.    If precisely synchronized collections are required this can be
  417.    achieved by having one manager request each meter to begin collecting
  418.    a new set of flows, then allowing all meter readers to collect the
  419.    usage data from the old sets of flows.
  420.  
  421.    If there is only one meter reader and it fails, the meters continue
  422.    to run.  When the meter reader is restarted it can collect all of the
  423.    accumulated flow data.  Should this happen, time resolution will be
  424.    lost (because of the missed collections) but overall traffic flow
  425.    information will not.  The only exception to this would occur if the
  426.    traffic volume was sufficient to 'roll over' counters for some flows
  427.    during the failure; this is addressed in the section on 'Rolling
  428.    Counters.'
  429.  
  430. 2.6 Interaction Between MANAGERs (MANAGER - MANAGER)
  431.  
  432.    Synchronization between multiple management systems is the province
  433.    of network management protocols.  This traffic flow measurement
  434.    architecture specifies only the network management controls necessary
  435.    to perform the traffic flow measurement function and does not address
  436.    the more global issues of simultaneous or interleaved (possibly
  437.    conflicting) commands from multiple network management stations or
  438.    the process of transferring control from one network management
  439.    station to another.
  440.  
  441. 2.7 METER READERs and APPLICATIONs
  442.  
  443.    Once a collection of usage data has been assembled by a meter reader
  444.    it can be processed by an analysis application.  Details of analysis
  445.    applications - such as the reports they produce and the data they
  446.    require - are outside the scope of this architecture.
  447.  
  448.  
  449.  
  450. Brownlee, et. al.             Experimental                      [Page 8]
  451.  
  452. RFC 2063         Traffic Flow Measurement: Architecture     January 1997
  453.  
  454.  
  455.    It should be noted, however, that analysis applications will often
  456.    require considerable amounts of input data.  An important part of
  457.    running a traffic flow measurement system is the storage and regular
  458.    reduction of flow data so as to produce daily, weekly or monthly
  459.    summary files for further analysis.  Again, details of such data
  460.    handling are outside the scope of this architecture.
  461.  
  462. 3 Traffic Flows and Reporting Granularity
  463.  
  464.    A flow was defined in section 2.1 above in abstract terms as follows:
  465.  
  466.     "A TRAFFIC FLOW is an artifical logical equivalent to a call or
  467.     connection, belonging to an ACCOUNTABLE ENTITY."
  468.  
  469.    In practical terms, a flow is a stream of packets passing across a
  470.    network between two end points (or being sent from a single end
  471.    point), which have been summarized by a traffic meter for analysis
  472.    purposes.
  473.  
  474. 3.1 Flows and their Attributes
  475.  
  476.    Every traffic meter maintains a table of 'flow records' for flows
  477.    seen by the meter.  A flow record holds the values of the ATTRIBUTES
  478.    of interest for its flow.  These attributes might include:
  479.  
  480.   - ADDRESSES for the flow's source and destination.  These comprise
  481.     the protocol type, the source and destination addresses at various
  482.     network layers (extracted from the packet), and the number of the
  483.     interface on which the packet was observed.
  484.  
  485.   - First and last TIMES when packets were seen for this flow, i.e.
  486.     the 'creation' and 'last activity' times for the flow.
  487.  
  488.   - COUNTS for 'forward' (source to destination) and 'backward'
  489.     (destination to source) components (e.g.  packets and bytes) of the
  490.     flow's traffic.  The specifying of 'source' and 'destination' for
  491.     flows is discussed in the section on packet matching below.
  492.  
  493.   - OTHER attributes, e.g.  information computed by the meter.
  494.  
  495.    A flow's ACCOUNTABLE ENTITY is specified by the values of its ADDRESS
  496.    attributes.  For example, if a flow's address attributes specified
  497.    only that "source address = IP address 10.1.0.1," then all IP packets
  498.    from and to that address would be counted in that flow.  If a flow's
  499.    address list were specified as "source address = IP address 10.1.0.1,
  500.    destination address = IP address 26.1.0.1" then only IP packets
  501.    between 10.1.0.1 and 26.1.0.1 would be counted in that flow.
  502.  
  503.  
  504.  
  505.  
  506. Brownlee, et. al.             Experimental                      [Page 9]
  507.  
  508. RFC 2063         Traffic Flow Measurement: Architecture     January 1997
  509.  
  510.  
  511.    The addresses specifying a flow's address attributes may include one
  512.    or more of the following types:
  513.  
  514.   - The INTERFACE NUMBER for the flow, i.e.  the interface on which the
  515.     meter measured the traffic.  Together with a unique address for the
  516.     meter this uniquely identifies a particular physical-level port.
  517.  
  518.   - The ADJACENT ADDRESS, i.e.  the [n-1] layer address of the
  519.     immediate source or destination on the path of the packet.  For
  520.     example, if flow measurement is being performed at the IP layer on
  521.     an Ethernet LAN [3], an adjacent address is a six-octet Media
  522.     Access Control (MAC) address.  For a host connected to the same LAN
  523.     segment as the meter the adjacent address will be the MAC address
  524.     of that host.  For hosts on other LAN segments it will be the MAC
  525.     address of the adjacent (upstream or downstream) router carrying
  526.     the traffic flow.
  527.  
  528.   - The PEER ADDRESS, which identifies the source or destination of the
  529.     PEER-LEVEL packet.  The form of a peer address will depend on the
  530.     network-layer protocol in use, and the network layer [n] at which
  531.     traffic measurement is being performed.
  532.  
  533.   - The TRANSPORT ADDRESS, which identifies the source or destination
  534.     port for the packet, i.e.  its [n+1] layer address.  For example,
  535.     if flow measurement is being performed at the IP layer a transport
  536.     address is a two-octet UDP or TCP port number.
  537.  
  538.    The four definitions above specify addresses for each of the four
  539.    lowest layers of the OSI reference model, i.e.  Physical layer, Link
  540.    layer, Network layer and Transport layer.  A FLOW RECORD stores both
  541.    the VALUE for each of its addresses (as described above) and a MASK
  542.    specifying which bits of the address value are being used and which
  543.    are ignored.  Note that if address bits are being ignored the meter
  544.    will set them to zero, however their actual values are undefined.
  545.  
  546.    One of the key features of the traffic measurement architecture is
  547.    that attributes have essentially the same meaning for different
  548.    protocols, so that analysis applications can use the same reporting
  549.    formats for all protocols.  This is straightforward for peer
  550.    addresses; although the form of addresses differs for the various
  551.    protocols, the meaning of a 'peer address' remains the same.  It
  552.    becomes harder to maintain this correspondence at higher layers - for
  553.    example, at the Network layer IP, Novell IPX and AppleTalk all use
  554.    port numbers as a 'transport address,' but CLNP and DECnet have no
  555.    notion of ports.  Further work is needed here, particularly in
  556.    selecting attributes which will be suitable for the higher layers of
  557.    the OSI reference model.
  558.  
  559.  
  560.  
  561.  
  562. Brownlee, et. al.             Experimental                     [Page 10]
  563.  
  564. RFC 2063         Traffic Flow Measurement: Architecture     January 1997
  565.  
  566.  
  567.    Reporting by adjacent intermediate sources and destinations or simply
  568.    by meter interface (most useful when the meter is embedded in a
  569.    router) supports hierarchical Internet reporting schemes as described
  570.    in the 'Traffic Flow Measurement:  Background' RFC [1].  That is, it
  571.    allows backbone and regional networks to measure usage to just the
  572.    next lower level of granularity (i.e.  to the regional and
  573.    stub/enterprise levels, respectively), with the final breakdown
  574.    according to end user (e.g.  to source IP address) performed by the
  575.    stub/enterprise networks.
  576.  
  577.    In cases where network addresses are dynamically allocated (e.g.
  578.    mobile subscribers), further subscriber identification will be
  579.    necessary if flows are to ascribed to individual users.  Provision is
  580.    made to further specify the accountable entity through the use of an
  581.    optional SUBSCRIBER ID as part of the flow id.  A subscriber ID may
  582.    be associated with a particular flow either through the current rule
  583.    set or by proprietary means within a meter, for example via protocol
  584.    exchanges with one or more (multi-user) hosts.  At this time a
  585.    subscriber ID is an arbitrary text string; later versions of the
  586.    architecture may specify its contents on more detail.
  587.  
  588. 3.2 Granularity of Flow Measurements
  589.  
  590.    GRANULARITY is the 'control knob' by which an application and/or the
  591.    meter can trade off the overhead associated with performing usage
  592.    reporting against the level of detail supplied.  A coarser
  593.    granularity means a greater level of aggregation; finer granularity
  594.    means a greater level of detail.  Thus, the number of flows measured
  595.    (and stored) at a meter can be regulated by changing the granularity
  596.    of the accountable entity, the attributes, or the time intervals.
  597.    Flows are like an adjustable pipe - many fine-granularity streams can
  598.    carry the data with each stream measured individually, or data can be
  599.    bundled in one coarse-granularity pipe.
  600.  
  601.    Flow granularity is controlled by adjusting the level of detail at
  602.    which the following are reported:
  603.  
  604.   - The accountable entity (address attributes, discussed above).
  605.  
  606.   - The categorisation of packets (other attributes, discussed below).
  607.  
  608.   - The lifetime/duration of flows (the reporting interval needs to be
  609.     short enough to measure them with sufficient precision).
  610.  
  611.  
  612.  
  613.  
  614.  
  615.  
  616.  
  617.  
  618. Brownlee, et. al.             Experimental                     [Page 11]
  619.  
  620. RFC 2063         Traffic Flow Measurement: Architecture     January 1997
  621.  
  622.  
  623.    The set of rules controlling the determination of each packet's
  624.    accountable entity is known as the meter's CURRENT RULE SET. As will
  625.    be shown, the meter's current rule set forms an integral part of the
  626.    reported information, i.e.  the recorded usage information cannot be
  627.    properly interpreted without a definition of the rules used to
  628.    collect that information.
  629.  
  630.    Settings for these granularity factors may vary from meter to meter.
  631.    They are determined by the meter's current rule set, so they will
  632.    change if network Operations personnel reconfigure the meter to use a
  633.    new rule set.  It is expected that the collection rules will change
  634.    rather infrequently; nonetheless, the rule set in effect at any time
  635.    must be identifiable via a RULE SET ID. Granularity of accountable
  636.    entities is further specified by additional ATTRIBUTES. These
  637.    attributes include:
  638.  
  639.      - Meter variables such as the index of the flow's record in the flow
  640.        table and the rule set id for the rules which the meter was running
  641.        while the flow was observed.  The values of these attributes
  642.        provide a way of distinguishing flows observed by a meter at
  643.        different times.
  644.  
  645.      - Attributes which record information derived from other attribute
  646.        values.  Six of these are defined (SourceClass, DestClass,
  647.        FlowClass, SourceKind, DestKind, FlowKind), and their meaning is
  648.        determined by the meter's rule set.  For example, one could have a
  649.        subroutine in the rule set which determined whether a source or
  650.        destination peer address was a member of an arbitrary list of
  651.        networks, and set SourceClass/DestClass to one if the source/dest
  652.        peer address was in the list or to zero otherwise.
  653.  
  654.      - Administratively specified attributes such as Quality Of Service
  655.        and Priority, etc.  These are not defined at this time.
  656.  
  657.      - Higher-layer (especially application-level) attributes.  These are
  658.        not defined at this time.
  659.  
  660.    Settings for these granularity factors may vary from meter to meter.
  661.    They are determined by the meter's current rule set, so they will
  662.    change if network Operations personnel reconfigure the meter to use a
  663.    new rule set.
  664.  
  665.    The LIFETIME of a flow is the time interval which began when the
  666.    meter observed the first packet belonging to the flow and ended when
  667.    it saw the last packet.  Flow lifetimes are very variable, but many -
  668.    if not most - are rather short.  A meter cannot measure lifetimes
  669.    directly; instead a meter reader collects usage data for flows which
  670.    have been active since the last collection, and an analysis
  671.  
  672.  
  673.  
  674. Brownlee, et. al.             Experimental                     [Page 12]
  675.  
  676. RFC 2063         Traffic Flow Measurement: Architecture     January 1997
  677.  
  678.  
  679.    application may compare the data from each collection so as to
  680.    determine when each flow actually stopped.
  681.  
  682.    The meter does, however, need to reclaim memory (i.e.  records in the
  683.    flow table) being held by idle flows.  The meter configuration
  684.    includes a variable called InactivityTimeout, which specifies the
  685.    minimum time a meter must wait before recovering the flow's record.
  686.    In addition, before recovering a flow record the meter must be sure
  687.    that the flow's data has been collected by at least one meter reader.
  688.  
  689.    These 'lifetime' issues are considered further in the section on
  690.    meter readers (below).  A complete list of the attributes currently
  691.    defined is given in Appendix C later in this document.
  692.  
  693. 3.3 Rolling Counters, Timestamps, Report-in-One-Bucket-Only
  694.  
  695.    Once an usage record is sent, the decision needs to be made whether
  696.    to clear any existing flow records or to maintain them and add to
  697.    their counts when recording subsequent traffic on the same flow.  The
  698.    second method, called rolling counters, is recommended and has
  699.    several advantages.  Its primary advantage is that it provides
  700.    greater reliability - the system can now often survive the loss of
  701.    some usage records, such as might occur if a meter reader failed and
  702.    later restarted.  The next usage record will very often contain yet
  703.    another reading of many of the same flow buckets which were in the
  704.    lost usage record.  The 'continuity' of data provided by rolling
  705.    counters can also supply information used for "sanity" checks on the
  706.    data itself, to guard against errors in calculations.
  707.  
  708.    The use of rolling counters does introduce a new problem:  how to
  709.    distinguish a follow-on flow record from a new flow record.  Consider
  710.    the following example.
  711.  
  712.  
  713.                          CONTINUING FLOW        OLD FLOW, then NEW FLOW
  714.  
  715.                          start time = 1            start time = 1
  716.    Usage record N:       flow count = 2000      flow count = 2000 (done)
  717.  
  718.                          start time = 1            start time = 5
  719.    Usage record N+1:     flow count = 3000      new flow count = 1000
  720.  
  721.    Total count:                 3000                    3000
  722.  
  723.  
  724.    In the continuing flow case, the same flow was reported when its
  725.    count was 2000, and again at 3000:  the total count to date is 3000.
  726.    In the OLD/NEW case, the old flow had a count of 2000.  Its record
  727.  
  728.  
  729.  
  730. Brownlee, et. al.             Experimental                     [Page 13]
  731.  
  732. RFC 2063         Traffic Flow Measurement: Architecture     January 1997
  733.  
  734.  
  735.    was then stopped (perhaps because of temporary idleness, or MAX
  736.    LIFETIME policy), but then more traffic with the same characteristics
  737.    arrived so a new flow record was started and it quickly reached a
  738.    count of 1000.  The total flow count from both the old and new
  739.    records is 3000.
  740.  
  741.    The flow START TIMESTAMP attribute is sufficient to resolve this.  In
  742.    the example above, the CONTINUING FLOW flow record in the second
  743.    usage record has an old FLOW START timestamp, while the NEW FLOW
  744.    contains a recent FLOW START timestamp.
  745.  
  746.    Each packet is counted in one and only one flow, so as to avoid
  747.    multiple counting of a single packet.  The record of a single flow is
  748.    informally called a "bucket." If multiple, sometimes overlapping,
  749.    records of usage information are required (aggregate, individual,
  750.    etc), the network manager should collect the counts in sufficiently
  751.    detailed granularity so that aggregate and combination counts can be
  752.    reconstructed in post-processing of the raw usage data.
  753.  
  754.    For example, consider a meter from which it is required to record
  755.    both 'total packets coming in interface #1' and 'total packets
  756.    arriving from any interface sourced by IP address = a.b.c.d.'
  757.    Although a bucket can be declared for each case, it is not clear how
  758.    to handle a packet which satisfies both criteria.  It must only be
  759.    counted once.  By default it will be counted in the first bucket for
  760.    which it qualifies, and not in the other bucket.  Further, it is not
  761.    possible to reconstruct this information by post-processing.  The
  762.    solution in this case is to define not two, but THREE buckets, each
  763.    one collecting a unique combination of the two criteria:
  764.  
  765.         Bucket 1:  Packets which came in interface 1,
  766.                    AND were sourced by IP address a.b.c.d
  767.  
  768.         Bucket 2:  Packets which came in interface 1,
  769.                    AND were NOT sourced by IP address a.b.c.d
  770.  
  771.         Bucket 3:  Packets which did NOT come in interface 1,
  772.                    AND were sourced by IP address a.b.c.d
  773.  
  774.        (Bucket 4:  Packets which did NOT come in interface 1,
  775.                    AND NOT sourced by IP address a.b.c.d)
  776.  
  777.    The desired information can now be reconstructed by post-processing.
  778.    "Total packets coming in interface 1" can be found by adding buckets
  779.    1 & 2, and "Total packets sourced by IP address a.b.c.d" can be found
  780.    by adding buckets 1 & 3.  Note that in this case bucket 4 is not
  781.    explicitly required since its information is not of interest, but it
  782.    is supplied here in parentheses for completeness.
  783.  
  784.  
  785.  
  786. Brownlee, et. al.             Experimental                     [Page 14]
  787.  
  788. RFC 2063         Traffic Flow Measurement: Architecture     January 1997
  789.  
  790.  
  791. 4 Meters
  792.  
  793.    A traffic flow meter is a device for collecting data about traffic
  794.    flows at a given point within a network; we will call this the
  795.    METERING POINT.  The header of every packet passing the network
  796.    metering point is offered to the traffic meter program.
  797.  
  798.    A meter could be implemented in various ways, including:
  799.  
  800.   - A dedicated small host, connected to a LAN (so that it can see all
  801.     packets as they pass by) and running a 'traffic meter' program.
  802.     The metering point is the LAN segment to which the meter is
  803.     attached.
  804.  
  805.   - A multiprocessing system with one or more network interfaces, with
  806.     drivers enabling a traffic meter program to see packets.  In this
  807.     case the system provides multiple metering points - traffic flows
  808.     on any subset of its network interfaces can be measured.
  809.  
  810.   - A packet-forwarding device such as a router or switch.  This is
  811.     similar to (b) except that every received packet should also be
  812.     forwarded, usually on a different interface.
  813.  
  814.    The discussion in the following sections assumes that a meter may
  815.    only run a single rule set.  It is, however, possible for a meter to
  816.    run several rule sets concurrently, matching each packet against
  817.    every active rule set and producing a single flow table with flows
  818.    from all the active rule sets.  The overall effect of doing this
  819.    would be similar to running several independent meters, one for each
  820.    rule set.
  821.  
  822. 4.1 Meter Structure
  823.  
  824.    An outline of the meter's structure is given in the following
  825.    diagram.
  826.  
  827.    Briefly, the meter works as follows:
  828.  
  829.   - Incoming packet headers arrive at the top left of the diagram and
  830.     are passed to the PACKET PROCESSOR.
  831.  
  832.   - The packet processor passes them to the Packet Matching Engine
  833.     (PME) where they are classified.
  834.  
  835.   - The PME is a Virtual Machine running a pattern matching program
  836.     contained in the CURRENT RULE SET. It is invoked by the Packet
  837.     Processor, and returns instructions on what to do with the packet.
  838.  
  839.  
  840.  
  841.  
  842. Brownlee, et. al.             Experimental                     [Page 15]
  843.  
  844. RFC 2063         Traffic Flow Measurement: Architecture     January 1997
  845.  
  846.  
  847.   - Some packets are classified as 'to be ignored.'  They are discarded
  848.     by the Packet Processor.
  849.  
  850.   - Other packets are matched by the PME, which returns a FLOW KEY
  851.     describing the flow to which the packet belongs.
  852.  
  853.   - The flow key is used to locate the flow's entry in the FLOW TABLE;
  854.     a new entry is created when a flow is first seen.  The entry's
  855.     packet and byte counters are updated.
  856.  
  857.   - A meter reader may collect data from the flow table at any time.
  858.     It may use the 'collect' index to locate the flows to be collected
  859.     within the flow table.
  860.  
  861.  
  862.  
  863.                   packet                +------------------+
  864.                   header                | Current Rule Set |
  865.                     |                   +--------+---------+
  866.                     |                            |
  867.            +--------*---------+       +----------*-------------+
  868.            | Packet Processor |<----->| Packet Matching Engine |
  869.            +--+------------+--+       +------------------------+
  870.               |            |
  871.        Ignore *            | Count via flow key
  872.                            |
  873.                         +--*--------------+
  874.                         | 'Search' index  |
  875.                         +--------+--------+
  876.                                  |
  877.                         +--------*--------+
  878.                         |                 |
  879.                         |   Flow Table    |
  880.                         |                 |
  881.                         +--------+--------+
  882.                                  |
  883.                         +--------*--------+
  884.                         | 'Collect' index |
  885.                         +--------+--------+
  886.                                  |
  887.                                  *
  888.                             Meter Reader
  889.  
  890.  
  891.  
  892.  
  893.  
  894.  
  895.  
  896.  
  897.  
  898. Brownlee, et. al.             Experimental                     [Page 16]
  899.  
  900. RFC 2063         Traffic Flow Measurement: Architecture     January 1997
  901.  
  902.  
  903. 4.2 Flow Table
  904.  
  905.    Every traffic meter maintains a table of TRAFFIC FLOW RECORDS for
  906.    flows seen by the meter.  A flow record contains attribute values for
  907.    its flow, including:
  908.  
  909.   - Addresses for the flow's source and destination.  These include
  910.     addresses and masks for various network layers (extracted from the
  911.     packet), and the number of the interface on which the packet was
  912.     observed.
  913.  
  914.   - First and last times when packets were seen for this flow.
  915.  
  916.   - Counts for 'forward' (source to destination) and 'backward'
  917.     (destination to source) components of the flow's traffic.
  918.  
  919.   - Other attributes, e.g.  state of the flow record (discussed below).
  920.  
  921.    The state of a flow record may be:
  922.  
  923.   - INACTIVE: The flow record is not being used by the meter.
  924.  
  925.   - CURRENT: The record is in use and describes a flow which belongs to
  926.     the 'current flow set,' i.e.  the set of flows recently seen by the
  927.     meter.
  928.  
  929.   - IDLE: The record is in use and the flow which it describes is part
  930.     of the current flow set.  In addition, no packets belonging to this
  931.     flow have been seen for a period specified by the meter's
  932.     InactivityTime variable.
  933.  
  934. 4.3 Packet Handling, Packet Matching
  935.  
  936.    Each packet header received by the traffic meter program is processed
  937.    as follows:
  938.  
  939.   - Extract attribute values from the packet header and use them to
  940.     create a MATCH KEY for the packet.
  941.  
  942.   - Match the packet's key against the current rule set, as explained
  943.     in detail below.
  944.  
  945.    The rule set specifies whether the packet is to be counted or
  946.    ignored.  If it is to be counted the matching process produces a FLOW
  947.    KEY for the flow to which the packet belongs.  This flow key is used
  948.    to find the flow's record in the flow table; if a record does not yet
  949.    exist for this flow, a new flow record may be created.  The counts
  950.    for the matching flow record can then be incremented.
  951.  
  952.  
  953.  
  954. Brownlee, et. al.             Experimental                     [Page 17]
  955.  
  956. RFC 2063         Traffic Flow Measurement: Architecture     January 1997
  957.  
  958.  
  959.    For example, the rule set could specify that packets to or from any
  960.    host in IP network 130.216 are to be counted.  It could also specify
  961.    that flow records are to be created for every pair of 24-bit (Class
  962.    C) subnets within network 130.216.
  963.  
  964.    Each packet's match key is passed to the meter's PATTERN MATCHING
  965.    ENGINE (PME) for matching.  The PME is a Virtual Machine which uses a
  966.    set of instructions called RULES, i.e.  a RULE SET is a program for
  967.    the PME. A packet's match key contains an interface number, source
  968.    address (S) and destination address (D) values.  It does not,
  969.    however, contain any attribute masks for its attributes, only their
  970.    values.
  971.  
  972.    If measured flows were unidirectional, i.e.  only counted packets
  973.    travelling in one direction, the matching process would be simple.
  974.    The PME would be called once to match the packet.  Any flow key
  975.    produced by a successful match would be used to find the flow's
  976.    record in the flow table, and that flow's counters would be updated.
  977.  
  978.    Flows are, however, bidirectional, reflecting the forward and reverse
  979.    packets of a protocol interchange or 'session.'  Maintaining two sets
  980.    of counters in the meter's flow record makes the resulting flow data
  981.    much simpler to handle, since analysis programs do not have to gather
  982.    together the 'forward' and 'reverse' components of sessions.
  983.    Implementing bi-directional flows is, of course, more difficult for
  984.    the meter, since it must decide whether a packet is a 'forward'
  985.    packet or a 'reverse' one.  To make this decision the meter will
  986.    often need to invoke the PME twice, once for each possible packet
  987.    direction.
  988.  
  989.    The diagram below describes the algorithm used by the traffic meter
  990.    to process each packet.  Flow through the diagram is from left to
  991.    right and top to bottom, i.e.  from the top left corner to the bottom
  992.    right corner.  S indicates the flow's source address (i.e.  its set
  993.    of source address attribute values) from the packet, and D indicates
  994.    its destination address.
  995.  
  996.    There are several cases to consider.  These are:
  997.  
  998.   - The packet is recognised as one which is TO BE IGNORED.
  999.  
  1000.   - The packet MATCHES IN BOTH DIRECTIONS. One situation in which this
  1001.     could happen would be a rule set which matches flows within network
  1002.     X (Source = X, Dest = X) but specifies that flows are to be created
  1003.     for each subnet within network X, say subnets y and z.  If, for
  1004.     example a packet is seen for y->z, the meter must check that flow
  1005.     z->y is not already current before creating y->z.
  1006.  
  1007.  
  1008.  
  1009.  
  1010. Brownlee, et. al.             Experimental                     [Page 18]
  1011.  
  1012. RFC 2063         Traffic Flow Measurement: Architecture     January 1997
  1013.  
  1014.  
  1015.   - The packet MATCHES IN ONE DIRECTION ONLY. If its flow is already
  1016.     current, its forward or reverse counters are incremented.
  1017.     Otherwise it is added to the flow table and then counted.
  1018.  
  1019.    The algorithm uses four functions, as follows:
  1020.  
  1021. match(A->B) implements the PME.  It uses the meter's current rule set
  1022.    to match the attribute values in the packet's match key.  A->B means
  1023.    that the assumed source address is A and destination address B, i.e.
  1024.    that the packet was travelling from A to B.  match() returns one of
  1025.    three results:
  1026.  
  1027.    'Ignore' means that the packet was matched but this flow is not
  1028.             to be counted.
  1029.  
  1030.    'Fail' means that the packet did not match.  It might, however
  1031.             match with its direction reversed, i.e. from B to A.
  1032.  
  1033.    'Suc'  means that the packet did match, i.e. it belongs to a flow
  1034.             which is to be counted.
  1035.  
  1036. current(A->B) succeeds if the flow A-to-B is current - i.e. has
  1037.    a record in the flow table whose state is Current - and fails
  1038.    otherwise.
  1039.  
  1040. create(A->B) adds the flow A-to-B to the flow table, setting the
  1041.    value for attributes - such as addresses - which remain constant,
  1042.    and zeroing the flow's counters.
  1043.  
  1044. count(A->B,f) increments the 'forward' counters for flow A-to-B.
  1045. count(A->B,r) increments the 'reverse' counters for flow A-to-B.
  1046.    'Forward' here means the counters for packets travelling from
  1047.    A to B.  Note that count(A->B,f) is identical to count(B->A,r).
  1048.  
  1049.  
  1050.  
  1051.  
  1052.  
  1053.  
  1054.  
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060.  
  1061.  
  1062.  
  1063.  
  1064.  
  1065.  
  1066. Brownlee, et. al.             Experimental                     [Page 19]
  1067.  
  1068. RFC 2063         Traffic Flow Measurement: Architecture     January 1997
  1069.  
  1070.  
  1071.                     Ignore
  1072.     --- match(S->D) -------------------------------------------------+
  1073.          | Suc   | Fail                                              |
  1074.          |       |          Ignore                                   |
  1075.          |      match(D->S) -----------------------------------------+
  1076.          |       | Suc   | Fail                                      |
  1077.          |       |       |                                           |
  1078.          |       |       +-------------------------------------------+
  1079.          |       |                                                   |
  1080.          |       |             Suc                                   |
  1081.          |      current(D->S) ---------- count(D->S,r) --------------+
  1082.          |       | Fail                                              |
  1083.          |       |                                                   |
  1084.          |      create(D->S) ----------- count(D->S,r) --------------+
  1085.          |                                                           |
  1086.          |             Suc                                           |
  1087.         current(S->D) ------------------ count(S->D,f) --------------+
  1088.          | Fail                                                      |
  1089.          |             Suc                                           |
  1090.         current(D->S) ------------------ count(D->S,r) --------------+
  1091.          | Fail                                                      |
  1092.          |                                                           |
  1093.         create(S->D) ------------------- count(S->D,f) --------------+
  1094.                                                                      |
  1095.                                                                      *
  1096.  
  1097.    When writing rule sets one must remember that the meter will normally
  1098.    try to match each packet in both directions.  It is particularly
  1099.    important that the rule set does not contain inconsistencies which
  1100.    will upset this process.
  1101.  
  1102.    Consider, for example, a rule set which counts packets from source
  1103.    network A to destination network B, but which ignores packets from
  1104.    source network B. This is an obvious example of an inconsistent rule
  1105.    set, since packets from network B should be counted as reverse
  1106.    packets for the A-to-B flow.
  1107.  
  1108.    This problem could be avoided by devising a language for specifying
  1109.    rule files and writing a compiler for it, thus making it much easier
  1110.    to produce correct rule sets.  Another approach would be to write a
  1111.    'rule set consistency checker' program, which could detect problems
  1112.    in hand-written rule sets.
  1113.  
  1114.    In the short term the best way to avoid these problems is to write
  1115.    rule sets which only clasify flows in the forward direction, and rely
  1116.    on the meter to handle reverse-travelling packets.
  1117.  
  1118.  
  1119.  
  1120.  
  1121.  
  1122. Brownlee, et. al.             Experimental                     [Page 20]
  1123.  
  1124. RFC 2063         Traffic Flow Measurement: Architecture     January 1997
  1125.  
  1126.  
  1127. 4.4 Rules and Rule Sets
  1128.  
  1129.    A rule set is an array of rules.  Rule sets are held within a meter
  1130.    as entries in an array of rule sets.  One member of this array is the
  1131.    CURRENT RULE SET, in that it is the one which is currently being used
  1132.    by the meter to classify incoming packets.
  1133.  
  1134.    Rule set 1 is built in to the meter and cannot be changed.  It is run
  1135.    when the meter is started up, and provides a very coarse reporting
  1136.    granularity; it is mainly useful for verifying that the meter is
  1137.    running, before a 'useful' rule set is downloaded to it.
  1138.  
  1139.    If the meter is instructed to use rule set 0, it will cease
  1140.    measuring; all packets will be ignored until another (non-zero) rule
  1141.    set is made current.
  1142.  
  1143.    Each rule in a rule set is structured as follows:
  1144.  
  1145.  
  1146.    +-------- test ---------+    +---- action -----+
  1147.    attribute & mask = value:    opcode,  parameter;
  1148.  
  1149.  
  1150.    Opcodes contain two flags:  'goto' and 'test.'  The PME maintains a
  1151.    Boolean indicator called the 'test indicator,' which is initially set
  1152.    (on).  Execution begins with rule 1, the first in the rule set.  It
  1153.    proceeds as follows:
  1154.  
  1155.    If the test indicator is on:
  1156.       Perform the test, i.e. AND the attribute value with the
  1157.          mask and compare it with the value.
  1158.       If these are equal the test has succeeded; perform the
  1159.          rule's action (below).
  1160.       If the test fails execute the next rule in the rule set.
  1161.       If there are no more rules in the rule set, return from the
  1162.          match() function indicating failure.
  1163.  
  1164.    If the test indicator is off, or the test (above) succeeded:
  1165.       Set the test indicator to this rule's test flag value.
  1166.       Determine the next rule to execute.
  1167.          If the opcode has its goto flag set, its parameter value
  1168.             specifies the number of the next rule.
  1169.          Opcodes which don't have their goto flags set either
  1170.             determine the next rule in special ways (Return),
  1171.             or they terminate execution (Ignore, Fail, Count,
  1172.             CountPkt).
  1173.       Perform the action.
  1174.  
  1175.  
  1176.  
  1177.  
  1178. Brownlee, et. al.             Experimental                     [Page 21]
  1179.  
  1180. RFC 2063         Traffic Flow Measurement: Architecture     January 1997
  1181.  
  1182.  
  1183.    The PME maintains two 'history' data structures.  The first, the
  1184.    'return' stack, simply records the index (i.e.  1-origin rule number)
  1185.    of each Gosub rule as it is executed; Return rules pop their Gosub
  1186.    rule index.  The second, the 'pattern' queue, is used to save
  1187.    information for later use in building a flow key.  A flow key is
  1188.    built by zeroing all its attribute values, then copying attribute and
  1189.    mask information from the pattern stack in the order it was enqueued.
  1190.  
  1191.    The opcodes are:
  1192.  
  1193.          opcode         goto    test
  1194.  
  1195.       1  Ignore           0       -
  1196.       2  Fail             0       -
  1197.       3  Count            0       -
  1198.       4  CountPkt         0       -
  1199.       5  Return           0       0
  1200.       6  Gosub            1       1
  1201.       7  GosubAct         1       0
  1202.       8  Assign           1       1
  1203.       9  AssignAct        1       0
  1204.      10  Goto             1       1
  1205.      11  GotoAct          1       0
  1206.      12  PushRuleTo       1       1
  1207.      13  PushRuleToAct    1       0
  1208.      14  PushPktTo        1       1
  1209.      15  PushPktToAct     1       0
  1210.  
  1211.    The actions they perform are:
  1212.  
  1213.    Ignore:         Stop matching, return from the match() function
  1214.                    indicating that the packet is to be ignored.
  1215.  
  1216.    Fail:           Stop matching, return from the match() function
  1217.                    indicating failure.
  1218.  
  1219.    Count:          Stop matching.  Save this rule's attribute name,
  1220.                    mask and value in the PME's pattern queue, then
  1221.                    construct a flow key for the flow to which this
  1222.                    this packet belongs.  Return from the match()
  1223.                    function indicating success.  The meter will use
  1224.                    the flow key to locate the flow record for this
  1225.                    packet's flow.
  1226.  
  1227.    CountPkt:       As for Count, except that the masked value from
  1228.                    the packet is saved in the PME's pattern queue
  1229.                    instead of the rule's value.
  1230.  
  1231.  
  1232.  
  1233.  
  1234. Brownlee, et. al.             Experimental                     [Page 22]
  1235.  
  1236. RFC 2063         Traffic Flow Measurement: Architecture     January 1997
  1237.  
  1238.  
  1239.    Gosub:          Call a rule-matching subroutine.  Push the current
  1240.                    rule number on the PME's return stack, set the
  1241.                    test indicator then goto the specified rule.
  1242.  
  1243.    GosubAct:       Same as Gosub, except that the test indicator is
  1244.                    cleared before going to the specified rule.
  1245.  
  1246.    Return:         Return from a rule-matching subroutine.  Pop the
  1247.                    number of the calling gosub rule from the PME's
  1248.                    'return' stack and add this rule's parameter value
  1249.                    to it to determine the 'target' rule.  Clear the
  1250.                    test indicator then goto the target rule.
  1251.  
  1252.                    A subroutine call appears in a rule set as a Gosub
  1253.                    rule followed by a small group of following rules.
  1254.                    Since a Return action clears the test flag, the
  1255.                    action of one of these 'following' rules will be
  1256.                    executed; this allows the subroutine to return a
  1257.                    result (in addition to any information it may save
  1258.                    in the PME's pattern queue).
  1259.  
  1260.    Assign:         Set the attribute specified in this rule to the
  1261.                    value specified in this rule.  Set the test
  1262.                    indicator then goto the specified rule.
  1263.  
  1264.    AssignAct:      Same as Assign, except that the test indicator
  1265.                    is cleared before going to the specified rule.
  1266.  
  1267.    Goto:           Set the test indicator then goto the
  1268.                    specified rule.
  1269.  
  1270.    GotoAct:        Clear the test indicator then goto the specified
  1271.                    rule.
  1272.  
  1273.    PushRuleTo:     Save this rule's attribute name, mask and value
  1274.                    in the PME's pattern queue. Set the test
  1275.                    indicator then goto the specified rule.
  1276.  
  1277.    PushRuleToAct:  Same as PushRuleTo, except that the test indicator
  1278.                    is cleared before going to the specified rule.
  1279.  
  1280.                    PushRuleTo actions may be used to save the value
  1281.                    and mask used in a test, or (if the test is not
  1282.                    performed) to save an arbitrary value and mask.
  1283.  
  1284.  
  1285.  
  1286.  
  1287.  
  1288.  
  1289.  
  1290. Brownlee, et. al.             Experimental                     [Page 23]
  1291.  
  1292. RFC 2063         Traffic Flow Measurement: Architecture     January 1997
  1293.  
  1294.  
  1295.    PushPktTo:      Save this rule's attribute name, mask, together
  1296.                    with the masked value from the packet, in the
  1297.                    PME's pattern queue.  SET the test indicator then
  1298.                    goto the specified rule.
  1299.  
  1300.    PushPktToAct:   Same as PushPktTo, except that the test indicator
  1301.                    is cleared before going to the specified rule.
  1302.  
  1303.                    PushPktTo actions may be used to save a value from
  1304.                    the packet using a specified mask.  The test in
  1305.                    PushPktTo rules will almost never be executed.
  1306.  
  1307.    As well as the attributes applying directly to packets (such as
  1308.    SourcePeerAddress, DestTransAddress, etc.)  the PME implements
  1309.    several further attribtes.  These are:
  1310.  
  1311.    Null:       Tests performed on the Null attribute always succeed.
  1312.  
  1313.    v1 .. v5:   v1, v2, v3, v4 and v5 are 'meter variables.'  They
  1314.                provide a way to pass parameters into rule-matching
  1315.                subroutines.  Each may hold the name of a normal
  1316.                attribute; its value is set by an Assign action.
  1317.                When a meter variable appears as the attribute of a
  1318.                rule, its value specifies the actual attribute to be
  1319.                tested.  For example, if v1 had been assigned
  1320.                SourcePeerAddress as its value, a rule with v1 as its
  1321.                attribute would actually test SourcePeerAddress.
  1322.  
  1323.    SourceClass, DestClass, FlowClass,
  1324.    SourceKind, DestKind, FlowKind:
  1325.                These six attributes may be set by executing PushRuleto
  1326.                actions.  They allow the PME to save (in flow records)
  1327.                information which has been built up during matching.
  1328.                Since their values are only defined when matching is
  1329.                complete (and the flow key is built) their values may
  1330.                not be tested in rules.
  1331.  
  1332. 4.5 Maintaining the Flow Table
  1333.  
  1334.    The flow table may be thought of as a 1-origin array of flow records.
  1335.    (A particular implementation may, of course, use whatever data
  1336.    structure is most suitable).  When the meter starts up there are no
  1337.    known flows; all the flow records are in the 'inactive' state.
  1338.  
  1339.    Each time a packet is seen for a flow which is not in the current
  1340.    flow set a flow record is set up for it; the state of such a record
  1341.    is 'current.'  When selecting a record for the new flow the meter
  1342.    searches the flow table for a 'inactive' record - there is no
  1343.  
  1344.  
  1345.  
  1346. Brownlee, et. al.             Experimental                     [Page 24]
  1347.  
  1348. RFC 2063         Traffic Flow Measurement: Architecture     January 1997
  1349.  
  1350.  
  1351.    particular significance in the ordering of records within the table.
  1352.  
  1353.    Flow data may be collected by a 'meter reader' at any time.  There is
  1354.    no requirement for collections to be synchronized.  The reader may
  1355.    collect the data in any suitable manner, for example it could upload
  1356.    a copy of the whole flow table using a file transfer protocol, or it
  1357.    could read the records in the current flow set row by row using a
  1358.    suitable data transfer protocol.
  1359.  
  1360.    The meter keeps information about collections, in particular it
  1361.    maintains a LastCollectTime variable which remembers the time the
  1362.    last collection was made.  A second variable, InactivityTime,
  1363.    specifies the minimum time the meter will wait before considering
  1364.    that a flow is idle.
  1365.  
  1366.    The meter must recover records used for idle flows, if only to
  1367.    prevent it running out of flow records.  Recovered flow records are
  1368.    returned to the 'inactive' state.  A variety of recovery strategies
  1369.    are possible, including the following:
  1370.  
  1371.    One possible recovery strategy is to recover idle flow records as
  1372.    soon as possible after their data has been collected.  To implement
  1373.    this the meter could run a background process which scans the flow
  1374.    table looking for 'current' flows whose 'last packet' time is earlier
  1375.    than the meter's LastCollectTime.  This would be suitable for use
  1376.    when one was interested in measuring flow lifetimes.
  1377.  
  1378.    Another recovery strategy is to leave idle flows alone as long as
  1379.    possible, which would be suitable if one was only interested in
  1380.    measuring total traffic volumes.  It could be implemented by having
  1381.    the meter search for collected idle flows only when it ran out of
  1382.    'inactive' flow records.
  1383.  
  1384.    One further factor a meter should consider before recovering a flow
  1385.    is the number of meter readers which have collected the flow's data.
  1386.    If there are multiple meter readers operating, network Operations
  1387.    personnel should be able to specify the minimum number of meters - or
  1388.    perhaps a specific list of meters - which should collect a flow's
  1389.    data before its memory can be recovered.  This issue will be further
  1390.    developed in the future.
  1391.  
  1392. 4.6 Handling Increasing Traffic Levels
  1393.  
  1394.    Under normal conditions the meter reader specifies which set of usage
  1395.    records it wants to collect, and the meter provides them.
  1396.  
  1397.    If memory usage rises above the high-water mark the meter should
  1398.    switch to a STANDBY RULE SET so as to increase the granularity of
  1399.  
  1400.  
  1401.  
  1402. Brownlee, et. al.             Experimental                     [Page 25]
  1403.  
  1404. RFC 2063         Traffic Flow Measurement: Architecture     January 1997
  1405.  
  1406.  
  1407.    flow collection and decrease the rate at which new flows are created.
  1408.    When the manager, usually as part of a regular poll, becomes aware
  1409.    that the meter is using its standby rule set, it could decrease the
  1410.    interval between collections.  The meter should also increase its
  1411.    efforts to recover flow memory so as to reduce the number of idle
  1412.    flows in memory.  When the situation returns to normal, the manager
  1413.    may request the meter to switch back to its normal rule set.
  1414.  
  1415. 5 Meter Readers
  1416.  
  1417.    Usage data is accumulated by a meter (e.g.  in a router) as memory
  1418.    permits.  It is collected at regular reporting intervals by meter
  1419.    readers, as specified by a manager.  The collected data is recorded
  1420.    in a disk file called a FLOW DATA FILE, as a sequence of USAGE
  1421.    RECORDS.
  1422.  
  1423.    The following sections describe the contents of usage records and
  1424.    flow data files.  Note, however, that at this stage the details of
  1425.    such records and files is not specified in the architecture.
  1426.    Specifying a common format for them would be a worthwhile future
  1427.    development.
  1428.  
  1429. 5.1 Identifying Flows in Flow Records
  1430.  
  1431.    Once a packet has been classified and is ready to be counted, an
  1432.    appropriate flow data record must already exist in the flow table;
  1433.    otherwise one must be created.  The flow record has a flexible format
  1434.    where unnecessary identification attributes may be omitted.  The
  1435.    determination of which attributes of the flow record to use, and of
  1436.    what values to put in them, is specified by the current rule set.
  1437.  
  1438.    Note that the combination of start time, rule set id and subscript
  1439.    (row number in the flow table) provide a unique flow identifier,
  1440.    regardless of the values of its other attributes.
  1441.  
  1442.    The current rule set may specify additional information, e.g.  a
  1443.    computed attribute value such as FlowKind, which is to be placed in
  1444.    the attribute section of the usage record.  That is, if a particular
  1445.    flow is matched by the rule set, then the corresponding flow record
  1446.    should be marked not only with the qualifying identification
  1447.    attributes, but also with the additional information.  Using this
  1448.    feature, several flows may each carry the same FlowKind value, so
  1449.    that the resulting usage records can be used in post-processing or
  1450.    between meter reader and meter as a criterion for collection.
  1451.  
  1452.  
  1453.  
  1454.  
  1455.  
  1456.  
  1457.  
  1458. Brownlee, et. al.             Experimental                     [Page 26]
  1459.  
  1460. RFC 2063         Traffic Flow Measurement: Architecture     January 1997
  1461.  
  1462.  
  1463. 5.2 Usage Records, Flow Data Files
  1464.  
  1465.    The collected usage data will be stored in flow data files on the
  1466.    meter reader, one file for each meter.  As well as containing the
  1467.    measured usage data, flow data files must contain information
  1468.    uniquely identifiying the meter from which it was collected.
  1469.  
  1470.    A USAGE RECORD contains the descriptions of and values for one or
  1471.    more flows.  Quantities are counted in terms of number of packets and
  1472.    number of bytes per flow.  Each usage record contains the entity
  1473.    identifier of the meter (a network address), a time stamp and a list
  1474.    of reported flows (FLOW DATA RECORDS). A meter reader will build up a
  1475.    file of usage records by regularly collecting flow data from a meter,
  1476.    using this data to build usage records and concatenating them to the
  1477.    tail of a file.  Such a file is called a FLOW DATA FILE.
  1478.  
  1479.    A usage record contains the following information in some form:
  1480.  
  1481.    +-------------------------------------------------------------------+
  1482.    |    RECORD IDENTIFIERS:                                            |
  1483.    |      Meter Id (& digital signature if required)                   |
  1484.    |      Timestamp                                                    |
  1485.    |      Collection Rules ID                                          |
  1486.    +-------------------------------------------------------------------+
  1487.    |    FLOW IDENTIFIERS:            |    COUNTERS                     |
  1488.    |      Address List               |       Packet Count              |
  1489.    |      Subscriber ID (Optional)   |       Byte Count                |
  1490.    |      Attributes (Optional)      |    Flow Start/Stop Time         |
  1491.    +-------------------------------------------------------------------+
  1492.  
  1493. 5.3 Meter to Meter Reader:  Usage Record Transmission
  1494.  
  1495.    The usage record contents are the raison d'etre of the system.  The
  1496.    accuracy, reliability, and security of transmission are the primary
  1497.    concerns of the meter/meter reader exchange.  Since errors may occur
  1498.    on networks, and Internet packets may be dropped, some mechanism for
  1499.    ensuring that the usage information is transmitted intact is needed.
  1500.  
  1501.    Flow data is moved from meter to meter reader via a series of
  1502.    protocol exchanges between them.  This may be carried out in various
  1503.    ways, moving individual attribute values, complete flows, or the
  1504.    entire flow table (i.e.  all the active flows).  One possible method
  1505.    of achieving this transfer is to use SNMP; the 'Traffic Flow
  1506.    Measurement:  Meter MIB' document [4] gives details.  Note that this
  1507.    is simply one example; the transfer of flow data from meter to meter
  1508.    reader is not specified in this document.
  1509.  
  1510.  
  1511.  
  1512.  
  1513.  
  1514. Brownlee, et. al.             Experimental                     [Page 27]
  1515.  
  1516. RFC 2063         Traffic Flow Measurement: Architecture     January 1997
  1517.  
  1518.  
  1519.    The reliability of the data transfer method under light, normal, and
  1520.    extreme network loads should be understood before selecting among
  1521.    collection methods.
  1522.  
  1523.    In normal operation the meter will be running a rule file which
  1524.    provides the required degree of flow reporting granularity, and the
  1525.    meter reader(s) will collect the flow data often enough to allow the
  1526.    meter's garbage collection mechanism to maintain a stable level of
  1527.    memory usage.
  1528.  
  1529.    In the worst case traffic may increase to the point where the meter
  1530.    is in danger of running completely out of flow memory.  The meter
  1531.    implementor must decide how to handle this, for example by switching
  1532.    to a default (extremely coarse granularity) rule set, by sending a
  1533.    trap to the manager, or by attempting to dump flow data to the meter
  1534.    reader.
  1535.  
  1536.    Users of the Traffic Flow Measurement system should analyse their
  1537.    requirements carefully and assess for themselves whether it is more
  1538.    important to attempt to collect flow data at normal granularity
  1539.    (increasing the collection frequency as needed to keep up with
  1540.    traffic volumes), or to accept flow data with a coarser granularity.
  1541.    Similarly, it may be acceptable to lose flow data for a short time in
  1542.    return for being sure that the meter keeps running properly, i.e.  is
  1543.    not overwhelmed by rising traffic levels.
  1544.  
  1545. 6 Managers
  1546.  
  1547.    A manager configures meters and controls meter readers.  It does this
  1548.    via the interactions described below.
  1549.  
  1550. 6.1 Between Manager and Meter:  Control Functions
  1551.  
  1552.   - DOWNLOAD RULE SET: A meter may hold an array of rule sets.  One of
  1553.     these, the 'default' rule set, is built in to the meter and cannot
  1554.     be changed; the others must be downloaded by the manager.  A
  1555.     manager may use any suitable protocol exchange to achieve this, for
  1556.     example an FTP file transfer or a series of SNMP SETs, one for each
  1557.     row of the rule set.
  1558.  
  1559.   - SWITCH TO SPECIFIED RULE SET: Once the rule sets have been
  1560.     downloaded, the manager must instruct the meter which rule set it
  1561.     is to actually run (i.e.  which is to be the current rule set), and
  1562.     which is to be the standby rule set.
  1563.  
  1564.   - SET HIGH WATER MARK: A percentage value interpreted by the meter
  1565.     which tells the meter when to switch to its standby rule set, so as
  1566.     to increase the granularity of the flows and conserve the meter's
  1567.  
  1568.  
  1569.  
  1570. Brownlee, et. al.             Experimental                     [Page 28]
  1571.  
  1572. RFC 2063         Traffic Flow Measurement: Architecture     January 1997
  1573.  
  1574.  
  1575.     flow memory.  Once this has happened, the manager may also change
  1576.     the polling frequency or the meter's control parameters (so as to
  1577.     increase the rate at which the meter can recover memory from idle
  1578.     flows).
  1579.  
  1580.     If the high traffic levels persist, the meter's normal rule set may
  1581.     have to be rewritten to permanently reduce the reporting
  1582.     granularity.
  1583.  
  1584.   - SET FLOW TERMINATION PARAMETERS: The meter should have the good
  1585.     sense in situations where lack of resources may cause data loss to
  1586.     purge flow records from its tables.  Such records may include:
  1587.  
  1588.       -  Flows that have already been reported to at least one meter
  1589.          reader, and show no activity since the last report,
  1590.  
  1591.       -  Oldest flows, or
  1592.  
  1593.       -  Flows with the smallest number of unreported packets.
  1594.  
  1595.  
  1596.   - SET INACTIVITY TIMEOUT: This is a time in seconds since the last
  1597.     packet was seen for a flow.  Flow records may be reclaimed if they
  1598.     have been idle for at least this amount of time, and have been
  1599.     collected in accordance with the current collection criteria.
  1600.  
  1601. 6.2 Between Manager and Meter Reader:  Control Functions
  1602.  
  1603.    Because there are a number of parameters that must be set for traffic
  1604.    flow measurement to function properly, and viable settings may change
  1605.    as a result of network traffic characteristics, it is desirable to
  1606.    have dynamic network management as opposed to static meter
  1607.    configurations.  Many of these operations have to do with space
  1608.    tradeoffs - if memory at the meter is exhausted, either the reporting
  1609.    interval must be decreased or a coarser granularity of aggregation
  1610.    must be used so that more data fits into less space.
  1611.  
  1612.    Increasing the reporting interval effectively stores data in the
  1613.    meter; usage data in transit is limited by the effective bandwidth of
  1614.    the virtual link between the meter and the meter reader, and since
  1615.    these limited network resources are usually also used to carry user
  1616.    data (the purpose of the network), the level of traffic flow
  1617.    measurement traffic should be kept to an affordable fraction of the
  1618.    bandwidth.  ("Affordable" is a policy decision made by the network
  1619.    Operations personnel).  At any rate, it must be understood that the
  1620.    operations below do not represent the setting of independent
  1621.    variables; on the contrary, each of the values set has a direct and
  1622.    measurable effect on the behaviour of the other variables.
  1623.  
  1624.  
  1625.  
  1626. Brownlee, et. al.             Experimental                     [Page 29]
  1627.  
  1628. RFC 2063         Traffic Flow Measurement: Architecture     January 1997
  1629.  
  1630.  
  1631.    Network management operations follow:
  1632.  
  1633.   - MANAGER and METER READER IDENTIFICATION: The manager should ensure
  1634.     that meters report to the correct set of collection stations, and
  1635.     take steps to prevent unauthorised access to usage information.
  1636.     The collection stations so identified should be prepared to poll if
  1637.     necessary and accept data from the appropriate meters.  Alternate
  1638.     collection stations may be identified in case both the primary
  1639.     manager and the primary collection station are unavailable.
  1640.     Similarly, alternate managers may be identified.
  1641.  
  1642.   - REPORTING INTERVAL CONTROL: The usual reporting interval should be
  1643.     selected to cope with normal traffic patterns.  However, it may be
  1644.     possible for a meter to exhaust its memory during traffic spikes
  1645.     even with a correctly set reporting interval.  Some mechanism must
  1646.     be available for the meter to tell the manager that it is in danger
  1647.     of exhausting its memory (by declaring a 'high water' condition),
  1648.     and for the manager to arbitrate (by decreasing the polling
  1649.     interval, letting nature take its course, or by telling the meter
  1650.     to ask for help sooner next time).
  1651.  
  1652.   - GRANULARITY CONTROL: Granularity control is a catch-all for all the
  1653.     parameters that can be tuned and traded to optimise the system's
  1654.     ability to reliably measure and store information on all the
  1655.     traffic (or as close to all the traffic as an administration
  1656.     requires).  Granularity
  1657.  
  1658.       -  Controls flow-id granularities for each interface, and
  1659.  
  1660.       -  Determines the number of buckets into which user traffic will
  1661.          be lumped together.
  1662.  
  1663.     Since granularity is controlled by the meter's current rule set,
  1664.     the manager can only change it by requesting the meter to switch to
  1665.     a different rule set.  The new rule set could be downloaded when
  1666.     required, or it could have been downloaded as part of the meter's
  1667.     initial configuration.
  1668.  
  1669.   - FLOW LIFETIME CONTROL: Flow termination parameters include timeout
  1670.     parameters for obsoleting inactive flows and removing them from
  1671.     tables and maximum flow lifetimes.  This is intertwined with
  1672.     reporting interval and granularity, and must be set in accordance
  1673.     with the other parameters.
  1674.  
  1675.  
  1676.  
  1677.  
  1678.  
  1679.  
  1680.  
  1681.  
  1682. Brownlee, et. al.             Experimental                     [Page 30]
  1683.  
  1684. RFC 2063         Traffic Flow Measurement: Architecture     January 1997
  1685.  
  1686.  
  1687. 6.3 Exception Conditions
  1688.  
  1689.    Exception conditions must be handled, particularly occasions when the
  1690.    meter runs out of buffer space.  Since, to prevent counting any
  1691.    packet twice, packets can only be counted in a single flow at any
  1692.    given time, discarding records will result in the loss of
  1693.    information.  The mechanisms to deal with this are as follows:
  1694.  
  1695.   - METER OUTAGES: In case of impending meter outages (controlled
  1696.     crashes, etc.)  the meter could send a trap to the manager.  The
  1697.     manager could then request one or more meter readers to pick up the
  1698.     usage record from the meter.
  1699.  
  1700.     Following an uncontrolled meter outage such as a power failure, the
  1701.     meter could send a trap to the manager indicating that it has
  1702.     restarted.  The manager could then download the meter's correct
  1703.     rule set and advise the meter reader(s) that the meter is running
  1704.     again.  Alternatively, the meter reader may discover from its
  1705.     regular poll that a meter has failed and restarted.  It could then
  1706.     advise the manager of this, instead of relying on a trap from the
  1707.     meter.
  1708.  
  1709.   - METER READER OUTAGES: If the collection system is down or isolated,
  1710.     the meter should try to inform the manager of its failure to
  1711.     communicate with the collection system.  Usage data is maintained
  1712.     in the flows' rolling counters, and can be recovered when the meter
  1713.     reader is restarted.
  1714.  
  1715.   - MANAGER OUTAGES: If the manager fails for any reason, the meter
  1716.     should continue measuring and the meter reader(s) should keep
  1717.     gathering usage records.
  1718.  
  1719.   - BUFFER PROBLEMS: The network manager may realise that there is a
  1720.     'low memory' condition in the meter.  This can usually be
  1721.     attributed to the interaction between the following controls:
  1722.  
  1723.       -  The reporting interval is too infrequent,
  1724.  
  1725.       -  The reporting granularity is too fine, or
  1726.  
  1727.       -  The throughput/bandwidth of circuits carrying the usage
  1728.          data is too low.
  1729.  
  1730.     The manager may change any of these parameters in response to the
  1731.     meter (or meter reader's) plea for help.
  1732.  
  1733.  
  1734.  
  1735.  
  1736.  
  1737.  
  1738. Brownlee, et. al.             Experimental                     [Page 31]
  1739.  
  1740. RFC 2063         Traffic Flow Measurement: Architecture     January 1997
  1741.  
  1742.  
  1743. 6.4 Standard Rule Sets
  1744.  
  1745.    Although the rule table is a flexible tool, it can also become very
  1746.    complex.  It may be helpful to develop some rule sets for common
  1747.    applications:
  1748.  
  1749.   - PROTOCOL TYPE: The meter records packets by protocol type.  This
  1750.     will be the default rule table for Traffic Flow Meters.
  1751.  
  1752.   - ADJACENT SYSTEMS: The meter records packets by the MAC address of
  1753.     the Adjacent Systems (neighbouring originator or next-hop).
  1754.     (Variants on this table are "report source" or "report sink" only.)
  1755.     This strategy might be used by a regional or backbone network which
  1756.     wants to know how much aggregate traffic flows to or from its
  1757.     subscriber networks.
  1758.  
  1759.   - END SYSTEMS: The meter records packets by the IP address pair
  1760.     contained in the packet.  (Variants on this table are "report
  1761.     source" or "report sink" only.)  This strategy might be used by an
  1762.     End System network to get detailed host traffic matrix usage data.
  1763.  
  1764.   - TRANSPORT TYPE: The meter records packets by transport address; for
  1765.     IP packets this provides usage information for the various IP
  1766.     services.
  1767.  
  1768.   - HYBRID SYSTEMS: Combinations of the above, e.g.  for one interface
  1769.     report End Systems, for another interface report Adjacent Systems.
  1770.     This strategy might be used by an enterprise network to learn
  1771.     detail about local usage and use an aggregate count for the shared
  1772.     regional network.
  1773.  
  1774.  
  1775.  
  1776.  
  1777.  
  1778.  
  1779.  
  1780.  
  1781.  
  1782.  
  1783.  
  1784.  
  1785.  
  1786.  
  1787.  
  1788.  
  1789.  
  1790.  
  1791.  
  1792.  
  1793.  
  1794. Brownlee, et. al.             Experimental                     [Page 32]
  1795.  
  1796. RFC 2063         Traffic Flow Measurement: Architecture     January 1997
  1797.  
  1798.  
  1799. 7 APPENDICES
  1800.  
  1801. 7.1 Appendix A: Network Characterisation
  1802.  
  1803.    Internet users have extraordinarily diverse requirements.  Networks
  1804.    differ in size, speed, throughput, and processing power, among other
  1805.    factors.  There is a range of traffic flow measurement capabilities
  1806.    and requirements.  For traffic flow measurement purposes, the
  1807.    Internet may be viewed as a continuum which changes in character as
  1808.    traffic passes through the following representative levels:
  1809.  
  1810.  
  1811.         International                    |
  1812.         Backbones/National        ---------------
  1813.                                  /              \
  1814.         Regional/MidLevel     ----------   ----------
  1815.                              /   \     \  /   /     \
  1816.         Stub/Enterprise     ---   ---   ---   ----   ----
  1817.                             |||   |||   |||   ||||   ||||
  1818.         End-Systems/Hosts   xxx   xxx   xxx   xxxx   xxxx
  1819.  
  1820.    Note that mesh architectures can also be built out of these
  1821.    components, and that these are merely descriptive terms.  The nature
  1822.    of a single network may encompass any or all of the descriptions
  1823.    below, although some networks can be clearly identified as a single
  1824.    type.
  1825.  
  1826.    BACKBONE networks are typically bulk carriers that connect other
  1827.    networks.  Individual hosts (with the exception of network management
  1828.    devices and backbone service hosts) typically are not directly
  1829.    connected to backbones.
  1830.  
  1831.    REGIONAL networks are closely related to backbones, and differ only
  1832.    in size, the number of networks connected via each port, and
  1833.    geographical coverage.  Regionals may have directly connected hosts,
  1834.    acting as hybrid backbone/stub networks.  A regional network is a
  1835.    SUBSCRIBER to the backbone.
  1836.  
  1837.    STUB/ENTERPRISE networks connect hosts and local area networks.
  1838.    STUB/ENTERPRISE networks are SUBSCRIBERS to regional and backbone
  1839.    networks.
  1840.  
  1841.    END SYSTEMS, colloquially HOSTS, are SUBSCRIBERS to any of the above
  1842.    networks.
  1843.  
  1844.    Providing a uniform identification of the SUBSCRIBER in finer
  1845.    granularity than that of end-system, (e.g.  user/account), is beyond
  1846.    the scope of the current architecture, although an optional attribute
  1847.  
  1848.  
  1849.  
  1850. Brownlee, et. al.             Experimental                     [Page 33]
  1851.  
  1852. RFC 2063         Traffic Flow Measurement: Architecture     January 1997
  1853.  
  1854.  
  1855.    in the traffic flow measurement record may carry system-specific
  1856.    "accountable (billable) party" labels so that meters can implement
  1857.    proprietary or non-standard schemes for the attribution of network
  1858.    traffic to responsible parties.
  1859.  
  1860. 7.2 Appendix B: Recommended Traffic Flow Measurement Capabilities
  1861.  
  1862.    Initial recommended traffic flow measurement conventions are outlined
  1863.    here according to the following Internet building blocks.  It is
  1864.    important to understand what complexity reporting introduces at each
  1865.    network level.  Whereas the hierarchy is described top-down in the
  1866.    previous section, reporting requirements are more easily addressed
  1867.    bottom-up.
  1868.  
  1869.         End-Systems
  1870.         Stub Networks
  1871.         Enterprise Networks
  1872.         Regional Networks
  1873.         Backbone Networks
  1874.  
  1875.    END-SYSTEMS are currently responsible for allocating network usage to
  1876.    end-users, if this capability is desired.  From the Internet Protocol
  1877.    perspective, end-systems are the finest granularity that can be
  1878.    identified without protocol modifications.  Even if a meter violated
  1879.    protocol boundaries and tracked higher-level protocols, not all
  1880.    packets could be correctly allocated by user, and the definition of
  1881.    user itself varies too widely from operating system to operating
  1882.    system (e.g.  how to trace network usage back to users from shared
  1883.    processes).
  1884.  
  1885.    STUB and ENTERPRISE networks will usually collect traffic data either
  1886.    by end- system network address or network address pair if detailed
  1887.    reporting is required in the local area network.  If no local
  1888.    reporting is required, they may record usage information in the exit
  1889.    router to track external traffic only.  (These are the only networks
  1890.    which routinely use attributes to perform reporting at granularities
  1891.    finer than end-system or intermediate-system network address.)
  1892.  
  1893.    REGIONAL networks are intermediate networks.  In some cases,
  1894.    subscribers will be enterprise networks, in which case the
  1895.    intermediate system network address is sufficient to identify the
  1896.    regional's immediate subscriber.  In other cases, individual hosts or
  1897.    a disjoint group of hosts may constitute a subscriber.  Then end-
  1898.    system network address pairs need to be tracked for those
  1899.    subscribers.  When the source may be an aggregate entity (such as a
  1900.    network, or adjacent router representing traffic from a world of
  1901.    hosts beyond) and the destination is a singular entity (or vice
  1902.    versa), the meter is said to be operating as a HYBRID system.
  1903.  
  1904.  
  1905.  
  1906. Brownlee, et. al.             Experimental                     [Page 34]
  1907.  
  1908. RFC 2063         Traffic Flow Measurement: Architecture     January 1997
  1909.  
  1910.  
  1911.    At the regional level, if the overhead is tolerable it may be
  1912.    advantageous to report usage both by intermediate system network
  1913.    address (e.g.  adjacent router address) and by end-system network
  1914.    address or end-system network address pair.
  1915.  
  1916.    BACKBONE networks are the highest level networks operating at higher
  1917.    link speeds and traffic levels.  The high volume of traffic will in
  1918.    most cases preclude detailed traffic flow measurement.  Backbone
  1919.    networks will usually account for traffic by adjacent routers'
  1920.    network addresses.
  1921.  
  1922. 7.3 Appendix C: List of Defined Flow Attributes
  1923.  
  1924.    This Appendix provides a checklist of the attributes defined to date;
  1925.    others will be added later as the Traffic Measurement Architecture is
  1926.    further developed.
  1927.  
  1928.    0  Null
  1929.    1  Flow Subscript                Integer    Flow table info
  1930.    2  Flow Status                   Integer
  1931.  
  1932.    4  Source Interface              Integer    Source Address
  1933.    5  Source Adjacent Type          Integer
  1934.    6  Source Adjacent Address       String
  1935.    7  Source Adjacent Mask          String
  1936.    8  Source Peer Type              Integer
  1937.    9  Source Peer Address           String
  1938.   10  Source Peer Mask              String
  1939.   11  Source Trans Type             Integer
  1940.   12  Source Trans Address          String
  1941.   13  Source Trans Mask             String
  1942.  
  1943.   14  Destination Interface         Integer    Destination Address
  1944.   15  Destination Adjacent Type     Integer
  1945.   16  Destination Adjacent Address  String
  1946.   17  Destination AdjacentMask      String
  1947.   18  Destination PeerType          Integer
  1948.   19  Destination PeerAddress       String
  1949.   20  Destination PeerMask          String
  1950.   21  Destination TransType         Integer
  1951.   22  Destination TransAddress      String
  1952.   23  Destination TransMask         String
  1953.  
  1954.   24  Packet Scale Factor           Integer    'Other' attributes
  1955.   25  Byte Scale Factor             Integer
  1956.   26  Rule Set Number               Integer
  1957.   27  Forward Bytes                 Counter    Source-to-Dest counters
  1958.   28  Forward Packets               Counter
  1959.  
  1960.  
  1961.  
  1962. Brownlee, et. al.             Experimental                     [Page 35]
  1963.  
  1964. RFC 2063         Traffic Flow Measurement: Architecture     January 1997
  1965.  
  1966.  
  1967.   29  Reverse Bytes                 Counter    Dest-to-Source counters
  1968.   30  Reverse Packets               Counter
  1969.   31  First Time                    TimeTicks  Activity times
  1970.   32  Last Active Time              TimeTicks
  1971.   33  Source Subscriber ID          String     Session attributes
  1972.   34  Destination Subscriber ID     String
  1973.   35  Session ID                    String
  1974.  
  1975.   36  Source Class                  Integer    'Computed' attributes
  1976.   37  Destination Class             Integer
  1977.   38  Flow Class                    Integer
  1978.   39  Source Kind                   Integer
  1979.   40  Destination Kind              Integer
  1980.   41  Flow Kind                     Integer
  1981.  
  1982.   51  V1                            Integer    Meter variables
  1983.   52  V2                            Integer
  1984.   53  V3                            Integer
  1985.   54  V4                            Integer
  1986.   55  V5                            Integer
  1987.  
  1988. 7.4 Appendix D: List of Meter Control Variables
  1989.  
  1990.       Current Rule Set Number       Integer
  1991.       Standby Rule Set Number       Integer
  1992.       High Water Mark               Percentage
  1993.       Flood Mark                    Percentage
  1994.       Inactivity Timeout (seconds)  Integer
  1995.       Last Collect Time             TimeTicks
  1996.  
  1997. 8 Acknowledgments
  1998.  
  1999.    This document was initially produced under the auspices of the IETF's
  2000.    Internet Accounting Working Group with assistance from SNMP, RMON and
  2001.    SAAG working groups.  This version documents the implementation work
  2002.    done by the Internet Accounting Working Group, and is intended to
  2003.    provide a starting point for the Realtime Traffic Flow Measurement
  2004.    Working Group.  Particular thanks are due to Stephen Stibler (IBM
  2005.    Research) for his patient and careful comments during the preparation
  2006.    of this memo.
  2007.  
  2008.  
  2009.  
  2010.  
  2011.  
  2012.  
  2013.  
  2014.  
  2015.  
  2016.  
  2017.  
  2018. Brownlee, et. al.             Experimental                     [Page 36]
  2019.  
  2020. RFC 2063         Traffic Flow Measurement: Architecture     January 1997
  2021.  
  2022.  
  2023. 9 References
  2024.  
  2025.    [1] Mills, C., Hirsch, G. and G. Ruth, "Internet Accounting
  2026.    Background", RFC 1272, Bolt Beranek and Newman Inc., Meridian
  2027.    Technology Corporation, November 1991.
  2028.  
  2029.    [2] International Standards Organisation (ISO), "Management
  2030.    Framework," Part 4 of Information Processing Systems Open
  2031.    Systems Interconnection Basic Reference Model, ISO 7498-4,
  2032.    1994.
  2033.  
  2034.    [3] IEEE 802.3/ISO 8802-3 Information Processing Systems -
  2035.    Local Area Networks - Part 3:  Carrier sense multiple access
  2036.    with collision detection (CSMA/CD) access method and physical
  2037.    layer specifications, 2nd edition, September 21, 1990.
  2038.  
  2039.    [4] Brownlee, N., "Traffic Flow Measurement:  Meter MIB",
  2040.    RFC 2064, The University of Auckland, January 1997.
  2041.  
  2042. 10 Security Considerations
  2043.  
  2044.    Security issues are not discussed in detail in this document.  The
  2045.    meter's management and collection protocols are responsible for
  2046.    providing sufficient data integrity and confidentiality.
  2047.  
  2048. 11 Authors' Addresses
  2049.  
  2050.    Nevil Brownlee
  2051.    Information Technology Systems & Services
  2052.    The University of Auckland
  2053.  
  2054.    Phone: +64 9 373 7599 x8941
  2055.    EMail: n.brownlee @auckland.ac.nz
  2056.  
  2057.  
  2058.    Cyndi Mills
  2059.    BBN Systems and Technologies
  2060.  
  2061.    Phone: +1 617 873 4143
  2062.    EMail: cmills@bbn.com
  2063.  
  2064.  
  2065.    Greg Ruth
  2066.    GTE Laboratories, Inc
  2067.  
  2068.    Phone: +1 617 466 2448
  2069.    EMail: gruth@gte.com
  2070.  
  2071.  
  2072.  
  2073.  
  2074. Brownlee, et. al.             Experimental                     [Page 37]
  2075.  
  2076.