We may earn an affiliate commission when you visit our partners.
Abhishek CSEPracticals, Shiwani Nigam, and Ekta Ekta

      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.

Read more

      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 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

[ 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

[ 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

[ 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

[ 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

[ 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)

Enroll now

Here's a deal for you

We found an offer that may be relevant to this course.
Save money when you learn. All coupon codes, vouchers, and discounts are applied automatically unless otherwise noted.

What's inside

Learning objectives

  • 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 !

Syllabus

What is this Course About ?
Agenda
Sequel Course
Thanks Giving
Read more

The pre-requisite of this Course is that you have a thorough knowledge of Layer 2 and Layer 3. For that you can enroll into my Other networking course here : https://www.udemy.com/course/network-programming-from-scratch/?instructorPreviewMode=guest

and complete section no : 3 ,4 and 5.

In testapp.c file, we need to load the correct topology which I used for showing the Demo.

In testapp.c , inside main fn replace line :

topo =<some topology name>();

with

topo = build_square_topo();

recompile and rerun.

If it is already there, then no problem.

This Course is dependent on this External LIBCLI Library. I have added all Videos of this separate course in Appendix E.

Traffic lights

Read about what's good
what should give you pause
and possible dealbreakers
Provides hands-on experience with low-level networking concepts, which is valuable for those seeking roles in network development or security
Involves building a TCP/IP stack from scratch, offering a deep understanding of networking protocols and their implementation in C
Requires familiarity with L2 routing and L3 routing, suggesting it is best suited for learners with existing networking knowledge
Uses Ubuntu 19.04 and GCC compiler, which may require learners to set up a specific development environment
Focuses on practical implementation and coding, which is ideal for learners who prefer hands-on experience over theoretical knowledge
Requires knowledge of data structures and pointers, which may be a barrier for absolute beginners in programming

Save this course

Create your own learning path. Save this course to your list so you can find it easily later.
Save

Reviews summary

Implement tcp/ip stack topology in c

According to students, this course offers a highly practical, project-based deep dive into networking internals by teaching learners how to implement a network topology emulation infrastructure in C. Many find it incredibly rewarding and an excellent way to solidify theoretical knowledge with hands-on coding. The course is 100% coding focused, requiring learners to write code from scratch to build network nodes, links, and communication setup. Reviews indicate it is very challenging and has a steep learning curve, strongly reinforcing the stated prerequisite of solid C and networking fundamentals. While the project value for a professional portfolio is frequently highlighted, some reviews mention occasional difficulties with code clarity or environment setup.
Emphasis on writing code without libraries.
"This is a 100% Coding based Course in C in which we will develop a TCP/IP Stack from scratch"
"An absolute gem for understanding networking internals through coding. Building the topology simulation... is foundational."
"This practical approach beats pure theory any day."
Focuses on network graph and communication setup.
"Part A sets up the core infrastructure well."
"Building the topology emulation from scratch... The explanations are clear, and the project-based approach solidifies understanding."
"Loved building the network graph and getting the communication set up."
"Part A is a solid start to the project. Setting up the network nodes and links programmatically was insightful."
"This course teaches you to implement the foundational network topology emulation."
Excellent hands-on implementation experience.
"This course is fantastic for anyone wanting to dive deep into network programming."
"Building the topology emulation from scratch in C is incredibly rewarding."
"Loved building the network graph and getting the communication set up. This practical approach beats pure theory any day."
"An absolute gem for understanding networking internals through coding."
"Part A is a solid start to the project. Setting up the network nodes and links programmatically was insightful."
Some challenges with environment or code.
"Some parts of the code could be explained more thoroughly..."
"...the setup can be a bit tricky depending on your environment."
"Sometimes the code examples are hard to follow."
"Couldn't get the environment working properly either."
"The code is complex and hard to debug."
Very challenging, requires solid C and networking.
"It's challenging but worth it. Definitely requires strong C skills."
"The concept is great... However, I struggled with the prerequisites. It says intermediate, but you really need advanced C and networking knowledge."
"Found this course very difficult. The prerequisites aren't emphasized enough. I know some C, but this was way beyond me."
"Highly recommend if you are comfortable with C and want a serious networking project."
"It's a demanding course, so be prepared to spend time on it."

Activities

Be better prepared before your course. Deepen your understanding during and after it. Supplement your coursework and achieve mastery of the topics covered in Part A - Networking Projects - Implement TCP/IP Stack in C with these activities:
Review TCP/IP Fundamentals
Reinforce your understanding of TCP/IP fundamentals to better grasp the practical implementation in C.
Browse courses on TCP/IP
Show steps
  • Review the OSI model and TCP/IP stack layers.
  • Study the functions of each layer.
  • Understand the difference between TCP and UDP.
Brush Up on C Programming
Sharpen your C programming skills, especially pointers and memory management, as they are crucial for this project.
Browse courses on C Programming
Show steps
  • Review pointer arithmetic and memory allocation.
  • Practice implementing linked lists and other data structures in C.
  • Write small programs to reinforce your understanding.
Read 'TCP/IP Illustrated, Volume 1: The Protocols'
Deepen your understanding of TCP/IP protocols with this comprehensive guide.
Show steps
  • Read the chapters relevant to the project's current stage.
  • Take notes on key concepts and implementation details.
  • Refer to the book when facing challenges during coding.
Four other activities
Expand to see all activities and additional details
Show all seven activities
Implement a Simple Packet Sniffer
Gain hands-on experience with packet analysis by building a basic packet sniffer in C, reinforcing your understanding of network protocols.
Show steps
  • Research packet capture libraries like libpcap.
  • Write code to capture and dissect network packets.
  • Display packet headers and payload data.
Study 'Computer Networking: A Top-Down Approach'
Broaden your networking knowledge with this widely-used textbook.
Show steps
  • Read chapters related to the implemented protocols.
  • Compare the book's explanations with your implementation.
  • Identify areas for improvement in your code.
Document Your TCP/IP Stack Implementation
Solidify your understanding by creating detailed documentation of your TCP/IP stack implementation, explaining the design choices and code structure.
Show steps
  • Write a high-level overview of the stack architecture.
  • Document each module and its functions.
  • Include diagrams and flowcharts to illustrate the packet flow.
Contribute to a Networking Project
Apply your knowledge and skills by contributing to an open-source networking project, gaining experience in collaborative development and real-world networking challenges.
Show steps
  • Find an open-source networking project on GitHub.
  • Identify a bug or feature to work on.
  • Submit a pull request with your changes.

Career center

Learners who complete Part A - Networking Projects - Implement TCP/IP Stack in C will develop knowledge and skills that may be useful to these careers:
Network Protocol Developer
A Network Protocol Developer specializes in designing, implementing, and testing network protocols. This course directly aligns to the work of a protocol developer. The core focus of the course is on building a TCP/IP stack, which involves a deep understanding of network protocols and their implementation in C. The course covers data link, network, and application layers, all of which are essential to networking protocols. The practical hands-on approach in creating protocols will be especially valuable. The course emphasizes the importance of packet processing and flow, which is crucial for any network protocol developer. By building these protocols from scratch, a network protocol developer can significantly enhance their abilities. The course provides a strong framework for understanding protocol design.
Network Software Engineer
A Network Software Engineer designs, develops, and maintains software for network devices and systems, often working on low-level protocols and operating systems. This course is directly applicable to their work, as it involves building a TCP/IP stack from scratch in C, including data link, network, and application layers. This hands-on experience with network protocols and packet handling is highly relevant. The course emphasizes practical implementation, which is critical for network software engineering. Furthermore, the course covers the journey of packets through the TCP/IP stack, which is crucial for understanding network architecture. A network software engineer will find value in the course as they gain a deep understanding of the inner workings of network communication.
Embedded Systems Engineer
An Embedded Systems Engineer designs and develops software for embedded systems, which often involves low-level programming and network communication. This course helps an embedded systems engineer by providing practical experience in implementing a TCP/IP stack, a crucial component in many embedded systems that handle network communication. This course focuses on C development, a common language in embedded systems. The detailed implementation of data link and network layers allows for a solid understanding of network protocols. The project-based nature of the course translates directly to the kind of practical work embedded systems engineers need to be successful. The skills obtained in setting up network topologies and working with packet buffers provide a strong foundation for real-world embedded systems development.
Systems Programmer
A Systems Programmer works on low-level software, including operating systems and network components. This course is well-suited for a systems programmer, offering relevant experience in network programming in C. This course helps a systems programmer learn by building a TCP/IP stack from scratch and thus provides detailed knowledge of network layers and protocols. The course’s hands-on approach, including creating a network topology emulator in C, is an ideal training to become a systems programmer. The core knowledge of low-level network operations, data structures, and algorithms are essential skills for systems programming. Developing the TCP/IP stack also provides a solid background in the practical aspects of operating system interactions. The course content will translate well to other system-level software projects.
Network Security Engineer
A Network Security Engineer is responsible for securing network infrastructures against threats and vulnerabilities. This course is applicable to the role as it provides an understanding of how network protocols function at a low level. By building a TCP/IP stack from scratch, this course will familiarize a network security engineer with the inner workings of a network. The course covers data link, network, and application layers of the network stack which would provide valuable insight into network communications. An understanding of how packets are transmitted and handled helps to analyze potential security vulnerabilities. The course's hands-on implementation of network protocols, such as routing and switching, will help a network security engineer be better equipped to identify and mitigate security risks.
Firmware Engineer
A Firmware Engineer develops software that directly interacts with hardware. This course helps a firmware engineer by providing experience with low-level network programming in C. The core of the course is building a TCP/IP stack from scratch, a skill applicable to developing firmware for network devices. This is because many embedded systems and hardware devices have networking features. The course’s emphasis on data link and network layer implementations provides a practical learning experience. The knowledge of packet processing and buffer handling gained in the course is highly relevant for writing firmware. A firmware engineer will benefit from the course as it provides a hands-on, project-based approach to implementing network protocols in a practical way, focusing on low-level network implementations and manipulations.
Network Engineer
A Network Engineer is responsible for designing, implementing, and managing network infrastructures. While this role can encompass a wide range of tasks, this course will help a Network Engineer by providing in-depth knowledge of network protocols. The hands-on implementation of a TCP/IP stack gives a crucial understanding of the underlying principles. This course covers the details of how the data link and network layers operate, which a network engineer must fully grasp. While not a primary aspect of all Network Engineer roles, the ability to implement a TCP/IP stack from scratch is a highly valuable skill. The course emphasizes the practical aspects of network engineering with projects like building network topology, implementing layer 2 switching, and routing. Any network engineer will find this course very useful.
Telecommunications Engineer
A Telecommunications Engineer designs, installs, and maintains telecommunications systems and infrastructure. This course helps a telecommunications engineer as it provides an understanding of low-level network communication. Through the course, they will build a TCP/IP stack from scratch covering data link, network, and application layers which is vital in this field. The course reinforces a practical understanding of network protocols and how data is transmitted. Although a telecommunications engineer might not write their own network stack, the core knowledge of how a network operates is key. They will be able to optimize network deployments and manage telecommunications infrastructure more effectively. The hands-on implementation projects will help them succeed.
Cybersecurity Analyst
A Cybersecurity Analyst works to protect networks and systems from threats. This course may be useful for a cybersecurity analyst as it provides a deep understanding of network protocols and their implementation. The core of the course, building a TCP/IP stack from scratch, offers a valuable look into the functioning of network layers. This course covers the data link, network, and application layers, giving insight into how network communications work. Although a cybersecurity analyst does not usually code network stacks, the skills learned from working with packet buffers and network topology are very relevant. By learning this, a cybersecurity analyst can better understand how security vulnerabilities can arise. The course will help the analyst better understand how to protect systems and networks.
Research Scientist
A Research Scientist conducts research to advance scientific knowledge, often in fields related to computer networks and systems. This course may be useful for a research scientist involved with networking, as it provides hands-on implementation experience with network protocols. By building a TCP/IP stack from scratch in C, the course allows scientists to explore networking at a low level. The focus is on the data link, network, and application layers of network communication which is critical to systems research. While the research scientist may not often be in the position to implement a network stack from scratch, this experience helps deepen theoretical knowledge and provides a more real-world approach. The scientist will have a practical understanding of how network protocols actually work, and an appreciation for the actual challenges in the field.
Cloud Computing Specialist
A Cloud Computing Specialist designs, implements, and manages cloud-based systems and services. This course may be useful for a cloud computing specialist, offering a deeper understanding of network protocols. This course is not directly about cloud technologies, but it provides a foundation of network principles. The course centers around building a TCP/IP stack from scratch, covering data link, network, and application layers, all of which are very relevant to cloud-based networks. While they typically use existing cloud network services, a cloud computing specialist will find value in this course as learning the underlying mechanics allows them to more easily troubleshoot issues. The course provides a detailed understanding of how packets traverse different network layers.
Software Developer
A Software Developer designs and builds software applications. Although not all software development involves in-depth network programming, this course helps a software developer by providing a deeper understanding of network functions. The course involves developing a TCP/IP stack from scratch, covering data link, network, and application layers which is useful for understanding how systems communicate. The focus on C, a prevalent language in systems programming, and low-level network operations are valuable skills for any software developer. The course emphasizes hands-on projects, which leads to a deeper understanding. The course material on packet processing also gives a more robust understanding of the entire software stack. A software developer will benefit from the course's emphasis on practical implementation.
Technical Consultant
A Technical Consultant provides expertise to clients on technology solutions. This course may be useful for a technical consultant, offering knowledge of low-level network operations. This is because the course's hands-on approach in developing a TCP/IP stack lets the consultant better advise clients. The course covers the data link, network, and application layers, forming a foundation for understanding diverse networking technologies. The consultant will gain hands-on experience in building network topology and implementing protocols in C. By understanding the implementations of networking protocols, a technical consultant increases their expertise. The consultant will be able to better guide clients regarding network functionality with the knowledge gained from the course.
DevOps Engineer
A DevOps Engineer is responsible for automating and optimizing software development and deployment processes. This course may be useful to a DevOps Engineer, as a deeper understanding of network protocols can be advantageous. Although they don't typically build network protocols, the knowledge of a TCP/IP stack, developed in this course, gives an edge in infrastructure management. The course's focus on the data link, network, and application layers helps explain how different services interact with each other. Additionally, the hands-on experience of how network protocols are built will be very useful when managing deployments. The course’s project-based approach allows the DevOps Engineer to grasp the intricacies of network operations. The experience of building a network is applicable to building enterprise systems.
Data Scientist
A Data Scientist analyzes complex data to extract valuable insights and solve business problems. This course may be useful to a data scientist as it provides a deeper understanding of how data communications work at a lower level. While it does not directly involve data science, the course focuses on building a TCP/IP stack in C, which gives a more practical view of how data packets traverse different layers. Data scientists often analyze data collected from diverse sources, including networks, and this course’s work with packet buffers and network communication can be insightful. The course’s coverage of the data link, network, and application layers can be helpful for understanding the underlying infrastructure. The data scientist will gain a unique perspective on data transfer mechanisms.

Reading list

We've selected two books that we think will supplement your learning. Use these to develop background knowledge, enrich your coursework, and gain a deeper understanding of the topics covered in Part A - Networking Projects - Implement TCP/IP Stack in C.
Provides an in-depth look at the TCP/IP protocol suite. It valuable reference for understanding the underlying protocols being implemented in the course. The book is commonly used as a textbook in networking courses and provides detailed explanations and diagrams to aid comprehension.

Share

Help others find this course page by sharing it with your friends and followers:

Similar courses

Similar courses are unavailable at this time. Please try again later.
Our mission

OpenCourser helps millions of learners each year. People visit us to learn workspace skills, ace their exams, and nurture their curiosity.

Our extensive catalog contains over 50,000 courses and twice as many books. Browse by search, by topic, or even by career interests. We'll match you to the right resources quickly.

Find this site helpful? Tell a friend about us.

Affiliate disclosure

We're supported by our community of learners. When you purchase or subscribe to courses and programs or purchase books, we may earn a commission from our partners.

Your purchases help us maintain our catalog and keep our servers humming without ads.

Thank you for supporting OpenCourser.

© 2016 - 2025 OpenCourser