Matteo Scandolo | 84f7d48 | 2019-08-08 19:00:47 -0700 | [diff] [blame] | 1 | // 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 | |
| 15 | syntax = "proto3"; |
amit.ghosh | ee17c00 | 2021-06-10 12:14:38 +0200 | [diff] [blame^] | 16 | |
| 17 | option go_package = "github.com/opencord/bbsim/api/bbsim"; |
| 18 | |
Matteo Scandolo | 84f7d48 | 2019-08-08 19:00:47 -0700 | [diff] [blame] | 19 | package bbsim; |
| 20 | |
Pragya Arya | 8bdb453 | 2020-03-02 17:08:09 +0530 | [diff] [blame] | 21 | import "voltha_protos/openolt.proto"; |
Anand S Katti | 0954135 | 2020-01-29 15:54:01 +0530 | [diff] [blame] | 22 | import "voltha_protos/tech_profile.proto"; |
Matteo Scandolo | 10f965c | 2019-09-24 10:40:46 -0700 | [diff] [blame] | 23 | // Models |
| 24 | |
Matteo Scandolo | 84f7d48 | 2019-08-08 19:00:47 -0700 | [diff] [blame] | 25 | message PONPort { |
| 26 | int32 ID = 1; |
| 27 | string OperState = 2; |
Matteo Scandolo | 4b077aa | 2021-02-16 17:33:37 -0800 | [diff] [blame] | 28 | 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 | |
| 37 | message PonAllocatedResources { |
| 38 | string SerialNumber = 1; |
| 39 | int32 Id = 2; |
Matteo Scandolo | 84f7d48 | 2019-08-08 19:00:47 -0700 | [diff] [blame] | 40 | } |
| 41 | |
| 42 | message NNIPort { |
| 43 | int32 ID = 1; |
| 44 | string OperState = 2; |
| 45 | } |
| 46 | |
| 47 | message Olt { |
| 48 | int32 ID = 1; |
Matteo Scandolo | 8df63df | 2019-09-12 10:34:32 -0700 | [diff] [blame] | 49 | string SerialNumber = 2; |
| 50 | string OperState = 3; |
| 51 | string InternalState = 4; |
rajesh | f921f88 | 2020-03-06 18:24:28 +0530 | [diff] [blame] | 52 | string IP = 7; |
Matteo Scandolo | 8df63df | 2019-09-12 10:34:32 -0700 | [diff] [blame] | 53 | repeated NNIPort NNIPorts = 5; |
| 54 | repeated PONPort PONPorts = 6; |
Matteo Scandolo | 9a3518c | 2019-08-13 14:36:01 -0700 | [diff] [blame] | 55 | } |
| 56 | |
Matteo Scandolo | 4b077aa | 2021-02-16 17:33:37 -0800 | [diff] [blame] | 57 | message OltAllocatedResourceType { |
| 58 | enum Type { |
| 59 | UNKNOWN = 0; |
| 60 | ALLOC_ID = 1; |
| 61 | GEM_PORT = 2; |
| 62 | } |
| 63 | Type type = 1; |
| 64 | } |
| 65 | |
| 66 | message 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 | |
| 75 | message OltAllocatedResources { |
| 76 | repeated OltAllocatedResource resources = 1; |
| 77 | } |
| 78 | |
Matteo Scandolo | 9a3518c | 2019-08-13 14:36:01 -0700 | [diff] [blame] | 79 | message ONU { |
| 80 | int32 ID = 1; |
| 81 | string SerialNumber = 2; |
| 82 | string OperState = 3; |
| 83 | string InternalState = 4; |
| 84 | int32 PonPortID = 5; |
Matteo Scandolo | 4b3fc7e | 2019-09-17 16:49:54 -0700 | [diff] [blame] | 85 | string HwAddress = 8; |
Matteo Scandolo | 2742870 | 2019-10-11 16:21:16 -0700 | [diff] [blame] | 86 | int32 PortNo = 9; |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 87 | repeated Service services = 10; |
Matteo Scandolo | cedde46 | 2021-03-09 17:37:16 -0800 | [diff] [blame] | 88 | int32 ImageSoftwareExpectedSections = 11; |
| 89 | int32 ImageSoftwareReceivedSections = 12; |
| 90 | int32 ActiveImageEntityId = 13; |
| 91 | int32 CommittedImageEntityId = 14; |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 92 | } |
| 93 | |
| 94 | message 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 Scandolo | 75ed5b9 | 2020-09-03 09:03:16 -0700 | [diff] [blame] | 106 | string InternalState = 12; |
Matteo Scandolo | 618a658 | 2020-09-09 12:21:29 -0700 | [diff] [blame] | 107 | string IGMPState = 13; |
Matteo Scandolo | 9a3518c | 2019-08-13 14:36:01 -0700 | [diff] [blame] | 108 | } |
| 109 | |
Anand S Katti | 0954135 | 2020-01-29 15:54:01 +0530 | [diff] [blame] | 110 | message ONUTrafficSchedulers { |
| 111 | tech_profile.TrafficSchedulers traffSchedulers = 1; |
| 112 | } |
| 113 | |
Matteo Scandolo | 9a3518c | 2019-08-13 14:36:01 -0700 | [diff] [blame] | 114 | message ONUs { |
| 115 | repeated ONU items = 1; |
Matteo Scandolo | 84f7d48 | 2019-08-08 19:00:47 -0700 | [diff] [blame] | 116 | } |
| 117 | |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 118 | message Services { |
| 119 | repeated Service items = 1; |
| 120 | } |
| 121 | |
Matteo Scandolo | 10f965c | 2019-09-24 10:40:46 -0700 | [diff] [blame] | 122 | // Inputs |
| 123 | |
| 124 | message ONURequest { |
| 125 | string SerialNumber = 1; |
| 126 | } |
| 127 | |
Pragya Arya | bd731ec | 2020-02-11 16:38:17 +0530 | [diff] [blame] | 128 | message PONRequest { |
| 129 | uint32 PonPortId = 1; |
| 130 | } |
| 131 | |
Scott Baker | 41724b8 | 2020-01-21 19:54:53 -0800 | [diff] [blame] | 132 | // Alarms |
| 133 | |
| 134 | message 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 | |
| 163 | message AlarmParameter { |
| 164 | string Key = 1; |
| 165 | string Value = 2; |
| 166 | } |
| 167 | |
Anand S Katti | 86552f9 | 2020-03-03 21:56:32 +0530 | [diff] [blame] | 168 | // ONUAlarmRequest includes fields common to every Onu alarm, |
Anand S Katti | 0954135 | 2020-01-29 15:54:01 +0530 | [diff] [blame] | 169 | // plus an optional list of AlarmParameter list that can be used |
Scott Baker | 41724b8 | 2020-01-21 19:54:53 -0800 | [diff] [blame] | 170 | // to set additional fields in alarms that support them. |
Anand S Katti | 86552f9 | 2020-03-03 21:56:32 +0530 | [diff] [blame] | 171 | message ONUAlarmRequest { |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 172 | string AlarmType = 1; // name of alarm to raise |
| 173 | string SerialNumber = 2; // serial number of ONU |
| 174 | string Status = 3; // status of Alarm |
Scott Baker | 41724b8 | 2020-01-21 19:54:53 -0800 | [diff] [blame] | 175 | repeated AlarmParameter Parameters = 4; // optional list of additional parameters |
| 176 | } |
| 177 | |
Anand S Katti | 86552f9 | 2020-03-03 21:56:32 +0530 | [diff] [blame] | 178 | // OLT alarm request |
| 179 | message OLTAlarmRequest { |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 180 | uint32 InterfaceID = 1; // Switch Interface Id |
| 181 | string InterfaceType = 2; // PON or NNI Type |
| 182 | string Status = 3; // Interface Operstatus |
Anand S Katti | 86552f9 | 2020-03-03 21:56:32 +0530 | [diff] [blame] | 183 | } |
| 184 | |
Matteo Scandolo | 10f965c | 2019-09-24 10:40:46 -0700 | [diff] [blame] | 185 | // Utils |
| 186 | |
Matteo Scandolo | 84f7d48 | 2019-08-08 19:00:47 -0700 | [diff] [blame] | 187 | message VersionNumber { |
| 188 | string version = 1; |
| 189 | string buildTime = 2; |
| 190 | string commitHash = 3; |
| 191 | string gitStatus = 4; |
| 192 | } |
| 193 | |
Matteo Scandolo | 2bf742a | 2019-10-01 11:33:34 -0700 | [diff] [blame] | 194 | message LogLevel { |
| 195 | string level = 1; |
| 196 | bool caller = 2; |
| 197 | } |
| 198 | |
Matteo Scandolo | 10f965c | 2019-09-24 10:40:46 -0700 | [diff] [blame] | 199 | message Response { |
| 200 | int32 status_code = 1; |
| 201 | string message = 2; |
| 202 | } |
| 203 | |
Arjun E K | 57a7fcb | 2020-01-30 06:44:45 +0000 | [diff] [blame] | 204 | enum SubActionTypes { |
| 205 | JOIN = 0; |
| 206 | LEAVE = 1; |
Arjun E K | dd443f0 | 2020-02-07 15:24:01 +0000 | [diff] [blame] | 207 | JOINV3 = 2; |
Arjun E K | 57a7fcb | 2020-01-30 06:44:45 +0000 | [diff] [blame] | 208 | } |
| 209 | |
| 210 | message IgmpRequest { |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 211 | ONURequest OnuReq = 1; |
| 212 | SubActionTypes SubActionVal = 2; |
Onur Kalinagac | 9f9faca | 2021-01-21 14:04:34 +0000 | [diff] [blame] | 213 | string GroupAddress = 3; |
Arjun E K | 57a7fcb | 2020-01-30 06:44:45 +0000 | [diff] [blame] | 214 | } |
| 215 | |
Pragya Arya | 8bdb453 | 2020-03-02 17:08:09 +0530 | [diff] [blame] | 216 | message Flows { |
| 217 | uint32 flow_count = 1; |
| 218 | repeated openolt.Flow flows = 2; |
| 219 | } |
| 220 | |
Matteo Scandolo | 88c204a | 2020-11-03 10:34:24 -0800 | [diff] [blame] | 221 | message Timeout { |
| 222 | uint32 delay = 1; |
| 223 | } |
| 224 | |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 225 | message Empty { |
| 226 | } |
Matteo Scandolo | 84f7d48 | 2019-08-08 19:00:47 -0700 | [diff] [blame] | 227 | |
| 228 | service BBSim { |
Pragya Arya | 3f8fdc6 | 2020-03-16 11:12:27 +0530 | [diff] [blame] | 229 | // Get BBSim version |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 230 | rpc Version (Empty) returns (VersionNumber) { |
| 231 | } |
Pragya Arya | 3f8fdc6 | 2020-03-16 11:12:27 +0530 | [diff] [blame] | 232 | // Set BBSim log level |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 233 | rpc SetLogLevel (LogLevel) returns (LogLevel) { |
| 234 | } |
Pragya Arya | bd731ec | 2020-02-11 16:38:17 +0530 | [diff] [blame] | 235 | |
Pragya Arya | 3f8fdc6 | 2020-03-16 11:12:27 +0530 | [diff] [blame] | 236 | // Get current status of OLT |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 237 | rpc GetOlt (Empty) returns (Olt) { |
| 238 | } |
Matteo Scandolo | 4b077aa | 2021-02-16 17:33:37 -0800 | [diff] [blame] | 239 | |
| 240 | rpc GetOltAllocatedResources (OltAllocatedResourceType) returns (OltAllocatedResources) { |
| 241 | } |
| 242 | |
Pragya Arya | 3f8fdc6 | 2020-03-16 11:12:27 +0530 | [diff] [blame] | 243 | // Poweron OLT |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 244 | rpc PoweronOlt (Empty) returns (Response) { |
| 245 | } |
Pragya Arya | 3f8fdc6 | 2020-03-16 11:12:27 +0530 | [diff] [blame] | 246 | // Shutdown OLT |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 247 | rpc ShutdownOlt (Empty) returns (Response) { |
| 248 | } |
Pragya Arya | 3f8fdc6 | 2020-03-16 11:12:27 +0530 | [diff] [blame] | 249 | // Reboot OLT |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 250 | rpc RebootOlt (Empty) returns (Response) { |
| 251 | } |
Matteo Scandolo | 88c204a | 2020-11-03 10:34:24 -0800 | [diff] [blame] | 252 | // 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 Arya | bd731ec | 2020-02-11 16:38:17 +0530 | [diff] [blame] | 261 | |
Pragya Arya | 3f8fdc6 | 2020-03-16 11:12:27 +0530 | [diff] [blame] | 262 | // Get status of an ONU by serial number |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 263 | rpc GetONU (ONURequest) returns (ONU) { |
| 264 | } |
Pragya Arya | 3f8fdc6 | 2020-03-16 11:12:27 +0530 | [diff] [blame] | 265 | // Get status of all ONUs |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 266 | 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 Arya | bd731ec | 2020-02-11 16:38:17 +0530 | [diff] [blame] | 276 | |
Pragya Arya | 3f8fdc6 | 2020-03-16 11:12:27 +0530 | [diff] [blame] | 277 | // Shutdown an ONU by serial number |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 278 | rpc ShutdownONU (ONURequest) returns (Response) { |
| 279 | } |
Pragya Arya | 3f8fdc6 | 2020-03-16 11:12:27 +0530 | [diff] [blame] | 280 | // Shutdown all ONUs in OLT |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 281 | rpc ShutdownAllONUs (Empty) returns (Response) { |
| 282 | } |
Pragya Arya | 3f8fdc6 | 2020-03-16 11:12:27 +0530 | [diff] [blame] | 283 | // Shutdown all ONUs under a PON by pon-port-ID |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 284 | rpc ShutdownONUsOnPON (PONRequest) returns (Response) { |
| 285 | } |
Pragya Arya | bd731ec | 2020-02-11 16:38:17 +0530 | [diff] [blame] | 286 | |
Pragya Arya | 3f8fdc6 | 2020-03-16 11:12:27 +0530 | [diff] [blame] | 287 | // Poweron an ONU by serial number |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 288 | rpc PoweronONU (ONURequest) returns (Response) { |
| 289 | } |
Pragya Arya | 3f8fdc6 | 2020-03-16 11:12:27 +0530 | [diff] [blame] | 290 | // Poweron all ONUs in OLT |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 291 | rpc PoweronAllONUs (Empty) returns (Response) { |
| 292 | } |
Pragya Arya | 3f8fdc6 | 2020-03-16 11:12:27 +0530 | [diff] [blame] | 293 | // Poweron all ONUs under a PON by pon-port-ID |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 294 | rpc PoweronONUsOnPON (PONRequest) returns (Response) { |
| 295 | } |
Pragya Arya | bd731ec | 2020-02-11 16:38:17 +0530 | [diff] [blame] | 296 | |
Pragya Arya | 3f8fdc6 | 2020-03-16 11:12:27 +0530 | [diff] [blame] | 297 | // Restart EAPOL for ONU |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 298 | rpc RestartEapol (ONURequest) returns (Response) { |
| 299 | } |
Onur Kalinagac | 9f9faca | 2021-01-21 14:04:34 +0000 | [diff] [blame] | 300 | // Restart DHCP for ONU |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 301 | rpc RestartDhcp (ONURequest) returns (Response) { |
| 302 | } |
Pragya Arya | 3f8fdc6 | 2020-03-16 11:12:27 +0530 | [diff] [blame] | 303 | // Send ONU alarm indication |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 304 | rpc SetOnuAlarmIndication (ONUAlarmRequest) returns (Response) { |
| 305 | } |
Pragya Arya | 3f8fdc6 | 2020-03-16 11:12:27 +0530 | [diff] [blame] | 306 | // Send OLT alarm indication for Interface type NNI or PON |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 307 | rpc SetOltAlarmIndication (OLTAlarmRequest) returns (Response) { |
| 308 | } |
Pragya Arya | 3f8fdc6 | 2020-03-16 11:12:27 +0530 | [diff] [blame] | 309 | // Get all flows or ONU specific flows |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 310 | rpc GetFlows (ONURequest) returns (Flows) { |
| 311 | } |
Onur Kalinagac | 9f9faca | 2021-01-21 14:04:34 +0000 | [diff] [blame] | 312 | // Change IGMP state |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 313 | rpc ChangeIgmpState (IgmpRequest) returns (Response) { |
| 314 | } |
Pragya Arya | 3f8fdc6 | 2020-03-16 11:12:27 +0530 | [diff] [blame] | 315 | // Get Traffic scheduler information for ONU |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 316 | rpc GetOnuTrafficSchedulers (ONURequest) returns (ONUTrafficSchedulers) { |
| 317 | } |
Arjun E K | 57a7fcb | 2020-01-30 06:44:45 +0000 | [diff] [blame] | 318 | } |