15 int main (int argc, char *argv[]) |
15 int main (int argc, char *argv[]) |
16 { |
16 { |
17 Ptr<Node> node = CreateObject<InternetNode> (); |
17 Ptr<Node> node = CreateObject<InternetNode> (); |
18 node->AggregateObject (CreateObject<MobilityModelNotifier> ()); |
18 node->AggregateObject (CreateObject<MobilityModelNotifier> ()); |
19 |
19 |
20 Ptr<PointToPointNetDevice> p2p = CreateObject<PointToPointNetDevice> ("Node", node, |
20 Ptr<PointToPointNetDevice> p2p = CreateObject<PointToPointNetDevice> ("Address", Mac48Address::Allocate ()); |
21 "Address", Mac48Address::Allocate ()); |
|
22 node->AddDevice (p2p); |
21 node->AddDevice (p2p); |
23 p2p->AddQueue (CreateObject<DropTailQueue> ()); |
22 p2p->AddQueue (CreateObject<DropTailQueue> ()); |
24 Ptr<CsmaNetDevice> csma = CreateObject<CsmaNetDevice> ("Node", node, |
23 Ptr<CsmaNetDevice> csma = CreateObject<CsmaNetDevice> ("Address", Mac48Address::Allocate (), |
25 "Address", Mac48Address::Allocate (), |
24 "EncapsulationMode", String ("Llc")); |
26 "EncapsulationMode", String ("Llc")); |
|
27 node->AddDevice (csma); |
25 node->AddDevice (csma); |
28 csma->AddQueue (CreateObject<DropTailQueue> ()); |
26 csma->AddQueue (CreateObject<DropTailQueue> ()); |
29 |
27 |
30 |
28 |
31 return 0; |
29 return 0; |