{"id":443,"date":"2009-08-18T03:13:49","date_gmt":"2009-08-18T07:13:49","guid":{"rendered":"http:\/\/www.rakkar.org\/blog\/?p=443"},"modified":"2009-08-18T03:13:49","modified_gmt":"2009-08-18T07:13:49","slug":"new-congestion-control-thanks-to-udt","status":"publish","type":"post","link":"https:\/\/rakkar.org\/blog\/index.php\/2009\/08\/18\/new-congestion-control-thanks-to-udt\/","title":{"rendered":"New congestion control thanks to UDT"},"content":{"rendered":"<p>\t\t\t\tA few years ago, a user in the forum stated that <a HREF=\"http:\/\/udt.sourceforge.net\/\">UDT<\/a> had much higher throughput than RakNet for LAN transfers. I took a look at it and it was made by a couple of research scientists for the purpose of being faster than TCP. While they <a HREF=\"http:\/\/udt.sourceforge.net\/doc.html\">published<\/a> details of their work, the documentation is extremely technical and academic. Anyway, I said at the time that <a HREF=\"http:\/\/www.rakkarsoft.com\">RakNet<\/a> was designed with different goals, and if all they wanted was high speed LAN transfer to use UDT instead.<\/p>\n<p>Since that time, I had ongoing problems with congestion control. Every 2-6 months I&#8217;d try a different approach with incremental improvements. But with the wide range of scenarios under which RakNet is used, there was always a new scenario where it didn&#8217;t work. So I basically gave up, and turned to UDT for help.<\/p>\n<p>My first approach was to directly integrate UDT into RakNet. I spent about a week removing all exceptions from the UDT source, changing to the RakNet memory allocator, and integrating RakNet to use UDT for sends and receives through RakNet&#8217;s own sockets. I had it working, but had problems where UDT didn&#8217;t connect as fast as RakNet. UDT also didn&#8217;t support priority levels or different sending types other than RELIABLE_ORDERED. I wasn&#8217;t happy about having another UDP library integrated into my core product just for one feature (congestion control). In the end, I released this an optional define flag. It&#8217;s present in version 3.62 though I left it disabled by default.<\/p>\n<p>At random, I saw an advertisement by one of the authors of UDT, Yunhong Gu, for paid contracting. Rather than have him code a solution, I had him write a <a HREF=\"http:\/\/www.jenkinssoftware.com\/raknet\/manual\/congestioncontrol.html\">technical design document<\/a> on how the UDT congestion control was implemented, so I could implement it myself.<\/p>\n<p><a HREF=\"http:\/\/raknetjenkinsso.svn.sourceforge.net\/viewvc\/raknetjenkinsso\/trunk\/Source\/CCRakNetUDT.cpp\">The result of my implementation<\/a><\/p>\n<p>Using <a HREF=\"http:\/\/en.wikipedia.org\/wiki\/DevPartner\">DevPartner performance analysis<\/a> I eliminated the top 20% CPU utilization from RakNet. I also <a HREF=\"http:\/\/www.jenkinssoftware.com\/raknet\/manual\/systemoverview.html\">reduced the bandwidth overhead<\/a>, even though more information is sent. In the end, I raised the file transfer rate on localhost from 2 to over 20 megabytes per second (I&#8217;ve seen it go as high as 40 on another computer). And the transfer rate to my remote server went up by 50%.<\/p>\n<p>I&#8217;m pretty happy with the end-result. This is probably the most significant improvement to RakNet I&#8217;ve made since it was developed. I&#8217;ll be releasing this as version 3.7 in the very near future.\t\t<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A few years ago, a user in the forum stated that UDT had much higher throughput than RakNet for LAN transfers. I took a look at it and it was made by a couple of research scientists for the purpose of being faster than TCP. While they published details of their work, the documentation is [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2],"tags":[],"_links":{"self":[{"href":"https:\/\/rakkar.org\/blog\/index.php\/wp-json\/wp\/v2\/posts\/443"}],"collection":[{"href":"https:\/\/rakkar.org\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rakkar.org\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rakkar.org\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/rakkar.org\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=443"}],"version-history":[{"count":0,"href":"https:\/\/rakkar.org\/blog\/index.php\/wp-json\/wp\/v2\/posts\/443\/revisions"}],"wp:attachment":[{"href":"https:\/\/rakkar.org\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=443"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rakkar.org\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=443"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rakkar.org\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=443"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}