
Discover the end product of this course: automatically built routing tables on topology load, a tcp/ip stack library with timer management, logging, and application development.
Explore building a tcp/ip stack in C within networking projects and join the telegram group for course updates and collaboration.
Explore interface management in networking by building a mini project that gathers interface statistics, counts packets transmitted and received, and enables status changes with notifications to applications.
Explore enabling and disabling interfaces on a networking device, including ingress and egress traffic, and how a disabled interface drops inbound and outbound traffic.
Implement per-interface send and receive statistics in a tcp/ip stack by incrementing counters on successful sends and receipts, with downstate interfaces excluded, and expose data via a show command.
Create a UDP packet generator that injects a configurable stream of UDP and ICMP packets into the pseudo tcp/ip stack, simulating source‑to‑destination traffic.
Revisit how the DCP IP stack in user space interacts with the kernel-space stack using UDP over localhost, with interface auxiliary data to simulate delivery between nodes.
Learn to implement a packet generator in the tcp/ip stack by creating a UDP socket, building pseudo headers, prepending the ingress interface name, and sending crafted UDP packets to a destination.
demonstrate the pacard packet generator with the tcp/ip stack in c by configuring topology and routing, running the generator at 10 packets per second, and verifying interface statistics.
Develop a dynamic routing solution that automatically constructs and installs layer 3 routes across all devices to prevent loops and inconsistencies, leveraging scmp (equal-cost multi-path) and reacting to link changes.
Review appendix section 8.1 and 8.2 to grasp the theory behind layer three routing table construction, including the DaCosta algorithm, before implementing the routing table in the next lecture.
This demonstration shows an automated DCP IP stack algorithm that computes and installs layer-3 routes across the topology, achieving loop-free, equal-cost multipath routing that adapts to link changes.
Implement the SPF routing algorithm through a new CLI, create a dedicated directory and files, update the Makefile, and wire handlers to compute and display SPF results.
Prepare before implementing the SPF algorithm by defining new data structures and helper APIs, and master priority queue operations like insertion and deletion by priority.
Define a next-hop data structure with ip address and outgoing interface, plus a reference count to support multiple next hops in an spf routing algorithm; maintain equal-cost paths.
Develop ten helper APIs to support the spf algorithm implementation, test them with a driver, and validate against a reference solution within the tcp/ip stack project in c.
Implement the l3 bidirectional link api for tcp/ip stack in c, ensuring interfaces are up and ip addresses are in same subnet, and flush next hops by managing reference counts.
Implement and manage SPF next-hop APIs by freeing objects, creating new hops from the outgoing interface, inserting and copying next hops, and comparing SPF metrics for priority queues.
Implement a priority queue for the SPF algorithm by inserting SPF data objects in increasing SPF metric order, and perform initialization, insertion, deletion, and dequeue via APIs.
Initialize the SPF algorithm by setting the root's matrix to zero, all other nodes to infinity, and prepare the topology, clearing old results and the priority queue for execution.
Calculate next hops using SPF rooted on the direct neighborhood, selecting least-cost links, handling equal-cost multipath, and initializing direct neighbor next hops for rapid routing.
Implement the initialization of direct neighbors by iterating all root links, evaluating eligibility, and updating each neighbor’s next hop and metric, including scmp handling and flushing old entries.
Complete the initialization by creating a priority queue, initializing its head with energy and thread function, and inserting the SPF root node into the queue.
Implement the execution phase of the SPF algorithm by popping nodes from the priority queue, handling root and non-root cases, and enqueuing eligible neighbors with debugging logs.
Record the result for the node removed from the priority queue that is not an isp of the route node. Capture its shortest path cost and next hops.
Explore the spf algorithm implementation by coding the function spf explorer neighbors, handling three rules for updating next hops and priority queue during shortest path cost comparisons.
Implement the spf explore neighbors function: test the inequality, update the spf metric and next hops, and refresh the priority queue for each eligible neighbor, then flush residual next hops.
Iterate eligible neighbors of the current node and test the first inequality. Update metrics or unite next hops via the second inequality and refresh the neighbor in the priority queue.
Plan and execute tests of the SBF algorithm across varied topologies, triggering updates on all nodes and verifying outputs against the documented test cases.
Explore ECMP requirements and implement phase three of the SPF algorithm to compute a routing table with multiple next hops, enabling round-robin load balancing and redundancy through SCMP.
Learn how ecmp data forwarding uses a next-hop index to select the next hop, forward packets across multiple routes, and update the index in a round-robin fashion.
Demonstrate the spf algorithm on a square topology by populating routing tables across nodes, then updating routes when an interface goes down and verifying reachability via ping.
Explore the need for logging in the tcp/ip stack, and learn to use a custom logging infrastructure to capture and analyze application headers and packets for debugging network applications.
Demonstrates using the tcp ip stack library to capture and log packets for debugging, including icmp, arp, and ip headers.
APIs to parse and format standard headers
Learn to implement and test header formatting APIs for a TCP/IP stack in C, formatting IP headers into a buffer, handling IP and ICMP protocols, and optional application headers.
Implements a logging function that checks log file pointers and a socket descriptor, writes the output buffer to non-null sources, flushes, and omits console output when needed.
Integrate tcp/ip stack with logging by bridging send and receive paths to dcp dumps and logger, enabling packet formatting, log files, and output data sources through two API hooks.
Learn how to implement separate logging buffers for packets entering and leaving a device, preventing concurrency issues, with per-node transmit buffers and a single receive buffer for serialized packet logging.
Learn to implement a dual-level logging system by creating device and interface log files, embedding log structures in node and interface data, and initializing logs during topology setup.
Explore the notification chain pattern, where a publisher pushes events to multiple subscribers and supports registration and deregistration across threads, processes, or components.
Explore how a publisher–subscriber model implements a notification chain, where subscribers subscribe to routing table entries, register callbacks, and receive updates on data source changes.
Learn how a notification chain distributes interface-level configuration changes to all applications on a DCB IP stack. See how callbacks respond, updating routing when interfaces go down.
Represent a notification chain as a linked list of elements with a key, key size, wildcard flag, and a function pointer; define the notification chain and elements for tcp/ip stack.
Implement two core nfc routines for a generic notification chain: register notification chain for subscribers and invoke notification chain for publishers, using a double linked list, key matching, and callbacks.
Use notification chains to propagate interface config changes from admin to applications in the TCP/IP stack. Wrap the generic notification chain to support interface conflict change notifications.
Implement a three-step notification chain for interface configuration changes: register subscribers with the notification module, publish notifications via administrator command line interface commands, and process received updates by subscribers.
Create a new header for the subscriber registration application programming interface and implement it by building a notification chain element and registering the subscriber callback in a linked list.
Learn how to implement a notification API that informs subscribers of interface configuration changes by packaging old parameters, the interface pointer, and a change flag into a single notification container.
Demonstrates a publisher–subscriber notification flow: when an interface's up/down state changes, it tracks old properties, sets change flags, and publishes the update to subscribers via the notification API.
Integrate a posix-thread based timer library into the tcp/ip stack project to add dynamic timing features, covering library integration steps, timer APIs, and a small timer-based enhancement.
Learn to integrate a timer library into a tcp/ip stack project by downloading two files from GitHub, placing them in a Will Taimur directory, and updating the Makefile to compile.
Understand how three routers automatically build routing tables, forward traffic via the shortest paths, and handle equal-cost multi-path routing while preventing loops through shared metrics and routing cooperation.
Define the problem: given a network graph with p2p links and node lookback addresses, derive each node's routing table using shortest path concepts and next hop details.
Understand the routing table entry format, including destination IP, outgoing interface, gateway, optional cost and next-hop, and how least-cost paths and topology changes drive updates.
Learn how equal cost multiple path routing (ECMP) forwards traffic across two gateways through multiple next hops, as shown by a routing table entry with two interfaces Internet1 and Internet2.
Explore how routing tables determine the next hop to reach a destination like 192.168.0.2, using least-cost entries, local routes, and forward decisions through devices D, E, C, and B.
We explain the three basic steps routers follow to compute their local routing table. Build an input graph of the topology, apply the routing algorithm, and derive the routing table.
Welcome to the Part-B of the TCP/IP Stack Development Course Series. This is a sequel course to Part-A in which we implemented a pseudo TCP/IP Stack working in Virtualized topology.
In this Course, We shall be implementing more advanced and additional features to our Pseudo TCP/IP Stack and would try to impart a more realistic flavor to it.
We will resume from where we left in Part-A. If you have signed up for this course, I presume you have completed Part-A of the course and we are ready for another roller coaster ride into our project.
This course is Advanced as compared to Part-A. In this course we will learn some more aspects of TCP/IP stack and in general, how Networking software is developed. You will not only doing Networking Based Programming but also, you will continue doing a typical Linux based System Programming development as Networking is strongly tied to System Programming.
Student Level: Intermediate to Advanced to Working Professionals, Beginners in Coding pls excuse this course.
Table of Contents
1. What is this Course all about?
2. Project 1 : Interface Management and Statistics
Enable/Disable an Interface
Gathering Interface Rx/Tx Statistics
3. Project 2 : Implementing the Packet Generator
Create and Feed Pkt stream into Topology
4. Project 3 : Implementing Routing Table Construction Algorithm
Designing Data Structure
Shortest Path First Algorithm in Detail
Implementation Strategy
Testing SPF Algorithm Implementation
Route Calculation
5. Project 4 : Logging Infra
Track Ingress and Egress pkts per device per interface
Track L3 Path taken by a pkt from src to dst
6. Project 5 : Notification Chains
Introduction to NFC
Understand with the help of Example
Writing a Generic NOTIF Infra code
Writing TCP/IP Stack NFC
Implement Publisher Subscriber APIs
See NFC in Action
7. Project 6 : Working with Timers
Implementing Ageism
Implement Timer State Machine