1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
|
2 /* |
|
3 * This program is free software; you can redistribute it and/or modify |
|
4 * it under the terms of the GNU General Public License version 2 as |
|
5 * published by the Free Software Foundation; |
|
6 * |
|
7 * This program is distributed in the hope that it will be useful, |
|
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
10 * GNU General Public License for more details. |
|
11 * |
|
12 * You should have received a copy of the GNU General Public License |
|
13 * along with this program; if not, write to the Free Software |
|
14 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
15 * |
|
16 * Author: George F. Riley<riley@ece.gatech.edu> |
|
17 */ |
|
18 |
|
19 // Define an object to create a dumbbell topology. |
|
20 |
|
21 #ifndef __POINT_TO_POINT_DUMBBELL_HELPER_H__ |
|
22 #define __POINT_TO_POINT_DUMBBELL_HELPER_H__ |
|
23 |
|
24 #include <string> |
|
25 |
|
26 #include "point-to-point-helper.h" |
|
27 #include "ipv4-address-helper.h" |
|
28 #include "internet-stack-helper.h" |
|
29 #include "ipv4-interface-container.h" |
|
30 |
|
31 namespace ns3 { |
|
32 |
|
33 class PointToPointDumbbellHelper |
|
34 { |
|
35 public: |
|
36 PointToPointDumbbellHelper (uint32_t nLeftLeaf, // Number of left size leaf nodes |
|
37 PointToPointHelper& leftHelper, |
|
38 uint32_t nRightLeaf, // Number of right side leaf nodes |
|
39 PointToPointHelper& rightHelper, |
|
40 PointToPointHelper& bottleneckHelper); |
|
41 public: |
|
42 Ptr<Node> GetLeft () const; // Get the left side bottleneck router |
|
43 Ptr<Node> GetLeft (uint32_t) const; // Get the i'th left side leaf |
|
44 Ptr<Node> GetRight () const; // Get the right side bottleneck router |
|
45 Ptr<Node> GetRight (uint32_t) const; // Get the i'th right side leaf |
|
46 Ipv4Address GetLeftAddress (uint32_t) const; // Get left leaf address |
|
47 Ipv4Address GetRightAddress (uint32_t) const; // Get right leaf address |
|
48 uint32_t LeftCount () const; // Number of left side nodes |
|
49 uint32_t RightCount () const; // Number of right side nodes |
|
50 void InstallStack (InternetStackHelper stack); |
|
51 void AssignAddresses (Ipv4AddressHelper leftIp, |
|
52 Ipv4AddressHelper rightIp, |
|
53 Ipv4AddressHelper routerIp); |
|
54 // Add locations in the specified bounding box |
|
55 // Arguments are uppler left x, upper left y, lower right x, lower right y |
|
56 void BoundingBox (double, double, double, double); |
|
57 |
|
58 private: |
|
59 NodeContainer m_leftLeaf; |
|
60 NetDeviceContainer m_leftLeafDevices; |
|
61 NodeContainer m_rightLeaf; |
|
62 NetDeviceContainer m_rightLeafDevices; |
|
63 NodeContainer m_routers; |
|
64 NetDeviceContainer m_routerDevices; // just two connecting the routers |
|
65 // Device containers for the router devices connecting to the leaf devices |
|
66 NetDeviceContainer m_leftRouterDevices; |
|
67 NetDeviceContainer m_rightRouterDevices; |
|
68 Ipv4InterfaceContainer m_leftLeafInterfaces; |
|
69 Ipv4InterfaceContainer m_leftRouterInterfaces; |
|
70 Ipv4InterfaceContainer m_rightLeafInterfaces; |
|
71 Ipv4InterfaceContainer m_rightRouterInterfaces; |
|
72 Ipv4InterfaceContainer m_routerInterfaces; |
|
73 }; |
|
74 } |
|
75 #endif |
|
76 |
|
77 |
|