## 2 Mechanism Description
### Mechanism Components  
The system consists of two components: the Measurement Component (MC) and the Label Allocator Component (LAC). Both components are part of the SDN controller, which controls the switches by assigning MPLS labels (Figure 1). The control plane uses the standard set of functions offered by SDN. The action list form uses switches that support the OpenFlow protocol [9]. Using this protocol, MPLS label switching rules are propagated. MPLS labels represent aggregated flows. The basic functionality of the mechanism is multipath transmission. New paths bypassing overloaded links are determined using a link-state routing protocol (e.g., OSPF). The SDN controller stores a copy of the link state database (_vLSDB--virtual Link State Database_), which reflects the original database used by the routing protocol (_LSDB--Link State Database_). During its operation, the mechanism modifies vLSDB, while not changing the LSDB database.  
The mechanism forwards flows based on MPLS labels. Provider Edge switches (PE) are the source and destination of traffic and at the same time define the boundary of the network using the presented mechanism. Provider switches (P) only mediate in flow forwarding. The labels used are sent by the controller to the switches. The basis of the mechanism is the creation of a relationship between the destination network address and the appropriate label. Labels are global; i.e., all nodes in the network use the same label to deliver traffic to a given end node (PE). Labels are propagated to individual switches according to the tree built by the routing protocol. A new label associated with a given destination node is assigned after recalculation of the reversed Dijkstra algorithm [8], while existing flows are still served by previously assigned labels associated with the same end node. All new flows use the new label, which allows for the stability of already active flows (without changing their routes).  
The Measurement Component is responsible for periodically reading the counters on the individual interfaces of the switches. Based on these data, MC calculates the utilization of individual links. If the pre-set utilization threshold is exceeded, the weight of the link in vLSDB is changed. The version of the mechanism described in [8] uses two threshold values (_WarnTh_ and _CongTh_) and the three corresponding weights (NORM, WARN, CONG), associated with exceeding the individual thresholds. In the previous version of the proposed mechanism, these weights remained constant. However, in this article we introduce a modification in which the weights are not predetermined. Instead, they can vary according to the utilization of the link.  
The Label Allocator Component is responsible for constructing and maintaining _vLSDB_. If even one weight has been changed by MC, then LAC starts recalculation of the paths using the reverse Dijkstra algorithm. Then, a new set of labels is allocated. In each new set, the rule applies that there is one label for each PE node in the entire network.  
The flow forwarding and updating mechanisms depend on the type of switch (PE or P). PE nodes employ a flow-based forwarding approach. The definition of flows typically involves a 5-tuple, encompassing source and destination addresses/ports with the Layer 4 protocol.  
In accordance with the OpenFlow specification, we propose employing two flow tables within each PE node, namely _coarse flow table_ (CFT) and _detailed flow table_ (DFT). CFT  
Figure 1: Flowchart of the proposed mechanism.  
stores mappings between destination networks and pairs (output MPLS label, output interface). DFT captures information on active flows (5-tuple). The match fields for the rules in the DFT vary from those in the CFT.