# QoS Management and Flexible Traffic Detection Architecture for 5G Mobile Networks
## 3 Proposed Architecture
### OF-NB Logic and Traffic Detection  
The proposed logic at the OF-NBs is described for the uplink direction. The proposed traffic detection logic is thought to replace elements of the 3 GPP mobile architecture as AF and the Traffic Detection Function (TDF) in a flexible and programmable way and to move the traffic analysis and the billing counters closer to UEs. Moving the control functionalities closer to UE is one of the requirement to achieve the 5G objectives [36; 37]. All OF-NB have preconfigured all traffic detection tables, and during the attachment process, each UE is linked with one of the traffic detection tables corresponding to its user profile. The user profile can be obtained during the attachment procedure by querying an appropriate database, or using a non-standard QoS Class Identifier (QCI) value from the HSS, or querying a new 5G database. Figure 4 shows the different OpenFlow tables that compose the uplink forwarding logic or OF-NB; it illustrates M traffic detection tables for M different users profiles, and only the traffic detection table corresponding to user profile Y is detailed. As is depicted in Figure 4, the UE x is associated with the user profile Y, which is linked using the default flow entry to UE x. In Figure 4, the proposed Table 0, implemented in OF-NB, consists of three types of flow entries:  
* Specific service flow entries: This is used to forward traffic with specific QoS requirements from a UE through a specific OF-Bearer with QoS created on demand. * Default flow entries to UE: Each attached UE has its own default flow entry, and it is used as the default route for all traffic originated in the UE. This flow entry is created during the attachment procedure, and it is responsible for linking the default radio bearer with the default OF-Bearer (creating the default EPS-Bearer for the attached UE). Additionally, this flow entry is responsible for linking the UE traffic with the traffic detection table corresponding to its user profile. * General default flow entry: This is responsible for dropping the traffic from an invalid source mobile IP address. Prior to the UE x attachment, the OF-NB has neither a specific service flow entry, nor a default flow entry to UE x. During the specific UE x attachment procedure, the default flow entry to UE x is created. The matching file used by the default flow entries to UE x is based on the source IPv4, the source IPv6 prefix, or the default Radio Bearer, which univocally identifies the UE originator. The default flow entry to UE x links the default radio Bearer with the default OF-Bearer to create the  
Figure 4: Traffic detection logic at OF-NB. default EPS-Bearer for the UE x. If traffic from UE x does not match with specific service flow entries, it is routed by the default flow entry to UE. The proposed logic at OF-NB is detailed in Figure 4, and its flow diagram is described in Figure 5. When the uplink traffic matches with a default flow entry to UE x, the traffic is sent by two simultaneous pipeline processes, one proactively (indicated as one) to route a packet copy immediately as traffic without QoS requirements (using the default OF-Bearer), and the other (indicated as 2) sends the packets to traffic detection table to user profile Y. Next, the implementation of both pipeline processes is explained. 1. The default flow entry to UE x has an instruction of apply-action and, within it, two Push-MPLS actions responsible for univocally identifying the default EPS-Bearer used to send the traffic. The inner MPLS label identifies the UE/default Radio Bearer, and the outer label identifies the default OF-Bearer. Additionally, the instruction of apply-action type has the output-action to the appropriate output port, which sends a copy of the packet to the default OF-Bearer (standard behavior of the apply-action instruction as is specified in [19]). 2. Simultaneously, the default flow entry to UE x has goto tableinstructions, which sends the packet to the traffic detection table for user profile Y.