Discussion Locked

How to set Window size in Ethernet ?

0 helpful
14 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

We are a developer of encryption and are trying to find how to set the packetsize in the ethernet protocol. We believe that it is compareable to the window size value in TCP but is packets instead of bytes.

Any help will be appreciated and awarded acordingly.

14 replies

by dmiles

See the following sites for info
1)http://www.skyia.com/raspppoe-2k
2http://www.mikrotik.com/Documentation/manual_2.3/section

by trackhappy

Not a guru in this arena, but does that relate to the MTU? That can be set in the Windows registry.

by tjm101

We tried going into the registry and setting the MTU and the window size but didn't get the throughput we were looking for. We also went into the nic card and changed some settings with no favorable results there.

by shmaltz

OK. This is a tuough one.
I believe that the Ethernet Windows size and the TCP size is 2 different things. What OS are you using?
I will get back with the Info I have it printed out I just have to look it up.

by shmaltz

Here it is:
Windows size is the size of data TCP packets being received can be buffered on the local machine. The TCP receive window size is the amount of receive data (in bytes) that can be buffered at one time on a connection. The sending host can send only that amount of data before waiting for acknowledgments for data sent and window updates from the receiving host. Windows 2000 TCP/IP is designed to tune itself in most environments, and uses larger default window sizes than earlier versions.
Instead of using a hard-coded default receive window size, TCP adjusts to even increments of the maximum segment size (MSS) negotiated during connection setup. Matching the receive window to even increments of the MSS increases the percentage of full-sized TCP segments used during bulk data transmission. The receive window size defaults to a value calculated as follows:
The first connection request sent to a remote host advertises a receive window size of 16 kilobytes (KB) or 16,384 bytes.
Upon establishing the connection, the receive window size is rounded up to an integral multiple of the TCP maximum segment size (MSS) that was negotiated during connection setup.
If the rounded-up value is not at least four times the MSS, thenit is adjusted to 4 * MSS, with a maximum size of 64 KB, unless a window scaling option (RFC 1323) is in effect.
For Ethernet-based TCP connections, the window is normally set to 17,520 bytes, or 16 KB rounded up to twelve 1,460-byte segments. In previous versions of MS Windows NT TCP/IP, the Ethernet window used was 8,760 bytes, or six MSS-sized segments.
There are two methods for setting the receive window size to specific values:
The TcpWindowSize registry entry (HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interface\ ).
On a per-socket basis with the setsockopt( ) Windows Sockets function.

by shmaltz

MTU is the size on the Data Link layer whcih in our case is the Ethernet packet size.
Maximum Segment Size (MSS), is the size of the transmited TCP packet. When a connection is established, the two hosts involved exchange their TCP maximum segment size (MSS) values. The smaller of the two MSS values is used for the connection. Previously, the MSS for a host has been the MTU at the link layer minus 40 bytes for the IP and TCP headers. However, support for additional TCP options, such as timestamps, has increased the typical TCP and IP header to 52 or more bytes.
Maximum Transmission Unit (MTU)
The maximum frame size supported by a network technology such as Ethernet or Token Ring.
According to Micorosoft Windows 2000 Server Resource Kit you change the MTU value at the following registry key in Windows 2000 (I don't know about other versions, but I believe the same goes for NT):
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\Adapter_GUID
MSS and MTU work together in Windows 2000 (again I'm not sure about NT) the MSS is caluclated as above. Now if there is a problem on the path that a router cant take this size and the don't fragments flag (this a an IP datagram flag it's called the DF flag).Most routers will respond with ICMP Destination Unreachable-Fragmentation Needed message. Or it sends the above and DF Set message containing the MTU of the next hop. Or the following might happen:
The router discards the IP datagram without sending an ICMP Destination Unreachable-Fragmentation Needed and DF Set message. This type of router is known as a PMTU black hole.

by shmaltz

If the latest is the case:
To respond effectively to black hole routers, you must enable the Path MTUBH Detect feature of TCP/IP. Path MTUBH Detect recognizes repeated unacknowledged transmissions and responds by turning off the Don't Fragment bit.After a datagram is transmitted successfully, it reduces the maximum segment size and turns the Don't Fragment bit on again.
The Path MTUBH Detect feature is disabled by default, but you can enable it by adding the EnablePMTUBHDetect entry to the registry and setting its value to 1. EnablePMTUBHDetect is an optional entry that does not appear in the registry unless you add it. You must place it in:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip \Parameters.
A second registry entry, EnablePMTUDiscovery, also helps address the PMTU black hole router problem. This key is enabled by default. EnablePMTUDiscovery completely enables or disables the PMTU discovery mechanism.When PMTU discovery is disabled, a TCP Maximum Segment Size (MSS)of 536 bytes is used for all non-local destination addresses.

by shmaltz

Here is what you can do:
To set the Windows size (which is only the receive buffer):HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interface\

To set the MSS Size (which is the TCP datagram size):
1. Disalbe the EnablePMTUBHDetect registry key at: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip \Parameters (if it's not there then it is disabled).
2. Disable the EnablePMTUDiscovery registry key at the above location.
This will set the MSS size to 536 bytes.

by shmaltz

To change The MTU size (which is the size the the Data Link layer uses in our case Ethernet) change the following value:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\Adapter_GUID

by tjm101

NewYorker you did some home work here and even though it doesn't solve the problem I am going to award the points to you. Keep an eye open for when we reopen the question because we eventually will get back around to this problem and will needsome answers. Can I email your yahoo account with a heads up?

This discussion is closed to new replies.