-
Notifications
You must be signed in to change notification settings - Fork 152
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
Migrate jDiameter to Netty #35
Comments
TCPClientConnection & TCPTransportClient are used by both diameter server and client. |
I went through the code and seems like changing to netty requires a bit of refactoring or may be i need more understanding of the code. The problems i am facing specifically are: 1- Client and Server both are using same TCPClientConnection class which I want to separate. I will need some assistance how to do that. 2- I am trying to understand the purpose of NetworkGuard and when it is used? I am attaching a client side NettyTransportClient that i created for review. There are other parts of transport which will benefit from refactoring e.g. Connection Listener and Event logic is duplicated in all transports TCP, TLS etc. Connection Listeners are blocking i.e. when an event e.g. message received is raised, all the connection listeners are called in blocking which blocks the worker thread instead it should be asynchronous and we can use e.g. guava event bus for handling events. What are your thoughts? |
Hi @jehanzebqayyum, thanks for your interest in this contribution. As per your queries, I will try to explain as I can.
In jDiameter it's a common pattern to have the basic/common functionality in the client side and the server extending it with additional features. In this case it's pretty much the same, except the naming might not be the most clear. So, on the client side we have:
These are the basics for a Diameter peer to operate, be it a server or a client, receive the bytes, transform them into a Diameter message and deliver it to the listeners. Also, always keep in mind that in Diameter both client or server might initiate the session with a message and even any of them may initiate the connection.
So, in case of the server, we need to open a port for incoming connections. We have the following:
So, I think this should make it clear that there's no need for distinct TCPTransportClient or TCPTransportClient as the tasks they perform are quite delimited and common to any type of peer. Also should be taken into account the modularity of jDiameter, where all these components are changeable by custom implementations, thus the need of these separation of concerns. I will review the NettyTransportClient.java you have attached, at first look it seems correct, but haven't yet had the time to fully review and test it, but wanted to try to answer your questions ASAP. Feel free to make any changes to it meanwhile, if you feel necessary and if this explanation might have caused any difference to it. |
Thanks for the guidance. Base on the input i updated TCPClientConnection, TCPClientTransport (NettyTransportClient) and NetworkGuard. Attached updated. A couple of more questions, hope you do not mind: Meanwhile i will be testing the changes. NettyTransportClient.java.txt |
@jehanzebqayyum it may be easier for review if you fork the project, commit your changes in your own branch and push to your fork and do a pull request for review as described in our Open Source Playbook |
Done. Please review the pull request and provide your comments. Best Regards, On Thu, May 12, 2016 at 12:57 AM, Jean Deruelle notifications@github.com
|
Thanks @jehanzebqayyum ! @brainslog will review. |
Should TLS negotiation happen in connection establishment or CER/CEA? Below is what i found out: Secondly this is what i found for inband security id in RFC6733: Inband-Security-Id AVP The Inband-Security-Id AVP (AVP Code 299) is of type Unsigned32 and Any comments? Best Regards, On Mon, May 16, 2016 at 1:49 PM, Jean Deruelle notifications@github.com
|
@jehanzebqayyum, regarding TLS we are working in parallel on issue #14 . The idea will be to have both ways working. We surely want RFC 6733 behavior to be the default, but most implementations seem to still be using RFC 3588, so we also need to have it for interop. Implementing RFC 3588 is likely (still) the most useful and the most challenging one, so that'd be a good start :) |
@brainslog quick questions |
@jehanzebqayyum, both server and client need to prepare for TLS after sending/receiving the CEA, and setup the HandshakeCompletedListener. As for the check of EXPERIMENTAL_RESULT, it's likely just a "fallback" mechanism when no Result-Code is present. It can probably be safely discarded. |
@jehanzebqayyum where you able to move forward thanks to @brainslog comments ? Anything blocking ? |
Yes i almost finished TLS implementation. Since there are no test case for Thanks
|
@brainslog https://github.com/brainslog where can i find sample TLS Best Regards, On Wed, Jun 1, 2016 at 12:36 PM, jz jehanzeb.qayyum@gmail.com wrote:
|
@jehanzebqayyum, I don't think we have any ready, will need to prepare it. Or maybe @coolface88 who's working on #14 might have some already ? If not, I'll try to provide you with it by next week. BTW, regarding TCP, I've made some comments to the PR #39 as it seems it has some functional issues. |
@jehanzebqayyum just checking if you have been able to move forward on that ? |
Well i am trying to resolve following issue with TLS implementation. io.netty.handler.codec.DecoderException: Client config looks like this:
Server config has following:
public static SslContext getSslContextForClient(Configuration config) .keyManager(getKeyManagerFactory(config)).trustManager(getTrustManagerFactory(config)).build(); public static SslContext getSslContextForServer(Configuration config) On Fri, Jun 10, 2016 at 8:40 PM, Jean Deruelle notifications@github.com
|
@jehanzebqayyum were you able to debug it ? try to make sure the key manager is not null http://stackoverflow.com/a/15144731/118052 |
Yes in fact the ssl debug log showed that the key i was using did not match I used default jdk keytool option to generate key pair which resulted in I resolved it by specifying RSA as the keyalg. And finally i was able to run a functional test I will push my changes soon. On Mon, Jun 13, 2016 at 5:23 PM, Jean Deruelle notifications@github.com
|
@brainslog did you check? On Jun 13, 2016 10:58 PM, "jz" jehanzeb.qayyum@gmail.com wrote:
|
hi @deruelle, are you referring Restcomm/sctp netty branch? I do not see netty-2. |
@jehanzebqayyum since my comment the master branch is now netty enabled so you can use https://github.com/RestComm/sctp/tree/master. |
I have created an issue that explain details for switching to new SCTP lib versions |
Move all the IO layer to Netty.
The text was updated successfully, but these errors were encountered: