|
|
Created:
3 years, 10 months ago by elad.alon Modified:
3 years, 9 months ago CC:
webrtc-reviews_webrtc.org, tterriberry_mozilla.com, zhuangzesen_agora.io, danilchap, mflodman Target Ref:
refs/heads/master Project:
webrtc Visibility:
Public. |
DescriptionGetTransportFeedbackVector return vector with lost packets too, sorted by seq-num
1. GetTransportFeedbackVector will now return a vector which also explicitly states lost packets.
2. The returned vector is unsorted (uses default order - by sequence number). It's up to the users to sort otherwise, if they need a different order.
BUG=None
Review-Url: https://codereview.webrtc.org/2707383006
Cr-Commit-Position: refs/heads/master@{#17114}
Committed: https://chromium.googlesource.com/external/webrtc/+/ec304f96b30ef679708971889b2fcab15481fb1b
Patch Set 1 #
Total comments: 9
Patch Set 2 : . #
Total comments: 4
Patch Set 3 : Efficiency improvement. #Patch Set 4 : nits #Patch Set 5 : Response to CR #
Total comments: 4
Patch Set 6 : Response to CR. #Patch Set 7 : Rebased and event-log-visualizer modified. #
Total comments: 3
Patch Set 8 : CR response #
Total comments: 1
Patch Set 9 : SortPacketFeedbackVector moved out of class. #
Messages
Total messages: 27 (8 generated)
stefan@webrtc.org changed reviewers: + stefan@webrtc.org
https://codereview.webrtc.org/2707383006/diff/1/webrtc/modules/congestion_con... File webrtc/modules/congestion_controller/delay_based_bwe.cc (right): https://codereview.webrtc.org/2707383006/diff/1/webrtc/modules/congestion_con... webrtc/modules/congestion_controller/delay_based_bwe.cc:450: std::sort(output->begin(), output->end(), PacketFeedbackComparator()); Should we do this in-place instead and just ignore kLost packets in the loop on line 284? https://codereview.webrtc.org/2707383006/diff/1/webrtc/modules/congestion_con... File webrtc/modules/congestion_controller/transport_feedback_adapter.cc (right): https://codereview.webrtc.org/2707383006/diff/1/webrtc/modules/congestion_con... webrtc/modules/congestion_controller/transport_feedback_adapter.cc:141: for (; seq_no != packet.sequence_number(); ++seq_no) { Should we have a limit to how many lost packets we insert? Just to avoid building a huge vector in case we receive some corrupt packet or a packet gets lost on the web and arrive super late.
https://codereview.webrtc.org/2707383006/diff/1/webrtc/modules/congestion_con... File webrtc/modules/congestion_controller/delay_based_bwe.cc (right): https://codereview.webrtc.org/2707383006/diff/1/webrtc/modules/congestion_con... webrtc/modules/congestion_controller/delay_based_bwe.cc:450: std::sort(output->begin(), output->end(), PacketFeedbackComparator()); On 2017/02/24 09:28:57, stefan-webrtc wrote: > Should we do this in-place instead and just ignore kLost packets in the loop on > line 284? The way I see it, we have to duplicate the input to make sure we can define it as const, which seems like a design requirement to me (but I am open for discussion, of course). And if we copy, we might as well not copy elements we'll not really need, thereby also making the sort quicker. Wdyt? https://codereview.webrtc.org/2707383006/diff/1/webrtc/modules/congestion_con... File webrtc/modules/congestion_controller/transport_feedback_adapter.cc (right): https://codereview.webrtc.org/2707383006/diff/1/webrtc/modules/congestion_con... webrtc/modules/congestion_controller/transport_feedback_adapter.cc:141: for (; seq_no != packet.sequence_number(); ++seq_no) { On 2017/02/24 09:28:57, stefan-webrtc wrote: > Should we have a limit to how many lost packets we insert? Just to avoid > building a huge vector in case we receive some corrupt packet or a packet gets > lost on the web and arrive super late. The implicit limit here is 2^16. Do you have a tighter one in mind? (By the way, ignore that seq_no is not incremented when |seq_no == packet.sequence_number()|, which is a problem for the next iteration. I've given you the link as reference before finishing the CL, as mentioned.)
elad.alon@webrtc.org changed reviewers: + michaelt@webrtc.org, minyue@webrtc.org, sprang@webrtc.org, terelius@webrtc.org
Description was changed from ========== GetTransportFeedbackVector return vector with lost packets too, sorted by seq-num 1. GetTransportFeedbackVector will now return a vector which also explicitly states lost packets. 2. The returned vector is unsorted (uses default order - by sequence number). It's up to the users to sort otherwise, if they need a different order. BUG= ========== to ========== GetTransportFeedbackVector return vector with lost packets too, sorted by seq-num 1. GetTransportFeedbackVector will now return a vector which also explicitly states lost packets. 2. The returned vector is unsorted (uses default order - by sequence number). It's up to the users to sort otherwise, if they need a different order. BUG= ==========
On 2017/02/27 19:48:54, elad.alon wrote: TODO: 1. Extend UT coverage further, to make sure they fail if SortPacketFeedbackVector() fails to either (a) sort the vector by arrival time or (b) filter out lost packets. 2. Event log visualizer.
https://codereview.webrtc.org/2707383006/diff/1/webrtc/modules/congestion_con... File webrtc/modules/congestion_controller/transport_feedback_adapter.cc (right): https://codereview.webrtc.org/2707383006/diff/1/webrtc/modules/congestion_con... webrtc/modules/congestion_controller/transport_feedback_adapter.cc:141: for (; seq_no != packet.sequence_number(); ++seq_no) { On 2017/02/27 09:43:48, elad.alon wrote: > On 2017/02/24 09:28:57, stefan-webrtc wrote: > > Should we have a limit to how many lost packets we insert? Just to avoid > > building a huge vector in case we receive some corrupt packet or a packet gets > > lost on the web and arrive super late. > > The implicit limit here is 2^16. Do you have a tighter one in mind? > (By the way, ignore that seq_no is not incremented when |seq_no == > packet.sequence_number()|, which is a problem for the next iteration. I've given > you the link as reference before finishing the CL, as mentioned.) Yes, I don't think we'd be interested in 2^16 old packets. 1000 packets per second and we're talking about over a minute old packets. I'm thinking something a lot tighter, maybe 50? Or do you see a use-case where you actually would be able to make use of those 2^16 instances of kLost? https://codereview.webrtc.org/2707383006/diff/20001/webrtc/modules/congestion... File webrtc/modules/congestion_controller/transport_feedback_adapter.cc (right): https://codereview.webrtc.org/2707383006/diff/20001/webrtc/modules/congestion... webrtc/modules/congestion_controller/transport_feedback_adapter.cc:142: PacketFeedback packet_feedback(PacketFeedback::kLost, seq_no); Is kLost the right name? It indicates that he packet is lost, but it may not be, it could also just be late and reordered. Maybe kNotAcked? https://codereview.webrtc.org/2707383006/diff/20001/webrtc/modules/congestion... File webrtc/modules/congestion_controller/transport_feedback_adapter_unittest.cc (right): https://codereview.webrtc.org/2707383006/diff/20001/webrtc/modules/congestion... webrtc/modules/congestion_controller/transport_feedback_adapter_unittest.cc:95: if (!allow_unreceived || Why can't we always allow unreceived? I would assume we could adapt all tests so that this works?
https://codereview.webrtc.org/2707383006/diff/1/webrtc/modules/congestion_con... File webrtc/modules/congestion_controller/delay_based_bwe.cc (right): https://codereview.webrtc.org/2707383006/diff/1/webrtc/modules/congestion_con... webrtc/modules/congestion_controller/delay_based_bwe.cc:450: std::sort(output->begin(), output->end(), PacketFeedbackComparator()); On 2017/02/27 09:43:48, elad.alon wrote: > On 2017/02/24 09:28:57, stefan-webrtc wrote: > > Should we do this in-place instead and just ignore kLost packets in the loop > on > > line 284? > > The way I see it, we have to duplicate the input to make sure we can define it > as const, which seems like a design requirement to me (but I am open for > discussion, of course). And if we copy, we might as well not copy elements we'll > not really need, thereby also making the sort quicker. Wdyt? True the constness is a good point.
https://codereview.webrtc.org/2707383006/diff/1/webrtc/modules/congestion_con... File webrtc/modules/congestion_controller/transport_feedback_adapter.cc (right): https://codereview.webrtc.org/2707383006/diff/1/webrtc/modules/congestion_con... webrtc/modules/congestion_controller/transport_feedback_adapter.cc:141: for (; seq_no != packet.sequence_number(); ++seq_no) { On 2017/02/28 14:51:11, stefan-webrtc wrote: > On 2017/02/27 09:43:48, elad.alon wrote: > > On 2017/02/24 09:28:57, stefan-webrtc wrote: > > > Should we have a limit to how many lost packets we insert? Just to avoid > > > building a huge vector in case we receive some corrupt packet or a packet > gets > > > lost on the web and arrive super late. > > > > The implicit limit here is 2^16. Do you have a tighter one in mind? > > (By the way, ignore that seq_no is not incremented when |seq_no == > > packet.sequence_number()|, which is a problem for the next iteration. I've > given > > you the link as reference before finishing the CL, as mentioned.) > > Yes, I don't think we'd be interested in 2^16 old packets. 1000 packets per > second and we're talking about over a minute old packets. I'm thinking something > a lot tighter, maybe 50? > > Or do you see a use-case where you actually would be able to make use of those > 2^16 instances of kLost? 1. If there is a burst of losses, and we don't truncate the data, we'll get RPLR that would reflect it. It would reflect that FEC might not be so useful here, because the losses were consecutive. So I think I'd like to keep quite a lot of this data. We could argue that 0x8000 is the most that we could use, and truncate to that, maybe, but that's specific to the packet-loss-tracker, so doesn't really belong here. 2. I can't think of a good threshold for truncation, which would be sure to serve all possible observers. 3. Observer code would have to become more sophisticate, allowing for both present or missing not-received packets in this vector. https://codereview.webrtc.org/2707383006/diff/20001/webrtc/modules/congestion... File webrtc/modules/congestion_controller/transport_feedback_adapter.cc (right): https://codereview.webrtc.org/2707383006/diff/20001/webrtc/modules/congestion... webrtc/modules/congestion_controller/transport_feedback_adapter.cc:142: PacketFeedback packet_feedback(PacketFeedback::kLost, seq_no); On 2017/02/28 14:51:12, stefan-webrtc wrote: > Is kLost the right name? It indicates that he packet is lost, but it may not be, > it could also just be late and reordered. Maybe kNotAcked? I was thinking kNotReceived, but I was afraid some would confuse it with StatusSymbol::kNotReceived. Shall I got with kNotAcked, then, or kNotReceived? https://codereview.webrtc.org/2707383006/diff/20001/webrtc/modules/congestion... File webrtc/modules/congestion_controller/transport_feedback_adapter_unittest.cc (right): https://codereview.webrtc.org/2707383006/diff/20001/webrtc/modules/congestion... webrtc/modules/congestion_controller/transport_feedback_adapter_unittest.cc:95: if (!allow_unreceived || On 2017/02/28 14:51:12, stefan-webrtc wrote: > Why can't we always allow unreceived? I would assume we could adapt all tests so > that this works? I can remove this, it shouldn't interfere with anything at the moment. I just don't want ComparePacketVectors() to accidentally give a seal of approval to anything that has an unreceived packet by mistake. You prefer to remove this?
https://codereview.webrtc.org/2707383006/diff/1/webrtc/modules/congestion_con... File webrtc/modules/congestion_controller/transport_feedback_adapter.cc (right): https://codereview.webrtc.org/2707383006/diff/1/webrtc/modules/congestion_con... webrtc/modules/congestion_controller/transport_feedback_adapter.cc:141: for (; seq_no != packet.sequence_number(); ++seq_no) { On 2017/02/28 15:20:18, elad.alon wrote: > On 2017/02/28 14:51:11, stefan-webrtc wrote: > > On 2017/02/27 09:43:48, elad.alon wrote: > > > On 2017/02/24 09:28:57, stefan-webrtc wrote: > > > > Should we have a limit to how many lost packets we insert? Just to avoid > > > > building a huge vector in case we receive some corrupt packet or a packet > > gets > > > > lost on the web and arrive super late. > > > > > > The implicit limit here is 2^16. Do you have a tighter one in mind? > > > (By the way, ignore that seq_no is not incremented when |seq_no == > > > packet.sequence_number()|, which is a problem for the next iteration. I've > > given > > > you the link as reference before finishing the CL, as mentioned.) > > > > Yes, I don't think we'd be interested in 2^16 old packets. 1000 packets per > > second and we're talking about over a minute old packets. I'm thinking > something > > a lot tighter, maybe 50? > > > > Or do you see a use-case where you actually would be able to make use of those > > 2^16 instances of kLost? > > 1. If there is a burst of losses, and we don't truncate the data, we'll get RPLR > that would reflect it. It would reflect that FEC might not be so useful here, > because the losses were consecutive. So I think I'd like to keep quite a lot of > this data. We could argue that 0x8000 is the most that we could use, and > truncate to that, maybe, but that's specific to the packet-loss-tracker, so > doesn't really belong here. > 2. I can't think of a good threshold for truncation, which would be sure to > serve all possible observers. > 3. Observer code would have to become more sophisticate, allowing for both > present or missing not-received packets in this vector. This can be triggered by a man-in-the-middle, right?
https://codereview.webrtc.org/2707383006/diff/1/webrtc/modules/congestion_con... File webrtc/modules/congestion_controller/transport_feedback_adapter.cc (right): https://codereview.webrtc.org/2707383006/diff/1/webrtc/modules/congestion_con... webrtc/modules/congestion_controller/transport_feedback_adapter.cc:141: for (; seq_no != packet.sequence_number(); ++seq_no) { On 2017/02/28 16:05:58, terelius wrote: > On 2017/02/28 15:20:18, elad.alon wrote: > > On 2017/02/28 14:51:11, stefan-webrtc wrote: > > > On 2017/02/27 09:43:48, elad.alon wrote: > > > > On 2017/02/24 09:28:57, stefan-webrtc wrote: > > > > > Should we have a limit to how many lost packets we insert? Just to avoid > > > > > building a huge vector in case we receive some corrupt packet or a > packet > > > gets > > > > > lost on the web and arrive super late. > > > > > > > > The implicit limit here is 2^16. Do you have a tighter one in mind? > > > > (By the way, ignore that seq_no is not incremented when |seq_no == > > > > packet.sequence_number()|, which is a problem for the next iteration. I've > > > given > > > > you the link as reference before finishing the CL, as mentioned.) > > > > > > Yes, I don't think we'd be interested in 2^16 old packets. 1000 packets per > > > second and we're talking about over a minute old packets. I'm thinking > > something > > > a lot tighter, maybe 50? > > > > > > Or do you see a use-case where you actually would be able to make use of > those > > > 2^16 instances of kLost? > > > > 1. If there is a burst of losses, and we don't truncate the data, we'll get > RPLR > > that would reflect it. It would reflect that FEC might not be so useful here, > > because the losses were consecutive. So I think I'd like to keep quite a lot > of > > this data. We could argue that 0x8000 is the most that we could use, and > > truncate to that, maybe, but that's specific to the packet-loss-tracker, so > > doesn't really belong here. > > 2. I can't think of a good threshold for truncation, which would be sure to > > serve all possible observers. > > 3. Observer code would have to become more sophisticate, allowing for both > > present or missing not-received packets in this vector. > > This can be triggered by a man-in-the-middle, right? For an unencrypted connection, yes. But then you'd get a maximum of 65k packets, which is not orders of magnitude more than the 8k packets which can currently be done, right? So I don't think the CPU would be burdened much more than it already is. Wdyt?
On 2017/02/28 16:17:30, elad.alon wrote: > https://codereview.webrtc.org/2707383006/diff/1/webrtc/modules/congestion_con... > File webrtc/modules/congestion_controller/transport_feedback_adapter.cc (right): > > https://codereview.webrtc.org/2707383006/diff/1/webrtc/modules/congestion_con... > webrtc/modules/congestion_controller/transport_feedback_adapter.cc:141: for (; > seq_no != packet.sequence_number(); ++seq_no) { > On 2017/02/28 16:05:58, terelius wrote: > > On 2017/02/28 15:20:18, elad.alon wrote: > > > On 2017/02/28 14:51:11, stefan-webrtc wrote: > > > > On 2017/02/27 09:43:48, elad.alon wrote: > > > > > On 2017/02/24 09:28:57, stefan-webrtc wrote: > > > > > > Should we have a limit to how many lost packets we insert? Just to > avoid > > > > > > building a huge vector in case we receive some corrupt packet or a > > packet > > > > gets > > > > > > lost on the web and arrive super late. > > > > > > > > > > The implicit limit here is 2^16. Do you have a tighter one in mind? > > > > > (By the way, ignore that seq_no is not incremented when |seq_no == > > > > > packet.sequence_number()|, which is a problem for the next iteration. > I've > > > > given > > > > > you the link as reference before finishing the CL, as mentioned.) > > > > > > > > Yes, I don't think we'd be interested in 2^16 old packets. 1000 packets > per > > > > second and we're talking about over a minute old packets. I'm thinking > > > something > > > > a lot tighter, maybe 50? > > > > > > > > Or do you see a use-case where you actually would be able to make use of > > those > > > > 2^16 instances of kLost? > > > > > > 1. If there is a burst of losses, and we don't truncate the data, we'll get > > RPLR > > > that would reflect it. It would reflect that FEC might not be so useful > here, > > > because the losses were consecutive. So I think I'd like to keep quite a lot > > of > > > this data. We could argue that 0x8000 is the most that we could use, and > > > truncate to that, maybe, but that's specific to the packet-loss-tracker, so > > > doesn't really belong here. > > > 2. I can't think of a good threshold for truncation, which would be sure to > > > serve all possible observers. > > > 3. Observer code would have to become more sophisticate, allowing for both > > > present or missing not-received packets in this vector. > > > > This can be triggered by a man-in-the-middle, right? > > For an unencrypted connection, yes. But then you'd get a maximum of 65k packets, > which is not orders of magnitude more than the 8k packets which can currently be > done, right? So I don't think the CPU would be burdened much more than it > already is. Wdyt? Summary of my discussion on the topic with Stefan: * An uncapped (except by 2^16) number of packets can at the moment be created by GetStatusVector(). * The protocol itself allows for a large number of kNotReceived packets in a feedback message. It's up to the sender of the feedback to make sure such messages would not be sent if not useful. * About man-in-the-middle (not discussed with Stefan, btw; just summarizing it here), I think it would not create more havoc than could be created otherwise (bad estimation, but not too much CPU overuse compared to other possible feedback messages).
https://codereview.webrtc.org/2707383006/diff/80001/webrtc/modules/congestion... File webrtc/modules/congestion_controller/transport_feedback_adapter.cc (right): https://codereview.webrtc.org/2707383006/diff/80001/webrtc/modules/congestion... webrtc/modules/congestion_controller/transport_feedback_adapter.cc:133: received_packets[received_packets.size() - 1].sequence_number(); received_packets.back().sequence_number() https://codereview.webrtc.org/2707383006/diff/80001/webrtc/modules/congestion... webrtc/modules/congestion_controller/transport_feedback_adapter.cc:146: uint16_t seq_no = feedback.GetBaseSequence(); seq_num is typically used throughout the code base
Anything else I could improve? https://codereview.webrtc.org/2707383006/diff/80001/webrtc/modules/congestion... File webrtc/modules/congestion_controller/transport_feedback_adapter.cc (right): https://codereview.webrtc.org/2707383006/diff/80001/webrtc/modules/congestion... webrtc/modules/congestion_controller/transport_feedback_adapter.cc:133: received_packets[received_packets.size() - 1].sequence_number(); On 2017/03/03 20:11:13, stefan-webrtc wrote: > received_packets.back().sequence_number() Will do. https://codereview.webrtc.org/2707383006/diff/80001/webrtc/modules/congestion... webrtc/modules/congestion_controller/transport_feedback_adapter.cc:146: uint16_t seq_no = feedback.GetBaseSequence(); On 2017/03/03 20:11:13, stefan-webrtc wrote: > seq_num is typically used throughout the code base Will change (I also prefer seq_num). FYI, I lifted this from webrtc/modules/rtp_rtcp/source/rtcp_packet/transport_feedback.cc, so you might want some changes there.
https://codereview.webrtc.org/2707383006/diff/120001/webrtc/tools/event_log_v... File webrtc/tools/event_log_visualizer/analyzer.cc (right): https://codereview.webrtc.org/2707383006/diff/120001/webrtc/tools/event_log_v... webrtc/tools/event_log_visualizer/analyzer.cc:46: class PacketFeedbackComparator { This is now duplicated with delay_based_bwe.cc. Any ideas about how to eliminate this duplication? This is nothing major, so I'd also be OK with keeping this, if others are fine with that too.
https://codereview.webrtc.org/2707383006/diff/120001/webrtc/modules/congestio... File webrtc/modules/congestion_controller/delay_based_bwe.cc (right): https://codereview.webrtc.org/2707383006/diff/120001/webrtc/modules/congestio... webrtc/modules/congestion_controller/delay_based_bwe.cc:442: void DelayBasedBwe::SortPacketFeedbackVector( This should be in the anonymous namespace and not a class method.
https://codereview.webrtc.org/2707383006/diff/120001/webrtc/modules/congestio... File webrtc/modules/congestion_controller/delay_based_bwe.cc (right): https://codereview.webrtc.org/2707383006/diff/120001/webrtc/modules/congestio... webrtc/modules/congestion_controller/delay_based_bwe.cc:442: void DelayBasedBwe::SortPacketFeedbackVector( On 2017/03/07 12:04:18, stefan-webrtc wrote: > This should be in the anonymous namespace and not a class method. Done.
lgtm wit one nit: https://codereview.webrtc.org/2707383006/diff/140001/webrtc/tools/event_log_v... File webrtc/tools/event_log_visualizer/analyzer.cc (right): https://codereview.webrtc.org/2707383006/diff/140001/webrtc/tools/event_log_v... webrtc/tools/event_log_visualizer/analyzer.cc:572: void EventLogAnalyzer::SortPacketFeedbackVector( This method does not appear to use any state in the EventLogAnalyzer. I'd prefer to make it a normal function in the anonymous namespace.
lgtm from me too with terelius nit fixed.
Description was changed from ========== GetTransportFeedbackVector return vector with lost packets too, sorted by seq-num 1. GetTransportFeedbackVector will now return a vector which also explicitly states lost packets. 2. The returned vector is unsorted (uses default order - by sequence number). It's up to the users to sort otherwise, if they need a different order. BUG= ========== to ========== GetTransportFeedbackVector return vector with lost packets too, sorted by seq-num 1. GetTransportFeedbackVector will now return a vector which also explicitly states lost packets. 2. The returned vector is unsorted (uses default order - by sequence number). It's up to the users to sort otherwise, if they need a different order. BUG=None ==========
The CQ bit was checked by elad.alon@webrtc.org
The patchset sent to the CQ was uploaded after l-g-t-m from terelius@webrtc.org, stefan@webrtc.org Link to the patchset: https://codereview.webrtc.org/2707383006/#ps160001 (title: "SortPacketFeedbackVector moved out of class.")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.webrtc.org/...
CQ is committing da patch. Bot data: {"patchset_id": 160001, "attempt_start_ts": 1488976814760520, "parent_rev": "41f8a88e4fb8070d0422d74920d29383c6777e21", "commit_rev": "ec304f96b30ef679708971889b2fcab15481fb1b"}
Message was sent while issue was closed.
Description was changed from ========== GetTransportFeedbackVector return vector with lost packets too, sorted by seq-num 1. GetTransportFeedbackVector will now return a vector which also explicitly states lost packets. 2. The returned vector is unsorted (uses default order - by sequence number). It's up to the users to sort otherwise, if they need a different order. BUG=None ========== to ========== GetTransportFeedbackVector return vector with lost packets too, sorted by seq-num 1. GetTransportFeedbackVector will now return a vector which also explicitly states lost packets. 2. The returned vector is unsorted (uses default order - by sequence number). It's up to the users to sort otherwise, if they need a different order. BUG=None Review-Url: https://codereview.webrtc.org/2707383006 Cr-Commit-Position: refs/heads/master@{#17114} Committed: https://chromium.googlesource.com/external/webrtc/+/ec304f96b30ef679708971889... ==========
Message was sent while issue was closed.
Committed patchset #9 (id:160001) as https://chromium.googlesource.com/external/webrtc/+/ec304f96b30ef679708971889... |