MCPcopy Index your code
hub / github.com/Netis/cloud-probe

github.com/Netis/cloud-probe @v0.9.4

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.9.4 ↗ · + Follow
2,422 symbols 5,287 edges 275 files 349 documented · 14%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

English ∙ 简体中文

Netis Cloud Probe

Stable release Software License

什么是Netis Cloud Probe?

Netis Cloud probe(曾用名 Packet Agent)是一个用于解决如下问题的开源项目:设备A上抓取的数据包,之后在设备B上使用分析。在很多时候,当你希望监控网络的流量,但是并没有可用的设备,例如: - 物理环境中不存在TAPSPAN设备。 - 虚拟环境中,Virtual Switch Flow Table不支持SPAN功能。

因此,该项目提供一套低开销但是高性能的抓包工具,用于应对上述困难。 - cpworker 该工具可以轻松地在网卡上抓数据包,通过不同的输出方式将数据包发送到远端的设备,从而进行数据包监控和分析。

capture traffic flow via GRE/Cloud

此外,还有工具: - cpdaemon 是cpworker的管理程序。它可以拉起和停止cpworker。该模块需要和CPM(Cloud Probe Mananger).CPM提供了用户界面,可以对cpworker的策略进行配置,同时还可以图形化显示cpdaemon上报的统计数据。您可以联系Netis获取关于CPM的进一步支持,或者可以开发自己的CPM。

快速开始

通过libpcap抓包,用GRE头进行封装并发送到远端设备

备注:请确保防火墙允许向目标发送GRE数据包. https://lartc.org/howto/lartc.tunnel.gre.html 提供验证是否允许向目标发送GRE数据包的方法.

新建配置文件,比如:libpcap_gre.json

{
    "log_level": "INFO",
    "control": {
        "type": "unix",
        "unix": {
            "path": "/var/run/cloud-probe/cpworker.sock"
        }
    },
    "tasks": [
        {
            "req_pattern": {
                "type": "auto"
            },
            "capturer": {
                "type": "libpcap",
                "libpcap": {
                    "interface": "eth0",
                    "snaplen": 2048,
                    "buffer_size_mb": 256
                }
            },
            "outputs": [
                {
                    "type": "gre",
                    "gre": {
                        "host": "172.16.1.201",
                        "bind_device": "eth1"
                    }
                }
            ]
        }
    ]
}

执行命令:

cpworker -c libpcap_gre.json

完整的使用说明,请参阅这篇文档.

转发速率对比测试

版本 输出类型 转发BPS 转发PPS CPU使用率 版本 转发BPS 转发PPS CPU使用率 转发BPS提升% 转发PPS提升% CPU使用率提升%
0.8.7 ZMQ 1560Mbps 241K 110% 0.9.0 2680Mbps 409K 49% +71.8% +69.7% -55.4%
GRE 786Mbps 120K 90% 883Mbps 135K 58% +12.3% +12.5% -35.5%
VXLAN 820Mbps 125K 96% 883Mbps 135K 52% +7.7% +8% -45.8%

文档/ 链接

贡献

您可以fork本项目并提交Pull Request。我们欢迎所有开源社区的同学提交自己的贡献。

支持

本项目提供给具备开发能力的团队使用,官方不承诺提供支持。详情参见 SUPPORT-zh-Hans.md

许可证

Copyright (c) 2018 - 2020 Netis.

本项目库遵循下列许可证: - BSD-3-Clause.

联系方式

issue模板

Extension points exported contracts — how you extend this code

FingerprintContributor (Interface)
FingerprintContributor lets a type override how it contributes to the fingerprint. WARNING: implementing it REPLACES aut [1 …
cpdaemon/pkg/common/fingerprint_reflect.go
Daemon (FuncType)
(no doc)
cpdaemon/cmd/internal/asm/instance.go
Client (Interface)
(no doc)
cpgolib/cpworker/client.go
Tool (Interface)
(no doc) [2 implementers]
cpdaemon/pkg/cpm/syncer.go
IWorkerManager (Interface)
(no doc) [2 implementers]
cpdaemon/pkg/cpm/syncer.go
Client (Interface)
(no doc)
cpdaemon/pkg/cpm/syncer.go

Core symbols most depended-on inside this repo

cjson_set_parse_error
called by 127
cpworker/src/cjson_utils.c
String
called by 112
cpdaemon/pkg/common/fingerprint.go
Error
called by 86
cpdaemon/pkg/cpm/models.go
cJSON_GetObjectItemCaseSensitive
called by 81
cpworker/src/cJSON/cJSON.c
error_format
called by 68
cpworker/src/errorf.c
Close
called by 56
cpgolib/cpworker/client.go
req_pattern_custom_match_by_ipport
called by 55
cpworker/src/req_pattern.c
cJSON_Delete
called by 49
cpworker/src/cJSON/cJSON.c

Shape

Function 1,791
Method 315
Class 184
Struct 116
Interface 6
TypeAlias 4
Enum 3
FuncType 3

Languages

C65%
Go25%
Ruby6%
C++4%
Python1%

Modules by API surface

cpworker/tests/unit/unity/test/tests/test_unity_integers.c257 symbols
cpworker/src/cJSON/cJSON.c117 symbols
cpworker/tests/unit/unity/test/tests/test_unity_floats.c93 symbols
cpworker/tests/unit/unity/test/tests/test_unity_arrays.c92 symbols
cpworker/tests/unit/unity/test/tests/test_unity_doubles.c91 symbols
cpworker/src/task.c82 symbols
cpworker/tests/unit/unity/src/unity.c56 symbols
cpworker/tests/unit/misc.c44 symbols
cpworker/tests/unit/packet_split.c43 symbols
cpdaemon/pkg/cpm/syncer.go43 symbols
cpworker/src/cJSON/cJSON_Utils.c39 symbols
cpworker/tests/unit/unity/test/tests/test_unity_integers_64.c34 symbols

For agents

$ claude mcp add cloud-probe \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact