-
Notifications
You must be signed in to change notification settings - Fork 221
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
Adding message (de)serializing for connection-oriented SCCP messages #242
Comments
Hello @vmykhailiuk thanks for your contribution. I added you PR to master branch #243. My comments:
We need to create a set of methods for new connected-oriented messages (and add them also into MessageFactory interface). We may not have a method "SccpMessageImpl createMessage(int type, int opc, int dpc, int sls, int networkId)". Please update the class / interface / tests for this case.
|
PS: a list of added commits I will put into an initail issues for this topic: |
Hi @vetss
SccpDataMessage createDataMessageClass0(SccpAddress calledParty, SccpAddress callingParty, byte[] data, int localSsn, boolean returnMessageOnError, HopCounter hopCounter, Importance importance);
SccpDataMessage createDataMessageClass1(SccpAddress calledParty, SccpAddress callingParty, byte[] data, int sls, int localSsn, boolean returnMessageOnError, HopCounter hopCounter, Importance importance);
// SccpNoticeMessage createNoticeMessage(ReturnCause returnCause, int outgoingSls, SccpAddress calledParty, SccpAddress callingParty, byte[] data, HopCounter hopCounter, Importance importance); What methods should be added to MessageFactory and MessageFactoryImpl: public SccpMessageImpl createMessageClass2(int type, int sls, int localSsn) {
SccpMessageImpl msg = null;
switch (type) {
case SccpMessage.MESSAGE_TYPE_CR:
msg = new SccpConnCrMessageImpl(this.sccpStackImpl.getMaxDataMessage(), sls, localSsn);
break;
// other message types of protocol class 2
}
return msg;
}
public SccpMessageImpl createMessageClass3(int type, int sls, int localSsn) {
SccpMessageImpl msg = null;
switch (type) {
case SccpMessage.MESSAGE_TYPE_CR:
msg = new SccpConnCrMessageImpl(this.sccpStackImpl.getMaxDataMessage(), sls, localSsn);
break;
// other message types of protocol class 3
}
return msg;
} or public SccpConnAkMessage createAkMessageClass3(int sls, int localSsn, LocalReference reference, ReceiveSequenceNumber receiveSequenceNumber, Credit credit) {
}
// other per-message type factory methods
public SccpConnRlsdMessage createRlsdMessageClass23(int sls, int localSsn, LocalReference destinationLocalReferenceNumber, LocalReference sourceLocalReferenceNumber, . . .) {
} ?
|
Hello @vmykhailiuk
createDataMessageClass1() and createDataMessageClass2() - this is messages for creating DATA messages from outside of SCCP stack == for a SCCP stack user. For connected-oriented case we need to think which messages are needed for a SCCP stack user. This depends on a future management interface of SCCP stack. If for example for connection creating a user will invoke an interface method like "establishConnection()" and an argument will be "XXXMessage" than we need to create the concrete method in factory to create a concrete primitive. We may have a separate discussion of management interfaces. As for live traces, I got you. Better to update unit tests when you have live traces to be sure. |
Hi @vetss Designed the following API for connection-oriented protocol classes. Going to add such methods to MessageFactory: SccpConnCrMessage createConnectMessageClass2(SccpAddress calledAddress, SccpAddress callingAddress, byte[] data, Importance importance);
SccpConnCrMessage createConnectMessageClass3(SccpAddress calledAddress, SccpAddress callingAddress, Credit credit, byte[] data, Importance importance);
SccpConnDt1Message createDataMessageClass2(LocalReference destinationLocalReferenceNumber, SegmentingReassembling segmentingReassembling, byte[] data);
SccpConnDt2Message createDataMessageClass3(LocalReference destinationLocalReferenceNumber, SequencingSegmenting sequencingSegmenting, byte[] data); Creating interfaces SccpConnection, SccpClass2Connection, SccpClass3Connection: public interface SccpConnection {
int getSls();
// source local reference
LocalReference getSlr();
// destination local reference
LocalReference getDlr();
void disconnect(ReleaseCause reason, byte[] data);
// not available after disconnect
boolean isAvailable();
}
public interface SccpClass2Connection extends SccpConnection {
void send(SccpConnDt1Message message);
}
public interface SccpClass3Connection {
Credit getCredit();
void send(SccpConnDt2Message message);
void reset(ResetCause reason);
} Adding methods to SccpListener: // can call conn.confirm() or conn.disconnect(...) with refuse reason and data
void onConnectIndication(SccpPendingConnection conn, SccpAddress calledAddress, SccpAddress callingAddress, ProtocolClass clazz, Credit credit, byte[] data, Importance importance);
void onConnectConfirm(SccpConnection conn);
void onDisconnectIndication(SccpConnection conn, ReleaseCause reason, byte[] data);
void onResetIndication(SccpConnection conn, ResetCause reason);
void onResetConfirm(SccpConnection conn); SccpPendingConnection interface is: public interface SccpPendingConnection {
// can be used only in SccpListener.onConnect
void disconnect(RefusalCause reason, byte[] data);
void confirm();
} Adding method to SccpProvider: // intiates establishment of connection
void establishConnection(SccpConnCrMessage message) throws IOException; Adding extra method to RefusalCause, ReleaseCause: DisconnectOriginator getOriginator(); where DisconnectOriginator is enum: public enum DisconnectOriginator {
NSU, NSP, RESERVED, UNDEFINED;
//. . .
} Please comment could I continue implementing it or something should be changed in API. |
Hello @vmykhailiuk thanks for sharing your interfaces data, I have some comments for your solution:
If you need to discuss anything else, please let me know. |
Hi @vetss Thanks for your comments and quick response.
|
Hello @vmykhailiuk your PR #244 looks good for me, I have added it into a amaster branch. Looks forward to a core level implmentation. |
Hi @vetss Thanks for reviewing my pull request. Have following notes about pull request #246. BaseSccpListener was created to avoid declaring connection-oriented listener methods in test listeners used by non connection-oriented tests.
Each case requires different messages sent in case of error (correspondingly):
There is some duplication of routing code methods but they have error handling differences. SccpConnCrMessageImpl doesn’t inherit SccpAddressedMessageImpl because that won’t allow using the same method for handling all addressed messages anyway (it would be too large and would consist from two similar parts for handling CR and non-CR messages routing) and also because it doesn’t need getReturnMessageOnError, clearReturnMessageOnError methods. |
Segmenting / reassembling, flow control / (flow control window) case, message transit are planned to be implemented later. |
Hello @vmykhailiuk I can treat the update as draft one because not all staff is implemented and therefor I do not add it into a main repo. I have not checked also tests. My comments for the current update:
Routing for connectionless messages and a CR message looks for me more or less similar. But now after your implementation we have doubled code methods with code that is more or less same that will make code maintananse more difficult in future. Routing of connection-oriented messages (including CC) is much different as compare with a) and b) and we can and much simplier. We do not need to make any transaltion, any SSN / address analisys etc. All routing info must be already connected into a Connection object and simply reused. I see we can simplify this part by usage of may be two methods like Please provide if agree for my suggestions for "7)" or give me your doubts why it is bad / unreachable / very difficult. We can make a separate discussion for this topic. PS: now is an important step when we have to incorparate new functionality (connection-oriented messageflow) into a core level. We need to make it carefully to avoid of current fuctionality break. |
Hello @vmykhailiuk I checked you two last updates from PR and they looks good for me. Sorry for some delays in processing.
This is a separate branch that contains all updtes from you : |
Inherited SccpConnCrMessageImpl from SccpAddressedMessageImpl and reused SccpAddressedMessageImpl routing scenarios as per 7). |
Hello @vmykhailiuk I have added a commit from your PR #251 into "sccp-co" branch. SccpRoutingControl looks much better now. And I see not functionality is already fuly implemented. My comments:
I can not check the whole code and may be mistaken for some raised issues, we can discuss. |
@vetss |
Hello @vmykhailiuk thanks for your update, I see a big progress. Please check my comments here:
I will add you commit into a "sccp-co" branch and we need to fix issues to finish the work. |
@vetss As for
It's correct. In Q.714
|
Hello @vmykhailiuk I have added your PR #255 into sccp-co branch. Commants:
|
Hi @vetss |
Hello @vmykhailiuk I have checked your PR and a commit "SCCP credit fixes". I hope this commit contains your update for changing of message sequensing and I have not missed anything. The second commit was for TCAP stack error fix. I have checked your update for changing of message sequensing. I still have doubts of we make it in a proper way.
We definitely need a set of unit tests to finish of sequensing. Please finish this step. PS: I added 2 commits from your PR 256 to a master branch |
Hello @vmykhailiuk can we finish of fixing of issues form my comments in short time ? |
@vetss
|
Hello @vmykhailiuk I see we have a big progress. Thanks for your work.
I need to make some extra checking of your code before we can merge it into master branch. |
Hello @vmykhailiuk please check my next comments after checking of the implementation
|
Hi @vetss
|
Hello @vmykhailiuk I have made checking and testing of whole code. Code is now here: What made:
Comments for possible missing parts:
PS: let's avoid of bit code refactoring from now to minimize of possible breaks for what we have already tested and make kust bug fixing, testing. |
Hello @vmykhailiuk I have added your 3 commits and my commit for a field changing into sccp-co branch and I finished of testing and code checking. What I see which unit tests are missed. I tried to imaging some life cases (if any of this tests are already implemented then sorry for mentioning them, please let me know where to find them):
This is a list for what I have questions/doubts for implementation:
PS: I have not checked how well the implementation fits to a way we process error cases (proper local actions, proper sent error codes, full checking of incoming message content etc). |
Hi @vetss
Other: b) Updated implementation and added tests for incorrect msg.getSourceLocalReferenseNumber() :
c) added re-initialization as discussed. |
Hello @vmykhailiuk I added all code into jss7 master branch. I am closing this issue now as solved. If any bug are found we can open separate issues for them. |
Created interfaces for various SCCP connection-oriented messages and their implementation with (de)serializing support.
Going to create pull request (major patch) with corresponding changes.
The text was updated successfully, but these errors were encountered: