Part A – Network Protocol Development in C ( from scratch )

Part A – Network Protocol Development in C ( from scratch )

English | MP4 | AVC 1280×720 | AAC 44KHz 2ch | 119 lectures (12h 35m) | 5.14 GB

Network Coding Project for Network Core Developers, Linux, System Programming, Operating systems, Projects in C/C++

This Course presents the Case study in which we implement the Pseudo Interior Gateway Protocol similar to OSPF (Open Shortest Path First) & ISIS (Intermediate System to Intermediate System). Both ISIS and OSPF are IGP protocols that fall under the category of link-state protocols and achieves the same objectives. Don’t worry, We shall cover all necessary theories regarding what we shall be going to implement in the project before we hit the first line of code of the project.

This full course is divided into 3 parts – Part A, Part B, and Part C out of which Part A and B are Live, and Part C is under Development as of 19 Oct 2022.

We shall implement the Simplified version of the actual ISIS protocol using our tcp-ip stack library. The goal is to learn the nuances involved in implementing a typical Network protocol on a device from absolute scratch. You will be doing it all your life once you join the industry, but here, this case study aims at giving you firsthand experience regarding what it takes to implement a typical Network protocol on a (simulated) device.

I bet if you are giving an interview in the company for a network developer role, entry-level up to 2-3 yrs of experience, or making a cross-domain switch into Networking Development, seeing the above mention of the project in your resume would give goosebumps to the interviewer. If you could answer cross-questions (I shall be covering in this Course) – you shall be selected without any doubt. Maintain GitHub to present your codes to him if asked.

Project Goals

The AIM of this project is to cycle you through the experience of end-to-end implementation of a typical network protocol. In this case study, we have chosen a routing protocol as an example, but the high-level logistics involved to implement a typical network protocol are more or less the same. For example, a typical network protocol has to:

  • Configurable via CLIs
  • Show internal states and results through show CLIs
  • Respond to generic configuration changes ( such as link shut-down, IP Address on interface change, etc)
  • Compute results and install the results in Tables (Routing Information Base, MAC Tables, hardware Tables, etc )
  • Respond to Topological Changes (link failures, device failures, etc )
  • Time-out stale Data structures if any.
  • Periodically Generate Or Process Protocol packet
  • How to add a new feature to the existing working Protocol Codebase. (This is what you shall be doing all your life as a software engineer !!)

Since the project is quite big (I am expecting around 20k LOCs), you would also get the opportunity to learn how to:

  • Organize the code in header and src files
  • Modularize the codebase: How to keep the code of different features in different src files
  • Testing the new feature, and cross-check it doesn’t break existing features
  • Maintain Code Commits through Version control system ( Github in this case )
  • Bug Fixing, and exercise various debugging techniques (gdb, Valgrind, etc )

Needless to say, you Can’t exercise the above points unless you do a project of considerable size.

What you’ll learn

  • Understand how Network Protocols are implemented on Network Devices
  • Implement new features incrementally
  • Packet processing, Update protocol data structures through packets processing
  • Implement complex protocol state machines and Network Algorithms
  • Debugging and troubleshoot code to resolve issues
  • The AIM of this project is to cycle you through the experience of end-to-end implementation of a typical network protocol
Table of Contents

Course Objectives and Pre-requisites
Course Objectives and Pre-requisites
Agenda and Challenges
Project Road Map
How to do this Course

Schooling – Get familiar with TCPIP Stack Library
Download Src Code
Setup Code Navigator
Topology Building ( Optional, you may Skip )
Checking RT and MAC Tables
Packet Capture and Debugging
Library Internal Design and Architecture
Handling Interface Config Change Events
LIBCLI Library

Theory – Layer3 Routing Fundamentals
Welcome To College – Agenda
L3 Routing Table Construction – Introduction
Goals and Problem Statement
Routing Table Entry Format
ECMP – Equal Cost Multiple Path
L3 Device Collaboration
Generic Steps to Build Routing Table

