Logo Background

Application Layer Gateway Service has encountered a problem and needs to close

  • When shutting down my computer a message appears saying “Application Layer Gateway Service has encountered a problem and needs to close”. How can I stop this message from appearing? The computer is running Windows XP.

    The Application Layer Gateway (ALG) Service is part of the Internet Connection Sharing (ICS) and Internet Connection Firewall (ICF) functions of Windows XP, and allows third party protocol plugins to be used with these services. In non-technical talk, this means that if you have a certain type of traffic (known as a protocol) transmitting requests onto the internet, then the ALG service realises that data will likely be coming back in response to your request and will make the necessary arrangements to ensure this received traffic goes to the correct application or computer. For example, if you are using an FTP program, the ALG service will listen for outbound FTP traffic and then create the necessary port (analogous to a hole allowing incoming data) to allow the incoming data, in response to your query, to go to the correct application or computer (much like a pipe going from the port/hole to the correct application or computer). As you can see, this is particularly useful when you are using Internet Connection Sharing to ensure that incoming data knows which computer it needs to go to. It is also required for some protocols using the Windows Firewall to ensure that the data ends up in the correct application.

    Some computers do not require the ALG service, and disabling this service could be one way to fix your problem. However, without seeing the exact configuration and usage of your computer I am unable to tell whether you actually need the ALG service running on your computer. However, I can say with a large degree of certainty that if you are running Internet Connection Sharing or the in-built Windows Firewall then you most likely need to keep the ALG service enabled. That said, we could always try disabling the service to see whether there are any side effects and whether this resolves the problem. Be aware, this may result in the internet becoming inaccessible on your computer. Should this occur do not panic, as we can re-enable the service to restore internet access. To disable the service, go to the “Start” menu > “Control Panel”. In the window that appears, open the “Administrative Tools” control panel (you may need to first click the “Performance and Maintenance” category). Open the “Services” applet. In the list of services, find “Application Layer Gateway Service” (this should be near the top) then right-click on the entry and select “Properties”. On the “General” tab for the “Startup type” select “Disabled” and click the “Stop” button. Click “Apply” and then OK. Once this has been done, restart the computer. Don’t be alarmed if the ALG error message appears when you restart the computer, as the service may still have elements which are resident in the background (which the restart should clear). Once the computer has started, check whether you can still access the internet without issue. Assuming this works alright, try shutting down or restarting the computer again. If the message does not appear, it seems that we may have resolved the problem. However, if you notice that anything does not work this could indicate that you do need to have the ALG process enabled. In this case, you should re-enable the process by returning to the Application Layer Gateway Service properties and setting the “Startup type” to “Automatic” and clicking the “Start” button.

    In the event that you find the internet does not work correctly after disabling this service, or the error message still appears, then clearly disabling this service is not going to help the situation. Before proceeding further we should undo what we have done, so make sure you revisit the ALG service properties and re-enable the service to start automatically and click the Start button. We can now move onto the next possible cause of the problem. There may be something wrong with the Winsock settings on your computer. Winsock stands for the Windows Sockets API, which allows programs on your computer (e.g. web browsers and FTP clients) to interface with the underlying networking sub-system (TCP/IP) which is used to communicate over networks, such as the internet. Since the ALG service works in conjunction with the Winsock service to a degree, if any of the Winsock settings have become corrupt this could cause the ALG service to also experience problems. As such, we could try to repair the Winsock settings in case there are any such corruptions. There is a very handy utility called WinSock XP Fix which can fix some of the more common WinSock related problems. Please note, that when undertaking non-standard system maintenance using non-official Microsoft tools there is always a chance that things could go bad and your system may end up in a worse state. The WinSock XP Fix utility is generally designed for situations where network connectivity problems are so severe that the user cannot access the network or internet at all on the computer. As such, the utility will perform a fair bit of black magic to repair and modify various WinSock settings. Therefore, there is potential that something more major could be broken resulting in your computer not being able to access any networks at all. As such, if you wish to use WinSock XP Fix to attempt to resolve this problem then you should backup all important data on your computer which you wish to keep, just in case things go bad and you need to complete a reinstall of Windows.

    Assuming you have a full backup of all your data, and wish to proceed with using WinSock XP Fix, you will need to download the utility from: www.snapfiles.com/get/winsockxpfix.html . Once downloaded, I suggest that you follow the very well written instructions at www.cit.cornell.edu/security/spyware/WinFix/ . In particular, once again, make sure you have backed-up any important data, and then the article also outlines how you can backup your network (TCP/IP) configuration, as this will also be reset by the WinSock XP Fix utility. In most cases, you will probably find that your TCP/IP configuration has been set to automatically obtain its settings (from a DHCP server), and there are no specific settings within the configuration. That’s alright, as that is the most common configuration to have on a Windows computer. In this case, simply note down which configuration options have been set to automatically obtain their configuration. Once this has been done, you can commence using WinSock XP Fix to resolve the problem. Section C of the instructions outlines the steps so that WinSock XP Fix will backup your registry before making any changes. This is a very important step, and adds another layer of protection should the changes made cause greater problems, as this will allow you to restore your previous settings. Finally, once the registry backup has completed follow the instructions in section D to reset the Winsock Stack and restart your computer, to check whether the problem has been fixed. Regardless of whether the problem has been fixed, you should check whether your network and internet still works correctly. Bearing in mind, if your network connection is not automatically configured using DHCP you will need to manually re-configure your network TCP/IP settings which you previously noted down.

    Should the problem continue after using WinSock XP Fix, then your next best option is to run the Windows XP System File Checker (SFC) utility. This will scan your Windows installation for missing or corrupt files, and replace these with known good copies from your original Windows CD. To run the SFC utility, go to the “Start” menu > “Run” and type “sfc /scannow” (without the quotes) and click OK. The SFC utility will immediately commence scanning your computer for any corrupt or missing files. You may be prompted for your Windows XP CD during this process, so you should have this CD handy. Once the SFC utility has finished operations it will exit silently with no user feedback. At this time you can restart your computer and check whether the problem persists.

    If the problem has not been resolved by running the SFC utility then I will need some additional information to help resolve the problem. When the error message appears on shutdown there should be a button labelled “Details” which provides a mini-dump of information regarding the error. Please click the “Details” button and email me the contained text, as this contains useful information about exactly in which module this error is occurring which may assist in diagnosing the problem.

Leave a Comment
Hi there. If this is the first time you are posting a comment it will not appear immediately, but needs to be approved. This is necessary in order to combat comment spam. However, once you have submitted a comment (which is subsequently approved) you do not need to go through this process again - the site remembers who you are and auto-approves your comments. Nifty eh? Anyway, sorry about the inconvenience that this may cause for your first comment post.