Deciding on what to do with a #packet
▻https://hackernoon.com/deciding-on-what-to-do-with-a-packet-d8c47412c61b?source=rss----3a8144ea
When one device wants to send a packet to another, it has two options:If the recipient is on the same subnet, it can send the packet directly to them, it just needs to workout what the recipients MAC address is.If the recipient is on another subnet it will pass the packet onto a device that can forward it to its destination.Option 1The first thing the sending device needs to workout is, is the recipient on the same subnet as me?To do this it uses the IP address and netmask that were defined when the interface was configured to workout the range of addresses that are on the same subnet as it.E.g.eth0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500 inet 10.0.0.7 netmask 255.255.255.0 broadcast 10.0.0.255 ether b8:27:eb:28:f5:e0 txqueuelen 1000 (Ethernet)Using one of (...)