fsm.cc
上传用户:rrhhcc
上传日期:2015-12-11
资源大小:54129k
文件大小:73k
源码类别:

通讯编程

开发平台:

Visual C++

  1. /* -*- Mode:C++; c-basic-offset:8; tab-width:8; indent-tabs-mode:t -*- */
  2. /*
  3.  * Copyright (C) 1999 by the University of Southern California
  4.  * $Id: fsm.cc,v 1.12 2005/08/25 18:58:02 johnh Exp $
  5.  *
  6.  * This program is free software; you can redistribute it and/or
  7.  * modify it under the terms of the GNU General Public License,
  8.  * version 2, as published by the Free Software Foundation.
  9.  *
  10.  * This program is distributed in the hope that it will be useful,
  11.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13.  * GNU General Public License for more details.
  14.  *
  15.  * You should have received a copy of the GNU General Public License along
  16.  * with this program; if not, write to the Free Software Foundation, Inc.,
  17.  * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
  18.  *
  19.  *
  20.  * The copyright of this module includes the following
  21.  * linking-with-specific-other-licenses addition:
  22.  *
  23.  * In addition, as a special exception, the copyright holders of
  24.  * this module give you permission to combine (via static or
  25.  * dynamic linking) this module with free software programs or
  26.  * libraries that are released under the GNU LGPL and with code
  27.  * included in the standard release of ns-2 under the Apache 2.0
  28.  * license or under otherwise-compatible licenses with advertising
  29.  * requirements (or modified versions of such code, with unchanged
  30.  * license).  You may copy and distribute such a system following the
  31.  * terms of the GNU GPL for this module and the licenses of the
  32.  * other code concerned, provided that you include the source code of
  33.  * that other code when and as the GNU GPL requires distribution of
  34.  * source code.
  35.  *
  36.  * Note that people who make modified versions of this module
  37.  * are not obligated to grant this special exception for their
  38.  * modified versions; it is their choice whether to do so.  The GNU
  39.  * General Public License gives permission to release a modified
  40.  * version without this exception; this exception also makes it
  41.  * possible to release a modified version which carries forward this
  42.  * exception.
  43.  *
  44.  */
  45. /* 
  46.  * Contributed by Polly Huang (USC/ISI), http://www-scf.usc.edu/~bhuang
  47.  * 
  48.  * @(#) $Header: /cvsroot/nsnam/ns-2/common/fsm.cc,v 1.12 2005/08/25 18:58:02 johnh Exp $ (LBL)
  49.  */
  50. /*
  51.  * The contents of this file are described in the paper:
  52.  *   Polly Huang and John Heidemann.
  53.  *     Capturing TCP Burstiness in Light-weight Simulations.
  54.  *     In Proceedings of the SCS Conference on Communication Networks and Distributed Systems Modeling and Simulation, pp. 90-96.
  55.  *     Phoenix, Arizona, USA, USC/Information Sciences Institute, Society for Computer Simulation.
  56.  *     January, 2001.
  57.  *     <http://www.isi.edu/~johnh/PAPERS/Huang01a.html>.
  58.  *
  59.  * (Although this code talks about FSMs or Finite-State Machines,
  60.  * the paper uses the term FSA or Finite-State Automoton.)
  61.  */
  62. #include "fsm.h"
  63. #include <assert.h>
  64. #ifndef MAX
  65. #define MAX(a, b)  (((a) > (b)) ? (a) : (b))
  66. #endif
  67. #ifndef MIN
  68. #define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  69. #endif
  70. FSM* FSM::instance_;
  71. TahoeAckFSM* TahoeAckFSM::instance_;
  72. RenoAckFSM* RenoAckFSM::instance_;
  73. TahoeDelAckFSM* TahoeDelAckFSM::instance_;
  74. RenoDelAckFSM* RenoDelAckFSM::instance_;
  75. void
  76. FSMState::number_all()
  77. {
  78. if (processed())
  79. return;
  80. static int next_i = 0;
  81. print_i_ = ++next_i;
  82. //
  83. int i;
  84. for (i = 0; i < 17; i++)
  85. if (drop_[i])
  86. drop_[i]->number_all();
  87. }
  88. void
  89. FSMState::reset_all_processed()
  90. {
  91. if (print_i_ == 0)
  92. number_all();
  93. // requires a full traversal always to work
  94. if (!processed())
  95. return;
  96. print_i_ = -print_i_;
  97. int i;
  98. for (i = 0; i < 17; i++)
  99. if (drop_[i])
  100. drop_[i]->reset_all_processed();
  101. }
  102. void
  103. FSMState::print_all(int level)
  104. {
  105. if (processed())
  106. return;
  107. const int SPACES_PER_LEVEL = 2;
  108. printf("#%-2d %*s %d:n", print_i_, level * SPACES_PER_LEVEL + 1, " ", batch_size_);
  109. int i;
  110. for (i = 0; i <= batch_size_; i++) {
  111. static char *delay_names[] = {"done", "error", "RTT", "timeout" };
  112. assert(transition_[i] >= -1 && transition_[i] <= TIMEOUT);
  113. printf("   %*s %d %s -> #%dn", level * SPACES_PER_LEVEL + 3, " ",
  114.        i,
  115.        delay_names[transition_[i]+1],
  116.        drop_[i] ? drop_[i]->print_i_ : 0);
  117. if (drop_[i])
  118. drop_[i]->print_all(level + 1);
  119. };
  120. }
  121. static void
  122. report_stat_terminus(int desired_pkts, // # needed
  123.   int pkts,       // # got so far
  124.   int rtts, // # of rtt events
  125.   int timeouts, // # of to events
  126.   int ps, // # of times taken a prob. p event (pkt received OK)
  127.   int qs, // # of times taken a prob. q event (pkt dropped OK)
  128.   int num_states, // size of the stack
  129.   int num_state_names,
  130.      FSMState **states,
  131.      char *state_names)
  132. {
  133. // print states and probability
  134. printf("%s: p^%d*q^%d, %d rtt, %d timeouts, %d states:",
  135.        (pkts > desired_pkts ? "exceeded-pkts" :
  136.         (pkts == desired_pkts ? "desired_pkts" : "unimplemented-qs")),
  137.        ps, qs,
  138.        rtts, timeouts,
  139.        num_states);
  140. char ch = ' ';
  141. int i;
  142. for (i = 0; i < num_states; i++) {
  143. printf ("%c#%d", ch, states[i]->print_i_);
  144. ch = ',';
  145. };
  146. printf(" [%.*s]n", num_state_names, state_names);
  147. }
  148. /*
  149.  * FSMState::print_all_stats:
  150.  * Walk through the tcp state table exhaustively.
  151.  * Recurse to handle errors.
  152.  * Very hairy.
  153.  * johnh.
  154.  */
  155. void
  156. FSMState::print_all_stats(int desired_pkts_total, // # needed
  157.   int pkts,       // # got so far
  158.   int rtts, // # of rtt events
  159.   int timeouts, // # of to events
  160.   int ps, // # of times taken a prob. p event (pkt received OK)
  161.   int qs, // # of times taken a prob. q event (pkt dropped OK)
  162.   int num_states, // size of the stack
  163.   int num_state_names)
  164. {
  165. int i;
  166. #define LARGER_NUMBER_OF_STATES 31   // was 17
  167. static FSMState *states[LARGER_NUMBER_OF_STATES];
  168. static char state_names[LARGER_NUMBER_OF_STATES*4]; // xxx: this is just some random big size :-(
  169. if (pkts >= desired_pkts_total || qs > 5) {
  170. // done; print states and probability
  171. // (give up when we're where we want to be [good],
  172. // or we've taken too many losses [to prevent recursion])
  173. report_stat_terminus(desired_pkts_total, pkts, rtts, timeouts, ps, qs, num_states, num_state_names, states, state_names);
  174. return;
  175. };
  176. // remember us!
  177. states[num_states] = this;
  178. num_states++;
  179. // xxx: doesn't handle TCP tail behavior
  180. //
  181. // first, consider the no-loss case
  182. //
  183. int desired_pkts_remaining = desired_pkts_total - pkts;
  184. int desired_pkts_this_round = MIN(desired_pkts_remaining, batch_size_);
  185. for (i = 0; i< desired_pkts_this_round; i++)
  186. state_names[num_state_names + i] = 's';
  187. if (desired_pkts_remaining > desired_pkts_this_round) {
  188. // more to do?  take a rtt hit and keep going
  189. state_names[num_state_names + desired_pkts_this_round] = '.';
  190. drop_[0]->print_all_stats(desired_pkts_total,
  191.   pkts + desired_pkts_this_round,
  192.   rtts + 1, timeouts,
  193.   ps + desired_pkts_this_round, qs,
  194.   num_states,
  195.   num_state_names + desired_pkts_this_round + 1);
  196. } else {
  197. // no more to do... report out
  198. report_stat_terminus(desired_pkts_total,
  199.      pkts + desired_pkts_this_round,
  200.      rtts, timeouts,
  201.      ps + desired_pkts_this_round, qs,
  202.      num_states,
  203.      num_state_names + desired_pkts_this_round,
  204.      states,
  205.      state_names);
  206. };
  207. //
  208. // now consider losses
  209. //
  210. int desired_pkts_with_loss = MAX(desired_pkts_this_round - 1, 0);
  211. // loop through losing the i'th packet for all possible i's.
  212. // Can't loop through more than we could have sent.
  213. for (i = 1; i <= desired_pkts_this_round; i++) {
  214. // keep track of sending patterns
  215. if (i > 1)
  216. state_names[num_state_names + i - 2] = 's';
  217. state_names[num_state_names + i - 1] = 'd';
  218. state_names[num_state_names + desired_pkts_this_round] = (transition_[i] == RTT ? '.' : '-');
  219. // can we even have any?
  220. if (qs) {
  221. // not if we already had one!
  222. report_stat_terminus(desired_pkts_total,
  223.      pkts + i - 1,
  224.      rtts, timeouts,
  225.      ps + i - 1, qs + 1,
  226.      num_states,
  227.      num_state_names + i,
  228.      states,
  229.      state_names);
  230. } else {
  231. // recurse... assume the rest made it
  232. drop_[i]->print_all_stats(desired_pkts_total, pkts + desired_pkts_with_loss,
  233.   rtts + (transition_[i] == RTT ? 1 : 0),
  234.   timeouts + (transition_[i] == TIMEOUT ? 1 : 0),
  235.   ps + desired_pkts_with_loss, qs + 1,
  236.   num_states,
  237.   num_state_names + desired_pkts_this_round + 1);
  238. // 2nd drop somewhere in this round?
  239. int remaining_pkts_this_round = desired_pkts_this_round - i;
  240. if (qs == 0 && remaining_pkts_this_round > 0) {
  241. // yes, generate the probs
  242. int j;
  243. for (j = i+1; j <= desired_pkts_this_round; j++) {
  244. if (j > i+1)
  245. state_names[num_state_names + j - 1] = 's';
  246. state_names[num_state_names + j] = 'd';
  247. report_stat_terminus(desired_pkts_total,
  248.      pkts + j - 2,
  249.      rtts, timeouts,
  250.      ps + j - 2, qs + 2,
  251.      num_states,
  252.      num_state_names + j,
  253.      states,
  254.      state_names);
  255. };
  256. };
  257. };
  258. };
  259. }
  260. void
  261. FSM::print_FSM(FSMState* state)
  262. {
  263. #if 0
  264. int i;
  265. if (state != NULL) {
  266. for (i=0; i<17; i++) {
  267. if (state->drop_[i] != NULL) {
  268. if (i==0) 
  269. printf("%d->(%d) ", state->transition_[i], state->drop_[i]->batch_size_);
  270. else
  271. printf("n%d->(%d) ", state->transition_[i], state->drop_[i]->batch_size_);
  272. print_FSM(state->drop_[i]);
  273. }
  274. }
  275. }
  276. #else /* ! 0 */
  277. state->reset_all_processed();
  278. state->print_all(0);
  279. #endif /* 0 */
  280. }
  281. void
  282. FSM::print_FSM_stats(FSMState* state, int n)
  283. {
  284. state->reset_all_processed();
  285. state->print_all_stats(n);
  286. fflush(stdout);
  287. }
  288. static class TahoeAckFSMClass : public TclClass {
  289. public:
  290.         TahoeAckFSMClass() : TclClass("FSM/TahoeAck") {}
  291.         TclObject* create(int , const char*const*) {
  292.                 return (new TahoeAckFSM);
  293.         }
  294. } class_tahoeackfsm;
  295. static class RenoAckFSMClass : public TclClass {
  296. public:
  297.         RenoAckFSMClass() : TclClass("FSM/RenoAck") {}
  298.         TclObject* create(int , const char*const*) {
  299.                 return (new RenoAckFSM);
  300.         }
  301. } class_renoackfsm;
  302. static class TahoeDelAckFSMClass : public TclClass {
  303. public:
  304.         TahoeDelAckFSMClass() : TclClass("FSM/TahoeDelAck") {}
  305.         TclObject* create(int , const char*const*) {
  306.                 return (new TahoeDelAckFSM);
  307.         }
  308. } class_tahoedelackfsm;
  309. static class RenoDelAckFSMClass : public TclClass {
  310. public:
  311.         RenoDelAckFSMClass() : TclClass("FSM/RenoDelAck") {}
  312.         TclObject* create(int , const char*const*) {
  313.                 return (new RenoDelAckFSM);
  314.         }
  315. } class_renodelackfsm;
  316. // ***********************************************
  317. // Tahoe-Ack TCP Connection Finite State Machine *
  318. // ***********************************************
  319. TahoeAckFSM::TahoeAckFSM() : FSM(), start_state_(NULL) 
  320. {
  321. int i;
  322. FSMState* tmp;
  323. instance_ = this;
  324. // (wnd, ssh) == (1, 20)
  325. start_state_ = new FSMState;
  326. //printf("creating Tahoe Ack FSMn"); 
  327. for (i=0; i<17; i++) {
  328. start_state_->drop_[i] = NULL;
  329. start_state_->transition_[i] = -1;
  330. }
  331. start_state_->batch_size_ = 1;
  332. // (wnd, ssh) == (2, 20)
  333. tmp = new FSMState;
  334. for (i=0; i<17; i++) {
  335. tmp->drop_[i] = NULL;
  336. tmp->transition_[i] = -1;
  337. }
  338. tmp->batch_size_ = 2;
  339. start_state_->drop_[0] = tmp;
  340. start_state_->transition_[0] = RTT;
  341. tmp = new FSMState;
  342. for (i=0; i<17; i++) {
  343. tmp->drop_[i] = NULL;
  344. tmp->transition_[i] = -1;
  345. }
  346. tmp->batch_size_ = 2;
  347. start_state_->drop_[0]->drop_[2] = tmp;
  348. start_state_->drop_[0]->transition_[2] = RTT;
  349. // (wnd, ssh) == (4, 20)
  350. tmp = new FSMState;
  351. for (i=0; i<17; i++) {
  352. tmp->drop_[i] = NULL;
  353. tmp->transition_[i] = -1;
  354. }
  355. tmp->batch_size_ = 4;
  356. start_state_->drop_[0]->drop_[0] = tmp;
  357. start_state_->drop_[0]->transition_[0] = RTT;
  358. tmp = new FSMState;
  359. for (i=0; i<17; i++) {
  360. tmp->drop_[i] = NULL;
  361. tmp->transition_[i] = -1;
  362. }
  363. tmp->batch_size_ = 2;
  364. start_state_->drop_[0]->drop_[0]->drop_[2] = tmp;
  365. start_state_->drop_[0]->drop_[0]->transition_[2] = RTT;
  366. tmp = new FSMState;
  367. for (i=0; i<17; i++) {
  368. tmp->drop_[i] = NULL;
  369. tmp->transition_[i] = -1;
  370. }
  371. tmp->batch_size_ = 4;
  372. start_state_->drop_[0]->drop_[0]->drop_[3] = tmp;
  373. start_state_->drop_[0]->drop_[0]->transition_[3] = RTT;
  374. tmp = new FSMState;
  375. for (i=0; i<17; i++) {
  376. tmp->drop_[i] = NULL;
  377. tmp->transition_[i] = -1;
  378. }
  379. tmp->batch_size_ = 6;
  380. start_state_->drop_[0]->drop_[0]->drop_[4] = tmp;
  381. start_state_->drop_[0]->drop_[0]->transition_[4] = RTT;
  382. //(wnd, ssh) == (8, 20)
  383. tmp = new FSMState;
  384. for (i=0; i<17; i++) {
  385. tmp->drop_[i] = NULL;
  386. tmp->transition_[i] = -1;
  387. }
  388. tmp->batch_size_ = 8;
  389. start_state_->drop_[0]->drop_[0]->drop_[0] = tmp;
  390. start_state_->drop_[0]->drop_[0]->transition_[0] = RTT;
  391. tmp = new FSMState;
  392. for (i=0; i<17; i++) {
  393. tmp->drop_[i] = NULL;
  394. tmp->transition_[i] = -1;
  395. }
  396. tmp->batch_size_ = 2;
  397. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[2] = tmp;
  398. start_state_->drop_[0]->drop_[0]->drop_[0]->transition_[2] = RTT;
  399. tmp = new FSMState;
  400. for (i=0; i<17; i++) {
  401. tmp->drop_[i] = NULL;
  402. tmp->transition_[i] = -1;
  403. }
  404. tmp->batch_size_ = 4;
  405. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[3] = tmp;
  406. start_state_->drop_[0]->drop_[0]->drop_[0]->transition_[3] = RTT;
  407. tmp = new FSMState;
  408. for (i=0; i<17; i++) {
  409. tmp->drop_[i] = NULL;
  410. tmp->transition_[i] = -1;
  411. }
  412. tmp->batch_size_ = 6;
  413. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[4] = tmp;
  414. start_state_->drop_[0]->drop_[0]->drop_[0]->transition_[4] = RTT;
  415. tmp = new FSMState;
  416. for (i=0; i<17; i++) {
  417. tmp->drop_[i] = NULL;
  418. tmp->transition_[i] = -1;
  419. }
  420. tmp->batch_size_ = 8;
  421. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[5] = tmp;
  422. start_state_->drop_[0]->drop_[0]->drop_[0]->transition_[5] = RTT;
  423. tmp = new FSMState;
  424. for (i=0; i<17; i++) {
  425. tmp->drop_[i] = NULL;
  426. tmp->transition_[i] = -1;
  427. }
  428. tmp->batch_size_ = 10;
  429. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[6] = tmp;
  430. start_state_->drop_[0]->drop_[0]->drop_[0]->transition_[6] = RTT;
  431. tmp = new FSMState;
  432. for (i=0; i<17; i++) {
  433. tmp->drop_[i] = NULL;
  434. tmp->transition_[i] = -1;
  435. }
  436. tmp->batch_size_ = 12;
  437. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[7] = tmp;
  438. start_state_->drop_[0]->drop_[0]->drop_[0]->transition_[7] = RTT;
  439. tmp = new FSMState;
  440. for (i=0; i<17; i++) {
  441. tmp->drop_[i] = NULL;
  442. tmp->transition_[i] = -1;
  443. }
  444. tmp->batch_size_ = 14;
  445. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[8] = tmp;
  446. start_state_->drop_[0]->drop_[0]->drop_[0]->transition_[8] = RTT;
  447. //(wnd, ssh) == (16, 20)
  448. tmp = new FSMState;
  449. for (i=0; i<17; i++) {
  450. tmp->drop_[i] = NULL;
  451. tmp->transition_[i] = -1;
  452. }
  453. tmp->batch_size_ = 16;
  454. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0] = tmp;
  455. start_state_->drop_[0]->drop_[0]->drop_[0]->transition_[0] = RTT;
  456. tmp = new FSMState;
  457. for (i=0; i<17; i++) {
  458. tmp->drop_[i] = NULL;
  459. tmp->transition_[i] = -1;
  460. }
  461. tmp->batch_size_ = 1;
  462. for (i=1; i<17; i++) start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[i] = tmp;
  463. for (i=1; i<14; i++)
  464. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->transition_[i] = RTT;
  465. for (i=14; i<17; i++)
  466. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->transition_[i] = TIMEOUT;
  467. //(wnd, ssh) == (1, 2), timeout
  468. tmp = new FSMState;
  469. for (i=0; i<17; i++) {
  470. tmp->drop_[i] = NULL;
  471. tmp->transition_[i] = -1;
  472. }
  473. tmp->batch_size_ = 1;
  474. start_state_->drop_[1] = tmp;
  475. start_state_->transition_[1] = TIMEOUT;
  476. start_state_->drop_[0]->drop_[1] = tmp;
  477. start_state_->drop_[0]->transition_[1] = TIMEOUT;
  478. start_state_->drop_[0]->drop_[2]->drop_[0] = tmp;
  479. start_state_->drop_[0]->drop_[2]->transition_[0] = TIMEOUT;
  480. start_state_->drop_[0]->drop_[0]->drop_[1] = tmp;
  481. start_state_->drop_[0]->drop_[0]->transition_[1] = RTT;
  482. start_state_->drop_[0]->drop_[0]->drop_[2]->drop_[0] = tmp;
  483. start_state_->drop_[0]->drop_[0]->drop_[2]->transition_[0] = RTT;
  484. //(wnd, ssh) == (2, 2)
  485. tmp = new FSMState;
  486. for (i=0; i<17; i++) {
  487. tmp->drop_[i] = NULL;
  488. tmp->transition_[i] = -1;
  489. }
  490. tmp->batch_size_ = 2;
  491. start_state_->drop_[1]->drop_[0] = tmp;
  492. start_state_->drop_[1]->transition_[0] = RTT;
  493. //(wnd, ssh) == (2.5, 2)
  494. tmp = new FSMState;
  495. for (i=0; i<17; i++) {
  496. tmp->drop_[i] = NULL;
  497. tmp->transition_[i] = -1;
  498. }
  499. tmp->batch_size_ = 2;
  500. start_state_->drop_[1]->drop_[0]->drop_[0] = tmp;
  501. start_state_->drop_[1]->drop_[0]->transition_[0] = RTT;
  502. //(wnd, ssh) == (3, 2)
  503. tmp = new FSMState;
  504. for (i=0; i<17; i++) {
  505. tmp->drop_[i] = NULL;
  506. tmp->transition_[i] = -1;
  507. }
  508. tmp->batch_size_ = 3;
  509. start_state_->drop_[1]->drop_[0]->drop_[0]->drop_[0] = tmp;
  510. start_state_->drop_[1]->drop_[0]->drop_[0]->transition_[0] = RTT;
  511. //(wnd, ssh) == (4, 2)
  512. tmp = new FSMState;
  513. for (i=0; i<17; i++) {
  514. tmp->drop_[i] = NULL;
  515. tmp->transition_[i] = -1;
  516. }
  517. tmp->batch_size_ = 4;
  518. start_state_->drop_[1]->drop_[0]->drop_[0]->drop_[0]->drop_[0] = tmp;
  519. start_state_->drop_[1]->drop_[0]->drop_[0]->drop_[0]->transition_[0] = RTT;
  520. //(wnd, ssh) == (5, 2)
  521. tmp = new FSMState;
  522. for (i=0; i<17; i++) {
  523. tmp->drop_[i] = NULL;
  524. tmp->transition_[i] = -1;
  525. }
  526. tmp->batch_size_ = 5;
  527. start_state_->drop_[1]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0] = tmp;
  528. start_state_->drop_[1]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->transition_[0] = RTT;
  529. //(wnd, ssh) == (6, 2)
  530. tmp = new FSMState;
  531. for (i=0; i<17; i++) {
  532. tmp->drop_[i] = NULL;
  533. tmp->transition_[i] = -1;
  534. }
  535. tmp->batch_size_ = 6;
  536. start_state_->drop_[1]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0] = tmp;
  537. start_state_->drop_[1]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->transition_[0] = RTT;
  538. //(wnd, ssh) == (7, 2)
  539. tmp = new FSMState;
  540. for (i=0; i<17; i++) {
  541. tmp->drop_[i] = NULL;
  542. tmp->transition_[i] = -1;
  543. }
  544. tmp->batch_size_ = 7;
  545. start_state_->drop_[1]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0] = tmp;
  546. start_state_->drop_[1]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->transition_[0] = RTT;
  547. //(wnd, ssh) == (7, 2)
  548. tmp = new FSMState;
  549. for (i=0; i<17; i++) {
  550. tmp->drop_[i] = NULL;
  551. tmp->transition_[i] = -1;
  552. }
  553. tmp->batch_size_ = 7;
  554. start_state_->drop_[1]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0] = tmp;
  555. start_state_->drop_[1]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->transition_[0] = RTT;
  556. //(wnd, ssh) == (1, 3)
  557. tmp = new FSMState;
  558. for (i=0; i<17; i++) {
  559. tmp->drop_[i] = NULL;
  560. tmp->transition_[i] = -1;
  561. }
  562. tmp->batch_size_ = 1;
  563. start_state_->drop_[0]->drop_[0]->drop_[3]->drop_[0] = tmp;
  564. start_state_->drop_[0]->drop_[0]->drop_[3]->transition_[0] = RTT;
  565. start_state_->drop_[0]->drop_[0]->drop_[4]->drop_[0] = tmp;
  566. start_state_->drop_[0]->drop_[0]->drop_[4]->transition_[0] = RTT;
  567. tmp = new FSMState;
  568. for (i=0; i<17; i++) {
  569. tmp->drop_[i] = NULL;
  570. tmp->transition_[i] = -1;
  571. }
  572. tmp->batch_size_ = 2;
  573. start_state_->drop_[0]->drop_[0]->drop_[3]->drop_[0]->drop_[0] = tmp;
  574. start_state_->drop_[0]->drop_[0]->drop_[3]->drop_[0]->transition_[0] = RTT;
  575. tmp = new FSMState;
  576. for (i=0; i<17; i++) {
  577. tmp->drop_[i] = NULL;
  578. tmp->transition_[i] = -1;
  579. }
  580. tmp->batch_size_ = 3;
  581. start_state_->drop_[0]->drop_[0]->drop_[3]->drop_[0]->drop_[0]->drop_[0] = tmp;
  582. start_state_->drop_[0]->drop_[0]->drop_[3]->drop_[0]->drop_[0]->transition_[0] = RTT;
  583. tmp = new FSMState;
  584. for (i=0; i<17; i++) {
  585. tmp->drop_[i] = NULL;
  586. tmp->transition_[i] = -1;
  587. }
  588. tmp->batch_size_ = 4;
  589. start_state_->drop_[0]->drop_[0]->drop_[3]->drop_[0]->drop_[0]->drop_[0]->drop_[0] = tmp;
  590. start_state_->drop_[0]->drop_[0]->drop_[3]->drop_[0]->drop_[0]->drop_[0]->transition_[0] = RTT;
  591. tmp = new FSMState;
  592. for (i=0; i<17; i++) {
  593. tmp->drop_[i] = NULL;
  594. tmp->transition_[i] = -1;
  595. }
  596. tmp->batch_size_ = 5;
  597. start_state_->drop_[0]->drop_[0]->drop_[3]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0] = tmp;
  598. start_state_->drop_[0]->drop_[0]->drop_[3]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->transition_[0] = RTT;
  599. tmp = new FSMState;
  600. for (i=0; i<17; i++) {
  601. tmp->drop_[i] = NULL;
  602. tmp->transition_[i] = -1;
  603. }
  604. tmp->batch_size_ = 5;
  605. start_state_->drop_[0]->drop_[0]->drop_[3]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0] = tmp;
  606. start_state_->drop_[0]->drop_[0]->drop_[3]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->transition_[0] = RTT;
  607. tmp = new FSMState;
  608. for (i=0; i<17; i++) {
  609. tmp->drop_[i] = NULL;
  610. tmp->transition_[i] = -1;
  611. }
  612. tmp->batch_size_ = 6;
  613. start_state_->drop_[0]->drop_[0]->drop_[3]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0] = tmp;
  614. start_state_->drop_[0]->drop_[0]->drop_[3]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->transition_[0] = RTT;
  615. //(wnd, ssh) == (1, 4)
  616. tmp = new FSMState;
  617. for (i=0; i<17; i++) {
  618. tmp->drop_[i] = NULL;
  619. tmp->transition_[i] = -1;
  620. }
  621. tmp->batch_size_ = 1;
  622. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[1] = tmp;
  623. start_state_->drop_[0]->drop_[0]->drop_[0]->transition_[1] = RTT;
  624. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[2]->drop_[0] = tmp;
  625. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[2]->transition_[0] = 0;
  626. tmp = new FSMState;
  627. for (i=0; i<17; i++) {
  628. tmp->drop_[i] = NULL;
  629. tmp->transition_[i] = -1;
  630. }
  631. tmp->batch_size_ = 2;
  632. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[1]->drop_[0] = tmp;
  633. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[1]->transition_[0] = RTT;
  634. tmp = new FSMState;
  635. for (i=0; i<17; i++) {
  636. tmp->drop_[i] = NULL;
  637. tmp->transition_[i] = -1;
  638. }
  639. tmp->batch_size_ = 4;
  640. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[1]->drop_[0]->drop_[0] = tmp;
  641. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[1]->drop_[0]->transition_[0] = RTT;
  642. tmp = new FSMState;
  643. for (i=0; i<17; i++) {
  644. tmp->drop_[i] = NULL;
  645. tmp->transition_[i] = -1;
  646. }
  647. tmp->batch_size_ = 4;
  648. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[1]->drop_[0]->drop_[0]->drop_[0] = tmp;
  649. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[1]->drop_[0]->drop_[0]->transition_[0] = RTT;
  650. tmp = new FSMState;
  651. for (i=0; i<17; i++) {
  652. tmp->drop_[i] = NULL;
  653. tmp->transition_[i] = -1;
  654. }
  655. tmp->batch_size_ = 5;
  656. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[1]->drop_[0]->drop_[0]->drop_[0]->drop_[0] = tmp;
  657. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[1]->drop_[0]->drop_[0]->drop_[0]->transition_[0] = RTT;
  658. tmp = new FSMState;
  659. for (i=0; i<17; i++) {
  660. tmp->drop_[i] = NULL;
  661. tmp->transition_[i] = -1;
  662. }
  663. tmp->batch_size_ = 6;
  664. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[1]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0] = tmp;
  665. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[1]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->transition_[0] = RTT;
  666. //(wnd, ssh) == (1, 5)
  667. tmp = new FSMState;
  668. for (i=0; i<17; i++) {
  669. tmp->drop_[i] = NULL;
  670. tmp->transition_[i] = -1;
  671. }
  672. tmp->batch_size_ = 1;
  673. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[3]->drop_[0] = tmp;
  674. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[3]->transition_[0] = 0;
  675. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[4]->drop_[0] = tmp;
  676. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[4]->transition_[0] = 0;
  677. tmp = new FSMState;
  678. for (i=0; i<17; i++) {
  679. tmp->drop_[i] = NULL;
  680. tmp->transition_[i] = -1;
  681. }
  682. tmp->batch_size_ = 2;
  683. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[3]->drop_[0]->drop_[0] = tmp;
  684. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[3]->drop_[0]->transition_[0] = RTT;
  685. tmp = new FSMState;
  686. for (i=0; i<17; i++) {
  687. tmp->drop_[i] = NULL;
  688. tmp->transition_[i] = -1;
  689. }
  690. tmp->batch_size_ = 4;
  691. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[3]->drop_[0]->drop_[0]->drop_[0] = tmp;
  692. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[3]->drop_[0]->drop_[0]->transition_[0] = RTT;
  693. tmp = new FSMState;
  694. for (i=0; i<17; i++) {
  695. tmp->drop_[i] = NULL;
  696. tmp->transition_[i] = -1;
  697. }
  698. tmp->batch_size_ = 5;
  699. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[3]->drop_[0]->drop_[0]->drop_[0]->drop_[0] = tmp;
  700. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[3]->drop_[0]->drop_[0]->drop_[0]->transition_[0] = RTT;
  701. tmp = new FSMState;
  702. for (i=0; i<17; i++) {
  703. tmp->drop_[i] = NULL;
  704. tmp->transition_[i] = -1;
  705. }
  706. tmp->batch_size_ = 6;
  707. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[3]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0] = tmp;
  708. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[3]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->transition_[0] = RTT;
  709. //(wnd, ssh) == (1, 6)
  710. tmp = new FSMState;
  711. for (i=0; i<17; i++) {
  712. tmp->drop_[i] = NULL;
  713. tmp->transition_[i] = -1;
  714. }
  715. tmp->batch_size_ = 1;
  716. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[5]->drop_[0] = tmp;
  717. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[5]->transition_[0] = 0;
  718. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[6]->drop_[0] = tmp;
  719. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[6]->transition_[0] = RTT;
  720. tmp = new FSMState;
  721. for (i=0; i<17; i++) {
  722. tmp->drop_[i] = NULL;
  723. tmp->transition_[i] = -1;
  724. }
  725. tmp->batch_size_ = 2;
  726. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[5]->drop_[0]->drop_[0] = tmp;
  727. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[5]->drop_[0]->transition_[0] = RTT;
  728. tmp = new FSMState;
  729. for (i=0; i<17; i++) {
  730. tmp->drop_[i] = NULL;
  731. tmp->transition_[i] = -1;
  732. }
  733. tmp->batch_size_ = 4;
  734. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[5]->drop_[0]->drop_[0]->drop_[0] = tmp;
  735. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[5]->drop_[0]->drop_[0]->transition_[0] = RTT;
  736. tmp = new FSMState;
  737. for (i=0; i<17; i++) {
  738. tmp->drop_[i] = NULL;
  739. tmp->transition_[i] = -1;
  740. }
  741. tmp->batch_size_ = 6;
  742. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[5]->drop_[0]->drop_[0]->drop_[0]->drop_[0] = tmp;
  743. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[5]->drop_[0]->drop_[0]->drop_[0]->transition_[0] = RTT;
  744. //(wnd, ssh) == (1, 7)
  745. tmp = new FSMState;
  746. for (i=0; i<17; i++) {
  747. tmp->drop_[i] = NULL;
  748. tmp->transition_[i] = -1;
  749. }
  750. tmp->batch_size_ = 1;
  751. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[7]->drop_[0] = tmp;
  752. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[7]->transition_[0] = RTT;
  753. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[8]->drop_[0] = tmp;
  754. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[8]->transition_[0] = RTT;
  755. tmp = new FSMState;
  756. for (i=0; i<17; i++) {
  757. tmp->drop_[i] = NULL;
  758. tmp->transition_[i] = -1;
  759. }
  760. tmp->batch_size_ = 2;
  761. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[7]->drop_[0]->drop_[0] = tmp;
  762. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[7]->drop_[0]->transition_[0] = RTT;
  763. tmp = new FSMState;
  764. for (i=0; i<17; i++) {
  765. tmp->drop_[i] = NULL;
  766. tmp->transition_[i] = -1;
  767. }
  768. tmp->batch_size_ = 4;
  769. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[7]->drop_[0]->drop_[0]->drop_[0] = tmp;
  770. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[7]->drop_[0]->drop_[0]->transition_[0] = RTT;
  771. //print_FSM(start_state_);
  772. //printf("n");
  773. }
  774. // **********************************************
  775. // Reno-ACK TCP Connection Finite State Machine *
  776. // **********************************************
  777. RenoAckFSM::RenoAckFSM() : FSM(), start_state_(NULL) 
  778. {
  779. int i;
  780. FSMState* tmp;
  781. //printf("creating Reno Ack FSMn");
  782. instance_ = this;
  783. // (wnd, ssh) == (1, 20)
  784. start_state_ = new FSMState;
  785. for (i=0; i<17; i++) {
  786. start_state_->drop_[i] = NULL;
  787. start_state_->transition_[i] = -1;
  788. }
  789. start_state_->batch_size_ = 1;
  790. // (wnd, ssh) == (2, 20)
  791. tmp = new FSMState;
  792. for (i=0; i<17; i++) {
  793. tmp->drop_[i] = NULL;
  794. tmp->transition_[i] = -1;
  795. }
  796. tmp->batch_size_ = 2;
  797. start_state_->drop_[0] = tmp;
  798. start_state_->transition_[0] = RTT;
  799. tmp = new FSMState;
  800. for (i=0; i<17; i++) {
  801. tmp->drop_[i] = NULL;
  802. tmp->transition_[i] = -1;
  803. }
  804. tmp->batch_size_ = 2;
  805. start_state_->drop_[0]->drop_[2] = tmp;
  806. start_state_->drop_[0]->transition_[2] = RTT;
  807. // (wnd, ssh) == (4, 20)
  808. tmp = new FSMState;
  809. for (i=0; i<17; i++) {
  810. tmp->drop_[i] = NULL;
  811. tmp->transition_[i] = -1;
  812. }
  813. tmp->batch_size_ = 4;
  814. start_state_->drop_[0]->drop_[0] = tmp;
  815. start_state_->drop_[0]->transition_[0] = RTT;
  816. tmp = new FSMState;
  817. for (i=0; i<17; i++) {
  818. tmp->drop_[i] = NULL;
  819. tmp->transition_[i] = -1;
  820. }
  821. tmp->batch_size_ = 2;
  822. start_state_->drop_[0]->drop_[0]->drop_[2] = tmp;
  823. start_state_->drop_[0]->drop_[0]->transition_[2] = RTT;
  824. tmp = new FSMState;
  825. for (i=0; i<17; i++) {
  826. tmp->drop_[i] = NULL;
  827. tmp->transition_[i] = -1;
  828. }
  829. tmp->batch_size_ = 4;
  830. start_state_->drop_[0]->drop_[0]->drop_[3] = tmp;
  831. start_state_->drop_[0]->drop_[0]->transition_[3] = RTT;
  832. tmp = new FSMState;
  833. for (i=0; i<17; i++) {
  834. tmp->drop_[i] = NULL;
  835. tmp->transition_[i] = -1;
  836. }
  837. tmp->batch_size_ = 6;
  838. start_state_->drop_[0]->drop_[0]->drop_[4] = tmp;
  839. start_state_->drop_[0]->drop_[0]->transition_[4] = RTT;
  840. //(wnd, ssh) == (8, 20)
  841. tmp = new FSMState;
  842. for (i=0; i<17; i++) {
  843. tmp->drop_[i] = NULL;
  844. tmp->transition_[i] = -1;
  845. }
  846. tmp->batch_size_ = 8;
  847. start_state_->drop_[0]->drop_[0]->drop_[0] = tmp;
  848. start_state_->drop_[0]->drop_[0]->transition_[0] = RTT;
  849. tmp = new FSMState;
  850. for (i=0; i<17; i++) {
  851. tmp->drop_[i] = NULL;
  852. tmp->transition_[i] = -1;
  853. }
  854. tmp->batch_size_ = 4;
  855. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[3] = tmp;
  856. start_state_->drop_[0]->drop_[0]->drop_[0]->transition_[3] = RTT;
  857. tmp = new FSMState;
  858. for (i=0; i<17; i++) {
  859. tmp->drop_[i] = NULL;
  860. tmp->transition_[i] = -1;
  861. }
  862. tmp->batch_size_ = 6;
  863. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[4] = tmp;
  864. start_state_->drop_[0]->drop_[0]->drop_[0]->transition_[4] = RTT;
  865. tmp = new FSMState;
  866. for (i=0; i<17; i++) {
  867. tmp->drop_[i] = NULL;
  868. tmp->transition_[i] = -1;
  869. }
  870. tmp->batch_size_ = 8;
  871. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[5] = tmp;
  872. start_state_->drop_[0]->drop_[0]->drop_[0]->transition_[5] = RTT;
  873. tmp = new FSMState;
  874. for (i=0; i<17; i++) {
  875. tmp->drop_[i] = NULL;
  876. tmp->transition_[i] = -1;
  877. }
  878. tmp->batch_size_ = 10;
  879. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[6] = tmp;
  880. start_state_->drop_[0]->drop_[0]->drop_[0]->transition_[6] = RTT;
  881. tmp = new FSMState;
  882. for (i=0; i<17; i++) {
  883. tmp->drop_[i] = NULL;
  884. tmp->transition_[i] = -1;
  885. }
  886. tmp->batch_size_ = 6;
  887. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[6]->drop_[0] = tmp;
  888. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[6]->transition_[0] = RTT;
  889. tmp = new FSMState;
  890. for (i=0; i<17; i++) {
  891. tmp->drop_[i] = NULL;
  892. tmp->transition_[i] = -1;
  893. }
  894. tmp->batch_size_ = 12;
  895. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[7] = tmp;
  896. start_state_->drop_[0]->drop_[0]->drop_[0]->transition_[7] = RTT;
  897. tmp = new FSMState;
  898. for (i=0; i<17; i++) {
  899. tmp->drop_[i] = NULL;
  900. tmp->transition_[i] = -1;
  901. }
  902. tmp->batch_size_ = 14;
  903. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[8] = tmp;
  904. start_state_->drop_[0]->drop_[0]->drop_[0]->transition_[8] = RTT;
  905. //(wnd, ssh) == (16, 20)
  906. tmp = new FSMState;
  907. for (i=0; i<17; i++) {
  908. tmp->drop_[i] = NULL;
  909. tmp->transition_[i] = -1;
  910. }
  911. tmp->batch_size_ = 16;
  912. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0] = tmp;
  913. start_state_->drop_[0]->drop_[0]->drop_[0]->transition_[0] = RTT;
  914. tmp = new FSMState;
  915. for (i=0; i<17; i++) {
  916. tmp->drop_[i] = NULL;
  917. tmp->transition_[i] = -1;
  918. }
  919. tmp->batch_size_ = 1;
  920. for (i=1; i<17; i++) start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[i] = tmp;
  921. for (i=1; i<14; i++)
  922. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->transition_[i] = RTT;
  923. for (i=14; i<17; i++)
  924. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->transition_[i] = TIMEOUT;
  925. //(wnd, ssh) == (1, 2), timeout
  926. tmp = new FSMState;
  927. for (i=0; i<17; i++) {
  928. tmp->drop_[i] = NULL;
  929. tmp->transition_[i] = -1;
  930. }
  931. tmp->batch_size_ = 1;
  932. start_state_->drop_[1] = tmp;
  933. start_state_->transition_[1] = TIMEOUT;
  934. start_state_->drop_[0]->drop_[1] = tmp;
  935. start_state_->drop_[0]->transition_[1] = TIMEOUT;
  936. start_state_->drop_[0]->drop_[2]->drop_[0] = tmp;
  937. start_state_->drop_[0]->drop_[2]->transition_[0] = TIMEOUT;
  938. //(wnd, ssh) == (2, 2)
  939. tmp = new FSMState;
  940. for (i=0; i<17; i++) {
  941. tmp->drop_[i] = NULL;
  942. tmp->transition_[i] = -1;
  943. }
  944. tmp->batch_size_ = 2;
  945. start_state_->drop_[1]->drop_[0] = tmp;
  946. start_state_->drop_[1]->transition_[0] = RTT;
  947. start_state_->drop_[0]->drop_[0]->drop_[1] = tmp;
  948. start_state_->drop_[0]->drop_[0]->transition_[1] = RTT;
  949. start_state_->drop_[0]->drop_[0]->drop_[2]->drop_[0] = tmp;
  950. start_state_->drop_[0]->drop_[0]->drop_[2]->transition_[0] = RTT;
  951. //(wnd, ssh) == (2.5, 2)
  952. tmp = new FSMState;
  953. for (i=0; i<17; i++) {
  954. tmp->drop_[i] = NULL;
  955. tmp->transition_[i] = -1;
  956. }
  957. tmp->batch_size_ = 2;
  958. start_state_->drop_[1]->drop_[0]->drop_[0] = tmp;
  959. start_state_->drop_[1]->drop_[0]->transition_[0] = RTT;
  960. //(wnd, ssh) == (3, 2)
  961. tmp = new FSMState;
  962. for (i=0; i<17; i++) {
  963. tmp->drop_[i] = NULL;
  964. tmp->transition_[i] = -1;
  965. }
  966. tmp->batch_size_ = 3;
  967. start_state_->drop_[1]->drop_[0]->drop_[0]->drop_[0] = tmp;
  968. start_state_->drop_[1]->drop_[0]->drop_[0]->transition_[0] = RTT;
  969. //(wnd, ssh) == (4, 2)
  970. tmp = new FSMState;
  971. for (i=0; i<17; i++) {
  972. tmp->drop_[i] = NULL;
  973. tmp->transition_[i] = -1;
  974. }
  975. tmp->batch_size_ = 4;
  976. start_state_->drop_[1]->drop_[0]->drop_[0]->drop_[0]->drop_[0] = tmp;
  977. start_state_->drop_[1]->drop_[0]->drop_[0]->drop_[0]->transition_[0] = RTT;
  978. //(wnd, ssh) == (5, 2)
  979. tmp = new FSMState;
  980. for (i=0; i<17; i++) {
  981. tmp->drop_[i] = NULL;
  982. tmp->transition_[i] = -1;
  983. }
  984. tmp->batch_size_ = 5;
  985. start_state_->drop_[1]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0] = tmp;
  986. start_state_->drop_[1]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->transition_[0] = RTT;
  987. //(wnd, ssh) == (6, 2)
  988. tmp = new FSMState;
  989. for (i=0; i<17; i++) {
  990. tmp->drop_[i] = NULL;
  991. tmp->transition_[i] = -1;
  992. }
  993. tmp->batch_size_ = 6;
  994. start_state_->drop_[1]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0] = tmp;
  995. start_state_->drop_[1]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->transition_[0] = RTT;
  996. //(wnd, ssh) == (7, 2)
  997. tmp = new FSMState;
  998. for (i=0; i<17; i++) {
  999. tmp->drop_[i] = NULL;
  1000. tmp->transition_[i] = -1;
  1001. }
  1002. tmp->batch_size_ = 7;
  1003. start_state_->drop_[1]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0] = tmp;
  1004. start_state_->drop_[1]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->transition_[0] = RTT;
  1005. //(wnd, ssh) == (7.5, 2)
  1006. tmp = new FSMState;
  1007. for (i=0; i<17; i++) {
  1008. tmp->drop_[i] = NULL;
  1009. tmp->transition_[i] = -1;
  1010. }
  1011. tmp->batch_size_ = 7;
  1012. start_state_->drop_[1]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0] = tmp;
  1013. start_state_->drop_[1]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->transition_[0] = RTT;
  1014. //(wnd, ssh) == (3, 3)
  1015. tmp = new FSMState;
  1016. for (i=0; i<17; i++) {
  1017. tmp->drop_[i] = NULL;
  1018. tmp->transition_[i] = -1;
  1019. }
  1020. tmp->batch_size_ = 3;
  1021. start_state_->drop_[0]->drop_[0]->drop_[3]->drop_[0] = tmp;
  1022. start_state_->drop_[0]->drop_[0]->drop_[3]->transition_[0] = RTT;
  1023. start_state_->drop_[0]->drop_[0]->drop_[4]->drop_[0] = tmp;
  1024. start_state_->drop_[0]->drop_[0]->drop_[4]->transition_[0] = RTT;
  1025. tmp = new FSMState;
  1026. for (i=0; i<17; i++) {
  1027. tmp->drop_[i] = NULL;
  1028. tmp->transition_[i] = -1;
  1029. }
  1030. tmp->batch_size_ = 3;
  1031. start_state_->drop_[0]->drop_[0]->drop_[3]->drop_[0]->drop_[0] = tmp;
  1032. start_state_->drop_[0]->drop_[0]->drop_[3]->drop_[0]->transition_[0] = RTT;
  1033. tmp = new FSMState;
  1034. for (i=0; i<17; i++) {
  1035. tmp->drop_[i] = NULL;
  1036. tmp->transition_[i] = -1;
  1037. }
  1038. tmp->batch_size_ = 4;
  1039. start_state_->drop_[0]->drop_[0]->drop_[3]->drop_[0]->drop_[0]->drop_[0] = tmp;
  1040. start_state_->drop_[0]->drop_[0]->drop_[3]->drop_[0]->drop_[0]->transition_[0] = RTT;
  1041. tmp = new FSMState;
  1042. for (i=0; i<17; i++) {
  1043. tmp->drop_[i] = NULL;
  1044. tmp->transition_[i] = -1;
  1045. }
  1046. tmp->batch_size_ = 5;
  1047. start_state_->drop_[0]->drop_[0]->drop_[3]->drop_[0]->drop_[0]->drop_[0]->drop_[0] = tmp;
  1048. start_state_->drop_[0]->drop_[0]->drop_[3]->drop_[0]->drop_[0]->drop_[0]->transition_[0] = RTT;
  1049. tmp = new FSMState;
  1050. for (i=0; i<17; i++) {
  1051. tmp->drop_[i] = NULL;
  1052. tmp->transition_[i] = -1;
  1053. }
  1054. tmp->batch_size_ = 6;
  1055. start_state_->drop_[0]->drop_[0]->drop_[3]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0] = tmp;
  1056. start_state_->drop_[0]->drop_[0]->drop_[3]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->transition_[0] = RTT;
  1057. //(wnd, ssh) == (4, 4)
  1058. tmp = new FSMState;
  1059. for (i=0; i<17; i++) {
  1060. tmp->drop_[i] = NULL;
  1061. tmp->transition_[i] = -1;
  1062. }
  1063. tmp->batch_size_ = 4;
  1064. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[1] = tmp;
  1065. start_state_->drop_[0]->drop_[0]->drop_[0]->transition_[1] = RTT;
  1066. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[2] = tmp;
  1067. start_state_->drop_[0]->drop_[0]->drop_[0]->transition_[2] = RTT;
  1068. tmp = new FSMState;
  1069. for (i=0; i<17; i++) {
  1070. tmp->drop_[i] = NULL;
  1071. tmp->transition_[i] = -1;
  1072. }
  1073. tmp->batch_size_ = 4;
  1074. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[1]->drop_[0] = tmp;
  1075. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[1]->transition_[0] = RTT;
  1076. tmp = new FSMState;
  1077. for (i=0; i<17; i++) {
  1078. tmp->drop_[i] = NULL;
  1079. tmp->transition_[i] = -1;
  1080. }
  1081. tmp->batch_size_ = 5;
  1082. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[1]->drop_[0]->drop_[0] = tmp;
  1083. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[1]->drop_[0]->transition_[0] = RTT;
  1084. tmp = new FSMState;
  1085. for (i=0; i<17; i++) {
  1086. tmp->drop_[i] = NULL;
  1087. tmp->transition_[i] = -1;
  1088. }
  1089. tmp->batch_size_ = 6;
  1090. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[1]->drop_[0]->drop_[0]->drop_[0] = tmp;
  1091. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[1]->drop_[0]->drop_[0]->transition_[0] = RTT;
  1092. //(wnd, ssh) == (5, 5)
  1093. tmp = new FSMState;
  1094. for (i=0; i<17; i++) {
  1095. tmp->drop_[i] = NULL;
  1096. tmp->transition_[i] = -1;
  1097. }
  1098. tmp->batch_size_ = 1;
  1099. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[3]->drop_[0] = tmp;
  1100. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[3]->transition_[0] = 0;
  1101. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[4]->drop_[0] = tmp;
  1102. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[4]->transition_[0] = 0;
  1103. tmp = new FSMState;
  1104. for (i=0; i<17; i++) {
  1105. tmp->drop_[i] = NULL;
  1106. tmp->transition_[i] = -1;
  1107. }
  1108. tmp->batch_size_ = 5;
  1109. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[3]->drop_[0]->drop_[0] = tmp;
  1110. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[3]->drop_[0]->transition_[0] = RTT;
  1111. tmp = new FSMState;
  1112. for (i=0; i<17; i++) {
  1113. tmp->drop_[i] = NULL;
  1114. tmp->transition_[i] = -1;
  1115. }
  1116. tmp->batch_size_ = 6;
  1117. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[3]->drop_[0]->drop_[0]->drop_[0] = tmp;
  1118. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[3]->drop_[0]->drop_[0]->transition_[0] = RTT;
  1119. tmp = new FSMState;
  1120. for (i=0; i<17; i++) {
  1121. tmp->drop_[i] = NULL;
  1122. tmp->transition_[i] = -1;
  1123. }
  1124. tmp->batch_size_ = 7;
  1125. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[3]->drop_[0]->drop_[0]->drop_[0]->drop_[0] = tmp;
  1126. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[3]->drop_[0]->drop_[0]->drop_[0]->transition_[0] = RTT;
  1127. //(wnd, ssh) == (6, 6)
  1128. tmp = new FSMState;
  1129. for (i=0; i<17; i++) {
  1130. tmp->drop_[i] = NULL;
  1131. tmp->transition_[i] = -1;
  1132. }
  1133. tmp->batch_size_ = 1;
  1134. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[5]->drop_[0] = tmp;
  1135. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[5]->transition_[0] = 0;
  1136. tmp = new FSMState;
  1137. for (i=0; i<17; i++) {
  1138. tmp->drop_[i] = NULL;
  1139. tmp->transition_[i] = -1;
  1140. }
  1141. tmp->batch_size_ = 6;
  1142. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[5]->drop_[0]->drop_[0] = tmp;
  1143. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[5]->drop_[0]->transition_[0] = RTT;
  1144. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[6]->drop_[0]->drop_[0] = tmp;
  1145. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[6]->drop_[0]->transition_[0] = RTT;
  1146. tmp = new FSMState;
  1147. for (i=0; i<17; i++) {
  1148. tmp->drop_[i] = NULL;
  1149. tmp->transition_[i] = -1;
  1150. }
  1151. tmp->batch_size_ = 7;
  1152. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[5]->drop_[0]->drop_[0]->drop_[0] = tmp;
  1153. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[5]->drop_[0]->drop_[0]->transition_[0] = RTT;
  1154. //(wnd, ssh) == (7, 7)
  1155. tmp = new FSMState;
  1156. for (i=0; i<17; i++) {
  1157. tmp->drop_[i] = NULL;
  1158. tmp->transition_[i] = -1;
  1159. }
  1160. tmp->batch_size_ = 7;
  1161. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[7]->drop_[0] = tmp;
  1162. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[7]->transition_[0] = RTT;
  1163. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[8]->drop_[0] = tmp;
  1164. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[8]->transition_[0] = RTT;
  1165. //print_FSM(start_state_);
  1166. //printf("n");
  1167. }
  1168. // *****************************************************
  1169. // Tahoe-Delay Ack TCP Connection Finite State Machine *
  1170. // *****************************************************
  1171. TahoeDelAckFSM::TahoeDelAckFSM() : FSM(), start_state_(NULL) 
  1172. {
  1173. int i;
  1174. FSMState* tmp;
  1175. //printf("creating Tahoe DelAck FSMn");
  1176. instance_ = this;
  1177. // (wnd, ssh) == (1, 20)
  1178. start_state_ = new FSMState;
  1179. for (i=0; i<17; i++) {
  1180. start_state_->drop_[i] = NULL;
  1181. start_state_->transition_[i] = -1;
  1182. }
  1183. start_state_->batch_size_ = 1;
  1184. // (wnd, ssh) == (2, 20)
  1185. tmp = new FSMState;
  1186. for (i=0; i<17; i++) {
  1187. tmp->drop_[i] = NULL;
  1188. tmp->transition_[i] = -1;
  1189. }
  1190. tmp->batch_size_ = 2;
  1191. start_state_->drop_[0] = tmp;
  1192. start_state_->transition_[0] = RTT;
  1193. tmp = new FSMState;
  1194. for (i=0; i<17; i++) {
  1195. tmp->drop_[i] = NULL;
  1196. tmp->transition_[i] = -1;
  1197. }
  1198. tmp->batch_size_ = 2;
  1199. start_state_->drop_[0]->drop_[2] = tmp;
  1200. start_state_->drop_[0]->transition_[2] = RTT;
  1201. // (wnd, ssh) == (3, 20)
  1202. tmp = new FSMState;
  1203. for (i=0; i<17; i++) {
  1204. tmp->drop_[i] = NULL;
  1205. tmp->transition_[i] = -1;
  1206. }
  1207. tmp->batch_size_ = 3;
  1208. start_state_->drop_[0]->drop_[0] = tmp;
  1209. start_state_->drop_[0]->transition_[0] = RTT;
  1210. tmp = new FSMState;
  1211. for (i=0; i<17; i++) {
  1212. tmp->drop_[i] = NULL;
  1213. tmp->transition_[i] = -1;
  1214. }
  1215. tmp->batch_size_ = 2;
  1216. start_state_->drop_[0]->drop_[0]->drop_[2] = tmp;
  1217. start_state_->drop_[0]->drop_[0]->transition_[2] = RTT;
  1218. tmp = new FSMState;
  1219. for (i=0; i<17; i++) {
  1220. tmp->drop_[i] = NULL;
  1221. tmp->transition_[i] = -1;
  1222. }
  1223. tmp->batch_size_ = 3;
  1224. start_state_->drop_[0]->drop_[0]->drop_[3] = tmp;
  1225. start_state_->drop_[0]->drop_[0]->transition_[3] = RTT;
  1226. //(wnd, ssh) == (5, 20)
  1227. tmp = new FSMState;
  1228. for (i=0; i<17; i++) {
  1229. tmp->drop_[i] = NULL;
  1230. tmp->transition_[i] = -1;
  1231. }
  1232. tmp->batch_size_ = 5;
  1233. start_state_->drop_[0]->drop_[0]->drop_[0] = tmp;
  1234. start_state_->drop_[0]->drop_[0]->transition_[0] = RTT;
  1235. tmp = new FSMState;
  1236. for (i=0; i<17; i++) {
  1237. tmp->drop_[i] = NULL;
  1238. tmp->transition_[i] = -1;
  1239. }
  1240. tmp->batch_size_ = 2;
  1241. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[2] = tmp;
  1242. start_state_->drop_[0]->drop_[0]->drop_[0]->transition_[2] = RTT;
  1243. tmp = new FSMState;
  1244. for (i=0; i<17; i++) {
  1245. tmp->drop_[i] = NULL;
  1246. tmp->transition_[i] = -1;
  1247. }
  1248. tmp->batch_size_ = 3;
  1249. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[3] = tmp;
  1250. start_state_->drop_[0]->drop_[0]->drop_[0]->transition_[3] = RTT;
  1251. tmp = new FSMState;
  1252. for (i=0; i<17; i++) {
  1253. tmp->drop_[i] = NULL;
  1254. tmp->transition_[i] = -1;
  1255. }
  1256. tmp->batch_size_ = 5;
  1257. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[4] = tmp;
  1258. start_state_->drop_[0]->drop_[0]->drop_[0]->transition_[4] = RTT;
  1259. tmp = new FSMState;
  1260. for (i=0; i<17; i++) {
  1261. tmp->drop_[i] = NULL;
  1262. tmp->transition_[i] = -1;
  1263. }
  1264. tmp->batch_size_ = 6;
  1265. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[5] = tmp;
  1266. start_state_->drop_[0]->drop_[0]->drop_[0]->transition_[5] = RTT;
  1267. //(wnd, ssh) == (8, 20)
  1268. tmp = new FSMState;
  1269. for (i=0; i<17; i++) {
  1270. tmp->drop_[i] = NULL;
  1271. tmp->transition_[i] = -1;
  1272. }
  1273. tmp->batch_size_ = 8;
  1274. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0] = tmp;
  1275. start_state_->drop_[0]->drop_[0]->drop_[0]->transition_[0] = RTT;
  1276. tmp = new FSMState;
  1277. for (i=0; i<17; i++) {
  1278. tmp->drop_[i] = NULL;
  1279. tmp->transition_[i] = -1;
  1280. }
  1281. tmp->batch_size_ = 2;
  1282. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[2] = tmp;
  1283. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->transition_[2] = RTT;
  1284. tmp = new FSMState;
  1285. for (i=0; i<17; i++) {
  1286. tmp->drop_[i] = NULL;
  1287. tmp->transition_[i] = -1;
  1288. }
  1289. tmp->batch_size_ = 3;
  1290. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[3] = tmp;
  1291. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->transition_[3] = RTT;
  1292. tmp = new FSMState;
  1293. for (i=0; i<17; i++) {
  1294. tmp->drop_[i] = NULL;
  1295. tmp->transition_[i] = -1;
  1296. }
  1297. tmp->batch_size_ = 5;
  1298. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[4] = tmp;
  1299. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->transition_[4] = RTT;
  1300. tmp = new FSMState;
  1301. for (i=0; i<17; i++) {
  1302. tmp->drop_[i] = NULL;
  1303. tmp->transition_[i] = -1;
  1304. }
  1305. tmp->batch_size_ = 6;
  1306. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[5] = tmp;
  1307. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->transition_[5] = RTT;
  1308. tmp = new FSMState;
  1309. for (i=0; i<17; i++) {
  1310. tmp->drop_[i] = NULL;
  1311. tmp->transition_[i] = -1;
  1312. }
  1313. tmp->batch_size_ = 8;
  1314. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[6] = tmp;
  1315. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->transition_[6] = RTT;
  1316. tmp = new FSMState;
  1317. for (i=0; i<17; i++) {
  1318. tmp->drop_[i] = NULL;
  1319. tmp->transition_[i] = -1;
  1320. }
  1321. tmp->batch_size_ = 9;
  1322. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[7] = tmp;
  1323. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->transition_[7] = RTT;
  1324. tmp = new FSMState;
  1325. for (i=0; i<17; i++) {
  1326. tmp->drop_[i] = NULL;
  1327. tmp->transition_[i] = -1;
  1328. }
  1329. tmp->batch_size_ = 11;
  1330. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[8] = tmp;
  1331. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->transition_[8] = RTT;
  1332. //(wnd, ssh) == (12, 20)
  1333. tmp = new FSMState;
  1334. for (i=0; i<17; i++) {
  1335. tmp->drop_[i] = NULL;
  1336. tmp->transition_[i] = -1;
  1337. }
  1338. tmp->batch_size_ = 12;
  1339. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0] = tmp;
  1340. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->transition_[0] = RTT;
  1341. tmp = new FSMState;
  1342. for (i=0; i<17; i++) {
  1343. tmp->drop_[i] = NULL;
  1344. tmp->transition_[i] = -1;
  1345. }
  1346. tmp->batch_size_ = 1;
  1347. for (i=1; i<13; i++) start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[i] = tmp;
  1348. for (i=1; i<10; i++)
  1349. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->transition_[i] = RTT;
  1350. for (i=10; i<13; i++)
  1351. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->transition_[i] = TIMEOUT;
  1352. //(wnd, ssh) == (1, 2), timeout
  1353. tmp = new FSMState;
  1354. for (i=0; i<17; i++) {
  1355. tmp->drop_[i] = NULL;
  1356. tmp->transition_[i] = -1;
  1357. }
  1358. tmp->batch_size_ = 1;
  1359. start_state_->drop_[1] = tmp;
  1360. start_state_->transition_[1] = TIMEOUT;
  1361. start_state_->drop_[0]->drop_[1] = tmp;
  1362. start_state_->drop_[0]->transition_[1] = TIMEOUT;
  1363. start_state_->drop_[0]->drop_[2]->drop_[0] = tmp;
  1364. start_state_->drop_[0]->drop_[2]->transition_[0] = TIMEOUT;
  1365. start_state_->drop_[0]->drop_[0]->drop_[1] = tmp;
  1366. start_state_->drop_[0]->drop_[0]->transition_[1] = TIMEOUT;
  1367. start_state_->drop_[0]->drop_[0]->drop_[2]->drop_[0] = tmp;
  1368. start_state_->drop_[0]->drop_[0]->drop_[2]->transition_[0] = RTT;
  1369. start_state_->drop_[0]->drop_[0]->drop_[3]->drop_[0] = tmp;
  1370. start_state_->drop_[0]->drop_[0]->drop_[3]->transition_[0] = RTT;
  1371. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[1] = tmp;
  1372. start_state_->drop_[0]->drop_[0]->drop_[0]->transition_[1] = RTT;
  1373. //(wnd, ssh) == (2, 2)
  1374. tmp = new FSMState;
  1375. for (i=0; i<17; i++) {
  1376. tmp->drop_[i] = NULL;
  1377. tmp->transition_[i] = -1;
  1378. }
  1379. tmp->batch_size_ = 2;
  1380. start_state_->drop_[1]->drop_[0] = tmp;
  1381. start_state_->drop_[1]->transition_[0] = RTT;
  1382. //(wnd, ssh) == (2.5, 2)
  1383. tmp = new FSMState;
  1384. for (i=0; i<17; i++) {
  1385. tmp->drop_[i] = NULL;
  1386. tmp->transition_[i] = -1;
  1387. }
  1388. tmp->batch_size_ = 2;
  1389. start_state_->drop_[1]->drop_[0]->drop_[0] = tmp;
  1390. start_state_->drop_[1]->drop_[0]->transition_[0] = RTT;
  1391. //(wnd, ssh) == (2.9, 2)
  1392. tmp = new FSMState;
  1393. for (i=0; i<17; i++) {
  1394. tmp->drop_[i] = NULL;
  1395. tmp->transition_[i] = -1;
  1396. }
  1397. tmp->batch_size_ = 2;
  1398. start_state_->drop_[1]->drop_[0]->drop_[0]->drop_[0] = tmp;
  1399. start_state_->drop_[1]->drop_[0]->drop_[0]->transition_[0] = RTT;
  1400. //(wnd, ssh) == (3, 2)
  1401. tmp = new FSMState;
  1402. for (i=0; i<17; i++) {
  1403. tmp->drop_[i] = NULL;
  1404. tmp->transition_[i] = -1;
  1405. }
  1406. tmp->batch_size_ = 3;
  1407. start_state_->drop_[1]->drop_[0]->drop_[0]->drop_[0]->drop_[0] = tmp;
  1408. start_state_->drop_[1]->drop_[0]->drop_[0]->drop_[0]->transition_[0] = RTT;
  1409. //(wnd, ssh) == (3.3, 2)
  1410. tmp = new FSMState;
  1411. for (i=0; i<17; i++) {
  1412. tmp->drop_[i] = NULL;
  1413. tmp->transition_[i] = -1;
  1414. }
  1415. tmp->batch_size_ = 3;
  1416. start_state_->drop_[1]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0] = tmp;
  1417. start_state_->drop_[1]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->transition_[0] = RTT;
  1418. //(wnd, ssh) == (4, 2)
  1419. tmp = new FSMState;
  1420. for (i=0; i<17; i++) {
  1421. tmp->drop_[i] = NULL;
  1422. tmp->transition_[i] = -1;
  1423. }
  1424. tmp->batch_size_ = 4;
  1425. start_state_->drop_[1]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0] = tmp;
  1426. start_state_->drop_[1]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->transition_[0] = RTT;
  1427. //(wnd, ssh) == (4.7, 2)
  1428. tmp = new FSMState;
  1429. for (i=0; i<17; i++) {
  1430. tmp->drop_[i] = NULL;
  1431. tmp->transition_[i] = -1;
  1432. }
  1433. tmp->batch_size_ = 4;
  1434. start_state_->drop_[1]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0] = tmp;
  1435. start_state_->drop_[1]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->transition_[0] = RTT;
  1436. //(wnd, ssh) == (5, 2)
  1437. tmp = new FSMState;
  1438. for (i=0; i<17; i++) {
  1439. tmp->drop_[i] = NULL;
  1440. tmp->transition_[i] = -1;
  1441. }
  1442. tmp->batch_size_ = 5;
  1443. start_state_->drop_[1]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0] = tmp;
  1444. start_state_->drop_[1]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->transition_[0] = RTT;
  1445. //(wnd, ssh) == (6, 2)
  1446. tmp = new FSMState;
  1447. for (i=0; i<17; i++) {
  1448. tmp->drop_[i] = NULL;
  1449. tmp->transition_[i] = -1;
  1450. }
  1451. tmp->batch_size_ = 6;
  1452. start_state_->drop_[1]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0] = tmp;
  1453. start_state_->drop_[1]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->transition_[0] = RTT;
  1454. //(wnd, ssh) == (1, 3)
  1455. tmp = new FSMState;
  1456. for (i=0; i<17; i++) {
  1457. tmp->drop_[i] = NULL;
  1458. tmp->transition_[i] = -1;
  1459. }
  1460. tmp->batch_size_ = 1;
  1461. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[2]->drop_[0] = tmp;
  1462. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[2]->transition_[0] = RTT;
  1463. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[3]->drop_[0] = tmp;
  1464. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[3]->transition_[0] = RTT;
  1465. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[4]->drop_[0] = tmp;
  1466. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[4]->transition_[0] = RTT;
  1467. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[5]->drop_[0] = tmp;
  1468. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[5]->transition_[0] = RTT;
  1469. tmp = new FSMState;
  1470. for (i=0; i<17; i++) {
  1471. tmp->drop_[i] = NULL;
  1472. tmp->transition_[i] = -1;
  1473. }
  1474. tmp->batch_size_ = 2;
  1475. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[3]->drop_[0]->drop_[0] = tmp;
  1476. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[3]->drop_[0]->transition_[0] = RTT;
  1477. tmp = new FSMState;
  1478. for (i=0; i<17; i++) {
  1479. tmp->drop_[i] = NULL;
  1480. tmp->transition_[i] = -1;
  1481. }
  1482. tmp->batch_size_ = 3;
  1483. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[3]->drop_[0]->drop_[0]->drop_[0] = tmp;
  1484. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[3]->drop_[0]->drop_[0]->transition_[0] = RTT;
  1485. tmp = new FSMState;
  1486. for (i=0; i<17; i++) {
  1487. tmp->drop_[i] = NULL;
  1488. tmp->transition_[i] = -1;
  1489. }
  1490. tmp->batch_size_ = 3;
  1491. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[3]->drop_[0]->drop_[0]->drop_[0]->drop_[0] = tmp;
  1492. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[3]->drop_[0]->drop_[0]->drop_[0]->transition_[0] = RTT;
  1493. tmp = new FSMState;
  1494. for (i=0; i<17; i++) {
  1495. tmp->drop_[i] = NULL;
  1496. tmp->transition_[i] = -1;
  1497. }
  1498. tmp->batch_size_ = 4;
  1499. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[3]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0] = tmp;
  1500. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[3]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->transition_[0] = RTT;
  1501. tmp = new FSMState;
  1502. for (i=0; i<17; i++) {
  1503. tmp->drop_[i] = NULL;
  1504. tmp->transition_[i] = -1;
  1505. }
  1506. tmp->batch_size_ = 4;
  1507. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[3]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0] = tmp;
  1508. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[3]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->transition_[0] = RTT;
  1509. tmp = new FSMState;
  1510. for (i=0; i<17; i++) {
  1511. tmp->drop_[i] = NULL;
  1512. tmp->transition_[i] = -1;
  1513. }
  1514. tmp->batch_size_ = 5;
  1515. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[3]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0] = tmp;
  1516. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[3]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->transition_[0] = RTT;
  1517. //(wnd, ssh) == (1, 4)
  1518. tmp = new FSMState;
  1519. for (i=0; i<17; i++) {
  1520. tmp->drop_[i] = NULL;
  1521. tmp->transition_[i] = -1;
  1522. }
  1523. tmp->batch_size_ = 1;
  1524. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[1] = tmp;
  1525. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->transition_[1] = RTT;
  1526. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[2]->drop_[0] = tmp;
  1527. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[2]->transition_[0] = 0;
  1528. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[3]->drop_[0] = tmp;
  1529. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[3]->transition_[0] = 0;
  1530. tmp = new FSMState;
  1531. for (i=0; i<17; i++) {
  1532. tmp->drop_[i] = NULL;
  1533. tmp->transition_[i] = -1;
  1534. }
  1535. tmp->batch_size_ = 2;
  1536. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[1]->drop_[0] = tmp;
  1537. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[1]->transition_[0] = RTT;
  1538. tmp = new FSMState;
  1539. for (i=0; i<17; i++) {
  1540. tmp->drop_[i] = NULL;
  1541. tmp->transition_[i] = -1;
  1542. }
  1543. tmp->batch_size_ = 3;
  1544. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[1]->drop_[0]->drop_[0] = tmp;
  1545. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[1]->drop_[0]->transition_[0] = RTT;
  1546. tmp = new FSMState;
  1547. for (i=0; i<17; i++) {
  1548. tmp->drop_[i] = NULL;
  1549. tmp->transition_[i] = -1;
  1550. }
  1551. tmp->batch_size_ = 4;
  1552. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[1]->drop_[0]->drop_[0]->drop_[0] = tmp;
  1553. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[1]->drop_[0]->drop_[0]->transition_[0] = RTT;
  1554. tmp = new FSMState;
  1555. for (i=0; i<17; i++) {
  1556. tmp->drop_[i] = NULL;
  1557. tmp->transition_[i] = -1;
  1558. }
  1559. tmp->batch_size_ = 4;
  1560. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[1]->drop_[0]->drop_[0]->drop_[0]->drop_[0] = tmp;
  1561. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[1]->drop_[0]->drop_[0]->drop_[0]->transition_[0] = RTT;
  1562. //(wnd, ssh) == (1, 5)
  1563. tmp = new FSMState;
  1564. for (i=0; i<17; i++) {
  1565. tmp->drop_[i] = NULL;
  1566. tmp->transition_[i] = -1;
  1567. }
  1568. tmp->batch_size_ = 1;
  1569. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[4]->drop_[0] = tmp;
  1570. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[4]->transition_[0] = 0;
  1571. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[5]->drop_[0] = tmp;
  1572. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[5]->transition_[0] = 0;
  1573. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[6]->drop_[0] = tmp;
  1574. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[6]->transition_[0] = RTT;
  1575. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[7]->drop_[0] = tmp;
  1576. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[7]->transition_[0] = RTT;
  1577. tmp = new FSMState;
  1578. for (i=0; i<17; i++) {
  1579. tmp->drop_[i] = NULL;
  1580. tmp->transition_[i] = -1;
  1581. }
  1582. tmp->batch_size_ = 2;
  1583. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[4]->drop_[0]->drop_[0] = tmp;
  1584. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[4]->drop_[0]->transition_[0] = RTT;
  1585. tmp = new FSMState;
  1586. for (i=0; i<17; i++) {
  1587. tmp->drop_[i] = NULL;
  1588. tmp->transition_[i] = -1;
  1589. }
  1590. tmp->batch_size_ = 3;
  1591. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[4]->drop_[0]->drop_[0]->drop_[0] = tmp;
  1592. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[4]->drop_[0]->drop_[0]->transition_[0] = RTT;
  1593. tmp = new FSMState;
  1594. for (i=0; i<17; i++) {
  1595. tmp->drop_[i] = NULL;
  1596. tmp->transition_[i] = -1;
  1597. }
  1598. tmp->batch_size_ = 5;
  1599. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[4]->drop_[0]->drop_[0]->drop_[0]->drop_[0] = tmp;
  1600. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[4]->drop_[0]->drop_[0]->drop_[0]->transition_[0] = RTT;
  1601. //(wnd, ssh) == (1, 6)
  1602. tmp = new FSMState;
  1603. for (i=0; i<17; i++) {
  1604. tmp->drop_[i] = NULL;
  1605. tmp->transition_[i] = -1;
  1606. }
  1607. tmp->batch_size_ = 1;
  1608. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[8]->drop_[0] = tmp;
  1609. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[8]->transition_[0] = RTT;
  1610. tmp = new FSMState;
  1611. for (i=0; i<17; i++) {
  1612. tmp->drop_[i] = NULL;
  1613. tmp->transition_[i] = -1;
  1614. }
  1615. tmp->batch_size_ = 2;
  1616. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[8]->drop_[0]->drop_[0] = tmp;
  1617. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[8]->drop_[0]->transition_[0] = RTT;
  1618. //print_FSM(start_state_);
  1619. //printf("n");
  1620. }
  1621. // ****************************************************
  1622. // Reno-Delay Ack TCP Connection Finite State Machine *
  1623. // ****************************************************
  1624. RenoDelAckFSM::RenoDelAckFSM() : FSM(), start_state_(NULL) 
  1625. {
  1626. int i;
  1627. FSMState* tmp;
  1628. //printf("creating Reno DelAck FSMn");
  1629. instance_ = this;
  1630. // (wnd, ssh) == (1, 20)
  1631. start_state_ = new FSMState;
  1632. for (i=0; i<17; i++) {
  1633. start_state_->drop_[i] = NULL;
  1634. start_state_->transition_[i] = -1;
  1635. }
  1636. start_state_->batch_size_ = 1;
  1637. // (wnd, ssh) == (2, 20)
  1638. tmp = new FSMState;
  1639. for (i=0; i<17; i++) {
  1640. tmp->drop_[i] = NULL;
  1641. tmp->transition_[i] = -1;
  1642. }
  1643. tmp->batch_size_ = 2;
  1644. start_state_->drop_[0] = tmp;
  1645. start_state_->transition_[0] = RTT;
  1646. tmp = new FSMState;
  1647. for (i=0; i<17; i++) {
  1648. tmp->drop_[i] = NULL;
  1649. tmp->transition_[i] = -1;
  1650. }
  1651. tmp->batch_size_ = 2;
  1652. start_state_->drop_[0]->drop_[2] = tmp;
  1653. start_state_->drop_[0]->transition_[2] = RTT;
  1654. // (wnd, ssh) == (3, 20)
  1655. tmp = new FSMState;
  1656. for (i=0; i<17; i++) {
  1657. tmp->drop_[i] = NULL;
  1658. tmp->transition_[i] = -1;
  1659. }
  1660. tmp->batch_size_ = 3;
  1661. start_state_->drop_[0]->drop_[0] = tmp;
  1662. start_state_->drop_[0]->transition_[0] = RTT;
  1663. tmp = new FSMState;
  1664. for (i=0; i<17; i++) {
  1665. tmp->drop_[i] = NULL;
  1666. tmp->transition_[i] = -1;
  1667. }
  1668. tmp->batch_size_ = 2;
  1669. start_state_->drop_[0]->drop_[0]->drop_[2] = tmp;
  1670. start_state_->drop_[0]->drop_[0]->transition_[2] = RTT;
  1671. tmp = new FSMState;
  1672. for (i=0; i<17; i++) {
  1673. tmp->drop_[i] = NULL;
  1674. tmp->transition_[i] = -1;
  1675. }
  1676. tmp->batch_size_ = 3;
  1677. start_state_->drop_[0]->drop_[0]->drop_[3] = tmp;
  1678. start_state_->drop_[0]->drop_[0]->transition_[3] = RTT;
  1679. //(wnd, ssh) == (5, 20)
  1680. tmp = new FSMState;
  1681. for (i=0; i<17; i++) {
  1682. tmp->drop_[i] = NULL;
  1683. tmp->transition_[i] = -1;
  1684. }
  1685. tmp->batch_size_ = 5;
  1686. start_state_->drop_[0]->drop_[0]->drop_[0] = tmp;
  1687. start_state_->drop_[0]->drop_[0]->transition_[0] = RTT;
  1688. tmp = new FSMState;
  1689. for (i=0; i<17; i++) {
  1690. tmp->drop_[i] = NULL;
  1691. tmp->transition_[i] = -1;
  1692. }
  1693. tmp->batch_size_ = 2;
  1694. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[2] = tmp;
  1695. start_state_->drop_[0]->drop_[0]->drop_[0]->transition_[2] = RTT;
  1696. tmp = new FSMState;
  1697. for (i=0; i<17; i++) {
  1698. tmp->drop_[i] = NULL;
  1699. tmp->transition_[i] = -1;
  1700. }
  1701. tmp->batch_size_ = 3;
  1702. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[3] = tmp;
  1703. start_state_->drop_[0]->drop_[0]->drop_[0]->transition_[3] = RTT;
  1704. tmp = new FSMState;
  1705. for (i=0; i<17; i++) {
  1706. tmp->drop_[i] = NULL;
  1707. tmp->transition_[i] = -1;
  1708. }
  1709. tmp->batch_size_ = 5;
  1710. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[4] = tmp;
  1711. start_state_->drop_[0]->drop_[0]->drop_[0]->transition_[4] = RTT;
  1712. tmp = new FSMState;
  1713. for (i=0; i<17; i++) {
  1714. tmp->drop_[i] = NULL;
  1715. tmp->transition_[i] = -1;
  1716. }
  1717. tmp->batch_size_ = 6;
  1718. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[5] = tmp;
  1719. start_state_->drop_[0]->drop_[0]->drop_[0]->transition_[5] = RTT;
  1720. tmp = new FSMState;
  1721. for (i=0; i<17; i++) {
  1722. tmp->drop_[i] = NULL;
  1723. tmp->transition_[i] = -1;
  1724. }
  1725. tmp->batch_size_ = 2;
  1726. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[2]->drop_[0] = tmp;
  1727. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[2]->transition_[0] = RTT;
  1728. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[4]->drop_[0] = tmp;
  1729. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[4]->transition_[0] = RTT;
  1730. tmp = new FSMState;
  1731. for (i=0; i<17; i++) {
  1732. tmp->drop_[i] = NULL;
  1733. tmp->transition_[i] = -1;
  1734. }
  1735. tmp->batch_size_ = 3;
  1736. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[3]->drop_[0] = tmp;
  1737. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[3]->transition_[0] = RTT;
  1738. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[5]->drop_[0] = tmp;
  1739. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[5]->transition_[0] = RTT;
  1740. //(wnd, ssh) == (8, 20)
  1741. tmp = new FSMState;
  1742. for (i=0; i<17; i++) {
  1743. tmp->drop_[i] = NULL;
  1744. tmp->transition_[i] = -1;
  1745. }
  1746. tmp->batch_size_ = 8;
  1747. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0] = tmp;
  1748. start_state_->drop_[0]->drop_[0]->drop_[0]->transition_[0] = RTT;
  1749. tmp = new FSMState;
  1750. for (i=0; i<17; i++) {
  1751. tmp->drop_[i] = NULL;
  1752. tmp->transition_[i] = -1;
  1753. }
  1754. tmp->batch_size_ = 3;
  1755. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[2] = tmp;
  1756. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->transition_[2] = RTT;
  1757. tmp = new FSMState;
  1758. for (i=0; i<17; i++) {
  1759. tmp->drop_[i] = NULL;
  1760. tmp->transition_[i] = -1;
  1761. }
  1762. tmp->batch_size_ = 4;
  1763. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[3] = tmp;
  1764. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->transition_[3] = RTT;
  1765. tmp = new FSMState;
  1766. for (i=0; i<17; i++) {
  1767. tmp->drop_[i] = NULL;
  1768. tmp->transition_[i] = -1;
  1769. }
  1770. tmp->batch_size_ = 4;
  1771. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[2]->drop_[0] = tmp;
  1772. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[2]->transition_[0] = RTT;
  1773. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[3]->drop_[0] = tmp;
  1774. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[3]->transition_[0] = RTT;
  1775. tmp = new FSMState;
  1776. for (i=0; i<17; i++) {
  1777. tmp->drop_[i] = NULL;
  1778. tmp->transition_[i] = -1;
  1779. }
  1780. tmp->batch_size_ = 1;
  1781. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[4] = tmp;
  1782. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->transition_[4] = RTT;
  1783. tmp = new FSMState;
  1784. for (i=0; i<17; i++) {
  1785. tmp->drop_[i] = NULL;
  1786. tmp->transition_[i] = -1;
  1787. }
  1788. tmp->batch_size_ = 2;
  1789. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[5] = tmp;
  1790. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->transition_[5] = RTT;
  1791. tmp = new FSMState;
  1792. for (i=0; i<17; i++) {
  1793. tmp->drop_[i] = NULL;
  1794. tmp->transition_[i] = -1;
  1795. }
  1796. tmp->batch_size_ = 8;
  1797. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[6] = tmp;
  1798. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->transition_[6] = RTT;
  1799. tmp = new FSMState;
  1800. for (i=0; i<17; i++) {
  1801. tmp->drop_[i] = NULL;
  1802. tmp->transition_[i] = -1;
  1803. }
  1804. tmp->batch_size_ = 9;
  1805. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[7] = tmp;
  1806. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->transition_[7] = RTT;
  1807. tmp = new FSMState;
  1808. for (i=0; i<17; i++) {
  1809. tmp->drop_[i] = NULL;
  1810. tmp->transition_[i] = -1;
  1811. }
  1812. tmp->batch_size_ = 11;
  1813. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[8] = tmp;
  1814. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->transition_[8] = RTT;
  1815. //(wnd, ssh) == (12, 20)
  1816. tmp = new FSMState;
  1817. for (i=0; i<17; i++) {
  1818. tmp->drop_[i] = NULL;
  1819. tmp->transition_[i] = -1;
  1820. }
  1821. tmp->batch_size_ = 12;
  1822. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0] = tmp;
  1823. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->transition_[0] = RTT;
  1824. tmp = new FSMState;
  1825. for (i=0; i<17; i++) {
  1826. tmp->drop_[i] = NULL;
  1827. tmp->transition_[i] = -1;
  1828. }
  1829. tmp->batch_size_ = 1;
  1830. for (i=1; i<13; i++) start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[i] = tmp;
  1831. for (i=1; i<10; i++)
  1832. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->transition_[i] = RTT;
  1833. for (i=10; i<13; i++)
  1834. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->transition_[i] = TIMEOUT;
  1835. //(wnd, ssh) == (1, 2), timeout
  1836. tmp = new FSMState;
  1837. for (i=0; i<17; i++) {
  1838. tmp->drop_[i] = NULL;
  1839. tmp->transition_[i] = -1;
  1840. }
  1841. tmp->batch_size_ = 1;
  1842. start_state_->drop_[1] = tmp;
  1843. start_state_->transition_[1] = TIMEOUT;
  1844. start_state_->drop_[0]->drop_[1] = tmp;
  1845. start_state_->drop_[0]->transition_[1] = TIMEOUT;
  1846. start_state_->drop_[0]->drop_[2]->drop_[0] = tmp;
  1847. start_state_->drop_[0]->drop_[2]->transition_[0] = TIMEOUT;
  1848. start_state_->drop_[0]->drop_[0]->drop_[1] = tmp;
  1849. start_state_->drop_[0]->drop_[0]->transition_[1] = TIMEOUT;
  1850. start_state_->drop_[0]->drop_[0]->drop_[2]->drop_[0] = tmp;
  1851. start_state_->drop_[0]->drop_[0]->drop_[2]->transition_[0] = TIMEOUT;
  1852. //(wnd, ssh) == (2, 2)
  1853. tmp = new FSMState;
  1854. for (i=0; i<17; i++) {
  1855. tmp->drop_[i] = NULL;
  1856. tmp->transition_[i] = -1;
  1857. }
  1858. tmp->batch_size_ = 2;
  1859. start_state_->drop_[1]->drop_[0] = tmp;
  1860. start_state_->drop_[1]->transition_[0] = RTT;
  1861. //(wnd, ssh) == (2.5, 2)
  1862. tmp = new FSMState;
  1863. for (i=0; i<17; i++) {
  1864. tmp->drop_[i] = NULL;
  1865. tmp->transition_[i] = -1;
  1866. }
  1867. tmp->batch_size_ = 2;
  1868. start_state_->drop_[1]->drop_[0]->drop_[0] = tmp;
  1869. start_state_->drop_[1]->drop_[0]->transition_[0] = RTT;
  1870. //(wnd, ssh) == (2.9, 2)
  1871. tmp = new FSMState;
  1872. for (i=0; i<17; i++) {
  1873. tmp->drop_[i] = NULL;
  1874. tmp->transition_[i] = -1;
  1875. }
  1876. tmp->batch_size_ = 2;
  1877. start_state_->drop_[1]->drop_[0]->drop_[0]->drop_[0] = tmp;
  1878. start_state_->drop_[1]->drop_[0]->drop_[0]->transition_[0] = RTT;
  1879. //(wnd, ssh) == (3, 2)
  1880. tmp = new FSMState;
  1881. for (i=0; i<17; i++) {
  1882. tmp->drop_[i] = NULL;
  1883. tmp->transition_[i] = -1;
  1884. }
  1885. tmp->batch_size_ = 3;
  1886. start_state_->drop_[1]->drop_[0]->drop_[0]->drop_[0]->drop_[0] = tmp;
  1887. start_state_->drop_[1]->drop_[0]->drop_[0]->drop_[0]->transition_[0] = RTT;
  1888. //(wnd, ssh) == (3.3, 2)
  1889. tmp = new FSMState;
  1890. for (i=0; i<17; i++) {
  1891. tmp->drop_[i] = NULL;
  1892. tmp->transition_[i] = -1;
  1893. }
  1894. tmp->batch_size_ = 3;
  1895. start_state_->drop_[1]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0] = tmp;
  1896. start_state_->drop_[1]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->transition_[0] = RTT;
  1897. //(wnd, ssh) == (4, 2)
  1898. tmp = new FSMState;
  1899. for (i=0; i<17; i++) {
  1900. tmp->drop_[i] = NULL;
  1901. tmp->transition_[i] = -1;
  1902. }
  1903. tmp->batch_size_ = 4;
  1904. start_state_->drop_[1]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0] = tmp;
  1905. start_state_->drop_[1]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->transition_[0] = RTT;
  1906. //(wnd, ssh) == (4.7, 2)
  1907. tmp = new FSMState;
  1908. for (i=0; i<17; i++) {
  1909. tmp->drop_[i] = NULL;
  1910. tmp->transition_[i] = -1;
  1911. }
  1912. tmp->batch_size_ = 4;
  1913. start_state_->drop_[1]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0] = tmp;
  1914. start_state_->drop_[1]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->transition_[0] = RTT;
  1915. //(wnd, ssh) == (5, 2)
  1916. tmp = new FSMState;
  1917. for (i=0; i<17; i++) {
  1918. tmp->drop_[i] = NULL;
  1919. tmp->transition_[i] = -1;
  1920. }
  1921. tmp->batch_size_ = 5;
  1922. start_state_->drop_[1]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0] = tmp;
  1923. start_state_->drop_[1]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->transition_[0] = RTT;
  1924. //(wnd, ssh) == (6, 2)
  1925. tmp = new FSMState;
  1926. for (i=0; i<17; i++) {
  1927. tmp->drop_[i] = NULL;
  1928. tmp->transition_[i] = -1;
  1929. }
  1930. tmp->batch_size_ = 6;
  1931. start_state_->drop_[1]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0] = tmp;
  1932. start_state_->drop_[1]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->transition_[0] = RTT;
  1933. //(wnd, ssh) == (2, 2), rtt
  1934. tmp = new FSMState;
  1935. for (i=0; i<17; i++) {
  1936. tmp->drop_[i] = NULL;
  1937. tmp->transition_[i] = -1;
  1938. }
  1939. tmp->batch_size_ = 2;
  1940. start_state_->drop_[0]->drop_[0]->drop_[3]->drop_[0] = tmp;
  1941. start_state_->drop_[0]->drop_[0]->drop_[3]->transition_[0] = RTT;
  1942. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[1] = tmp;
  1943. start_state_->drop_[0]->drop_[0]->drop_[0]->transition_[1] = RTT;
  1944. //(wnd, ssh) == (2.5, 2)
  1945. tmp = new FSMState;
  1946. for (i=0; i<17; i++) {
  1947. tmp->drop_[i] = NULL;
  1948. tmp->transition_[i] = -1;
  1949. }
  1950. tmp->batch_size_ = 2;
  1951. start_state_->drop_[0]->drop_[0]->drop_[3]->drop_[0]->drop_[0] = tmp;
  1952. start_state_->drop_[0]->drop_[0]->drop_[3]->drop_[0]->transition_[0] = RTT;
  1953. //(wnd, ssh) == (3, 2)
  1954. tmp = new FSMState;
  1955. for (i=0; i<17; i++) {
  1956. tmp->drop_[i] = NULL;
  1957. tmp->transition_[i] = -1;
  1958. }
  1959. tmp->batch_size_ = 3;
  1960. start_state_->drop_[0]->drop_[0]->drop_[3]->drop_[0]->drop_[0]->drop_[0] = tmp;
  1961. start_state_->drop_[0]->drop_[0]->drop_[3]->drop_[0]->drop_[0]->transition_[0] = RTT;
  1962. //(wnd, ssh) == (4, 2)
  1963. tmp = new FSMState;
  1964. for (i=0; i<17; i++) {
  1965. tmp->drop_[i] = NULL;
  1966. tmp->transition_[i] = -1;
  1967. }
  1968. tmp->batch_size_ = 4;
  1969. start_state_->drop_[0]->drop_[0]->drop_[3]->drop_[0]->drop_[0]->drop_[0]->drop_[0] = tmp;
  1970. start_state_->drop_[0]->drop_[0]->drop_[3]->drop_[0]->drop_[0]->drop_[0]->transition_[0] = RTT;
  1971. //(wnd, ssh) == (4.3, 2)
  1972. tmp = new FSMState;
  1973. for (i=0; i<17; i++) {
  1974. tmp->drop_[i] = NULL;
  1975. tmp->transition_[i] = -1;
  1976. }
  1977. tmp->batch_size_ = 4;
  1978. start_state_->drop_[0]->drop_[0]->drop_[3]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0] = tmp;
  1979. start_state_->drop_[0]->drop_[0]->drop_[3]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->transition_[0] = RTT;
  1980. //(wnd, ssh) == (4.7, 2)
  1981. tmp = new FSMState;
  1982. for (i=0; i<17; i++) {
  1983. tmp->drop_[i] = NULL;
  1984. tmp->transition_[i] = -1;
  1985. }
  1986. tmp->batch_size_ = 4;
  1987. start_state_->drop_[0]->drop_[0]->drop_[3]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0] = tmp;
  1988. start_state_->drop_[0]->drop_[0]->drop_[3]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->transition_[0] = RTT;
  1989. //(wnd, ssh) == (5, 2)
  1990. tmp = new FSMState;
  1991. for (i=0; i<17; i++) {
  1992. tmp->drop_[i] = NULL;
  1993. tmp->transition_[i] = -1;
  1994. }
  1995. tmp->batch_size_ = 5;
  1996. start_state_->drop_[0]->drop_[0]->drop_[3]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0] = tmp;
  1997. start_state_->drop_[0]->drop_[0]->drop_[3]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->transition_[0] = RTT;
  1998. //(wnd, ssh) == (3.3, 3)
  1999. tmp = new FSMState;
  2000. for (i=0; i<17; i++) {
  2001. tmp->drop_[i] = NULL;
  2002. tmp->transition_[i] = -1;
  2003. }
  2004. tmp->batch_size_ = 3;
  2005. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[2]->drop_[0]->drop_[0] = tmp;
  2006. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[2]->drop_[0]->transition_[0] = RTT;
  2007. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[3]->drop_[0]->drop_[0] = tmp;
  2008. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[3]->drop_[0]->transition_[0] = RTT;
  2009. tmp = new FSMState;
  2010. for (i=0; i<17; i++) {
  2011. tmp->drop_[i] = NULL;
  2012. tmp->transition_[i] = -1;
  2013. }
  2014. tmp->batch_size_ = 4;
  2015. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[2]->drop_[0]->drop_[0]->drop_[0] = tmp;
  2016. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[2]->drop_[0]->drop_[0]->transition_[0] = RTT;
  2017. tmp = new FSMState;
  2018. for (i=0; i<17; i++) {
  2019. tmp->drop_[i] = NULL;
  2020. tmp->transition_[i] = -1;
  2021. }
  2022. tmp->batch_size_ = 4;
  2023. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[2]->drop_[0]->drop_[0]->drop_[0]->drop_[0] = tmp;
  2024. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[2]->drop_[0]->drop_[0]->drop_[0]->transition_[0] = RTT;
  2025. tmp = new FSMState;
  2026. for (i=0; i<17; i++) {
  2027. tmp->drop_[i] = NULL;
  2028. tmp->transition_[i] = -1;
  2029. }
  2030. tmp->batch_size_ = 5;
  2031. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[2]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0] = tmp;
  2032. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[2]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->transition_[0] = RTT;
  2033. tmp = new FSMState;
  2034. for (i=0; i<17; i++) {
  2035. tmp->drop_[i] = NULL;
  2036. tmp->transition_[i] = -1;
  2037. }
  2038. tmp->batch_size_ = 5;
  2039. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[2]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0] = tmp;
  2040. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[2]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[0]->transition_[0] = RTT;
  2041. //(wnd, ssh) == (4, 4)
  2042. tmp = new FSMState;
  2043. for (i=0; i<17; i++) {
  2044. tmp->drop_[i] = NULL;
  2045. tmp->transition_[i] = -1;
  2046. }
  2047. tmp->batch_size_ = 4;
  2048. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[1] = tmp;
  2049. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->transition_[1] = RTT;
  2050. tmp = new FSMState;
  2051. for (i=0; i<17; i++) {
  2052. tmp->drop_[i] = NULL;
  2053. tmp->transition_[i] = -1;
  2054. }
  2055. tmp->batch_size_ = 4;
  2056. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[1]->drop_[0] = tmp;
  2057. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[1]->transition_[0] = RTT;
  2058. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[2]->drop_[0]->drop_[0] = tmp;
  2059. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[2]->drop_[0]->transition_[0] = RTT;
  2060. tmp = new FSMState;
  2061. for (i=0; i<17; i++) {
  2062. tmp->drop_[i] = NULL;
  2063. tmp->transition_[i] = -1;
  2064. }
  2065. tmp->batch_size_ = 5;
  2066. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[1]->drop_[0]->drop_[0] = tmp;
  2067. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[1]->drop_[0]->transition_[0] = RTT;
  2068. //(wnd, ssh) == (5, 5)
  2069. tmp = new FSMState;
  2070. for (i=0; i<17; i++) {
  2071. tmp->drop_[i] = NULL;
  2072. tmp->transition_[i] = -1;
  2073. }
  2074. tmp->batch_size_ = 5;
  2075. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[4]->drop_[0] = tmp;
  2076. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[4]->transition_[0] = 0;
  2077. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[5]->drop_[0] = tmp;
  2078. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[5]->transition_[0] = 0;
  2079. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[6]->drop_[0] = tmp;
  2080. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[6]->transition_[0] = RTT;
  2081. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[7]->drop_[0] = tmp;
  2082. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[7]->transition_[0] = RTT;
  2083. tmp = new FSMState;
  2084. for (i=0; i<17; i++) {
  2085. tmp->drop_[i] = NULL;
  2086. tmp->transition_[i] = -1;
  2087. }
  2088. tmp->batch_size_ = 5;
  2089. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[4]->drop_[0]->drop_[0] = tmp;
  2090. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[4]->drop_[0]->transition_[0] = RTT;
  2091. tmp = new FSMState;
  2092. for (i=0; i<17; i++) {
  2093. tmp->drop_[i] = NULL;
  2094. tmp->transition_[i] = -1;
  2095. }
  2096. tmp->batch_size_ = 5;
  2097. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[4]->drop_[0]->drop_[0]->drop_[0] = tmp;
  2098. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[4]->drop_[0]->drop_[0]->transition_[0] = RTT;
  2099. //(wnd, ssh) == (6, 6)
  2100. tmp = new FSMState;
  2101. for (i=0; i<17; i++) {
  2102. tmp->drop_[i] = NULL;
  2103. tmp->transition_[i] = -1;
  2104. }
  2105. tmp->batch_size_ = 6;
  2106. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[8]->drop_[0] = tmp;
  2107. start_state_->drop_[0]->drop_[0]->drop_[0]->drop_[0]->drop_[8]->transition_[0] = RTT;
  2108. //print_FSM(start_state_);
  2109. //printf("n");
  2110. }