The Impact of Transport Protocol, Packet Size, and Connection Type on the Round Trip Time
Total Page:16
File Type:pdf, Size:1020Kb
Bachelor of Science in Computer Science with specialization in Game Programming June 2017 The impact of transport protocol, packet size, and connection type on the round trip time Tobias Kling Faculty of Computing Blekinge Institute of Technology SE–371 79 Karlskrona, Sweden i This thesis is submitted to the Faculty of Computing at Blekinge Institute of Technology in partial fulfillment of the requirements for the degree of Degree of Bachelor of Science in Computer Science with specialization in Game Programming. The thesis is equivalent to 10 weeks of full-time studies. Contact Information: Author(s): Tobias Kling E-mail: [email protected] University Advisor: Francisco Lopez Luro Department of Creative Technologies Faculty of Computing Internet : www.bth.se Blekinge Institute of Technology Phone : +46 455 38 50 00 SE–371 79 Karlskrona, Sweden Fax : +46 455 38 50 57 Abstract While developing networking for games and applications, developers have a list of network specific requirements to be met as well as decide how to meet them. It is not always easy to decide what protocol is best suited for a given network configuration, or what is the best size of a data packet. By performing a comparative analysis, it becomes possible to identify how proto- cols, packet size, and network configuration impact the one-way travel time and throughput of a given implementation. The result shows how the different implementations compared against each other and the analysis tries to determine why they perform as they do. This gives a good overview of the pros and cons of how TCP, TCP(N), UDP, and RakNet, behave and perform over LANs and WLANs with varying packet size. Keywords: Transport protocol, Network Configuration, Packet Size, Comparison ii List of Figures 5.1 Ethenet TCP Delay Results . 12 5.2 Ethenet TCP(N) Delay Results . 13 5.3 Ethenet RakNet Delay Results . 13 5.4 Ethenet UDP Delay Results . 14 5.5 Switch TCP Delay Results . 15 5.6 Switch TCP(N) Delay Results . 16 5.7 Switch RakNet Delay Results . 16 5.8 Switch UDP Delay Results . 17 5.9 Private wifi TCP Delay Results . 18 5.10 Private wifi TCP(N) Delay Results . 19 5.11 Private wifi RakNet Delay Results . 19 5.12 Private wifi UDP Delay Results . 20 5.13 Public wifi TCP Delay Results . 21 5.14 Public wifi TCP(N) Delay Results . 22 5.15 Public wifi RakNet Delay Results . 22 5.16 Public wifi UDP Delay Results . 23 5.17 Ethernet TCP Throughput Results . 24 5.18 Ethernet TCP(N) Throughput Results . 25 5.19 Ethernet RakNet Throughput Results . 25 5.20 Ethernet UDP Throughput Results . 26 5.21 Switch TCP Throughput Results . 27 5.22 Switch TCP(N) Throughput Results . 28 5.23 Switch RakNet Throughput Results . 28 5.24 Switch UDP Throughput Results . 29 5.25 Private wifi TCP Throughput Results . 30 5.26 Private wifi TCP(N) Throughput Results . 31 5.27 Private wifi RakNet Throughput Results . 31 5.28 Private wifi UDP Throughput Results . 32 5.29 Public wifi TCP Throughput Results . 33 5.30 Public wifi TCP(N) Throughput Results . 34 5.31 Public wifi RakNet Throughput Results . 34 iii Contents List of Figures iii 1 Introduction 1 1.1 Background . 1 1.2 Problem Description . 1 1.3 The Scope of the Thesis . 1 1.4 Research Question . 2 2 Previous Work 3 3 Theory 4 3.1 What impacts the problem . 4 3.2 Network Configuration . 4 3.3 Network Transport Protocols . 5 3.4 Packet Size . 6 4 Method 7 4.1 Method Description . 7 4.2 Execution . 8 4.3 Expected Results . 10 5 Result 11 5.1 Delay Results . 12 5.1.1 Ethernet . 12 5.1.2 Switch . 15 5.1.3 Private Wifi . 18 5.1.4 Public Wifi . 21 5.2 Throughput Results . 24 5.2.1 Ethernet . 24 5.2.2 Switch . 27 5.2.3 Private wifi . 30 5.2.4 Public Wifi . 33 6 Analysis 35 6.1 Packet Travel Time Test . 35 6.2 Throughput Test . 37 iv 7 Conclusion 39 7.1 Summary . 39 7.2 Future Work . 40 A Bachelor Networking 43 A.1 main.cpp . 43 A.2 NetworkService.h . 55 A.3 NetworkService.cpp . 56 A.4 NetworkData.h . 57 A.5 WinsocModule.h . 59 A.6 WinsocModule.cpp . 62 A.7 RakNetModule.h . 88 A.8 RakNetModule.cpp . 90 B Modified RakNet Big Packet Test 97 B.1 BigPacketTest.cpp . 97 C Hardware List and Network settings 106 D Literature study 108 v vi Chapter 1 Introduction 1.1 Background A common and popular feature for today's video games is the ability to play together with players from across the world. Being able to play the same game, at the same time, with friends or strangers is the main selling point of many games. The games that support this feature stretch from turned based strategy games[1][2] to a fast paced shooter[3][4]. To make the experience enjoyable for the players, the game has to always feel responsive even though the data might have to travel from one side of the planet and back again. Depending on the game, the requirements for transport time and reliability of the data will vary. This is why it is important for the developer of a games networking system to know what can be done to optimize the game's networking to best suit its requirements. 1.2 Problem Description There are many variables that determine the total time it takes for one packet of data to be sent from one system to another. Some of the variables can not be interacted with and are therefore constants, such as the time it takes the data to physically travel from one device to another. There are also other variables that can be changed and optimized to make the total travel time faster. Determining the best combination of these variables is the key to making an effective and fast communication system for video games. 1.3 The Scope of the Thesis For this paper, a literature study will be conducted using the "Snowball" method described by Claes Wohlin in his paper "Guidelines for Snowballing in Systematic Literature Studies and a Replication in Software Engineering"[5] to identify earlier works in the field that are relevant to this paper and the experiment. The results of the literature study can be found in Appendix D. The selected papers from the literature study will be further discussed in Chapter 2. After studying the results of the literature study, three independent variables have been iden- tified to impact the Packet Delay and will, therefore, be the main focus for the experiment. The three variables are Transport Protocol(TP), Packet Size, and Network Configuration. These 1 variables will be discussed in more detail in Chapter 3. This paper will use a comparative analysis to compare different real combinations of these variables. Each combination will vary its Transport Protocol, Packet size used and Network Configuration to identify any changes to its Packet Delay and Throughput. The research goal of this analysis is to identify which combination would be best suited for given network requirements based on Packet Delay and Throughput. In this paper, there will be two test scenarios, one that will measure the Packet Delay, and one that will test the Throughput of the implementation. The first scenario will have the combinations to only to send a single packet at a time and measure the one-way travel time of that packet. This is to determine the sending speed and potential differences in packet delay between Network Configurations. The second scenario will have the combinations send one gigabyte of data to measure the throughput of the combination. The experiment will be executed using a test bed where different combinations of the variables can be tested and data will be collected on Packet Delay, Bandwidth, Packet Loss, and CPU Work Load. More information will be provided in Chapter 4. Finally, the data will be presented in graphs in Chapter 5. The results will be analyzed in Chapter 6 and finally, a summarized answer to the research questions will be presented in Chapter 7. 1.4 Research Question To summarize; there will be two research questions that this paper will try to answer. 1. What is the impact of different combinations of transport protocols and packet sizes on the packet delay and bandwidth? 2. How does the network configuration impact on the packet delay? 2 Chapter 2 Previous Work In their book, \Performance Analysis of Computer Networks" [6], Matthew Sadiku and Sarhan Musa talk thoroughly about the techniques and performance measurements normally used to analyze network performance. They discuss the three performance evaluation techniques of a network, measurement, analytic modelling, and simulation and the pros and cons in different situations. They also describe the inner workings of different topologies for both LAN and WLAN which are the network configurations this paper will mainly focus on. The methods used in this paper will be based on the guidelines discussed in this book. In the paper \TCP and UDP Performance over Wireless LAN" [7], by George Xylomenos and George Polyzos, a similar experiment to the one in this paper is performed. By doing a real implementation of both TCP and UDP while varying the packet size and processing power, the authors try to identify how the performance of the system changes depending on the variables. The goal of the journal is to identify performance problems in realistic conditions for UDP and TCP but does not try to compare the protocols against each other to determine the optimal choice in the given scenario.