Adaptive Methods for Revenue Model learning of a Slice Broker in the Presence of Adversaries

In the Fifth Generation (5G) of mobile networks, Multi-Access Edge Computing (MEC) refers to the deployment of computing resources closer to the end-users for improved service delivery. In the context of 5G MEC, the slice broker plays a crucial role in managing the allocation of resources among the diﬀerent network slices, which are logical networks on top of a shared infrastructure. The slice broker is a business entity that acts as an intermediary between the slice tenants and the infrastructure provider and is responsible for allocating resources (such as CPU, memory, and network bandwidth) required to set up the network. The slice broker must ensure that resources are allocated in a way that the revenue is maximized. In a dynamic environment, the slice broker must learn the revenue model adaptively and online. Adversaries can signiﬁcantly reduce the revenue by misleading the sys-tem about the resources pretending to be selﬁsh nodes, or creating noise. The slice broker should learn the revenue model in the presence of adversaries. We apply cooperative deep reinforcement learning with consensus mechanism and consensus deep learning to learn the revenue model adaptively. We also compare our proposed methods with the reference solution. Simulation results show that our proposed methods, especially the cooperative version, outperform the reference solution.


Introduction
In the Fifth Generation (5G) of mobile networks, Multi-Access Edge Computing (MEC) is a technology that enables the deployment of computing resources closer to the end-users, thereby improving the quality of service and user experience [1].In the supply chain of 5G MEC, the three main components are the slice tenants, Infrastructure Providers (InPs), and the slice broker.InPs provide the physical infrastructure needed to support the MEC services, such as servers, network equipment, and storage devices.The slice tenants are users or organizations requesting different MEC services.The slice broker is instead a new business entity that buys the resources from InPs and creates and manages the slices, which are bought by the slice tenants.Slice brokers need to consider the economic aspects for dynamic resource allocation.One crucial aspect of this resource allocation is considering the economic aspects [2].To learn the proper revenue model, it is necessary to dynamically allocate computing, storage, and network resources to different network slices to ensure efficient utilization of available resources and high-quality service delivery.However, in the learning process, adversaries such as selfish nodes and malicious users can threaten the system's security and efficiency [3].Selfish nodes may try to exploit the system by consuming more resources than necessary, leading to inefficient resource utilization and degradation of the system's overall performance.On the other hand, malicious users may add noise to the system, causing interference and affecting the quality of service.So, we need a dynamic method that can adaptively learn about the revenue model in the presence of adversaries and noises.
In [4], the authors propose a heuristic approach to minimize the cost of the slice brokers in 5G MEC.They address the slice allocation problem.However, their method is not adaptive.There is no dynamic demand/request and no revenue model learning.In [5], the authors propose a novel framework for profit-driven network slicing and resource allocation in MEC systems.The proposed framework enables service providers to slice the network and allocate resources based on the profit generated by different services.However, their method is not adaptive, they do not have dynamic requests, and they do not learn the revenue model adaptively.
Security is a significant concern to consider for resource allocation.In recent years, some works have been based on resource allocation, considering security concerns.In [6], the authors propose a secure slice allocation in 5G.They consider device authentication using a password-based essential derivation function.In addition, they consider the massive traffic in their scenario.They propose a distributed Reinforcement Learning (RL) based method for Distributed Denial-of-Service (DDoS) attackers.However, their proposed method do not consider the revenue model learning adaptively.In [7], the authors propose a cooperative reinforcement learning method for revenue model learning for a slice broker in the 5G-MEC system in the presence of adversaries.This paper extends the work [7] by proposing another adaptive method and perform evaluation with the existing one and also with the reference solution.
In summary, the contributions of our paper are as follows: • We consider a dynamic demand model based on the set prices by the agents.
Demand varies based on the price.With the increment of the price, the demand decreases and vice versa.• We consider two types of security issues: selfish nodes and added noises for resource allocation for slices.We also learn the revenue model considering these adversaries.• We consider the consensus mechanism for adaptively learning the security threats for revenue model learning.We apply two variants of deep learning mechanisms with consensus.One with the cooperation among agents and another one to send information to the server and the server collaborates with the agents.• We compare our proposed methods with the reference solution.
The paper is structured as follows.Section II provides some related works.Section III describes the problem of maximizing revenue in the presence of adversaries.Section IV introduces the proposed method to solve the presented problem.Section V presents the results of comparing the proposed method with reference methods.Finally, Section VI concludes the paper.

