Skip to contentSkip to conversation

CCID3: dead code in ccid3_hc_rx_packet_recv?

DISCUSSION Arnaldo Carvalho de Melo 3 participants 6 messages Nov 15, 2006 – Nov 16, 2006

lore
Share & tools
lore
#0 lore raw
Quoted 8 lines · Gerrit Renker

While working on the promised EWMA patch for CCID 3 packet sizes, I stumbled over two things and can make no sense of a bit of CCID 3 Receive code:

1) ccid3_hc_rx_sock maintains a real-timer RTT counter ccid3hcrx_rtt which is an alias for a TFRC structure defined in <linux/tfrc.h>
2) ccid3_hc_rx_packet_recv (detailed below) updates this, but leaves the variable `win_count = packet->dccphrx_ccval;' entirely untouched after initialisation

Quoted 4 lines

It may be that ... ?
* this is because a real-time counter as opposed to the 4-digit window value counter affords better reliability (but then win_count should be removed)
* this stems from the original TFRC code and might need update

Well, the ccid3 codebase has a long lineage, came from Lulea, passed thru Waikato and the thru my linux CodingStyle and use slab caches, turn parts into a lib, etc, so it may have all sorts of dragons, oops, bugs lurking, Ian has more knowledge about CCID3 and the original Waikato codebase, so he may well answer your questions while I try to get the rest of the patch queue processed :-)

- Arnaldo

#1 lore raw
Quoted 8 lines · Gerrit Renker

While working on the promised EWMA patch for CCID 3 packet sizes, I stumbled over two things and can make no sense of a bit of CCID 3 Receive code:

1) ccid3_hc_rx_sock maintains a real-timer RTT counter ccid3hcrx_rtt which is an alias for a TFRC structure defined in <linux/tfrc.h>
2) ccid3_hc_rx_packet_recv (detailed below) updates this, but leaves the variable `win_count = packet->dccphrx_ccval;' entirely untouched after initialisation

Quoted 5 lines

It may be that ... ?
* this is because a real-time counter as opposed to the 4-digit window value counter affords better reliability (but then win_count should be removed)
* this stems from the original TFRC code and might need update

I'll have a look at it when I get the chance. I know the win_count code in CCID3 is screwed at the moment and I just hacked it by removing some lines as it was making loss intervals wrong which made performance wrong.

It does need fixing properly though and there are large parts of code that don't do anything but should be fixed up to meet RFC. I haven't removed some of it though so I know what it was...

Anyway I'll have a look at it as I can but feel free to make patches. If you're removing chunks of code I'd prefer it commented out in the meantime rather than removed.

Ian

Signature · 7 lines
Ian McDonald
Web: http://wand.net.nz/~iam4
Blog: http://imcdnzl.blogspot.com
WAND Network Research Group
Department of Computer Science
University of Waikato
New Zealand
#2 lore raw
In reply to Arnaldo Carvalho de Melo
|  Anyway I'll have a look at it as I can but feel free to make patches.
|  If you're removing chunks of code I'd prefer it commented out in the
|  meantime rather than removed.

Thanks - I was hoping for your answer. To me it seemed that the bidirectional processing (node is both receiver and sender) is not supported at the moment and that therefore it would make sense to keep tx/rx functionality separate.

Gerrit

#3 lore raw
In reply to Arnaldo Carvalho de Melo
Quoted 7 lines · Gerrit Renker
|  Anyway I'll have a look at it as I can but feel free to make patches.
|  If you're removing chunks of code I'd prefer it commented out in the
|  meantime rather than removed.

Thanks - I was hoping for your answer. To me it seemed that the bidirectional processing (node is both receiver and sender) is not supported at the moment and that therefore it would make sense to keep tx/rx functionality separate.

You are correct there that it is one directional.

Signature · 7 lines
Ian McDonald
Web: http://wand.net.nz/~iam4
Blog: http://imcdnzl.blogspot.com
WAND Network Research Group
Department of Computer Science
University of Waikato
New Zealand
#4 lore raw
In reply to Arnaldo Carvalho de Melo
Quoted 5 lines · Gerrit Renker

While working on the promised EWMA patch for CCID 3 packet sizes, I stumbled over two things and can make no sense of a bit of CCID 3 Receive code:

1) ccid3_hc_rx_sock maintains a real-timer RTT counter ccid3hcrx_rtt which is an alias for a TFRC structure defined in <linux/tfrc.h>

See comments below. Don't really understand what you are saying.

Quoted 3 lines

