Sponsored Content
Full Discussion: TCP MSS Issue
Special Forums IP Networking TCP MSS Issue Post 302882229 by denis4inet on Monday 6th of January 2014 02:02:03 AM
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!
 

6 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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
synos(1)							Mail Avenger 0.8.3							  synos(1)

NAME
synos - guess operating system from TCP SYN fingerprint SYNOPSIS
synos [--mtu mtu] [--db path] syn-fingerprint DESCRIPTION
synos takes a SYN fingerprint, in the format described for the CLIENT_SYNFP environment variable in the avenger(1) man page, and outputs a guess as to the type of the client operating system. synos makes use of the OpenBSD SYN fingerprint database (which is also repackaged with Mail Avenger). OPTIONS --mtu val Certain operating systems set the initial TCP window size based on the maximum transmission unit, or MTU, of the network. For such operating systems, synos usually checks the window size using both the client's MSS option plus 40 bytes (for TCP and IP headers), or a hard-coded MTU, which defaults to 1,500 bytes. If either value works, the fingerprint is considered to match the operating system. You can change the value 1,500 by specifying this option. A value of 0 tells synos to use only the value derived from the MSS option. --db file Specifies an alternate location for the SYN fingerprint database. FILES
/usr/local/share/pf.os Default location of SYN fingerprint database. SEE ALSO
avenger(1), asmtpd(8) The Mail Avenger home page: <http://www.mailavenger.org/>. The OpenBSD home page: <http://www.openbsd.org/>. BUGS
The operating system type is determined by heuristics that are not always reliable. Moreover, not all operating systems can be distinguished. The database may not even contain a client's particular operating system and version. It is not hard to fool synos deliberately by changing TCP socket options or injecting raw packets onto the network. AUTHOR
David Mazieres Mail Avenger 0.8.3 2012-04-05 synos(1)
All times are GMT -4. The time now is 02:54 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy