Jimmy
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    [toc] # AUSF improvement 1 * (2024/02/26~) ## Reason ![image](https://hackmd.io/_uploads/SJt-zyy6T.png) ## Method ![image](https://hackmd.io/_uploads/By0XfkyaT.png) ### Full flow of 5g-aka ![image](https://hackmd.io/_uploads/SkUgmxDTp.png) ### Corresponded logs ![image](https://hackmd.io/_uploads/S1LMbJka6.png) ## Analysis (Part 1) ### Corresponded logs of part 1 * Dark place is where I need to skip in call flow. ![image](https://hackmd.io/_uploads/S19PW66nT.png) * [Drawio(clearer version)](https://drive.google.com/file/d/1eejyLflMXjOaQxs9qnIe1W4Nd-nn3B-0/view?usp=drive_link) ![Authenticationo part 1.drawio](https://hackmd.io/_uploads/HJIpd1yTp.png) ### Red framed place ![image](https://hackmd.io/_uploads/Sya1xz1ap.png) :::warning #### Foreword * Here I just find the source file by search the log (Authentication procedure), so I dont know the source of the previous log, who triggers the authentication. * And I started from AuthenticationProcedure, the prvious function who calls it is sm.go, you can chek how it works [here](https://hackmd.io/fH1eBOchRbGLQA3qb202PQ?view#Orange-framed-place) ::: #### Simple process | Seq. | File name | Function name | |:----:|:-------------------------------------------------- |:-------------------------------------------- | | 0 | ![image](https://hackmd.io/_uploads/SkfDwUdTp.png) | func Authentication | | 1 | ![image](https://hackmd.io/_uploads/BklaAxJpT.png) | func AuthenticationProcedure | | 2 | ![image](https://hackmd.io/_uploads/HyDOgBVA6.png) | func SendUEAuthenticationAuthenticateRequest | | 3 | NRF -> routers.go & api_default.go in AUSF | NRF forward & OpenAPI | | 4 | ![image](https://hackmd.io/_uploads/SkAn8byT6.png) | func HandleUeAuthPostRequest | #### Detailed process 1. func AuthenticationProcedure * ![image](https://hackmd.io/_uploads/Hy4c3-kpp.png) * Check the ID of UE. * ![image](https://hackmd.io/_uploads/rkBiuN_pp.png) * **Call(AUSF)** ![image](https://hackmd.io/_uploads/rkSo0whaa.png) * It is wrong, see [here](https://hackmd.io/fH1eBOchRbGLQA3qb202PQ?both#Correction) * This one is true : ![image](https://hackmd.io/_uploads/r1oIRv2Tp.png) * func SendUEAuthenticationAuthenticateRequest * ![image](https://hackmd.io/_uploads/HJf-2O-Ca.png) 2. NRF forward -> OpenAPI * NRF forwarding * OpenAPI * ![image](https://hackmd.io/_uploads/HyQSp-k6a.png) ![image](https://hackmd.io/_uploads/ryjO6WJ6T.png) * ![image](https://hackmd.io/_uploads/H15ca-kap.png) ![image](https://hackmd.io/_uploads/r1L2a-1pa.png) 3. func HandleUeAuthPostRequest * ![image](https://hackmd.io/_uploads/HypzRZypT.png) * **Call (Function)** * ![image](https://hackmd.io/_uploads/BySVAZy6T.png) ### Purple framed place ![image](https://hackmd.io/_uploads/HJNfeGyTp.png) #### Simple process | Seq. | File name | Function name | |:----:|:-------------------------------------------------------------- |:---------------------------------- | | 1 | ![image](https://hackmd.io/_uploads/SkAn8byT6.png) | func HandleUeAuthPostRequest | | 2 | ![image](https://hackmd.io/_uploads/SkAn8byT6.png) | func UeAuthPostRequestProcedure | | 3 | NRF -> routers.go & api_generate_auth_data.go in UDM | NRF forward & OpenAPI | | 4 | ![image](https://hackmd.io/_uploads/By1Y2YH6p.png) | func HandleGenerateAuthDataRequest | | 5 | ![image](https://hackmd.io/_uploads/By1Y2YH6p.png) | func GenerateAuthDataProcedure | | 6 | NRF -> routers.go & api_authentication_data_document.go in UDM | NRF forward & OpenAPI | | 7 | ![image](https://hackmd.io/_uploads/rkVqxjSTp.png) | func HandleQueryAuthSubsData | | 8 | **Return (5)** | **Return (5)** | | 9 | NRF -> routers.go & api_authentication_data_document.go in UDM | NRF forward & OpenAPI | | 10 | ![image](https://hackmd.io/_uploads/rkVqxjSTp.png) | func HandleModifyAuthentication | | 11 | **Return (8)** | **Return (8)** | | 12 | **Return (2)** | **Return (2)** | | 13 | **Return (1)** | **Return (1)** | #### Detailed process 1. func HandleUeAuthPostRequest * ![image](https://hackmd.io/_uploads/HypzRZypT.png) * **Call (Function)** * ![image](https://hackmd.io/_uploads/BySVAZy6T.png) 2. func UeAuthPostRequestProcedure * ![image](https://hackmd.io/_uploads/rJMQsFrpp.png) * Here it calls ![image](https://hackmd.io/_uploads/ByHb0tBpT.png), because it is not quit important to the flow in the picture, I just skip recording it, and I will also do this if there is any same situation. * **Call (UDM)** * ![image](https://hackmd.io/_uploads/rkgzhFBpT.png) 3. NRF forward -> OpenAPI * NRF forwarding * OpenAPI * ![image](https://hackmd.io/_uploads/SJPD15Ba6.png) We can notice that the calling line is not in the var routes. ![image](https://hackmd.io/_uploads/BkJdy5H6T.png) * ![image](https://hackmd.io/_uploads/Sy1VkqrTa.png) ![image](https://hackmd.io/_uploads/Bk9l1crT6.png) 4. func HandleGenerateAuthDataRequest * ![image](https://hackmd.io/_uploads/SJ6cRYraT.png) * **Call (Function)** * ![image](https://hackmd.io/_uploads/SJbVa9Sa6.png) 5. func GenerateAuthDataProcedure * **Call (Function)** * Suci transfer to Supi * ![image](https://hackmd.io/_uploads/Sydna9BT6.png) * ![image](https://hackmd.io/_uploads/B1Qx09STp.png) func ToSupi (Include below three Suci lines) ![image](https://hackmd.io/_uploads/SJUBR5B6a.png) * ![image](https://hackmd.io/_uploads/Bkr_C5S6a.png) * ![image](https://hackmd.io/_uploads/SkZ2CcrpT.png) * ![image](https://hackmd.io/_uploads/SJkp09HT6.png) * **Return** * **Call (UDR)** * ![image](https://hackmd.io/_uploads/BkpcksST6.png) 6. NRF forward -> OpenAPI * NRF forwarding * OpenAPI * ![image](https://hackmd.io/_uploads/S1WZgjHaT.png) * ![image](https://hackmd.io/_uploads/B1fEloBTa.png) ![image](https://hackmd.io/_uploads/H1sExiBTa.png) 7. func HandleQueryAuthSubsData * ![image](https://hackmd.io/_uploads/H1hPQiH6a.png) * **Call (Function)** * ![image](https://hackmd.io/_uploads/Hk5wBora6.png) * func QueryAuthSubsDataProcedure * **Call (Function) : Get data from mongoDB.** * ![image](https://hackmd.io/_uploads/HkDZIjr6a.png) * func getDataFromDB![image](https://hackmd.io/_uploads/r1yH8jSa6.png) ![image](https://hackmd.io/_uploads/H1dkSxP6p.png) * **Return : Deal some error of data not found and return sub data.** * **Return : Deal some procedure error and return sub data.** * ![image](https://hackmd.io/_uploads/r1WoPiSpp.png) : Something about http status(Not 200 ok and also no problem). * **Return (5) : HTTP response to UDM, it includes the 200ok and response(Getted sub data).** 8. (5) func GenerateAuthDataProcedure * After receiving the return from UDR, it computes the hash values, ![image](https://hackmd.io/_uploads/SkOZPlvaT.png) does some conditionals, and ![image](https://hackmd.io/_uploads/S1kwDxvpa.png) is printed here, ![image](https://hackmd.io/_uploads/HkbKveDpa.png) * Then has a re-syncronization if needed ![image](https://hackmd.io/_uploads/BJcldlDap.png) and SQN ![image](https://hackmd.io/_uploads/H1rXdlPpa.png) * And then call the patch API (update the authentication-data), **Call (UDR)** ![image](https://hackmd.io/_uploads/rJwUdePT6.png) ![image](https://hackmd.io/_uploads/BJnndgv6p.png) 9. NRF forward -> OpenAPI * NRF forwarding * OpenAPI * ![image](https://hackmd.io/_uploads/rkt7k-v6T.png) * ![image](https://hackmd.io/_uploads/S1lH1-vTa.png) ![image](https://hackmd.io/_uploads/HJFIJZD6T.png) 10. func HandleModifyAuthentication * ![image](https://hackmd.io/_uploads/SkRul-D6T.png) * **Call (Funcion)** * ![image](https://hackmd.io/_uploads/H1MCxZDpp.png) * func ModifyAuthenticationProcedure * ![image](https://hackmd.io/_uploads/r1Fe-bwp6.png) * func patchDataToDBAndNotify * Do some API work in UDR. * **Return** * **Return (8)** 11. (8) func GenerateAuthDataProcedure * Generating of parameters. * ![image](https://hackmd.io/_uploads/rkrJ8-vpT.png) * ![image](https://hackmd.io/_uploads/BybxU-DTa.png) * ![image](https://hackmd.io/_uploads/ryx-IWPaa.png) * ![image](https://hackmd.io/_uploads/BkdGU-vTa.png) * AV * Use 5g-AKA * ![image](https://hackmd.io/_uploads/rkWnI-Ppp.png) * ![image](https://hackmd.io/_uploads/rJC2U-vpT.png) * ![image](https://hackmd.io/_uploads/H1FTUbDpT.png) * Use EAP-AKA' * ... * **Return to AUSF (2) : AV & SUPI** * ![image](https://hackmd.io/_uploads/SycDRrWk0.png) * ![image](https://hackmd.io/_uploads/rk28vbDpa.png) * Maybe it is this API log, but not sure. * ![image](https://hackmd.io/_uploads/S1aBOWvp6.png) 12. (2) func UeAuthPostRequestProcedure * It get the info from UDM and create the AUSF context (Need modified)). ![image](https://hackmd.io/_uploads/rJUY4Gw6a.png) * ![image](https://hackmd.io/_uploads/rJv5EfD6p.png) * Use 5g-AKA * ![image](https://hackmd.io/_uploads/r10bSMPTp.png) * ![image](https://hackmd.io/_uploads/rJOGrzwTT.png) * ![image](https://hackmd.io/_uploads/rJlOHGPap.png) * ![image](https://hackmd.io/_uploads/rkbQrMPTp.png) * Use EAP-AKA * ![image](https://hackmd.io/_uploads/r1bBHzDTp.png) * **Return (1) (same as 3 in red framed place.)** 13. (1) func HandleUeAuthPostRequest * **Return HTTP to AMF. (same as 1 in red framed place)** * ![image](https://hackmd.io/_uploads/HJOyKS_Tp.png) ### Orange framed place ![image](https://hackmd.io/_uploads/HycrxGyaT.png) #### Simple process | Seq. | File name | Function name | |:----:|:-------------------------------------------------- |:--------------------------------- | | 1 | ![image](https://hackmd.io/_uploads/SkAn8byT6.png) | func HandleUeAuthPostRequest | | 2 | ![image](https://hackmd.io/_uploads/SkAn8byT6.png) | func UeAuthPostRequestProcedure | | 3 | ![image](https://hackmd.io/_uploads/BklaAxJpT.png) | func AuthenticationProcedure | | 4 | ![image](https://hackmd.io/_uploads/S1MOcB_pa.png) | func SendAuthenticationReques | | 5 | **(3)** | **(3)** | | 6 | **Return (0)** | **Return (0)** | | 7 | N/A | N/A | | 8 | ![image](https://hackmd.io/_uploads/BklaAxJpT.png) | func HandleAuthenticationResponse | #### Detailed process 1. = 13.(Purple) 2. = 12.(Purple) 3. = [1.(Red) func AuthenticationProcedure](https://hackmd.io/fH1eBOchRbGLQA3qb202PQ?both#Red-framed-place) * Here I find that I got it wrong, see the green part. ![image](https://hackmd.io/_uploads/SyvE4S_Tp.png) :::success #### Correction * In the red framed place, I think the first SearchNF line is the one which call AUSF, but it is not. * The test code : ![image](https://hackmd.io/_uploads/HJdLSSd6p.png) ![image](https://hackmd.io/_uploads/HJdvSB_TT.png) * The test logs : ![image](https://hackmd.io/_uploads/Hy5YHruTp.png) * So the third one ![image](https://hackmd.io/_uploads/H1QSLruaT.png) is the real one to generate the authentication context, the red framed place need to be corrected. * And it will call another function in AMF then call the AUSF. * ![image](https://hackmd.io/_uploads/rkVQcHOTT.png) * And the first one and the second one in the crossed picture are just use NRF to find AUSF. * But I dont know which one produce the NRF log. * ![image](https://hackmd.io/_uploads/B1fPtBdap.png) ::: * Keep in func AuthenticationProcedure * **Call (Function)**![image](https://hackmd.io/_uploads/rkTpoEOTT.png) 4. func SendAuthenticationRequest * ![image](https://hackmd.io/_uploads/HJ5F5H_aT.png) * **Call (Function)** ![image](https://hackmd.io/_uploads/r1gn5Hu6p.png) * func BuildAuthenticationRequest ![image](https://hackmd.io/_uploads/By8XoH_ap.png) * It use the context from AUSF's reponse to build the request sending to UE by 5G-AKA or EAP-AKA' ![image](https://hackmd.io/_uploads/HJAGjHdTT.png) ![image](https://hackmd.io/_uploads/rJJasSd66.png) * **Return :** ![image](https://hackmd.io/_uploads/HJHl2Hu6p.png) * **Call (Function)** ![image](https://hackmd.io/_uploads/BkrrCSOTa.png) * func SendDownlinkNasTransport ![image](https://hackmd.io/_uploads/H1sPAr_p6.png) * It builds nas message in ngap folder then send to RAN and UE. ![image](https://hackmd.io/_uploads/BkfsCHOpT.png) * No **Return** unless error happends. * Use timer waiting for UE and decide if it need a retransmission. ![image](https://hackmd.io/_uploads/ryriyUO6p.png) * No **Return (3)** unless error happends. 5. (3) func AuthenticationProcedure * **Return to (0) in red framed place** after sending the request to UE. 6. (0) func Authentication * This function receive the state, event and arg of UE, then use switch to decide the event related to authentication, and it doesnt have return value, it's like a divider. * So we dont have clues about next step, and also serch this function name got too much results, here search the logs directly. 7. 1~3 include the interactions with UE, so I dont take time on them. ![image](https://hackmd.io/_uploads/Bkoso8Oa6.png) 1. ![image](https://hackmd.io/_uploads/r1SRs8d6a.png) * ![image](https://hackmd.io/_uploads/ByYZiLu6p.png) * ![image](https://hackmd.io/_uploads/r1lBoUOT6.png) * ![image](https://hackmd.io/_uploads/BJmwjI_a6.png) * Dispach is too much to find the source. 2. ![image](https://hackmd.io/_uploads/HJbghU_aT.png) * ![image](https://hackmd.io/_uploads/rk_GnLuTa.png) * ![image](https://hackmd.io/_uploads/HypVhIOaT.png) * Same as 1. 3. ![image](https://hackmd.io/_uploads/rkbj2U_pa.png) * This one is like the start of authentication procedure, which can not be found like the [foreword](https://hackmd.io/fH1eBOchRbGLQA3qb202PQ?both#Foreword) says. 4. Next log we can get the clue. 8. func HandleAuthenticationResponse * The source is also one case from ![image](https://hackmd.io/_uploads/Skc26Id66.png), so like 6. says. * ![image](https://hackmd.io/_uploads/BJEK0L_66.png) * It stops the timer ![image](https://hackmd.io/_uploads/ryZIgD_Ta.png) ![image](https://hackmd.io/_uploads/B15Ylw_pa.png) * It decodes the response and sends the confirm request to AUSF, so it belongs to Part 2. ## Stratagy 1 * Simplify the go.mod procedure * Check whether we need this module or not. ![image](https://hackmd.io/_uploads/BJiRd8_CT.png) * In the debug on undefined parameters process, some functions may not be used like the AUSF config & context, need to check how to reduce them. ## Modification 1 ### Prerequisite * Remove the AUSF in run.sh and Makefile * Move the producer folder in AUSF ![image](https://hackmd.io/_uploads/S1ZGwv366.png) to the neighbor of AMF, ![image](https://hackmd.io/_uploads/SJEhow2aT.png) * ![image](https://hackmd.io/_uploads/r1te2D3aT.png) ### 1st authentication request ![image](https://hackmd.io/_uploads/B1ZxMDnpT.png) #### AMF side () :::warning 1. Stop the AUSF selecting process in func AuthenticationProcedure * ![image](https://hackmd.io/_uploads/SkL-bBV06.png) * ![image](https://hackmd.io/_uploads/Sy-FZr406.png) 2. In func SendUEAuthenticationAuthenticateRequest. * Print the authinfo to see the content, ![image](https://hackmd.io/_uploads/H13DLBER6.png) ![image](https://hackmd.io/_uploads/HkxevSNAp.png) * but I dont know the meaning of this kind of parameter format, ![image](https://hackmd.io/_uploads/r1Ds1IVAT.png) * it seems like it doesnt need to be modified, because the receiver side has the same format (models.AuthenticationInfo) . ![image](https://hackmd.io/_uploads/B1PLk8N06.png) ![image](https://hackmd.io/_uploads/rJbvJUN0T.png) * And the other parameter ![image](https://hackmd.io/_uploads/SyhlgUNA6.png) . * ~~I cant find where it is from in the context folder in amf/internal.~~ * Actually it is from ![image](https://hackmd.io/_uploads/BkOUeLE0p.png) . * It is kinda complex, it is a specific method in Go language, here it can be used in API searching. * [Link](https://garyliao-13743.medium.com/go-context-23c80159854c) * **Modification of sender** * Comment out parameter not using. ![image](https://hackmd.io/_uploads/SyAT2FN0T.png) * Directly call the func UeAuthPostRequestProcedure ![image](https://hackmd.io/_uploads/Hyf16FVR6.png) * Need to test the cooperation with the receiver's three return parameter. * And need to add some lines dealing the error (if locationURI ... then ...) . ::: #### AUSF side () :::warning 1. In func HandleUeAuthPostRequest * Comment out the API forwarding function ![image](https://hackmd.io/_uploads/SkLuCFEAp.png) * There are another two forwarding function for confirming the 5g-aka and eap-aka', which may use in next round of request and response. 2. In func UeAuthPostRequestProcedure. * In all of the files in producer_ausf, change the package name * And the imported path is from github, so just reserve it, I will move the local imported files to amf and modify the path if some errors shows up. ![image](https://hackmd.io/_uploads/H1hPAE4C6.png) * **Modification of receiver :** * Stays the same, but Im not sure if the passing parameter is matched after jump through the forwarding part. * Like the pointer parameter or some other wrapping process. ![image](https://hackmd.io/_uploads/B14Jx9ERT.png) ::: #### Test :::spoiler 1. Debug on Go module problems 1. Forget to import the path of receiver. ![image](https://hackmd.io/_uploads/SyBU-5NCp.png) * ~~Just using 相對路徑導入, if these two files are in the same folder (sbi) .~~ ![image](https://hackmd.io/_uploads/S1elDqE0a.png) * Actually it need to be in the same packge (need all of them using packge sbi, not packge consumer & packge producer_ausf), so it need 絕對路徑導入 (it is not flexible, need to change the path when moving to other environment.). ![image](https://hackmd.io/_uploads/HkBFY9VRa.png) or ![image](https://hackmd.io/_uploads/SyM5K5NRa.png) 2. No set GOPATH. ![image](https://hackmd.io/_uploads/Skyiq5EAT.png) * First error is because of the redudant slash before home. * Second error is because "go build" or "go install" will find the packge under GOPATH or GOROOT, and GOROOT is the official packages path, so we need to set a GOPATH. * [Solu](https://hackmd.io/DETj57LjQFimKBIOaD6csQ?both#GOPATH) 3. About make command. * When I use make to compile again, the same error pops up even that I have set the GOPATH, it may related to the compiling method. ![image](https://hackmd.io/_uploads/rJiHR5ECp.png) * Go build is to directly compile go language. * Make use makefile to implimenting lots of command in one time, so maybe there is some default setting in makefile that will cover the manual set GOPATH. * Modify part of Makefile. ![image](https://hackmd.io/_uploads/SJGh-jEAT.png) * $(ROOT_PATH) represent the absolute path of Makefile, it use $(shell pwd) to get the path of current directory, then give it to $(ROOT_PATH). 4. GOPATH -> Go mudule * After modifying the Makefile and trying many kind of solutions (set GOPATH, move producer_ausf to amf/consumer and test), the results still searchs in GOROOT only. ![image](https://hackmd.io/_uploads/r1UnknVCp.png) * Then I find a [solu](https://stackoverflow.com/questions/62760999/how-to-make-go-search-for-packages-in-gopath-while-importing-a-package) on google, but the result is like below altough I have set the GOPATH. ![image](https://hackmd.io/_uploads/rJcfGnEAa.png) * Then I find that there is no go.mod in free5gc_AUSF_v2.0, but go.mod exists in MFs/amf, ![image](https://hackmd.io/_uploads/Hkztf3EA6.png) and chatGPT give the answar like below : 根据提供的 `go.mod` 文件, amf的模块路径为 `github.com/free5gc/amf`。如果您的 `producer_ausf` 也是在 `github.com/free5gc` ,应该可以被正确地导入。请确保在 `producer_ausf` 模块中的代码中,导入路径应该是`github.com/free5gc/amf/internal/sbi/producer_ausf`。 * Q & A * Q : producer_ausf是我自己建的,而非在github上 A : 由于 producer_ausf 是您自己在本地项目中创建的模块,需要正确设置 GOPATH 和 GO111MODULE。 1. 首先,确保您的 GOPATH 环境变量已经正确设置为 /home/ubuntu/free5gc_AUSF_v2.0。您之前提到已经设置了,这一步应该没问题。 2. 接下来,确保您的项目目录结构正确。producer_ausf 应该位于 /home/ubuntu/free5gc_AUSF_v2.0/NFs/amf/internal/sbi/producer_ausf。您之前提到已经建立了该路径,所以这一步也应该没问题。 3. 然后,**请确保您在 go.mod 中指定了您的项目路径。本地项目需要在 go.mod 中加 replace 指令,告诉编译器在构建时使用本地路径**。 5. 最后,请确保您在导入 producer_ausf 时使用正确的导入路径。在 amf 模块的代码中,导入路径应该是 github.com/free5gc/amf/internal/sbi/producer_ausf,而不是 NFs/amf/internal/sbi/producer_ausf。 * Q : 為何使用NFs/amf/internal/sbi/producer_ausf是不行的 就算我已經設置GOPATH A : 问题可能出在导入路径的解析上。**在 Go 1.11 之后,当您使用 go mod 管理依赖关系时,Go 将不再依赖于 GOPATH 来解析导入路径。** * 当您使用相对路径 NFs/amf/internal/sbi/producer_ausf 时,Go 编译器会将其解释为相对于当前目录的导入路径。由于您的项目不在 GOPATH 中,编译器无法正确地解析该路径,导致无法找到相应的模块。 * 您应该使用绝对路径或者正确的模块路径来导入模块。**正确的导入路径应该是 github.com/free5gc/amf/internal/sbi/producer_ausf。** 然后在 go.mod 文件中,使用 replace 指令将该路径映射到本地路径。 * Q : 所以在有使用go.mod的資料夾中 無法透過設置GOPATH來導入自己建立的檔案 只能透過已經啟用的go mod來管理嗎? A : 是的,您的理解基本上是正确的。 * **在使用 go mod 管理依赖关系时,Go 编译器会优先使用模块的根目录来解析导入路径,而不是依赖于 GOPATH。** 因此,即使您设置了 GOPATH,也不会影响 go mod 项目中的导入路径解析。 * 如果您希望在 go mod 项目中引入自己的本地包或模块,通常的做法是将其放置在正确的模块路径下,并确保在 go.mod 文件中正确地指定了依赖关系。**如果您的本地包或模块并不是一个独立的模块,而只是当前项目的一部分,您可以使用 replace 指令将本地路径映射到正确的模块路径,以便在开发过程中使用。** * Q : 為何要使用replace而非直接設置絕對路徑在go.mod中 A : 可以直接在 go.mod 文件中指定本地包或模块的绝对路径。使用 replace 的情况通常是在以下情形下: * 开发时使用本地修改的包或模块:如果您在开发过程中对本地包或模块进行了修改,并且希望立即看到这些修改的效果。 * 依赖管理工具支持:有些依赖管理工具或持续集成工具可能会自动地将 replace 指令用于本地路径的解决方案。这可以确保在开发和构建过程中始终使用正确的依赖关系。 * Q : 如何直接設定絕對路徑 A : 添加一个 replace 指令,将您的本地路径映射到您的模块或包。 * 这将告诉 Go 编译器在构建过程中将 github.com/yourusername/yourmodule 映射到您的本地路径 /path/to/yourmodule。然后,您可以在您的代码中使用 github.com/yourusername/yourmodule,Go 编译器将会自动将其解析为您的本地路径。 * 这种方法仅适用于开发阶段,因为其他人无法访问您的本地路径。一旦您准备好将代码推送到公共存储库,您应该将 replace 指令删除,或者使用相对于 GOPATH 或者模块的路径。 * Q : 我原本就沒有設置github.com/free5gc/amf/internal/sbi/producer_ausf而想要直接使用/home/ubuntu/free5gc_AUSF_v2.0/NFs/amf/internal/sbi/producer_ausf A : import ("home/ubuntu/free5gc_AUSF_v2.0/NFs/amf/internal/sbi/producer_ausf") * Q : ../internal/sbi/consumer/ue_authentication.go:19:2: package home/ubuntu/free5gc_AUSF_v2.0/NFs/amf/internal/sbi/producer_ausf is not in GOROOT(/usr/local/go/src/home/ubuntu/free5gc_AUSF_v2.0/NFs/amf/internal/sbi/producer_ausf) A : **在 Go 中,包的导入路径应该是相对于 $GOPATH/src 或者是在使用 go mod 的情况下,相对于模块的根目录。由于您想要导入的包路径不是相对于这些目录的,因此 Go 编译器无法找到该包。** * 一种解决方法是**将您的项目作为一个模块来管理**,这样您就可以使用 go mod 来管理依赖关系,并且可以在任何地方导入该包。要将您的项目初始化为模块,可以执行以下命令: * cd /home/ubuntu/free5gc_AUSF_v2.0 go mod init github.com/yourusername/yourprojectname * 然后,您可以使用 go mod tidy 命令来整理并下载所需的依赖项。之后,您就可以在您的代码中导入 producer_ausf 包了。 * **但這樣子就得結合github,所以還是得嘗試使用replce** * Q : replace放在require中還是外面 A : ![image](https://hackmd.io/_uploads/HJk1eEdCp.png) * Need to do some study about : * Import of Go. [Link](https://www.cnblogs.com/f-ck-need-u/p/9847554.html) * And the nameing rule of Go, what kind of function is visible in imported file, what kind of function is not. [Link](https://hackmd.io/@Aquamay/r13t064Yd) * And also the path methods of Go, below is the example. ![image](https://hackmd.io/_uploads/HkDFI5ERp.png) * [Go module & GOPATH](https://ithelp.ithome.com.tw/articles/10217414?sc=rss.iron) ::: :::success * The conoclution of Go module : * Free5GC use go.mod in every NFs to manage the imported packges, so set GOPATH is useless. * In go.mod, we have two methods to add a local path : * Put the path outside the root folder of go.mod, and use the absolute path. * But the local file is put in amf(which has its own go.mod), so it need to use go mod init to modulize and tidy with the github. * This method is not clear for me, I need more study. * Use replace for mapping the github path to local path. * Replace method has some problem, the imported local file also imports other github path, so it need git get to get it from github. ![image](https://hackmd.io/_uploads/B1PKLhV0a.png) ![image](https://hackmd.io/_uploads/HkjvtEdCp.png) ![image](https://hackmd.io/_uploads/Syx_UnV0T.png) * You can try the go get command. * But if I go get these modules, it still uses the AUSF contents, the got package from AUSF shouldnt be existed, I have two options : 1. Move these folder from AUSF to AMF locally, and also add the path using replace. * This method is not totally equal to go get, because it modify the path and files into local contents of AMF. * It also need to change the path when the environment is changed. 2. Directly put the functions in the same file and use function calling. * I think it's too complicated, maybe I will put it as the last step of improvement. * Replace problem * Move four folders to AMF. ![image](https://hackmd.io/_uploads/ByoIzwdRp.png) * Change the path in the error file : * ![image](https://hackmd.io/_uploads/BJdDoI_0a.png) * ![image](https://hackmd.io/_uploads/H1n5jIO0T.png) * Add new lines in go.mod. * ![image](https://hackmd.io/_uploads/rko8p8OAT.png) * The moved files need to change the imported path too. * ![image](https://hackmd.io/_uploads/r1xifvu06.png) ![image](https://hackmd.io/_uploads/SkaazDdCa.png) ![image](https://hackmd.io/_uploads/rJpuNDORT.png) * ![image](https://hackmd.io/_uploads/BJskVvuRT.png) ![image](https://hackmd.io/_uploads/SJb-Nwu0T.png) * ![image](https://hackmd.io/_uploads/rytC7v_A6.png) ![image](https://hackmd.io/_uploads/HJC_mw_Cp.png) * ![image](https://hackmd.io/_uploads/S1_i7v_C6.png) ![image](https://hackmd.io/_uploads/SJjfHP_RT.png) * ![image](https://hackmd.io/_uploads/r1FBBvuCT.png) ![image](https://hackmd.io/_uploads/S1mUSv_0p.png) * ![image](https://hackmd.io/_uploads/SkpdBPdCT.png) ![image](https://hackmd.io/_uploads/ry3YSwuRa.png) * I dont know why these errors dont show up at the same time, so if you want to solve them asap, you can directly comment out all related lines at first. * Remained errors ![image](https://hackmd.io/_uploads/B1LVIPuC6.png) * In amf folder and go get them, but the third one didnt have a message after typing the command, but it still worked. ![image](https://hackmd.io/_uploads/SyvxwvuRa.png) ::: :::spoiler 2. Debug on undefined parameter and imported not use path * The new moved file has some parameter undefined. ![image](https://hackmd.io/_uploads/HJtnPutAa.png) * In func BuildNFInstance ![image](https://hackmd.io/_uploads/r1sG_uF0a.png) * **Forgot to change the belonged packge of those moved files.** * ![image](https://hackmd.io/_uploads/S1RlKdFAa.png) ![image](https://hackmd.io/_uploads/rJoWYOtAa.png) * ![image](https://hackmd.io/_uploads/SyFGtdY0a.png) * ![image](https://hackmd.io/_uploads/r1OrYOtAp.png) ![image](https://hackmd.io/_uploads/Hy3IYuKCT.png) * ![image](https://hackmd.io/_uploads/rJEFtdFC6.png) ![image](https://hackmd.io/_uploads/Sy8qKuYC6.png) * Some **function calling of logger are undefined** because of the changed name logger_ausf. ![image](https://hackmd.io/_uploads/SyyMp_YAp.png) * And **the changed path is also not used** because of it. * I don't know whether this error files will be used or not, because config.go is for AUSF configuration, but it may be abandoned in the future, **I just recover them for current debugging process, maybe I will comment out all of them, maybe not**. * ![image](https://hackmd.io/_uploads/r1nXTdFAp.png) * ![image](https://hackmd.io/_uploads/HkuI6dKA6.png) * ![image](https://hackmd.io/_uploads/S1UD6_YCp.png) * ![image](https://hackmd.io/_uploads/Hk7tAuFCp.png) * ![image](https://hackmd.io/_uploads/Hyd5Adt06.png) * ![image](https://hackmd.io/_uploads/S1ej0dFRp.png) * ![image](https://hackmd.io/_uploads/B16nR_tAp.png) * ![image](https://hackmd.io/_uploads/S1MCAdtAp.png) * ![image](https://hackmd.io/_uploads/Hk3zJYKC6.png) * More undefined problems. ![image](https://hackmd.io/_uploads/B1rZZKK0a.png) * Same method, recover them first. * ![image](https://hackmd.io/_uploads/SyM8bFF0T.png) * ![image](https://hackmd.io/_uploads/BkIwWtKAT.png) * ![image](https://hackmd.io/_uploads/rkccWKKAT.png) * ![image](https://hackmd.io/_uploads/HyXZGttA6.png) * ![image](https://hackmd.io/_uploads/HybzGKFR6.png) * ![image](https://hackmd.io/_uploads/HkJdGFY06.png) * ![image](https://hackmd.io/_uploads/rJAcGFtC6.png) * More. ![image](https://hackmd.io/_uploads/SkgTzttCT.png) * ![image](https://hackmd.io/_uploads/Hyu1QYtRp.png) * ![image](https://hackmd.io/_uploads/ryqQmYF0a.png) * ![image](https://hackmd.io/_uploads/rkO4mFFAT.png) * ![image](https://hackmd.io/_uploads/rJSr7FtCT.png) * ![image](https://hackmd.io/_uploads/SyVLmFY0T.png) * It comes back again. ![image](https://hackmd.io/_uploads/B1gMVYKCp.png) * I dont know why it is undefined, because the called function is model from openapi, it should be defined properly. * But when I look back to the original file in AUSF, it doesnt include the "s", I don’t know when to **typed one more letter and saved the file**. ![image](https://hackmd.io/_uploads/rJDbBFKRa.png) * After restoring it, there is no problem. * More... ![image](https://hackmd.io/_uploads/ryvbLYFCp.png) ![image](https://hackmd.io/_uploads/SkxbvFtCT.png) ![image](https://hackmd.io/_uploads/SyJpwFFAa.png) * ![image](https://hackmd.io/_uploads/r1aVLYKRp.png) * ![image](https://hackmd.io/_uploads/HJ78LFtAa.png) * ![image](https://hackmd.io/_uploads/B1Pv8KKC6.png) * ![image](https://hackmd.io/_uploads/ryu_LKFR6.png) * ![image](https://hackmd.io/_uploads/ryhFUtYRa.png) * ![image](https://hackmd.io/_uploads/r1boIKK06.png) * ![image](https://hackmd.io/_uploads/S1z3UFFAT.png) * ![image](https://hackmd.io/_uploads/Byl6UtFAa.png) * ![image](https://hackmd.io/_uploads/Syz0LKKRa.png) * ![image](https://hackmd.io/_uploads/r1MyvtKR6.png) * ![image](https://hackmd.io/_uploads/SyPGvKtCT.png) * ![image](https://hackmd.io/_uploads/SyPQwFFR6.png) * ![image](https://hackmd.io/_uploads/ByoNvKtRT.png) * ![image](https://hackmd.io/_uploads/HyIrwYKRp.png) * ![image](https://hackmd.io/_uploads/S1vwPttC6.png) * ![image](https://hackmd.io/_uploads/HJLuDKtC6.png) * ![image](https://hackmd.io/_uploads/Bk6YDFKCT.png) * ![image](https://hackmd.io/_uploads/ryMjvKY06.png) * ![image](https://hackmd.io/_uploads/SynCDKtCa.png) * ![image](https://hackmd.io/_uploads/rkM-uKt0T.png) * ![image](https://hackmd.io/_uploads/ryeMdtKAa.png) * ![image](https://hackmd.io/_uploads/HkUEdYtCa.png) * ![image](https://hackmd.io/_uploads/S1USOKYRp.png) * ![image](https://hackmd.io/_uploads/H1o8OKtCp.png) * More...... ![image](https://hackmd.io/_uploads/rJ-cOYtA6.png) ![image](https://hackmd.io/_uploads/ryP7FFYRa.png) ![image](https://hackmd.io/_uploads/ryzpKFYCa.png) ![image](https://hackmd.io/_uploads/HJ5MiFYAT.png) * ![image](https://hackmd.io/_uploads/HkRnuKtRT.png) * ![image](https://hackmd.io/_uploads/Sy-ROKKA6.png) * ![image](https://hackmd.io/_uploads/S1uRutKCa.png) * ![image](https://hackmd.io/_uploads/BJMfKYY0p.png) * ![image](https://hackmd.io/_uploads/rkrStKtC6.png) * ![image](https://hackmd.io/_uploads/r198YtKRp.png) * ![image](https://hackmd.io/_uploads/H1FPYFYRa.png) * ![image](https://hackmd.io/_uploads/ByGYYtF0a.png) * ![image](https://hackmd.io/_uploads/Syr3Ktt0T.png) * ![image](https://hackmd.io/_uploads/rJje5FtAa.png) * ![image](https://hackmd.io/_uploads/HyqW9ttC6.png) * ![image](https://hackmd.io/_uploads/SJtzqYY0a.png) * ![image](https://hackmd.io/_uploads/B1YQqFFAa.png) * ![image](https://hackmd.io/_uploads/rk945tFCp.png) * ![image](https://hackmd.io/_uploads/BJPB9YtRT.png) * ![image](https://hackmd.io/_uploads/HyJd9FKAp.png) * ![image](https://hackmd.io/_uploads/SyTuqKFCT.png) * ![image](https://hackmd.io/_uploads/SkKK9FtRp.png) * ![image](https://hackmd.io/_uploads/H1Si9KY0a.png) * ![image](https://hackmd.io/_uploads/HJt2qKKRp.png) * ![image](https://hackmd.io/_uploads/HJA6qtYCp.png) * ![image](https://hackmd.io/_uploads/H1l1ittCa.png) * ![image](https://hackmd.io/_uploads/S1ylittCa.png) * The use of logger. ![image](https://hackmd.io/_uploads/rkPWs2qCT.png) * The use of factory. ![image](https://hackmd.io/_uploads/BJmEs25Ap.png) ::: :::success * After changing all the parameters, they can call each other in AMF. * Next, modify the code to fix the errors about integration test. ::: :::spoiler 3. Debug on integrating errors **Parameter transfering problem** ![image](https://hackmd.io/_uploads/BJaWMjcCT.png) 1. The original parameter is httpResponse in the 45 line, and after commenting out the api part in amf and ausf, httpResponse is not used, so I fill in the returned parameter locationURI instead, but the locationURI is originally used for producer side api handling. * So I think I can directly comment out the URI construction process in producer side. ![image](https://hackmd.io/_uploads/HJ50si90p.png) * Here other parameter using locationURI in 5g-AKA & EAPAKA' can be commented out, because the Links in response will be set nil as default, will not have any error. * In Go, not initailed map will be nil. ![image](https://hackmd.io/_uploads/HkCJ2ic0p.png) ![image](https://hackmd.io/_uploads/SyNORs5CT.png) ![image](https://hackmd.io/_uploads/BJ2i0jcRT.png) ![image](https://hackmd.io/_uploads/SkB6Ro5Aa.png) * And the received & returned parameter number need to be modified to 2. ![image](https://hackmd.io/_uploads/Hk9Olh9R6.png) ![image](https://hackmd.io/_uploads/ByFPlhqRp.png) ![image](https://hackmd.io/_uploads/BkuBxh5Cp.png) ![image](https://hackmd.io/_uploads/SyrEen906.png) ![image](https://hackmd.io/_uploads/BkX7x25Ap.png) ![image](https://hackmd.io/_uploads/ry4fe29C6.png) ![image](https://hackmd.io/_uploads/SkmEWhcR6.png) 2. In amf side, the 66 line has got the *models.UeAuthenticationCtx but the 68 line return the address (*models.UeAuthenticationCtx) of it, so **don't need to add & before the parameter**. ![image](https://hackmd.io/_uploads/HyrX-oc0T.png) * I think the reason is the original parameter used in the 45 line, implements **the openAPI transformation (httpwarpper) between AMF and AUSF which will add one more pointer (addressing) operation**. 3. Bsed on ChatGPT, responseBody and ueAuthenticationCtx have the same format *models.UeAuthenticationCtx, so they wont conflict. 4. Compile has error, ![image](https://hackmd.io/_uploads/BJncfhcCa.png) so I change the commenting out method, maybe the original one is wrong. ![image](https://hackmd.io/_uploads/ryx1Q39Ap.png) * But the error stays the same, then I find the function title definds the number of returned values, ![image](https://hackmd.io/_uploads/rJ_RX39Rp.png) so I change it. ![image](https://hackmd.io/_uploads/S1ZvEn9Ap.png) * Another error like this. ![image](https://hackmd.io/_uploads/BJ0kLh9CT.png) If I change like this (the commenting out part doesnt affect). ![image](https://hackmd.io/_uploads/Hke4Uh5A6.png) It cause another error. ![image](https://hackmd.io/_uploads/SyBmLh9Ra.png) * After trying, below two kind of methods are correct way to define function. ![image](https://hackmd.io/_uploads/rkNwPn90a.png) or ![image](https://hackmd.io/_uploads/rJwFDh5Aa.png) **Adding a comma at the end or put in same line.** **Bug 2** ![image](https://hackmd.io/_uploads/Hkm-h290a.png) * It call itself, so just change the parameter number ![image](https://hackmd.io/_uploads/S1wJp290a.png) ::: :::success * The compiling result is successful ![image](https://hackmd.io/_uploads/HykaTh9Ap.png) ::: :::spoiler 4. Debug on function problems after function integrated successfully. ![image](https://hackmd.io/_uploads/Bk64Z6qCa.png) * This problem is about ServingNetworkAuthorized function, maybe the parameter got from amf calling is not matching after killing the openAPI. ![image](https://hackmd.io/_uploads/r1x1MT9AT.png) * Here print it to compare with orginal one (Using %+v in both places). ![image](https://hackmd.io/_uploads/BJaZy6C0T.png) ![image](https://hackmd.io/_uploads/B1iG16RRp.png) * The result is that the values of them are the same. ![image](https://hackmd.io/_uploads/BkWOJpC0T.png) ![image](https://hackmd.io/_uploads/HkYY16CRa.png) ![image](https://hackmd.io/_uploads/SJWc1a0Ra.png) * Check back to the place that it use ausf_context to call IsServingNetworkAuthorized function, and in this function it match the snName from AMF with snRegex in AUSF. ![image](https://hackmd.io/_uploads/HyDNxTA0p.png) ![image](https://hackmd.io/_uploads/SJcHep0RT.png) * The AUSFContext should not be created because I commented out AUSF finding process. * So maybe the serving network check part can be commented out too. ::: :::success * Pause in half done status, if you want to continue simplifying, you should start here. * And ![image](https://hackmd.io/_uploads/rJCD2aCCa.png) ::: ## Analysis (Part 2) * 3/25~ * As the **ending** of my stratay, investigate remained procedure, understand them, so I can continue to Terry's stratagy. * If the parameters(XRES*, HXRES*...) between AMF and AUSF comfirming are needed or I can ignore them and use the generating function in UDM directly. * Maybe the stratagy and modification parts also needed to be completed and concluded. ### Corresponded logs of part 2 * Dark place is where I need to skip in call flow. ![image](https://hackmd.io/_uploads/S1hhfgPTT.png) ![image](https://hackmd.io/_uploads/rJBXZP_p6.png) #### Simple process | Seq. | File name | Function name | |:----:|:-------------------------------------------------- |:------------------------------------- | | 0 | ![image](https://hackmd.io/_uploads/SkfDwUdTp.png) | func Authentication | | 1 | ![image](https://hackmd.io/_uploads/BklaAxJpT.png) | func HandleAuthenticationResponse | | 2 | ![image](https://hackmd.io/_uploads/r1txQD-1A.png) | func SendAuth5gAkaConfirmRequest | | 3 | API | API | | 4 | ![image](https://hackmd.io/_uploads/rkRLEPZ1R.png) | func HandleAuth5gAkaComfirmRequest | | 5 | ![image](https://hackmd.io/_uploads/rkRLEPZ1R.png) | func Auth5gAkaComfirmRequestProcedure | | 6 | **Return (2)** | **Return (2)** | | 7 | **Return (1)** | **Return (1)** | #### Detailed process 1. func HandleAuthenticationResponse * After the timer start in 4(Orange framed place), 5(Orange framed place) return to sm.go, then 6(Orange framed place) waits for the uplinkNAStransport from gnb. * After dealing the NAS in 7(Orange framed place), we can find that 8(Orange framed place) is called by searching the log. * The 8(Orange framed place) is 1(here), actually it is called by 0, which is triggered by the NAS message. ![image](https://hackmd.io/_uploads/HkzgJDbkA.png) * After it stop the T3560, it uses switch to choose 5g-aka, ![image](https://hackmd.io/_uploads/SJlmlvby0.png) then gets the res*, calculates the HRES*, compare to HXRES* ![image](https://hackmd.io/_uploads/HkUHlwb1A.png) ![image](https://hackmd.io/_uploads/rJtPeDWJ0.png) ![image](https://hackmd.io/_uploads/rkvgWPZJR.png) then send comfirm request to AUSF, **call(function)**. ![image](https://hackmd.io/_uploads/HJUzbwWkA.png) 2. func SendAuth5gAkaConfirmRequest * It's just below func SendUEAuthenticationAuthenticateRequest, in ueauthentication.go of amf side. * **Call (AUSF)** ![image](https://hackmd.io/_uploads/BJyqmwWJC.png) 3. API (No explanation) 4. func HandleAuth5gAkaComfirmRequest * ![image](https://hackmd.io/_uploads/B1J9EDbk0.png) * **Call (function)** ![image](https://hackmd.io/_uploads/HJe2ND-J0.png) 5. func Auth5gAkaComfirmRequestProcedure * Check SUPI & get SUPI & use SUPI to get info. ![image](https://hackmd.io/_uploads/SyrhLv-k0.png) * Use info to compare & print ![image](https://hackmd.io/_uploads/SJJk9wWk0.png) . ![image](https://hackmd.io/_uploads/BkD1vDb1R.png) * **Call (UDM)** to create AuthStatus. ![image](https://hackmd.io/_uploads/ry1jPw-JR.png) * func sendAuthResultToUDM ![image](https://hackmd.io/_uploads/SkKTDwb1C.png) ![image](https://hackmd.io/_uploads/BJyeuPbkC.png) * API (No explanation) & func HandleConfirmAuthDataRequest (print) & **Call(Function)** ![image](https://hackmd.io/_uploads/HJ3XOw-yR.png) ![image](https://hackmd.io/_uploads/rkaQ5wWkC.png) ![image](https://hackmd.io/_uploads/HJqucP-1A.png) ![image](https://hackmd.io/_uploads/HkNVuvZyA.png) * func ConfirmAuthDataProcedure & **Call (UDR)** ![image](https://hackmd.io/_uploads/Hk-DuwZk0.png) * API (No explanation) & In UDR (print) ![image](https://hackmd.io/_uploads/SJKWiw-JA.png) ![image](https://hackmd.io/_uploads/rJZauDWyR.png) * **Continuous return (AUSF)** * **Return (4) & Return (2)** ![image](https://hackmd.io/_uploads/B13fivZJR.png) 6. (2) func SendAuth5gAkaConfirmRequest * Deal with HTTP response from AUSF ![image](https://hackmd.io/_uploads/Syrk2vWkC.png) * Return (1) 7. (1) func HandleAuthenticationResponse * In the choose of 5g-aka, switch the confirm result. & **Call(function)** & **Reutrn (0)** ![image](https://hackmd.io/_uploads/HyTu3PWyA.png) * func DerivateKamf ![image](https://hackmd.io/_uploads/BkaihP-JR.png) * func SendEvent (call callback function) ![image](https://hackmd.io/_uploads/SyBXTvWJC.png) ![image](https://hackmd.io/_uploads/rJgEaDWyC.png) * I think here is the source to print it, which **ends the event of Authentication**. ![image](https://hackmd.io/_uploads/HkofCvWJ0.png) * But I dont understand why the return use call function instead of err, in sm.go it use err to receive the return value. ![image](https://hackmd.io/_uploads/BJbKCw-y0.png) * And I dont understand the relation between the exit event and the N1 message from AMF to UE. * How to end the authentication and start the next stage ? * Maybe the start and the end are both triggered by UE ?

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully