Coding Challenge #38 - Network Modelling Tool
John Crickett
Become a better software engineer by building real-world applications.
Aside: Guided Coding Challenges
If you want more help working through the Coding Challenges, I have a guided course that walks you through Building Your Own Redis Server in Python and I’m currently porting the course to support building Redis in Go.
The Challenge - Building A Network Modelling Tool For An IP Network.
For this challenge we’ll build a tool that can load in a network that is described in a CSV file and some traffic data, then we’ll model the traffic flowing over the network to determine the utilisation of each link within the network.
That shows the network designer how close to capacity their network is.
The next most useful thing for many network owners is to be able to see how their network behaves in the event of the worst case failure, so we’ll implement the modelling of that scenario too.
You can build this as a command line tool that outputs another CSV, or you could build a desktop of web based GUI for it. The choice is yours!
An example of a commercial product that does this is Juniper Networks’ NorthStart Planner.
Step Zero
As always the first thing to do is decide on the programming language you’re going to use to tackle this challenge and set up your development environment.
Step 1
In this step your goal is to load a network from file. For simplicity we’ll use a CSV format file - which actually isn’t that uncommon, several of the big carriers we dealt with used Excel to model their networks!
If you imagine the following network:
领英推荐
It might be represented like this:
LinkId,Start,End,Capacity,Weight
1,A,B,10,5
2,B,C,10,5
3,C,D,10,5
4,D,E,10,5
5,E,F,10,5
6,G,H,10,5
7,H,A,10,5
8,A,I,10,5
9,B,I,10,1
10,C,G,10,5
11,D,F,10,1
12,I,G,10,5
13,F,G,10,3
For simplicity, assume each link is bi-directional with symmetrical capacity.
If you’re building a GUI you might like to add an x and y coordinate so you can render it onscreen.
Either way build the code to read a CSV like this and model it in a suitable data structure. As always I encourage you to use TDD when developing this functionality.
Continued...
You can find Step 2 and beyond on the Coding Challenges website as build your own Network Modelling Tool.
Or if you'd rather get the whole challenge delivered to you inbox every week, you can subscribe on the Coding Challenges Substack.
2 other ways I can help you:
???? Full Stack Engineer (Frontend Heavy) @ Meta | ?? React | ????? Python | Career Coach | ?? Blogger | Ex-Yahoo, Visa, PayPal, Target, Proximus
9 个月Well said John
??Unpacking Software Architecture
9 个月Looks like Ubiquiti hardware sitting on a shelf in a wall mounted rack. Yours John Crickett?
??Unpacking Software Architecture
9 个月Nice one. I did something similar recently by building a Directed Acyclic Graph and used PyGraphviz to visualize it. I used ChatGPT heavily to write the Graphviz parts since I’m not that familiar with the syntax ??. I colored different edges and nodes based on activity hotspots. Maybe I could build off of that to complete this challenge ??