Related Works
Some current research works focus on resource allocation for slice brokers in 5G considering the profit level of the broker.Some works also consider adaptive methods, e.g., RL, Deep RL, and Artificial Intelligence (AI) based methods.In [8], the authors propose a distributed slice allocation using the adaptive machine learning method.Their proposed method helps to achieve the requirements for multiple information flows.However, they do not consider learning the revenue model for the broker, and also, there is no consideration of security issues for resource allocation.In [9], the slice allocation mechanism is proposed where dynamic slice admission is gained, and at the same time, the operator's profit is investigated.They apply Lyapunov optimization for the optimization.However, there is no revenue model learning and no consideration of security issues in this work.In [10], the authors propose an auction-based method for radio resource allocation in 5G.However, their proposed method is not adaptive, and also they do not consider the security threats to resource allocation.In [11], the authors propose a method named RL-NSB (RL-based Network Slice Broker), where the slice broker's profit is maximized adaptively by charging customers for the allocated resources while minimizing the cost of providing those resources.However, their proposed method is not learning any revenue model.They also do not consider the security issues for resource allocation.In [12], the authors propose RL and Deep RL for learning the admission policy that optimizes the profit of the slice broker.
In contrast to all these approaches, our proposed methods adaptively learn the revenue model considering security issues like considering some selfish nodes and noisy nodes in the system.To our best knowledge, this is the first work which considers to learn the revenue model adaptively with security attacks.

Problem Description
We consider three business entities, e.g., InPs, a slice broker, and a slice tenant, in the 5G-MEC system.
The assumption is that each InP has one MEC host (MEH).The problem can be generalized to multiple MEHs belonging to the same InP.
A MEH is a computing platform with computational resources in the system, e.g., processing power in vCPU.
The business entity slice broker buys the computational resources from the InPs, which resells the resources to multiple slice tenants.For the sake of simplicity, we assume only one tenant but the problem and the solution can be generalized to having multiple tenants.
We also assume that the slice broker has already bought an amount of computational resources from each InP.Therefore, in each MEH, the broker has one chunk of computational resources.The set of chunks is denoted as M. For each chunk m ∈ M, the amount of bought computational resources is denoted as µ m .The tenant dynamically requests to the broker an amount of computational resources that we call slice demand and indicate as d t , where t identifies the time interval.
At each time interval t, the broker decides the amount of resources from each chunk, which will be allocated to fill the slice demand.The portion of chunk allocated to the tenant is denoted as subchunk.The subchunk's computational resources from the chunk m ∈ M at the time interval t is denoted as δ t m .The broker also decides the subchunk price (in €/vCPU), denoted as c t m .In our system, we consider that the broker has one software agent for each chunk m ∈ M helping to decide the amount of computational resources, δ t m , and price, c t m , for the related subchunk at each time interval t. Figure 1 represents the investigated 5G-MEC system for first proposed method and Figure 5 denotes the system for other proposed method.The adversary and noise injections will be explained in the second part of this section.
We use a practical demand model to get the slice demand of the slice tenant, d t .In the real world, demand changes over time and depends not only on the current price but can also be impacted by the magnitude of recent price changes.A price decrease can create a temporary demand increment, wherever a price increase can cause a fall in demand.The impact of price changes can also be asymmetric, so price increases have a much more significant or smaller impact than decreases.
In our case, at every time interval, the slice demand depends on the weighted average price, which is computed from the prices of each subchunk as follows.
Based on the price-demand function in [13], we compute the slice demand for the next time interval t + 1 as follows. where and where p t is the price for the current time interval t and p t−1 is the price for the previous time interval.The first two terms of Eq. ( 2) correspond to a linear demand model with intercepting d 0 and slope k.The second two terms model the response to a price change between two intervals.Coefficients a and b define the sensitivity to positive and negative price changes, respectively, and s is a shock function that can be used to specify a non-linear dependency between the price change and demand.We assume s(•) = √ •.The problem of maximizing the revenue of the slice brokers to serve the slice demand at the time interval t can be formulated by basing on Bertnard model [14]: Where Φ t is the defined revenue function and the objective function of the problem, C1 is the constraint that limits the size of the subchunk to the size of the related chunk, and C2 is the constraint that limits the cumulative size of all subchunks to the slice demand.

