blob: 0216eb5e05c7f4b839c9236aa59fdaa8bcb73aa0 [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";
amit.ghoshee17c002021-06-10 12:14:38 +020016
17option go_package = "github.com/opencord/bbsim/api/bbsim";
18
Matteo Scandolo84f7d482019-08-08 19:00:47 -070019package bbsim;
20
Pragya Arya8bdb4532020-03-02 17:08:09 +053021import "voltha_protos/openolt.proto";
Anand S Katti09541352020-01-29 15:54:01 +053022import "voltha_protos/tech_profile.proto";
Matteo Scandolo10f965c2019-09-24 10:40:46 -070023// Models
24
Matteo Scandolo84f7d482019-08-08 19:00:47 -070025message PONPort {
26 int32 ID = 1;
27 string OperState = 2;
Matteo Scandolo4b077aa2021-02-16 17:33:37 -080028 string InternalState = 3;
29 uint64 PacketCount = 4;
30 // ONU ID are reported by VOLTHA in the ActivateOnu call
31 repeated PonAllocatedResources AllocatedOnuIds = 5;
32 // these are the stored resource IDs as reported via OMCI
33 repeated PonAllocatedResources AllocatedGemPorts = 6;
34 repeated PonAllocatedResources AllocatedAllocIds = 7;
35}
36
37message PonAllocatedResources {
38 string SerialNumber = 1;
39 int32 Id = 2;
Matteo Scandolo84f7d482019-08-08 19:00:47 -070040}
41
42message NNIPort {
43 int32 ID = 1;
44 string OperState = 2;
45}
46
47message Olt {
48 int32 ID = 1;
Matteo Scandolo8df63df2019-09-12 10:34:32 -070049 string SerialNumber = 2;
50 string OperState = 3;
51 string InternalState = 4;
rajeshf921f882020-03-06 18:24:28 +053052 string IP = 7;
Matteo Scandolo8df63df2019-09-12 10:34:32 -070053 repeated NNIPort NNIPorts = 5;
54 repeated PONPort PONPorts = 6;
Matteo Scandolo9a3518c2019-08-13 14:36:01 -070055}
56
Matteo Scandolo4b077aa2021-02-16 17:33:37 -080057message OltAllocatedResourceType {
58 enum Type {
59 UNKNOWN = 0;
60 ALLOC_ID = 1;
61 GEM_PORT = 2;
62 }
63 Type type = 1;
64}
65
66message OltAllocatedResource {
67 string Type = 1;
68 uint32 PonPortId = 2;
69 uint32 OnuId = 3;
70 uint32 PortNo = 4;
71 int32 ResourceId = 5;
72 uint64 FlowId = 6;
73}
74
75message OltAllocatedResources {
76 repeated OltAllocatedResource resources = 1;
77}
78
Matteo Scandolo9a3518c2019-08-13 14:36:01 -070079message ONU {
80 int32 ID = 1;
81 string SerialNumber = 2;
82 string OperState = 3;
83 string InternalState = 4;
84 int32 PonPortID = 5;
Matteo Scandolo4b3fc7e2019-09-17 16:49:54 -070085 string HwAddress = 8;
Matteo Scandolo27428702019-10-11 16:21:16 -070086 int32 PortNo = 9;
Matteo Scandolo4a036262020-08-17 15:56:13 -070087 repeated Service services = 10;
Matteo Scandolocedde462021-03-09 17:37:16 -080088 int32 ImageSoftwareExpectedSections = 11;
89 int32 ImageSoftwareReceivedSections = 12;
90 int32 ActiveImageEntityId = 13;
91 int32 CommittedImageEntityId = 14;
Matteo Scandolo4a036262020-08-17 15:56:13 -070092}
93
94message Service {
95 string Name = 1;
96 string HwAddress = 2;
97 string OnuSn = 3;
98 int32 STag = 4;
99 int32 CTag = 5;
100 bool NeedsEapol = 6;
101 bool NeedsDhcp = 7;
102 bool NeedsIgmp = 8;
103 int32 GemPort = 9;
104 string EapolState = 10;
105 string DhcpState = 11;
Matteo Scandolo75ed5b92020-09-03 09:03:16 -0700106 string InternalState = 12;
Matteo Scandolo618a6582020-09-09 12:21:29 -0700107 string IGMPState = 13;
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700108}
109
Anand S Katti09541352020-01-29 15:54:01 +0530110message ONUTrafficSchedulers {
111 tech_profile.TrafficSchedulers traffSchedulers = 1;
112}
113
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700114message ONUs {
115 repeated ONU items = 1;
Matteo Scandolo84f7d482019-08-08 19:00:47 -0700116}
117
Matteo Scandolo4a036262020-08-17 15:56:13 -0700118message Services {
119 repeated Service items = 1;
120}
121
Matteo Scandolo10f965c2019-09-24 10:40:46 -0700122// Inputs
123
124message ONURequest {
125 string SerialNumber = 1;
126}
127
Pragya Aryabd731ec2020-02-11 16:38:17 +0530128message PONRequest {
129 uint32 PonPortId = 1;
130}
131
Scott Baker41724b82020-01-21 19:54:53 -0800132// Alarms
133
134message AlarmType {
135 // These types correspond to the messages permitted in the oneof
136 // in AlarmIndication in the openolt protos
137 enum Types {
138 LOS = 0; // LOS is an OLT alarm for an entire PON
139 DYING_GASP = 1;
140 ONU_ALARM = 2;
141 ONU_STARTUP_FAILURE = 3;
142 ONU_SIGNAL_DEGRADE = 4;
143 ONU_DRIFT_OF_WINDOW = 5;
144 ONU_LOSS_OF_OMCI_CHANNEL = 6;
145 ONU_SIGNALS_FAILURE = 7;
146 ONU_TRANSMISSION_INTERFERENCE_WARNING = 8;
147 ONU_ACTIVATION_FAILURE = 9;
148 ONU_PROCESSING_ERROR = 10;
149 ONU_LOSS_OF_KEY_SYNC_FAILURE = 11;
150 ONU_ITU_PON_STATS = 12;
151
152 // These break out ONU_ALARM, which is a single message, but
153 // includes statuses for these six alarms.
154 ONU_ALARM_LOS = 13;
155 ONU_ALARM_LOB = 14;
156 ONU_ALARM_LOPC_MISS = 15;
157 ONU_ALARM_LOPC_MIC_ERROR = 16;
158 ONU_ALARM_LOFI = 17;
159 ONU_ALARM_LOAMI = 18;
160 }
161}
162
163message AlarmParameter {
164 string Key = 1;
165 string Value = 2;
166}
167
Anand S Katti86552f92020-03-03 21:56:32 +0530168// ONUAlarmRequest includes fields common to every Onu alarm,
Anand S Katti09541352020-01-29 15:54:01 +0530169// plus an optional list of AlarmParameter list that can be used
Scott Baker41724b82020-01-21 19:54:53 -0800170// to set additional fields in alarms that support them.
Anand S Katti86552f92020-03-03 21:56:32 +0530171message ONUAlarmRequest {
Matteo Scandolo4a036262020-08-17 15:56:13 -0700172 string AlarmType = 1; // name of alarm to raise
173 string SerialNumber = 2; // serial number of ONU
174 string Status = 3; // status of Alarm
Scott Baker41724b82020-01-21 19:54:53 -0800175 repeated AlarmParameter Parameters = 4; // optional list of additional parameters
176}
177
Anand S Katti86552f92020-03-03 21:56:32 +0530178// OLT alarm request
179message OLTAlarmRequest {
Matteo Scandolo4a036262020-08-17 15:56:13 -0700180 uint32 InterfaceID = 1; // Switch Interface Id
181 string InterfaceType = 2; // PON or NNI Type
182 string Status = 3; // Interface Operstatus
Anand S Katti86552f92020-03-03 21:56:32 +0530183}
184
Matteo Scandolo10f965c2019-09-24 10:40:46 -0700185// Utils
186
Matteo Scandolo84f7d482019-08-08 19:00:47 -0700187message VersionNumber {
188 string version = 1;
189 string buildTime = 2;
190 string commitHash = 3;
191 string gitStatus = 4;
192}
193
Matteo Scandolo2bf742a2019-10-01 11:33:34 -0700194message LogLevel {
195 string level = 1;
196 bool caller = 2;
197}
198
Matteo Scandolo10f965c2019-09-24 10:40:46 -0700199message Response {
200 int32 status_code = 1;
201 string message = 2;
202}
203
Arjun E K57a7fcb2020-01-30 06:44:45 +0000204enum SubActionTypes {
205 JOIN = 0;
206 LEAVE = 1;
Arjun E Kdd443f02020-02-07 15:24:01 +0000207 JOINV3 = 2;
Arjun E K57a7fcb2020-01-30 06:44:45 +0000208}
209
210message IgmpRequest {
Matteo Scandolo4a036262020-08-17 15:56:13 -0700211 ONURequest OnuReq = 1;
212 SubActionTypes SubActionVal = 2;
Onur Kalinagac9f9faca2021-01-21 14:04:34 +0000213 string GroupAddress = 3;
Arjun E K57a7fcb2020-01-30 06:44:45 +0000214}
215
Pragya Arya8bdb4532020-03-02 17:08:09 +0530216message Flows {
217 uint32 flow_count = 1;
218 repeated openolt.Flow flows = 2;
219}
220
Matteo Scandolo88c204a2020-11-03 10:34:24 -0800221message Timeout {
222 uint32 delay = 1;
223}
224
Matteo Scandolo4a036262020-08-17 15:56:13 -0700225message Empty {
226}
Matteo Scandolo84f7d482019-08-08 19:00:47 -0700227
228service BBSim {
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530229 // Get BBSim version
Matteo Scandolo4a036262020-08-17 15:56:13 -0700230 rpc Version (Empty) returns (VersionNumber) {
231 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530232 // Set BBSim log level
Matteo Scandolo4a036262020-08-17 15:56:13 -0700233 rpc SetLogLevel (LogLevel) returns (LogLevel) {
234 }
Pragya Aryabd731ec2020-02-11 16:38:17 +0530235
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530236 // Get current status of OLT
Matteo Scandolo4a036262020-08-17 15:56:13 -0700237 rpc GetOlt (Empty) returns (Olt) {
238 }
Matteo Scandolo4b077aa2021-02-16 17:33:37 -0800239
240 rpc GetOltAllocatedResources (OltAllocatedResourceType) returns (OltAllocatedResources) {
241 }
242
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530243 // Poweron OLT
Matteo Scandolo4a036262020-08-17 15:56:13 -0700244 rpc PoweronOlt (Empty) returns (Response) {
245 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530246 // Shutdown OLT
Matteo Scandolo4a036262020-08-17 15:56:13 -0700247 rpc ShutdownOlt (Empty) returns (Response) {
248 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530249 // Reboot OLT
Matteo Scandolo4a036262020-08-17 15:56:13 -0700250 rpc RebootOlt (Empty) returns (Response) {
251 }
Matteo Scandolo88c204a2020-11-03 10:34:24 -0800252 // Closes the Openolt gRPC server
253 rpc StopgRPCServer (Empty) returns (Response) {
254 }
255 // Start the Openolt gRPC server
256 rpc StartgRPCServer (Empty) returns (Response) {
257 }
258 // Restart the Openolt gRPC server after the given timeout
259 rpc RestartgRPCServer (Timeout) returns (Response) {
260 }
Pragya Aryabd731ec2020-02-11 16:38:17 +0530261
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530262 // Get status of an ONU by serial number
Matteo Scandolo4a036262020-08-17 15:56:13 -0700263 rpc GetONU (ONURequest) returns (ONU) {
264 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530265 // Get status of all ONUs
Matteo Scandolo4a036262020-08-17 15:56:13 -0700266 rpc GetONUs (Empty) returns (ONUs) {
267 }
268
269 // Get all the Services
270 rpc GetServices (Empty) returns (Services) {
271 }
272
273 // Get all the Services of an ONU by serial number
274 rpc GetOnuServices (ONURequest) returns (Services) {
275 }
Pragya Aryabd731ec2020-02-11 16:38:17 +0530276
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530277 // Shutdown an ONU by serial number
Matteo Scandolo4a036262020-08-17 15:56:13 -0700278 rpc ShutdownONU (ONURequest) returns (Response) {
279 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530280 // Shutdown all ONUs in OLT
Matteo Scandolo4a036262020-08-17 15:56:13 -0700281 rpc ShutdownAllONUs (Empty) returns (Response) {
282 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530283 // Shutdown all ONUs under a PON by pon-port-ID
Matteo Scandolo4a036262020-08-17 15:56:13 -0700284 rpc ShutdownONUsOnPON (PONRequest) returns (Response) {
285 }
Pragya Aryabd731ec2020-02-11 16:38:17 +0530286
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530287 // Poweron an ONU by serial number
Matteo Scandolo4a036262020-08-17 15:56:13 -0700288 rpc PoweronONU (ONURequest) returns (Response) {
289 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530290 // Poweron all ONUs in OLT
Matteo Scandolo4a036262020-08-17 15:56:13 -0700291 rpc PoweronAllONUs (Empty) returns (Response) {
292 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530293 // Poweron all ONUs under a PON by pon-port-ID
Matteo Scandolo4a036262020-08-17 15:56:13 -0700294 rpc PoweronONUsOnPON (PONRequest) returns (Response) {
295 }
Pragya Aryabd731ec2020-02-11 16:38:17 +0530296
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530297 // Restart EAPOL for ONU
Matteo Scandolo4a036262020-08-17 15:56:13 -0700298 rpc RestartEapol (ONURequest) returns (Response) {
299 }
Onur Kalinagac9f9faca2021-01-21 14:04:34 +0000300 // Restart DHCP for ONU
Matteo Scandolo4a036262020-08-17 15:56:13 -0700301 rpc RestartDhcp (ONURequest) returns (Response) {
302 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530303 // Send ONU alarm indication
Matteo Scandolo4a036262020-08-17 15:56:13 -0700304 rpc SetOnuAlarmIndication (ONUAlarmRequest) returns (Response) {
305 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530306 // Send OLT alarm indication for Interface type NNI or PON
Matteo Scandolo4a036262020-08-17 15:56:13 -0700307 rpc SetOltAlarmIndication (OLTAlarmRequest) returns (Response) {
308 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530309 // Get all flows or ONU specific flows
Matteo Scandolo4a036262020-08-17 15:56:13 -0700310 rpc GetFlows (ONURequest) returns (Flows) {
311 }
Onur Kalinagac9f9faca2021-01-21 14:04:34 +0000312 // Change IGMP state
Matteo Scandolo4a036262020-08-17 15:56:13 -0700313 rpc ChangeIgmpState (IgmpRequest) returns (Response) {
314 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530315 // Get Traffic scheduler information for ONU
Matteo Scandolo4a036262020-08-17 15:56:13 -0700316 rpc GetOnuTrafficSchedulers (ONURequest) returns (ONUTrafficSchedulers) {
317 }
Arjun E K57a7fcb2020-01-30 06:44:45 +0000318}