IWF Configuration

This section includes configuration options supported for IWF.

For detailed information about configuring parameters, see IWF Configurable Parameters.

Download the InterWorking and Mediation Function (IWF) Custom Template ZIP file from OHC and Unzip the template to get ociwf-custom-values-1.4.0.yaml file.

Updating Mediation Rules
  • A script file is available in tools/ directory, which downloads the required rule files. It needs namespace as well as configmap name. These rules then can be changed accordingly.
  • After changing the rules, the user must reload the changes by executing:

    "kubectl create configmap <configmapname> -n <namespace> --dry-run -o yaml --from-file="<filename>" | kubectl replace -f -"

  • The test rules can also be modified similarly.

Mediation Test Mode configuration

IWF Mediation can be configured to send request and response to IWF Mediation Test Service by setting test-mode-enable to enable in environment variable in the IWF Mediation deployment chart.

MYSQL Configuration

The MYSQL allows the operator to configure the database and store the association between the N5 and Rx session.

  • Configurable options supported through custom values file ociwf-custom-values-1.4.0.yaml.
    1. Using CNE Mysql cluster
      1. Edit iwf-mysql:enabled: false (Disables the mysql pod)
      2. Edit iwf-diameterproxy:

        Enter the IP of the primary and secondary mysql nodes in the mysql cluster deployed in CNE.

        dpDBService1: xyz.xyz.xyz.xyz

        dpDBService2: xyz.xyz.xyz.xyz

        Note:

        Along with IP, the DB cluster credentials should be configured.
    2. Local mysql pod

      Note:

      These steps are only applicable for deployment and testing scenario.
      1. Edit iwf-mysql:enabled: true (It brings up the mysql local pod deployment)
      2. Edit iwf-diameterproxy:

        dpDBService1: iwf-pt-mysql-svc

        dpDBService2: iwf-pt-mysql-svc

        This enables the mysql deployment as your database source instead of the cluster.

Reloading ConfigMap

Reloading the IWF-Mediation ConfigMap, if in case any updates were made in the Rules.

The tool ociwf-rule-download_tool.sh can be used to download the rule configmap in a folder (folder name will be configmap name). It needs namespace as well as required configmap name. These rules then can be changed accordingly.

The tool ociwf-rule-upload_tool.sh can be used to upload the rule config map from the existing config map folder. It needs namespace as well as required configmap name to be uploaded.
  • If rules were changed on iwf active mediation, then use ociwf-iwf-mediation-config-active as the name of configmap.
  • If rules were changed on iwf test mediation then use ociwf-iwf-mediation-config-test as the name of the configmap.
Reloading the NF-Mediation ConfigMap, if in case any updates were made in the Rules.
  • The tool ociwf-rule-download_tool.sh can be used to download the rule configmap in a folder (folder name will be configmap name). It needs namespace as well as required configmap name. These rules then can be changed accordingly.
  • The tool ociwf-rule-upload_tool.sh can be used to upload the rule config map from the existing config map folder. It needs namespace as well as required configmap name to be uploaded
  • If rules were changed on nf active mediation, then execute ociwf-nf-mediation-config-active as the name of configmap
  • If the rules were changed on nf test mediation, then execute: ociwf-nf-mediation-config-test as the name of the configmap.

IWF-Mediation Rule Configuration for PT

Add below rules to the mediation rules:

Note:

In the below rules, replace PCF_loadBalancerIP_and_Port and IWF_loadBalancerIP_and_Port with appropriate values.
rule "pt_d2h_AAR_rule_N5_To_Rx"
salience 20
when
m : IWFHttpRequest(header("pt_dest_uri") != null)
then
m.setUri(m.header("pt_dest_uri").replace("pcf.com","10.178.246.13:1000/simulation"))   //"PCF_loadBalancerIP_and_Port"
m.header(m.DEL,"pt_dest_uri")
end
 
rule "pt1_h2d_RAR_rule_N5_To_Rx"
salience 20
when
  m : IWFHttpRequest(getUri() matches ".*(npcf-policyauthorization)*(v1)*(notification)*(notify).*")
