Showing posts with label software architecture. Show all posts
Showing posts with label software architecture. Show all posts

Tuesday, February 2, 2016

NetworkManager architecture

After figuring out how VPN establishment works in NetworkManager the next big question is about the architecture of NetworkManager and its run-time behavior. This post tries to provide answer to the given question. This post consists of two parts. The first part, Source code organization, gives information about the source tree organization of NetworkManager. The second part, Run-time initialization behavior has a goal to describe initialization of NetworkManager and its key parts. Note that I'll update this post as I learn about NetworkManager.

The last update time of this post was: February 2nd, 2016.

Source code organization

So, let us start with a source tree organization. If you take a look at the top level directory of the NetworkManager git tree, you'll find there some files and the set of directories. The files are build scripts and configuration files, there are also some documentation files. But, in the end all the interesting functionality is placed within the top level directories. There are the following top level directories:
  • callouts

    TBD
     
  • clients

    Clients to control NM like nmcli or nmtui.
     
  • introspection

    contains XML description of DBus interfaces provided by NetworkManager and its components. For example, VPN plugins are external to NetworkManager but they use DBus to communicate with NetworkManager and there is an XML file that describes VPN plugin's interfaces. All the descriptions are converted into C code stubs and skeletons using dbus-binding-tool. There is a lot of magic staff happening here.
     
  • libnm

    Libraries intended to be used by clients accessing and using services provided by NetworkManager. This also includes application that control NetworkManager itself (like nmcli and nmtui)
     
  • libnm-core

    Core NM libraries used by NetworkManager itself and all the other components, like command line utilities.
     
  • libnm-gliblibnm-util

    Old NM libraries that are deprecated starting with 1.0 release of NetworkManager. Still, it seems that at least some functionality is used from those libraries so probably until all the pieces of NetworkManager are converted to the new libraries they are to stay. Note that in my posts I ignore the content of those libraries as much as possible and I concentrate on the previous two libraries, libnm and libnm-core.
     
  • src

    The directory with the code specific to the NetworkManager unlike the previous directories that contain code used by different programs. The src/ directory contains file and  a number of subdirectories:
     
    • devices/

      Classes and sub classes used to represent different networking devices, real and virtual, that can be managed by NetworkManager.
       
    • dhcp-manager/

      Manager class that manages and interfaces DHCP clients to NetworkManager.
       
    • dns-manager/


       
    • dnsmasq-manager/


       
    • platform/

      Platform specific code that interfaces NetworkManager to particular operating system it is running on. For the moment there is a base class and derived Linux specific class.
       
    • ppp-manager/


       
    • rdisc/

      Code to monitor and parse IPv6 router advertisement messages.
       
    • settings/

      Code to keep track of connections. Since connections are read from configuration files that depend on particular distributions this directory also contains plugins, one plugin for each supported distribution.
       
    • supplicant-manager/


       
    • systemd/


       
    • vpn-manager/

      VPN specific code. Here is a manager class that is used to manage all the VPN connections and also class that is used to represent each active VPN connection.
       


Run-time initialization behavior


When NM is started execution starts from main() function that can be found in src/main.c. The goal of the main function is to parse command line options, check some prerequisites for running NM, do initialization steps and start glib main loop. The most interesting are initialization steps which are:
  • Initialize logging.
     
  • Create configuration object singleton, NM_TYPE_CONFIG (defined in file src/nm-config.c).
     
  • Creates a singleton for managing DBus connections and communication, NM_TYPE_BUS_MANAGER (defined in file src/nm-bus-manager.c).
     
  • Creates a singleton that is platform dependent used for management of network subsystem, NM_TYPE_LINUX_PLATFORM (defined in file src/platform/nm-linux-platform.c).
     
  • Creates a main singleton object of class NM_TYPE_MANAGER (defined in file src/nm-manager.c).
     
  • Initializes loopback interface.
So, while NetworkManager is running it basically consists of a set of singleton objects that communicate and make what is named NetworkManager.

References




Thursday, November 24, 2011

Prijevod riječi "enterprise"...

In this post I'm discussing the possible translation of a word enterprise to Croatian. There is no adequate translation (as far as I know) and I'm suggesting that word enterprise actually means large business system so I'm starting with that  premise.
Riječ enterprise puno se koristi u Engleskom jeziku i dosta često vidim kako ljudi kada pišu tekst na Hrvatskom koriste tu riječ bez prijevoda, što baš i nije prihvatljivo - bar meni. Razlog za to je jednostavan, nema standardiziranog, niti opće prihvaćenog prijevoda. Dakle, moji prijedlozi za prijevod te riječi su:
  • veliki poslovni sustav
  • veliki sustav
  • poslovni sustav
Razlog za te varijacije je sljedeći. Prvo sigurno se radi o nekakvom sustavu i to najčešće vezano uz nekakav poslovni sustav (što nije uvijek slučaj kako ću malo kasnije pokazati). Nadalje, radi se definitivno o velikom sustavu jer se s tom riječi želi istaknuti nešto što je veće od uobičajnog. Naravno da odgovor na pitanje da li je nešto veliko ili ne, ovisi o mjeri. Primjerice, za Hrvatske uvjete INA je jako velika tvrtka, ali u svjetskim razmjerima (ili Kineskim ;)) radi se o tvrtci koja je bliže srednje veličine.

Dakle, zaključak je, kada se u Engleskom tekstu nalazi riječ enterprise bez dodatnih atributa, radi se o velikom poslovnom sustavu.

Ali, postoje i neke iznimke gornjeg pravila zbog kojega je potrebno imati i alternativne izraze. Za početak, dosta često se sreće pojam SME odnosno Small to/and Medium Enterprises. Dakle, ponekad se želi istaknuti kako se ne radi o najvećim mogućim sustavima već o srednjim ili malima. U tom smislu riječ enterprise ne može se prevoditi kao veliki poslovni sustav već samo kao poslovni sustav, pa onda možemo govoriti o malim i srednjim poslovnim sustavima, ili poslovnim sustavima male do srednje veličine. Naravno, opet je to podložno relativnosti, što sam već pojasnio.

Konačno, u programskom inženjerstvu, odnosno općenito u računarstvu, javlja se i izrazi enterprise software architecture te samo enterprise software. Pod tim izrazima podrazumijeva se programska podrška namjenjenoj upotrebi u velikim poslovnim sustavima, odnosno njena arhitektura, a koja zbog složenosti okoline u kojoj se upotrebljava onda sama po sebi mora biti velika, odnosno složena. Dakle, potencijalni prijevod je arhitektura programske podrške velikim poslovnim sustavima ili arhitektura programske podrške velikih sustava, odnosno, programska podrška velikim (poslovnim) sustavima. Međutim, istina je, ovo su malo nespretni prijevodi no u nedostatku boljeg i ovaj će poslužiti.

About Me

scientist, consultant, security specialist, networking guy, system administrator, philosopher ;)

Blog Archive