1 / 14

Chapter 7 Queue Management and packet Scheduling

Chapter 7 Queue Management and packet Scheduling. Instructor : Sheau-Ru Tong Presenter : Hao-Hsiang Ku.

tad
Download Presentation

Chapter 7 Queue Management and packet Scheduling

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter 7Queue Management and packet Scheduling Instructor : Sheau-Ru Tong Presenter : Hao-Hsiang Ku From: The ns Manual (formerly ns Notes and Documentation) The VINT Project A collaboratoin between researchers at UC Berkeley, LBL, USC/ISI, and Xerox PARC. Kevin Fall, Editor ,Kannan Varadhan, Editor

  2. Outline • Abstract • 7.1 The C++ Queue Class • 7.2 Drop Tail • 7.3 Different Types of Queue Objects • 7.4 Commands at a Glance

  3. Abstract • Packet scheduling • Buffer management • FIFO • Other kinds of Queues.

  4. 7.1 The C++ Queue Class class Queue : public Connector{ public : virtual void enque(Packet*)=0; virtual Packet* deque()=0; void recv(Packet *,Handler*); void resume(); int blocked(); void unblock(); void block();protected: Queue(); int command(int argc,const char*const* argv) int qlim_; int blocked_; int unblock_on_resume_; QueueHandler qh_; };

  5. 7.1.1 Queue Blocking class QueueHandler : public Handler { public: inline QueueHandler(Queue& q) : queue_(q) {} void handle(Event*); private: Queue& queue_; }; void QueueHandler::handle(Event*) { queue_.resume(); }Queue::Queue() : drop_(0), blocked_(0), qh_(*this) { Tcl& tcl = Tcl::instance(); bind("limit_", &qlim_); }

  6. 7.1.1 Queue Blocking(cont.) void Queue::recv(Packet* p, Handler*) { enque(p); if (!blocked_) { p = deque(); if (p != 0) { blocked_ = 1; target_-\>recv(p, &qh_);}}} void Queue::resume() { Packet* p = deque(); if (p != 0) target_-\>recv(p, &qh_); else { if (unblock_on_resume_) blocked_ = 0; else blocked_ = 1; } }

  7. 7.1.2 PacketQueue Class class PacketQueue { public: PacketQueue(); int length(); void enque(Packet* p); Packet* deque(); Packet* lookup(int n); void remove(Packet*); protected: Packet* head_; Packet** tail_; int len_; };

  8. 7.2 Drop Tail • A bounded, drop-tail queue • class DropTail : public Queue { protected: void enque(Packet*); Packet* deque(); PacketQueue q_; };

  9. 7.2 Drop Tail(cont.) • drop-tail • void DropTail::enque(Packet* p) { q_.enque(p); if (q_.length() \>= qlim_) { q_.remove(p); drop(p); } }Packet* DropTail::deque() { return (q_.deque()); }

  10. 7.3 Different Types of Queue Object • Parameters: • limit_ • blocked_ • unblock_on_resume_ • Other Queue objects • Drop-tail,FQ,SFQ,DRR,RED and CBQ.

  11. 7.3 Different Types of Queue Object(cont.) • Drop-tail objects: simple FIFO queue. • FQ objects:Fair Queue. • SFQ objects : Stochastic Fair queuing. • DRR objects: Deficit round robin scheduling. • RED objects:Random Early-detection Gateway.

  12. 7.3 Different Types of Queue Object(cont.) • CBQ objects:Class-Based Queuing. • CBQ/WRR(Weighted Round-Robin scheduling)

  13. 7.3 Different Types of Queue Object(cont.) • Queue-monitor objects • $queuemonitor • $queuemonitor set-delay-samples <delaySamp_> • $queuemonitor get-bytes-integrator • $queuemonitor get-pkts-integrator • $queuemonitor get-delay-samples

  14. 7.4 Commands at a Glance • $ns_ queue-limit <n1> <n2> <limit> • $ns_ trace-queue <n1> <n2> <optional:file> • $ns_ namtrace-queue <n1> <n2> <optional:file> • $ns_ monitor-queue <n1> <n2> <optional:qtrace> <optional:sampleinterval >

More Related