network-bus.ned 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. package inet.tests.ethernet;
  2. import inet.linklayer.ethernet.EtherBus;
  3. import inet.node.ethernet.EtherHost2;
  4. import inet.common.scenario.ScenarioManager;
  5. import ned.DatarateChannel;
  6. //
  7. // Sample Ethernet LAN: hosts connected via bus
  8. //
  9. network HostsWithBus
  10. {
  11. types:
  12. submodules:
  13. hostA: EtherHost2 {
  14. parameters:
  15. @display("p=72,80");
  16. }
  17. hostB: EtherHost2 {
  18. parameters:
  19. @display("p=334,80");
  20. }
  21. hostC: EtherHost2 {
  22. parameters:
  23. @display("p=334,80");
  24. }
  25. bus: EtherBus {
  26. parameters:
  27. positions = "0 5 10";
  28. propagationSpeed = 2e8 mps; // 1us = 200m
  29. @display("p=250,180;b=400,6;o=#408060");
  30. gates:
  31. ethg[3];
  32. }
  33. scenarioManager: ScenarioManager {
  34. parameters:
  35. script = default(xml("<empty/>"));
  36. @display("p=184,180");
  37. }
  38. connections:
  39. bus.ethg++ <--> DatarateChannel <--> hostA.ethg;
  40. bus.ethg++ <--> DatarateChannel <--> hostB.ethg;
  41. bus.ethg++ <--> DatarateChannel <--> hostC.ethg;
  42. }