How sachinites/tcpip_stack works
tcpip_stack is an educational, in-process network-topology emulator for routers and switches. The principal workflow is to configure a topology through its CLI, start its packet-receive machinery, and exercise packet forwarding across Ethernet/ARP, switching/VLAN, and IP-routing stages; ping provides an end-to-end demonstration. The graph preserves the README’s project capabilities, while showing only relationships supported by excerpts, indexed references, or README statements. Unsampled modules are represented only where the tree and documentation support their role.
Main entry points: layer3.c IP routing · nwcli.c Network CLI · graph.c Network graph · comm.c Packet transport
Components 18
CLI and Configuration
- CLI command tree
CommandParser/cmd_hier.c - Command parser
CommandParser/parser.c - Command TLV
CommandParser/cmdtlv.h - Network CLI
nwcli.c
Topology and Transport
- Topology setup
topologies.c - Network graph
graph.c - Node properties
net.c - Packet transport
comm.c
Packet Forwarding
- Ethernet and ARP
Layer2/layer2.c - MAC and VLAN switching
Layer2/l2switch.c - IP routing
Layer3/layer3.c - Layer 4
Layer4/layer4.c - Layer 5 app
Layer5/layer5.c - Ping application
Layer5/ping.c
Runtime Support
- Wheel timer
WheelTimer/WheelTimer.c - Glue-thread lists
gluethread/glthread.c - Packet generator
pkt_gen.c
Other components
- Network operator
Connections 20
- Network operator → Network CLI: issues commands
- Network CLI → CLI command tree: uses CLI
nwcli.c - Network CLI → Command TLV: encodes commands
nwcli.c - Network CLI → Network graph: configures topology
nwcli.c - CLI command tree → Command parser: parses commands
- Command parser → Command TLV: collects values
CommandParser/parser.c - Topology setup → Network graph: builds topology
topologies.c - Topology setup → Packet transport: starts receiver
topologies.c - Network graph → Node properties: stores properties
- Packet transport → Network graph: uses node links
comm.c - Ethernet and ARP → Packet transport: sends frames
Layer2/layer2.c - MAC and VLAN switching → Packet transport: forwards frames
Layer2/l2switch.c - IP routing → Ethernet and ARP: demotes packets
Layer3/layer3.c - IP routing → Layer 4: promotes packets
Layer3/layer3.c - IP routing → Layer 5 app: promotes packets
Layer3/layer3.c - Ping application → IP routing: uses IP routing
Layer5/ping.c - Ethernet and ARP → Glue-thread lists: uses lists
Layer2/layer2.c - IP routing → Glue-thread lists: uses lists
- Wheel timer → Glue-thread lists: uses lists
- Packet generator → IP routing: creates packets