2) ccid3_hc_rx_packet_recv (detailed below) updates this, but leaves the variable `win_count = packet->dccphrx_ccval;' entirely untouched after initialisation

This can be deleted. It was used but I have shifted the code into ccid3_hc_rx_detect_loss. I forgot to delete this variable. I will produce a patch to do this in next week if you don't.

Quoted 5 lines

/*
after updating r_sample with regard to t_elapsed ...
=> The code that now follows is identical with ccid3_hc_tx_packet_recv
--is this a leftover ?
--should it not rather update the sending structure (ccid3hctx_rtt)

No they are half connections. Maybe I don't understand your question.

Quoted 1 line

=> why not use win_count ??

Can be deleted.

Signature · 7 lines
Ian McDonald
Web: http://wand.net.nz/~iam4
Blog: http://imcdnzl.blogspot.com
WAND Network Research Group
Department of Computer Science
University of Waikato
New Zealand
#5 lore raw
In reply to Arnaldo Carvalho de Melo
|  > I stumbled over two things and can make no sense of a bit of CCID 3 Receive code:
|  >
|  >         1) ccid3_hc_rx_sock maintains a real-timer RTT counter ccid3hcrx_rtt
|  >            which is an alias for a TFRC structure defined in <linux/tfrc.h>
|  
|  See comments below. Don't really understand what you are saying.

Sorry if my questions were really clear, part of this is probably due to my lack of understanding what went on. I went through this again and I hope that this time it is clearer to understand.

1) The above was expressed in too complicated a way. I meant to say "why does the receiver

     keep a real-time RTT counter"? I was referrind to the following element of code:

	struct ccid3_hc_rx_sock {
	struct tfrc_rx_info	ccid3hcrx_tfrc;
	/* 	... 	*/
	#define ccid3hcrx_rtt		ccid3hcrx_tfrc.tfrcrx_rtt

     And in <linux/tfrc.h>:

	struct tfrc_tx_info {
	/*	... 	*/
	__u32 tfrctx_rtt;
      
     I was puzzled why the receiver has to keep time while RFC 4342 speaks of `quarter RTT increases'
     For `pure' TFRC (:-) it is understandable why the receiver should track RTT, here I could not follow.

2) With regard to the code I was referring to, the points are precisely:

* the receiver appears not to look at the window counter
* RTT is updated only on Ack/DataAck and is never updated when the packet carries no timestamp, due to:
case DCCP_PKT_ACK:
if (hcrx->ccid3hcrx_state = TFRC_RSTATE_NO_DATA)
return;
case DCCP_PKT_DATAACK:
if (opt_recv->dccpor_timestamp_echo = 0)
break;
* timestamps are permitted on any DCCP packet (RFC 4340, sec. 13); hence the code, if it is really used, could be pulled out and below the switch statement, to also use the timestamps of incoming Data packets

* if I understand correctly, ccid3_hc_rx_packet_recv is in the receiving side of the half-connection => receiver gets data and sends Acks
=> but only receives (Data)Acks if it is also a sender or if it
has to ack e.g. AckVectors
* the thing that puzzled me most is that ccid3_hc_tx_send_packet() uses the window counter as per RFC 4342 8.1 (visible in wireshark), but the receiver makes no use of it.

|  >         2) ccid3_hc_rx_packet_recv (detailed below) updates this, but leaves the variable
|  >            `win_count = packet->dccphrx_ccval;'  entirely untouched after initialisation
|  >
|  This can be deleted. It was used but I have shifted the code into
|  ccid3_hc_rx_detect_loss. I forgot to delete this variable. I will
|  produce a patch to do this in next week if you don't.

Do you mean another function - I can not find any RTT-related code in ccid3_hc_rx_detect_loss.

|  >                 /*
|  >                    after updating r_sample with regard to t_elapsed ...
|  >                    => The code that now follows is identical with ccid3_hc_tx_packet_recv
|  >                        --is this a leftover ?
|  >                        --should it not rather update the sending structure (ccid3hctx_rtt)
|  
|  No they are half connections. Maybe I don't understand your question.

Again, sorry for not putting this clearly: my understanding is that currently the code works unidirectional, i.e. a node is not both receiver and sender at the same time. This would be the most sensible starting point; and in that case the above question is unnecessary.

|  >                    => why not use win_count ??
|  
|  Can be deleted.

My intuition at the moment is that it should be the other way round (i.e. delete the timestamp-dependent code and use window counter values as per RFC 4342): in any case I think this needs a revision. I have been doing some capturing tests to solve this question today, but ran out of time. Another ToDo.

-- Gerrit