Documentation
¶
Index ¶
- func CreateAgentWithMockInCI(config *TNConfig, logger *log.Logger) interface{}
- func IsRunningInCI() bool
- func ShouldMockVXLAN() bool
- func ShouldSkipKubernetesTests() bool
- type BandwidthMonitor
- func (bm *BandwidthMonitor) ExportMetrics() ([]byte, error)
- func (bm *BandwidthMonitor) GetBandwidthSample(interfaceName string) (*BandwidthSample, error)
- func (bm *BandwidthMonitor) GetCurrentMetrics() map[string]*InterfaceMetrics
- func (bm *BandwidthMonitor) GetInterfaceMetrics(interfaceName string) (*InterfaceMetrics, error)
- func (bm *BandwidthMonitor) GetNetworkStats() *NetworkStats
- func (bm *BandwidthMonitor) GetPerformanceSummary() map[string]interface{}
- func (bm *BandwidthMonitor) IsHealthy() bool
- func (bm *BandwidthMonitor) SetInterval(interval time.Duration)
- func (bm *BandwidthMonitor) Start(ctx context.Context) error
- func (bm *BandwidthMonitor) StartContinuousLogging(interval time.Duration)
- func (bm *BandwidthMonitor) Stop() error
- type BandwidthPolicy
- type BandwidthSample
- type Filter
- type InterfaceMetrics
- type IperfCPUUtil
- type IperfManager
- func (im *IperfManager) GetActiveServers() map[string]*IperfServer
- func (im *IperfManager) RunLatencyTest(serverIP string, port int, duration time.Duration) (*LatencyMetrics, error)
- func (im *IperfManager) RunTest(config *IperfTestConfig) (*IperfResult, error)
- func (im *IperfManager) RunThroughputTest(serverIP string, port int, duration time.Duration) (*ThroughputMetrics, error)
- func (im *IperfManager) StartServer(port int) error
- func (im *IperfManager) StopAllServers() error
- func (im *IperfManager) StopServer(port int) error
- type IperfResult
- type IperfServer
- type IperfServerInfo
- type IperfStream
- type IperfStreamSummary
- type IperfSummary
- type IperfTestConfig
- type LatencyMetrics
- type MetricCollector
- type MockTNAgent
- type NetworkInterface
- type NetworkStats
- type PerformanceMetrics
- type PerformanceTestConfig
- type PrometheusMetrics
- func (pm *PrometheusMetrics) RecordAgentStatus(clusterName string, status *TNStatus)
- func (pm *PrometheusMetrics) RecordPerformanceTest(clusterName string, metrics *PerformanceMetrics)
- func (pm *PrometheusMetrics) UpdateAgentMetrics(clusterName string, healthy bool, connections int)
- func (pm *PrometheusMetrics) UpdateBandwidthMetrics(clusterName string, interfaceMetrics map[string]*InterfaceMetrics)
- func (pm *PrometheusMetrics) UpdateLatencyMetrics(clusterName string, metrics *LatencyMetrics, target, sliceType string)
- func (pm *PrometheusMetrics) UpdateSLACompliance(clusterName, sliceType string, compliant bool)
- func (pm *PrometheusMetrics) UpdateTCMetrics(clusterName, interfaceName string, status *TCStatus, overhead float64)
- func (pm *PrometheusMetrics) UpdateTestMetrics(clusterName, testType, sliceType string, duration float64, success bool)
- func (pm *PrometheusMetrics) UpdateThesisCompliance(clusterName string, validation *ThesisValidation)
- func (pm *PrometheusMetrics) UpdateThroughputMetrics(clusterName string, metrics *ThroughputMetrics, sliceType string)
- func (pm *PrometheusMetrics) UpdateVXLANMetrics(clusterName string, status *VXLANStatus, overhead float64)
- type TCManager
- func (tc *TCManager) ApplyShaping() error
- func (tc *TCManager) CalculateTCOverhead() float64
- func (tc *TCManager) CleanRules() error
- func (tc *TCManager) GetBandwidthUsage() (map[string]float64, error)
- func (tc *TCManager) GetTCStatus() (*TCStatus, error)
- func (tc *TCManager) MonitorBandwidth(interval time.Duration, stopCh <-chan struct{})
- func (tc *TCManager) UpdateShaping(newConfig *BandwidthPolicy) error
- type TCStatus
- type TNAgent
- func (agent *TNAgent) ConfigureSlice(sliceID string, config *TNConfig) error
- func (agent *TNAgent) GetStatus() (*TNStatus, error)
- func (agent *TNAgent) RunPerformanceTest(config *PerformanceTestConfig) (*PerformanceMetrics, error)
- func (agent *TNAgent) Start() error
- func (agent *TNAgent) Stop() error
- type TNConfig
- type TNStatus
- type ThesisValidation
- type ThroughputMetrics
- type VXLANConfig
- type VXLANManager
- func (vm *VXLANManager) CalculateVXLANOverhead(originalMTU int) float64
- func (vm *VXLANManager) CreateTunnel() error
- func (vm *VXLANManager) DeleteTunnel() error
- func (vm *VXLANManager) GetTunnelStatus() (*VXLANStatus, error)
- func (vm *VXLANManager) GetVXLANInfo() (map[string]interface{}, error)
- func (vm *VXLANManager) MonitorTunnel(interval time.Duration, stopCh <-chan struct{})
- func (vm *VXLANManager) TestConnectivity() map[string]bool
- func (vm *VXLANManager) UpdatePeers(newPeers []string) error
- type VXLANStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateAgentWithMockInCI ¶
CreateAgentWithMockInCI creates either a real or mock agent based on CI environment
func IsRunningInCI ¶
func IsRunningInCI() bool
IsRunningInCI checks if the code is running in a CI environment
func ShouldMockVXLAN ¶
func ShouldMockVXLAN() bool
ShouldMockVXLAN determines if VXLAN operations should be mocked
func ShouldSkipKubernetesTests ¶
func ShouldSkipKubernetesTests() bool
ShouldSkipKubernetesTests determines if Kubernetes-dependent tests should be skipped
Types ¶
type BandwidthMonitor ¶
type BandwidthMonitor struct {
// contains filtered or unexported fields
}
BandwidthMonitor provides real-time bandwidth monitoring capabilities
func NewBandwidthMonitor ¶
func NewBandwidthMonitor(logger *log.Logger) *BandwidthMonitor
NewBandwidthMonitor creates a new bandwidth monitor
func (*BandwidthMonitor) ExportMetrics ¶
func (bm *BandwidthMonitor) ExportMetrics() ([]byte, error)
ExportMetrics exports metrics to JSON
func (*BandwidthMonitor) GetBandwidthSample ¶
func (bm *BandwidthMonitor) GetBandwidthSample(interfaceName string) (*BandwidthSample, error)
GetBandwidthSample returns a bandwidth sample for a specific interface
func (*BandwidthMonitor) GetCurrentMetrics ¶
func (bm *BandwidthMonitor) GetCurrentMetrics() map[string]*InterfaceMetrics
GetCurrentMetrics returns current metrics for all interfaces
func (*BandwidthMonitor) GetInterfaceMetrics ¶
func (bm *BandwidthMonitor) GetInterfaceMetrics(interfaceName string) (*InterfaceMetrics, error)
GetInterfaceMetrics returns metrics for a specific interface
func (*BandwidthMonitor) GetNetworkStats ¶
func (bm *BandwidthMonitor) GetNetworkStats() *NetworkStats
GetNetworkStats returns aggregated network statistics
func (*BandwidthMonitor) GetPerformanceSummary ¶
func (bm *BandwidthMonitor) GetPerformanceSummary() map[string]interface{}
GetPerformanceSummary returns a performance summary for reporting
func (*BandwidthMonitor) IsHealthy ¶
func (bm *BandwidthMonitor) IsHealthy() bool
IsHealthy returns true if the monitor is running and collecting metrics
func (*BandwidthMonitor) SetInterval ¶
func (bm *BandwidthMonitor) SetInterval(interval time.Duration)
SetInterval sets the monitoring interval
func (*BandwidthMonitor) Start ¶
func (bm *BandwidthMonitor) Start(ctx context.Context) error
Start begins bandwidth monitoring
func (*BandwidthMonitor) StartContinuousLogging ¶
func (bm *BandwidthMonitor) StartContinuousLogging(interval time.Duration)
StartContinuousLogging starts continuous logging of bandwidth metrics
func (*BandwidthMonitor) Stop ¶
func (bm *BandwidthMonitor) Stop() error
Stop stops bandwidth monitoring
type BandwidthPolicy ¶
type BandwidthPolicy struct {
DownlinkMbps float64 `json:"downlinkMbps" yaml:"downlinkMbps"`
UplinkMbps float64 `json:"uplinkMbps" yaml:"uplinkMbps"`
LatencyMs float64 `json:"latencyMs" yaml:"latencyMs"`
JitterMs float64 `json:"jitterMs" yaml:"jitterMs"`
LossPercent float64 `json:"lossPercent" yaml:"lossPercent"`
Priority int `json:"priority" yaml:"priority"`
QueueClass string `json:"queueClass" yaml:"queueClass"`
Burst string `json:"burst" yaml:"burst"`
Filters []Filter `json:"filters" yaml:"filters"`
}
BandwidthPolicy represents bandwidth policy configuration
type BandwidthSample ¶
type BandwidthSample struct {
Timestamp time.Time `json:"timestamp"`
Interface string `json:"interface"`
RxMbps float64 `json:"rxMbps"`
TxMbps float64 `json:"txMbps"`
TotalMbps float64 `json:"totalMbps"`
Utilization float64 `json:"utilization"`
PacketLoss float64 `json:"packetLoss"`
}
BandwidthSample represents a single bandwidth measurement
type Filter ¶
type Filter struct {
Protocol string `json:"protocol" yaml:"protocol"`
SrcIP string `json:"srcIP" yaml:"srcIP"`
DstIP string `json:"dstIP" yaml:"dstIP"`
SrcPort int `json:"srcPort" yaml:"srcPort"`
DstPort int `json:"dstPort" yaml:"dstPort"`
FlowID string `json:"flowID" yaml:"flowID"`
Action string `json:"action" yaml:"action"`
ClassID string `json:"classID" yaml:"classID"`
Priority int `json:"priority" yaml:"priority"`
}
Filter represents a traffic classification filter
type InterfaceMetrics ¶
type InterfaceMetrics struct {
InterfaceName string `json:"interfaceName"`
Timestamp time.Time `json:"timestamp"`
RxBytes int64 `json:"rxBytes"`
TxBytes int64 `json:"txBytes"`
RxPackets int64 `json:"rxPackets"`
TxPackets int64 `json:"txPackets"`
RxErrors int64 `json:"rxErrors"`
TxErrors int64 `json:"txErrors"`
RxDropped int64 `json:"rxDropped"`
TxDropped int64 `json:"txDropped"`
RxRateMbps float64 `json:"rxRateMbps"`
TxRateMbps float64 `json:"txRateMbps"`
TotalRateMbps float64 `json:"totalRateMbps"`
Utilization float64 `json:"utilization"`
QueueLengths map[string]int64 `json:"queueLengths"`
PacketSize float64 `json:"avgPacketSize"`
ErrorRate float64 `json:"errorRate"`
DropRate float64 `json:"dropRate"`
}
InterfaceMetrics contains detailed interface statistics
type IperfCPUUtil ¶
type IperfCPUUtil struct {
HostTotal float64 `json:"hostTotal"`
HostUser float64 `json:"hostUser"`
HostSystem float64 `json:"hostSystem"`
RemoteTotal float64 `json:"remoteTotal"`
RemoteUser float64 `json:"remoteUser"`
RemoteSystem float64 `json:"remoteSystem"`
}
IperfCPUUtil contains CPU utilization information
type IperfManager ¶
type IperfManager struct {
// contains filtered or unexported fields
}
IperfManager manages iperf3 testing operations
func NewIperfManager ¶
func NewIperfManager(logger *log.Logger) *IperfManager
NewIperfManager creates a new iperf3 manager
func (*IperfManager) GetActiveServers ¶
func (im *IperfManager) GetActiveServers() map[string]*IperfServer
GetActiveServers returns information about running iperf3 servers
func (*IperfManager) RunLatencyTest ¶
func (im *IperfManager) RunLatencyTest(serverIP string, port int, duration time.Duration) (*LatencyMetrics, error)
RunLatencyTest runs a latency test using iperf3 with small packets
func (*IperfManager) RunTest ¶
func (im *IperfManager) RunTest(config *IperfTestConfig) (*IperfResult, error)
RunTest executes an iperf3 client test with comprehensive security validation. This function implements multiple security layers: 1. Input validation for all configuration parameters 2. IP address and port validation 3. Bandwidth and timeout limits 4. Individual argument validation for all command parameters 5. Secure subprocess execution with custom iperf3 validators All subprocess execution is protected against command injection attacks.
func (*IperfManager) RunThroughputTest ¶
func (im *IperfManager) RunThroughputTest(serverIP string, port int, duration time.Duration) (*ThroughputMetrics, error)
RunThroughputTest runs a comprehensive throughput test
func (*IperfManager) StartServer ¶
func (im *IperfManager) StartServer(port int) error
StartServer starts an iperf3 server on the specified port with enhanced security validation. This function implements multiple security layers: 1. Port validation to ensure valid port ranges 2. iperf3 argument validation using security.ValidateIPerfArgs 3. Secure subprocess execution with security.SecureExecute 4. Process isolation and monitoring All command execution is protected against injection attacks.
func (*IperfManager) StopAllServers ¶
func (im *IperfManager) StopAllServers() error
StopAllServers stops all running iperf3 servers
func (*IperfManager) StopServer ¶
func (im *IperfManager) StopServer(port int) error
StopServer stops the iperf3 server on the specified port
type IperfResult ¶
type IperfResult struct {
TestID string `json:"testId"`
Timestamp time.Time `json:"timestamp"`
Duration float64 `json:"duration"`
Protocol string `json:"protocol"`
Streams []IperfStream `json:"streams"`
Summary IperfSummary `json:"summary"`
ServerInfo IperfServerInfo `json:"serverInfo"`
ErrorMessages []string `json:"errorMessages,omitempty"`
RawOutput string `json:"rawOutput,omitempty"`
}
IperfResult contains iperf3 test results
type IperfServer ¶
type IperfServer struct {
Port int `json:"port"`
PID int `json:"pid"`
Started time.Time `json:"started"`
Context context.Context `json:"-"`
Cancel context.CancelFunc `json:"-"`
}
IperfServer represents an iperf3 server instance
type IperfServerInfo ¶
type IperfServerInfo struct {
Host string `json:"host"`
Port int `json:"port"`
Version string `json:"version"`
Platform string `json:"platform"`
}
IperfServerInfo contains server information
type IperfStream ¶
type IperfStream struct {
StreamID int `json:"streamId"`
Bytes int64 `json:"bytes"`
BitsPerSec float64 `json:"bitsPerSec"`
Retransmits int `json:"retransmits,omitempty"`
RTTMin float64 `json:"rttMin,omitempty"`
RTTMax float64 `json:"rttMax,omitempty"`
RTTMean float64 `json:"rttMean,omitempty"`
RTTVar float64 `json:"rttVar,omitempty"`
}
IperfStream represents individual stream results
type IperfStreamSummary ¶
type IperfStreamSummary struct {
Bytes int64 `json:"bytes"`
BitsPerSec float64 `json:"bitsPerSec"`
MbitsPerSec float64 `json:"mbitsPerSec"`
Retransmits int `json:"retransmits,omitempty"`
}
IperfStreamSummary contains summary for sent/received data
type IperfSummary ¶
type IperfSummary struct {
Sent IperfStreamSummary `json:"sent"`
Received IperfStreamSummary `json:"received"`
CPUUtil IperfCPUUtil `json:"cpuUtil"`
LostPackets int `json:"lostPackets,omitempty"`
LostPercent float64 `json:"lostPercent,omitempty"`
Jitter float64 `json:"jitter,omitempty"`
}
IperfSummary contains aggregated test results
type IperfTestConfig ¶
type IperfTestConfig struct {
ServerIP string `json:"serverIP"`
Port int `json:"port"`
Duration time.Duration `json:"duration"`
Protocol string `json:"protocol"` // "tcp" or "udp"
Bandwidth string `json:"bandwidth"` // for UDP tests, e.g., "10M"
Parallel int `json:"parallel"` // number of parallel streams
WindowSize string `json:"windowSize"` // TCP window size
Interval time.Duration `json:"interval"` // reporting interval
Reverse bool `json:"reverse"` // reverse mode (server sends)
Bidir bool `json:"bidir"` // bidirectional test
JSON bool `json:"json"` // JSON output
}
IperfTestConfig defines parameters for iperf3 tests
type LatencyMetrics ¶
type LatencyMetrics struct {
RTTMs float64 `json:"rttMs"`
MinRTTMs float64 `json:"minRttMs"`
MaxRTTMs float64 `json:"maxRttMs"`
AvgRTTMs float64 `json:"avgRttMs"`
StdDevMs float64 `json:"stdDevMs"`
P50Ms float64 `json:"p50Ms"`
P95Ms float64 `json:"p95Ms"`
P99Ms float64 `json:"p99Ms"`
TargetMs float64 `json:"targetMs"`
}
LatencyMetrics contains detailed latency measurements (from types.go)
type MetricCollector ¶
type MetricCollector struct {
// contains filtered or unexported fields
}
MetricCollector collects metrics for a specific interface
type MockTNAgent ¶
type MockTNAgent struct {
// contains filtered or unexported fields
}
MockTNAgent provides a mock implementation of TNAgent for testing
func NewMockTNAgent ¶
func NewMockTNAgent(config *TNConfig, logger *log.Logger) *MockTNAgent
NewMockTNAgent creates a new mock TN agent for testing
func (*MockTNAgent) GetHealthEndpoint ¶
func (ma *MockTNAgent) GetHealthEndpoint() string
GetHealthEndpoint returns the health check URL for the mock agent
func (*MockTNAgent) GetStatus ¶
func (ma *MockTNAgent) GetStatus() (*TNStatus, error)
GetStatus returns the status of the mock agent
func (*MockTNAgent) Start ¶
func (ma *MockTNAgent) Start() error
Start starts the mock agent (no-op for mock)
type NetworkInterface ¶
type NetworkInterface struct {
Name string `json:"name" yaml:"name"`
Type string `json:"type" yaml:"type"`
IP string `json:"ip" yaml:"ip"`
Netmask string `json:"netmask" yaml:"netmask"`
Gateway string `json:"gateway" yaml:"gateway"`
MTU int `json:"mtu" yaml:"mtu"`
State string `json:"state" yaml:"state"`
}
type NetworkStats ¶
type NetworkStats struct {
Timestamp time.Time `json:"timestamp"`
TotalRxMbps float64 `json:"totalRxMbps"`
TotalTxMbps float64 `json:"totalTxMbps"`
TotalMbps float64 `json:"totalMbps"`
AvgUtilization float64 `json:"avgUtilization"`
Interfaces map[string]*InterfaceMetrics `json:"interfaces"`
QueueStats map[string]int64 `json:"queueStats"`
TotalErrors int64 `json:"totalErrors"`
TotalDropped int64 `json:"totalDropped"`
}
NetworkStats contains aggregated network statistics
type PerformanceMetrics ¶
type PerformanceMetrics struct {
Timestamp time.Time `json:"timestamp"`
ClusterName string `json:"clusterName"`
TestID string `json:"testId"`
TestType string `json:"testType"`
Duration time.Duration `json:"duration"`
Throughput ThroughputMetrics `json:"throughput"`
Latency LatencyMetrics `json:"latency"`
PacketLoss float64 `json:"packetLoss"`
Jitter float64 `json:"jitter"`
BandwidthUtilization float64 `json:"bandwidthUtilization"`
QoSClass string `json:"qosClass"`
VXLANOverhead float64 `json:"vxlanOverhead"`
TCOverhead float64 `json:"tcOverhead"`
NetworkPath []string `json:"networkPath"`
ErrorDetails []string `json:"errorDetails,omitempty"`
}
type PerformanceTestConfig ¶
type PerformanceTestConfig struct {
TestID string `json:"testId"`
SliceID string `json:"sliceId"`
SliceType string `json:"sliceType"`
Duration time.Duration `json:"duration"`
TestType string `json:"testType"` // "iperf3", "ping", "custom"
SourceCluster string `json:"sourceCluster"`
TargetCluster string `json:"targetCluster"`
Protocol string `json:"protocol"` // "tcp", "udp"
Parallel int `json:"parallel"`
WindowSize string `json:"windowSize"`
Interval time.Duration `json:"interval"`
}
type PrometheusMetrics ¶
type PrometheusMetrics struct {
// Network throughput metrics
ThroughputMbps *prometheus.GaugeVec
// Latency metrics
LatencyMs *prometheus.GaugeVec
// Packet metrics
PacketsTotal *prometheus.CounterVec
PacketsDropped *prometheus.CounterVec
PacketsErrors *prometheus.CounterVec
// VXLAN metrics
VXLANTunnelUp *prometheus.GaugeVec
VXLANOverhead *prometheus.GaugeVec
// TC metrics
TCRulesActive *prometheus.GaugeVec
TCOverhead *prometheus.GaugeVec
BandwidthUtilization *prometheus.GaugeVec
// Test metrics
TestDuration *prometheus.HistogramVec
TestSuccess *prometheus.CounterVec
TestFailure *prometheus.CounterVec
// Agent health metrics
AgentUp *prometheus.GaugeVec
AgentConnections *prometheus.GaugeVec
// Performance target compliance
ThesisCompliance *prometheus.GaugeVec
SLACompliance *prometheus.GaugeVec
}
PrometheusMetrics contains all Prometheus metrics for the TN agent
func NewPrometheusMetrics ¶
func NewPrometheusMetrics() *PrometheusMetrics
NewPrometheusMetrics creates new Prometheus metrics
func (*PrometheusMetrics) RecordAgentStatus ¶
func (pm *PrometheusMetrics) RecordAgentStatus(clusterName string, status *TNStatus)
RecordAgentStatus records complete agent status
func (*PrometheusMetrics) RecordPerformanceTest ¶
func (pm *PrometheusMetrics) RecordPerformanceTest(clusterName string, metrics *PerformanceMetrics)
RecordPerformanceTest records a complete performance test
func (*PrometheusMetrics) UpdateAgentMetrics ¶
func (pm *PrometheusMetrics) UpdateAgentMetrics(clusterName string, healthy bool, connections int)
UpdateAgentMetrics updates agent health metrics
func (*PrometheusMetrics) UpdateBandwidthMetrics ¶
func (pm *PrometheusMetrics) UpdateBandwidthMetrics(clusterName string, interfaceMetrics map[string]*InterfaceMetrics)
UpdateBandwidthMetrics updates bandwidth utilization metrics
func (*PrometheusMetrics) UpdateLatencyMetrics ¶
func (pm *PrometheusMetrics) UpdateLatencyMetrics(clusterName string, metrics *LatencyMetrics, target, sliceType string)
UpdateLatencyMetrics updates latency metrics
func (*PrometheusMetrics) UpdateSLACompliance ¶
func (pm *PrometheusMetrics) UpdateSLACompliance(clusterName, sliceType string, compliant bool)
UpdateSLACompliance updates SLA compliance metrics
func (*PrometheusMetrics) UpdateTCMetrics ¶
func (pm *PrometheusMetrics) UpdateTCMetrics(clusterName, interfaceName string, status *TCStatus, overhead float64)
UpdateTCMetrics updates Traffic Control metrics
func (*PrometheusMetrics) UpdateTestMetrics ¶
func (pm *PrometheusMetrics) UpdateTestMetrics(clusterName, testType, sliceType string, duration float64, success bool)
UpdateTestMetrics updates test execution metrics
func (*PrometheusMetrics) UpdateThesisCompliance ¶
func (pm *PrometheusMetrics) UpdateThesisCompliance(clusterName string, validation *ThesisValidation)
UpdateThesisCompliance updates thesis validation metrics
func (*PrometheusMetrics) UpdateThroughputMetrics ¶
func (pm *PrometheusMetrics) UpdateThroughputMetrics(clusterName string, metrics *ThroughputMetrics, sliceType string)
UpdateThroughputMetrics updates throughput metrics
func (*PrometheusMetrics) UpdateVXLANMetrics ¶
func (pm *PrometheusMetrics) UpdateVXLANMetrics(clusterName string, status *VXLANStatus, overhead float64)
UpdateVXLANMetrics updates VXLAN metrics
type TCManager ¶
type TCManager struct {
// contains filtered or unexported fields
}
TCManager manages Traffic Control (TC) operations for bandwidth shaping
func NewTCManager ¶
func NewTCManager(config *BandwidthPolicy, interfaceName string, logger *log.Logger) *TCManager
NewTCManager creates a new Traffic Control manager
func (*TCManager) ApplyShaping ¶
ApplyShaping applies traffic shaping rules to the interface
func (*TCManager) CalculateTCOverhead ¶
CalculateTCOverhead estimates the overhead introduced by TC processing
func (*TCManager) CleanRules ¶
CleanRules removes all existing TC rules from the interface
func (*TCManager) GetBandwidthUsage ¶
GetBandwidthUsage returns current bandwidth utilization
func (*TCManager) GetTCStatus ¶
GetTCStatus returns the current TC configuration and statistics
func (*TCManager) MonitorBandwidth ¶
MonitorBandwidth continuously monitors bandwidth usage
func (*TCManager) UpdateShaping ¶
func (tc *TCManager) UpdateShaping(newConfig *BandwidthPolicy) error
UpdateShaping updates the traffic shaping configuration
type TCStatus ¶
type TCStatus struct {
RulesActive bool `json:"rulesActive"`
QueueStats map[string]int64 `json:"queueStats"`
ShapingActive bool `json:"shapingActive"`
Interfaces []string `json:"interfaces"`
}
TCStatus represents TC status information
type TNAgent ¶
type TNAgent struct {
// contains filtered or unexported fields
}
TNAgent represents the Transport Network agent
func NewTNAgent ¶
NewTNAgent creates a new Transport Network agent
func (*TNAgent) ConfigureSlice ¶
ConfigureSlice configures the network slice
func (*TNAgent) RunPerformanceTest ¶
func (agent *TNAgent) RunPerformanceTest(config *PerformanceTestConfig) (*PerformanceMetrics, error)
RunPerformanceTest executes a comprehensive performance test
type TNConfig ¶
type TNConfig struct {
ClusterName string `json:"clusterName" yaml:"clusterName"`
NetworkCIDR string `json:"networkCIDR" yaml:"networkCIDR"`
VXLANConfig VXLANConfig `json:"vxlan" yaml:"vxlan"`
BWPolicy BandwidthPolicy `json:"bandwidthPolicy" yaml:"bandwidthPolicy"`
QoSClass string `json:"qosClass" yaml:"qosClass"`
Interfaces []NetworkInterface `json:"interfaces" yaml:"interfaces"`
MonitoringPort int `json:"monitoringPort" yaml:"monitoringPort"`
}
Export relevant types from manager package
type TNStatus ¶
type TNStatus struct {
Healthy bool `json:"healthy"`
LastUpdate time.Time `json:"lastUpdate"`
ActiveConnections int `json:"activeConnections"`
BandwidthUsage map[string]float64 `json:"bandwidthUsage"`
VXLANStatus VXLANStatus `json:"vxlanStatus"`
TCStatus TCStatus `json:"tcStatus"`
ErrorMessages []string `json:"errorMessages,omitempty"`
}
type ThesisValidation ¶
type ThesisValidation struct {
DeployTimeMs int64 `json:"deployTimeMs"`
DLThroughputMbps float64 `json:"dlThroughputMbps"`
PingRTTMs float64 `json:"pingRTTMs"`
TCOverheadPercent float64 `json:"tcOverheadPercent"`
CompliancePercent float64 `json:"compliancePercent"`
ThroughputResults []float64 `json:"throughputResults"`
ThroughputTargets []float64 `json:"throughputTargets"`
RTTResults []float64 `json:"rttResults"`
RTTTargets []float64 `json:"rttTargets"`
}
ThesisValidation represents thesis validation metrics
type ThroughputMetrics ¶
type ThroughputMetrics struct {
DownlinkMbps float64 `json:"downlinkMbps"`
UplinkMbps float64 `json:"uplinkMbps"`
BiDirMbps float64 `json:"biDirMbps"`
TargetMbps float64 `json:"targetMbps"`
AchievedRatio float64 `json:"achievedRatio"`
PeakMbps float64 `json:"peakMbps"`
MinMbps float64 `json:"minMbps"`
AvgMbps float64 `json:"avgMbps"`
StdDevMbps float64 `json:"stdDevMbps"`
}
ThroughputMetrics contains detailed throughput measurements (from types.go)
type VXLANConfig ¶
type VXLANConfig struct {
VNI uint32 `json:"vni" yaml:"vni"`
RemoteIPs []string `json:"remoteIPs" yaml:"remoteIPs"`
LocalIP string `json:"localIP" yaml:"localIP"`
Port int `json:"port" yaml:"port"`
MTU int `json:"mtu" yaml:"mtu"`
DeviceName string `json:"deviceName" yaml:"deviceName"`
Learning bool `json:"learning" yaml:"learning"`
}
VXLANConfig represents the configuration from types.go
type VXLANManager ¶
type VXLANManager struct {
// contains filtered or unexported fields
}
VXLANManager manages VXLAN tunnel operations
func NewVXLANManager ¶
func NewVXLANManager(config *VXLANConfig, logger *log.Logger) *VXLANManager
NewVXLANManager creates a new VXLAN manager
func (*VXLANManager) CalculateVXLANOverhead ¶
func (vm *VXLANManager) CalculateVXLANOverhead(originalMTU int) float64
CalculateVXLANOverhead calculates the overhead introduced by VXLAN encapsulation
func (*VXLANManager) CreateTunnel ¶
func (vm *VXLANManager) CreateTunnel() error
CreateTunnel creates a VXLAN tunnel
func (*VXLANManager) DeleteTunnel ¶
func (vm *VXLANManager) DeleteTunnel() error
DeleteTunnel removes the VXLAN tunnel
func (*VXLANManager) GetTunnelStatus ¶
func (vm *VXLANManager) GetTunnelStatus() (*VXLANStatus, error)
GetTunnelStatus returns the current status of the VXLAN tunnel
func (*VXLANManager) GetVXLANInfo ¶
func (vm *VXLANManager) GetVXLANInfo() (map[string]interface{}, error)
GetVXLANInfo returns detailed VXLAN interface information
func (*VXLANManager) MonitorTunnel ¶
func (vm *VXLANManager) MonitorTunnel(interval time.Duration, stopCh <-chan struct{})
MonitorTunnel continuously monitors tunnel health
func (*VXLANManager) TestConnectivity ¶
func (vm *VXLANManager) TestConnectivity() map[string]bool
TestConnectivity tests connectivity to remote peers
func (*VXLANManager) UpdatePeers ¶
func (vm *VXLANManager) UpdatePeers(newPeers []string) error
UpdatePeers updates the list of remote peers
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package tc provides secure traffic control (TC) management functionality All subprocess operations use SecureExecuteWithValidation to prevent command injection
|
Package tc provides secure traffic control (TC) management functionality All subprocess operations use SecureExecuteWithValidation to prevent command injection |
|
watcher
module
|