// Default max packet size (1500, minus allowance for IP, UDP, UMTP headers)
// (Also, make it a multiple of 4 bytes, just in case that matters.)
//static int s_max_packet_size = 1456; // from Live555 MultiFrameRTPSink.cpp RTP_PAYLOAD_MAX_SIZE
//static size_t s_max_packet_size = 576; // UNIX Network Programming by W. Richard Stevens
static int s_max_packet_size = 1434; // from VLC
根据我自己网络环境的测试结果,udp完全可以发送大于1500字节的数据。 使用iperf3信令如下: iperf3 -c xx.xx.xx.xx -p 40001 -u -l 60000 udp包长度为60000依然可以在公网上正常传输。如果s_max_packet_size=4000的话(exosip中默认的信令最大长度),可以提高发送效率。但是为什么要让s_max_packet_size等于1434?虽然大包会导致IP分片,但是为何不利用IP分片机制传输数据呢?
// Default max packet size (1500, minus allowance for IP, UDP, UMTP headers) // (Also, make it a multiple of 4 bytes, just in case that matters.) //static int s_max_packet_size = 1456; // from Live555 MultiFrameRTPSink.cpp RTP_PAYLOAD_MAX_SIZE //static size_t s_max_packet_size = 576; // UNIX Network Programming by W. Richard Stevens static int s_max_packet_size = 1434; // from VLC