The Model View Controller Architecture for Network Element Software
Usually when network element software is developed most of the initial work is focused on the data path. This is natural since there are performance issues, new hardware or new protocols to deal with and we want to prove that the data path works as early in the project as possible. We usually develop some simple command line functions to set up critical parameters for testing during this phase of development.
Once the basic operation of the network element is proven we start looking at the management functions. The command line interface developed in the first phase is enhanced to meet the needs of an end user. Then we may layer an SNMP agent and a web interface on top of the data path. This usually leads to an architecture similar to the one shown below:

There are several problems with this approach. First, there is usually duplicate code for each user interface. More code means more bugs, more debugging time, and less reliability. Second, the functions provided by the different user interfaces don’t always quite match up. Similar functions on the command line interface and the web interface for example do slightly different things, confusing the end user. Finally this architecture is difficult to maintain. The user interface often requires more feature changes and enhancements than any other part of a software system. Every time we need to add a new user interface function we have to modify the user interfaces and each of the data path components that are affected. This means more room for bugs to creep into the system. If you want to see a good example, look at how difficult it is to configure any out of the ordinary networking options on Linux or any other flavor of Unix.
A better approach is to plan the architecture of the entire system early in the development. The Model-View-Controller architecture is ideal for this type of application. The Model-View-Controller architecture is often used by our colleagues in the web application business. The Model-View-Controller architecture applied to a network element software application is shown below:

The critical point is that the model and controller provide an abstraction of the management functions of the data path. This allows the various views to see a single consistent interface. When a new user interface feature is required the data path is only modified once. The model and controller are simple to modify since they really just provide a façade (see the Gang of Four Design Patterns Book). Then the modifications to the various views are also quite simple since only user interface code needs to be modified. The views, i.e. the SNMP agent, Command Line Interface, and Web Interface can even be re-usable software components designed to interact with a predefined model-controller interface. Again, the less software you have to write, the fewer bugs and the better the quality of the product. And let’s not forget, quality products put more money in the bank.







