[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ns] ECN in TCP Vegas



Below is the diff to allow Vegas to use ECN.  The comments tell the 
whole story.

-- 
Brian Lee Bowers	|	RADIANT Team (Summer Intern)
[email protected]	|	Los Alamos National Laboratory


*** tcp-vegas.cc	Tue Jul 17 07:51:21 2001
--- tcp-vegas-ecn.cc	Tue Jul 17 08:44:14 2001
***************
*** 432,437 ****
--- 432,452 ----
  	tcph->ts() = now;
  	tcph->reason() = reason;
  
+ 	/*+-+-+  Allow TCP Vegas to use ECN  +-+-+*/
+ 	//  code shamelessly stolen from TcpAgent::output :)
+ 	{  //  artificial scope so that hf doesn't cause conflicts
+ 		hdr_flags* hf = hdr_flags::access(p);
+ 		if (ecn_) {
+ 			hf->ect() = 1;	// ECN-capable transport
+ 		}
+ 		
+ 		if (cong_action_) {
+ 			hf->cong_action() = TRUE;  // Congestion action.
+ 			cong_action_ = FALSE;
+ 		}
+ 	}
+ 	/*+-+-+  End ECN Addition  +-+-+*/
+ 
  	/* if this is the 1st pkt, setup senttime[] and transmits[]
  	 * I alloc mem here, instrad of in the constructor, to cover
  	 * cases which windows get set by each different tcp flows */
@��y@