Login Form

Donations

Amount Tooltip $10.00
$20.00
$30.00
$40.00
$
Sunday, 20th May 2012
11:43:32pm

How To Turn An Old Router Into A Wireless Bridge for your Xbox 360

You may some day encounter a situation in which you will require a wireless internet connection for a desktop computer. I also used this setup to get my Xbox 360 to hook up to my router and it works great. Perhaps you have decided to move your office from one room to another in your home. However, the new room does not have the cable or telephone connection you need to bring that computer online.

Before you go out and buy a wireless network card or attempt to run wire through your attic, you might be able to save yourself time and money if you have an old wireless router lying around. You may be able to upgrade your old router with a different firmware that will allow it to act as a wireless bridge. That is, turn your old router into wireless bridge. A wireless bridge allows you to connect one network to another over the airwaves, rather than having to run wire from one room to another.

 

wireless-bridge-diagram

The free firmware that makes this possible is called DD-WRT.  Before reading further, check the DD-WRT supported device list to see if your router is supported.  If it is supported, be sure to check out the notes for running DD-WRT on the supported device page. You’ll need to refer to the recommended installation method later.

Requirements

- Broadband internet connection.
- Two wireless routers:

  • One connected to your broadband internet connection to serve as the access point.
  • One connected to other machine(s) that need to connect to web. This one will need to support DD-WRT.

Initial Setup

 

 

1. Make sure your main internet router is working properly. Verify the wireless connection is working properly by connecting a laptop or some other device.

2. Set up the remote computer at the remote location.

3. Connect the remote computer to the router you will be installing DD-WRT onto. Just plug it into one of the ports on the hub (i.e. not the internet port or uplink port).

4. Open your browser and connect to the router’s web configuration page.

If you’re not sure what the address is, you may need to refer to the router’s manual. If the router is running DHCP, it is likely to be the address of the computer’s gateway. In Windows XP, go to the Control Panel and then Network Connections. There Double-click on your LAN connection and go to the Support tab. The default gateway will be listed there. You can also check it on CIRT.net along with other details such default username and password for the router.

Download DD-WRT

Now, you need to download the DD-WRT.

      1. Go to the

DD-WRT download page

      and Navigate to the

stable

      directory.

2. Navigate to the latest version (you can sort by date descending).

3. Navigate to the Consumer directory.

4. Navigate to the proper directory for your router’s manufacturer and then the model/version of the router. You should be able to find the model and version number printed somewhere on the router.

6. Download the .bin file of your choice.

The notes for running DD-WRT on the supported device list may mandate you use a specific version. If not, I recommend you select either the mini or the standard. If you want to know the differences between the different versions, check out the File Versions section of the What is DD-WRT? page of the DD-WRT wiki.

Install DD-WRT

If you downloaded DD-WRT from your main internet connection, you may need to copy it to a USB drive to install it on the remote router from the remote computer. The remaining instructions are to be run from the remote computer connected to the remote router where DD-WRT is to be installed.

Install DD-WRT according to the installation instructions on the wiki.  Use the installation method recommended for your device in the notes on the supported device page (if applicable).

Warning: It is possible to brick your router when you install the new firmware (i.e. render it useless).  Please take caution in reading the installation instructions carefully.  I recommend you install DD-WRT on an old router that you are currently not using, so that if something does go awry there is no major loss.

Configuring DD-WRT as a Client Bridge

1. Once you have DD-WRT installed, open your browser to http://192.168.1.1 and log into the router. In older versions of DD-WRT, the default username is

2. Next, click on the Wireless tab at the top.

3. Set the Wireless Mode to Client Bridge. Then click Apply.

4. Set the SSID to that of your main wireless router that is connected to the Internet.  In my case, my main wireless router SSID is sierra. Then click Apply.

 

step-1-client-bridge-apply

5. Click on the Wireless Security tab in the second row of tabs, and configure the router to match the security settings as your main router. In my case, my main wireless router has WPA security mode with TKIP shared key, so I set up DD-WRT to match it.

6. Click Apply.

 

step-2-wireless-security

7. Click the Setup (very first tab in the upper left) to configure the LAN settings.

8. Assign the router a Local IP Address on the same subnet as your main router, but give it a different address.  That means that all the numbers for the address will be the same as the main router except for the numbers in the fourth box.  For example, the address of my main router is 192.168.1.1 so I gave my DD-WRT router an IP of 192.168.1.2.

