working to analyze timing issues
This commit is contained in:
40
analyzer/models/flow_stats.py
Normal file
40
analyzer/models/flow_stats.py
Normal file
@@ -0,0 +1,40 @@
|
||||
"""
|
||||
Data structures for flow and frame type statistics
|
||||
"""
|
||||
|
||||
from dataclasses import dataclass, field
|
||||
from typing import Dict, List, Set, Tuple
|
||||
|
||||
|
||||
@dataclass
|
||||
class FrameTypeStats:
|
||||
"""Statistics for a specific frame type within a flow"""
|
||||
frame_type: str
|
||||
count: int = 0
|
||||
total_bytes: int = 0
|
||||
timestamps: List[float] = field(default_factory=list)
|
||||
frame_numbers: List[int] = field(default_factory=list)
|
||||
inter_arrival_times: List[float] = field(default_factory=list)
|
||||
avg_inter_arrival: float = 0.0
|
||||
std_inter_arrival: float = 0.0
|
||||
outlier_frames: List[int] = field(default_factory=list)
|
||||
outlier_details: List[Tuple[int, float]] = field(default_factory=list)
|
||||
|
||||
|
||||
@dataclass
|
||||
class FlowStats:
|
||||
"""Statistics for a source-destination IP pair"""
|
||||
src_ip: str
|
||||
dst_ip: str
|
||||
frame_count: int
|
||||
timestamps: List[float]
|
||||
frame_numbers: List[int]
|
||||
inter_arrival_times: List[float]
|
||||
avg_inter_arrival: float
|
||||
std_inter_arrival: float
|
||||
outlier_frames: List[int]
|
||||
outlier_details: List[Tuple[int, float]] # (frame_number, time_delta)
|
||||
total_bytes: int
|
||||
protocols: Set[str]
|
||||
detected_protocol_types: Set[str] # Enhanced protocol detection (CH10, PTP, IENA, etc)
|
||||
frame_types: Dict[str, FrameTypeStats] = field(default_factory=dict) # Per-frame-type statistics
|
||||
Reference in New Issue
Block a user