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

feat: use max QFI value in a pdu session as GRE tunnel key #6

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ LDFLAGS = -X github.com/free5gc/version.BUILD_TIME=$(BUILD_TIME) \

n3iwue: clean
@echo "Start building $(@F)...."
go mod tidy
CGO_ENABLED=0 go build -gcflags "$(GCFLAGS)" -ldflags "$(LDFLAGS)" -o $(ROOT_PATH)/$@ $(@F).go

debug: GCFLAGS += -N -l
Expand Down
2 changes: 1 addition & 1 deletion config/n3ue.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ configuration:
SQN: 16f3b3f71005
AMF: 8000
OP: b672047e003bb952dca6cb8af0e5b779
OPC: df0c67868fa25f748b7044c6e7c245b8
OPC: df0c67868fa25f748b7044c6e7c245b8 # not support
logger:
N3UE: # the kind of log output
debugLevel: trace # how detailed to output, value: trace, debug, info, warn, error, fatal, panic
Expand Down
2 changes: 1 addition & 1 deletion internal/gre/gre.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func SetupGreTunnel(greIfaceName, parentIfaceName string, ueTunnelAddr, n3iwfTun
)

if qoSInfo != nil {
greKeyField |= (uint32(qoSInfo.QfiList[0]) & 0x3F) << 24
greKeyField |= (uint32(qoSInfo.MaxQFI()) & 0x3F) << 24
}

if parent, err = netlink.LinkByName(parentIfaceName); err != nil {
Expand Down
8 changes: 8 additions & 0 deletions internal/qos/qos.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,11 @@ func Parse5GQoSInfoNotify(n *message.Notification) (info *PDUQoSInfo, err error)

return
}

func (pduQosInfo PDUQoSInfo) MaxQFI() uint8 {
var maxQfi uint8 = 0
for _, qfi := range pduQosInfo.QfiList {
maxQfi = max(maxQfi, qfi)
}
return maxQfi
}
19 changes: 13 additions & 6 deletions pkg/procedure/Procedure.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,20 @@ func StartProcedure() {
}
case context.PduSessionCreated:
AppLog.Info("PduSession Created")
if err := TestConnectivity("8.8.8.8"); err != nil {
AppLog.Errorf("ping fail : %+v", err)

pingDest := "1.1.1.1"
if err := TestConnectivity(pingDest); err != nil {
AppLog.Errorf("ping fail %s: %+v", pingDest, err)
} else {
logger.NASLog.Infof("ULCount=%x, DLCount=%x",
n3ueSelf.RanUeContext.ULCount.Get(),
n3ueSelf.RanUeContext.DLCount.Get())
AppLog.Info("Keep connection with N3IWF until receive SIGINT or SIGTERM")
pingDest = "8.8.8.8"
if err := TestConnectivity(pingDest); err != nil {
AppLog.Errorf("ping fail %s: %+v", pingDest, err)
} else {
logger.NASLog.Infof("ULCount=%x, DLCount=%x",
n3ueSelf.RanUeContext.ULCount.Get(),
n3ueSelf.RanUeContext.DLCount.Get())
AppLog.Info("Keep connection with N3IWF until receive SIGINT or SIGTERM")
}
}
}
}
Expand Down
Loading