feat(n3iwf): add N3IWF-ID support to sctplb gRPC bridge#646
Draft
andybavier wants to merge 3 commits intomainfrom
Draft
feat(n3iwf): add N3IWF-ID support to sctplb gRPC bridge#646andybavier wants to merge 3 commits intomainfrom
andybavier wants to merge 3 commits intomainfrom
Conversation
- Extend server.proto with N3IWF_MSG/DISC/CONN msgType values and
N3iwfId field in SctplbMessage and AmfMessage (aligns with sctplb
client.proto)
- Regenerate protos/sdcoreAmfServer/{server,server_grpc}.pb.go
- service/amf_server.go: handle N3IWF INIT_MSG (create RAN with
RanPresentN3IwfId + NON_3GPP AnType), N3IWF_DISC, and N3IWF_CONN
- ngap/dispatcher.go: resolve RAN from N3IwfId when GnbId absent;
populate N3IwfId (not GnbId) on REDIRECT_MSG for N3IWF RANs
- ngap/message/send.go: send N3IwfId or GnbId based on RanPresent
- nas/handler.go: fix AnType assignment (was always 3GPP); fix
REDIRECT_MSG to use N3IwfId for N3IWF RANs
- ngap/handler.go: fix REDIRECT_MSG N3IwfId field for N3IWF RANs
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Andy Bavier <andybavier@gmail.com>
There was a problem hiding this comment.
Pull request overview
This PR extends the sctplb↔AMF gRPC bridge to support N3IWF (non‑3GPP) nodes in addition to gNBs, including protobuf updates and runtime routing/redirect fixes so non‑3GPP attach flows use the correct access type and identifiers.
Changes:
- Extend
server.proto/ generated gRPC code withN3IWF_*message types andN3iwfIdfields on both request/response messages. - Update AMF gRPC handling and NGAP dispatch/send paths to key/look up RANs via
N3IwfIdand populateN3IwfIdvsGnbIdin redirect / AMF→RAN messages. - Fix non‑3GPP
AnTypeassignment for sctplb-mode UEs.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| service/amf_server.go | Creates/updates RAN context during INIT; handles N3IWF DISC/CONN and sets non‑3GPP access type. |
| protos/server.proto | Adds N3IWF enum values and N3iwfId fields to bridge messages. |
| protos/sdcoreAmfServer/server.pb.go | Regenerated protobuf types for new enum/fields and updated proto source path metadata. |
| protos/sdcoreAmfServer/server_grpc.pb.go | Regenerated gRPC stubs/metadata reflecting updated proto path. |
| ngap/dispatcher.go | Resolves RAN by N3IwfId and sets redirect ID field based on RanPresent. |
| ngap/message/send.go | Sends AMF→RAN messages using N3IwfId vs GnbId depending on RanPresent. |
| ngap/handler.go | Populates correct redirect identifier field for N3IWF vs gNB. |
| nas/handler.go | Fixes AnType for sctplb UEs and sets redirect identifier field for N3IWF vs gNB. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
RanID() and Remove() both dereference ran.RanId, which was left nil when creating N3IWF RAN entries. Add ConvertN3iwfIdToRanId (parallel to ConvertGnbIdToRanId) that parses "mcc:mnc:n3iwfId" into a GlobalRanNodeId and sets RanPresent = RanPresentN3IwfId. Call it in both amf_server.go and dispatcher.go instead of the bare RanPresent assignment. Addresses PR review comments. Signed-off-by: Andy Bavier <andybavier@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
protos/server.protowith sctplb'sclient.proto— addsN3IWF_MSG,N3IWF_DISC,N3IWF_CONNmessage types andN3iwfIdfieldsAnType = 3GPP_ACCESSfor sctplb-mode UEs, breaking non-3GPP attach flowsChanges
protos/server.protoN3iwfIdfield to both messagesprotos/sdcoreAmfServer/server.pb.goprotos/sdcoreAmfServer/server_grpc.pb.goservice/amf_server.goRanPresentN3IwfId+NON_3GPP_ACCESSngap/dispatcher.goN3IwfId; populate correct redirect fieldngap/message/send.goN3IwfIdvsGnbIdbased onRanPresentnas/handler.goAnTypeassignment; fix redirect field for N3IWFngap/handler.goDesign Notes
ran.GnbIdto store the N3IWF ID string ("mcc:mnc:n3iwfId") — same as theAmfRanPoolkey — soAmfRanFindByGnbIdworks uniformly for both node typesRanPresentN3IwfId == 3is the discriminator for all N3IWF-specific branchesPost-Deploy Monitoring & Validation
GrpcLogentries —"new N3IWF RAN","N3IWF disconnected","new N3IWF Connected"RanPresentN3IwfId; subsequent NGAP messages route correctly viaN3IwfIdfield; UE attach completes withAccessType_NON_3_GPP_ACCESS"N3IwfId"missing from REDIRECT_MSG (sctplb drops packet); UE stuck in non-3GPP auth with wrong AnType;AmfRanFindByGnbIdreturning false for known N3IWF ID🤖 Generated with Claude Code