Environment
Our proposed method is based on RL.In RL, the agents learn over time intervals by performing a particular action, and it shifts from one state to another.After performing an action, the agents receive a reward for the performed action.The environment of the RL determines the states, actions, and reward function [15].In our case, the states are the slice demand at time t, d t , the size of the subchunks at time interval t − 1, δ t−1 m and all the previous prices of the subchunk m, c τ m ∀τ ∈ [1, t − 1].The actions are the size and the price of the subchunks m at t, δ t m , and c t m , respectively.The reward function denotes the revenue for allocating the subchunk m at the time interval t.
Fig. 2 5G-MEC System with the Adversaries

Presence of Adversarial Agents
According to the European Network and Information Security Agency (ENISA) 5G threat landscape [16], one of the potential threats related to 5G MEC is the compromised supply chain (i.e., vendor and service providers).Since the tampering of network products (creating adversaries and added noises) can result in service unavailability, information destruction, or misinformation generation.For example, in Figure 2, the attacker compromises the software agents SA1 and SA2, making them selfish or uncooperative.In this case, SA1 and SA2 will try to maximize their reward without cooperation, eventually causing less revenue for the broker.Let M + and M − denote the set of cooperative agents and adversaries, respectively, where M = M + ∪ M − .Since we have assumed that there is one agent per chunk (and subchunk), we use M to interchangeably indicate the set of agents or the set of chunks.
The objective of agents m ∈ M + is to maximize a team-average objective function given as follows.
where τ is the time under investigation, γ m is a discounted factor, has a value between 0 and 1, and indicates how much the RL agents care about rewards in the distant future concerning those in the immediate future.
The cooperative agents are unaware of the presence of an adversarial agent that seeks to maximize a different objective function.We define the objective function for m ∈ M − as follows.
It is important to note that the adversarial agent can compromise the rewards r τ m , m ∈ M − , to incentivize its malicious behavior [17].Furthermore, once the agents establish communication, the adversary can spread false information about the entire network's performance embedded in the compromised rewards r τ m .This may eventually lead to incentivizing bad behavior in the cooperative agents.

Presence of Noisy Agents
An attacker may try injecting noise into any component, e.g., a software agent, to compromise the system.For example, in Figure 3, the attacker compromises the software agent SA1 and SA2.Noise may hamper the cooperation among agents in a way that the broker may have an idea that it has enough resources to allocate or sometimes get the knowledge of not allocating the resources, which is harmful to the revenue-making of a broker.We consider a few agents with noise.Here, we consider Additive White Gaussian Noise (AWGN).The noise can be normally distributed as follows: Article Title where A m is the magnitude of the noise.
4 Proposed Methods

Deep Learning with Consensus Mechanism
We propose a resource allocation method based on a generic Deep Q Network (DQN) algorithm [18] to learn the revenue model.We use the original DQN as it is simple considering other variants of the learning mechanism.We could not apply classical RL, e.g., Q-learning, State-Action-Reward-State-Action (SARSA) learning, as our states are continuous.A learning mechanism like Actor-Critic learning is not applied for its complexities.RL considers the setup where an agent interacts with the environment in discrete time intervals to learn a reward-maximizing behavior policy.At each time interval t, with a given state s, the agent takes action a according to its policy π(s) → a and receives the reward r moving to the next state s ′ .We define our environment considering the RL terms as follows.
The goal of the algorithm is to learn an action policy π that maximizes the total discounted cumulative reward/return earned during the episode of T time intervals: 9 Such a policy can be defined if we know a function that estimates the expected return based on the current state and next action, under the assumption that all subsequent actions will also be taken according to the policy: (10) Assuming that this function (known as the Q-function) is known, the policy can be straightforwardly defined as follows to maximize the return: We can combine the above definitions based on the Bellman equation as follows: where s ′ and a ′ are the next state and the action taken in that state, respectively.If we estimate the Q-function using an approximator, then the quality of the approximation can be measured using the difference as follows: This value is called the temporal difference error, the loss function.
Algorithm 1 shows the step-by-step procedure about how the system works and training has been done.Consensus Procedure: An agent i communicates the Q-value to all its neighbors j ∈ M G m .M G m denotes the set of neighbors of agent m.All agents update their Q-values through a linear combination of their own values and the information of neighbors received in the previous step.The procedure can be written as: So, in other words, each agent updates its state by using the disagreement of states with all its neighbors, scaled by a factor of Γ.Thus the convergence rate of this algorithm depends on the scaling factor used.Convergence is guaranteed as long as the following constraint is met [19]: where d max denotes the maximum degree among all nodes in the network.The constraint can be fulfilled by realizing an upper bound on the maximum possible neighbors for any node.Choose the action based on Q φ (s t , a t ) 10: Execute the action and save transition (s t , a t , r t , s ′ t ) in the buffer 11: Calculate the Q-value 12: Consensus Step: 13: Send the Q-value to the neighbors 14: Update the Q-value of agent m as follows considering the neighbor's impact:

17:
Calculate target Q-values for each sample in the batch: where Q(s, a) = 0 for last states of the episodes (initial condition)

20:
Calculate the loss: Update the network's parameters: if t mod t u = 0 then 25: Update the target network: 26: ϕ targ ← ϕ 27: end if 28: end for

Consensus Deep Learning
We apply another variant of consensus deep learning.Our variant is based on Deep Q learning.Consensus deep learning is one kind of RL where Q values of multiple agents are combined to reach an optimal action in a given state [20].This method is helpful in case of requirements where each agent will work independently and collaborate to reach a particular decision.In traditional Q learning, the agents learn about the action by calculating the Q values of the state-action pair by trial and error.However, to reach any sub-optimal solution, the agents need to collaborate, and at this point, a consensus is needed.For reaching a consensus, cooperation among the agents is important.For this cooperation, one possible option is cooperation among the neighboring agents, which needs lots of communication efforts and proper synchronization.The other option is to collaborate with a server in the learning mechanism.
The server plays a critical role in deep consensus learning by enabling the networks to share their weights, and aggregate their updates, ultimately leading to improved performance and better generalization.Overall, the use of a server is important for achieving consensus and is a powerful tool for training complex and highly accurate models [21].Choose action based on the epsilon-greedy policy 12: Execute the action and save transition (s t , a t , r t , s ′ t ) in the buffer

13:
Sample a minibatch of B transitions from Replay buffer, R Compute Q-targets: For each transition (s t , a t , r t , s ′ t ) in minibatch, set target = r + γ m • maxQ j (s ′ , a ′ ) where j! = i 16: For each transition (s t , a t , r t , s ′ t ) not in minibatch, set target = Q(s t , a t )

17:
Update the i-th Q-network using the mean-squared error loss between Q i (s t , a t ) and its target 18: Compute the gradients of the loss with respect to the Q i network's weights

19:
Update the weights by using the learning rate α and the gradients Compute the consensus Q-value for each state-action pair (s t , a t ) by averaging all collected Q-values from all |M| Q-networks: Update each Q-network by using the mean-squared error loss between Q i (s t , a t ) and Q consensus (s t , a t )

24:
Compute the gradients of the loss with respect to the i-th Qnetwork's weights

