How yaminmusleh/tcp-ip-stack works
This is a user-space network-stack demonstration that reads and writes Ethernet frames through a TAP device. Its principal workflow receives a frame, dispatches ARP or IPv4 handling, routes IPv4 payloads to ICMP, UDP, or TCP logic, and sends replies; outbound IP traffic may wait for ARP resolution. TCP connection handling is a distinct stateful stage. Relationships are limited to calls and protocol handling visible in the excerpts; the README is empty, and unsampled details are not inferred.
Main entry points: main.cpp Stack application · checksum.cpp Internet checksum · tap.cpp TAP device · tcp.cpp TCP segments
Components 12
Network I/O
- TAP device
src/net/tap.cpp
Link Layer
- Ethernet frames
src/net/ethernet.cpp - ARP packets
src/net/arp.cpp - ARP cache
src/net/arp_cache.cpp
IP Protocols
- IPv4 packets
src/net/ipv4.cpp - ICMPv4
src/net/icmpv4.cpp - Internet checksum
src/net/checksum.cpp
Transport
- UDP packets
src/net/udp.cpp - TCP segments
src/net/tcp.cpp - TCP connection engine
src/net/tcp_engine.cpp
Other components
- Network peer
- Stack application
src/main.cpp
Connections 16
- Network peer → TAP device: sends frames
- TAP device → Stack application: delivers frames
- Stack application → TAP device: writes frames
src/main.cpp - Stack application → Ethernet frames: parses frames
src/main.cpp - Stack application → ARP packets: handles ARP
src/main.cpp - Stack application → ARP cache: updates cache
src/main.cpp - Stack application → IPv4 packets: handles IPv4
src/main.cpp - Stack application → ICMPv4: handles echo
src/main.cpp - Stack application → UDP packets: handles UDP
src/main.cpp - Stack application → TCP segments: parses segments
src/main.cpp - Stack application → TCP connection engine: dispatches segments
src/main.cpp - TCP connection engine → TCP segments: processes segments
- IPv4 packets → Internet checksum: uses checksum
src/net/ipv4.cpp - ICMPv4 → Internet checksum: uses checksum
src/net/icmpv4.cpp - UDP packets → Internet checksum: uses checksum
src/net/udp.cpp - TCP segments → Internet checksum: uses checksum
src/net/tcp.cpp