How to configure/reduce tcp segment size
I need to send data from my machine to a remote server over tcp and I need
the data to be fragmented (it's a test). That explains the reason I am
looking for a way to change the segment size to a small number.
I have googled around and I found that we can set MSS using iptables
iptables -A FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --set-mss
some-number
However, after more googling, it seems like that solution is used to tell
the server the TCP segment size that my machine can accept versus setting
the segment size on the tcp packets/segments that my machine is sending
over to the server.
I also learnt about MTU and how to change it, but that doesn't seem to be
what I want because I need/want to cut my data up in a higher level (in
the transport level). My questions are 1) how can I set MSS for TCP
segments that my machine is sending? 2) is it possible to do it using
Java?
Sorry for these newbie questions.
No comments:
Post a Comment