What is the optimal size of a UDP packet for maximum throughput?

后端 未结 9 2036
深忆病人
深忆病人 2020-12-13 00:31

I need to send packets from one host to another over a potentially lossy network. In order to minimize packet latency, I\'m not considering TCP/IP. But, I w

相关标签:
9条回答
  • 2020-12-13 00:57

    Uhh Jason, TCP does not use UDP. TCP uses IP, which is why you often see it referred to as TCP/IP. UDP also uses IP, so UDP is technically UDP/IP. The IP layer handles the transfer of data from end to end (across different networks), which is why it is called the Inter-networking Protocol. TCP and UDP handle the segmentation of the data itself. The lower layers such as Ethernet or PPP or whatever else you use handle computer-to-computer data transfer (that is, within a single network).

    0 讨论(0)
  • 2020-12-13 01:05

    The easiest workaround to find mtu in c# is to send udp packets with dontfragment flag set to true. if it throws an exception, try reduce the packet size. do this until there is no exception thrown. you can start with 1500 packet size.

    0 讨论(0)
  • 2020-12-13 01:05

    Even though the MTU at the switch is 1500, you can have situations (like tunneling through a VPN) that wrap a few extra headers around the packet- you may do better to reduce them slightly, and go at 1450 or so.

    Can you simulate the network and test performance with different packet sizes?

    0 讨论(0)
提交回复
热议问题