9. Set the Subnet Mask to 255.255.255.0.

10. Set the Gateway and Local DNS to the address of the main router.

 

step-3-lan-settings

11. Click Apply.

Your DD-WRT router should now allow you to connect your remote computer to your main internet router through the airwaves!  If you ever need to reconfigure the DD-WRT router, just be sure to remember the new IP address that you assigned in step number 8.  You could always use a nice label maker and slap it right onto the router.

 

Internet Tweaks For Broadband

Windows 7 / Vista / 2008 Tweaks

Tweaking Vista TCP/IP settings for broadband internet connections
2008.04.24 10:40 by Philip
Keywords: Vista, tweak, TCP/IP, Registry, TCP Window, CTCP, Chimney Offload, Compound TCP, auto-tunning, MTU, TCP 1323 Options, NetDMA, DefaultTTL, DNS, SynAttackProtect, QoS, Nagle, patch

Windows Vista introduces a number of new features to the TCP/IP stack, including CTCP, and TCP Window Auto-Tuning. This new implementation works much better by default than previous Windows versions with broadband internet connections, and is able to adjust the RWIN value on the fly, depending on the BDP (bandwidth-delay product). This, however, introduces some problems with older routers and restricts the user from tweaking some of the TCP/IP parameters. Still, there is always some room for improvement, and this article explains the known tweakable TCP/IP parameters.

To enter some of the commands below, you will need to run "elevated" command prompt. To do so, click the Start icon > Run > type: cmd , then click CTRL+SHIFT+ENTER. Alternatively, you can navigate to Start > All Programs > Accessories > right-click Command Prompt and choose "Run as Administrator".

Check the TCP/IP state

To check the current status of the Vista TCP/IP tweakable parameters, in elevated command prompt type the following command:

netsh int tcp show global

You will be presented with something like the following:

 

The settings, as well as their default and recommended state are explained below. The two most important tweakable parameters are "Auto-Tuning Level" and "Congestion Control Provider".

 

TCP Auto-Tuning

To turn off the default RWIN auto tuning behavior, (in elevated command prompt) type:

netsh int tcp set global autotuninglevel=disabled

The default auto-tuning level is "normal", and the possible settings for the above command are:

disabled: uses a fixed value for the tcp receive window. Limits it to 64KB (limited at 65535).
higlyrestricted: allows the receive window to grow beyond its default value, very conservatively
restricted: somewhat restricted growth of the tcp receive window beyond its default value
normal: default value, allows the receive window to grow to accommodate most conditions
experimental: allows the receive window to grow to accommodate extreme scenarios (not recommended, it can degrade performance in common scenarios, only intended for research purposes. It enables RWIN values of over 16 MB)

Our recommendation: normal  (unless you're experiencing problems).

If you're experiencing problems with your NAT router or SPI firewall, try the "restricted", "highlyrestricted", or even "disabled" state.

Notes:
- Reportedly, many home NAT routers with a SPI firewall may have problems with enabled tcp auto-tuning in it's "normal" state, resulting in slow speeds, packet loss, and general reduced network performance.
- auto-tuning also causes problems with older routers that do not support TCP Windows scaling. See
MSKB 935400 
- netsh set commands take effect immediately after executing, there is no need to reboot.
- sometimes when using "normal" mode and long lasting connections (p2p software / torrents), tcp windows can get very large and consume too much resources, if you're experiencing problems try a more conservative setting.

If you're experiencing problems with Auto-Tuning, see also:
MS KB 835400 - email issues
MS KB 934430 - network connectivity behind firewall problems
MS KB 940646 - 3G WWAN throughput issues
MS KB 929868 - web browsing issues
MS KB 932170 - slow network file transfer

 

Compound TCP - Improve throughput

The traditional slow-start and congestion avoidance algorithms in TCP help avoid network congestion by gradually increasing the TCP window at the beginning of transfers until the TCP Receive Window boundary is reached, or packet loss occurs. For broadband internet connections that combine high TCP Window with higher latency (high BDP), these algorithms do not increase the TCP windows fast enough to fully utilize the bandwidth of the connection.

Compound TCP (CTCP) is a newer method, available in Vista and Server 2008 (there is also a hotfix available for XP/2003). CTCP increases the TCP send window more aggressively for broadband connections (with large RWIN and BDP). CTCP attempts to maximize throughput by monitoring delay variations and packet loss. It also ensures that its behavior does not impact other TCP connections negatively.

By default, Vista has CTCP turned off, and Server 2008 turned on. Turning this option on can significantly increase throughput.

To enable CTCP, in elevated command prompt type:

netsh int tcp set global congestionprovider=ctcp

To disable CTCP:

netsh int tcp set global congestionprovider=none

Possible options are:  ctcp, none, default (restores the system default value).
Recommended setting: ctcp

It is better to use this newer generation CTCP congestion control algorithm for most broadband connections, we highly recommend it being turned on. 

 

ECN Capability

ECN (Explicit Congestion Notification) is a mechanism that provides routers with an alternate method of communicating network congestion. It is aimed to decrease retransmissions. In essence, ECN assumes that the cause of any packet loss is router congestion. It allows routers experiencing congestion to mark packets and allow clients to automatically lower their transfer rate to prevent further packet loss. ECN is disabled by default in Vista, as it is possible that it may cause problems with some older routers that do not support this feature.

To check whether your router supports ECN, you can use the Microsoft Internet Connectivity Evaluation Tool. The results will be displayed under "Traffic Congestion Test".

To enable ECN, in elevated command prompt type:

netsh int tcp set global ecncapability=enabled

Possible settings are: enabled, disabled, default (restores the state to the system default).
The default state is: disabled
Our recommendation: disabled

More information on ECN: Explicit Congestion Notification (ECN) for TCP/IP

 

RSS - Receive-side Scaling

The receive-side scaling setting enables parallelized processing of received packets on multiple processors, while avoiding packet reordering. It avoids packet reordering y separating packets into "flows", and using a single processor for processing all the packets for a given flow. Packets are separated into flows by computing a hash value based on specific fields in each packet, and the resulting hash values are used to select a processor for processing the flow. This approach ensures that all packets belonging to a given TCP connection will be queued to the same processor, in the same order that they were received by the network adapter.

To set RSS:

netsh int tcp set global rss=enabled

Possible rss settings are: disabled, enabled, default (restores rss state to the system default).
Default state is: enabled
Recommended: enabled (if you have 2 or more processor cores and a NIC that can handle RSS)

 

TCP Chimney Offload

TCP chimney offload enables Windows to offload all TCP processing for a connection to a network adapter. Offloads are initiated on a per-connection basis. Compared to task offload, TCP chimney offload further reduces networking-related CPU overhead, enabling better overall system performance by freeing up CPU time for other tasks.

To set TCP Chimney Offload:

netsh int tcp set global chimney=enabled

The possible states are: disabled, enabled, default (restores chimney offload state to the system default)
Default state: enabled
Recommended: enabled

 

Setting MTU

It is sometimes useful to view and set the MTU value for a specific network interface manually. To view a list of active network interfaces and their MTU values in Vista using netsh, open command prompt as administrator and execute the following command:

netsh interface ipv4 show subinterface

You will be presented with a list of interfaces, and their respective MTU values as follows:

 

Click to expand

To change the MTU value of a specific network card, type the following in command prompt:

netsh interface ipv4 set subinterface "network interface name" mtu=#### store=persistent

Where "network interface name" is your specific network adapter name as obtained above (or viewable under Network adapters), and mtu=#### is the desired MTU value.

For example, if the name of your network card is "Wireless Network Connection" and you'd like to set its MTU to 1500, you'd have to type:

netsh interface ipv4 set subinterface "Wireless Network Connection" mtu=1500 store=persistent

Note: The maximum MTU value is usually 1500, and up to 1492 for PPPoE connections.

 

Manually tuning Registry Parameters

Many of the registry keys tuning TCP/IP parameters from previous Windows versions no longer work in Vista and Server 2008. Below is a list of the few we've confirmed to still work. Note that for changes to these settings to take effect the computer needs to be rebooted. As always, a registry backup is recommended if making any changes, and some proficiency in using regedit is required.

In regedit (Start icon > Run > type: regedit  while logged in as administrator), you can navigate and edit the following keys.

MTU (Maximum Transmission Unit) - the maximum packet size.

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{...}\
MTU=1500 (DWORD, entry does not exist by default)

The {....} part of the above path is the unique identifier of your network adapter. You can recognize the correct adapter by looking at it's IP address, if obtaining IP automatically labeled by: DhcpIPAddress=192.168.x.x text value, for example.

We recommend leaving this at default, unless you want to lower it. Vista uses the largest possible packet size for the underlying network by default.

Note: In some test environments, the correct MTU entry may be offset by 8. The 8 offset seems to coincide with the size of the PPPoE overhead. Check the result with the TCP Analyzer.

 

TCP 1323 Options

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\
Tcp1323Opts=1 (DWORD, entry created automatically by Windows when you run the "netsh int tcp set global autotuninglvl=..." command, set to 0 by default).

Setting this seems to have no effect, since auto-tuning uses the TCP 1323 scale factor and changes it on the fly, disregarding this setting. Additional testing may be required to determine it's effect if auto-tuning is turned off. Setting it to 1 is best for broadband connections. 

 

NetDMA

NetDMA enables support for advanced direct memory access. In essence, it provides the ability to more efficiently move network data by minimizing CPU usage. NetDMA frees the CPU from handling memory data transfers between network card data buffers and application buffers by using a DMA engine.

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
EnableTCPA=1
  (DWORD, 1 to enable, 0 to disable NetDMA. Value not present by default in Vista)

Recommended setting is 1, a new DWORD value may need to be created if not already present in the registry.

 

DefaultTTL

TTL can be safely left alone in many cases. It is a limit to the time and number of hops/routers a packet will travel before being discarded. A number that's too small risks packets being discarded before reaching their destination. A number that's too large (over 128) will cause delay in when lost IP packets are discarded. 

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
DefaultTTL=64
  (DWORD, set to a decimal value between 32 and 128. Recommended: 64) 

 

TcpMaxDataRetransmissions

Determines how many times unacknowledged data (non-connect segment) is retransmitted before TCP aborts the connection. The retransmission timeout is doubled with each successive retransmission on a connection. It is reset when responses resume.

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
TCPMaxDataRetransmissions=7
  (DWORD, recommended: between 3 and 10, default registry value 255, default 5 in documentation)

 

SynAttackProtect

This undocumented setting provides protection against SYN denial of service (DoS) attacks. When enabled, connections timeout sooner if SYN attack is detected. When set at 1, TCPMaxDataRetransmissions can be lowered further.

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
SynAttackProtect=1
  (DWORD, recommended: 1, not present in registry by default)

  

Set DNS and Hosts Priority

As with previous versions of Windows, one can improve DNS and hostname resolution by increasing the priority of of related services, while keeping their order. This is explained in more defail in our Host Resolution article. Lower numbers mean higher process priority. The corresponding registry settings in Vista are as follows:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\ServiceProvider
LocalPriority=4
  (DWORD, recommended: 4, default: 499) - local names cache
HostsPriority=5  (DWORD, recommended: 5, default: 500) - the HOSTS file
DnsPriority=6  (DWORD, recommended: 6, default: 2000) - DNS
NetbtPriority=7  (DWORD, recommended: 7, default: 2001) - NetBT name resolution, including WINS

 

TcpTimedWaitDelay (port allocation)

Short lived (ephemeral) TCP/IP ports above 1024 are allocated as needed by the OS. The default Vista values have improved from previous Windows versions, and are usually sufficient under normal load. However, in some instances under heavy load it it may be necessary to adjust the settings below to tweak the availability of user ports requested by an application.

If the default limits are exceeded under heavy loads, the following error may be observed: "address in use: connect exception".  By default under Vista (when the values are not presend in the registry), the OS can allocate up to 16384 ephemeral ports above port 1024, and the OS waits for 120 seconds before reclaiming ports after an application closes the TCP connection. This is a considerable improvement over older Windows versions. However, if necessary, the following registry values can be added/edited:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
MaxUserPort=65535
(DWORD, not in the registry by default. Recommended: leave at default, or use a number above 16384 up to 65535 decimal as necessary) -  maximum number of ports to use. 1024 is automatically subtracted from entered value to allow for reserved ports under 1024. 
TcpTimedWaitDelay=30 (DWORD, 0xffffffff in registry by default. Recommended: 30 decimal, denoting 30 seconds) - time to wait before reclaiming ports, in seconds. Default time before reclaiming ports, if value is at 0xffffffff or not present in the registry is 120 seconds. Just reducing the delay is often sufficient without changing MaxUserPort, as it allows for reusing ports more efficiently.

Ephemeral ports can be checked and changed using netsh as well.

To query the current values, in command prompt, type:
netsh int ipv4 show dynamicportrange tcp (for UDP, use the same command, replacing only "tcp" with "udp" at the end)

To set both the starting, and max user port using netsh, in elevated command prompt run:
netsh int ipv4 set dynamicportrange protocol=tcp start=1025 num=64511 (start=NNN denoting the starting port, and num=NNN denoting the number of ports)

Notes:
By default, dynamic ports are allocated between ports 49152 and 65535 (for a total of 16384 ephemeral ports).
Using netsh allows to set both the starting port and port range. Editing the Registry allows for setting the port range, and the starting port is fixed at 1025. Deleting the MaxUserPort registry entry (or setting it to a value outside the allowed range) causes the OS to revert to using the default values.
Some system processes can install port filters to block certain port ranges. If ephemeral ports run into these filtered port ranges, TCP/IP applications will be unable to bind to any ports.

 

QoS Reserved Bandwidth

As with Windows XP, nework adapters have a "QoS Packet Scheduler" enabled by default, which reserves 20% of bandwidth by default for QoS applications that request priority traffic. Note this only has effect in the presence of running QoS applications that request priority traffic. Registry value is undocumented for the Vista version of Windows. To customize this setting, in the Windows Registry:

HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Psched
NonBestEffortLimit=0
(DWORD, not present in the registry by default. Recommended: 0 , possible values between 0 and 100) - indicates the percentage value of reserved bandwidth for QoS applications. Set to 0 to disable.

Notes: This tweak applies only to Windows versions that have Qos Packet Scheduler enabled. It will ONLY have effect in the presense of running QoS applications.

 

Gaming Tweak - Disable Nagle's algorithm

The tweak below allows for tweaking or disabling Nagle's alogrithm. Disabling "nagling" allows for very small packets to be transferred immediately without delay. Note that disabling Nagle's algorithm is only recommended for some games, and it may have negative impact on file transfers/throughput. The dafault state (Nagling enabled) improves performance by allowing several small packets to be combined together into a single, larger packet for more efficient transmission. While this improves overall performance and reduces TCP/IP overhead, it may briefly delay transmission of smaller packets. Keep in mind that disabling Nagle's algorithm may have some negative effect on file transfers, and can only help reduce delay in some games. To implement this tweak, in the registry editor (Start>Run>regedit) find:

This setting configures the maximum number of outstanding ACKs in Windows XP/2003/Vista/2008:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{NIC-id}
There will be multiple NIC interfaces listed there, for example: {1660430C-B14A-4AC2-8F83-B653E83E8297}. Find the correct one with your IP address listed. Under this {NIC-id} key, create a new DWORD value:
TcpAckFrequency=1 (DWORD value, 1=disable, 2=default, 2-n=send ACKs if outstanding ACKs before timed interval. Setting not present by default).

For gaming performance, recommended is 1 (disable). For pure throughput and data streaming, you can experiment with values over 2. If you try larger values, just make sure TcpAckFrequency*MTU is less than RWIN, since the sender may stop sending data if RWIN fills witout acknowledgement. 

Also, find the following key (if present):
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSMQ\Parameters
Add a new DWORD value:
TCPNoDelay=1 (DWORD value, 0 to enable Nagle's algorithm, 1 to disable, not present by default)

To configure the ACK interval timeout (only has effect if nagling is enabled), find the following key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{NIC-id}
TcpDelAckTicks=0  (DWORD value, default=2, 0=disable nagling, 1-6=100-600 ms). Note you can also set this to 1 to reduce the nagle effect from the default of 200ms without disabling it.

Notes:
Reportedly, the above gaming tweak (disabling nagle's algorithm) can reduce WoW (World of Warcraft) latency by almost half!
XP/2003 needs hotfix or SP2 for it to work (MS KB 815230)
Vista needs hotfix or SP1 for it to work (MS KB 935458)

 

SG Vista TCP/IP Patch - automatic optimization

For user convenience, we also provide a quick way to apply all optimal values as recommended above using our SG Vista TCP/IP Patch. It allows for tweaking all the above netsh settings and registry values in one simple step (with the exception of the "gaming tweak" section). The patch also provides for easily reverting the settings to their Windows default values. To apply, save to your desktop and run as administrator (right-click -> run as administrator). Click Y when prompted to apply settings.

   

See Also

Windows Vista tcpip.sys connection limit patch for Event ID 4226 - removing the limit on half-open TCP connections.

 

References

Windows Server 2008 Network Shell (Netsh) Technical Reference
Microsoft KB951037

RFC 2581
Wikipedia: Nagle's algorithm
Technet: TCPNoDelay
MS KB 311833
MS KB 328890
MS KB 321098
MS KB 321169