25:
Update the weights by using the learning rate α and the gradient Here, in this proposed method, all software agents send the Q-values to another software agent/server in the broker to calculate the consensus of the mechanism.There is no neighboring factor and cooperation among agents for this algorithm.Figure 5 shows the considered 5G-MEC system for deep consensus learning.The agents send the gradients of loss to the server.Server sends the updated weights to the agents.Instead of having cooperation among themselves like the other method, here agents send information to the server and server also update the agents with weights.
Algorithm 2 defines the proposed method step-by-step.
Here action selection is done based on the epsilon-greedy policy.The epsilon-greedy policy is one kind of mechanism to balance exploration and exploitation.Exploration means to try an action randomly, whereas exploitation means to exploit based on the learning algorithm.Here, epsilon, ϵ means to try an action randomly.
Action at time t = max Q t (a) with probability 1 − ϵ Any action a(t) with probability ϵ We need to sample a minibatch from the Replay buffer.For each transition, if it is in minibatch, set the Q values as We set the Q target as Q(s t , a t ).Then the loss function is calculated as the Equation 13.
Consensus Steps: The server in slice broker collects all the Q values of the agents at each time interval and calculates the consensus Q value.The consensus Q values can be calculated as follows: Agents are informed about the Q consensus (t + 1).After that, the gradients of loss is calculated.Agents send the gradients to the server and then the server calculates the weights using the learning rate and the gradients are as follows: Where α is the learning rate.g t is the gradients calculated at time interval t.
Back propagation is used to train the neural network in the learning algorithm for making it more efficient.So, the selection of amount of resources, the calculated revenues, gradients will be in a way that the proper weight will be adjusted and the loss will be minimized [22].

Results and Discussion
We consider four software agents.The software agents are connected in cooperative deep learning with consensus mechanism.In consensus deep learning, these software agents communicate with another software agent/server.First, we consider revenue model learning without any adversaries.After that, we consider two software nodes as adversary nodes among the four agents, trying to maximize their revenue.Then we consider two noisy nodes that put noises to provide misinformation about the resources that hampers the learning mechanism.Table 1 shows the simulation parameters that we consider.Here, the values are considered based on the empirical study.
We apply a deep learning mechanism where we consider 150 hidden nodes with three layers where 50 nodes are considered per layer.We consider Adaptive Moment Estimation (Adam) algorithm to optimize the Neural Network (NN) weights.We use the Rectified Linear Unit (ReLU) as an activation function to activate a particular input.
Figure 5 refers to the revenue over time intervals.We can observe that the cooperative deep learning with a consensus mechanism outperforms the other methods.Here we can see that initially, there is a rise, and then saturation comes over the time intervals.We can see there are some variations here for exploration and exploitation.We can observe that in consensus deep learning, where there is no cooperation and huge fluctuations over time intervals.This is for the exploration, exploitation variations, and training time requirements.We can find saturation here, but this method does not outperform cooperative deep learning with a consensus mechanism.For the independent Q learning, we can see the revenue is quite low compared with our proposed methods.This can happen for independent learning as some selfish nodes can maximize their own revenue and get a lower overall revenue.6 shows the revenue over time intervals comparing with our learning methods and without learning adversaries.Here, there are selfish nodes in the simulation.We can observe that in our cooperative deep learning method, there is an increment at first, then decrements, and finally, it goes for saturation after 4000 intervals.The massive decrement happens due to the selfish nodes.When our consensus steps help us learn about the adversaries, we can Article Title see that learning converges to a level.We can see that the cooperative method outperforms the other method and obviously without learning adversaries.Learning adversaries with cooperative deep learning provides increment at first and then goes down, provides lower performances compared with the cooperative one, and finally reaches the cooperative one after having an increment.This increment collects the Q values to a particular agent and then collaboration for learning.On the other hand, without learning adversaries, the revenue goes very low over time intervals.The cooperative one for dealing with the noises outperforms the consensus deep learning and the reference solution.We can observe that for noises, the revenue goes up and then massive decrement at the 3000-time interval and again increment after the consensus has been reached then, and adequate convergence happens.Whereas, the consensus deep learning starts with the higher revenue and then again goes down after the 3000 time intervals.So, dealing with the noises cooperation is helping rather than the consensus deep learning.The overall fluctuations at every time interval are due to the exploration and exploitation and also for training periods.The decrement in the consensus deep learning at the later time intervals is because, in server-based consensus, there may be the presence of some gradients that further mislead the system, and the revenue may go down.Without learning the noises means, without the consensus steps, the learning algorithm provides the lowest performance in terms of revenue.
We can observe that for both types of adversaries, our proposed cooperative deep learning with consensus outperforms consensus deep learning and deep Q learning.We can find that without adversaries, the revenue is more compared with the revenue with adversaries.Furthermore, the revenue with selfish nodes is higher than with noisy nodes.

