How mosn/mosn works
And delineate the main logical components
• Client/Edge – The entry point for external requests.
• Inbound Listener & Connection Handler – Accepts and demultiplexes incoming traffic.
• Filter Chain/Routing Engine – Processes inbound requests through a flexible series of filters including header manipulation, fault injection, mirroring, retry and redirect components.
• Protocol Modules – Multiple protocol support (HTTP/1.1, HTTP/2, gRPC, XProtocol, etc.) implemented across various “pkg/protocol” directories.
• Load Balancing / Upstream Cluster Manager – Manages connection pools, health checks, circuit breakers, and multiple load balancing policies (round-robin, weighted RR, EDF, etc.).
• TLS and Security Module – Handles certificate management, TLS inspection, and SDS integration (using pkg/mtls and related crypto packages).
• Administration & Configuration Management – Administration API, dynamic config reloading, logging, and metrics (as seen with pkg/admin, pkg/configmanager, and pkg/metrics).
• Extension Framework – Plugin systems with support for go-plugins, WASM-based extensions, and process-based modules.
• Observability and Tracing – Integration of tracing (Jaeger, Skywalking), access/logging, and metrics reporting (via Prometheus sinks and pkg/log, pkg/trace).
Relationships and interactions
• How the routing engine uses configuration and dynamic policies (supplied by the Configuration Manager) to select an upstream cluster.
• That the Upstream Cluster Manager (load balancing and health checking) passes traffic to the backend services.
• Auxiliary control paths for administrative APIs, real-time metrics collection, and TLS/SDS updates.
• Extension hooks where custom filters or protocol transformations can plug into the filter chain or protocol processing modules.
Important architectural patterns
• Modularity: Each major function (routing, security, metrics, protocol handling) is decoupled into separate modules.
• Dynamic configuration: Emphasize how the configuration is continuously reloaded and how administrative APIs (or even integration with Istio’s dynamic resources) drive behavior.
• Pluggability: Clearly show extension points that support go-plugin, WASM, and custom compiled modules.
• High-performance networking: Underline the event-driven, asynchronous design with efficient connection pooling (as evident in pkg/network and pkg/stream).
Relevant technologies and libraries
• Go as the core programming language.
• Integration with Istio, Envoy libraries and CNCF ecosystem components (like Prometheus, Jaeger, Skywalking).
• Use of Docker (via .devcontainer and build/) for containerized deployment.
• CGo-based cipher suites for SM3/SM4 support.
• WASM runtime integration.