troubleshooting tcp/ip connection failure in my application - tcp

I am having a desktop application which can talk to a server application using TCP/IP. It was working all these days but now we ran into an issue. The log message in the server shows that the socket is disconnected after a while, but we are able to exchange heart beat messages. When i ran the WhireShark tool i am getting this log which i dont know how to interpret.
The other thing is when i run this application in the LAN where the server is running it just works fine.
Please help me to understand what is happening in the network.

It is difficult for me to see the trace details but it looks like .218 is the client trying to connect to .135? If so, 218's connection attempts (SYN) are being immediately rejected by 135 (RST). Normal 3-way TCP handshake should be SYN, SYN-ACK, ACK.
If the server is accepting requests from other hosts has some sort of firewall or the sort been setup to allow local LAN connections but disallow remote hosts?

Related

How can I check for specific remote address before accepting a TCP connection in Omnet++ with INET?

I'm currently having a problem with my module which uses TCP in Omnet++ with INET.
I have typical client-server scenario where a server is listening for clients. I'm trying to figure out how to have control over which remote IP is actually accepted.
Usually, if server is not listening for clients at all, following pattern can be observed:
Client -----[SYN]-----> Server
Client <---[RST+ACK]--- Server
I want to check Client's IP address in order to decide if the server should respond with [SYN+ACK] or [RST+ACK].
My module implements interface TcpSocket::ReceiveQueueBasedCallback and callback method, which is invoked as first, is socketAvailable which happens after SYN+ACK is already sent.
Is there any way to do this? I'm working with pretty much the newest version of INET.
Thanks in advance

How do I solve a WSAECONNRESET error?

I am using Perforce as part of a small development team. Everyone was able to connect to the P4V client except for one person who gets the following error:
TCP receive failed.
read: socket: WSAECONNRESET
We have deactivated his McAfee firewall and virus scan, but the error persists. I really don't know what to do with this error and it seems to be rather undocumented on the perforce website. From what I gather, it's because it's not a perforce-specific issue, but rather a TCP communication problem that might be caused by something else.
Any tips?
a TCP communication problem that might be caused by something else.
This is possible, or it's possible that whenever this user connects it causes some sort of server fault.
https://msdn.microsoft.com/en-us/library/ms740668.aspx
WSAECONNRESET 10054 Connection reset by peer.
An existing connection was forcibly closed by the remote host. This normally results if the peer application on the remote host is suddenly stopped, the host is rebooted, the host or remote network interface is disabled, or the remote host uses a hard close (see setsockopt for more information on the SO_LINGER option on the remote socket). This error may also result if a connection was broken due to keep-alive activity detecting a failure while one or more operations are in progress. Operations that were in progress fail with WSAENETRESET. Subsequent operations fail with WSAECONNRESET.
Beyond the usual connection troubleshooting questions (is this user on the same subnet? same version of the client software? same exact P4PORT setting? is the user able to connect via the command line client and if not does it give a more helpful error? why is this user unlike all other users?) I'd look at the server logs to see if it's logging any sort of more helpful error when this user tries to connect.

How to debug pending state of an HTTP request

My website works fine on my local machine. And it also works fine, when I publish it, and access it over the Internet.
However, when I access it through my company's network (LAN), many requests state in the pending state and they won't return back either successfully, or with error. No IIS logs, no nothing.
After like 5 minutes, the request simply dies. No HTTP response is shown in Chrome's console. I guess it's a network problem. But I don't know how to debug it.
How should I debug this pending state?
This is more a problem for sys-ops than for development but you might need to verify/prove the problem is with the routers and not with your server or computer configuration.
The first tool you need is network analyzer, for this look no further than Wireshark. You'll need administrator permissions on your machine.
Wireshark is intuitive, but has a lot of features, you might want to read a tutorial or two on how to use it.
With Wireshark on your machine you can verify a TCP connection to the server is made or attempted. If you don't know how TCP works, now is the time to learn.
Based on the result you should have your answer of where the problem is:
No TCP SYN sent or sent to wrong IP: problem in your machine. Make sure the server is not redirected to localhost/wrong ip in the hosts file and verify no static routes have been added to your routing table.
Most likely no TCP SYN-ACK: The problem is in the network routing, you might want to install Wireshark on the server and verify the SYN packets are indeed not getting through. Get your sys-ops guys to fix the problem. Probably a misconfigured firewall rule.
Very unlikely: TCP connection established and HTTP request sent to server, but server does not respond. No idea, if the server responds to internet traffic it should respond to your traffic.
By the way if there are no sys-ops guys in your company to fix the problem, get the model of any configurable router between your computer and the server and try asking in Server Fault (or get a consultant).

Connection refused - not consistent

I have an application that is used to make hotel bookings. The application takes an XML message, transforms the XML into another XML message and sends this new XML to another application. I am able to book hotels successfully.
When I try to amend this booking (different XML request, same application, same URL) I get a 'Connection refused' error.
I would have thought that there'd be consistency (all work or none) but there's not.
Anyone any idea why?
"Connection refused" means that no application is accepting connections on the port and host that you try to connect to. It can be caused by
The application is actually running on a different host or a different port
The application crashed and hasn't been restarted
The application is buggy: it closes the listening server socket from time to time, so that it is not listening for connection attempts all the time
Firewall is configured to respond to new connections with a "connection refused" even if the application was able to accept a connection

trouble hosting asp.net on iis

I'm doing some test hosting of an asp.net program I created
I can access it fine from the local machine (both debugging and pointing the virtual directory to it)
I can also access (local) by using the localhost or using the ip
however when i get on a different machine on the same network (i can ping my machine)
I get the following error:
Connection Interrupted
The connection to the server was reset while the page was loading.
The network link was interrupted while negotiating a connection. Please try again.
Does anyone have any idea what I'm doing wrong?
Crash893
EDIT:
I have duplicate this question on serverfault.com
I would generally take a snapshot of the network traffic with Wireshark (or other network sniffer) and see what is happening on the wire. Compare this to a site that works. Windows firewall, a browser proxy, or some other network software may be at fault.

Resources