LEFT | RIGHT |
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * This program is free software; you can redistribute it and/or modify | 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 | 4 * it under the terms of the GNU General Public License version 2 as |
5 * published by the Free Software Foundation; | 5 * published by the Free Software Foundation; |
6 * | 6 * |
7 * This program is distributed in the hope that it will be useful, | 7 * This program is distributed in the hope that it will be useful, |
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 8 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
10 * GNU General Public License for more details. | 10 * GNU General Public License for more details. |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 PointToPointHelper p2p; | 76 PointToPointHelper p2p; |
77 p2p.SetDeviceAttribute ("DataRate", StringValue ("5Mbps")); | 77 p2p.SetDeviceAttribute ("DataRate", StringValue ("5Mbps")); |
78 p2p.SetChannelAttribute ("Delay", StringValue ("2ms")); | 78 p2p.SetChannelAttribute ("Delay", StringValue ("2ms")); |
79 NetDeviceContainer dAdB = p2p.Install (nAnB); | 79 NetDeviceContainer dAdB = p2p.Install (nAnB); |
80 | 80 |
81 NetDeviceContainer dBdC = p2p.Install (nBnC);; | 81 NetDeviceContainer dBdC = p2p.Install (nBnC);; |
82 | 82 |
83 Ptr<CsmaNetDevice> deviceA = CreateObject<CsmaNetDevice> (); | 83 Ptr<CsmaNetDevice> deviceA = CreateObject<CsmaNetDevice> (); |
84 deviceA->SetAddress (Mac48Address::Allocate ()); | 84 deviceA->SetAddress (Mac48Address::Allocate ()); |
85 nA->AddDevice (deviceA); | 85 nA->AddDevice (deviceA); |
86 deviceA->SetQueue (CreateObject<PacketDropTailQueue> ()); | 86 deviceA->SetQueue (CreateObject<DropTailQueue<Packet> > ()); |
87 | 87 |
88 Ptr<CsmaNetDevice> deviceC = CreateObject<CsmaNetDevice> (); | 88 Ptr<CsmaNetDevice> deviceC = CreateObject<CsmaNetDevice> (); |
89 deviceC->SetAddress (Mac48Address::Allocate ()); | 89 deviceC->SetAddress (Mac48Address::Allocate ()); |
90 nC->AddDevice (deviceC); | 90 nC->AddDevice (deviceC); |
91 deviceC->SetQueue (CreateObject<PacketDropTailQueue> ()); | 91 deviceC->SetQueue (CreateObject<DropTailQueue<Packet> > ()); |
92 | 92 |
93 // Later, we add IP addresses. | 93 // Later, we add IP addresses. |
94 Ipv4AddressHelper ipv4; | 94 Ipv4AddressHelper ipv4; |
95 ipv4.SetBase ("10.1.1.0", "255.255.255.252"); | 95 ipv4.SetBase ("10.1.1.0", "255.255.255.252"); |
96 Ipv4InterfaceContainer iAiB = ipv4.Assign (dAdB); | 96 Ipv4InterfaceContainer iAiB = ipv4.Assign (dAdB); |
97 | 97 |
98 ipv4.SetBase ("10.1.1.4", "255.255.255.252"); | 98 ipv4.SetBase ("10.1.1.4", "255.255.255.252"); |
99 Ipv4InterfaceContainer iBiC = ipv4.Assign (dBdC); | 99 Ipv4InterfaceContainer iBiC = ipv4.Assign (dBdC); |
100 | 100 |
101 Ptr<Ipv4> ipv4A = nA->GetObject<Ipv4> (); | 101 Ptr<Ipv4> ipv4A = nA->GetObject<Ipv4> (); |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 | 152 |
153 AsciiTraceHelper ascii; | 153 AsciiTraceHelper ascii; |
154 p2p.EnableAsciiAll (ascii.CreateFileStream ("global-routing-injection32.tr")); | 154 p2p.EnableAsciiAll (ascii.CreateFileStream ("global-routing-injection32.tr")); |
155 p2p.EnablePcapAll ("global-routing-injection32"); | 155 p2p.EnablePcapAll ("global-routing-injection32"); |
156 | 156 |
157 Simulator::Run (); | 157 Simulator::Run (); |
158 Simulator::Destroy (); | 158 Simulator::Destroy (); |
159 | 159 |
160 return 0; | 160 return 0; |
161 } | 161 } |
LEFT | RIGHT |