Theory – Understanding IGP Protocols Functioning
Phases of This Section
Phase 1 – 4 Steps
Phase 1 – Step 1 and 2
Phase 1 – Steps 3 and 4
Phase 2 – Spf Algorithm
Phase 2 – Spf Algo Example 1
Phase 2 – Spf Algo Rules
Phase 2 – Spf Algo Example 2
Phase 3 – Final Routing Table Computation

Professional – Getting Started with Protocol Dev
Getting Started
Ecosystem for Protocol Development
Introducing LIBCLI
Ist CLI Development
CLI Backend Handler Implementation
Protocol Configuration Holders
Assignment Questions ( Mandatory )
Developing a Show CLI
Configuring Protocol Interfaces
CLI for Configuring Interfaces
Mandatory Assignment
Enable Disable Protocol On interfaces
Mandatory Assignment

Protocol Control Packets
Protocol Packet Types
Manipulating Ethernet Frames – APIs
Packet Registration Step 1 of 2
Packet Registration Step 2 of 2

Phase 1 – Adjacency Mgmt Implementation
Adjacency Mgmt – Getting Started
Hello Pkt Content
Adjacency Formation
Adjacency State
Adjacency Timers
Mandatory Assignment
Whats in this section to implement
TLVs – Prerequisites
TLV Insertion
TLV Search
Hello Packet Format
Assignment Questions
Cooking up Hello Protocol Packets – Pre-requisites
Cooking up Hello Protocol Packets
Hello Packet Transmission
Hello Packet Transmission Implementation
Assignment Questions
Hello Xmit APIs Integration
Hello Transmission Testing
Assignment Questions

Phase 1 – Packet Capture and Debugging
Packet Logging
Packet Registration for Tracing and logging
Packet Tracing Demo
Logging Internal Traces

Phase 1 – Protocol Hello Packet Processing
Entry point for Packet Processing
Assignment Question
Validation Checks on Hello Pkts
Bug Fix – Missed return
Adjacency Object Creation
Show Command Enhancements
Demo of the Project so far !
Adjacency Timers
Adjacency Delete Timer APIs Implementation
Adjacency Expiry Timer APIs Implementation
Assignment Questions
Show Command Enhancement Display Adjacency Timer Status
Adjacency State Transition Diagram
Adjacency State Transition Diagram Implementation
Adjacency State Transition Diagram Implementation – Part 2
Bug Fix – Adjacency State Machine – Missing Breaks
Assignment Questions

Phase 1 – Assignment Questions – Show me your Skills
Assignment Questions – Test your Understanding of Phase 1

Phase 1 – Interface Config Change Notifications
Interface Config Processing – Design
Interface Events Registration
Processing Interface Events
Handling Interface EnableDisable Event
Handling IP Address Change Event
Testing Procedure

Phase 1 – Shutting Down the Protocol
Protocol Shutdown
Where to go from here

Mini Project – Implement Layer2 Mapping
Problem Statement
Project Working
APIs and Working Demo

Appendix A – Part 1 – LibClI Library Tutorial
Command Types and quick demo
Command Tree
Param Types
Backend Handler Implementation

Appendix A – Part 2 – LibClI Library Tutorial
Building a Library
Hdr File Inclusions
show command example
show command demo
Front-End to Backend Data Flow
Library Capabilities
Config Command Example

Appendix B – Glue Based Linked List
GLthreads Definition
Pictorial Difference
Structure Field offset
GLNode Insertion
GLThread Iteration
GLNode Deletion
Code Walk Demo
Traditional Linked List Problems
GLThread Benefits

Appendix C – Header File Inclusion Tips
Duplicate Hdr File Inclusion
Preprocessor Directives

Appendix D – TLVs ( Type Length Value )
Concept of TLVs
Parsing TLV Buffer
TLV Assignment

Appendix E – Timer Library Tutorial
Working of Timers
Timer De-Registration
Other Helpful Timer APIs

Bonus Lecture
Bonus Lecture