Part A - Networking Projects - Implement TCP/IP Stack in C

C/C++ Linux Project, Network Socket Programming, Build TCP/IP Stack, Final Year Project, L2 & L3 Implementation in C

4.65 (186 reviews)
Udemy
platform
English
language
Network & Security
category
Part A - Networking Projects - Implement TCP/IP Stack in C
3,536
students
14.5 hours
content
Jun 2023
last update
$64.99
regular price

What you will learn

Implement Layer 2/3 of TCP/IP Stack by yourself from Scratch

Writing Custom CLI commands to configure network topology

Building Network Topology from Scratch

Implement Routing and Switching Algorithms - The practical way

Timers, GLthreads, Library integration, Makefile, Project modularization Techniques

Managing and developing a big source code from scratch using git, a Version control System

This is 100% Coding Course with minimal Theory

In Every other interview in Networking Domain, You shall be asked to explain Basic Routing Concepts, So Do not miss this Course !

Description

      Student Level: Intermediate to Advanced to Working Professionals, Beginners in Coding pls excuse this course.

      Talk to your Prof: Use this Project as your Final Year Under-Grad Project

      Note: If you are buying this course, pls do not buy my other course on - "Integrate CLI interface to you C/C+++ Project". It's all videos that are already included in this course.



This is a 100% Coding based Course in C in which we will develop a TCP/IP Stack from scratch having Data Link Layer, Network Layer and Application Layer in Operation. This is one big project split up into 6 mini-projects. The development of the sister course (Part-B) is in progress.

This Course will set you ready for a core network developer's role in the industry. If you are thorough with basics of L2 Routing including ARP, L3 routing, then probably you already have the required knowledge for this project-based course. If not, you should enroll in to my course - "Networking Concepts and Programming from Scratch" and at-least do section number : 3 to 5. For VLANs implementation section 6,7, and 8 is required. We shall be implementing this theory in C now. If you have some other favorite language, feel free to do this course in that, I don't mind, but I shall be explaining logic and showing the demos in C only.


In this course, We shall be implementing a TCP/IP Stack demo through 6 Networking Projects. All Below Projects should be done in the same sequence as listed.

Project 1 : Build a MultiNode Topology Emulation of Routers and Switches

Project 2 : Implement DataLink Layer (L2 routing), including ARP

Project 3 : Implement L2 Switching (Mac-based Learning and Forwarding)

Project 4 : Implement Vlan Based Mac learning and Forwarding

Project 5 : Implement Network Layer (L3 routing)

Project 6 : Case Study : Implement IP-Tunnelling (Optional)


In these mini Projects, we shall be implementing the packet Journey Upwards and Downwards through layers of TCP/IP Stack (= OSI Model). We shall be implementing the TCP/IP Stack !! There is minimal Socket Programming in this course. Not every Networking project has to be socket programming based.


Along the way, we shall be discussing and implementing the solution to new challenges we encounter while solving the problem. Based on how this course is accepted by students, I would add more projects to this course based on the student's feedback.


After Doing These Projects, you shall be able to :

1. Tell why you need Data link layer and Network Layer

2. How to design a new Application protocol on a TCP/IP stack (just like ICMP, HTTP, etc all work on TCP/IP Stack)

3. Get your hands dirty with industry-level network programming.

4. Learn cooking up, parsing and reading the packet buffers

5. Understand End-To-End Architecture and Design of Network Application and TCP/IP Stack

6. Conquer Interviews for the role of Network Developer Engineer

7. Decorate your GitHub, and add a strong project to your HAT, Expected LOCs of this course shall exceed 10k !


This project will fill up the gap between theoretical knowledge and the Implementation version of it. How does it sound that you have written code by your own hands to resolve ARP, packet forwarding, etc. Decorate your resume and GitHub with this project.


This course is divided into Two Parts :


Part A - In this part of the course, we shall be building up the Network topology Infrastructure comprising of routers, switches, and links connecting them. Nodes can also exchange packets with their neighbors. Basically, we want to simulate a fully programmable and configurable network topology in this part of the course. This is Project 1.

Part B - The Configurable Network Topology build in Part A of the course shall be used to implement the Remaining five Projects [2-6] as listed above.


