
The agenda extends the tcp/ip stack library with interface management and statistics, adds a topology-aware algorithm for auto-calculating altitudes, and implements dynamic aging entries with extensive logging.
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.
Switch to the part b branch of the tcp/ip stack library, clean and recompile, then run the dcp stack to view routing table, and switch back to the master branch.
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 an enable/disable interface feature in the C project, adding a command-line interface command, a status flag, and show output enhancements. Reject traffic on down interfaces and test with Pinkman.
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.
Design a udp packet generator to produce packet B for the dcp ip stack, requiring 2001 udp port, incoming interface, and destination ip, with loopback 127.0.0.1 and zero source port.
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 the SPF data structure and the SPF result to support the SPF algorithm’s execution and store results, using linked lists for nodes, costs, and the set of max tobs.
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.
Define the SPF data structures in the DCP project, alias the data structure, and add a member pointer to connect SPF data to the priority queue via a linked list.
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 SPF helper APIs, including SPF lookup by node and macros, by iterating the SPF result list, defining finite mattrick constants and offset macros for initialization and priority queue use.
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.
Develop an SPF algorithm implementation plan across initialization, execution, and calculation phases, outlining prerequisites to upgrade a data structure for scmp support, and modularize the approach for stepwise coding.
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 core SPF algorithm logic from scratch, incrementally handling steps four to six, then use the results to compute routes and install them in the routing table.
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 to implement equal-cost multipath routing by extending the routing data structure to store multiple next hops, update routing table operations, and flush next hops during changes.
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.
Finish implementing the SPF route installation by iterating SPF results to populate the routing table, using lookback addresses and next hop, flushing old routes, and returning the installed rounds.
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.
initialize the dcp ip stack at startup to auto-populate routing tables across the topology using a one-time startup function and an spf algorithm.
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.
Enable or disable logging at will, choose scope for packets and interfaces, and implement the logging infrastructure in two new files with a makefile update.
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.
Develop the tcp_dump implementation by formatting the standard packet headers and writing the formatted content to output sources using the DCP dump and DCP write data APIs.
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.
Define and implement a subscriber API for interface notifications in the IP stack, using a function pointer argument, enabling wildcard subscriptions and notifying all interface config changes during initialization.
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.
Explain how the notification callback unwraps interface data, detects abdon bit changes, and triggers the SPF algorithm on all topology nodes.
Demonstrate how a notification triggers the SBF algorithm to update routing tables. Observe traffic reroute to best paths when an interface goes down and return when it comes back up.
Timers drive networking by enabling timeouts, backoff, and periodic packets. The module covers Linux and POSIX timer APIs to build customizable timers with start, pause, kill, and reschedule.
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.
Convert a static arp table into dynamic tables with timeouts, automatically deleting unused entries after 30 seconds and resetting the expiration timer on use, with CLI visibility.
Explore how the timer library works and the APIs it provides in Appendix B, complete the short 24-minute section and its assignment, then proceed to the next video.
Initialize a separate real-time timer for every node in the topology and attach a timer member to each op entry to expose per-entry timer APIs for dynamic opticals.
We cover four APIs to manage ARP entry timers: create, delete, refresh, and query remaining time, using a 30-second expiration, timer callbacks, and routing table integration.
Implement four APIs to manage expiration times of op entries in the main tcp/ip stack, including adding, refreshing, and using app table entries during traffic forwarding.
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