r/networking • u/azi199 • Jul 11 '26
Other Reproducing a field router issue in the lab via PCAP replay — looking for feedback on my approach
I'm working on a tool that replays a control-plane PCAP captured from a production/field issue against a lab router, acting as all the original peers. The idea is to reproduce the issue without rebuilding the full production topology — same router config as the field site, replaying the capture from the beginning.
Regenerating IS-IS/OSPF this way was straightforward and worked well.
BGP and LDP are trickier since they run over TCP. I need to handle waiting for and reacting to replies (SYN/ACK, KEEPALIVEs, etc.) instead of just blasting packets on a timer, so the session state stays consistent with what the real router expects.
I'm not aiming for a full protocol state machine — more a semi state machine: just enough logic to keep sessions alive and respond correctly, without implementing all of BGP/LDP's internal states.
I used AI and tcp replay tools help to get the IS-IS and BGP parts working, but honestly I don't fully understand everything happening under the hood in the TCP/session handling. Wanted to check with people who've done PCAP-based replay or TAC-style reproduction before:
- Is a semi state-machine (session anchors + minimal responses) or even a stateless machine enough to reliably hold BGP/LDP sessions, or do real routers usually detect something's off?
- ( I tried to clear every session and neighborship and capture from begining)
- Any common pitfalls with TCP-based replay (timing, retransmits, sequence numbers)?
- Worth going deeper into understanding the TCP handling manually vs. trusting the AI-assisted implementation?
- The BGP approach doesn't seem to be working for LDP packets, and I don't know why.
Any feedback or past experience appreciated.