We shall be setting up all the required infrastructure to mimic the network topology - and that itself is a mini project altogether. We shall be creating nodes, links connecting nodes, configuring network parameters on nodes, sending and receiving traffic streams - All in one project. This is Megaproject, expected LOC may go to tens of thousands if we keep on adding TCP/IP stack features onto it. The sky is the limit.


The best thing about this project is - You will learn many other things along the journey, including setting up Timers, Network Topology Construction, Glthreads - A Glue way of Linked lists, Building Project using Makefile and I am not even talking about learning Software Designing skills. Additional Material has been added in the Appendix Section of the course. We shall be modularizing the project in separate folders, each folder contains code implementing a particular OSI Layer functionality, and Yes, We shall be doing it all from scratch.


Warning :

1. Absolute beginners, struggling with basic data structures and pointers, pls excuse this course. You are not prepared for this project. Pls, invest your time into learning basics first.

2. Machine Used: Ubuntu 19.04, GCC compiler.  So my codes may not compile on your machine if you are using some other compiler or machine.


Table Of Contents :

********

PART A

********

[ PROJECT 1]

Section 1. KYC (Know your Course)                           

Section 2. Developing a Generic Graph Topology

  • Graph Data structures

  • Graph related APIs

  • Creating our first static graph

Section 3. Construction of a Network Graph Topology

  • Adding Network topology details to the graph

  • APIs to configure Network Topology

  • Get ready without first Hello World Network Topology                             

Section 4. Command-Line Integration

  • Integrate CLI Interface to the project

  • Write Custom Commands to Display Network Topology detail

Section 5. Communication Setup

  • Sending a packet to Nbr node on the outgoing interface   

  • Listening and Monitoring Multiple Sockets

  • Receiving a packet on an interface


    ********

     PART B

    ********

Section 6. Agenda of Part B


[ PROJECT 2]

Section 7. Getting Started with TCP/IP Stack Development

  • Interface Modes

  • Ethernet Header Format

  • Assignment on Ethernet Header Manipulation

  • Packet Processing Criteria

  • Packet Buffer Management

Section 8. Implement Layer 2 (DataLink Layer) - ARP                         

  • Get started with ARP Implementation

  • ARP Message Format and Example

  • Creating ARP Tables

  • CRUD APIs on ARP Tables

  • CLIs to work with ARP                                                         

  • ARP Cycle and ARP APIs

  • Preparing and Sending ARP Broadcast request msg

  • Processing ARP Broadcast Request msg

  • Sending ARP reply Msg

  • API to Start Ingress Journey of the Frame

  • Processing ARP reply msg and create an ARP entry in ARP table

  • ARP in Action


[ PROJECT 3]

Section 9. Implement Layer 2 (DataLink Layer) - L2 Switching                 

  • APIs to configure node as L2 switches

  • Setting up the new Topology with L2 switches and host machines

  • Implementing MAC learning and Forwarding algorithms

  • MAC Table Management of L2 switches

  • Testing L2 switching behavior using ARP


[ PROJECT 4]

Section 10. Layer 2 - Implementing Vlan Based Forwarding

  • Goals and Pre-requisites

  • 802.1Q Vlan hdr format

  • Vlan Tagged Ethernet Header Data Structures

  • API to determine Tagged Vs Untagged frames

  • Tagged <--> Untagged Frame Conversion                       

  • Vlan Based MAC Forwarding - Further Roadmap

  • Frame Ingress Condition Table

  • Frame Ingress Completion

  • Frame Egress Condition Table

  • Egress Frame Completion

  • Test Vlan Based Forwarding


[ PROJECT 5]

Section 11. Setting Up Layer 3 Routing Infrastructure (Network Layer)                                 

  • Goals and Pre-requisites

  • L3 Routing Table Setup

  • CRUD APIs for Routing Table Mgmt

  • L3 Route Installation

  • Defining IP HDr format                   

  • Adding Ping CLI

  • Network and Application Layer Interaction

  • L3 Routing Concepts Revisited

    • Forwarding Case

    • Direct Host Delivery Case

    • Local Delivery Case

    • Self-Ping Case

  • L3 Routing Flowcharts

