11. Network layer tasks and protocols

11.3. Network layer testing

Every operating system implements programs that allow us to test the network layer. One of these is the PING programme (Windows), which is used to test connectivity between hosts. 

PING uses another network layer protocol, ICMP, to send an echo request datagram and wait for a response. When the response is received, it shows us the elapsed time between sending the request and receiving the feedback. PING can be used for testing:

·         the so-called local stack, i.e. to verify the correct installation of the IP protocol on the computer, it is sufficient to enter the PING command in the Windows console, using one of the feedback addresses, i.e. in the range 127.0.0.1 to 127.255.255.254:

·         a connection is established to a host on the local network, then instead of the loopback address, the address of the host on the local network is entered (e.g. 192.168.0.1):

·         connect to the host on the remote network. Here, if you want to check communication with the server where the page is stored, you can enter the domain name, i.e. facebook.com, instead of the IP address.

Sometimes we may not receive a response to an echo request sent by the PING programme, even if the remote network is working and communicating correctly. This is because some network administrators restrict or completely prevent the insertion of ICMP datagrams into their networks for security reasons.

Another part of network layer testing is to examine the routing of packets from the source host to the destination host. Thousands of routers operate in the wide area network, creating the Internet, connections between local networks spread across the globe.

To check which routers a packet is being sent through, e.g. from a computer to a web server, we will use TRACERT for Windows or TRACEROUTE for Linux. They work in exactly the same way and, similarly to PING, use the ICMP protocol and echo messages. To perform the test, type TRACERT in the console along with the address of the target host. This can be an IP address, or a domain address if you want to test routing to a specific host.