Utilities
This directory contains some stand-alone utility programs to help in the
development of the ONU Mock application
onumock-olt-test
This is a simple test to exercise various tasks that an OLT OMCI Stack will often
request of ONUs on the PON.
Currently the OLT test application performs the following steps:
Main application startup and processing loop
-
There are 3 projects in the ignored 'dep' list. Find as way not to ignore them
and look into what the best logger may be if log4go is not the best supported one.
-
Creates OltOmciEndpoint (gRPC) channel to send/receive requests to an
actively running ONU Mock application.
-
Generates a set of PON IDs and constructs an array of Pon structures to
contain PON and ONU information.
-
Creates an onuOMCIChannel to receive requests upon
-
Schedules a DiscoverONU Process to start running in the background. It will
start after 1 second.
-
At this point, the main processing loop is entered.
Main Processing loop
This is a 'for-ever' loop that starts with a select statement waiting on one
of the following 3 events:
-
Done channel message: This signals to the main loop to exit and proceed to
the termination steps
-
ONU OMCI channel message: This is called from an ONU (part of the Pon
structure created at startup and initialized with discovered ONUs) to send an
OMCI Request to the ONU Mock.
-
OMCI Response channel message: This is the response from the ONU Mock for a
previously issued request. AVC and Alarm notifications also arrive on this channel.
-
PLOAM Response channel message: This is reception of a PLOAM OMCI message from
the PON. For example, this will receive DISCOVER responses and will then formulate
a PLOAM Activate request in order to activate an ONU.
Currently only Discover responses are handled and these contain the serial number
of the ONU. A PLOAM Activate is sent with the ONU ID (and other useful info) to the
MOCK and an ONU structure is initialized and stored in the Pon structure.
After the ONU structure is saved, an ONU thread is scheduled to start in 2 seconds
to begin the MIB Upload sequence. The first step in OMCI initialization...
Main Processing shutdown
When the Done channel is written too, the main loop exits and
Discover ONU Task
This task is started one second after initial startup. This task runs with a
currently fixed discovery interval/delay of 20 seconds. It does the
following sequence of steps until the main application writes to it's done
channel.
- Schedule a timer to fire in the delay seconds (currently 20s)
- On timer expiration, create a PloamRequest with an Operation of DISCOVERY.
- go to step 1
The DISCOVERY responses will be receive in the main application loop and acted
upon there.
ONU Thread
The ONU thread contains a state machine that runs through a series of states to
test the functionality of the ONU Mock. It does not run forever but instead just
runs several OMCI tasks to exercise the OMCI gopacket library as well as the ONU
MOCK application.
The thread is a forever loop that processes incoming OMCI responses and looks
for the Done channel to be written to signal thread shutdown.
The current states are listed below:
Initial
Just the initial state. The PLOAM actiation loop will kick us to the next state
whcih is MibUpload
MibUpload
Sends a MIB Reset and the performs a full MIB upload sequence request. Goes to
the capabilities state next
Capabilities
Gets the ME and Message types supported by the ONU via the OMCI ME. Goes to time
sync next.
TimeSync
Sends a time-sync request to the ONU Mock. It sets the time to 1 minute ahead of what
the current wall clock is just so we can test running the MOCK with a skewed since of
time. On a response, it transitions to service provisioning.
Service Provisioning
TODO: Not yet coded. Should do initial MIB download and the try out several
different flow and TCONT/GEM Port configurations.
Idle
TODO: Not yet coded. Good state for waiting on NBI events
Shutdown
Does cleanup. which is simple
Tasks remaining before initial ONU Mock v1.0.0 release
These tasks need to be performed before we can really call it ready for an initial
release. These are not necessary in priority order, just the order I initially wrote
them up when this document was first created.
-
Run application to find out MEs & Attributes not supported but available on Alpha, T&W, and Adtran
ONUs.
-
During application startup, query the ONU Mock for number of PONs that are
supported by its configuration. Currently it only creates a single PON with
a PON ID of 0.
-
Investigate the DISCOVERY process and see if it properly separate discovery from
activation.
-
See if the PLOAM response channel message handler needs to be moved to a separate
method and have it handle more than just Discovery responses.
-
Add ONU States/Tasks for the following:
- Alarm Sync
- PM Interval Collection
- Get Current PM Interval Request
- LOS / ONU goes away...
- ONU Reboot request
- ONU Admin Lock (ONU-G and UNI)
-
Add Alarm Notification handling and generate some in the MOCK based on
config settings or NBI requests. Perhaps UNI oper-status to start with
-
Add AVC Notification handling. And generate some based on events in the MOC
-
Implement the service provisioning steps for initial startup.
Tasks for future OLT Mocks
These tasks often will require additional work in the ONU Mock and the OMCI
go-packet library. Some features may be moved into the v1.0.0 release if it
will provide a useful feature.
-
Support a configurable (command line) setting of the ONU discovery interval
-
Add ONU States Tasks for the following:
- Test Request/response (perhaps a self-test???)
- Software download and image activation
- Power failure / battery backup support
- Multicast services support
-
In the capabilities state, also test out ONU support for getting ME and
attribute details. Some ONUs may not support this.