[null, {"document_url": "http://blog.sflow.com/2016_09_01_archive.html", "unformatted_src": "https://3.bp.blogspot.com/-p9jSbDGkFvo/V9q-tQLpPtI/AAAAAAAACi0/04qPG9Q7eUMYGmtvrUgyz27LUlJ9Df6MQCLcB/s640/swarmelb.png", "src": "https://3.bp.blogspot.com/-p9jSbDGkFvo/V9q-tQLpPtI/AAAAAAAACi0/04qPG9Q7eUMYGmtvrUgyz27LUlJ9Df6MQCLcB/s640/swarmelb.png", "formatted_filename": "swarmelb", "rendered_width": 640, "rendered_height": 156}, null, {"document_url": "http://blog.sflow.com/2016_09_01_archive.html", "unformatted_src": "https://4.bp.blogspot.com/-T_TYjXfAB9g/V-XUF4XYBhI/AAAAAAAACjI/AciexjPrnWME6Of2XBCB_7X58bkFb4SMACLcB/s640/elb-results.png", "src": "https://4.bp.blogspot.com/-T_TYjXfAB9g/V-XUF4XYBhI/AAAAAAAACjI/AciexjPrnWME6Of2XBCB_7X58bkFb4SMACLcB/s640/elb-results.png", "formatted_filename": "elb results", "rendered_width": 640, "rendered_height": 344}, null, {"document_url": "http://blog.sflow.com/2016_09_01_archive.html", "unformatted_src": "https://1.bp.blogspot.com/-pojZC8kGTlQ/V-Ya9CDLArI/AAAAAAAACjY/SHa8-B-j-wUs3-rwJ-ttrDXI-E5U0-HVwCLcB/s640/top-flows.png", "src": "https://1.bp.blogspot.com/-pojZC8kGTlQ/V-Ya9CDLArI/AAAAAAAACjY/SHa8-B-j-wUs3-rwJ-ttrDXI-E5U0-HVwCLcB/s640/top-flows.png", "formatted_filename": "top flows", "rendered_width": 640, "rendered_height": 514}, null, null, {"document_url": "http://blog.sflow.com/2016_09_01_archive.html", "unformatted_src": "https://3.bp.blogspot.com/-9t3lr_nxAIM/V-ftOOx6ctI/AAAAAAAACkA/zo9pZrYKtI4XREAwy-GRVE4oMD4bSVRrwCLcB/s640/hsflowd-docker.png", "src": "https://3.bp.blogspot.com/-9t3lr_nxAIM/V-ftOOx6ctI/AAAAAAAACkA/zo9pZrYKtI4XREAwy-GRVE4oMD4bSVRrwCLcB/s640/hsflowd-docker.png", "formatted_filename": "hsflowd docker", "rendered_width": 640, "rendered_height": 284}, null, {"document_url": "http://blog.sflow.com/2016_09_01_archive.html", "unformatted_src": "https://4.bp.blogspot.com/-UkdzTs2yRkI/V-ajuAkElaI/AAAAAAAACjw/2DUzqNdKnl0Nm6RNDfK6DzX4JjEDvF1EQCLcB/s640/event_state.png", "src": "https://4.bp.blogspot.com/-UkdzTs2yRkI/V-ajuAkElaI/AAAAAAAACjw/2DUzqNdKnl0Nm6RNDfK6DzX4JjEDvF1EQCLcB/s640/event_state.png", "formatted_filename": "event state", "rendered_width": 640, "rendered_height": 324}, null, null, {"document_url": "http://blog.sflow.com/2016_09_01_archive.html", "unformatted_src": "https://3.bp.blogspot.com/-FIhJDIzICdU/V9B-QFYtOOI/AAAAAAAACig/Fd5icnF28vUHK4LHzeeYpm1OORXG6f5_QCLcB/s640/erspan.png", "src": "https://3.bp.blogspot.com/-FIhJDIzICdU/V9B-QFYtOOI/AAAAAAAACig/Fd5icnF28vUHK4LHzeeYpm1OORXG6f5_QCLcB/s640/erspan.png", "formatted_filename": "erspan", "rendered_width": 640, "rendered_height": 304}, null, {"document_url": "http://blog.sflow.com/2016_09_01_archive.html", "unformatted_src": "https://2.bp.blogspot.com/-ZGwt8K82OaI/UXoYfhsykvI/AAAAAAAAA_8/hRYCfsEBD68Se7I9uqZdMRCG3456up-ewCPcB/s320/Finderscope_50.jpg", "src": "https://2.bp.blogspot.com/-ZGwt8K82OaI/UXoYfhsykvI/AAAAAAAAA_8/hRYCfsEBD68Se7I9uqZdMRCG3456up-ewCPcB/s320/Finderscope_50.jpg", "formatted_filename": "Finderscope", "rendered_width": 320, "rendered_height": 252}, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null]

