Skip to content

[FeG][Orc8r] Add charging characteristics filter for Virtual APN#4164

Merged
themarwhal merged 1 commit intomagma:masterfrom
themarwhal:virtual-apn
Dec 24, 2020
Merged

[FeG][Orc8r] Add charging characteristics filter for Virtual APN#4164
themarwhal merged 1 commit intomagma:masterfrom
themarwhal:virtual-apn

Conversation

@themarwhal
Copy link
Copy Markdown
Member

@themarwhal themarwhal commented Dec 23, 2020

Signed-off-by: Marie Bremner [email protected]

Summary

Our current VirtualAPN config is the following:

type VirtualApnRule struct {

	// Regex to match APN values
	ApnFilter string `json:"apn_filter,omitempty"`

	// New APN to overwrite when filter matches
	ApnOverwrite string `json:"apn_overwrite,omitempty"`
}

where SessionProxy replaces any APNs that match the APNFilter (RegEx) with the ApnOverwrite value.
This is not sufficient as we want to be able to also case on the charging characteristics as well.

The goal of this issue is to extend this configuration to include a ChargingCharacteristicsFilter (RegEx) to also case on the incoming session context.
The new logic will be: any session with APN that satisfies ApnFilter and Charging Characteristics that satisfies ChargingCharacteristicsFilter will have its APN replaced with ApnOverwrite.

NEW

type VirtualApnRule struct {

	// Regex to match APN values
	ApnFilter string `json:"apn_filter,omitempty"`

	// Regex to match Charging Characteristics values
	ChargingCharacteristicsFilter string `json:"charging_characteristics_filter,omitempty"`

	// New APN to overwrite when filter matches
	ApnOverwrite string `json:"apn_overwrite,omitempty"`
}

Test Plan

FeG precommit, Orc8r precommit
Local Orc8r API testing
Some hacky testing with the CWF integ test setup to test CCR creations from a static gateway.mconfig

Additional Information

  • This change is backwards-breaking

@themarwhal themarwhal changed the title [wip]Add charging characteristics filter for Virtual APN [FeG]Add charging characteristics filter for Virtual APN Dec 23, 2020
@themarwhal themarwhal linked an issue Dec 23, 2020 that may be closed by this pull request
@themarwhal themarwhal added the component: feg FEG-gateway related issues label Dec 23, 2020
@themarwhal themarwhal changed the title [FeG]Add charging characteristics filter for Virtual APN [FeG][Orc8r][FOR1.4!] Add charging characteristics filter for Virtual APN Dec 23, 2020
}
virtualApnConfigs = append(virtualApnConfigs, apnRule)
log.Printf("Virtual APN Rule Activated filter: %s, Overwrite: %s", virtualApnlCfg.GetApnFilter(), virtualApnlCfg.GetApnOverwrite())
glog.Infof("Virtual APN Rule Activated filter: %s, Overwrite: %s", pVirtualApnCfg.GetApnFilter(), pVirtualApnCfg.GetApnOverwrite())
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure if GenerateVirtualApnRules is triggered per each request or just at init. But if this is per request, then we should be setting this as V(2)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is done everytime the service starts. So Info is probably OK. :)

@magmabot magmabot added component: agw Access gateway-related issue component: cwag CWAG related issues labels Dec 23, 2020
Copy link
Copy Markdown
Contributor

@hcgatewood hcgatewood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cloud changes lgtm

Comment thread feg/protos/mconfig/mconfigs.proto Outdated
}

message VirtualApnRule {
// Regex to match APN values
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here and elsewhere -- prefer golang-style doc comments, i.e. start the comment with // apn_filter is a regex ...

TgppContext tgpp_ctx = 15;
CommonSessionContext common_context = 16;
RatSpecificContext rat_specific_context = 17;
string charging_characteristics = 18;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not for this PR but: the lack of doc comments in this proto file is a bit sad 😥

}

// getAPNfromConfig returns a new apn value to overwrite the one in the request based on list of regex definied in Gx config.
// getAPNFromConfig returns a new apn value to overwrite the one in the request based on list of regex definied in Gx config.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Golang convention (in Magma codebase and in stdlib) is to wrap comments to 79 chars

@themarwhal themarwhal self-assigned this Dec 24, 2020
@themarwhal themarwhal changed the title [FeG][Orc8r][FOR1.4!] Add charging characteristics filter for Virtual APN [FeG][Orc8r] Add charging characteristics filter for Virtual APN Dec 24, 2020
@themarwhal themarwhal merged commit 25b5738 into magma:master Dec 24, 2020
@themarwhal themarwhal deleted the virtual-apn branch January 5, 2021 11:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: agw Access gateway-related issue component: cwag CWAG related issues component: feg FEG-gateway related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[VirtualAPN] APN replacement based on charging characteristics

4 participants