# Attemping to make a new AUSF Algorithm
## The Current Algorithm

## Attempt at Improving the Algorithm

Changes:
1. The Authentication Server Function (AUSF) incorporates authentication caching to minimize the frequency of communication with the User Data Management (UDM) system.
2. The AUSF incorporates a message queue mechanism to ensure a stable connection, allowing multiple User Equipment (UE) devices to connect without concerns about connection drops.
3. The Access and Mobility Management Function (AMF) is empowered with Authentication Confirmation capability, eliminating the need for AMF to forward responses from the UE to the AUSF.
4. In this optimal scenario, the number of steps is reduced from 10 to 6, streamlining the process.
5. In the event of an authentication caching miss, the request would still need to be forwarded to the User Data Management (UDM) system, resulting in an increase in the number of steps from the current 6 to 8.
Some concerns:
1. The expected cache hit/miss ratio for the implementation on the Authentication Server Function (AUSF) is currently uncertain or unknown.
2. Enabling Authentication Confirmation functionality within the Access and Mobility Management Function (AMF) would diverge from the established 5G architecture, potentially posing compatibility, security, and scalability concerns. The existing architecture aims to maintain independent evolution of various network functions, and combining them may restrict this desired flexibility.