SEBA-663 VOLTHA 1.7 support in BBSim
Error handling in FlowRemove()
Error handling in getGemPortId
Update README for supporting VOLTHA 1.7
Change-Id: Ib9e76282f8bdf2b7b66bbf745521bca31cd4a219
diff --git a/README.md b/README.md
index 194360c..004f413 100644
--- a/README.md
+++ b/README.md
@@ -3,21 +3,35 @@
The BBSim (Broadband Simulator) is for emulating the control message response (e.g. OLTInd, DHCP, EAPOL, OpenOMCI messages etc..) sent from OLT and ONUs which are connected to VOLTHA Adapter (OpenOLT Adapter).
It is implemetend as a software process which runs outside VOLTHA, and acts as if it was a OLT connected to multiple ONUs.
This enables the scalability test of VOLTHA / ONOS without actual hardware OLT / ONUs.
-The BBSim container contains wpa_supplicants and dhcp clients inside, so that you can try to test AAA/DHCPL2Relay Apps on ONOS using BBSim.
+You can use BBSim container for a scalability test for VOLTHA, DHCP L2 relay (https://github.com/opencord/dhcpl2relay) and AAA (AAA (ONOS 1.10)#ActivateAAAapp) applications on ONOS.
The difference from the existing PONsim is to focus on emulating control messages, not data-path traffic which PONsim targets.
```
-==============
-VOLTHA
-OpenOLT Adapter
-==============
- |
- | gRPC connections
- |
-==============
-BBSim containers
-(Each BBSim container corresponds to a single olt)
-==============
+ +--------------------------------------------------+
+ | VOLTHA Core |
+ +--------------------------------------------------+
+ +--------------------------------------------------+
+ | OpenOLT Adapter |
+ +------------------------^-------------------------+
+ +------------------------|-------------------------+
+ |Container---------------|-----------------------+ |
+ | |BBSim | | |
+ | | +------------v---------------------+ | |
+ | | | gRPC Server | | |
+ | | +------------^---------------------+ | |
+ |+------+| +------------|---------------------+ | |
+ || || |CoreServer | | | |
+ ||DHCP || | +----------v-------------------+ | | |
+ ||Server <--->| MainPktLoop | | | |
+ || || | +---^--------^-------------^---+ | | |
+ |+------+| +-----|--------|-------------|-----+ | |
+ | | +-----v---++---v-----++------v-----+ | |
+ | | |OMCI ||EAPOL || DHCP | | |
+ | | |Responder||Responder|| Responder | | |
+ | | +---------++---------++------------+ | |
+ | +---------------------------------------+ |
+ +--------------------------------------------------+
+
```
# 2. Build, Run BBSim and VOLTHA-CLI commands
@@ -44,9 +58,9 @@
## You can see the list of devices (OLT/ONUs) ##
```
-# 3. Configuration of ONOS App side
+# 3. Configuration of ONOS App side (VOLTHA 1.7, ONOS1.13.9.rc4)
You need to configure a few parameters for AAA/DHCPL2Relay app before running BBSim.
-You only need to set 1. device id assigned to BBSim (i.e. of:*********), 2. IP Address of BBSim container and 3. c/sTag with BBSim ONU instance device id, in .netconf file.
+You only need to set 1. device id assigned to BBSim (i.e. of:*********), 2. c/sTag and Tech Profile with BBSim ONU instance device id, in .netconf file.
(Please refer to https://wiki.onosproject.org/display/ONOS/NETCONF about netconf support in ONOS)
```
"org.opencord.dhcpl2relay" : {
@@ -62,14 +76,14 @@
"sadis" : {
"entries":[
{
- "id" : "<IP Address of BBSim Container>:50060",
+ "id" : "BBSIMOLT000",
"hardwareIdentifier" : "de:ad:be:ef:ba:11",
"uplinkPort" : 65536
},
//BBSim generates both device id and c/stag assigned to each ONU while incrementing them by 1 from BBSM00000100, 900.
//The following lines are an example when we use for configuring 2 ONUs.
- {"id" : "BBSM00000100", "cTag" : 900, "sTag" : 900, "nasPortId" : "BBSM00000100"},
- {"id" : "BBSM00000101", "cTag" : 901, "sTag" : 901, "nasPortId" : "BBSM00000101"},
+ {"id" : "BBSM00000100", "cTag" : 900, "sTag" : 900, "nasPortId" : "BBSM00000100", "technologyProfileId" : 64, "upstreamBandwidthProfile":"High-Speed-Internet", "downstreamBandwidthProfile":"User1-Specific"},
+ {"id" : "BBSM00000101", "cTag" : 901, "sTag" : 901, "nasPortId" : "BBSM00000101", "technologyProfileId" : 64, "upstreamBandwidthProfile":"High-Speed-Internet", "downstreamBandwidthProfile":"User1-Specific"},
......
```
@@ -79,25 +93,25 @@
```
Usage of ./bbsim:
-H string
- IP address:port (default ":50060")
+ IP address:port (default ":50060")
-aw int
- Wait time (sec) for activation WPA supplicants (default 10)
+ Wait time (sec) for activation WPA supplicants (default 10)
-d string
- Debug Level(TRACE DEBUG INFO WARN ERROR) (default "DEBUG")
+ Debug Level(TRACE DEBUG INFO WARN ERROR) (default "DEBUG")
-dw int
- Wait time (sec) for activation DHCP clients (default 20)
+ Wait time (sec) for activation DHCP clients (default 20)
-i int
- Number of PON-IF ports (default 1)
+ Number of PON-IF ports (default 1)
-id int
- OLT-ID
+ OLT-ID
-k string
- Kafka broker
+ Kafka broker
-m string
- Emulation mode (default, aaa, both (aaa & dhcp)) (default "default")
+ Emulation mode (default, aaa, both (aaa & dhcp)) (default "default")
-n int
- Number of ONUs per PON-IF port (default 1)
+ Number of ONUs per PON-IF port (default 1)
-s string
- DHCP Server IP Address (default "182.21.0.128")
+ DHCP Server IP Address (default "182.21.0.128")
-v int
- Interval each ONU Discovery Indication (ms) (default 1000)
+ Interval each ONU Discovery Indication (ms) (default 1000)
```
diff --git a/core/core_server.go b/core/core_server.go
index 2033ec1..17404e3 100644
--- a/core/core_server.go
+++ b/core/core_server.go
@@ -19,10 +19,11 @@
import (
"context"
"errors"
- "reflect"
"strconv"
"sync"
+ "reflect"
+ omci "github.com/opencord/omci-sim"
"gerrit.opencord.org/voltha-bbsim/common/logger"
"gerrit.opencord.org/voltha-bbsim/common/utils"
"gerrit.opencord.org/voltha-bbsim/device"
@@ -30,7 +31,6 @@
"github.com/google/gopacket"
"github.com/google/gopacket/layers"
"github.com/google/gopacket/pcap"
- omci "github.com/opencord/omci-sim"
log "github.com/sirupsen/logrus"
"golang.org/x/sync/errgroup"
"google.golang.org/grpc"
diff --git a/core/grpc_service.go b/core/grpc_service.go
index 69dadaa..c030c18 100644
--- a/core/grpc_service.go
+++ b/core/grpc_service.go
@@ -213,13 +213,14 @@
// FlowRemove should handle flow deletion from datapath
func (s *Server) FlowRemove(c context.Context, flow *openolt.Flow) (*openolt.Empty, error) {
- onu, _ := s.GetOnuByID(uint32(flow.OnuId), uint32(flow.AccessIntfId))
-
- utils.LoggerWithOnu(onu).WithFields(log.Fields{
- "olt": s.Olt.ID,
- "c_tag": flow.Action.IVid,
- }).Debug("OLT receives FlowRemove().")
-
+ logger.Debug("OLT %d receives FlowRemove()", s.Olt.ID)
+ onu, err := s.GetOnuByID(uint32(flow.OnuId), uint32(flow.AccessIntfId))
+ if err == nil{
+ utils.LoggerWithOnu(onu).WithFields(log.Fields{
+ "olt": s.Olt.ID,
+ "c_tag": flow.Action.IVid,
+ }).Debug("OLT receives FlowRemove().")
+ }
return new(openolt.Empty), nil
}