Skip to content

daneshih1125/openwrt-me-proxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

me_proxy: Dynamic OMCI Managed Entity Proxy for OpenWrt

Abstract

Testing interoperability between ONUs and various GPON/XGSPON OLTs often requires handling vendor-specific Managed Entities (ME). Traditionally, supporting a new ME requires modifying the core OMCI application and performing a full Firmware (FW) upgrade—a process that is time-consuming and risky for field deployments.

me_proxy is an experimental project designed to solve this. Leveraging OpenWrt’s powerful opkg package management and high-performance Lua integration, me_proxy allows ODMs and Telecommunications providers to customize ME behavior on-the-fly. By simply installing a specific .ipk plugin, the system can support new MEs without a reboot or firmware flash.


System Architecture

The system is divided into three layers: the CLI Trigger, the Communication Bridge, and the Logic Engine.

me_proxy Architecture

  1. omci_pkt (CLI Tool): A lightweight test tool that sends OMCI commands (Get/Set) to a Named Pipe (FIFO).
  2. omci_app (Daemon): Reads from the FIFO and acts as a ubus client, forwarding requests to the core proxy.
  3. me_proxy (Core Engine):
    • C Core: Manages ubus registration and system signals.
    • Lua Binding: Provides an abstraction layer for ME logic.
    • Hot-Reload (SIGHUP): Supports reloading Lua plugins without restarting the process.
  4. Plugins (Lua): User-defined logic stored in /etc/omci/plugins/, distributed via independent ipk packages (e.g., Mesh Control, Robot Manager).

Request Control Flow

The following diagram illustrates the lifecycle of an omci_pkt set command as it traverses from the CLI to the Lua callback.

me_proxy Control Flow

Workflow Steps:

  1. Trigger: User executes omci_pkt set 33100....
  2. IPC: The command is written to /tmp/omci_fifo.
  3. Dispatch: omci_app invokes the omci.me_proxy set method via ubus.
  4. Parsing: me_proxy parses the attribute mask and looks up the corresponding handler.
  5. Execution: The C core calls the specific Lua function defined in the plugin (e.g., robot_manager.lua).
  6. Response: The result is bubbled back up to the CLI tool.

Key Features

  • Decoupled Logic: Keep the stable C core intact while iterating on business logic in Lua.
  • Dynamic Deployment: Use opkg install to add support for new MEs (e.g., Mesh, VoIP, or proprietary OAM).
  • Zero Downtime: Supports SIGHUP signal to refresh the Lua environment without dropping ubus connections.
  • Lightweight: Minimal memory footprint, ideal for embedded resource-constrained ONUs.

Installation & Usage

1. Start the Proxy

/etc/init.d/me_proxy start

2. Test an Unsupported ME

./omci_pkt get 33000 0 c000
# Result: 4 (Not Supported)

3. Install Plugin and Hot-Reload

opkg install me-33000-mesh
# The postinst script automatically sends SIGHUP to me_proxy

4. Verify Support

./omci_pkt get 33000 0 c000
# Result: 0 (Success)

Future Experiments

  • Extended Schema Validation: Using Lua tables to define ME constraints (Range, Type).
  • MIB Persistence: Allowing Lua plugins to store state across reboots via UCI.

About

A lightweight OpenWrt daemon for OMCI Managed Entities, leveraging Lua C-binding to enable dynamic ME logic injection

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors