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

Network Instance IE encoding problem #86

Closed
diallama opened this issue May 7, 2021 · 2 comments
Closed

Network Instance IE encoding problem #86

diallama opened this issue May 7, 2021 · 2 comments

Comments

@diallama
Copy link

diallama commented May 7, 2021

I'm trying through your library to mount a session on the travelping UPF but it can't read Network Instance IE. when i asked them they told me it was related to the encoding (your IE instance is encoded as a DNN name while theirs is encoded as an APN name).

My question is if it would be possible to adapt your Network Instance IE?
Thanks in advance

here his the full upg-travelping response:

Network Instance IE encoding is wrong. The value is encoded as DNN name, but UPG expects a APN name there.

TS 29.244 is very confusing on the details of how Network Instance needs to be encoded. It states that APN is not encoded as FQDN string, that implies the same encoding as in the GTP APN IE is used. The specification is silent about how a DNN is encoded into that IE. That has lead some implementations to encode DNN's as plain binary (FQDN with dots in there, no length indicators).

UPG only understands APN encoding at the moment.

@wmnsk
Copy link
Owner

wmnsk commented May 8, 2021

In short: you can encode/decode in the expected format by using NewNetworkInstanceFQDN/NetworkInstanceFQDN that I've just added in #87.

Since I'm implementing IEs in the quite straightforward way(=just as what the spec says), this kind of problem sometimes happens(cf. #82), and the report like this is very helpful. Thank you (and travelping folks) 😆

BTW, the ie.IE type is implemented so flexibly that you can get the same output in this way (a little hacky but might be helpful when you face similar issues).

	ni := ie.NewAPNDNN("example.net") // create an APN/DNN
	ni.Type = ie.NetworkInstance // overwrite the type

And by this hack, suppose you have an DNN IE and want to create a new Network Instance IE with that value, you can just use DNN with type modified, which is a little bit more efficient than creating a new IE (but less readable and may cause another issue, though).

@diallama
Copy link
Author

Thank you for your explanations and your quick response.
It works now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants