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

apn fqdn encode fix #319

Merged
merged 2 commits into from Aug 16, 2021
Merged

Conversation

badhrinathpa
Copy link
Contributor

@badhrinathpa badhrinathpa commented Aug 13, 2021

In PFCP versions before 16.3 we send User Plane IP Resource Information in association setup response.
This contains the network instance (DNN) parameter which should be encoded as FQDN. But it is encoded as string.
This can be fixed in the go-pfcp library also. But since the whole User Plane IP Resource Information parameter itself is deprecated, we are doing this change in pfcp agent. This will be updated when we start supporting release 16 and above in 5gc and upf.

@krsna1729
Copy link
Member

Update the description of the commit and the first comment in this conversation. Have the description point to relevant section of spec. Also should this be handled upstream in go-pfcp library or not.

@@ -73,6 +73,7 @@ func (pc *PFCPConn) handleAssociationSetupRequest(upf *upf, msg message.Message,
// Timestamp shouldn't be the time message is sent in the real deployment but anyway :D
log.Println("Dnn info : ", upf.dnn)

networkInstance := encodeFQDN(upf.dnn)
Copy link
Member

@krsna1729 krsna1729 Aug 14, 2021

Choose a reason for hiding this comment

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

Suggested change
networkInstance := encodeFQDN(upf.dnn)
networkInstance := string(ie.NewNetworkInstanceFQDN(upf.dnn).Payload)

Copy link
Contributor

Choose a reason for hiding this comment

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

is ie.NewNetworkInstanceFQDN available in go-pfcp ?

Copy link
Member

Choose a reason for hiding this comment

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

Comment on lines 42 to 57
func encodeFQDN(fqdn string) string {
b := make([]byte, len(fqdn)+1)

var offset int

for _, label := range strings.Split(fqdn, ".") {

l := len(label)
b[offset] = uint8(l)
copy(b[offset+1:], label)
offset += l + 1
}

return string(b)
}

Copy link
Member

Choose a reason for hiding this comment

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

we can remove this function

@krsna1729
Copy link
Member

Split the commits for DNN and lint fixes

@@ -73,6 +73,7 @@ func (pc *PFCPConn) handleAssociationSetupRequest(upf *upf, msg message.Message,
// Timestamp shouldn't be the time message is sent in the real deployment but anyway :D
log.Println("Dnn info : ", upf.dnn)

networkInstance := string(ie.NewNetworkInstanceFQDN("internet").Payload)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
networkInstance := string(ie.NewNetworkInstanceFQDN("internet").Payload)
networkInstance := string(ie.NewNetworkInstanceFQDN(upf.dnn).Payload)

@badhrinathpa
Copy link
Contributor Author

retest this please

1 similar comment
@badhrinathpa
Copy link
Contributor Author

retest this please

@thakurajayL thakurajayL merged commit 31c5985 into omec-project:master Aug 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants