Skip to content

Commit

Permalink
SDCORE-850: Adding support for NW requested PDU Sess Release (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vini Gajjar committed Mar 24, 2022
1 parent 6e34bd2 commit 2a0452a
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 16 deletions.
2 changes: 2 additions & 0 deletions common/procedures.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const (
UE_TRIGGERED_SERVICE_REQUEST_PROCEDURE
NW_TRIGGERED_UE_DEREGISTRATION_PROCEDURE
AMF_RELEASE_PROCEDURE
NW_REQUESTED_PDU_SESSION_RELEASE_PROCEDURE
)

var procStrMap = map[ProcedureType]string{
Expand All @@ -30,6 +31,7 @@ var procStrMap = map[ProcedureType]string{
NW_TRIGGERED_UE_DEREGISTRATION_PROCEDURE: "NW-TRIGGERED-UE-DEREGISTRATION-PROCEDURE",
AMF_RELEASE_PROCEDURE: "AMF-RELEASE-PROCEDURE",
UE_REQUESTED_PDU_SESSION_RELEASE_PROCEDURE: "UE-REQUESTED-PDU-SESSION-RELEASE-PROCEDURE",
NW_REQUESTED_PDU_SESSION_RELEASE_PROCEDURE: "NW-REQUESTED-PDU-SESSION-RELEASE-PROCEDURE",
}

func (id ProcedureType) String() string {
Expand Down
9 changes: 9 additions & 0 deletions config/gnbsim.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,15 @@ configuration:
plmnId: # Public Land Mobile Network ID, <PLMN ID> = <MCC><MNC>. Should match startImsi
mcc: 208 # Mobile Country Code (3 digits string, digit: 0~9)
mnc: 93 # Mobile Network Code (2 or 3 digits string, digit: 0~9)
- profileType: nwreqpdusessrelease # profile type
profileName: profile8 # uniqely identifies a profile within application
enable: false # Set true to execute the profile, false otherwise.
gnbName: gnb1 # gNB to be used for this profile
startImsi: 208930100007497 # First IMSI. Subsequent values will be used if ueCount is more than 1
ueCount: 1 # Number of UEs for for which the profile will be executed
plmnId: # Public Land Mobile Network ID, <PLMN ID> = <MCC><MNC>. Should match startImsi
mcc: 208 # Mobile Country Code (3 digits string, digit: 0~9)
mnc: 93 # Mobile Network Code (2 or 3 digits string, digit: 0~9)

logger:
logLevel: info # how detailed the log will be, values: trace, debug, info, warn, error, fatal, panic
42 changes: 30 additions & 12 deletions profile/profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@ import (

//profile names
const (
REGISTER string = "register"
PDU_SESS_EST string = "pdusessest"
DEREGISTER string = "deregister"
AN_RELEASE string = "anrelease"
UE_TRIGG_SERVICE_REQ string = "uetriggservicereq"
NW_TRIGG_UE_DEREG_REQ string = "nwtriggeruedereg"
UE_REQ_PDU_SESS_REL string = "uereqpdusessrelease"
REGISTER string = "register"
PDU_SESS_EST string = "pdusessest"
DEREGISTER string = "deregister"
AN_RELEASE string = "anrelease"
UE_TRIGG_SERVICE_REQ string = "uetriggservicereq"
NW_TRIGG_UE_DEREG string = "nwtriggeruedereg"
UE_REQ_PDU_SESS_RELEASE string = "uereqpdusessrelease"
NW_REQ_PDU_SESS_RELEASE string = "nwreqpdusessrelease"
)

func InitializeAllProfiles() {
Expand Down Expand Up @@ -122,7 +123,7 @@ func initEventMap(profile *profctx.Profile) {
common.PDU_SESS_EST_ACCEPT_EVENT: common.PDU_SESS_EST_ACCEPT_EVENT,
common.PROFILE_PASS_EVENT: common.QUIT_EVENT,
}
case UE_REQ_PDU_SESS_REL:
case UE_REQ_PDU_SESS_RELEASE:
profile.Events = map[common.EventType]common.EventType{
common.REG_REQUEST_EVENT: common.AUTH_REQUEST_EVENT,
common.AUTH_REQUEST_EVENT: common.AUTH_RESPONSE_EVENT,
Expand Down Expand Up @@ -168,7 +169,7 @@ func initEventMap(profile *profctx.Profile) {
common.TRIGGER_AN_RELEASE_EVENT: common.CONNECTION_RELEASE_REQUEST_EVENT,
common.PROFILE_PASS_EVENT: common.QUIT_EVENT,
}
case NW_TRIGG_UE_DEREG_REQ:
case NW_TRIGG_UE_DEREG:
profile.Events = map[common.EventType]common.EventType{
common.REG_REQUEST_EVENT: common.AUTH_REQUEST_EVENT,
common.AUTH_REQUEST_EVENT: common.AUTH_RESPONSE_EVENT,
Expand All @@ -177,9 +178,19 @@ func initEventMap(profile *profctx.Profile) {
common.PDU_SESS_EST_REQUEST_EVENT: common.PDU_SESS_EST_ACCEPT_EVENT,
common.PDU_SESS_EST_ACCEPT_EVENT: common.PDU_SESS_EST_ACCEPT_EVENT,
common.DEREG_REQUEST_UE_TERM_EVENT: common.DEREG_ACCEPT_UE_TERM_EVENT,
common.TRIGGER_AN_RELEASE_EVENT: common.CONNECTION_RELEASE_REQUEST_EVENT,
common.PROFILE_PASS_EVENT: common.QUIT_EVENT,
}
case NW_REQ_PDU_SESS_RELEASE:
profile.Events = map[common.EventType]common.EventType{
common.REG_REQUEST_EVENT: common.AUTH_REQUEST_EVENT,
common.AUTH_REQUEST_EVENT: common.AUTH_RESPONSE_EVENT,
common.SEC_MOD_COMMAND_EVENT: common.SEC_MOD_COMPLETE_EVENT,
common.REG_ACCEPT_EVENT: common.REG_COMPLETE_EVENT,
common.PDU_SESS_EST_REQUEST_EVENT: common.PDU_SESS_EST_ACCEPT_EVENT,
common.PDU_SESS_EST_ACCEPT_EVENT: common.PDU_SESS_EST_ACCEPT_EVENT,
common.PDU_SESS_REL_COMMAND_EVENT: common.PDU_SESS_REL_COMPLETE_EVENT,
common.PROFILE_PASS_EVENT: common.QUIT_EVENT,
}

}
}
Expand Down Expand Up @@ -216,19 +227,26 @@ func initProcedureList(profile *profctx.Profile) {
common.AN_RELEASE_PROCEDURE,
common.UE_TRIGGERED_SERVICE_REQUEST_PROCEDURE,
}
case NW_TRIGG_UE_DEREG_REQ:
case NW_TRIGG_UE_DEREG:
profile.Procedures = []common.ProcedureType{
common.REGISTRATION_PROCEDURE,
common.PDU_SESSION_ESTABLISHMENT_PROCEDURE,
common.USER_DATA_PKT_GENERATION_PROCEDURE,
common.NW_TRIGGERED_UE_DEREGISTRATION_PROCEDURE,
}
case UE_REQ_PDU_SESS_REL:
case UE_REQ_PDU_SESS_RELEASE:
profile.Procedures = []common.ProcedureType{
common.REGISTRATION_PROCEDURE,
common.PDU_SESSION_ESTABLISHMENT_PROCEDURE,
common.USER_DATA_PKT_GENERATION_PROCEDURE,
common.UE_REQUESTED_PDU_SESSION_RELEASE_PROCEDURE,
}
case NW_REQ_PDU_SESS_RELEASE:
profile.Procedures = []common.ProcedureType{
common.REGISTRATION_PROCEDURE,
common.PDU_SESSION_ESTABLISHMENT_PROCEDURE,
common.USER_DATA_PKT_GENERATION_PROCEDURE,
common.NW_REQUESTED_PDU_SESSION_RELEASE_PROCEDURE,
}
}
}
12 changes: 8 additions & 4 deletions simue/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,10 +221,12 @@ func HandlePduSessReleaseCommandEvent(ue *simuectx.SimUe,
intfcMsg common.InterfaceMessage) (err error) {

msg := intfcMsg.(*common.UeMessage)
err = ue.ProfileCtx.CheckCurrentEvent(common.PDU_SESS_REL_REQUEST_EVENT, msg.Event)
if err != nil {
ue.Log.Errorln("CheckCurrentEvent returned:", err)
return err
if ue.Procedure == common.UE_REQUESTED_PDU_SESSION_RELEASE_PROCEDURE {
err = ue.ProfileCtx.CheckCurrentEvent(common.PDU_SESS_REL_REQUEST_EVENT, msg.Event)
if err != nil {
ue.Log.Errorln("CheckCurrentEvent returned:", err)
return err
}
}
nextEvent, err := ue.ProfileCtx.GetNextEvent(msg.Event)
if err != nil {
Expand Down Expand Up @@ -481,5 +483,7 @@ func HandleProcedure(ue *simuectx.SimUe) {
SendToRealUe(ue, msg)
case common.NW_TRIGGERED_UE_DEREGISTRATION_PROCEDURE:
ue.Log.Infoln("Waiting for N/W Triggered De-registration Procedure")
case common.NW_REQUESTED_PDU_SESSION_RELEASE_PROCEDURE:
ue.Log.Infoln("Waiting for N/W Requested PDU Session Release Procedure")
}
}

0 comments on commit 2a0452a

Please sign in to comment.