Section 12. Layer 3 Routing Flowcharts Implementation                   

  • Payload Data Transfer from L2 to L3                                   

  • Layer 3 Flowchart Implementation - Step by Step

  • Layer 3 Operations Flowchart Implementation

  • Layer 2 Operations Flowchart Implementation

  • Testing Beta Version of our Project

Section 13. On-Demand ARP Resolution

  • Problem Statement

  • Solution Strategy                                   

  • Data Structure Enhancements

  • ARP Sane Entry Creation

  • ARP Pending List Processing

  • Final Demo of our Complete Project


[Project 6]

Section 14. Implement IP-IN-IP Encapsulation (Tunneling)

  • Implement IP-IN-IP Encapsulation (Tunneling)


Future Extension of the Project. Students are supposed to take this forward on their own.

Section 15. Routing between two Vlans (Inter Vlan Routing)


Content

What is this Course About ?

Agenda
Thanks Giving
Pre-requisites
Future Project Extensions
Project Goals

Generic Graph Construction

Starting With Generic Graphs
Feel the End Product of this Course
Graph Modelling
Graph Data Structures and Repository Access
Graph Construction
Graph APIs
Makefile - Project Compilation

Construction of Networking Topology

Adding Networking Properties to Graph
APIs to Add Networking Properties
Code Walk to construct Network Graph

Command Line Integration

Introducing LibCli Library
Steps To Integrate LibCLI library with our Project
Implementing our first CLI

Communication Setup

Goals of this Section
Design Discussion - Logical and Physical View
Design Discussion - Physical View in Detail
8 steps of Implementation
Implementing Step 1 and 2 - Sockets Creation
Implementing Step 3 - Starting a Socket Monitoring Thread
Implementing Step 4 - Packet Transmission
Implementation Steps 5 - 8
Test Demo
Summary

Part B - Agenda

Part B - Agenda

Getting Started with TCP/IP Stack Development

Getting Started with ARP Implementation
Interface Modes
Ethernet Header Format
Packet Processing Criteria
Packet Buffer Management
Right Shift of Packet Buffers
A word of Warning !

Layer 2 - Implementing ARP

ARP Message Format
ARP Message Format Example
Creating ARP Tables
ARP Table - CRUD APIs Prototypes
ARP Table - CRUD APIs Implementation
API to trigger ARP Resolution
ARP CLIs to Add
ARP Cycle
ARP APIs - Sending ARP Request
ARP APIs - Processing ARP Request
ARP APIs - Sending ARP Reply
ARP APIs - Processing ARP Reply
Theory - Starting a Frame's Ingress Journey in TCP/IP Stack
Implementation - Starting a Frame's Ingress Journey in TCP/IP Stack
Demo - ARP In Action
Summary

Layer 2 - Implementation of L2 Switching

Goals of this Section
Pre-Requisites
L2 Switch Vs L3 router
Code Access For this Section
Interface Modes
L2 Switch Based Topology
Mac Tables Setup
Mac Learning and Forwarding - Quick Revision
Entry Point for L2 Switching
Implementing L2 Switching Algorithm

Layer 2 - Implementing Vlan Based Forwarding

Goals and Pre-requisites
802.1Q Vlan hdr format
Vlan Tagged Ethernet Header Data Structure
API to determine Tagged Vs Untagged Ethernet frame
Tagged <--> Untagged Frame Conversion
Tagged <--> Untagged Frame Conversion Steps
APIs to Configure Vlan Memberships
L2 Switching Topology
Vlan Based MAC Forwarding - Further Roadmap
Frame Ingress Condition Table
Frame Ingress - Quick Code Walk
Frame Ingress Completion
Starting with Frame Egress
Frame Egress Condition Table
Frame Egress Condition Table - A Quick Code Walk
Egress Frame Completion

Layer 3 - Setting up L3 Routing Infrastructure

Goals and Pre-requisites
Phases of This Section
Code Access For this Section
Fix : Slight Code Reorganization
Phase 1 : L3 Routing Table Setup - Data Structures
Phase 1 : CRUD APIs for Routing Table
Phase 2 : L3 Route Installation - CLIs and APIs
Phase 2 : L3 Route Configuration
Phase 3 : Defining IP Header
Phase 4 : Topology Used and ARP Assumption
Phase 5 : Introducing Ping Application
Phase 5 : Ping CLIs
Phase 5 : Ping packet Layout
Phase 5 : Ping Packet Journey from Src to Dst
Phase 6 : Application <--> Network Layer Interaction
Phase 6 : Network Layer <--> Data Link Layer Interaction
Phase 6 : Placing API Signatures in Project Code
Phase 7 : Layer 3 Routing - Revision of 4 Cases
Phase 7 : L3 Routing Revision : Case 1 : Forwarding
Phase 7 : L3 Routing Revision : Case 2 : Direct Host Delivery
Phase 7 : L3 Routing Revision : Case 3 : Local Delivery
Phase 7 : L3 Routing Revision : Case 4 : Self-Ping
Phase 8 : Layer 3 Routing Flowcharts

Final Push - Implementing Layer 2 & 3 Routing flowcharts

Code Access For this Section
Payload Data Transfer from L2 to L3
Layer 3 Operation Flowchart 1 Implementation
Layer 3 Operation Flowchart 2 Implementation
Layer 2 Routing - Algorithm/Flowchart Discussion
Part 1 - Layer 2 Routing - Algorithm/Flowchart Implementation
Part 2 - Layer 2 Routing - Algorithm/Flowchart Implementation
Demo - Testing Beta Version of our Project

On-Demand ARP Resolution

Problem Statement
Solution Strategy
Data Structures Enhancements
ARP Sane Entry Creation
ARP Pending List Processing
Final Project Demo

Project - Implement IP-In-IP encapsulation

IP-IN-IP Encapsulation - Implement in 3 Steps
Step 1/3 - CLI Requirement
Step 2/3 - Backend Handler
Step 3/3 - TCP/IP Stack Changes

Project Extension and Home Work for you !

Inter-Vlan Routing

Appendix A : Makefile - Quick Tutorial

Makefile - Quick Tutorial
Makefile Analogy - Dependency Tree
Makefile Assignment - part1
Makefile Assignment - part2
Final Makefile

Appendix B : GLThreads - a Glue way of Linked List

Introduction
Glthreads Definition
Difference - Traditional Vs Glue Based DLL
Structure Field Offset
GLNode Insertion
GLThread Iteration
GLNode Removal
Code Walk - Demo
Traditional List Problems
GLThread Benefits

Appendix C : Creation and Linking of Libraries

Resuming with Doubly Linked List Library
Static and Dynamic Libraries - Quick Creation
Linking with Static Library
Linking with Dynamic Library
Summary

Appendix D : The Header File Management

Duplicate Inclusion of Header File - The Problem
Duplicate Inclusion of Header File - Solution
Recursive Dependency - The Problem Statement
Solution to Recursive Dependency

Appendix E : Section 1 - Integrate CLI interface to your C/C++ Projects

Introduction - What is this Course all about ?
Command Types
Command Tree
Param Types
Leaf Param Constraint
Library Capabilities

Appendix E : Section 2 - Integrate CLI interface to your C/C++ Projects

Building A LibCli Library
Including Header Files and Importing Hooks
Show Command Addition Example
Show Command Demo
Understanding DataFlow from CLI to Backend
Backend Command Handler Implementation
Config Command Addition Example

Appendix F : Local and Remote Subnets

Local and Remote Subnets

Appendix G : IP-in-IP Encapsulation Theory

Introduction
How IP-in-IP Encapsulation works

Reviews

