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 * Copyright (c) 2015 Magister Solutions | 3 * Copyright (c) 2015 Magister Solutions |
4 * | 4 * |
5 * This program is free software; you can redistribute it and/or modify | 5 * This program is free software; you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 2 as | 6 * it under the terms of the GNU General Public License version 2 as |
7 * published by the Free Software Foundation; | 7 * published by the Free Software Foundation; |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 * \param rtt The packet round trip delay time. | 251 * \param rtt The packet round trip delay time. |
252 * \param from The address of the device where the packet originates from. | 252 * \param from The address of the device where the packet originates from. |
253 */ | 253 */ |
254 void ClientRxRttCallback (const Time &rtt, const Address &from); | 254 void ClientRxRttCallback (const Time &rtt, const Address &from); |
255 /** | 255 /** |
256 * Connected with `PhyRxDrop` trace source of both the client's and server's | 256 * Connected with `PhyRxDrop` trace source of both the client's and server's |
257 * devices. Increments #m_numOfPacketDrops. | 257 * devices. Increments #m_numOfPacketDrops. |
258 * \param packet Pointer to the packet being dropped. | 258 * \param packet Pointer to the packet being dropped. |
259 */ | 259 */ |
260 void DeviceDropCallback (Ptr<const Packet> packet); | 260 void DeviceDropCallback (Ptr<const Packet> packet); |
| 261 /** |
| 262 * Dummy event |
| 263 */ |
| 264 void ProgressCallback (); |
261 | 265 |
262 // THE PARAMETERS OF THE TEST CASE. | 266 // THE PARAMETERS OF THE TEST CASE. |
263 | 267 |
264 int64_t m_rngRun; ///< Determines the set of random values generated. | 268 int64_t m_rngRun; ///< Determines the set of random values generated. |
265 TypeId m_tcpType; ///< TCP algorithm used. | 269 TypeId m_tcpType; ///< TCP algorithm used. |
266 Time m_channelDelay; ///< %Time needed by a packet to propagate. | 270 Time m_channelDelay; ///< %Time needed by a packet to propagate. |
267 uint32_t m_mtuSize; ///< Maximum transmission unit (in bytes). | 271 uint32_t m_mtuSize; ///< Maximum transmission unit (in bytes). |
268 bool m_useIpv6; ///< Whether to use IPv6 or IPv4. | 272 bool m_useIpv6; ///< Whether to use IPv6 or IPv4. |
269 | 273 |
270 // OTHER MEMBER VARIABLES. | 274 // OTHER MEMBER VARIABLES. |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
485 traceSourceConnected = httpClient->TraceConnectWithoutContext ( | 489 traceSourceConnected = httpClient->TraceConnectWithoutContext ( |
486 "RxDelay", | 490 "RxDelay", |
487 MakeCallback (&ThreeGppHttpObjectTestCase::ClientRxDelayCallback, | 491 MakeCallback (&ThreeGppHttpObjectTestCase::ClientRxDelayCallback, |
488 this)); | 492 this)); |
489 NS_ASSERT (traceSourceConnected); | 493 NS_ASSERT (traceSourceConnected); |
490 traceSourceConnected = httpClient->TraceConnectWithoutContext ( | 494 traceSourceConnected = httpClient->TraceConnectWithoutContext ( |
491 "RxRtt", | 495 "RxRtt", |
492 MakeCallback (&ThreeGppHttpObjectTestCase::ClientRxRttCallback, | 496 MakeCallback (&ThreeGppHttpObjectTestCase::ClientRxRttCallback, |
493 this)); | 497 this)); |
494 NS_ASSERT (traceSourceConnected); | 498 NS_ASSERT (traceSourceConnected); |
| 499 |
| 500 Simulator::Schedule (Seconds (1.0), &ThreeGppHttpObjectTestCase::ProgressCallb
ack, this); |
495 | 501 |
496 /* | 502 /* |
497 * Here we don't set the simulation stop time. During the run, the simulation | 503 * Here we don't set the simulation stop time. During the run, the simulation |
498 * will stop immediately after the client has completely received the third | 504 * will stop immediately after the client has completely received the third |
499 * web page. | 505 * web page. |
500 */ | 506 */ |
501 Simulator::Run (); | 507 Simulator::Run (); |
502 | 508 |
503 // Dump some statistical information about the simulation. | 509 // Dump some statistical information about the simulation. |
504 NS_LOG_INFO (this << " Total request objects received: " | 510 NS_LOG_INFO (this << " Total request objects received: " |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
738 if (m_numOfPagesReceived >= 3) | 744 if (m_numOfPagesReceived >= 3) |
739 { | 745 { |
740 // We have processed 3 web pages and that should be enough for this te
st. | 746 // We have processed 3 web pages and that should be enough for this te
st. |
741 NS_LOG_LOGIC (this << " Test is stopping now."); | 747 NS_LOG_LOGIC (this << " Test is stopping now."); |
742 Simulator::Stop (); | 748 Simulator::Stop (); |
743 } | 749 } |
744 } | 750 } |
745 } | 751 } |
746 | 752 |
747 void | 753 void |
| 754 ThreeGppHttpObjectTestCase::ProgressCallback () |
| 755 { |
| 756 NS_LOG_INFO ("Simulator time now: " << Simulator::Now ().GetSeconds () << "s")
; |
| 757 Simulator::Schedule (Seconds (1.0), &ThreeGppHttpObjectTestCase::ProgressCallb
ack, this); |
| 758 } |
| 759 |
| 760 void |
748 ThreeGppHttpObjectTestCase::ClientRxDelayCallback (const Time &delay, | 761 ThreeGppHttpObjectTestCase::ClientRxDelayCallback (const Time &delay, |
749 const Address &from) | 762 const Address &from) |
750 { | 763 { |
751 NS_LOG_FUNCTION (this << delay.GetSeconds () << from); | 764 NS_LOG_FUNCTION (this << delay.GetSeconds () << from); |
752 m_delayCalculator->Update (delay.GetSeconds ()); | 765 m_delayCalculator->Update (delay.GetSeconds ()); |
753 } | 766 } |
754 | 767 |
755 void | 768 void |
756 ThreeGppHttpObjectTestCase::ClientRxRttCallback (const Time &rtt, | 769 ThreeGppHttpObjectTestCase::ClientRxRttCallback (const Time &rtt, |
757 const Address &from) | 770 const Address &from) |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
795 // LogComponentEnable ("ThreeGppHttpClientServerTest", LOG_INFO); | 808 // LogComponentEnable ("ThreeGppHttpClientServerTest", LOG_INFO); |
796 // LogComponentEnable ("ThreeGppHttpClient", LOG_INFO); | 809 // LogComponentEnable ("ThreeGppHttpClient", LOG_INFO); |
797 // LogComponentEnable ("ThreeGppHttpServer", LOG_INFO); | 810 // LogComponentEnable ("ThreeGppHttpServer", LOG_INFO); |
798 // LogComponentEnableAll (LOG_PREFIX_ALL); | 811 // LogComponentEnableAll (LOG_PREFIX_ALL); |
799 | 812 |
800 Time channelDelay[] = { | 813 Time channelDelay[] = { |
801 MilliSeconds (3), | 814 MilliSeconds (3), |
802 MilliSeconds (30), | 815 MilliSeconds (30), |
803 MilliSeconds (300) | 816 MilliSeconds (300) |
804 }; | 817 }; |
805 double bitErrorRate[] = {0.0, 5.0e-5}; | 818 double bitErrorRate[] = {0.0, 5.0e-6}; |
806 uint32_t mtuSize[] = {536, 1460}; | 819 uint32_t mtuSize[] = {536, 1460}; |
807 | 820 |
808 int64_t run = 1; | 821 int64_t run = 1; |
809 while (run <= 100) | 822 while (run <= 100) |
810 { | 823 { |
811 for (uint32_t i1 = 0; i1 < 3; i1++) | 824 for (uint32_t i1 = 0; i1 < 3; i1++) |
812 { | 825 { |
813 for (uint32_t i2 = 0; i2 < 2; i2++) | 826 for (uint32_t i2 = 0; i2 < 2; i2++) |
814 { | 827 { |
815 for (uint32_t i3 = 0; i3 < 2; i3++) | 828 for (uint32_t i3 = 0; i3 < 2; i3++) |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
888 testDuration); | 901 testDuration); |
889 } | 902 } |
890 | 903 |
891 }; // end of class `ThreeGppHttpClientServerTestSuite` | 904 }; // end of class `ThreeGppHttpClientServerTestSuite` |
892 | 905 |
893 /// The global instance of the `three-gpp-http-client-server` system test. | 906 /// The global instance of the `three-gpp-http-client-server` system test. |
894 static ThreeGppHttpClientServerTestSuite g_httpClientServerTestSuiteInstance; | 907 static ThreeGppHttpClientServerTestSuite g_httpClientServerTestSuiteInstance; |
895 | 908 |
896 | 909 |
897 } // end of namespace ns3 | 910 } // end of namespace ns3 |
LEFT | RIGHT |