| Contatct: Li Yuan | ||||||
|
||||||
| Overview |
ImplementationThis User Model simulator extends Webcache module in NS2.
Overview of WebcacheThere are three major classes related to web cache, as it is in the real world: client (browser or user), server, and cache. They are Http/Client, Http/Server, Http/Cache, derived from the same base class Http (Otcl class, HttpApp in C++). Http (derived from Process) is not real Appication in NS2. It transmits real data and that's provided by TcpApp instead of any Agent. TcpApp is the Tcp agent wrapper, currently it supports symmetric TCP agent only (FullTcp). TcpApp object is derived from Application in NS2, it contains a pointer to a transport agent. Our ExtensionOur aim is to let 'client' have some user behavior, such like abort currently on-going download, 'click' another page after abort, having some think time, sleep time (session interval), etc. We extend Http/Client and Http/Server to Http/Client/AbortClient and Http/Server/NewServer. Since we are not interested in Cache object, we disabled this class in our model. Our extended model can use measured data from real trace as web surffing parameters. These parameters include: FTO (frustration timeout), think time (time between two dowloads), sleep time (time between two sessions), webpage size. It can also use RandomVariable object in NS2 to generate these data. How User Model Works?Our model works like real HTTP by implementing request/response exchanging between clients and servers. Here we consider every request as a request for a download. Each request specify which page it wants. The request size is 43Bytes by default. Client will set a FTO timer, when the timer timeouts before download competes, it will decide whether abort or not. When server gets this request, it will check the requested page size, then deliver these bytes to client. After client gets all the bytes it requested, it will arrange for next download.
Class OverviewHttp/Client/AbortClientHere is the table of major memeber functions. The meaning of memeber variables are explained in the source code files.
Http/Server/NewServerWe will use most of the functions of Http/Server except below two.
|