set MTU in C programmatically

前端 未结 4 546
温柔的废话
温柔的废话 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

    The MTU is a number which defines the maximum transmission unit per packet. The bigger it is, the faster your data will be sent. Assuming you can send npackets/s of msize, if m grows, m*n grows too.

    I think your client wants that MTU because of its network equipment (maybe ethernet 802.3). Some equipment handel biggest frames size than others.

    You can use ifconfig with the option mtuto change its value: ifconfig eth0 mtu 1492.

提交回复
热议问题