68 CsmaIpv4Topology::AddIpv4Address (n3, nd3, "10.1.1.4", "255.255.255.0"); |
68 CsmaIpv4Topology::AddIpv4Address (n3, nd3, "10.1.1.4", "255.255.255.0"); |
69 |
69 |
70 uint16_t port = 7; |
70 uint16_t port = 7; |
71 |
71 |
72 Ptr<UdpEchoClient> client = |
72 Ptr<UdpEchoClient> client = |
73 CreateObject<UdpEchoClient> ("Node", n0, |
73 CreateObject<UdpEchoClient> ("RemoteIpv4", Ipv4Address ("10.1.1.2"), |
74 "RemoteIpv4", Ipv4Address ("10.1.1.2"), |
74 "RemotePort", Uinteger (port), |
75 "RemotePort", Uinteger (port), |
75 "MaxPackets", Uinteger (1), |
76 "MaxPackets", Uinteger (1), |
76 "Interval", Seconds(1.), |
77 "Interval", Seconds(1.), |
77 "PacketSize", Uinteger (1024)); |
78 "PacketSize", Uinteger (1024)); |
|
79 n0->AddApplication (client); |
78 n0->AddApplication (client); |
80 |
79 |
81 Ptr<UdpEchoServer> server = |
80 Ptr<UdpEchoServer> server = |
82 CreateObject<UdpEchoServer> ("Node", n1, |
81 CreateObject<UdpEchoServer> ("Port", Uinteger (port)); |
83 "Port", Uinteger (port)); |
|
84 n1->AddApplication (server); |
82 n1->AddApplication (server); |
85 |
83 |
86 server->Start(Seconds(1.)); |
84 server->Start(Seconds(1.)); |
87 client->Start(Seconds(2.)); |
85 client->Start(Seconds(2.)); |
88 |
86 |