PRRT sockets come with a application layer MTU, that is specified at creation time (and defaults to 1500):
import prrt s = prrt.PrrtSocket(address=("0.0.0.0", 5000), mtu=1200)
If the application tries to send data that is bigger than this, the socket will raise a
PayloadTooBigException. If the application sends data that is smaller, PRRT maintains this length under the following conditions:
- The packet is send as a data packet and is successfully received.
- The packet is reconstructed by
In the "gap-preserving" receive mode, a gap of one MTU is returned by the socket. Hence, applications that send packets smaller than MTU and want gaps to be preserved, must add and remove padding on their own. PRRT has no knowledge about the original packet size and hence will assume a full MTU has been used.