@@ -557,8 +557,9 @@ static struct sk_buff *mptcp_ratio_next_segment(struct sock *meta_sk,
557557 }
558558
559559 time_diff = jiffies_to_msecs (jiffies - meta_tp -> rate_interval_us );
560- /*Ratio search logic, triggered by collecting samples every ratio_rate_sample (ms)*/
560+ /*Ratio search logic, triggered by collecting samples every probe interval: ratio_rate_probe interval (ms)*/
561561 if (time_diff >= meta_tp -> ratio_rate_sample ) {
562+ /*Load parameter from previous probe interval*/
562563 last_rate = meta_tp -> prr_out ;
563564 trigger_threshold = meta_tp -> prr_delivered ;
564565 in_search = meta_tp -> lost ;
@@ -601,26 +602,13 @@ static struct sk_buff *mptcp_ratio_next_segment(struct sock *meta_sk,
601602
602603 for (iter = 0 ; iter < 3 ; iter ++ ) {
603604 if (iter == 2 )
604- meta_tp -> last_rate_search_start [iter ] = meta_tp -> rate_delivered ;
605+ meta_tp -> last_rate_search_start [iter ] = meta_tp -> rate_delivered ;//is current rate
605606 else
606- meta_tp -> last_rate_search_start [iter ] = meta_tp -> last_rate_search_start [iter + 1 ];
607+ meta_tp -> last_rate_search_start [iter ] = meta_tp -> last_rate_search_start [iter + 1 ];//keep shifting to get the updated rate
607608 }
608- if (inet_sk (meta_sk )-> inet_daddr )
609- printk ("ratio: %d"
610- ", rate_ad: %u"
611- ", rate_ac: %u"
612- ", srtt_ad: %u"
613- ", srtt_ac: %u"
614- ", num_acks_ad: %u"
615- ", num_acks_ac: %u\n" ,
616- meta_tp -> num_segments_flow_one ,
617- tput [0 ],
618- tput [1 ],
619- srtt [0 ],
620- srtt [1 ],
621- num_acks [0 ],
622- num_acks [1 ]);
623- else
609+
610+ if (inet_sk (meta_sk )-> inet_daddr ){}
611+ {
624612 printk ("ratio: %d"
625613 ", rate_ad: %u"
626614 ", rate_ac: %u"
@@ -635,11 +623,11 @@ static struct sk_buff *mptcp_ratio_next_segment(struct sock *meta_sk,
635623 srtt [1 ],
636624 num_acks [0 ],
637625 num_acks [1 ]);
638-
639- printk ( "rate_thresh_cnt : %d"
640- ", buffer_thresh_cnt: %d\n" ,
641- threshold_cnt ,
642- buffer_threshold_cnt );
626+ printk ( "rate_thresh_cnt: %d"
627+ ", buffer_thresh_cnt : %d\n" ,
628+ threshold_cnt ,
629+ buffer_threshold_cnt );
630+ }
643631
644632 if (!in_search && !last_rate ) {
645633 count_set_init_rate ++ ;
@@ -749,12 +737,12 @@ static struct sk_buff *mptcp_ratio_next_segment(struct sock *meta_sk,
749737 printk ("INITIAL or PERIODIC SEARCH\n" );
750738 }
751739
752- /*Set search state and reset counter for the next skb */
740+ /*Set search state and reset counter for the next interval */
753741 in_search = true;
754742 threshold_cnt = 0 ;
755743 buffer_threshold_cnt = 0 ;
756744
757- /*Multiply sampling interval*/
745+ /*Increase sampling interval*/
758746 meta_tp -> ratio_rate_sample = meta_tp -> ratio_rate_sample * 4 ;
759747 last_trigger_tstamp = jiffies ;
760748
@@ -769,7 +757,7 @@ static struct sk_buff *mptcp_ratio_next_segment(struct sock *meta_sk,
769757 }
770758
771759
772- /*????? */
760+ /*Calculating averate last_rate if we decide to search */
773761 last_rate = 0 ;
774762 for (iter = 0 ; iter < 3 ; iter ++ )
775763 last_rate += meta_tp -> last_rate_search_start [iter ];
@@ -891,8 +879,8 @@ static struct sk_buff *mptcp_ratio_next_segment(struct sock *meta_sk,
891879 }/*End ratio searching*/
892880
893881 last_rate = meta_tp -> rate_delivered ;
894- //Save estimation value at this interval for later use
895882reset :
883+ /*Save the calculated parameters this interval*/
896884 meta_tp -> prr_out = last_rate ;
897885 meta_tp -> prr_delivered = trigger_threshold ;
898886 meta_tp -> lost = in_search ;
@@ -903,6 +891,8 @@ static struct sk_buff *mptcp_ratio_next_segment(struct sock *meta_sk,
903891 meta_tp -> prior_cwnd = init_rate ;
904892 memcpy (meta_tp -> init_buffer_size , init_buffer_size , 2 * sizeof (u32 ));
905893 memcpy (meta_tp -> last_buffer_size , last_buffer_size , 2 * sizeof (u32 ));
894+
895+ /*Reset the containers for the next intervals*/
906896 meta_tp -> delivered = 0 ;
907897 meta_tp -> rate_delivered = 0 ;
908898 meta_tp -> high_seq = 0 ;
0 commit comments