-
Notifications
You must be signed in to change notification settings - Fork 390
/
flow_stats.sandesh
182 lines (162 loc) · 4.14 KB
/
flow_stats.sandesh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
/*
* Copyright (c) 2015 Juniper Networks, Inc. All rights reserved.
*/
/**
* The flow stats module is responsible for flow sampling
* contrail-vrouter-agent exports flow records to contrail-collector
* upon flow creation and deletion, updates flow statistics at regular intervals
*
* Each flow is subjected to a sampling algorithm at regular interval to decide
* Whether flow is exported or not
*
* Parameters used for flow sampling algorithm are:
* Configured flow export rate (can be configured as part of global-vrouter-config)
* Actual flow export rate
* Sampling threshold (dynamic value calculated internally, if flow stats in a flow sample are above this threshold, the flow record is exported).
*/
include "vnsw/agent/oper/agent.sandesh"
/**
* Request message to set time interval for flow update to collector
*/
request sandesh SetFlowStatsInterval_InSeconds {
1: byte interval;
}
/**
* Response message of success to set time interval for flow update to collector
*/
response sandesh FlowStatsCfgResp {
1: string resp = " Success ";
}
/**
* Response message of error for setting time interval for flow update to collector
*/
response sandesh FlowStatsCfgErrResp {
1: string resp = " Failure: Value should be greater than 0 ";
}
/**
* Request message to get time interval for flow update to collector
*/
request sandesh GetFlowStatsInterval {
}
/**
* Response message for time interval for flow update to collector
*/
response sandesh FlowStatsIntervalResp_InSeconds {
1: byte flow_stats_interval;
}
/**
* Request message to get flow stats collection parameters configured for flow sampling
*/
request sandesh FlowStatsCollectionParamsReq {
}
/**
* Response message for flow stats collection parameters configured for flow sampling
*/
response sandesh FlowStatsCollectionParamsResp {
1: u32 flow_export_rate;
2: u32 sampling_threshold;
}
/**
* Sandesh definition for flow key based on five tuple consisting of source and destination IP addresses,
* ports and the ip protocol
*/
struct SandeshFlowKey {
1: u32 nh;
2: string sip;
3: string dip;
4: u32 src_port;
5: u32 dst_port;
6: byte protocol;
}
/**
* Flow entry as sandesh data type to be send to collector
*/
struct SandeshFlowExportInfo {
1: SandeshFlowKey key;
2: string egress_uuid;
3: string rev_flow_uuid;
4: string source_vn;
5: string dest_vn;
6: string sg_rule_uuid;
7: string nw_ace_uuid;
8: u64 setup_time;
9: u64 teardown_time;
10: u64 last_modified_time; //used for aging
11: u64 bytes;
12: u64 packets;
13: u32 flags;
14: u32 flow_handle;
15: list<agent.ActionStr> action;
16: string vm_cfg_name;
17: string peer_vrouter;
18: string tunnel_type;
19: string fip_vmi;
20: string fip;
21: u16 underlay_source_port;
22: bool delete_enqueued;
23: string uuid;
}
/**
* Statistics for flow record
*/
struct FlowStatsRecord {
1: SandeshFlowExportInfo info;
}
/**
* Request flow statistics
*/
request sandesh FlowStatsRecordsReq {
}
/**
* Response message for flow stats list
*/
response sandesh FlowStatsRecordsResp {
1: list<FlowStatsRecord> records_list;
}
/**
* Request message to get flow aging parameters
*/
request sandesh ShowAgingConfig {
}
/**
* Parameters for flow ageing
*/
struct AgingConfig {
1: u32 protocol;
2: u32 port;
3: u32 stats_interval;
4: u32 cache_timeout;
}
/**
* Response message for flow aging parameters
*/
response sandesh AgingConfigResponse {
1: list<AgingConfig> aging_config_list;
}
/**
* Request message for configuring flow aging parameters
*/
request sandesh AddAgingConfig {
1: u32 protocol;
2: u32 port;
3: optional u32 stats_interval;
4: optional u32 cache_timeout;
}
/**
* Request message to delete flow aging parameters
*/
request sandesh DeleteAgingConfig {
1: u32 protocol;
2: u32 port;
}
/**
* @description: Trace message for agent flow sampling export rate
* @type: Trace
* @severity: DEBUG
*/
traceobject sandesh FlowExportStatsTrace {
1: u32 export_rate;
2: u32 export_rate_without_sampling;
3: u32 old_threshold;
4: u32 new_threshold;
}