Categorygithub.com/BroadBridgeNetworks/goflowd
repositorypackage
0.0.0-20200704215023-41fb47dd8339
Repository: https://github.com/broadbridgenetworks/goflowd.git
Documentation: pkg.go.dev

# README

goflowd

Summary

goflowd is netflow probe like softflowd. It is written by golang. goflowd uses ietf-ipfix-psamp.yang standarized in RFC6728 data model for configuration. The yang model configuraiton is acheived by using openconfig/ygot.

Execution

./goflowd -c config.json

Configuration sample

Configuration file is json based. In following sample, the packets are read from enp0s3 interface and export flow to 192.168.1.1 port 4739. In this sample, FlowKeys are sourceIPv4Address, destinationIPv4Address, protocolIdentifier, sourceTransportPort, and destinationTransportPort.

If you want to use offline pcap file instead of online capture, you need to use offlineFile": "file name" instread of ifName": [ "interface name" ].

{
    "observationPoint": [
        {
            "name": "pcap",
            "observationDomainId": 1,
             "ifName": [ "enp0s3" ],
            "direction": "ingress",
            "selectionProcess": [
                "All"
            ]
        }
    ],
    "selectionProcess": [
        {   
            "name": "All",
            "selector": [
                {
                    "name": "Select all",
                    "selectAll": [
                        null
                    ]
                }
            ],
            "cache": "Flow cache"
        }
    ],
    "cache": [
        {
            "name": "Flow cache",
            "timeoutCache": {
                "maxFlows": 4096,
                "activeTimeout": 5000,
                "idleTimeout": 10000,
                "cacheLayout": {
                    "cacheField": [
                        {
                            "name": "Field 1",
                            "ieName": "sourceIPv4Address",
                            "isFlowKey": [
                                null
                            ]
                        },
                        {
                            "name": "Field 2",
                            "ieName": "destinationIPv4Address",
                            "isFlowKey": [
                                null
                            ]
                        },
                        {
                            "name": "Field 3",
                            "ieName": "protocolIdentifier",
                            "isFlowKey": [
                                null
                            ]
                        },
                        {
                            "name": "Field 4",
                            "ieName": "sourceTransportPort",
                            "isFlowKey": [
                                null
                            ]
                        },
                        {
                            "name": "Field 5",
                            "ieName": "destinationTransportPort",
                            "isFlowKey": [
                                null
                            ]
                        },
                        {
                            "name": "Field 6",
                            "ieName": "flowStartMilliseconds"
                        },
                        {
                            "name": "Field 7",
                            "ieName": "flowEndMilliseconds"
                        },
                        {
                            "name": "Field 8",
                            "ieName": "octetDeltaCount"
                        },
                        {
                            "name": "Field 9",
                            "ieName": "packetDeltaCount"
                        }
                    ]
                }
            },
            "exportingProcess": [
                "UDP"
            ]
        }
    ],
    "exportingProcess": [
        {
            "name": "UDP",
            "destination": [
                {
                    "name": "UDP",
                    "udpExporter": {
                        "ipfixVersion": 10,
                        "destinationPort": 4739,
                        "destinationIPAddress": "192.168.1.1"
                    }
                }
            ]
        }
    ]
}

Configurable Informaiton Elements for FlowKeys

Information Element IDInformation Element Name
4protocolIdentifier
5ipClassOfService
7sourceTransportPort
8sourceIPv4Address
11destinationTransportPort
12destinationIPv4Address
27sourceIPv6Address
28destinationIPv6Address
31flowLabelIPv6
32icmpTypeCodeIPv4
54fragmentIdentification
56sourceMacAddress
57postDestinationMacAddress
58vlanId
60ipVersion
139icmpTypeCodeIPv6
176icmpTypeIPv4
177icmpCodeIPv4
178icmpTypeIPv6
179icmpCodeIPv6
180udpSourcePort
181udpDestinationPort
182tcpSourcePort
183tcpDestinationPort
193nextHeaderIPv6
195ipDiffServCodePoint
196ipPrecedence

Configurable Informaiton Elements for Non-FlowKeys for collection

Information Element IDInformation Element Name
1octetDeltaCount
2packetDeltaCount
6tcpControlBits
21flowEndSysUpTime
22flowStartSysUpTime
150flowStartSeconds
151flowEndSeconds
152flowStartMilliseconds
153flowEndMilliseconds

Functionality comparison with softflowd

softflowdgoflowd
Online packet capturesupportedsupported
Reading pcap filesupported(-r)supported
PSAMP collectorsupported(-R)TODO
NetFlow version 1 exportsupported(-v 1)TODO
NetFlow version 5 exportsupported(-v 5)supported
NetFlow version 7 exportunsupportedTODO
NetFlow version 8 exportunsupportedTODO
NetFlow version 9 exportsupported(-v 9)TODO
IPFIX exportsupported(-v 10)supported
IPv6 support(v9,IPFIX)supported(-6)supported
Bidirectioal flow exportsupported(-b)TODO
PSAMP exportsupported(-v PSAMP)TODO
ntopng direct injectionsupported(-v ntopng)TODO
Flow export on UDPsupported(-P udp)supported
Flow export on TCPsupported(-P tcp)supported
Flow export on SCTPsupported(-P sctp)TODO
Configurationunsupportedsupported
FlowKey Configurationpartially supported(-T)supported
Count-based samplingsupportedsupported
Time-based samplingunsupportedsupported

Limiation of IPFIX export in goflowd

  • SCTP is mandatory in IPFIX (RFC7011), however go's net.Dial does not support SCTP. Hence, goflowd does not support SCTP export.
  • Every packets exported by goflowd contain Template Set.
  • Option Template has not implemented.