Git Product home page Git Product logo

Comments (2)

zpostfacto avatar zpostfacto commented on May 17, 2024

The constants you refer to are the largest message sizes, not packet sizes. For the actual MTU (max UDP packet size): The relevant constant is k_cbSteamNetworkingSocketsMaxUDPMsgLen, which is currently 1300. Any messages passed to the API larger than about 1200 bytes will be fragmented into multiple UDP packets by the API. (The difference since we need to save some room for headers and such.) We would never try to send a 512KB UDP packet; there are practically no places on the Internet where that would work.

As for sending a 512KB message: it's really only reasonable for a reliable message, where there is retransmission in the event of individual segment loss. And that constant has to do with buffering really, not fragmentation and packet loss. For unreliable, the practical limit is much lower without forward error correction. (Say 5-20 MTU's?) or else the effective message delivery rate will plummet, as you mention.

We currently don't have a configurable MTU, and don't do MTU discovery. I am aware that it is a theoretical problem and that there might be some routers or network devices out there that cannot handle a UDP packet with a 1300-byte payload, and might either drop it or fragment it. But in practice, using this code on Dota and CS:GO basically all over the world, this hasn't posed a problem, so I don't think the set of users affected by this is large. I don't think it's worth the complexity to the interface to either allow customization (which then needs to be exposed to the user somehow) or to do the discovery/negotiation.

from gamenetworkingsockets.

Salty-Sailor avatar Salty-Sailor commented on May 17, 2024

Thank you for your reply. I'm sorry that I misunderstand the const value's meaning.
PS: I am trying to use this lib on a moblie phone game. In the past, the game's network layer used the TCP/IP protocol. Although we have done some optimizations on upper level, we still suffer from the jitter of the Internet.So I want to try some UDP based protocol. I have written a C#-style wrapper and hope to use this lib in our game.

from gamenetworkingsockets.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.