The TCP/UDP monitoring is a little more advanced than the simple ICMP echo that we saw in the previous section. In this, a connection is sent to a port on the network stack and checked to see whether the port is opened.
A network port is nothing more than a memory buffer associated with a number in the network stack. Once an application needs to listen for the network traffic, it makes a call to the operating system kernel, for a number and a memory location.
The kernel assigns the number and memory location and also makes the TCP/IP stack aware of it. Once someone sends a packet to that port, the TCP/IP stack traversing through various layers gets the segment and puts it on the memory location.
It then becomes the application's ...