#include <empweb.h>
Inheritance diagram for EmpWebTrafSession:


|
|
Definition at line 66 of file timer-handler.h.
00066 { TIMER_IDLE, TIMER_PENDING, TIMER_HANDLING };
|
|
||||||||||||||||||||||||||||||||
|
Definition at line 53 of file empweb.h. References clientIdx_, curPage_, donePage_, fulltcp_, id_, interPageOption_, mgr_, nPage_, rvClientWin_, rvInterObj_, rvInterPage_, rvMtu_, rvObjSize_, rvPageSize_, rvPersistSel_, rvReqSize_, rvServerSel_, rvServerWin_, and src_.
00053 : 00054 rvInterPage_(NULL), rvPageSize_(NULL), 00055 rvInterObj_(NULL), rvObjSize_(NULL), 00056 rvReqSize_(NULL), rvPersistSel_(NULL), rvServerSel_(NULL), 00057 rvServerWin_(NULL), rvClientWin_(NULL), 00058 rvMtu_(NULL), 00059 mgr_(mgr), src_(src), nPage_(np), curPage_(0), donePage_(0), 00060 id_(id), clientIdx_(cl), fulltcp_(0), interPageOption_(1) { 00061 fulltcp_ = ftcp_; 00062 } |
|
|
Definition at line 118 of file empweb.cc. References abort(), curPage_, donePage_, TimerHandler::status_, and TimerHandler::TIMER_IDLE.
00119 {
00120 if (donePage_ != curPage_) {
00121 fprintf(stderr, "done pages %d != all pages %d\n",
00122 donePage_, curPage_);
00123 abort();
00124 }
00125 if (status_ != TIMER_IDLE) {
00126 fprintf(stderr, "EmpWebTrafSession must be idle when deleted.\n");
00127 abort();
00128 }
00129 /*
00130 if (rvInterPage_ != NULL)
00131 Tcl::instance().evalf("delete %s", rvInterPage_->name());
00132 if (rvPageSize_ != NULL)
00133 Tcl::instance().evalf("delete %s", rvPageSize_->name());
00134 if (rvInterObj_ != NULL)
00135 Tcl::instance().evalf("delete %s", rvInterObj_->name());
00136 if (rvObjSize_ != NULL)
00137 Tcl::instance().evalf("delete %s", rvObjSize_->name());
00138 if (rvReqSize_ != NULL)
00139 Tcl::instance().evalf("delete %s", rvReqSize_->name());
00140 if (rvPersistSel_ != NULL)
00141 Tcl::instance().evalf("delete %s", rvPersistSel_->name());
00142 if (rvServerSel_ != NULL)
00143 Tcl::instance().evalf("delete %s", rvServerSel_->name());
00144
00145 */
00146
00147 }
|
Here is the call graph for this function:

|
Here is the call graph for this function:

