-
Notifications
You must be signed in to change notification settings - Fork 851
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
Handshake and internal processing for socket groups #1119
Handshake and internal processing for socket groups #1119
Conversation
…/srt into dev-pre-group-api-complementary
…-group-api-complementary
srtcore/api.cpp
Outdated
CTimer::triggerEvent(); | ||
|
||
CTimer::triggerEvent(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
srtcore/buffer.h
Outdated
int capacity() const { return m_iSize; } // XXX WHY it was changed to m_iSize-1 ? | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// XXX WHY it was changed to m_iSize-1 ?
This comment was already removed from one of the previous PRs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I'll remove this. We'll research during the reimplementation
srtcore/packet.cpp
Outdated
// XXX EXPERIMENTAL. Pass the 32-bit integer here. | ||
m_nHeader[SRT_PH_MSGNO] = *lparam; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
alignment
srtcore/core.cpp
Outdated
int32_t groupdata[GRPD__SIZE]; | ||
if ( bytelen < GRPD__SIZE * GRPD_FIELD_SIZE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extra space after the left brace
srtcore/core.cpp
Outdated
//SRTSOCKET master_peerid = groupdata[GRPD_MASTERID]; | ||
//int32_t tdiff = groupdata[GRPD_MASTERTDIFF]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
delete commented code
srtcore/core.cpp
Outdated
/* | ||
|
||
// Synchronize the TSBPD PEER start time with the existing connection, | ||
// if there exists the connection with given peer. | ||
if (master_peerid != -1) | ||
{ | ||
// Here "I am a peer", so this is the socket ID of local socket of a parallel connection. | ||
// Check if it exists, if not, reject the connection. | ||
CUDTSocket* master = s_UDTUnited.locateSocket(master_peerid, s_UDTUnited.ERH_RETURN); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delete commented code
srtcore/core.cpp
Outdated
#ifndef SRT_TEST_DISABLE_KEY_CONTROL_PACKETS | ||
sendCtrl(UMSG_DROPREQ, &w_packet.m_iMsgNo, seqpair, sizeof(seqpair)); | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was already removed from one of the previous PRs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merging again...
srtcore/core.cpp
Outdated
|
||
bool need_tsbpd = m_bTsbPd || m_bGroupTsbPd; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const bool need_tsbpd
srtcore/core.cpp
Outdated
// XXX move this code do CUDT::defaultPacketArrival and call it from here: | ||
|
||
// srt_loss_seqs = CALLBACK_CALL(m_cbPacketArrival, rpkt); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure whether this comment should stay, but at least no need in extra blank lines
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should stay. This is where the parallel packet lossreport prevention should be added. It's an important improvement for broadcast groups.
srtcore/core.cpp
Outdated
int initial_loss_ttl = 0; | ||
if ( self->m_bPeerRexmitFlag ) | ||
initial_loss_ttl = self->m_iReorderTolerance; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const int initial_loss_ttl = (self->m_bPeerRexmitFlag)
? 0
: self->m_iReorderTolerance;
srtcore/core.cpp
Outdated
int32_t seqlo = CSeqNo::incseq(self->m_iRcvCurrSeqNo); | ||
int32_t seqhi = CSeqNo::decseq(pkt.m_iSeqNo); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const
Hi @ethouris , may I ask you a question about these codes?
The logging says I guess the correct code should be like this?
Correct me if I'm wrong, thanks! |
Ok, I'm not sure what this exactly is without more time spent on the analysis, but what I can see here is that the value The problem here was that in UDT the idea was that the packet doesn't get the sequence number at the time when it's being scheduled for sending; this number is given to the packet only at the sending queue. It's not even set when inserting into the queue, it's given to it at the time when the next packet is being picked up for sending. This was a problem for the group implementation that has been created on top of socket sending (let's say, without a strong refax of the code, in this case the sending facilities and the sender buffer, it wasn't possible to do any other way). And as a single packet had to be sent over possibly multiple connections at once, it should have the same sequence number on all member connections. Therefore there had to be one central place where this value has to be controlled, and as it was the group, it must have been decided before you call the single-socket sending procedure. It was expected though that the sequence numbers will roll in both systems the same way, which means that the only way how you can have a different "scheduling sequence" and "internal sequence" was the very first packet sending after activation of an idle link. |
@ethouris Thanks for you explanation.
"extraction sequence" should be |
Ups, maybe actuallly I should have spent more time on the analysis ;). Ok, it's done only as a replacement for previous "increasing the sequence by 1", so not in a situation when these sequences differ. Here the already set sequence is taken as a good deal. Whether the sequence of the packet being sent currently will be effectively dropped, is another matter. At least what I can see is likely that it will be, as dropping uses simply a pair of two sequences and the message is treated as if a packet was received previously with the sequence being the later one. If you have that case, you should see in the logs the packet sent after this |
If the |
Search for the instruction that assigns to this field. It's about 10 lines down. |
Did you mean
i.e. |
Or did you mean |
Let me try to start over. The "extraction sequence" (the value written in The extraction sequence should be used always in case when this is a socket connection, and it gets increased a few lines above. Whether this upper value of the sequence should be decreased, I'm not sure. It will be then used in |
No description provided.