{"title":"ns-3中的状态自动保存和回滚","authors":"Euna Kim, G. Riley","doi":"10.1145/3064911.3064925","DOIUrl":null,"url":null,"abstract":"When designing, implementing and executing large-scale distributed simulation codes it is well-known the so-called optimistic time synchronization methods often lead to better overall performance as compared to the so-called conservative methods. Particularly when the model being simulated suffers from small lookahead between two or more of the logical processes working on the overall simulation execution. However, the design and implementation of simulation model codes intended to be executed using optimistic approach is often daunting, especially when working with existing codes which were designed and implemented to be used in a conservative approach. When executing simulation events, optimistic simulation models must first save any existing state in the model prior to executing codes that change that state, and furthermore must implement rollback code which restores that state to the original value. The necessity for such extra software functionality is often a barrier to the complete implementation of an optimistic-based simulation model and the corresponding improved performance. However, recent work by Lawrence Livermore National Laboratory (LLNL) shows promise toward easing the burden of state-saving and rollback which will ultimately lead to simulation models that include state-saving and rollback automatically with little or no extra effort on the part of the model developer. This work, known as Backstroke, uses the C or C++ source code of the simulation model and generates both the forward-direction state-saving and the reverse-direction rollback prior to executing any simulation event. In this work, we demonstrate that the Network Simulator 3 (ns-3) model code, instrumented by Backstroke, can successfully execute scenario to some arbitrary time T, and then roll back to simulation time T0, restoring previously saved state for all modified ns-3 events and resulting in identical model state to that created in the original prior to the execution of the very first model event. Finally, we measure and report on the amount of wall-clock time overhead incurred by the ns-3 execution required by the Backstroke state saving and restoration, and compare that time to the execution time of the original unmodified ns-3 model codes.","PeriodicalId":341026,"journal":{"name":"Proceedings of the 2017 ACM SIGSIM Conference on Principles of Advanced Discrete Simulation","volume":"6 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2017-05-16","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"6","resultStr":"{\"title\":\"Automatic State Saving and Rollback in ns-3\",\"authors\":\"Euna Kim, G. Riley\",\"doi\":\"10.1145/3064911.3064925\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"When designing, implementing and executing large-scale distributed simulation codes it is well-known the so-called optimistic time synchronization methods often lead to better overall performance as compared to the so-called conservative methods. Particularly when the model being simulated suffers from small lookahead between two or more of the logical processes working on the overall simulation execution. However, the design and implementation of simulation model codes intended to be executed using optimistic approach is often daunting, especially when working with existing codes which were designed and implemented to be used in a conservative approach. When executing simulation events, optimistic simulation models must first save any existing state in the model prior to executing codes that change that state, and furthermore must implement rollback code which restores that state to the original value. The necessity for such extra software functionality is often a barrier to the complete implementation of an optimistic-based simulation model and the corresponding improved performance. However, recent work by Lawrence Livermore National Laboratory (LLNL) shows promise toward easing the burden of state-saving and rollback which will ultimately lead to simulation models that include state-saving and rollback automatically with little or no extra effort on the part of the model developer. This work, known as Backstroke, uses the C or C++ source code of the simulation model and generates both the forward-direction state-saving and the reverse-direction rollback prior to executing any simulation event. In this work, we demonstrate that the Network Simulator 3 (ns-3) model code, instrumented by Backstroke, can successfully execute scenario to some arbitrary time T, and then roll back to simulation time T0, restoring previously saved state for all modified ns-3 events and resulting in identical model state to that created in the original prior to the execution of the very first model event. Finally, we measure and report on the amount of wall-clock time overhead incurred by the ns-3 execution required by the Backstroke state saving and restoration, and compare that time to the execution time of the original unmodified ns-3 model codes.\",\"PeriodicalId\":341026,\"journal\":{\"name\":\"Proceedings of the 2017 ACM SIGSIM Conference on Principles of Advanced Discrete Simulation\",\"volume\":\"6 1\",\"pages\":\"0\"},\"PeriodicalIF\":0.0000,\"publicationDate\":\"2017-05-16\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"6\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"Proceedings of the 2017 ACM SIGSIM Conference on Principles of Advanced Discrete Simulation\",\"FirstCategoryId\":\"1085\",\"ListUrlMain\":\"https://doi.org/10.1145/3064911.3064925\",\"RegionNum\":0,\"RegionCategory\":null,\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"\",\"JCRName\":\"\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"Proceedings of the 2017 ACM SIGSIM Conference on Principles of Advanced Discrete Simulation","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/3064911.3064925","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
When designing, implementing and executing large-scale distributed simulation codes it is well-known the so-called optimistic time synchronization methods often lead to better overall performance as compared to the so-called conservative methods. Particularly when the model being simulated suffers from small lookahead between two or more of the logical processes working on the overall simulation execution. However, the design and implementation of simulation model codes intended to be executed using optimistic approach is often daunting, especially when working with existing codes which were designed and implemented to be used in a conservative approach. When executing simulation events, optimistic simulation models must first save any existing state in the model prior to executing codes that change that state, and furthermore must implement rollback code which restores that state to the original value. The necessity for such extra software functionality is often a barrier to the complete implementation of an optimistic-based simulation model and the corresponding improved performance. However, recent work by Lawrence Livermore National Laboratory (LLNL) shows promise toward easing the burden of state-saving and rollback which will ultimately lead to simulation models that include state-saving and rollback automatically with little or no extra effort on the part of the model developer. This work, known as Backstroke, uses the C or C++ source code of the simulation model and generates both the forward-direction state-saving and the reverse-direction rollback prior to executing any simulation event. In this work, we demonstrate that the Network Simulator 3 (ns-3) model code, instrumented by Backstroke, can successfully execute scenario to some arbitrary time T, and then roll back to simulation time T0, restoring previously saved state for all modified ns-3 events and resulting in identical model state to that created in the original prior to the execution of the very first model event. Finally, we measure and report on the amount of wall-clock time overhead incurred by the ns-3 execution required by the Backstroke state saving and restoration, and compare that time to the execution time of the original unmodified ns-3 model codes.