Docker 1.12 swarm mode elastic load balancing Docker Built-In Orchestration Ready For Production: Docker 1.12 Goes GA describes the native swarm mode feature that integrates cluster management, virtual networking, and policy based deployment of services.

This article will demonstrate how real-time streaming telemetry can be used to construct an elastic load balancing solution that dynamically adjusts service capacity to match changing demand.

Getting started with swarm mode describes the steps to configure a swarm cluster. For example, following command issued on any of the Manager nodes deploys a web service on the cluster:
And the following command raises the number of containers in the service pool from 2 to 4:
Asynchronous Docker metrics describes how sFlow telemetry provides the real-time visibility required for elastic load balancing. The diagram shows how streaming telemetry allows the sFlow-RT controller to determine the load on the service pool so that it can use the Docker service API to automatically increase or decrease the size of the pool as demand changes. Elastic load balancing of the service pools ensures consistent service levels by adding additional resources if demand increases. In addition, efficiency is improved by releasing resources when demand drops so that they can be used by other services. Finally, global visibility into all resources and services makes it possible to load balance between services, reducing service pools for non-critical services to release resources during peak demand.

The first step is to install and configure Host sFlow agents on each of the nodes in the Docker swarm cluster. The following /etc/hsflowd.conf file configures Host sFlow to monitor Docker and send sFlow telemetry to a designated collector (in this case 10.0.0.162):
Note: The configuration file is identical for all nodes in the cluster making it easy to automate the installation and configuration of sFlow monitoring using  Puppet, Chef, Ansible, etc.

Verify that the sFlow measurements are arriving at the collector node (10.0.0.162) using sflowtool:
The following elb.js script implements elastic load balancer functionality using the sFlow-RT real-time analytics engine:
Some notes on the script:
Run the controller:
The autoscaling functionality can be enabled:
and disabled:
using the REST API exposed by the script. The chart above shows the results of a simple test to demonstrate the elastic load balancer function. First, ab - Apache HTTP server benchmarking tool was used to generate load on the apache service running under Docker swarm:
Next, the test was repeated with the elastic load balancer enabled. The chart clearly shows that the load balancer is keeping the average network load on each container under control.
The sFlow-RT log shows that containers are added to the apache service to handle the increased load and removed once demand decreases.

This example relied on a small subset of the information available from the sFlow telemetry stream. In addition to container resource utilization, the Host sFlow agent exports an extensive set of metrics from the nodes in the Docker swarm cluster. If the nodes are virtual machines running in a public or private cloud, the metrics can be used to perform elastic load balancing of the virtual machine pool making up the cluster, increasing the cluster size if demand increases and reducing cluster size when demand decreases. In addition, poorly performing instances can be detected and removed from the cluster (see Stop thief! for an example). The sFlow agents also efficiently report on traffic flowing within and between microservices running on the swarm cluster. For example, the following command:
launches the top-flows application to show an up to the second view of active flows in the network.

Comprehensive real-time analytics is critical to effectively managing agile container-bases infrastructure. Open source Host sFlow agents provide a lightweight method of instrumenting the infrastructure that unifies network and system monitoring to deliver a full set of standard metrics to performance management applications.
Posted by Peter at 10:25 AM 0 comments Labels: cluster, control, Docker, sFlow, sFlow-RT, telemetry


Asynchronous Docker metrics Docker allows large numbers of lightweight containers can be started and stopped within seconds, creating an agile infrastructure that can rapidly adapt to changing requirements. However, the rapidly changing populating of containers poses a challenge to traditional methods of monitoring which struggle to keep pace with the changes. For example, periodic polling methods take time to detect new containers and can miss short lived containers entirely.

This article describes how the latest version of the Host sFlow agent is able to track the performance of a rapidly changing population of Docker containers and export a real-time stream of standard sFlow metrics. The diagram above shows the life cycle status events associated with a container. The Docker Remote API provides a set of methods that allow the Host sFlow agent to communicate with the Docker to list containers and receive asynchronous container status events. The Host sFlow agent uses the events to keep track of running containers and periodically exports cpu, memory, network and disk performance counters for each container.

The diagram at the beginning of this article shows the sequence of messages, going from top to bottom, required to track a container. The Host sFlow agent first registers for container lifecycle events before asking for all the currently running containers. Later, when a new container is started, Docker immediately sends an event to the Host sFlow agent, which requests additional information (such as the container process identifier - PID) that it can use to retrieve performance counters from the operating system. Initial counter values are retrieved and exported along with container identity information as an sFlow counters message and a polling task for the new container is initiated. Container counters are periodically retrieved and exported while the container continues to run (2 polling intervals are shown in the diagram). When the Host sFlow agent receives an event from Docker indicating that the container is being stopped, it retrieves the final values of the performance counters, exports a final sFlow message, and removes the polling task for the container.

This method of asynchronously triggered periodic counter export allows an sFlow collector to accurately track rapidly changing container populations in large scale deployments. The diagram only shows the sequence of events relating to monitoring a single container. Docker network visibility demonstration shows the full range of network traffic and system performance information being exported.

Detailed real-time visibility is essential for fully realizing the benefits of agile container infrastructure, providing the feedback needed to track and automatically optimize the performance of large scale microservice deployments.
Posted by Peter at 8:44 AM 0 comments Labels: Docker, polling, sFlow


Triggered remote packet capture using filtered ERSPAN Packet brokers are typically deployed as a dedicated network connecting network taps and SPAN/mirror ports to packet analysis applications such as Wireshark, Snort, etc.

Traditional hierarchical network designs were relatively straightforward to monitor using a packet broker since traffic flowed through a small number of core switches and so a small number of taps provided network wide visibility. The move to leaf and spine fabric architectures eliminates the performance bottleneck of core switches to deliver low latency and high bandwidth connectivity to data center applications. However, traditional packet brokers are less attractive since spreading traffic across many links with equal cost multi-path (ECMP) routing means that many more links need to be monitored.

This article will explore how the remote Selective Spanning capability in Cumulus Linux 3.0 combined with industry standard sFlow telemetry embedded in commodity switch hardware provides a cost effective alternative to traditional packet brokers.

Cumulus Linux uses iptables rules to specify packet capture sessions. For example, the following rule forwards packets with source IP 22.214.171.124 and destination IP 126.96.36.199 to a packet analyzer on host 188.8.131.52:
REST API for Cumulus Linux ACLs describes a simple Python wrapper that exposes IP tables through a RESTful API. For example, the following command remotely installs the capture rule on switch 10.0.0.233:
The following command deletes the rule:
Selective Spanning makes it possible to turn every switch and port in the network into a capture device. However, it is import to carefully select which traffic to capture since the aggregate bandwidth of an ECMP fabric is measured in Terabits per second - far more traffic than can be handled by typical packet analyzers. SDN packet broker describes an analogy for the role that sFlow plays in steering the capture network to that of a finderscope, the small wide-angle telescope used to provide an overview of the sky and guide a telescope to its target. The article goes on to describes some of the benefits of combining sFlow analytics with selective packet capture:
The diagram at the top of this article shows an example of using sFlow to target selective capture of traffic to blacklisted addresses. In this example sFlow-RT is used to perform real-time sFlow analytics. The following emerging.js script instructs sFlow-RT to download the Emerging Threats blacklist and identify any local hosts that are communicating with addresses in the blacklist. A full packet capture is triggered when a potentially compromised host is detected:
Some comments about the script:
Configure sFlow on the Cumulus switches to stream telemetry to a host running Docker. Next, log into the host and run the following command in a directory containing the emerging.js script:
Note: Deploying analytics as a Docker service is a convenient method of packaging and running sFlow-RT. However, you can also download and install sFlow-RT as a package.

Once the software is running, you should see output similar to the following:
The last line shows that traffic from host 10.0.0.162 to a blacklisted address has been detected and that selective spanning session has been configured on switch 10.0.0.253 to capture packets and send them to the host running Wireshark (10.0.0.70) for further analysis.
Posted by Peter at 12:48 PM 0 comments Labels: data center, Docker, ECMP, mirror, SPAN, telemetry, visibility
 Author's Profile