Welcome to the EmION technical guide. This document provides a deep dive into programmatically orchestrating authentic BPv7 networks using the EmION framework.
EmION is built on three layers:
- C-Engine Layer: Authentic NASA-JPL ION-DTN 4.x binaries.
- Binding Layer:
pyionC-extensions for zero-copy memory access. - Orchestration Layer: EmION's Python API for high-level management.
The emion.core.network module is the primary entry point for research scripts.
from emion.core import network
# 1. Define and Register Nodes
nodes = [1, 2, 3]
for nid in nodes:
network.register_node(nid)
# 2. Boot ION Core
# This handles the complex ionadmin/bpadmin/ipnadmin bootstrapping
network.start_core(cleanup=True)Bundles are dispatched using real IPN endpoints (ipn:node.service).
# Send from Node 1 to Node 3
result = network.send_bundle(
src=1,
dst=3,
payload="MISSION_DATA_V7"
)
print(f"Bundle {result['bundle_id']} currently in transit.")EmION allows you to "hook" into the bundle flow via external APIs.
from fastapi import FastAPI, Request
app = FastAPI()
@app.get("/health")
def health():
return {"status": "ok", "name": "DeepShield-V7"}
@app.post("/analyze")
async def analyze(request: Request):
data = await request.json()
payload = data.get("payload")
metadata = data.get("metadata")
# Custom logic: Flag payloads over 100 bytes
is_anomaly = len(payload) > 100
return {
"is_anomaly": is_anomaly,
"score": 0.99 if is_anomaly else 0.01,
"details": {"size": len(payload)}
}network.attach_plugin("http://localhost:8421", target_nodes="all")For production research, always use the unified test suite to verify routing integrity.
python3 tests/test_emion.py- Cleanup: Always call
network.stop_core()or use thekillmcommand if a script crashes to release shared memory. - Stabilization: ION requires ~5 seconds to propagate Contact Graph updates after boot.
- BPv7: Ensure your
pyionis built with--enable-bpv7for full protocol authenticity.
EmION Team · Authentic Space Research Framework