Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bitrate support in simapp #25

Merged
merged 2 commits into from
Nov 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
27 changes: 17 additions & 10 deletions config/simapp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,9 @@ configuration:
mtu: 1460
ue-ip-pool: 10.91.0.0/16
ue-dnn-qos:
dnn-mbr-downlink: 20000000
dnn-mbr-uplink: 4000000
dnn-mbr-downlink: 20
dnn-mbr-uplink: 4
bitrate-unit: Mbps
traffic-class: #default bearer QCI/ARP
name: "platinum"
qci: 9
Expand All @@ -65,15 +66,17 @@ configuration:
priority: 25
action: "permit"
endpoint: 0.0.0.0/0
app-mbr-uplink: 100000 #100kbps
app-mbr-downlink: 2000000 #2Mbps
app-mbr-uplink: 100 #100kbps
app-mbr-downlink: 2000 #2Mbps
bitrate-unit: Kbps
traffic-class : "silver" #if same as APN-AMBR then its default bearer rule
- rule-name: rule2
priority: 15
action: "permit"
endpoint: 8.8.8.8/32
app-mbr-uplink: 1000000 #1Mbps
app-mbr-downlink: 4000000 #5Mbps
app-mbr-uplink: 1 #1Mbps
app-mbr-downlink: 5 #5Mbps
bitrate-unit: Mbps
traffic-class : #if same as APN-AMBR then its default bearer rule
name: "silver"
qci: 9
Expand All @@ -84,8 +87,9 @@ configuration:
priority: 25
action: "permit"
endpoint: 8.8.8.4/32
app-mbr-uplink: 120000
app-mbr-downlink: 520000
app-mbr-uplink: 120
app-mbr-downlink: 520
bitrate-unit: Kbps
traffic-class : #this will create new bearer if QCI/ARP combination is different than default QCI/ARP
name: "platinum"
qci: 9
Expand All @@ -99,6 +103,7 @@ configuration:
endpoint: 1.1.1.1/32
app-mbr-uplink: 120000
app-mbr-downlink: 520000
bitrate-unit: bps
traffic-class : #this will create new bearer if QCI/ARP combination is different than default QCI/ARP
name: "gold"
qci: 9
Expand All @@ -112,6 +117,7 @@ configuration:
endpoint: 1.1.1.2/32
app-mbr-uplink: 120000
app-mbr-downlink: 520000
bitrate-unit: bps
traffic-class : #this will create new bearer if QCI/ARP combination is different than default QCI/ARP
name: "diamond"
qci: 9
Expand All @@ -120,8 +126,9 @@ configuration:
pelr: 6
rule-trigger: "timer,0" #immeidate creation of this bearer immediately. Create after 10 sec time.
qos:
uplink: 2000000 #2Mbps
downlink: 5000000 #5Mbps
uplink: 2 #2Mbps
downlink: 5 #5Mbps
bitrate-unit: Mbps
traffic-class: "silver" #default bearer QCI/ARP
site-info:
gNodeBs:
Expand Down
13 changes: 12 additions & 1 deletion simapp.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
"log"
"net"
"net/http"
"reflect"
"strconv"
"strings"
"time"
Expand Down Expand Up @@ -100,12 +101,14 @@ type SliceId struct {
type QosInfo struct {
Uplink int `yaml:"uplink,omitempty" json:"uplink,omitempty"`
Downlink int `yaml:"downlink,omitempty" json:"downlink,omitempty"`
BitRateUnit string `yaml:"bitrate-unit,omitempty" json:"bitrate-unit,omitempty"`
TrafficClass string `yaml:"traffic-class,omitempty" json:"traffic-class,omitempty"`
}

type UeDnnQosInfo struct {
Uplink int `yaml:"dnn-mbr-uplink,omitempty" json:"dnn-mbr-uplink,omitempty"`
Downlink int `yaml:"dnn-mbr-downlink,omitempty" json:"dnn-mbr-downlink,omitempty"`
BitRateUnit string `yaml:"bitrate-unit,omitempty" json:"bitrate-unit,omitempty"`
TrafficClass *TrafficClassInfo `yaml:"traffic-class,omitempty" json:"traffic-class,omitempty"`
}

Expand Down Expand Up @@ -167,6 +170,8 @@ type ApplicationFilteringRules struct {

AppMbrDownlink int32 `yaml:"app-mbr-downlink,omitempty" json:"app-mbr-downlink,omitempty"`

BitRateUnit string `yaml:"bitrate-unit,omitempty" json:"bitrate-unit,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

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

bitrate-unit or bitrateUnit ?


TrafficClass *TrafficClassInfo `yaml:"traffic-class,omitempty" json:"traffic-class,omitempty"`

RuleTrigger string `yaml:"rule-trigger,omitempty" json:"rule-trigger,omitempty"`
Expand Down Expand Up @@ -320,7 +325,8 @@ func sendHttpReqMsg(req *http.Request) (*http.Response, error) {
}

if rsp.StatusCode == http.StatusAccepted ||
rsp.StatusCode == http.StatusOK || rsp.StatusCode == http.StatusNoContent {
rsp.StatusCode == http.StatusOK || rsp.StatusCode == http.StatusNoContent ||
rsp.StatusCode == http.StatusCreated {
log.Println("config push success")
return rsp, nil
} else {
Expand Down Expand Up @@ -534,6 +540,11 @@ func compareNetworkSlice(sliceNew *NetworkSlice, sliceOld *NetworkSlice) bool {
log.Println("Traffic Class changed ")
return true
}
appFilteringRulesNew := sliceNew.ApplicationFilteringRules
appFilteringRulesOld := sliceOld.ApplicationFilteringRules
if reflect.DeepEqual(appFilteringRulesNew, appFilteringRulesOld) == false {
return true
}
for _, ng := range sliceNew.DevGroups {
found := false
for _, og := range sliceOld.DevGroups {
Expand Down