Conclusion
The slice broker plays a vital role as a business entity for the supply chain of 5G MEC.We propose two methods based on a consensus mechanism to adaptively learn a slice broker's revenue model.One method is cooperative, whereas the other sends information to another agent for consensus.The cooperative one outperforms the other variant and the reference solution.Our proposed method can track the adversaries through revenue model learning and get suitable results.
In the future, we plan to consider the faults in the system for learning the revenue model.Data Availability.There is no dataset available for this project.

Fig. 1
Fig. 1 5G-MEC System under Consideration for Deep Learning with Consensus Mechanism

Algorithm 2 1 :
Proposed Method based on Deep Consensus Q Learning Parameters and Initialization: 2: E -Environment 3: A -Set of Possible Actions 4: γ m -Discount Factor 5: α -Learning Rate 6: N -Number of Consensus Iterations 7: B -Batch Size 8: T -Maximum Number of Episodes 9: for t = 1 to T do 10:for i= 1 to B do 11:

20 :
for n=1 to N do 21: 29: end for Article Title

Fig. 4
Fig. 4 5G-MEC System for Consensus Deep Learning with Adversaries and Noises.

Fig. 5
Fig. 5 Revenue over Time Interval with and without Learning Adversaries

Fig. 6
Fig. 6 Revenue over Time Interval with and without Learning Adversaries

Figure
Figure6shows the revenue over time intervals comparing with our learning methods and without learning adversaries.Here, there are selfish nodes in the simulation.We can observe that in our cooperative deep learning method, there is an increment at first, then decrements, and finally, it goes for saturation after 4000 intervals.The massive decrement happens due to the selfish nodes.When our consensus steps help us learn about the adversaries, we can

Fig. 7
Fig. 7 Revenue over Time Interval with and without Learning Noises

Figure 7
Figure 7 refers to the revenue over time intervals after adding noisy nodes.The cooperative one for dealing with the noises outperforms the consensus deep learning and the reference solution.We can observe that for noises, the revenue goes up and then massive decrement at the 3000-time interval and again increment after the consensus has been reached then, and adequate convergence happens.Whereas, the consensus deep learning starts with the higher revenue and then again goes down after the 3000 time intervals.So, dealing with the noises cooperation is helping rather than the consensus deep learning.The overall fluctuations at every time interval are due to the exploration and exploitation and also for training periods.The decrement in the consensus deep learning at the later time intervals is because, in server-based consensus, there may be the presence of some gradients that further mislead the system, and the revenue may go down.Without learning the noises means, without the consensus steps, the learning algorithm provides the lowest performance in terms of revenue.We can observe that for both types of adversaries, our proposed cooperative deep learning with consensus outperforms consensus deep learning and deep Q Article Title Algorithm 1 Proposed Method based on Deep Q Learning 1: Parameters and Initialization: 2: ϕ -Parameters of the policy network Q φ 3: ϕ targ -Parameters of the target network Q φtarg 4: α -Learning rate 5: B -Batch size 6: t u -Period of target updates 7: Initialization: ϕ targ = ϕ 8: for t = 1 to T do

Table 1
Simulation parameters and their values.