• [^] # Re: TCP

    Posté par . En réponse au message client serveur par socket en clientThread. Évalué à 1.

    La fragmentation au niveau du protocole IP c'est mal. En effet, si on fragmente un paquet IP, il n'y a pas de mécanisme de re-négociation, et donc il suffit de perdre un morceau du paquet pour se retrouver à renvoyer l'intégralité du paquet, ce qui n'est généralement pas une bonne idée.

    De plus, avec les NAT, ça devient marrant : « Reassembly is intended to happen in the receiving host but in practice it may be done by an intermediate router, for example, network address translation (NAT) may need to re-assemble fragments in order to translate data streams.[3] » (IP Fragmentation)

    Enfin, c'est vraiment pas très bien fait

    « In IPv4, hosts must make a best-effort attempt to reassemble fragmented IP datagrams with a total reassembled size of up to 576 bytes. They may also attempt to reassemble fragmented IP datagrams larger than 576 bytes, but they are also permitted to silently discard such larger datagrams. Applications are recommended to refrain from sending datagrams larger than 576 bytes unless they have prior knowledge that the remote host is capable of accepting or reassembling them »

    Du coup, bon, c'est bien gentil, mais autant passer par TCP, ou gérer son propre truc sur UDP, ce sera toujours mieux fait.