How to forcibly close a socket in TIME_WAIT?

Actually there is a way to kill a connection – killcx. They claim it works in any state of the connection (which I have not verified). You need to know the interface where communication happens though, it seems to assume eth0 by default. UPDATE: another solution is cutter which comes in some linux distros’ repositories.

What is the difference between Unix sockets and TCP/IP sockets?

A UNIX socket, AKA Unix Domain Socket, is an inter-process communication mechanism that allows bidirectional data exchange between processes running on the same machine. IP sockets (especially TCP/IP sockets) are a mechanism allowing communication between processes over the network. In some cases, you can use TCP/IP sockets to talk with processes running on the same … Read more

TCP/IP packets and datagrams

You are getting caught up in the details … packet and datagram are not exactly well defined terms. I also think that you are also looking at things backwards. In a conventional network: the link layer (e.g., 802.3 “Ethernet” or 802.11 “Wi-Fi”) presents frames to the network layer (e.g., IP, ICMP) The network layer assembles the frames into packets which are passed on to the next layer … Read more

What is duplicate ACK when does it occur?

I’m currently learning about TCP protocol and don’t understand what duplicate acknowledgement are when they will occur. Also doesn’t retransmission only happen when a ACK is not received from the receiver to the client? To work out a retransmission you have to add the round trip time (from 3 way handshake) by the safety margin? … Read more

What are examples of TCP and UDP in real life?

UDP: Anything where you don’t care too much if you get all data always Tunneling/VPN (lost packets are ok – the tunneled protocol takes care of it) Media streaming (lost frames are ok) Games that don’t care if you get every update Local broadcast mechanisms (same application running on different machines “discovering” each other) TCP: … Read more

UDP vs TCP, how much faster is it?

UDP is faster than TCP, and the simple reason is because its non-existent acknowledge packet (ACK) that permits a continuous packet stream, instead of TCP that acknowledges a set of packets, calculated by using the TCP window size and round-trip time (RTT). For more information, I recommend the simple, but very comprehensible Skullbox explanation (TCP … Read more

What is the reason and how to avoid the [FIN, ACK] , [RST] and [RST, ACK]

Here is a rough explanation of the concepts. [ACK] is the acknowledgement that the previously sent data packet was received. [FIN] is sent by a host when it wants to terminate the connection; the TCP protocol requires both endpoints to send the termination request (i.e. FIN). So, suppose host A sends a data packet to host B and then host B wants … Read more

MAMP “Apache couldn’t be started because port is in use.” AND “Can’t connect to local MySQL server through /tmp/mysql.sock

After restarting MAMP, I noticed the MySQL Server checkbox didn’t turn green as it usually does. I clicked ‘Start Servers’ again and got a message stating, “Apache couldn’t be started because port 8888 is in use by some other software.” Weird since I haven’t made any changes to the system or application, or installed any … Read more