blob: 709105b713e684edfbc8fb8dff080e4723f1af4c [file] [log] [blame]
Phaneendra Manda4c62c802019-03-06 21:37:49 +05301// Copyright (c) 2018 Open Networking Foundation
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at:
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15syntax = "proto3";
16
17option go_package = "github.com/opencord/voltha-go/protos/openolt";
18
19package openolt;
20
21import "google/api/annotations.proto";
22
23service Openolt {
24
25 rpc DisableOlt(Empty) returns (Empty) {
26 option (google.api.http) = {
27 post: "/v1/Disable"
28 body: "*"
29 };
30 }
31
32 rpc ReenableOlt(Empty) returns (Empty) {
33 option (google.api.http) = {
34 post: "/v1/Reenable"
35 body: "*"
36 };
37 }
38
39 rpc ActivateOnu(Onu) returns (Empty) {
40 option (google.api.http) = {
41 post: "/v1/EnableOnu"
42 body: "*"
43 };
44 }
45
46 rpc DeactivateOnu(Onu) returns (Empty) {
47 option (google.api.http) = {
48 post: "/v1/DisableOnu"
49 body: "*"
50 };
51 }
52
53 rpc DeleteOnu(Onu) returns (Empty) {
54 option (google.api.http) = {
55 post: "/v1/DeleteOnu"
56 body: "*"
57 };
58 }
59
60 rpc OmciMsgOut(OmciMsg) returns (Empty) {
61 option (google.api.http) = {
62 post: "/v1/OmciMsgOut"
63 body: "*"
64 };
65 }
66
67 rpc OnuPacketOut(OnuPacket) returns (Empty) {
68 option (google.api.http) = {
69 post: "/v1/OnuPacketOut"
70 body: "*"
71 };
72 }
73
74 rpc UplinkPacketOut(UplinkPacket) returns (Empty) {
75 option (google.api.http) = {
76 post: "/v1/UplinkPacketOut"
77 body: "*"
78 };
79 }
80
81 rpc FlowAdd(Flow) returns (Empty) {
82 option (google.api.http) = {
83 post: "/v1/FlowAdd"
84 body: "*"
85 };
86 }
87
88 rpc FlowRemove(Flow) returns (Empty) {
89 option (google.api.http) = {
90 post: "/v1/FlowRemove"
91 body: "*"
92 };
93 }
94
95 rpc HeartbeatCheck(Empty) returns (Heartbeat) {
96 option (google.api.http) = {
97 post: "/v1/HeartbeatCheck"
98 body: "*"
99 };
100 }
101
102 rpc EnablePonIf(Interface) returns (Empty) {
103 option (google.api.http) = {
104 post: "/v1/EnablePonIf"
105 body: "*"
106 };
107 }
108
109 rpc DisablePonIf(Interface) returns (Empty) {
110 option (google.api.http) = {
111 post: "/v1/DisablePonIf"
112 body: "*"
113 };
114 }
115
116 rpc GetDeviceInfo(Empty) returns (DeviceInfo) {
117 option (google.api.http) = {
118 post: "/v1/GetDeviceInfo"
119 body: "*"
120 };
121 }
122
123 rpc Reboot(Empty) returns (Empty) {
124 option (google.api.http) = {
125 post: "/v1/Reboot"
126 body: "*"
127 };
128 }
129
130 rpc CollectStatistics(Empty) returns (Empty) {
131 option (google.api.http) = {
132 post: "/v1/CollectStatistics"
133 body: "*"
134 };
135 }
136
137 rpc CreateTconts(Tconts) returns (Empty) {
138 option (google.api.http) = {
139 post: "/v1/CreateTconts"
140 body: "*"
141 };
142 }
143
144 rpc RemoveTconts(Tconts) returns (Empty) {
145 option (google.api.http) = {
146 post: "/v1/RemoveTconts"
147 body: "*"
148 };
149 }
150
151 rpc EnableIndication(Empty) returns (stream Indication) {}
152}
153
154message Indication {
155 oneof data {
156 OltIndication olt_ind = 1;
157 IntfIndication intf_ind = 2;
158 IntfOperIndication intf_oper_ind = 3;
159 OnuDiscIndication onu_disc_ind = 4;
160 OnuIndication onu_ind = 5;
161 OmciIndication omci_ind = 6;
162 PacketIndication pkt_ind = 7;
163 PortStatistics port_stats = 8;
164 FlowStatistics flow_stats = 9;
165 AlarmIndication alarm_ind= 10;
166 }
167}
168
169message AlarmIndication {
170 oneof data {
171 LosIndication los_ind = 1;
172 DyingGaspIndication dying_gasp_ind = 2;
173 OnuAlarmIndication onu_alarm_ind = 3;
174 OnuStartupFailureIndication onu_startup_fail_ind = 4;
175 OnuSignalDegradeIndication onu_signal_degrade_ind = 5;
176 OnuDriftOfWindowIndication onu_drift_of_window_ind = 6;
177 OnuLossOfOmciChannelIndication onu_loss_omci_ind = 7;
178 OnuSignalsFailureIndication onu_signals_fail_ind = 8;
179 OnuTransmissionInterferenceWarning onu_tiwi_ind = 9;
180 OnuActivationFailureIndication onu_activation_fail_ind = 10;
181 OnuProcessingErrorIndication onu_processing_error_ind = 11;
182 }
183}
184
185message OltIndication {
186 string oper_state = 1; // up, down
187}
188
189message IntfIndication {
190 fixed32 intf_id = 1;
191 string oper_state = 2; // up, down
192}
193
194message OnuDiscIndication {
195 fixed32 intf_id = 1;
196 SerialNumber serial_number = 2;
197}
198
199message OnuIndication {
200 fixed32 intf_id = 1;
201 fixed32 onu_id = 2;
202 string oper_state = 3; // up, down
203 string admin_state = 5; // up, down
204 SerialNumber serial_number = 4;
205}
206
207message IntfOperIndication {
208 string type = 1; // nni, pon
209 fixed32 intf_id = 2;
210 string oper_state = 3; // up, down
211}
212
213message OmciIndication {
214 fixed32 intf_id = 1;
215 fixed32 onu_id = 2;
216 bytes pkt = 3;
217}
218
219message PacketIndication {
220 string intf_type = 5; // nni, pon, unknown
221 fixed32 intf_id = 1;
222 fixed32 gemport_id = 2;
223 fixed32 flow_id = 3;
224 fixed32 port_no = 6;
225 fixed64 cookie = 7;
226 bytes pkt = 4;
227}
228
229message Interface {
230 fixed32 intf_id = 1;
231}
232
233message Heartbeat {
234 fixed32 heartbeat_signature = 1;
235}
236
237message Onu {
238 fixed32 intf_id = 1;
239 fixed32 onu_id = 2;
240 SerialNumber serial_number = 3;
241 fixed32 pir = 4; // peak information rate assigned to onu
242}
243
244message OmciMsg {
245 fixed32 intf_id = 1;
246 fixed32 onu_id = 2;
247 bytes pkt = 3;
248}
249
250message OnuPacket {
251 fixed32 intf_id = 1;
252 fixed32 onu_id = 2;
253 fixed32 port_no = 4;
254 bytes pkt = 3;
255}
256
257message UplinkPacket {
258 fixed32 intf_id = 1;
259 bytes pkt = 2;
260}
261
262message DeviceInfo {
263 string vendor = 1;
264 string model = 2;
265 string hardware_version = 3;
266 string firmware_version = 4;
267 string device_id = 16;
268 string device_serial_number = 17;
269
270 // Total number of pon intf ports on the device
271 fixed32 pon_ports = 12;
272
273 // If using global per-device technology profile. To be deprecated
274 string technology = 5;
275 fixed32 onu_id_start = 6;
276 fixed32 onu_id_end = 7;
277 fixed32 alloc_id_start = 8;
278 fixed32 alloc_id_end = 9;
279 fixed32 gemport_id_start = 10;
280 fixed32 gemport_id_end = 11;
281 fixed32 flow_id_start = 13;
282 fixed32 flow_id_end = 14;
283
284 message DeviceResourceRanges {
285
286 // List of 0 or more intf_ids that use the same technology and pools.
287 // If 0 intf_ids supplied, it implies ALL interfaces
288 repeated fixed32 intf_ids = 1;
289
290 // Technology profile for this pool
291 string technology = 2;
292
293 message Pool {
294 enum PoolType {
295 ONU_ID = 0;
296 ALLOC_ID = 1;
297 GEMPORT_ID = 2;
298 FLOW_ID = 3;
299 }
300
301 enum SharingType {
302 DEDICATED_PER_INTF = 0;
303 SHARED_BY_ALL_INTF_ALL_TECH = 1; // Shared across all interfaces in all technologies in all ranges
304 SHARED_BY_ALL_INTF_SAME_TECH = 2; // Shared across all interfaces of the same technology used in this range
305 }
306
307 PoolType type = 1;
308 SharingType sharing = 2;
309 fixed32 start = 3; // lower bound on IDs allocated from this pool
310 fixed32 end = 4; // upper bound on IDs allocated from this pool
311 }
312 repeated Pool pools = 3;
313 }
314 repeated DeviceResourceRanges ranges = 15;
315}
316
317message Classifier {
318 fixed32 o_tpid = 1;
319 fixed32 o_vid = 2;
320 fixed32 i_tpid = 3;
321 fixed32 i_vid = 4;
322 fixed32 o_pbits = 5;
323 fixed32 i_pbits = 6;
324 fixed32 eth_type = 7;
325 bytes dst_mac = 8;
326 bytes src_mac = 9;
327 fixed32 ip_proto = 10;
328 fixed32 dst_ip = 11;
329 fixed32 src_ip = 12;
330 fixed32 src_port = 13;
331 fixed32 dst_port = 14;
332 string pkt_tag_type = 15; // untagged, single_tag, double_tag
333}
334
335message ActionCmd {
336 bool add_outer_tag = 1;
337 bool remove_outer_tag = 2;
338 bool trap_to_host = 3;
339}
340
341message Action {
342 ActionCmd cmd = 1;
343 fixed32 o_vid = 2;
344 fixed32 o_pbits = 3;
345 fixed32 o_tpid = 4;
346 fixed32 i_vid = 5;
347 fixed32 i_pbits = 6;
348 fixed32 i_tpid = 7;
349}
350
351message Flow {
352 sfixed32 access_intf_id = 1;
353 sfixed32 onu_id = 2;
354 sfixed32 uni_id = 11;
355 fixed32 flow_id = 3;
356 string flow_type = 4; // upstream, downstream, broadcast, multicast
357 sfixed32 alloc_id = 10;
358 sfixed32 network_intf_id = 5;
359 sfixed32 gemport_id = 6;
360 Classifier classifier = 7;
361 Action action = 8;
362 sfixed32 priority = 9;
363 fixed64 cookie = 12; // must be provided for any flow with trap_to_host action. Returned in PacketIndication
364 fixed32 port_no = 13; // must be provided for any flow with trap_to_host action. Returned in PacketIndication
365}
366
367message SerialNumber {
368 bytes vendor_id = 1;
369 bytes vendor_specific = 2;
370}
371
372message PortStatistics {
373 fixed32 intf_id = 1;
374 fixed64 rx_bytes = 2;
375 fixed64 rx_packets = 3;
376 fixed64 rx_ucast_packets = 4;
377 fixed64 rx_mcast_packets = 5;
378 fixed64 rx_bcast_packets = 6;
379 fixed64 rx_error_packets = 7;
380 fixed64 tx_bytes = 8;
381 fixed64 tx_packets = 9;
382 fixed64 tx_ucast_packets = 10;
383 fixed64 tx_mcast_packets = 11;
384 fixed64 tx_bcast_packets = 12;
385 fixed64 tx_error_packets = 13;
386 fixed64 rx_crc_errors = 14;
387 fixed64 bip_errors = 15;
388 fixed32 timestamp = 16;
389}
390
391message FlowStatistics {
392 fixed32 flow_id = 1;
393 fixed64 rx_bytes = 2;
394 fixed64 rx_packets = 3;
395 fixed64 tx_bytes = 8;
396 fixed64 tx_packets = 9;
397 fixed32 timestamp = 16;
398}
399
400message LosIndication {
401 fixed32 intf_id = 1;
402 string status = 2;
403}
404
405message DyingGaspIndication {
406 fixed32 intf_id = 1;
407 fixed32 onu_id = 2;
408 string status = 3;
409}
410
411message OnuAlarmIndication {
412 fixed32 intf_id = 1;
413 fixed32 onu_id = 2;
414 string los_status = 3;
415 string lob_status = 4;
416 string lopc_miss_status = 5;
417 string lopc_mic_error_status = 6;
418}
419
420message OnuStartupFailureIndication {
421 fixed32 intf_id = 1;
422 fixed32 onu_id = 2;
423 string status = 3;
424}
425
426message OnuSignalDegradeIndication {
427 fixed32 intf_id = 1;
428 fixed32 onu_id = 2;
429 string status = 3;
430 fixed32 inverse_bit_error_rate = 4;
431}
432
433message OnuDriftOfWindowIndication {
434 fixed32 intf_id = 1;
435 fixed32 onu_id = 2;
436 string status = 3;
437 fixed32 drift = 4;
438 fixed32 new_eqd = 5;
439}
440
441message OnuLossOfOmciChannelIndication {
442 fixed32 intf_id = 1;
443 fixed32 onu_id = 2;
444 string status = 3;
445}
446
447message OnuSignalsFailureIndication {
448 fixed32 intf_id = 1;
449 fixed32 onu_id = 2;
450 string status = 3;
451 fixed32 inverse_bit_error_rate = 4;
452}
453
454message OnuTransmissionInterferenceWarning {
455 fixed32 intf_id = 1;
456 fixed32 onu_id = 2;
457 string status = 3;
458 fixed32 drift = 4;
459}
460
461message OnuActivationFailureIndication {
462 fixed32 intf_id = 1;
463 fixed32 onu_id = 2;
464}
465
466message OnuProcessingErrorIndication {
467 fixed32 intf_id = 1;
468 fixed32 onu_id = 2;
469}
470
471enum Direction {
472 UPSTREAM = 0;
473 DOWNSTREAM = 1;
474 BIDIRECTIONAL = 2;
475}
476
477enum SchedulingPolicy {
478 WRR = 0;
479 StrictPriority = 1;
480 Hybrid = 2;
481}
482
483enum AdditionalBW {
484 AdditionalBW_None = 0;
485 AdditionalBW_NA = 1;
486 AdditionalBW_BestEffort = 2;
487 AdditionalBW_Auto = 3;
488}
489
490enum DiscardPolicy {
491 TailDrop = 0;
492 WTailDrop = 1;
493 Red = 2;
494 WRed = 3;
495}
496
497enum InferredAdditionBWIndication {
498 InferredAdditionBWIndication_None = 0;
499 InferredAdditionBWIndication_Assured = 1;
500 InferredAdditionBWIndication_BestEffort = 2;
501}
502
503message Scheduler {
504 Direction direction = 1;
505 AdditionalBW additional_bw = 2; // Valid on for “direction == Upstream”.
506 fixed32 priority = 3;
507 fixed32 weight = 4;
508 SchedulingPolicy sched_policy = 5;
509}
510
511message TrafficShapingInfo {
512 fixed32 cir = 1;
513 fixed32 cbs = 2;
514 fixed32 pir = 3;
515 fixed32 pbs = 4;
516 fixed32 gir = 5; // only if “direction == Upstream ”
517 InferredAdditionBWIndication add_bw_ind = 6; // only if “direction == Upstream”
518}
519
520message Tcont {
521 Direction direction = 1;
522 fixed32 alloc_id = 2; // valid only if “direction == Upstream ”
523 Scheduler scheduler = 3;
524 TrafficShapingInfo traffic_shaping_info = 4;
525}
526
527message Tconts {
528 fixed32 intf_id = 1;
529 fixed32 onu_id = 2;
530 fixed32 uni_id = 4;
531 fixed32 port_no = 5;
532 repeated Tcont tconts = 3;
533}
534
535message TailDropDiscardConfig {
536 fixed32 queue_size = 1;
537}
538
539message RedDiscardConfig {
540 fixed32 min_threshold = 1;
541 fixed32 max_threshold = 2;
542 fixed32 max_probability = 3;
543}
544
545message WRedDiscardConfig {
546 RedDiscardConfig green = 1;
547 RedDiscardConfig yellow = 2;
548 RedDiscardConfig red = 3;
549}
550
551message DiscardConfig {
552 DiscardPolicy discard_policy = 1;
553 oneof discard_config {
554 TailDropDiscardConfig tail_drop_discard_config = 2;
555 RedDiscardConfig red_discard_config = 3;
556 WRedDiscardConfig wred_discard_config = 4;
557 }
558}
559
560message Empty {}