Simulation Intermediate
Network simulation brings your digital twin to life, allowing you to verify protocol behavior, trace packet paths, test access control lists, and measure performance under various conditions.
Simulation Approaches
| Approach | Tools | Best For | Resource Cost |
|---|---|---|---|
| Config Analysis | Batfish | Routing verification, ACL testing, compliance | Low (CPU only) |
| Emulation | GNS3, EVE-NG, CML | Full protocol behavior, CLI testing | High (VMs per device) |
| Packet Simulation | ns-3, custom engines | Performance testing, capacity modeling | Medium |
| AI-Based Prediction | Custom ML models | Fast approximation, large-scale scenarios | Low (inference only) |
Batfish for Configuration Analysis
Python
from pybatfish.client.commands import * from pybatfish.question.bfq import * # Initialize Batfish with your network snapshot bf_init_snapshot('./network-configs', name='production') # Trace a path from source to destination result = bfq.traceroute( startLocation='@enter(core-rtr-01[GigabitEthernet0/0])', headers=HeaderConstraints(dstIps='10.0.50.100') ).answer() # Check for undefined references in configs issues = bfq.undefinedReferences().answer() # Verify ACL behavior acl_result = bfq.searchFilters( headers=HeaderConstraints(srcIps='10.0.0.0/8', dstPorts='22'), action='permit' ).answer()
Integrating Simulation into CI/CD
Run network simulations automatically when configuration changes are proposed, just like running unit tests for application code. This catches issues before they reach production.
Simulation in CI/CD: Use Batfish in your GitOps pipeline to automatically validate every proposed network config change. If the simulation detects reachability issues or policy violations, block the merge.
Next Step
Learn how to run what-if scenarios to test changes and failure modes safely.
Next: What-If Analysis →
Lilly Tech Systems