
Develop and implement access control lists and IPv4 routing tables in C/C++, using a shared data structure supported by bitmap, stack, and linked-list libraries, with prerequisites and debugging skills.
Explore how access control lists operate in routers and firewalls, named ACLs of permit or deny rules evaluated by protocol, source and destination addresses, and masks via longest prefix match.
Analyze how an IP packet is evaluated against an access control list to determine permit or deny decisions using longest prefix match, with specific versus generic rules and don't-care fields.
Demonstrates how a layer three forwarding device uses longest prefix match on an IPv4 routing table to forward packets, selecting the best matched route and default when necessary.
Explore the best matched principle for access control lists and routing tables, including long list prefix match with wild card bits, and review data structures and designs for ACLs.
We explain the routing table design using key terms prefix, mask, and wildcard, and illustrate how an IPv4 1.2.3.4/24 translates to 255.255.255.0 and its wildcard.
Introduce the amtrie data structure for IPv4 routing tables, detailing nodes storing effective prefixes with bitmaps, parent/child pointers, and a root, to support insert, delete, search, and longest-prefix-match.
Construct an ipv4 routing table using a prefix trie. Insert routes from the root via first bit decisions, creating zero/one/don't-care children and performing node splits.
Walk through the six-step route insertion algorithm with a concrete example, showing how a new prefix causes a node split, subtree transfer, and prefix reassignment, and discuss time complexity O(K).
Analyze how routing entries populate a tree structure, creating leaf and internal nodes, with leaves holding data and internal nodes null, while paths from root to leaf reveal prefix sums.
Use a route search algorithm with exact bit-by-bit matching and don't-care bits on a data structure. Traverse from root by effective prefixes to locate the matching leaf or report absence.
Follow the route deletion algorithm by locating the exact-matching leaf using the root search algorithm, delete the leaf, and convert the parent from a half node to a full node.
Explore deleting routes from a routing trie, using exact-match search to remove leaf nodes, merge nodes, and update the effective prefix, returning the root to an initialized state for lookups.
Explore the longest prefix match route lookup algorithm for a routing table, using IP header addresses and next-hop forwarding, including default routes and don't-care bit matching.
The lecture shows a route lookup using longest prefix match: convert the IP to 32-bit binary, traverse the data structure via a stack, and find the longest matching prefix.
Explore route lookup using a prefix tree to perform the longest-prefix match for an IPv4 address such as 1.2.3.5, including handling of the default route via the root.
*** 22 Sept 2022 - This Course is under Development ***
This Course aims at Explaining and Implementing the Data Structures Required to Implement IPV4 Routing Table and Access Control Lists. Both these features are ubiquitously used in Networking/Embedded/Distributed System/Cloud Computing etc, and hence we decided to throw a course on explaining the internal design and implementation.
We shall be going to build a Library called mtrie library, which will form the foundation for implementing IPV4 Routing Table and Access Control List framework. Trie is a popular standard data structure and its variant is used to solve different types of industry problems.
We shall be building Cisco like Access Control List which is used for Security, Controlling the traffic flow Or restricting the access & permissions to the user to certain resources over the network. Below is Cisco Example. We shall be going to re-invent the wheel.
access-list allow_traffic permit UDP 122.1.1.1 255.255.255.255 40.1.1.1 255.255.255.255
access-list allow_traffic permit UDP 122.1.1.0 255.255.255.0 40.1.1.0 255.255.255.0
access-list allow_traffic permit UDP 122.1.0.0 255.255.0.0 40.0.0.0 255.255.0.0
access-list allow_traffic deny any 0.0.0.0 0.0.0.0
This Course is Data Structure and Algorithmic Intensive, and We shall be showing all demonstrations in C/C++. However, you are free to implement the explained concepts in the language of your choice.
Pre-requisite :
It's desirable you understand how Subnet Masks work, and a very basic Networking background is required. This Course is exclusively designed for Intermediate to advanced developers only. If you are still struggling with programming basics, pls excuse this course. The complexity level of this course is intermediate, and not for beginners. You will need to do a lot of Bit-Level Programming in this course.
End Product :
The end product of this course is that you will have fully working Routing Table and Access Control List Libraries which you can further integrate into your other projects readily or decorate your resume with these milestones.
Table of Contents
1. What is Access Control List and how does it work?
2. What is the Longest prefix Match?
3. Trie Data Structure
4. Optimizing Trie to construct Routing Table Data Structure ( called mtrie )
Route Insertion Algorithm
Route Deletion Algorithm
Route Search Algorithm
Longest Prefix Match Algorithm
<< Delivered Till here as on 22 Sept 2022 >>
5. Building Routing Table CRUD APIs over Mtrie Data Structure
6. Implementing Access Control List Over Mtrie Data Structure
Compiling ACL Rule into TCAM entry format
Installing ACL Rule
Uninstalling ACL Rule
ACL lookup based on Longest Prefix Match
7. Testing our Codes and Libraries