TCP MSS Issue


 
Thread Tools Search this Thread
Special Forums IP Networking TCP MSS Issue
# 1  
Old 01-06-2014
TCP MSS Issue

Gretings! I have developed simple utility using Berkly sockets interface:
So, what do I?
$ ifconfig lo mtu 1500
$ make
//run netcat
$ ./target 127.0.0.1 5555 1460 1000000 #mss: 1460, loop sleep: 1s
On other virtual terminal:
$ netcat -l 127.0.0.1 -p 5555
On third virtual terminal:
# tcpdump -i lo -n -t
Code:
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on lo, link-type EN10MB (Ethernet), capture size 65535 bytes
IP 127.0.0.1.54707 > 127.0.0.1.5555: Flags [S], seq 453033050, win 29200, options [mss 1460,sackOK,TS val 53605642 ecr 0,nop,wscale 7], length 0
IP 127.0.0.1.5555 > 127.0.0.1.54707: Flags [S.], seq 1575152534, ack 453033051, win 28960, options [mss 1460,sackOK,TS val 53605642 ecr 53605642,nop,wscale 7], length 0
IP 127.0.0.1.54707 > 127.0.0.1.5555: Flags [.], ack 1, win 229, options [nop,nop,TS val 53605642 ecr 53605642], length 0
IP 127.0.0.1.54707 > 127.0.0.1.5555: Flags [.], seq 1:4345, ack 1, win 229, options [nop,nop,TS val 53605642 ecr 53605642], length 4344
IP 127.0.0.1.5555 > 127.0.0.1.54707: Flags [.], ack 4345, win 295, options [nop,nop,TS val 53605642 ecr 53605642], length 0
IP 127.0.0.1.54707 > 127.0.0.1.5555: Flags [P.], seq 4345:4381, ack 1, win 229, options [nop,nop,TS val 53605642 ecr 53605642], length 36
IP 127.0.0.1.5555 > 127.0.0.1.54707: Flags [.], ack 4381, win 295, options [nop,nop,TS val 53605642 ecr 53605642], length 0
IP 127.0.0.1.54707 > 127.0.0.1.5555: Flags [.], seq 4381:8725, ack 1, win 229, options [nop,nop,TS val 53607142 ecr 53605642], length 4344
IP 127.0.0.1.5555 > 127.0.0.1.54707: Flags [.], ack 8725, win 346, options [nop,nop,TS val 53607142 ecr 53607142], length 0
IP 127.0.0.1.54707 > 127.0.0.1.5555: Flags [P.], seq 8725:8761, ack 1, win 229, options [nop,nop,TS val 53607142 ecr 53605642], length 36
IP 127.0.0.1.5555 > 127.0.0.1.54707: Flags [.], ack 8761, win 346, options [nop,nop,TS val 53607142 ecr 53607142], length 0
IP 127.0.0.1.54707 > 127.0.0.1.5555: Flags [.], seq 8761:13105, ack 1, win 229, options [nop,nop,TS val 53608642 ecr 53607142], length 4344
IP 127.0.0.1.5555 > 127.0.0.1.54707: Flags [.], ack 13105, win 346, options [nop,nop,TS val 53608642 ecr 53608642], length 0
IP 127.0.0.1.54707 > 127.0.0.1.5555: Flags [P.], seq 13105:13141, ack 1, win 229, options [nop,nop,TS val 53608642 ecr 53607142], length 36
IP 127.0.0.1.5555 > 127.0.0.1.54707: Flags [.], ack 13141, win 346, options [nop,nop,TS val 53608642 ecr 53608642], length 0
IP 127.0.0.1.54707 > 127.0.0.1.5555: Flags [F.], seq 13141, ack 1, win 229, options [nop,nop,TS val 53609460 ecr 53608642], length 0
IP 127.0.0.1.5555 > 127.0.0.1.54707: Flags [F.], seq 1, ack 13142, win 355, options [nop,nop,TS val 53609460 ecr 53609460], length 0
IP 127.0.0.1.54707 > 127.0.0.1.5555: Flags [.], ack 2, win 229, options [nop,nop,TS val 53609460 ecr 53609460], length 0

Question: Why TCP segment size has set to 1460, but tcp segments real size is: 4344 + 36 = 3*mss?

My OS: Linux 3.12.6-1-ARCH x86_64 GNU/Linux

Thanks in advance!

---------- Post updated 06-01-14 at 02:02 AM ---------- Previous update was 05-01-14 at 11:51 AM ----------

I have disable Generic\TCP Segmentation offload with
Code:
# ethtool -K lo gso off
# ethtool -K lo tso off

Solved!
# 2  
Old 01-07-2014
MSS is related to MTU. I wrote it up very nicely years ago, so look here (come bits are AIX, but much is general):
http://davidgpickett.home.comcast.net/~davidgpickett/tips/
especially:
http://davidgpickett.home.comcast.net/~davidgpickett/tips/tcp_tuning.970513.txt

More modern TCP packets have extended headers, so you get less than 1460 payload from 1500 MTU. The extended header can do buffers over 65K and swap timestamps for tuning. Sometimes a TCP header carries an MTU setting, at least at first.
Login or Register to Ask a Question

Previous Thread | Next Thread

6 More Discussions You Might Find Interesting

1. Solaris

Too much TCP retransmitted and TCP duplicate on server Oracle Solaris 10

I have problem with oracle solaris 10 running on oracle sparc T4-2 server. Os information: 5.10 Generic_150400-03 sun4v sparc sun4v Output from tcpstat.d script TCP bytes: out outRetrans in inDup inUnorder 6833763 7300 98884 0... (2 Replies)
Discussion started by: insatiable1610
2 Replies

2. IP Networking

Could a tcp issue be causing a null pointer exception?

The client's app gets a 'suspend error' which they say is due to a null pointer exception. Application people say nothing's wrong with the app. Network people say the network's fine. I'm supposed to see what's wrong with the system to be causing this error. I checked the NIC card settings, which... (1 Reply)
Discussion started by: pmichner
1 Replies

3. IP Networking

Tcp\ip

I have written a TCP/IP client and server program. The client sends a message to the server and then the server sends a file back to the client. The client reads the buffer and stores it another file in the client side. I need to know what are the various exceptions that I need to handle in... (0 Replies)
Discussion started by: Rajeshsu
0 Replies

4. Linux

Security issue with TCP SYN packets on Linux

Hi all, A security scanner has been done on a linux server and have found that The remote host does not discard RCP SYN packets which have the FIN flag set. It tells that I need to request a patch which I haven't found yet. I have Red Hat Linux release 7.0 (Guinness) Kernel 2.2.16-22... (2 Replies)
Discussion started by: bert.n
2 Replies

5. Programming

How to set the MSS programatically.

I'm sending a SYN packet and now I want to specify the MSS (The maximum segment size option in a TCP packet ) through it. How can I do that? Also, I'm not getting a SYN-ACK back from the remote host. TCPDUMP tells me that my packet is good and is a SYN. Then, why don't I get back the SYN-ACK? I... (0 Replies)
Discussion started by: zampya
0 Replies

6. Cybersecurity

Tcp/ip

!HELLO , What is the maximum number of hosts on a TCP/IP internet? plz can u help me. :rolleyes: (2 Replies)
Discussion started by: smdakram
2 Replies
Login or Register to Ask a Question