Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the mystery and thinking caused by the value of MSS?

2025-04-12 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

What is the mystery and thinking caused by an MSS value? For this problem, this article introduces the corresponding analysis and solution in detail, hoping to help more small partners who want to solve this problem find a simpler and easier way.

Load Balancer is also present in many projects I've worked with, but I haven't encountered the MSS fault. Now for the fault just mentioned, I caught the package in my own experimental environment and tested it. I put forward my own two thoughts on this, only exchange.

Network environment topology:

172.29.141.150 for client address

172.29.141.100 is the real server address.

172.29.141.159 VIP address on Load Balancer

Load Balancer is deployed in bypass mode, but CLIENT NAT is not done (gateway is real gateway is not set on Load Balancer).

Access Flow:

1)172.29.141.150 Visit 172.29.141.100

2)Load Balancer completes three-way handshake with client

3) The Load Balancer device then initiates a connection to server 172.29.141.100

4) The server completes the three-way handshake with the Load Balancer device.

We found that the MSS values at both ends were 1440, there was no difference, and of course there was no fault mentioned by the original author.

Supplement: MSS is the maximum data fragment that TCP packets can transmit at a time. In order to achieve the best transmission performance TCP protocol in the establishment of the connection usually negotiate the MSS value of both parties, this value TCP protocol in the implementation of the MTU value is often replaced (need to subtract the IP packet header size of 20Bytes and TCP packet header 20Bytes), so often MSS is 1460. The two sides of the communication will determine the maximum MSS value for this connection according to the minimum MSS value provided by both parties.

Thinking 1: MTU impact on network devices

When two remote PCs are interconnected, their data needs to pass through many routers and various network media to reach the opposite end. The MTU of different media in the network is different, just like a long pipe, which is composed of pipes of different thicknesses (MTU is different). The maximum amount of water passing through this pipe is determined by the thinnest pipe in the middle. In network communication, because the MTU values occupied by network equipment provided by various network equipment manufacturers are different, the MSS value will be further reduced. If there are low-end routers in the network, you need to configure tcp mss values on both the intranet port and the external network port to keep the transmitted packet size uniform, so as to avoid normal communication due to the use of PPPoE or NAT applications that cannot fragment.

Note: NAT translation sometimes causes MTU values at both ends to be inconsistent.

MTU impact of server or system itself

The IP protocol at the network layer checks the size of each packet coming down from the upper layer protocol and decides whether to "fragment" it based on the size of the local MTU. The operating system will also automatically packetize data that does not meet the requirements according to the MTU value of the host before transmitting, so you can modify the MTU value of the corresponding host for these problems:

Windows modification method:

Open the registry and find the following location HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces There are multiple sub-entries under Interfaces, each sub-entry corresponds to a network card, determine the network card used by this machine to connect to the Internet, click the sub-entry on Interfaces to view the IPAddress entry in the key list. If the key value of IPAddress is the IP you are looking for, then this sub-entry is the network card you are looking for, and then enter this sub-entry. Press the right mouse button in the window on the right. Select New-> Double Byte Value, enter the name MTU and press Enter. Double-click "MTU" with the mouse, pop up the modification window and fill in the MTU value. Please set the radix to decimal before filling in. Once set up, you need to restart the machine to take effect.

How to modify Linux:

# ifconfig eth0 mtu number

where "number" is the MTU number. After the modification is complete, you can use the "ifconfig" command to view the results of the modification. To avoid having to modify it every time, we can modify it in the NIC configuration file:

# vi /etc/sysconfig/network-scripts/ifcfg-eth0

MTU=1000

Then save exit.

About an MSS value caused by the mystery and thinking is what kind of answer to the question shared here, I hope the above content can be of some help to everyone, if you still have a lot of doubts not solved, you can pay attention to the industry information channel to learn more related knowledge.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report