Host Forwarding Decision

In a computer network, several wired optical and wireless devices are connected using an intermediate device, such as a LAN switch and/or a wireless access point. The intermediate device provides interconnections between local hosts on the local network. The IPv4 address determines the destination of the packet. The packet may be destined for a local host or a remote host. The IPv4 address and subnet mask combination of the source device compared to the IPv4 address and subnet mask of the destination device. The packet forwarding decision between the different hosts is the role of the network layer. A host can send a packet to the following:

Itself

A host can ping itself, sending a packet to a special IPv4 address, 127.0.0.1.  127.0.0.1, also known as a loopback address or loopback interface. Pinging the loopback interface tests the TCP/IP protocol stack on the host.

Local Host Forwarding

If the sending host and receiving host belong to the same network, they share the same “network address”. The hosts can complete a connection with each other and share information without the need for any supplementary devices. If a host is sending a packet to a device that is configured with the same IP network as the host device, the packet is simply forwarded out of the host interface, through the intermediate devices, and to the destination device directly.

Remote Host Forwarding

If the sending and receiving hosts do not belong to the same network, both are remote hosts for one another. For example, it is available for other homes, businesses, and the Internet. So they cannot share the same network address. We want our devices to connect beyond the local network in nearly all situations. Routers and routing are required when a source device sends a packet to a remote destination device. Routing is the process of identifying the best path to a destination. The router is connected to the local network, also referred to as the default gateway.