Skip to content

Commit

Permalink
Network Instance State Collector
Browse files Browse the repository at this point in the history
The process of collecting state data and metrics for network instances
(IP assignments of app interfaces, interface metrics, application flows)
has been previously scattered all across the zedrouter codebase.
This commit consolidates stata data collecting into a standalone
component defined by an interface NIStateCollector, meaning that the
default Linux-based implementation is replaceable, which opens up
the possibility of adding native support for other network stacks to EVE.
Another important goal of this refactoring was to simplify the existing
implementation and make it easier to understand. Previously, state data
were collected by multiple Go routines and exchanged through some
additional channels and pubsub topics. It was quite difficult to
understand the code as a whole and to see what actually is the
intended behaviour of some of its parts.

Signed-off-by: Milan Lenco <milan@zededa.com>
  • Loading branch information
milan-zededa committed Mar 24, 2023
1 parent 267aee1 commit 1c55f74
Show file tree
Hide file tree
Showing 17 changed files with 2,069 additions and 1,979 deletions.
3 changes: 2 additions & 1 deletion pkg/dom0-ztools/rootfs/etc/sysctl.d/02-eve.conf
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ net.ipv4.tcp_keepalive_time = 60
# flowstats settings
# Adjust the conntrack flow session timeout values
# by adding 150 seconds on top of default seconds
# This also gets reflected in flowstats.go timeoutSec
# This also gets reflected in pkg/pillar/nistate/linux_flow.go,
# constant conntrackFlowExtraTimeout
net.netfilter.nf_conntrack_tcp_timeout_fin_wait = 270
net.netfilter.nf_conntrack_tcp_timeout_last_ack = 180
net.netfilter.nf_conntrack_tcp_timeout_max_retrans = 450
Expand Down
6 changes: 3 additions & 3 deletions pkg/pillar/cmd/zedagent/handlenetworkinstance.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,9 +268,9 @@ func protoEncodeAppFlowMonitorProto(ipflow types.IPFlow) *flowlog.FlowMessage {

// ScopeInfo fill in
pScope := new(flowlog.ScopeInfo)
pScope.Uuid = ipflow.Scope.UUID.String()
pScope.Intf = ipflow.Scope.Intf
pScope.LocalIntf = ipflow.Scope.Localintf
pScope.Uuid = ipflow.Scope.AppUUID.String()
pScope.Intf = ipflow.Scope.NetAdapterName
pScope.LocalIntf = ipflow.Scope.BrIfName
pScope.NetInstUUID = ipflow.Scope.NetUUID.String()
pflows.Scope = pScope

Expand Down
Loading

0 comments on commit 1c55f74

Please sign in to comment.