blob: dab179db9a84cd54cb167d3f5ada009780dc94ea [file] [log] [blame]
Matteo Scandolo84f7d482019-08-08 19:00:47 -07001// 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";
16package bbsim;
17
Pragya Arya8bdb4532020-03-02 17:08:09 +053018import "voltha_protos/openolt.proto";
Anand S Katti09541352020-01-29 15:54:01 +053019import "voltha_protos/tech_profile.proto";
Matteo Scandolo10f965c2019-09-24 10:40:46 -070020// Models
21
Matteo Scandolo84f7d482019-08-08 19:00:47 -070022message PONPort {
23 int32 ID = 1;
24 string OperState = 2;
25}
26
27message NNIPort {
28 int32 ID = 1;
29 string OperState = 2;
30}
31
32message Olt {
33 int32 ID = 1;
Matteo Scandolo8df63df2019-09-12 10:34:32 -070034 string SerialNumber = 2;
35 string OperState = 3;
36 string InternalState = 4;
rajeshf921f882020-03-06 18:24:28 +053037 string IP = 7;
Matteo Scandolo8df63df2019-09-12 10:34:32 -070038 repeated NNIPort NNIPorts = 5;
39 repeated PONPort PONPorts = 6;
Matteo Scandolo9a3518c2019-08-13 14:36:01 -070040}
41
42message ONU {
43 int32 ID = 1;
44 string SerialNumber = 2;
45 string OperState = 3;
46 string InternalState = 4;
47 int32 PonPortID = 5;
Matteo Scandolo4b3fc7e2019-09-17 16:49:54 -070048 string HwAddress = 8;
Matteo Scandolo27428702019-10-11 16:21:16 -070049 int32 PortNo = 9;
Matteo Scandolo4a036262020-08-17 15:56:13 -070050 repeated Service services = 10;
51}
52
53message Service {
54 string Name = 1;
55 string HwAddress = 2;
56 string OnuSn = 3;
57 int32 STag = 4;
58 int32 CTag = 5;
59 bool NeedsEapol = 6;
60 bool NeedsDhcp = 7;
61 bool NeedsIgmp = 8;
62 int32 GemPort = 9;
63 string EapolState = 10;
64 string DhcpState = 11;
Matteo Scandolo75ed5b92020-09-03 09:03:16 -070065 string InternalState = 12;
Matteo Scandolo618a6582020-09-09 12:21:29 -070066 string IGMPState = 13;
Matteo Scandolo9a3518c2019-08-13 14:36:01 -070067}
68
Anand S Katti09541352020-01-29 15:54:01 +053069message ONUTrafficSchedulers {
70 tech_profile.TrafficSchedulers traffSchedulers = 1;
71}
72
Matteo Scandolo9a3518c2019-08-13 14:36:01 -070073message ONUs {
74 repeated ONU items = 1;
Matteo Scandolo84f7d482019-08-08 19:00:47 -070075}
76
Matteo Scandolo4a036262020-08-17 15:56:13 -070077message Services {
78 repeated Service items = 1;
79}
80
Matteo Scandolo10f965c2019-09-24 10:40:46 -070081// Inputs
82
83message ONURequest {
84 string SerialNumber = 1;
85}
86
Pragya Aryabd731ec2020-02-11 16:38:17 +053087message PONRequest {
88 uint32 PonPortId = 1;
89}
90
Scott Baker41724b82020-01-21 19:54:53 -080091// Alarms
92
93message AlarmType {
94 // These types correspond to the messages permitted in the oneof
95 // in AlarmIndication in the openolt protos
96 enum Types {
97 LOS = 0; // LOS is an OLT alarm for an entire PON
98 DYING_GASP = 1;
99 ONU_ALARM = 2;
100 ONU_STARTUP_FAILURE = 3;
101 ONU_SIGNAL_DEGRADE = 4;
102 ONU_DRIFT_OF_WINDOW = 5;
103 ONU_LOSS_OF_OMCI_CHANNEL = 6;
104 ONU_SIGNALS_FAILURE = 7;
105 ONU_TRANSMISSION_INTERFERENCE_WARNING = 8;
106 ONU_ACTIVATION_FAILURE = 9;
107 ONU_PROCESSING_ERROR = 10;
108 ONU_LOSS_OF_KEY_SYNC_FAILURE = 11;
109 ONU_ITU_PON_STATS = 12;
110
111 // These break out ONU_ALARM, which is a single message, but
112 // includes statuses for these six alarms.
113 ONU_ALARM_LOS = 13;
114 ONU_ALARM_LOB = 14;
115 ONU_ALARM_LOPC_MISS = 15;
116 ONU_ALARM_LOPC_MIC_ERROR = 16;
117 ONU_ALARM_LOFI = 17;
118 ONU_ALARM_LOAMI = 18;
119 }
120}
121
122message AlarmParameter {
123 string Key = 1;
124 string Value = 2;
125}
126
Anand S Katti86552f92020-03-03 21:56:32 +0530127// ONUAlarmRequest includes fields common to every Onu alarm,
Anand S Katti09541352020-01-29 15:54:01 +0530128// plus an optional list of AlarmParameter list that can be used
Scott Baker41724b82020-01-21 19:54:53 -0800129// to set additional fields in alarms that support them.
Anand S Katti86552f92020-03-03 21:56:32 +0530130message ONUAlarmRequest {
Matteo Scandolo4a036262020-08-17 15:56:13 -0700131 string AlarmType = 1; // name of alarm to raise
132 string SerialNumber = 2; // serial number of ONU
133 string Status = 3; // status of Alarm
Scott Baker41724b82020-01-21 19:54:53 -0800134 repeated AlarmParameter Parameters = 4; // optional list of additional parameters
135}
136
Anand S Katti86552f92020-03-03 21:56:32 +0530137// OLT alarm request
138message OLTAlarmRequest {
Matteo Scandolo4a036262020-08-17 15:56:13 -0700139 uint32 InterfaceID = 1; // Switch Interface Id
140 string InterfaceType = 2; // PON or NNI Type
141 string Status = 3; // Interface Operstatus
Anand S Katti86552f92020-03-03 21:56:32 +0530142}
143
Matteo Scandolo10f965c2019-09-24 10:40:46 -0700144// Utils
145
Matteo Scandolo84f7d482019-08-08 19:00:47 -0700146message VersionNumber {
147 string version = 1;
148 string buildTime = 2;
149 string commitHash = 3;
150 string gitStatus = 4;
151}
152
Matteo Scandolo2bf742a2019-10-01 11:33:34 -0700153message LogLevel {
154 string level = 1;
155 bool caller = 2;
156}
157
Matteo Scandolo10f965c2019-09-24 10:40:46 -0700158message Response {
159 int32 status_code = 1;
160 string message = 2;
161}
162
Arjun E K57a7fcb2020-01-30 06:44:45 +0000163enum SubActionTypes {
164 JOIN = 0;
165 LEAVE = 1;
Arjun E Kdd443f02020-02-07 15:24:01 +0000166 JOINV3 = 2;
Arjun E K57a7fcb2020-01-30 06:44:45 +0000167}
168
169message IgmpRequest {
Matteo Scandolo4a036262020-08-17 15:56:13 -0700170 ONURequest OnuReq = 1;
171 SubActionTypes SubActionVal = 2;
Onur Kalinagac9f9faca2021-01-21 14:04:34 +0000172 string GroupAddress = 3;
Arjun E K57a7fcb2020-01-30 06:44:45 +0000173}
174
Pragya Arya8bdb4532020-03-02 17:08:09 +0530175message Flows {
176 uint32 flow_count = 1;
177 repeated openolt.Flow flows = 2;
178}
179
Matteo Scandolo88c204a2020-11-03 10:34:24 -0800180message Timeout {
181 uint32 delay = 1;
182}
183
Matteo Scandolo4a036262020-08-17 15:56:13 -0700184message Empty {
185}
Matteo Scandolo84f7d482019-08-08 19:00:47 -0700186
187service BBSim {
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530188 // Get BBSim version
Matteo Scandolo4a036262020-08-17 15:56:13 -0700189 rpc Version (Empty) returns (VersionNumber) {
190 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530191 // Set BBSim log level
Matteo Scandolo4a036262020-08-17 15:56:13 -0700192 rpc SetLogLevel (LogLevel) returns (LogLevel) {
193 }
Pragya Aryabd731ec2020-02-11 16:38:17 +0530194
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530195 // Get current status of OLT
Matteo Scandolo4a036262020-08-17 15:56:13 -0700196 rpc GetOlt (Empty) returns (Olt) {
197 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530198 // Poweron OLT
Matteo Scandolo4a036262020-08-17 15:56:13 -0700199 rpc PoweronOlt (Empty) returns (Response) {
200 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530201 // Shutdown OLT
Matteo Scandolo4a036262020-08-17 15:56:13 -0700202 rpc ShutdownOlt (Empty) returns (Response) {
203 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530204 // Reboot OLT
Matteo Scandolo4a036262020-08-17 15:56:13 -0700205 rpc RebootOlt (Empty) returns (Response) {
206 }
Matteo Scandolo88c204a2020-11-03 10:34:24 -0800207 // Closes the Openolt gRPC server
208 rpc StopgRPCServer (Empty) returns (Response) {
209 }
210 // Start the Openolt gRPC server
211 rpc StartgRPCServer (Empty) returns (Response) {
212 }
213 // Restart the Openolt gRPC server after the given timeout
214 rpc RestartgRPCServer (Timeout) returns (Response) {
215 }
Pragya Aryabd731ec2020-02-11 16:38:17 +0530216
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530217 // Get status of an ONU by serial number
Matteo Scandolo4a036262020-08-17 15:56:13 -0700218 rpc GetONU (ONURequest) returns (ONU) {
219 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530220 // Get status of all ONUs
Matteo Scandolo4a036262020-08-17 15:56:13 -0700221 rpc GetONUs (Empty) returns (ONUs) {
222 }
223
224 // Get all the Services
225 rpc GetServices (Empty) returns (Services) {
226 }
227
228 // Get all the Services of an ONU by serial number
229 rpc GetOnuServices (ONURequest) returns (Services) {
230 }
Pragya Aryabd731ec2020-02-11 16:38:17 +0530231
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530232 // Shutdown an ONU by serial number
Matteo Scandolo4a036262020-08-17 15:56:13 -0700233 rpc ShutdownONU (ONURequest) returns (Response) {
234 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530235 // Shutdown all ONUs in OLT
Matteo Scandolo4a036262020-08-17 15:56:13 -0700236 rpc ShutdownAllONUs (Empty) returns (Response) {
237 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530238 // Shutdown all ONUs under a PON by pon-port-ID
Matteo Scandolo4a036262020-08-17 15:56:13 -0700239 rpc ShutdownONUsOnPON (PONRequest) returns (Response) {
240 }
Pragya Aryabd731ec2020-02-11 16:38:17 +0530241
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530242 // Poweron an ONU by serial number
Matteo Scandolo4a036262020-08-17 15:56:13 -0700243 rpc PoweronONU (ONURequest) returns (Response) {
244 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530245 // Poweron all ONUs in OLT
Matteo Scandolo4a036262020-08-17 15:56:13 -0700246 rpc PoweronAllONUs (Empty) returns (Response) {
247 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530248 // Poweron all ONUs under a PON by pon-port-ID
Matteo Scandolo4a036262020-08-17 15:56:13 -0700249 rpc PoweronONUsOnPON (PONRequest) returns (Response) {
250 }
Pragya Aryabd731ec2020-02-11 16:38:17 +0530251
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530252 // Restart EAPOL for ONU
Matteo Scandolo4a036262020-08-17 15:56:13 -0700253 rpc RestartEapol (ONURequest) returns (Response) {
254 }
Onur Kalinagac9f9faca2021-01-21 14:04:34 +0000255 // Restart DHCP for ONU
Matteo Scandolo4a036262020-08-17 15:56:13 -0700256 rpc RestartDhcp (ONURequest) returns (Response) {
257 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530258 // Send ONU alarm indication
Matteo Scandolo4a036262020-08-17 15:56:13 -0700259 rpc SetOnuAlarmIndication (ONUAlarmRequest) returns (Response) {
260 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530261 // Send OLT alarm indication for Interface type NNI or PON
Matteo Scandolo4a036262020-08-17 15:56:13 -0700262 rpc SetOltAlarmIndication (OLTAlarmRequest) returns (Response) {
263 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530264 // Get all flows or ONU specific flows
Matteo Scandolo4a036262020-08-17 15:56:13 -0700265 rpc GetFlows (ONURequest) returns (Flows) {
266 }
Onur Kalinagac9f9faca2021-01-21 14:04:34 +0000267 // Change IGMP state
Matteo Scandolo4a036262020-08-17 15:56:13 -0700268 rpc ChangeIgmpState (IgmpRequest) returns (Response) {
269 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530270 // Get Traffic scheduler information for ONU
Matteo Scandolo4a036262020-08-17 15:56:13 -0700271 rpc GetOnuTrafficSchedulers (ONURequest) returns (ONUTrafficSchedulers) {
272 }
Arjun E K57a7fcb2020-01-30 06:44:45 +0000273}