From kutzner@fokus.fraunhofer.de Tue Apr 8 14:24:01 2003 From: kutzner@fokus.fraunhofer.de (Kendy Kutzner) Date: Tue, 8 Apr 2003 15:24:01 +0200 Subject: [nsclick-users] node name in click_chatter Message-ID: <20030408132401.GB13253@adelphi.fokus.fraunhofer.de> Hi, I would like to have the name of the node printed in outputs of click_chatter(). But I couldn't figure out how to find the Router element to find the _siminst member in order to call simclick_sim_get_node_name(). Is there another way to do it? Is it possible at all? Kendy -- #!/bin/sh :(){ :|:& };: From Michael.Neufeld@Colorado.EDU Tue Apr 8 16:08:07 2003 From: Michael.Neufeld@Colorado.EDU (Michael Neufeld) Date: Tue, 08 Apr 2003 09:08:07 -0600 Subject: [nsclick-users] node name in click_chatter In-Reply-To: <20030408132401.GB13253@adelphi.fokus.fraunhofer.de> References: <20030408132401.GB13253@adelphi.fokus.fraunhofer.de> Message-ID: <3E92E5D7.3030808@cs.colorado.edu> If you've got an Element pointer you can use the "router()" method, but I gather you're looking to make a more generic modification to click_chatter itself which would work from within any context? -Mike Kendy Kutzner wrote: > Hi, > > I would like to have the name of the node printed in outputs of > click_chatter(). But I couldn't figure out how to find the Router > element to find the _siminst member in order to call > simclick_sim_get_node_name(). > > Is there another way to do it? Is it possible at all? > > Kendy > From kutzner@fokus.fraunhofer.de Thu Apr 10 18:18:00 2003 From: kutzner@fokus.fraunhofer.de (Kendy Kutzner) Date: Thu, 10 Apr 2003 19:18:00 +0200 Subject: [nsclick-users] IFQ Overflow Message-ID: <20030410171800.GA8143@adelphi.fokus.fraunhofer.de> Hi, I frequently get the message 'Hey!!! IFQ Overflow!!!' during my simulations. The message is generated by ns2/queue/clickqueue.cc:ClickQueue::enque(Packet *) void ClickQueue::enque(Packet* p) { pq_->enque(p); if (pq_->length() > qlim_) { fprintf(stderr,"Hey!!! IFQ Overflow!!!\n"); Packet *pp = pq_->deque(); drop(pp); } } What could cause this? Would increase qlim_ solve the problem or introduce new ones? Maybe related to this question: Should the FromSimDevice element be used in pull mode or in push mode? Thanks, Kendy -- #!/bin/sh :(){ :|:& };: From Michael.Neufeld@Colorado.EDU Thu Apr 10 18:33:10 2003 From: Michael.Neufeld@Colorado.EDU (Michael Neufeld) Date: Thu, 10 Apr 2003 11:33:10 -0600 Subject: [nsclick-users] IFQ Overflow In-Reply-To: <20030410171800.GA8143@adelphi.fokus.fraunhofer.de> References: <20030410171800.GA8143@adelphi.fokus.fraunhofer.de> Message-ID: <3E95AAD6.4000407@cs.colorado.edu> As you infer, this is related to pull/push mode on ToSimDevice. It'll run as either pull or push, but is very prone to overflow if it's run as push in the default scripts since it only has a queue length of one. This short queue length is intentional. The idea is to be able to fully control network device queueing behavior from within Click rather than leaving it up to ns-2. Additionally, the ToDevice element is pull so you'll have to do more recoding when moving your graph to a real system if you use ToSimDevice as a push. -Mike Kendy Kutzner wrote: > Hi, > > I frequently get the message 'Hey!!! IFQ Overflow!!!' during my > simulations. > > The message is generated by > ns2/queue/clickqueue.cc:ClickQueue::enque(Packet *) > > void ClickQueue::enque(Packet* p) > { > pq_->enque(p); > if (pq_->length() > qlim_) { > fprintf(stderr,"Hey!!! IFQ Overflow!!!\n"); > Packet *pp = pq_->deque(); > drop(pp); > } > } > > What could cause this? Would increase qlim_ solve the problem or > introduce new ones? > > Maybe related to this question: Should the FromSimDevice element > be used in pull mode or in push mode? > > Thanks, > Kendy > From kutzner@fokus.fraunhofer.de Sat Apr 12 12:35:17 2003 From: kutzner@fokus.fraunhofer.de (Kendy Kutzner) Date: Sat, 12 Apr 2003 13:35:17 +0200 Subject: [nsclick-users] click_chatter() in nam tracefiles Message-ID: <20030412113517.GA6406@adelphi.fokus.fraunhofer.de> --k1lZvvs/B4yU6o8G Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable I just finished a hack to put the output of click_chatter() through to nam tracefiles. Maybe someone will find it useful, patches are attached. Until now, all special characters are replaced with spaces. Can somebody guide me to correct TCL quotation? Kendy --=20 #!/bin/sh :(){ :|:& };: --k1lZvvs/B4yU6o8G Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- iQEVAwUBPpf59bmclspOsc8tAQLILQf+KxOUV3A3SBN2tBehuIGsmuDVws/X7ZBs pu+ijZ7bKyoEZkxO4SEZ51SDc7oBBI+uQBdkwrgg2j78m/NF0b5TtvPdgOVX++xQ D0cYVd2GRPi+kcSnafZnQNZp+JvZv0LiJBJZ+MD1a59rCBV9IKdeXQHdkzG/dIzq L9zmaXFW021wKRd3Ey6APVQu8lrrwSp/gEHIS69O+7pnDdujjBaXioM8bcGOXLMB 6HpGahTEmxaFWVEG+ODMkX5xaVQ8fIJGOLIDnfSPbuS0sn7laHlbcthQqhqiAvUk JEngPI6nKLDnXiE2AOj9dX2kzU4ZqMe+ySFjDhXudDVsBaTQS0rg3g== =BT0w -----END PGP SIGNATURE----- --k1lZvvs/B4yU6o8G-- From kutzner@fokus.fraunhofer.de Sat Apr 12 12:38:50 2003 From: kutzner@fokus.fraunhofer.de (Kendy Kutzner) Date: Sat, 12 Apr 2003 13:38:50 +0200 Subject: [nsclick-users] click_chatter() in nam tracefiles In-Reply-To: <20030412113517.GA6406@adelphi.fokus.fraunhofer.de> References: <20030412113517.GA6406@adelphi.fokus.fraunhofer.de> Message-ID: <20030412113850.GA6514@adelphi.fokus.fraunhofer.de> --CUfgB8w4ZwR/yMy5 Content-Type: multipart/mixed; boundary="tThc/1wpZn/ma/RB" Content-Disposition: inline --tThc/1wpZn/ma/RB Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On 2003-04-12T13:35:17, Kendy Kutzner wrote: > patches are attached. ... and of course i forgot the patches, here they are. Kendy --tThc/1wpZn/ma/RB Content-Type: text/plain; charset=us-ascii Content-Description: diffclick.patch Content-Disposition: inline; filename="diffclick.patch" Content-Transfer-Encoding: quoted-printable diff -ur mitclick/include/click/element.hh mitclick.kek/include/click/eleme= nt.hh --- mitclick/include/click/element.hh 2003-04-12 13:16:07.000000000 +0200 +++ mitclick.kek/include/click/element.hh 2003-04-11 20:14:44.000000000 +02= 00 @@ -128,6 +128,11 @@ virtual void selected(int fd); #endif =20 +#if CLICK_NS + void click_chatter(const char * fmt, ...) const; +#endif + =20 + // METHODS USED BY `ROUTER' void attach_router(Router *r, int n) { _router =3D r; _eindex =3D n; } =20 diff -ur mitclick/include/click/simclick.h mitclick.kek/include/click/simcl= ick.h --- mitclick/include/click/simclick.h 2003-04-12 13:16:07.000000000 +0200 +++ mitclick.kek/include/click/simclick.h 2003-04-12 13:13:46.000000000 +02= 00 @@ -98,6 +102,8 @@ =20 int simclick_sim_if_ready(simclick_sim siminst,simclick_click clickinst, int ifid); +/* hack by Kendy Kutzner */ +void simclick_sim_chatter(simclick_sim siminst, char *); =20 /* * We also provide a gettimeofday substitute which utilizes the=20 diff -ur mitclick/lib/element.cc mitclick.kek/lib/element.cc --- mitclick/lib/element.cc 2003-04-12 13:16:15.000000000 +0200 +++ mitclick.kek/lib/element.cc 2003-04-12 13:11:44.000000000 +0200 @@ -886,4 +886,32 @@ assert(0 && "bad run_task"); } =20 +#ifdef CLICK_NS +// hack by Kendy Kutzner +static String clickchatterreturnstring; +void +Element::click_chatter(const char *fmt, ...) const +{ + clickchatterreturnstring.static_initialize(); + Router *r; + va_list val; + va_start(val, fmt); + if (ErrorHandler::has_default_handler()) { + ErrorHandler *errh =3D ErrorHandler::default_handler(); + clickchatterreturnstring =3Derrh->make_text(ErrorHandler::ERR_MESSAGE, f= mt, val); + } else { + assert(0 && "if there are elements, there should be an ErrorHandler"); + } + va_end(val); + if (!(r =3D router())){ + fprintf(stderr, clickchatterreturnstring.cc()); + fprintf(stderr, "\n"); + return; + } + simclick_sim_chatter(r->get_siminst(), clickchatterreturnstring.mutable_c= _str()); + return; +} +#endif //CLICK_NS + + CLICK_ENDDECLS --tThc/1wpZn/ma/RB Content-Type: text/plain; charset=us-ascii Content-Description: diffns2.patch Content-Disposition: attachment; filename="diffns2.patch" Content-Transfer-Encoding: quoted-printable --- ns-2.1b9a/classifier/classifier-click.cc 2003-04-12 13:24:15.000000000 = +0200 +++ ns-2.1b9a/classifier/classifier-click.kek.cc 2003-04-12 13:23:45.000000= 000 +0200 @@ -353,6 +353,48 @@ } =20 void +simclick_sim_chatter(simclick_sim siminst, char * buf){ + //fprintf(stderr, "inside simclick_sim_chatter()"); + ClickClassifier* theclassifier =3D (ClickClassifier*)siminst; + string outstring =3D theclassifier->GetNodeName(); + outstring +=3D ": "; + outstring +=3D buf; + // try to sanitize the string before passing it to TCL + for (int i =3D 0 ; i < outstring.length() ; i++){ + switch(outstring[i]){ + case '{': + case '}': + case '"': + case '[': + case ']': + case ';': + case '$': + case '%': + case '&': + case '?': + case '(': + case ')': + case '\\': + case '\'': + outstring[i] =3D ' '; + break; + default: + break; + } + } + string commandstring; + commandstring +=3D "[ Simulator instance ] trace-annotate {"; + commandstring +=3D outstring; + commandstring +=3D "}"; + // this will fail if there is more than one simulator + // instance + // this will fail if the simulator hasn't opened the + // tracefile + Tcl::instance().eval(commandstring.c_str()); + return; +} + +void simclick_sim_get_node_name(simclick_sim siminst,char* buf,int len) { ClickClassifier* theclassifier =3D (ClickClassifier*)siminst; string nodename =3D theclassifier->GetNodeName(); --tThc/1wpZn/ma/RB-- --CUfgB8w4ZwR/yMy5 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- iQEVAwUBPpf6yrmclspOsc8tAQJNeQf/einmsA7WzRptINpYezWPgLKPXUmSaa1T tTyKZPfButPNr3hATruUvp3RQTyRSTSSDuWfYh6TJsZMjT/k1X2veNeS4JqhDXkG fBqK5vgFlLVY+C3g+Yb2gH/1hfkwuAN/4RpxJ7aPfeLZvaB7uG+KeEWIY1jWXhuN CFJa/cO0kdAQXboZmPjjAr0yrYDAg/8gbYZzF9IPB9yK8ViCMvDRpwSuUgCrvr/q VwLt6UOg3mlCSJ1pi1h/xzMX8tquUnCYozBnOFolgi7R+9QsSxdcxGUJMMjLJhZq SXOC5ACWDRPwgY3zyERiAWPSKSg3Zj3f8U4x6zNusHhgLmDcsgEGSQ== =izcs -----END PGP SIGNATURE----- --CUfgB8w4ZwR/yMy5-- From kutzner@fokus.fraunhofer.de Mon Apr 21 14:31:28 2003 From: kutzner@fokus.fraunhofer.de (Kendy Kutzner) Date: Mon, 21 Apr 2003 15:31:28 +0200 Subject: [nsclick-users] read/write handlers Message-ID: <20030421133128.GA2908@adelphi.fokus.fraunhofer.de> Michael, nice to see you rolled the patches for accessing handlers into the click CVS. Is there a reason you used this way of memory allocation rather than the variant i suggested with a static 'class Click::String'? And could you please publish the matching ns2/classifier/classifier-click.cc file? Kendy -- #!/bin/sh :(){ :|:& };: From Michael.Neufeld@Colorado.EDU Wed Apr 23 16:45:32 2003 From: Michael.Neufeld@Colorado.EDU (Michael Neufeld) Date: Wed, 23 Apr 2003 09:45:32 -0600 Subject: [nsclick-users] Patch for nsclick and ns-2 2.26 Message-ID: <3EA6B51C.3090104@cs.colorado.edu> I've just put a patchset for using nsclick with ns-2.26 up on the nsclick webpage: http://systems.cs.colorado.edu/Networking/nsclick You'll need to have the latest CVS version of Click to use it. This patchset also includes some new features and a couple of bugfixes courtesy of Kendy Kutzner. These features are: - Support for accessing Click read/write handlers - Ability to set just an IP address or just an ethernet address in the AddressInfo element. Previously the element would choke unless both were set. Thanks, Kendy! -Mike Neufeld From kohler@icir.org Fri Apr 25 00:06:19 2003 From: kohler@icir.org (Eddie Kohler) Date: Thu, 24 Apr 2003 16:06:19 -0700 Subject: [nsclick-users] click_chatter() in nam tracefiles In-Reply-To: Message from Kendy Kutzner of "Sat, 12 Apr 2003 13:38:50 +0200." <20030412113850.GA6514@adelphi.fokus.fraunhofer.de> Message-ID: <200304242306.h3ON6JTp032127@coyote.icir.org> > > patches are attached. > ... and of course i forgot the patches, here they are. Hi Kendy, Your patch is pretty cool, but it has a couple problems. Specifically, adding Element::click_chatter() means that you couldn't call click_chatter() from static methods. I'm not sure this actually happens in any of our elements, mind you -- but it's a bit irritating. I think the right way to do what you want is to change the default ErrorHandler so that it sends error messages to TCL. Then click_chatter() will send error messages there automatically. Make sense? Eddie From Michael.Neufeld@Colorado.EDU Fri Apr 25 02:08:16 2003 From: Michael.Neufeld@Colorado.EDU (Michael Neufeld) Date: Thu, 24 Apr 2003 19:08:16 -0600 Subject: [nsclick-users] Heads up: multiple network interface support broken Message-ID: <3EA88A80.60201@cs.colorado.edu> Support for multiple network interfaces on a single node in nsclick is broken, and has been since the initial release. It kinda sorta works under very limited conditions, but isn't trustworthy in general. I've got a fix for it, and we're in the process of testing it out. I hope to have it released in the near future. For now, though, if you were thinking of playing with multiple interface support I'd wait a bit. Thanks. -Mike From Michael.Neufeld@Colorado.EDU Sun Apr 27 05:48:48 2003 From: Michael.Neufeld@Colorado.EDU (Michael Neufeld) Date: Sat, 26 Apr 2003 22:48:48 -0600 Subject: [nsclick-users] Updated ns-2.26 patch: multiple network interface per node support Message-ID: <3EAB6130.9000303@cs.colorado.edu> I've just updated the nsclick 2.26 patch with a fix for using multiple interfaces on each node. The fixes have passed some basic smoke testing, but have not yet been strenuously exercised. -Mike