TC1.ned 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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.linklayer.contract.ITrafficConditioner;
  21. import inet.networklayer.diffserv.DSCPMarker;
  22. import inet.networklayer.diffserv.MultiFieldClassifier;
  23. //
  24. // Traffic conditioner used in Experiments 1.1-1.6 and 5.1.
  25. //
  26. module TC1 like ITrafficConditioner
  27. {
  28. parameters:
  29. int numClasses;
  30. @display("i=block/classifier");
  31. gates:
  32. input in;
  33. output out;
  34. submodules:
  35. classifier: MultiFieldClassifier {
  36. @display("p=61,110");
  37. }
  38. marker: DSCPMarker {
  39. @display("p=192,110");
  40. }
  41. connections:
  42. in --> classifier.in;
  43. for i=1..numClasses {
  44. classifier.outs++ --> marker.in++;
  45. }
  46. classifier.defaultOut --> marker.in++;
  47. marker.out --> out;
  48. }