Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I turn on IPCOMP for a socket?

Tags:

linux

tcp

For reasons I can't go into, our system uses a very small MTU (128 bytes). These embedded devices are on a completely separate network so no internet access or interaction with other devices.

Obviously, TCP takes up 66 bytes per packet leaving not very much for payload.

After some googling, I came across IPCOMP which looks like it may help in reducing the amount of traffic on the network.

My question is how can I enable this? Is there a setsockopt, or do I need a special driver?

The only example I've seen is:

socket(PF_INET, SOCK_RAW, IPPROTO_COMP)

but this means I need to create the IP/TCP/payload manually.

Anyone have experience with this.

EDIT: Perhaps a better method would be to enable cslip or ppp on this connection. I can find tutorials on enabling PPP on a serial port (for dial-up modem), but nothing on enabling PPP on ethernet.
I've seen articles on PPPoE, but this seems to add MORE to the payload rather than reducing it.
Can anyone help with this?

like image 248
Neil Avatar asked Oct 21 '11 08:10

Neil


1 Answers

I've played around with IP xfrm in the past but I've never tried the comp option. If you want all outgoing traffic compressed, something like this would work.

ip xfrm policy add dev eth0 dir out tmpl proto comp
like image 115
Iyad K Avatar answered Sep 17 '22 15:09

Iyad K