Dhruv
October 20, 2023
Eventhough I am only half way through this course at the moment, I feel that is really an amazing course. People interested in low level network development should really go for it. This course allows you to actually get your hands dirty, i would suggest don't just copy paste the code from the instructors repository but actually try an implement everything on your own, it'll take more time but you will learn a lot. Although the course was released a couple of years ago, The support provided by the instructor is great. He even took out the time to help me debug my code and gave clear cut explanation to all my doubts. 100% would recommend.
Sebastian
July 13, 2022
Good: * The instructor is obviously knowledgeable on the topic * The project is engaging, relevant, and well structured Not so good: * The project requires learning about and referencing custom libraries built by the instructor. I argue that it makes more sense to find and use popular libraries instead of custom-made ones, even if they impose certain caveats and restrictions on the project. Note: I say POPULAR, not STANDARD LIBRARY. libcli is not a standard library, yet it's popular. * The intro/outro music gets repetitive and annoying after a while. Sometimes the music starts playing on top of the instructor while he's talking. This tells me he did not actually look at the videos after recording them. * The instructor's code editor has an illegible colour scheme and does not state which file is being edited. * There are plenty of spelling mistakes, random capitalization, and dispositional errors in the slides. * Problems with oral delivery such as overuse of rhetorical ".. right?"s, and pronouncing "e" as "a" (segment => sagment, receive => raceive, etc). Perhaps this is related to the "Americanized accent" that other reviewers alluded to. * Slides use a formal serif font which is intended for black-on-white print (think: newspaper) but is used as white-on-black. The serif font is also used for code examples in the slides (please use monospace!).
Hao
April 14, 2022
The content very good. The experience can be even improved if the background music is cut and the lecturer does not say the "right" so often...It is just a personal feeling but these two are kind of annoying..
Shivam
April 9, 2022
To be honest, I was very skeptical while purchasing this course thinking that the handling would be no better than any fresher level course, however, to my amazement some very advanced and complex concepts have been explained and handled in this course. The trainer seems to be fully in control of the flow of information and the graphics are beyond expectations. Altogether, it synchronizes into a very thorough & advanced course on networking, which even experienced professionals would find very useful. Being through it already - I can easily recommend it to everyone & say that if you are thinking - you are wasting your time - go for it and move up the notch - you wont be disappointed!!
Sourav
November 4, 2021
1. The teacher can first try and avoid using fake American accent. The narration needs to be easily understandable. Wrongly pronounced words makes it difficult to follow and understand. 2. There are other subtle changes needed. interfaces are usually represented like eth1/1 (read as: Ethernet 1 slash 1, and not Ethernet 1 by 1). MAC addresses are always represented in hexadecimal numbers.
Chao
June 15, 2021
Wonderful class providing a good chance to put your hands on a real mega network programming project!
Thiago
June 13, 2021
Very clear and precise on explanations. I love programming in C language and this course is full of this.
Praveen
June 13, 2021
I like the approach followed to explain things and gain practical experience code writing in parallel.
Erik
September 30, 2020
Fun course. If you simply follow along looking at instructors code you can go through the class fast. If you end up writing the code along with the project doing the challenges on your own it will take a while. Would give it a full 5 stars other then if you write your own code you will notice that some API signatures change and will take a bit of trouble shooting on your part. However this makes understanding what you are doing a better learning experience. If you like C and have an interest in the network stack I recommend it. How realistic the implementation is I cant say, but it is a fun project
deepak
September 23, 2020
Good course. Great content. Only take it if you are persistent enough and are ready to code on your own. This will be a great addition to your Github profile.
Andres
May 20, 2020
This course has really covered important topics that I wanted to see in a more practical way. Thanks for the great work.
Jamal
May 11, 2020
Very Good Course, I totally enjoyed doing this course as it provided a bridge between two major areas of interests for me in C / C++ development and networking. The low level implementation of the protocols was particularly fascinating. The course team also providing timely and useful feedback whenever I posed questions. I look forward to the next installment to expand on what was taught. I also did some additional feature to the CLI and the code out of curiosity.
Dineshh
April 17, 2020
Yes,this course is perfect match for me because i have completed CCNA wherein i am aware basics of C and Linux.
Ayushi
December 24, 2019
Thankyou so much!!! for the course ...people should just blindly go for it ..all those who are in the networking industry .
Mufaddal
November 21, 2019
Nice course . I was looking for a course on Networking coding with C and till now course has matched expectations.

Charts

Price

Part A - Networking Projects - Implement TCP/IP Stack in C - Price chart

Rating

Part A - Networking Projects - Implement TCP/IP Stack in C - Ratings chart

Enrollment distribution

Part A - Networking Projects - Implement TCP/IP Stack in C - Distribution chart
2534994
udemy ID
8/30/2019
course created date
11/20/2019
course indexed date
Bot
course submited by