|
|
Definition at line 76 of file empweb.h. References rvClientWin_. Referenced by EmpWebTrafPool::command(), expire(), and launchReq().
00076 { return rvClientWin_; }
|
|
|
Definition at line 149 of file empweb.cc. References abort(), csnk_, ctcp_, EmpWebPage::curObj(), EmpWebPage::doneObj(), donePage_, EmpWebTrafPool::doneSession(), EmpWebPage::dst(), fulltcp_, EmpWebPage::id(), id_, interPageOption_, EmpWebTrafPool::isdebug(), mgr_, nPage_, EmpWebPage::persistOption_, EmpWebTrafPool::recycleSink(), EmpWebTrafPool::recycleTcp(), rvInterPage_, TimerHandler::sched(), src_, ssnk_, stcp_, and EmpiricalRandomVariable::value(). Referenced by EmpWebPage::doneObject().
00150 {
00151 EmpWebPage* pg = (EmpWebPage*)ClntData;
00152 if (mgr_->isdebug())
00153 printf("Session %d done page %d\n", id_, pg->id());
00154
00155 if (pg->doneObj() != pg->curObj()) {
00156 fprintf(stderr, "done objects %d != all objects %d\n",
00157 pg->doneObj(), pg->curObj());
00158 abort();
00159 }
00160
00161
00162 //for HTTP1.1 persistent-connection
00163 if (pg->persistOption_) {
00164 if (!fulltcp_) {
00165 //recycle TCP connection
00166 mgr_->recycleTcp(ctcp_);
00167 mgr_->recycleTcp(stcp_);
00168 mgr_->recycleSink(csnk_);
00169 mgr_->recycleSink(ssnk_);
00170 } else {
00171 Tcl::instance().evalf("%s disconnect-full %s %s %s %s",
00172 mgr_->name(),
00173 src_->name(), pg->dst()->name(),
00174 ctcp_->name(), stcp_->name());
00175 }
00176 }
00177
00178 delete pg;
00179
00180 // If all pages are done, tell my parent to delete myself
00181 if (++donePage_ >= nPage_) {
00182 mgr_->doneSession(id_);
00183 } else if (interPageOption_) {
00184 sched(rvInterPage_->value());
00185 // printf("donePage: %g %d %d\n", Scheduler::instance().clock(), donePage_, curPage_);
00186 }
00187 }
|
Here is the call graph for this function:

|
|
Implements TimerHandler. Definition at line 190 of file empweb.cc. References clientIdx_, clientWin(), csnk_, ctcp_, curPage_, EmpWebPage::dst(), fulltcp_, id_, EmpWebTrafPool::isdebug(), EmpWebTrafPool::LASTFLOW_, LASTPAGE_, mgr(), mgr_, mtu(), EmpWebTrafPool::nClientL_, EmpWebPage::persistOption_, EmpWebTrafPool::picksink(), EmpWebTrafPool::picktcp(), rvPageSize_, EmpWebTrafPool::server_, serverSel(), serverWin(), EmpWebPage::set_persistOption(), src_, ssnk_, EmpWebPage::start(), stcp_, and EmpiricalRandomVariable::value().
00191 {
00192 // Pick destination for this page
00193 //temporary hack for isi traffic
00194 int n;
00195 if (clientIdx_ < mgr()->nClientL_) n = 0 ; //ISI server
00196 else
00197 n = int(ceil(serverSel()->value()));
00198
00199 assert((n >= 0) && (n < mgr()->nSrc_));
00200 Node* dst = mgr()->server_[n];
00201
00202
00203 // Make sure page size is not 0!
00204 EmpWebPage* pg = new EmpWebPage(LASTPAGE_++, this,
00205 (int)ceil(rvPageSize_->value()), dst, n);
00206
00207 //each page either use persistent or non-persistent connection
00208 int opt = (int)ceil(this->persistSel()->value());
00209 pg->set_persistOption(opt);
00210
00211 if (mgr_->isdebug())
00212 printf("Session %d starting page %d, curpage %d \n",
00213 id_, LASTPAGE_-1, curPage_);
00214
00215 if (pg->persistOption_) { //for HTTP1.1 persistent-connection
00216
00217 mgr_->LASTFLOW_++;
00218
00219 int wins = int(ceil(serverWin()->value()));
00220 int winc = int(ceil(clientWin()->value()));
00221 int window = (wins >= winc) ? wins : winc;
00222
00223 int m = int(ceil(mtu()->value()));
00224
00225 // Choose source and dest TCP agents for both source and destination
00226 if (fulltcp_) {
00227 ctcp_ = mgr_->picktcp(window,m);
00228 stcp_ = mgr_->picktcp(window,m);
00229
00230 Tcl::instance().evalf("%s connect-full %s %s %s %s",
00231 mgr_->name(),
00232 src_->name(), pg->dst()->name(),
00233 ctcp_->name(), stcp_->name());
00234
00235 } else {
00236 ctcp_ = mgr_->picktcp(window,m);
00237 stcp_ = mgr_->picktcp(window,m);
00238 csnk_ = mgr_->picksink();
00239 ssnk_ = mgr_->picksink();
00240 }
00241
00242 Tcl::instance().evalf("%s set-fid %d %s %s", mgr_->name(), mgr_->LASTFLOW_-1, ctcp_->name(), stcp_->name());
00243
00244 }
00245
00246 pg->start();
00247 }
|
Here is the call graph for this function:

