TC3.ned 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. //
  2. // Copyright (C) 2012 Opensim Ltd.
  3. // Author: Tamas Borbely
  4. //
  5. // This program is free software; you can redistribute it and/or
  6. // modify it under the terms of the GNU General Public License
  7. // as published by the Free Software Foundation; either version 2
  8. // of the License, or (at your option) any later version.
  9. //
  10. // This program is distributed in the hope that it will be useful,
  11. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. // GNU General Public License for more details.
  14. //
  15. // You should have received a copy of the GNU General Public License
  16. // along with this program; if not, write to the Free Software
  17. // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  18. //
  19. package inet.examples.diffserv.onedomain;
  20. import inet.common.queue.Join;
  21. import inet.common.queue.Sink;
  22. import inet.linklayer.contract.ITrafficConditioner;
  23. import inet.networklayer.diffserv.MultiFieldClassifier;
  24. import inet.networklayer.diffserv.TokenBucketMeter;
  25. //
  26. // Traffic conditioner used in Experiment 3.2.
  27. //
  28. module TC3 like ITrafficConditioner
  29. {
  30. parameters:
  31. string interfaceTableModule;
  32. *.interfaceTableModule = default(absPath(interfaceTableModule));
  33. @display("i=block/classifier");
  34. gates:
  35. input in;
  36. output out;
  37. submodules:
  38. classifier: MultiFieldClassifier {
  39. filters = xml("<filters><filter gate=\"0\"/></filters>");
  40. @display("p=40,186");
  41. }
  42. meter: TokenBucketMeter {
  43. @display("p=162,111");
  44. }
  45. sink: Sink {
  46. @display("p=271,60");
  47. }
  48. join: Join {
  49. @display("p=284,186");
  50. }
  51. connections:
  52. in --> classifier.in;
  53. classifier.outs++ --> meter.in++;
  54. classifier.defaultOut --> join.in++;
  55. meter.redOut --> sink.in++;
  56. meter.greenOut --> join.in++;
  57. join.out --> out;
  58. }