set MTU in C programmatically

前端 未结 4 614
温柔的废话
温柔的废话 2021-02-10 18:53

A client requested that the MTU limit should be 1492.

Is there a way to do it in the source code (program in C)?

Is there any other way to do it in general? (if

4条回答
  •  天命终不由人
    2021-02-10 19:34

    It's not about speed directly; By increasing MTU you're reducing overhead, which is data that is responsible for the proper delivery of the package but it's not usable by the end user; This can have a increase in speed but only for heavy traffic;

    Also, if you increase MTU, you're prone to increase the number of packets that are dropped (since you have a fixed bit error probability and more bits in a packet), eventually causing a decrease in performance with resent packets, etc... So it's a compromise between overhead and data integrity;

    I guess that it is more of a interface configuration than something you control with a program; So it's better to stick with 'ifconfig' command or find the equivalent solution for Windows.

提交回复
热议问题