|
|
Definition at line 60 of file timer-handler.h. References TimerHandler::_cancel(), TimerHandler::status_, TimerHandler::TIMER_IDLE, and TimerHandler::TIMER_PENDING. Referenced by TcpAgent::cancel_rtx_timer(), TcpSessionAgent::cancel_rtx_timer(), TcpFsAgent::cancel_rtx_timer(), AbsTcpAgent::cancel_timer(), TcpAgent::cancel_timers(), TcpSessionAgent::cancel_timers(), FullTcpAgent::cancel_timers(), TcpFsAgent::cancel_timers(), SinkAgent::command(), UnslottedAlohaMac::end_of_contention(), GAFAgent::processDiscoveryMsg(), RTPAgent::rate_change(), TfrcAgent::stop(), RTPAgent::stop(), and SinkAgent::stop().
00060 { // cancel!
00061 if (status_ == TIMER_PENDING) {
00062 _cancel();
00063 status_ = TIMER_IDLE;
00064 }
00065 }
|
Here is the call graph for this function:

|
|
Reimplemented from TimerHandler. Definition at line 249 of file empweb.cc. References curPage_, TimerHandler::handle(), interPageOption_, nPage_, rvInterPage_, TimerHandler::sched(), and EmpiricalRandomVariable::value().
00250 {
00251 // If I haven't scheduled all my pages, do the next one
00252 TimerHandler::handle(e);
00253 ++curPage_;
00254 // XXX Notice before each page is done, it will schedule itself
00255 // one more time, this makes sure that this session will not be
00256 // deleted after the above call. Thus the following code will not
00257 // be executed in the context of a deleted object.
00258 if (!interPageOption_) {
00259 if (curPage_ < nPage_) {
00260 sched(rvInterPage_->value());
00261 // printf("schedule: %g %d %d\n", Scheduler::instance().clock(), donePage_, curPage_);
00262 }
00263 }
00264 }
|
Here is the call graph for this function:

