feat(t2m): GS ダウンリンクで非 C2A-TSP パケットを破棄するオプション#492
Closed
harada hiroki (hender14) wants to merge 1 commit into
Closed
feat(t2m): GS ダウンリンクで非 C2A-TSP パケットを破棄するオプション#492harada hiroki (hender14) wants to merge 1 commit into
harada hiroki (hender14) wants to merge 1 commit into
Conversation
T2M_form_m_pdu が PacketList から取り出したパケットを M_PDU へ多重化する際、 TcpToMPdu.c2a_tsp_only が有効な場合に「C2A TSP 形式と Fill 以外」のパケット (例: PUS パケット) を破棄するようにした。判定はパケット先頭から書き始める前 (tcp_rp == 0) に行い、Fill パケット (APID_FILL_PKT) は 2nd ヘッダ版数が 未設定(0)でも除外して破棄しない (破棄すると M_PDU が埋まらず無限ループになるため)。 狙い: GS SW (tmtc-c2a) 側が未知 APID のパケットを受けると M_PDU 再構成バッファを reset し、同一バッファ内の後続パケットが巻き添えで欠落する。GS ダウンリンクには C2A TSP のみを載せることで、この巻き添え欠落を送信側で未然に防ぐ多層防御。 c2a_tsp_only は T2M_initialize で 0 (従来動作) に初期化。利用側が明示的に 1 を 設定した経路でのみ破棄が有効になる。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR adds an opt-in filter in the T2M (TCPacket → M_PDU) packing path to prevent non-C2A TSP telemetry (e.g., PUS packets) from being included in GS downlink M_PDUs, mitigating downstream GS software behavior that resets its reassembly buffer upon receiving unknown packets.
Changes:
- Added
c2a_tsp_onlyoption toTcpToMPdu, defaulting to disabled to preserve existing behavior. - Implemented a head-of-packet (when
tcp_rp == 0) drop rule that discards packets whose secondary header version is notTSP_2ND_HDR_VER_1, excluding Fill packets (APID_FILL_PKT) to avoid fill-related infinite loops.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
tlm_cmd/ccsds/aos_space_data_link_protocol/tcp_to_m_pdu.h |
Adds the c2a_tsp_only flag to the T2M state struct for opt-in filtering. |
tlm_cmd/ccsds/aos_space_data_link_protocol/tcp_to_m_pdu.c |
Initializes the new flag and applies the filter before packing a new packet into the M_PDU. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
Author
|
この処理は c2a-core 側のレイヤーで対応しない事にしたのでクローズする |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
変更内容
TcpToMPduにuint8_t c2a_tsp_onlyを追加 (T2M_initializeで0= 従来動作に初期化)T2M_form_m_pdu:c2a_tsp_onlyが有効なとき、PacketList 先頭パケットを M_PDU へ詰める前 (tcp_rp == 0) に判定し、Fill 以外で 2nd ヘッダ版数がTSP_2ND_HDR_VER_1でないもの (PUS パケット等) を破棄するAPID_FILL_PKTで除外し破棄しない (破棄すると M_PDU が埋まらず無限ループになるため)既定 (
c2a_tsp_only == 0) では完全に従来どおりの動作で、利用側が明示的に1を設定した経路でのみフィルタが有効になります。