Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 7 Queue Management and packet Scheduling Instructor : Sheau-Ru Tong Presenter : Hao-Hsiang Ku From: The ns Manual (formerly ns Notes and Documentation)

Similar presentations


Presentation on theme: "Chapter 7 Queue Management and packet Scheduling Instructor : Sheau-Ru Tong Presenter : Hao-Hsiang Ku From: The ns Manual (formerly ns Notes and Documentation)"— Presentation transcript:

1 Chapter 7 Queue 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 –$queuemonitor get-bytes-integrator –$queuemonitor get-pkts-integrator –$queuemonitor get-delay-samples

14 7.4 Commands at a Glance $ns_ queue-limit $ns_ trace-queue $ns_ namtrace-queue $ns_ monitor-queue


Download ppt "Chapter 7 Queue Management and packet Scheduling Instructor : Sheau-Ru Tong Presenter : Hao-Hsiang Ku From: The ns Manual (formerly ns Notes and Documentation)"

Similar presentations


Ads by Google