|
|
Definition at line 82 of file empweb.h. References id_. Referenced by EmpWebPage::expire(), and EmpWebPage::handle().
00082 { return id_; }
|
|
|
Definition at line 68 of file empweb.h. References rvInterObj_. Referenced by EmpWebTrafPool::command(), EmpWebPage::doneObject(), and EmpWebPage::handle().
00068 { return rvInterObj_; }
|
|
|
Definition at line 66 of file empweb.h. References rvInterPage_. Referenced by EmpWebTrafPool::command().
00066 { return rvInterPage_; }
|
|
||||||||||||||||||||||||||||
|
Definition at line 267 of file empweb.cc. References Node::address(), clientWin(), Scheduler::clock(), csnk_, ctcp_, EmpWebPage::dst(), fulltcp_, EmpWebPage::id(), id_, Scheduler::instance(), EmpWebTrafPool::isdebug(), EmpWebTrafPool::LASTFLOW_, mgr_, mtu(), EmpWebTrafPool::picksink(), EmpWebTrafPool::picktcp(), serverWin(), src_, ssnk_, and stcp_. Referenced by EmpWebPage::expire().
00268 {
00269
00270 TcpAgent* ctcp;
00271 TcpAgent* stcp;
00272 TcpSink* csnk;
00273 TcpSink* ssnk;
00274
00275 EmpWebPage* pg = (EmpWebPage*)ClntData;
00276
00277 if (persist) { //for HTTP1.1 persistent-connection
00278 if (mgr_->isdebug()) {
00279 printf("HTTP1.1\n");
00280 }
00281
00282 // use theh same connection
00283 if (fulltcp_) {
00284 ctcp = ctcp_;
00285 stcp = stcp_;
00286 } else {
00287 ctcp = ctcp_;
00288 stcp = stcp_;
00289 csnk = csnk_;
00290 ssnk = ssnk_;
00291 }
00292
00293
00294 } else { //for HTTP1.0 non-consistent connection
00295 if (mgr_->isdebug()) {
00296 printf("HTTP1.0\n");
00297 }
00298
00299 mgr_->LASTFLOW_++;
00300
00301 int wins = int(ceil(serverWin()->value()));
00302 int winc = int(ceil(clientWin()->value()));
00303 int window = (wins >= winc) ? wins : winc;
00304
00305 int m = int(ceil(mtu()->value()));
00306
00307 // Choose source and dest TCP agents for both source and destination
00308
00309 if (fulltcp_) {
00310 ctcp = mgr_->picktcp(window,m);
00311 stcp = mgr_->picktcp(window,m);
00312 } else {
00313 ctcp = mgr_->picktcp(window,m);
00314 stcp = mgr_->picktcp(window,m);
00315 csnk = mgr_->picksink();
00316 ssnk = mgr_->picksink();
00317 }
00318
00319 Tcl::instance().evalf("%s set-fid %d %s %s", mgr_->name(), mgr_->LASTFLOW_-1, ctcp->name(), stcp->name());
00320
00321 }
00322
00323 // Setup new TCP connection and launch request
00324 // size and reqSize are in the unit of bytes in fulltcp mode
00325 // but in the unit of packet in halftcp mode
00326 if (fulltcp_) {
00327
00328 Tcl::instance().evalf("%s launch-req-full %d %d %s %s %s %s %d %d %d %d", mgr_->name(), obj, pg->id(),
00329 src_->name(), pg->dst()->name(),
00330 ctcp->name(),
00331 stcp->name(),
00332 size, reqSize, ClntData,persist);
00333
00334 } else {
00335
00336 Tcl::instance().evalf("%s launch-req %d %d %s %s %s %s %s %s %d %d %d %d", mgr_->name(), obj, pg->id(),
00337 src_->name(), pg->dst()->name(),
00338 ctcp->name(), csnk->name(),
00339 stcp->name(), ssnk->name(),
00340 size, reqSize, ClntData,
00341 persist);
00342 }
00343
00344
00345
00346 if (mgr_->isdebug()) {
00347 printf("size=%d obj=%d page=%d sess=%d %g src=%d dst=%d\n", size, obj, pg->id(), id_, Scheduler::instance().clock(), src_->address(), pg->dst()->address());
00348 }
00349 }
|
Here is the call graph for this function:

|
|
Definition at line 83 of file empweb.h. References mgr_. Referenced by EmpWebPage::doneObject(), expire(), EmpWebPage::expire(), and EmpWebPage::handle().
00083 { return mgr_; }
|
|
|
Definition at line 78 of file empweb.h. References rvMtu_. Referenced by EmpWebTrafPool::command(), expire(), and launchReq().
00078 { return rvMtu_; }
|
|
|
Definition at line 69 of file empweb.h. References rvObjSize_. Referenced by EmpWebTrafPool::command(), and EmpWebPage::expire().
00069 { return rvObjSize_; }
|
|
|
Definition at line 67 of file empweb.h. References rvPageSize_. Referenced by EmpWebTrafPool::command().
00067 { return rvPageSize_; }
|
|
|
Definition at line 72 of file empweb.h. References rvPersistSel_. Referenced by EmpWebTrafPool::command().
00072 { return rvPersistSel_; }
|
|
|
Definition at line 71 of file empweb.h. References rvReqSize_. Referenced by EmpWebTrafPool::command(), and EmpWebPage::expire().
00071 { return rvReqSize_; }
|
|
Here is the call graph for this function:

