samedi 24 janvier 2015

TCP framing techniques

What is the proper way or technique in framing with TCP?


I have created a simple framer in my node.js server that frames each message as they come-in where the 1st byte is the packet size.


One problem though: What if a user purposely sends an invalid packet.


Something like:



0A 00 03 04 05


We can tell that this is a broken packet, 0A is the size but we can see that the actual size is only 05.


How can we prevent such attacks?


Aucun commentaire:

Enregistrer un commentaire