Configuration Analyser - nihole/PSEFABRIC GitHub Wiki

module cda

Correction

Python functions:

  • cda.dict_correct
  • cda.default_change

At this level, several tasks are solved (see scripts comments).

But we have one important for creating a new project task here. When we set up PSEFABRIC for a new network infrastructure, we need to keep that in mind.

Structure Element and parameter names used in the PSEFABRIC code are fixed: These are:

  • Structure: str_1, str_2, ..., str_9, vlans
  • Address objects parameters:
    • addr_par_1
    • addr_par_2
    • ...
    • addr_par6
  • Address sets parameters:
    • addrset_par_1
    • addrset_par_2
    • ...
    • addrset_par6
  • Services parameters:
    • svc_par_1
    • svc_par_2
    • ...
    • svc_par6
  • Service sets parameters:
    • svcset_par_1
    • svcset_par_2
    • ...
    • svcset_par6
  • Application parameters:
    • app_par_1
    • app_par_2
    • ...
    • app_par6
  • Application sets parameters:
    • appset_par_
    • appset_par_2
    • ...
    • appset_par6
  • Policies parameters:
    • plc_par_1
    • plc_par_2
    • ...
    • plc_par_6

If we want to use other names in CONFD interface (YANG configuration) then we have to use vocabulary to let PSEFABRIC be aware of it. Based on this vocabulary PSEFABRIC transforms interface names to the predefined ones.

See file p001 vocabulary.py for the examples.

Addition

Python functions:

  • cda.application_full
  • cda.service_full
  • cda.address_full
  • cda.psef_full

The idea is that information related to objects that have some child objects should be completed with the full information associated with these child objects.

Diff

Python functions:

  • DeepDiff from python module deepdiff
  • cda.diff_dict

Creates a python dictionary representing the difference between new and old PSEFABRIC configuration.

Indexing

Python functions:

  • psef_index.policy_index
  • psef_index.address_index

The goal is to create dictionaries suitable for decision making at the demultiplexer level. See Resolving Element concept below.

Resolving Element

This concept is important for the Demultiplexer Layer.

Resolving Element is the key for the decision-making process, on the basis of which PSEFABRIC determines where and which commands should be implemented to the equipment.

Four structure elements are used for the creation of Resolving Element:

(str_1, str_2, str_3, str_4)

The decision on which elements of the structure should participate in Resolving Element is one of the important steps that we must take during PSEFABRIC setup for a new project. For this purpose the vocabulary.str_voc dictionary is used.

In this example structure elements 'dc', 'vrf' and 'zone' will be used for the demultiplexing decision.

str_voc = {}
str_voc['str_1'] = 'dc'
str_voc['str_2'] = 'vrf'
str_voc['str_3'] = 'zone'
str_voc['str_4'] = 'str_4'
str_voc['str_5'] = 'str_5'
str_voc['str_6'] = 'device'
str_voc['str_7'] = 'interface'
str_voc['str_8'] = 'str_8'
str_voc['str_9'] = 'str_9'

Vocabulary

See Layer 1