# Blockchain-Assisted QoS-Aware Routing for Software-Defined Wide Area Network
## 4 Blockchain-Assisted Trading  
In this section, each directly and indirectly involved SDN provider in SD-WAN is termed as an \"ISP\". The ISPs act as an intermediary (by providing the required network support) to ensure the QoS requirements of cloud users for the services provided by the cloud providers. To ensure the QoS-aware routing, the ISPs need to handle an additional workload, leading to increased expenses in maintaining the network infrastructure. So,the ISPs are monetarily incentivized to maintain QoS-aware routing for the QoS-aware traffic flows of specific cloud users. The SDN framework for QoS support presented by [29] can be extended with a new \"financial\" sub-module within the management plane (in Figure 2). This sub-module (included in the architecture) can interact with other sub-modules and also with the related smart contract to update the workload (associated with handling the QoS aspects of a user). Such an automated interaction with the smart contract can benefit the ISP by obtaining financial benefits for the provided QoS-aware network support. The proposed high-level architecture in this article considers a smart contract to facilitate the trade between the cloud provider, the cloud user, and ISPs. The smart contract enforces predefined and agreed-upon conditions (related to service quality, delivery confirmation, deadlines, etc.) for the transaction with support for automatic payment withholding for dispute resolution, and helps the ISPs to initiate the timely execution of any financial transaction. The smart contract integrates a number of useful services: identity services, trading services, payment services, QoS management services, and distributed ledger services. The QoS management service is assumed to be run in any trusted premises, while other services (e.g., the payment-related services, etc.) are assumed to be executed directly through a smart contract. At the beginning, all the participating entities, i.e., cloud user, cloud provider, and ISP, register with the identity service in the smart contract (shown as Q1, Q2, and Q3 in Figure 3). The cloud user places a request to obtain the necessary cloud service (R1). The trading service is actually offered by the smart contract to allow the cloud user to purchase required services from the cloud provider (R2) and update the ISPs accordingly (R3). At the end of each trade, the smart contract provides necessary secured financial transactions between the cloud user and the cloud provider (T1, T2). The QoS management service communicates with the ISPs (in a path) to inform them about the QoS specification required between the cloud user and the cloud provider, and at the end, pays ISPs for their support service (T3) through a smart contract. Finally, the smart contract uses distributed ledger services to record financial transactions on the blockchain. Figure 2: SDNframework for QoS support [29]. The proposed architecture allows cloud users to communicate with the cloud provider by ensuring QoS and this requires the ISPs to specially consider the network flows between the cloud user and the cloud provider. Each ISP also needs to use the proposed QoS-aware route selection algorithm to find the best-suited network path satisfying the cloud user's preferences. For example, a cloud user may have various preferences regarding the quality of services, e.g., latency, throughput, etc., in communicating with the cloud provider. Among those preferences, some choices may be more critical to the cloud user as they highly depend on the type of application, whereas others may carry less importance. Each ISP in the communication path can find the best route that matches the best with the given preference values and the relative preference weights (i.e., critical measurement of choices) and obtain a financial benefit accordingly. The smart contract includes trading support services that begin with building a list of potential cloud providers or sellers (as shown in Algorithm 3).