Implementation and Usage¶
We highlight the salient aspects of STARRY NET’s implementation and usage in this section.
Framework implementation. STARRY NET’s observer is implemented as a combination of a crawler based on Scrapy [27], together with a MySQL-based data store. We implement STARRY NET’s synchronizor based on SkyField [29], an astronomy library that supports the calculation of high precision research-grade positions for satellites. STARRY NET’s orchestrator is implemented upon Docker [6] and it spans the emulated constellation across multiple machines. We use OpenvSwitch [19] to emulate and configure links, and use tc [67] to dynamically set artificial network conditions according to the numeric results calculated by STARRY NET’s synchronizer. Specifically, we optimized the link management module in tc to satisfy the requirement of light-weight state update. To accomplish flexibility, S TAR RY N ET ’s abstraction is implemented as a combination of a lib-STARRY NET library and a collection of shell commands. Collectively, the core components of STARRY NET are implemented in about 6500 lines of Python codes and scripts.
框架实现
观测器模块实现
- 数据采集层:基于Scrapy框架[27]构建分布式爬虫系统,支持多源异构数据(星座监管、轨道参数、地面站拓扑等)的自动化采集与清洗。
- 存储架构:采用MySQL数据库集群实现三层数据存储模型:
- 卫星元数据表(
satellite_metadata
)存储NORAD编号、TLE数据等 - 地面设施拓扑图(
ground_station_graph
)采用邻接表结构记录站点间连接关系 - 用户行为日志(
user_activity_log
)通过分区表优化时序数据查询效率
- 卫星元数据表(
同步器模块实现
- 天文计算引擎:集成SkyField库[29]实现高精度星历解算,关键算法包括:
- SGP4/SDP4轨道模型解析器(误差 <1km)
- 基于JPL DE421星历的星间可视性矩阵生成
- 动态参数生成:开发混合建模工具链,将Walker星座参数与实测数据融合,输出时变网络状态参数(传播时延、链路通断事件等)
协调器模块实现
- 容器化仿真:基于Docker[6]构建轻量化虚拟节点,单物理机支持200+容器实例
- 定制化基础镜像(
starrynet-base
)集成网络协议栈与资源监控代理
- 定制化基础镜像(
- 跨机拓扑管理:采用OpenvSwitch[19]实现VLAN级虚拟链路隔离,关键优化包括:
- 分布式链路状态数据库(LSDB)实现秒级拓扑同步
- 基于增量更新的BGP-LS协议优化跨机路由收敛
- 动态QoS控制:深度定制Linux tc工具[67],创新实现:
- 微秒级时延抖动注入(
netem
模块增强) - 带宽动态调整API支持滑动时间窗配置
- 微秒级时延抖动注入(
统一抽象层实现
- 开发者接口:
lib-starrynet
+ Shell CLI- 感觉完全类比mininet的形式即可 :))
Framework usage. We illustrate the usage of STARRY NET with a concrete example as plotted in Figure 4: a researcher wants to evaluate a novel geo-location-based routing mechanism based on [63], under the Starlink constellation. In particular, this experiment can be conducted with STARRY NET in three steps. First, leveraging STARRY NET’s APIs, the researcher writes a user-defined experimental program (Figure 4a) for test. In this example, we show a geo-routing policy similar to [63], which runs on each satellite, and forwards received packets to the adjacent satellite that is the geographically closest to the destination. Second, the researcher prepares a set of manifest files describing the constellation configurations, e.g., orbital information and ground station distribution (Figure 4b). Finally, the researcher runs a batch of shell commands exposed by STARRY NET to load manifest files (e.g., starlink.json and gs.json), create experimental environment (e.g., “sl_con”) on multiple machines, configure network parameters (e.g., uplink/downlink capacity), and run the user-specific program on emulated satellites (Figure 4c).
框架使用。我们通过一个具体的例子来说明如何使用STARRY NET,如图4所示:
一位研究人员希望基于文献[63]评估一种新型的基于地理位置的路由机制,该实验在Starlink星座下进行。具体而言,使用STARRY NET可以通过三个步骤来完成此实验。
首先,研究人员利用STARRY NET的API编写用户定义的实验程序(图4a)进行测试。在此示例中,我们展示了一个类似于文献[63]的地理路由策略,该策略在每颗卫星上运行,并将接收到的数据包转发给地理位置最接近目标的相邻卫星。
其次,研究人员准备一组描述星座配置的清单文件,如轨道信息和地面站分布(图4b)。
最后,研究人员运行一批由STARRY NET提供的Shell命令,加载清单文件(例如,starlink.json和gs.json),在多个机器上创建实验环境(如“sl_con”),配置网络参数(如上行/下行容量),并在模拟卫星上运行用户特定的程序(图4c)。