|
Here is the call graph for this function:

|
|
Definition at line 73 of file empweb.h. References rvServerSel_. Referenced by EmpWebTrafPool::command(), and expire().
00073 { return rvServerSel_; }
|
|
|
Definition at line 75 of file empweb.h. References rvServerWin_. Referenced by EmpWebTrafPool::command(), expire(), and launchReq().
00075 { return rvServerWin_; }
|
|
|
Definition at line 85 of file empweb.h. References interPageOption_. Referenced by EmpWebTrafPool::command().
00085 { interPageOption_ = option; }
|
|
|
|
Definition at line 103 of file empweb.h. Referenced by EmpWebTrafSession(), and expire(). |
|
|
Definition at line 111 of file empweb.h. Referenced by donePage(), expire(), and launchReq(). |
|
|
Definition at line 109 of file empweb.h. Referenced by donePage(), expire(), and launchReq(). |
|
|
Definition at line 99 of file empweb.h. Referenced by EmpWebTrafSession(), expire(), handle(), and ~EmpWebTrafSession(). |
|
|
Definition at line 99 of file empweb.h. Referenced by donePage(), EmpWebTrafSession(), and ~EmpWebTrafSession(). |
|
|
Definition at line 75 of file timer-handler.h. Referenced by TimerHandler::_cancel(), TimerHandler::_sched(), WebPage::start(), and EmpWebPage::start(). |
|
|
Definition at line 105 of file empweb.h. Referenced by donePage(), EmpWebTrafSession(), expire(), and launchReq(). |
|
|
Definition at line 100 of file empweb.h. Referenced by donePage(), EmpWebTrafSession(), expire(), id(), and launchReq(). |
|
|
Definition at line 107 of file empweb.h. Referenced by donePage(), EmpWebTrafSession(), handle(), and set_interPageOption(). |
|
|
Definition at line 113 of file empweb.cc. Referenced by expire(). |
|
|
Definition at line 97 of file empweb.h. Referenced by donePage(), EmpWebTrafSession(), expire(), launchReq(), and mgr(). |
|
|
Definition at line 99 of file empweb.h. Referenced by donePage(), EmpWebTrafSession(), and handle(). |
|
|
Definition at line 95 of file empweb.h. Referenced by clientWin(), and EmpWebTrafSession(). |
|
|
Definition at line 93 of file empweb.h. Referenced by EmpWebTrafSession(), and interObj(). |
|
|
Definition at line 93 of file empweb.h. Referenced by donePage(), EmpWebTrafSession(), handle(), and interPage(). |
|
|
Definition at line 96 of file empweb.h. Referenced by EmpWebTrafSession(), and mtu(). |
|
|
Definition at line 93 of file empweb.h. Referenced by EmpWebTrafSession(), and objSize(). |
|
|
Definition at line 93 of file empweb.h. Referenced by EmpWebTrafSession(), expire(), and pageSize(). |
|
|
Definition at line 94 of file empweb.h. Referenced by EmpWebTrafSession(), and persistSel(). |
|
|
Definition at line 94 of file empweb.h. Referenced by EmpWebTrafSession(), and reqSize(). |
|
|
Definition at line 94 of file empweb.h. Referenced by EmpWebTrafSession(), and serverSel(). |
|
|
Definition at line 95 of file empweb.h. Referenced by EmpWebTrafSession(), and serverWin(). |
|
|
Definition at line 98 of file empweb.h. Referenced by donePage(), EmpWebTrafSession(), expire(), and launchReq(). |
|
|
Definition at line 112 of file empweb.h. Referenced by donePage(), expire(), and launchReq(). |
|
|
|
Definition at line 110 of file empweb.h. Referenced by donePage(), expire(), and launchReq(). |
1.3.3