Jump to content
  • Advertisement
Sign in to follow this  
beebs1

Multiple Connections or Multiplex?

This topic is 2567 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hiya,

Given two networked machines that needs to maintain around 500 'streams' of player data between them using IP/TCP - are there any advantages to multiplexing the streams into a single connection, instead of using a single connection per stream?

If I the sockets are opened using SO_REUSEADDR, I shouldn't run out of endpoints using multiple connections, given this number of players.

I'm guessing I'll get better throughput by multiplexing, as it will reduce the amount of TCP frame-header traffic and overhead.

Could anyone give their thoughts?

Thanks!

Share this post


Link to post
Share on other sites
Advertisement
Implementation could be a factor. Writing a demultiplexer that is thoroughly robust may not be as easy as just handling individual connections. Then again, depending on what you're doing with the data on those connections, it might be far easier. Hard to say for sure without knowing more details.


One distinct advantage to running multiple connections is it leaves you a lot more options for decentralization in the future, but again, without knowing what you're working on it's hard to judge if that's a pro or a con :-)

Share this post


Link to post
Share on other sites

Given two networked machines that needs to maintain around 500 'streams' of player data between them using IP/TCP - are there any advantages to multiplexing the streams into a single connection, instead of using a single connection per stream?


Yes: flow control over a congested network works better when there is only one active/high-throughput stream between the two machines.

This is why browsers opening 6 different connections to the same HTTP server for fetching images and CSS for a web page makes no sense -- you'll just force more buffer bloat and more oscillation in throughput.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!