OpenDev Migration Patch
This commit was bulk generated and pushed by the OpenDev sysadmins as a part of the Git hosting and code review systems migration detailed in these mailing list posts: http://lists.openstack.org/pipermail/openstack-discuss/2019-March/003603.html http://lists.openstack.org/pipermail/openstack-discuss/2019-April/004920.html Attempts have been made to correct repository namespaces and hostnames based on simple pattern matching, but it's possible some were updated incorrectly or missed entirely. Please reach out to us via the contact information listed at https://opendev.org/ with any questions you may have.
|2 months ago|
|broadview_lib||2 years ago|
|doc||3 years ago|
|.gitreview||2 months ago|
|CONTRIBUTING.rst||3 years ago|
|HACKING.rst||3 years ago|
|LICENSE||3 years ago|
|MANIFEST.in||3 years ago|
|README.md||2 years ago|
|babel.cfg||3 years ago|
|requirements.txt||3 years ago|
|setup.cfg||3 years ago|
|setup.py||3 years ago|
|test-requirements.txt||3 years ago|
|tox.ini||2 years ago|
This repo supports versions of BroadView up to, but not including, version 3 of the agent protocol. For all later versions of BroadView, please visit https://github.com/Broadcom-Switch/broadview-lib.
broadview-lib is a library that provides an interface to Broadcom’s
BroadView instrumentation functionality.
BroadView is an open source software suite that enables advanced analytics in next-generation networks. Troubleshooting network problems and ensuring application SLAs are very complex tasks. In cloud networks, overlay technologies reduce visibility into packet flows, thereby making it even more difficult to analyze issues and ensure SLAs. OpenStack projects such as Monasca provide monitoring-as-a-service to deliver usage metrics from applications and tenant networks; however, underlay monitoring is not supported. Ensuring application SLAs requires overlay mapping to the underlay, and optimal performance of underlay infrastructure is essential.
BroadView-based solutions enable programmable access to underlay monitoring, facilitating applications to gather advanced analytics in a highly scalable manner.
Buffer Statistics Tracking (BST) is one of the most important features for enabling rich congestion analytics. Network Traffic is bursty by nature and microbursts occur when there is transient congestion. Microbursts are difficult to detect using traditional port drop counts. Broadcom silicon provides the ability to monitor MMU buffer utilization counts as part of the BST feature. It provides network administrators and applications improved telemetry on the usage of various ingress and egress buffers, without disrupting regular packet forwarding operations. There are thousands of counters available across various ports, port groups, and service pools that can be utilized by the applications for instantaneous monitoring in a scalable way. BST tracks ingress-, egress-, and device-based use-counts for both unicast and multicast flows. The actual use-counts vary depending on the chip set.
More information on BroadView, BST, and what they provide can be found at:
A BroadView agent is software running on platforms that support BroadView. It exposes a JSON-RPC, REST-like API for configuring the agent to report statistics such as BST. It also report statistics to agents or collectors that are designed to receive these reports. These reports are also transmitted using JSON-RPC. All connections to and from the agent are based on HTTP 1.1.
broadview-lib is designed to provide the underlying infrastructure that is needed for the development of Python applications that interact with a BroadView agent. Using broadview-lib, a Python application can configure a BroadView agent and make calls on the agent to perform various tasks. broadview-lib also provides classes that can parse notifications and data sent to an application by a BroadView agent. broadview-lib can be thought of as presenting an object-model above the JSON-RPC protocol of the BroadView agent.
As such, broadview-lib forms the basis of other contributions that integrate BroadView functionality into OpenStack, and represents an OpenStack-neutral view of BroadView’s API. The library can be used by other projects outside of OpenStack, if desired.
broadview-lib consists of two components. One is a set of classes that can be used to configure BroadView. The other is an API that parses content sent by BroadView agents and presents it as Python objects.
broadview-lib is, like BroadView itself, designed to be extensible. Currently the BroadView BST and PacketTrace components are supported. Future releases will add support for additional BroadView components as they become available.
broadview-lib includes command line tools that make use of broadview-lib to to issue supported commands for querying and configuring BroadView. Each command line tool is paired to a specific component of BroadView (BST, PacketTrace, etc).
Each of these commands supports a “help” argument that will print usage information. For commands that retrieve a JSON response from the agent, the JSON response will be written to stdout.
The file examples.sh in the tools directory contains example invocations of the supported commands.
Each of the commands provides example usage of broadview-lib APIs and thus can be used as inspiration for your own broadview-lib applications.
A command line application that can be used to configure BroadView BST.
A command line application that can be used to configure BroadView PacketTrace.
A command line application that can be used to configure BroadView’s Black Hole Detection feature.
A command line application that can be used to issue general BroadView commands for querying the supported features of BroadView, cancelling requests, etc.
The following describes the major classes in the library.
The broadview.py file in config contains general configuration classes for BroadView.
The following briefly summarizes these classes. For example usage, see the unit test code in broadview.py, or the bv-ctl.py application.
This command is used to retrieve the switch properties.
This command is used to retrieve the current configuration of the System module on the Agent.
This command can be used to enable or disable heartbeat messages from the agent, as well as specify a heartbeat interval.
All JSON RPC requests to the agent must be identified by a unique integer ID.
The reference implementation of the agent does not provide any support for
managing the ID space, ad it is left to client to ensure that IDs are unique.
broadview-lib supports this by maintaining an ID file that is shared across all
broadview-lib instances on the host and possibly the datacenter should the
ID file be placed in a shared file system. See commit
a72b75082e for details on the implementation.
The CancelRequest command takes the ID of a previous request as an argument and cancels that command on the agent. To obtain this ID, refer to the JSON output of the corresponding command for the cancellation-id field. Alternately, Python code using configuration objects can get at this ID for a request by calling getLastUsedSerial() member function of the object before making another request with that object (the configuration objects record the last used ID number within the object, so as long as the object itself is being used in a thread safe manner, this ID will be correct).
The bst.py file in config contains various configuration and data gathering classes.
The following briefly summarizes these classes. For example usage, see the unit test code in bst.py, or the bv-bstctl.py application.
This class can be used to provide general configuration of the BroadView BST component.
This class is used to enable or disable the tracking of various BST statistics.
This base class is inherited by the several subclasses, each which allow for the configuration of thresholds for the various statistics (realms) that are supported by BST. The following is a list of these subclasses, one for each supported BST realm:
This class supports the resetting of all BST statistics in the agent.
This class supports the resetting of all BST thresholds in the agent.
This class reports the various settings of the BroadView BST component.
This class reports the tracking settings for the BroadView BST component. The tracking status of each supported realm is reported.
This class reports the threshold settings for the various BST realms.
This class reports the current buffer statistics for the specified realms.
The class BSTParser (found in bst/bst_parser.py) accepts the JSON payload that is sent by a BroadView agent for BST notifications and responses that contain BST threshold reports.
The pt.py file in config contains various classes that wrap the BroadView packet trace protocol.
The following briefly summarizes these classes. For example usage, see the unit test code in pt.py, or the bv-ptctl.py application.
This class can be used to provide general configuration of the BroadView packet trace component.
This command configures the agent to send a copy of dropped packets and/or trace-profile to requestor asynchronously.
This command is used to cancel the trace-profile request previously initiated by GetPacketTraceProfile.
This command is used to cancel the lag-resolution request previously initiated by GetPacketTraceLAGResolution.
This command is used to cancel the ecmp-resolution request previously initiated by GetPacketTraceECMPResolution.
This command is used to cancel the send-dropped-packet request for a given list of ports. This command allows canceling of send-dropped-packet request for multiple drop reasons at a time.
This command is used to cancel the drop-counter-report request for a given list of ports. This command allows canceling of drop-counter-report request for multiple drop reasons at a time.
This command is used to retrieve the current configuration of the Packet Trace functionality on the Agent
This command is used to retrieve the LAG resolution for the given packet.
This command is used to retrieve the ECMP resolution for the given packet.
This command is used to retrieve the trace-profile for the given packet.
This command is used to retrieve the current configured drop reasons on the Broadcom ASIC.
This command is used to retrieve the drop counter-report.
This command is used to retrieve the supported drop reasons on the Broadcom ASIC.
The class PTParser (found in pt/pt_parser.py) accepts the JSON payload that is sent by a BroadView agent for PacketTrace, and converts this payload into Python objects. It provides an API for accessing these objects.
The bhd.py file in config contains various configuration and data gathering classes.
The following briefly summarizes these classes. For example usage, see the unit test code in bhd.py, or the bv-bhdctl.py application.
This class can be used to enable (or disable) black hole detection.
This class configures the Black Hole Detection functionality on the switch.
This class nullifies the configuration made by the ConfigureBlackHole class.
This class can be used to determine of black hole detection is enabled or not.
This class is used to get the current configuration of black hole detection on the agent.
This class is used to get a black hole event report. It is only valid if the agent sampling mode is configured on the agent.
This class is used to get current sFlow sampling status of Black Holed traffic.
The class BHDParser (found in bhd/bhd_parser.py) accepts the JSON payload that is sent by a BroadView agent for Black Hole Detection, and converts this payload into Python objects. It provides an API for accessing the data that is contained in these objects.
To ensure that broadview-lib is decoupled from any (and all) OpenStack dependencies, unit tests are implemented by each of the individual Python modules using the Python unittest framework.
© Copyright Broadcom Corporation 2016
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License.
You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.