then
 m.forwardPath = IWFConsts.FORWARD_TO_H2D
 m.header(m.ADD,"diameterApplicationId","16777236")
 m.header(m.ADD,"diameterCommandCode","258")
 m.header(m.ADD,"original-req-uri",m.getUri())
end
 
rule "pt1-d2h_ASR_rule_N5_To_Rx"
salience 20
when
m : IWFHttpRequest(getUri() matches ".*(npcf-policyauthorization)*(v1)*(notification)*(terminate).*")
then
m.forwardPath=IWFConsts.FORWARD_TO_H2D
m.header(m.ADD,"diameterApplicationId","16777236")
m.header(m.ADD,"diameterCommandCode","274")
m.header(m.ADD,"original-req-uri",m.getUri())
end
 
rule "pt_d2h_AAR_Update_Rx_To_N5"
salience 21
when
m : IWFHttpRequest(m.body("ascReqData:notifUri") != null)
then
m.body(m.UPDATE,"ascReqData:notifUri",update(m.body("ascReqData:notifUri")).replace("iwf.com","10.178.254.158:30079"))  //IWF_loadBalancerIP_and_Port
m.body(m.UPDATE,"ascReqData:evSubsc:notifUri",update(m.body("ascReqData:evSubsc:notifUri")).replace("iwf.com","10.178.254.158:30079"))  //IWF_loadBalancerIP_and_Port
end
 
rule "pt_h2d_ccri_rule_N7_To_Gx"
salience 20
when
m : IWFHttpRequest(getUri() matches ".*(npcf-smpolicycontrol/v1/sm-policies)(/$|$)")
then
m.forwardPath=IWFConsts.FORWARD_TO_H2D
m.header(m.ADD,"diameterApplicationId","16777238")
m.header(m.ADD,"diameterCommandCode","272")
m.header(m.ADD,"requestType","CREATE")
end
 
rule "pt_h2d_ccru_rule_N7_To_Gx"
salience 21
when
m : IWFHttpRequest(getUri() matches ".(npcf-smpolicycontrol/v1/sm-policies/)(.)(/update)(/$|$)")
then
m.forwardPath=IWFConsts.FORWARD_TO_H2D
m.header(m.ADD,"diameterApplicationId","16777238")
m.header(m.ADD,"diameterCommandCode","272")
m.header(m.ADD,"requestType","UPDATE")
m.header(m.ADD,"original-req-uri",m.getUri())
end
 
rule "pt_h2d_ccrt_rule_N7_To_Gx"
salience 21
when
m : IWFHttpRequest(getUri() matches ".(npcf-smpolicycontrol/v1/sm-policies/)(.)(/delete)(/$|$)")
then
m.forwardPath=IWFConsts.FORWARD_TO_H2D
m.header(m.ADD,"diameterApplicationId","16777238")
m.header(m.ADD,"diameterCommandCode","272")
m.header(m.ADD,"requestType","DELETE")
m.header(m.ADD,"original-req-uri",m.getUri())
end

NF-Mediation Rule Configuration

Add below rules to the mediation rules:

rule "default"
when
    m : NFHttpRequest(m.header("source") == "pcf")
then
    m.header(m.DEL, "custom-header-bad")
     
end
 
rule "scp-rule-header-1"
    salience 20
    agenda-group "scp-triggerpoint2"
when
    m : NFHttpRequest(m.header("custom-key") == "123")
then
    m.header(m.ADD, "custom-value", "pcf-nrf")
        m.header(m.UPDATE, "name", "nf","pcfnf")
end
 
rule "scp-rule-body-2"
    salience 21
    agenda-group "scp-triggerpoint2"
when
    m : NFHttpRequest( (m.body("nfType") == "PCF") &&
                       (m.body("fqdn") matches "^(cisco).*") )
then
    m.body(m.ADD, "pcfInfo:supiRangeList[1]:end", "2000000000")
    m.body(m.ADD, "pcfInfo:supiRangeList[1]:start", "1000000000")
 
    m.body(m.UPDATE, "nfServices[1]:ipEndPoints[1]:ipv4Address", "10.75.213.100")
 
    m.body(m.DEL, "nfServices[1]:apiPrefix")
end