0
Typically sFlow datagrams are sent unencrypted from agents embedded in switches and routers to a local collector/analyzer. Sending sFlow datagrams over the management VLAN or out of band management network generally provides adequate isolation and security within the site. Inter-site traffic within an organization is typically carried over a virtual private network (VPN) which encrypts the data and protects it from eavesdropping.
This article describes a simple method of carrying sFlow datagrams over an encrypted ssh connection which can be useful in situations where a VPN is not available, for example, sending sFlow to an analyzer in the public cloud, or to an external consultant.
The diagram shows the elements of the solution. A
collector on the site receives sFlow datagrams from the network devices and uses the
sflow_fwd.py script to convert the datagrams into line delimited hexadecimal strings that are sent over an
ssh connection to another instance of
sflow_fwd.py running on the
analyzer that converts the hexadecimal strings back to sFlow datagrams.
The following
sflow_fwd.py Python script accomplishes the task:
#!/usr/bin/python
import socket
import sys
import argparse
parser = argparse.ArgumentParser(description='Serialize/deserialize sFlow')
parser.add_argument('-c', '--collector', default='')
parser.add_argument('-s', '--server')
parser.add_argument('-p', '--port', type=int, default=6343)
Continue reading