Wednesday, September 05, 2007

Using winsock to send data using UDP protocol

I learned a lesson today, don't send big chunk of data with UDP. It will not be received properly.
I had to limit the size of data to 1471 bytes. Why, its due to MTU size, the UDP package will be defragmented.

Ethernet has a limit of about 1500 bytes per ethernet packet. This is called the MTU, Maximum Transmission Unit. I guess some space is needed for the UDP header, that why the biggest size possible to send was 1471 bytes of data.

The problem gets more complex, because an IP packet being sent across the internet may cross several types of hardware. That means an IP packet may be fragmented as it travels from source to destination.
The minimum hardware packet size on the path from source to destination is called the “path MTU”. Any packet larger than this will be fragmented.
IP packet fragmentation just means that the original IP packet will be broken up into two or more IP packets.
In TCP, these will just be re-assembled as normal.
UDP can do something similar. A big UDP packet can be fragmented into several IP packets. UDP makes no big attempts to reassemble, though. If one fragmented IP packet is dropped, the whole UDP packet is dropped.
Source: http://www.movesinstitute.org/~mcgredo/mv3500/lectures/Lecture13.ppt

MySQL to MariaDB

 Here is a good description how to migrate to MariaDb MySQL to MariaDb Example of how to dump data from MySQL port=3307: mysqldump --user=ro...