Method for determining maximum segment size

A method for determining a maximum segment size is disclosed. The method is used in an access point. The method includes: detecting a first MSS value between the access point and at least one device; setting a TCP MSS value of at least one TCP session established by the access point as a second MSS value; comparing the first MSS value with the second MSS value, and choosing a minimum value among the first MSS value and the second MSS value as a maximum value; and recording all the MSS values between the access point and the subsequent devices and the maximum value into a device MSS table.

CROSS REFERENCE TO RELATED APPLICATIONS

This Application claims priority of Taiwan Patent Application No. 103120301, filed on Jun. 12, 2014, the entirety of which is incorporated by reference herein.

BACKGROUND OF THE INVENTION

Field of the Invention

Aspects of the present invention relate generally to wireless communications systems, and more particularly, to methods for determining a maximum segment size (MSS) in a communications system.

Description of the Related Art

Third generation (3G) and fourth generation (4G) wireless networks, as specified by the 3rd Generation Partnership Project (3GPP), include wireless access networks in which different application services (e.g., data services, voice over IP (VoIP) content, video content, etc.). Transmission Control Protocol (TCP) defines size limits of packets transmitted over a network. The maximum transmission unit (MTU) defines the maximum size of a packet that can be transmitted. The TCP maximum segment size (MSS) defines the maximum number of data bytes in a packet.

Typically, user terminals at the end terminals do not know the MTU size and the MSS value that a network or a network segment in the TCP path can accommodate, and, therefore, the user terminal operating the system selects a predetermined value as the MTU size. However, the predetermined value may prevent the packet from passing through the wireless access network. When a packet is too large (e.g., the packet exceeds the MTU size and/or MSS value), network devices may discard the packet because the packet exceeds the predetermined value.

Therefore, there is a need for a method for determining a maximum segment size (MSS) to solve the problem of discarding the packet because the packet exceeds the MTU size and/or MSS value.

BRIEF SUMMARY OF THE INVENTION

Methods for determining a maximum segment size (MSS) are provided.

In one exemplary embodiment, the invention is directed to a method for determining a maximum segment size (MSS), comprising: detecting a first MSS value between the access point and at least one subsequent device; setting a transmission control protocol (TCP) MSS value of at least one TCP session established by the access point as a second MSS value; comparing the first MSS value with the second MSS value, and choosing a minimum value among the first MSS value and the second MSS value as a maximum MSS value; and recording all the MSS values between the access point and the subsequent devices and the maximum MSS value into a device MSS table.

In one exemplary embodiment, the invention is directed to a method for determining a maximum segment size (MSS). The method is used in wireless communication system, comprising: detecting a first MSS value between an access point and at least one subsequent device by the access point; setting a transmission control protocol (TCP) MSS value of at least one TCP session established by the access point as a second MSS value; comparing the first MSS value with the second MSS value by the access point, and choosing a minimum value among the first and the second MSS values as a maximum MSS value; and recording all the MSS values between the access point and the subsequent devices and the maximum MSS value into a device MSS table by the access point.

DETAILED DESCRIPTION OF THE INVENTION

Several exemplary embodiments of the present disclosure are described with reference toFIGS. 1 through 5, which generally relate to methods for determining a maximum segment size (MSS) in a communications system. It should be understood that the following disclosure provides various embodiments as examples for implementing different features of the present disclosure. Specific examples of components and arrangements are described in the following to simplify the present disclosure. These are, of course, merely examples and are not intended to be limiting. In addition, the present disclosure may repeat reference numerals and/or letters in the various examples. This repetition is for the purpose of simplicity and clarity and does not in itself dictate a relationship between the various described embodiments and/or configurations.

FIG. 1is a schematic diagram illustrating a wireless communications system100according to an exemplary embodiment of the present invention. The wireless communications system100at least includes a first user terminal110, a second user terminal112, a first remote device120, a second remote device122, and an access point130. The first user terminal110and a second user terminal112are connected to the first remote device120and the second remote device122, respectively, via the access point130in the Internet140.

It is worth noting that, although only one access point device is described in the embodiment ofFIG. 1, the technology in the invention can also be applied in any number and any type of access points existing in a peer-to-peer (P2P) network (e.g., the first user terminal110and the first remote device120). The access point device may be a router, a gateway or another device.

In addition, the first user terminal110and the second user terminal112may be an electronic device having a network connection capability For example, personal computers, notebooks, tablet PCs, smart terminal devices and other devices which can be connected to the wireless network. The first remote device120and the second remote device122can be a switch, a network service device or other equipment provided by the network or the telecommunication service provider. It should be noted that the number of user terminals and remote devices described above are not limited to the figures and the contents of the invention.

In one embodiment of the invention, the access point130may act to intercept transmission control protocol synchronize (TCP SYN) and/or transmission control protocol synchronize-acknowledge (TCP SYN-ACK) messages between the first user terminal110and the first remote device120and/or between the second user terminal112and the second remote device122when reading packets transmitted between the user terminals and the remote devices. The access point130may further inspect TCP headers in the TCP SYN and/or TCP SYN-ACK messages and adjust maximum segment size (MSS) values in the headers so that the packet can pass through the Internet. It should be noted that changes and updates made by the access point130may be transparent to the user terminals and the remote devices, such that optimal MSS values may be implemented with existing TCP protocols.

The following describes how the access point130decides a maximum MSS value. First, the access point130can detect a maximum MSS value between the access point130and at least one subsequent device in advance, wherein the subsequent device may be a wireless controller, a remote tunnel endpoint, a web server (for example, a dynamic host configuration protocol (DHCP) server, a domain name system (DNS) server, or a captive portal server) and other server apparatus, and the access point130sets the detection result as a first MSS value. It should be noted that the first MSS value corresponds to the subsequent device connected to the access point130individually. Therefore, the first MSS value may be a value, a plurality of values, or a classification belonging to the MSS. For example, the first MMS values may comprise MSS values between the access point130and at least one server or channel. In addition, the access point130may also record all TCP MSS values of TCP sessions established by the access point130in advance, so the access point sets a minimum TCP MSS value among all the TCP MSS values as a second MSS value, wherein the second MSS value also belongs to an MSS value about the TCP session. The access point130compares the first MSS value and the second MSS value, and selects the minimum value from the first MSS value and the second MSS value to determine an initial maximum MSS value.

In another embodiment, if the access point130has used a previous MSS value in advance, the access point130compares the previous MSS value and the maximum MSS value and then selects a greater MSS value between those values to update the maximum MSS value.

After determining the initial maximum MSS value, the access point130intercepts a first TCP SYN message which is transmitted to the first remote device120by the first user terminal110when receiving and reading the packets from the user terminal, wherein the first TCP SYN message has an MSS value of the first user terminal. Subsequently, the access point130determines the MSS value of the first user terminal and the initial maximum MSS value according to the header and other related packet information. When the maximum MSS value is less than the MSS value of the first user terminal, the access point130updates the MSS value of the first user terminal as the maximum MSS value, and transmits the first TCP SYN message which indicates that the MSS value of the first user terminal is the maximum MSS value to the first remote device120.

After receiving the first TCP SYN message, the first remote device120transmits a first TCP SYN-ACK message to the first user terminal110, wherein the first TCP SYN-ACK message has an MSS value of the first remote device. Similarly, the access point130intercepts the first TCP SYN-ACK message by reading the packet. Then, the access point130determines the MSS value of the first remote device and the maximum MSS value. When the maximum MSS value is less than the MSS value of the first remote device, the access point130updates the MSS value of the first remote device as the maximum MSS value, and transmits the first TCP SYN-ACK message to the first user terminal.

In another embodiment, the access point130may update the previous MSS value and the lowest TCP MSS values among all TCP sessions after reading and comparing the TCP/TCP SYN-ACK message, and stores all the MSS values into a device MSS table. The device MSS table can be a memory device or module installed in the access point130, such as a flash memory, or the device MSS table may also be other network device connected to the access point, which is not limited herein. The access point130further detects an optimal MSS value of the user terminal between the access point130and the user terminal by using an MSS detection threshold, and an optimal MSS value of the remote device between the access point130and the remote device. In other words, the access point130uses a predetermined MSS detection threshold as a standard, which can be used to compare the MSS value between the user terminal and the access point130, and between the remote device and the access point130. Then, the access point130determines whether the MSS values have reached an optimal value. When the optimal MSS value of the user terminal reaching the predetermined MSS detection threshold is greater than the previous MSS value, the access point130updates the previous MSS value as the optimal MSS value of the user terminal. When the optimal MSS value of the user terminal is less than the minimum MSS value, the access point130updates the minimum MSS value as the optimal MSS value of the user terminal. Similarly, when the optimal MSS value of the remote device reaching the predetermined MSS detection threshold is greater than the previous MSS value, the access point130updates the previous MSS value as the optimal MSS value of the remote device. When the optimal MSS value of the remote device is less than the minimum MSS value, the access point130updates the minimum MSS value as the optimal MSS value of the remote device. The efficiency of determining the maximum MSS value can be improved by using the MSS detection threshold in the present invention.

Turning toFIG. 2,FIG. 2shows an alternative simplified functional block diagram of a communication device200according to one embodiment of the invention. As shown inFIG. 2, the communication device200can be utilized for realizing the first user terminal110, the second user terminal112, the first remote device120, the second remote device122and the access point130inFIG. 1. The communication device200may include an input device202, an output device204, a control circuit206, a central processing unit (CPU)208, a memory210, a program code212, and a transceiver214. The control circuit206executes the program code212in the memory210through the CPU208, thereby controlling an operation of the communications device200. The communications device200can receive signals input by a user through the input device202, such as a keyboard or keypad, and can output images and sounds through the output device204, such as a monitor or speakers. The transceiver214is used to receive and transmit wireless signals, delivering received signals to the control circuit206, and wirelessly outputting signals generated by the control circuit206.

FIG. 3is a simplified block diagram of the program code212shown inFIG. 2in accordance with one embodiment of the invention. In this embodiment, the program code212includes an application layer300, a Layer 3 portion302, and a Layer 2 portion304, and is coupled to a Layer 1 portion306. The Layer 3 portion302generally performs radio resource control. The Layer 2 portion304generally performs link control. The Layer 1 portion306generally performs physical connections. In addition, the CPU208can execute the program code212to perform all of the above-described actions and steps or others described herein.

FIG. 4is a flow diagram400illustrating a method for determining a maximum segment size (MSS) according to the embodiment of the present invention. The method is used in an access point. In step S405, the access point detects a first MSS value between the access point and at least one subsequent device, and sets the detecting result as a first MSS value. In step S410, the access point establishes at least one transmission control protocol (TCP) session, and sets the lowest TCP MSS value among the TCP sessions as a second MSS value. Finally, in step S415, the access point compares the first MSS value with the second MSS value, and chooses a minimum value among the first and the second MSS values as a maximum MSS value. In one embodiment, when there is a previous MSS value stored in the access point, the access point compares the previous MSS value with the minimum value, and obtains a maximum value between the previous MSS value and the minimum value. After obtaining the maximum MSS value, the access point updates the maximum MSS value as the maximum value.

FIG. 5is a message flow500illustrating how the access point determining a maximum segment size (MSS) between the user terminal and the remote device according to the embodiment of the present invention.FIG. 5comprises a user terminal510, an access point512and a remote device514. In step S520, the user terminal510transmits a TCP SYN message to the remote device514, wherein the TCP SYN message has an MSS value of the user terminal. In step S525, the access point512intercepts the TCP SYN message, and detects an optimal MSS value of the user terminal by using an MSS detection threshold. The access point512further detects the MSS value between the access point512and at least one subsequent device, and compares the MSS value with a second MSS value among all the at least one established TCP session to obtain a minimum value among the MSS values. When there is a previous MSS value stored in the access point512, the access point512compares the previous MSS value with the minimum value, and obtains a maximum value between the previous MSS value and the minimum value to determine a maximum MSS value. Subsequent, the access point512compares the optimal MSS value of the user terminal with the minimum value. In step S530, when the maximum MSS value is less the optimal MSS value of the user terminal, the access point512updates the optimal MSS value of the user terminal as the maximum MSS value; otherwise, the access point512does not need to update the maximum MSS value. In step S535, the access point512updates the previous MSS value and the second MSS value according to the optimal MSS value of the user terminal. In step S540, the access point512transmits the TCP SYN message to the remote device514. In step S545, the remote device514obtains the maximum MSS value after receiving the TCP SYN message. Therefore, the MSS values of the TCP data transmitted from the remote device514to the user terminal510may not exceed the maximum MSS value.

Subsequent, in step S550, the remote device514transmits a TCP SYN-ACK message having an MSS value of the remote device to the user terminal510. In step S555, the access point intercepts the TCP SYN message and detects an optimal MSS value of the remote device of the remote device514by using an MSS detection threshold. The access point512further detects a first MSS value between the access point512and at least one subsequent device, and updates the maximum MSS value. Then, the access point512compares the optimal MSS value of the user terminal and the maximum MSS value. It should be noted that it is assumed that the maximum MSS value is less than the optimal MSS value of the remote device in this embodiment. Subsequent, in step S560, the access point512updates the optimal MSS value of the remote device as the maximum MSS value. In step S565, the access point512updates the previous MSS value and the second MSS value according to the optimal MSS value of the remote device. In step S570, the access point512transmits a TCP SYN-ACK message to the user terminal510. In step S575, the user terminal510obtains the maximum MSS value after receiving the TCP SYN-ACK message. Therefore, the MSS values of the TCP sessions transmitted from the user terminal510to the remote device514may not exceed the maximum MSS value.

As shown above, the access point automatically adjusts and updates the MSS values carried in the TCP SYN/TCP SYN-ACK messages by the method for determining an MSS value of the present invention. Therefore, it can not only avoid the inefficiencies caused by an MSS value that is set too low, but also avoid transmission errors caused by an MSS value that is set improperly.

Various aspects of the disclosure have been described above. It should be apparent that the teachings herein may be embodied in a wide variety of forms and that any specific structure, function, or both being disclosed herein is merely representative. Based on the teachings herein one skilled in the art should appreciate that an aspect disclosed herein may be implemented independently of any other aspects and that two or more of these aspects may be combined in various ways. For example, an apparatus may be implemented or a method may be practiced using any number of the aspects set forth herein.

It should be understood that any specific order or hierarchy of steps in any disclosed process is an example of a sample approach. It should be understood that the specific order or hierarchy of steps in the processes may be rearranged while remaining within the scope of the present disclosure. The accompanying method claims present elements of the various steps in a sample order, and are not meant to be limited to the specific order or hierarchy presented.