{"id":74,"date":"2018-07-25T13:12:03","date_gmt":"2018-07-25T09:12:03","guid":{"rendered":"http:\/\/kidds.co.za\/?p=74"},"modified":"2018-07-25T13:13:36","modified_gmt":"2018-07-25T09:13:36","slug":"address-resolution-protocols-arp","status":"publish","type":"post","link":"https:\/\/kidds.co.za\/index.php\/2018\/07\/25\/address-resolution-protocols-arp\/","title":{"rendered":"Address Resolution Protocols (ARP)"},"content":{"rendered":"<div id=\"mntl-sc-block_1-0\" class=\"comp mntl-sc-block mntl-sc-block-html\">\n<p>Address Resolution Protocols deal with the way local IP addresses are resolved between computers on a network.<\/p>\n<\/div>\n<div id=\"mntl-sc-block_1-0-1\" class=\"comp mntl-sc-block mntl-sc-block-adslot mntl-block\">\n<div id=\"mntl-block_4-0\" class=\"comp mntl-block\">\n<div id=\"billboard1-sticky-dynamic_1-0\" class=\"comp billboard1-sticky-dynamic billboard-sticky scads-to-load right-rail__item scads-stick-in-parent scads-ad-placed\" data-height=\"1050\">\n<div class=\"spacer\"><\/div>\n<\/div>\n<\/div>\n<\/div>\n<div id=\"mntl-sc-block_1-0-2\" class=\"comp mntl-sc-block mntl-sc-block-html\">\n<p>In its simplest form imagine you have a computer such as a laptop and you want to communicate with your Raspberry Pi which is both connected as part of your local broadband connection.<\/p>\n<\/div>\n<div id=\"mntl-sc-block_1-0-3\" class=\"comp mntl-sc-block mntl-sc-block-adslot mntl-block\"><\/div>\n<div id=\"mntl-sc-block_1-0-4\" class=\"comp mntl-sc-block mntl-sc-block-html\">\n<p>You can generally see if the Raspberry PI is available on the network by pinging it. As soon as you ping the Raspberry PI or attempt any other connection with the Raspberry PI you will be kicking off the need for address resolution. Think of it as a form of handshake.<\/p>\n<\/div>\n<div id=\"mntl-sc-block_1-0-5\" class=\"comp mntl-sc-block mntl-sc-block-adslot mntl-block\"><\/div>\n<div id=\"mntl-sc-block_1-0-6\" class=\"comp mntl-sc-block mntl-sc-block-html\">\n<p>The ARP compares the address and subnet masks of the host and the target computer. If these match then the address has effectively been resolved to the local network.<\/p>\n<\/div>\n<div id=\"mntl-sc-block_1-0-7\" class=\"comp mntl-sc-block mntl-sc-block-adslot mntl-block\"><\/div>\n<div id=\"mntl-sc-block_1-0-8\" class=\"comp mntl-sc-block mntl-sc-block-html\">\n<p>So how does this process actually work?<\/p>\n<\/div>\n<div id=\"mntl-sc-block_1-0-9\" class=\"comp mntl-sc-block mntl-sc-block-adslot mntl-block\"><\/div>\n<div id=\"mntl-sc-block_1-0-10\" class=\"comp mntl-sc-block mntl-sc-block-html\">\n<p>Your computer will have an ARP cache which is accessed first to try and resolve the address.<\/p>\n<\/div>\n<div id=\"mntl-sc-block_1-0-11\" class=\"comp mntl-sc-block mntl-sc-block-adslot mntl-block\"><\/div>\n<div id=\"mntl-sc-block_1-0-12\" class=\"comp mntl-sc-block mntl-sc-block-html\">\n<p>If the cache does not contain the information required to resolve the address then a request is sent to every machine on the network.<\/p>\n<\/div>\n<div id=\"mntl-sc-block_1-0-13\" class=\"comp mntl-sc-block mntl-sc-block-adslot mntl-block\"><\/div>\n<div id=\"mntl-sc-block_1-0-14\" class=\"comp mntl-sc-block mntl-sc-block-html\">\n<p>If a machine on the network doesn&#8217;t have the IP address being searched for then it will just ignore the request but if the machine has a match then it will add the information for the calling computer to its own ARP cache. It will then send a response back to the original calling computer.<\/p>\n<\/div>\n<div id=\"mntl-sc-block_1-0-15\" class=\"comp mntl-sc-block mntl-sc-block-adslot mntl-block\"><\/div>\n<div id=\"mntl-sc-block_1-0-16\" class=\"comp mntl-sc-block mntl-sc-block-html\">\n<p>Upon receiving confirmation of the target computer&#8217;s address the connection is made and so a ping or other network request can be processed.<\/p>\n<\/div>\n<div id=\"mntl-sc-block_1-0-17\" class=\"comp mntl-sc-block mntl-sc-block-adslot mntl-block\">\n<div id=\"mntl-block_5-0\" class=\"comp mntl-block\">\n<div id=\"billboard2-sticky_1-0\" class=\"comp billboard2-sticky billboard-sticky scads-to-load right-rail__item scads-stick-in-parent scads-ad-placed\" data-height=\"600\" data-parent=\"\">\n<div class=\"spacer\"><\/div>\n<\/div>\n<\/div>\n<\/div>\n<div id=\"mntl-sc-block_1-0-18\" class=\"comp mntl-sc-block mntl-sc-block-html\">\n<p>The actual information the source computer is seeking from the destination computer is its MAC Addresses or as it is sometimes termed the HW Address.<\/p>\n<\/div>\n<div id=\"mntl-sc-block_1-0-19\" class=\"comp mntl-sc-block mntl-sc-block-adslot mntl-block\"><\/div>\n<h3 id=\"mntl-sc-block_1-0-20\" class=\"comp mntl-sc-block mntl-sc-block-heading\">A Worked Example Using The Arp Command<\/h3>\n<div id=\"mntl-sc-block_1-0-21\" class=\"comp mntl-sc-block mntl-sc-block-html\">\n<p>To make this easier to understand you will need to have 2 computers attached to your network.<\/p>\n<\/div>\n<div id=\"mntl-sc-block_1-0-22\" class=\"comp mntl-sc-block mntl-sc-block-adslot mntl-block\"><\/div>\n<div id=\"mntl-sc-block_1-0-23\" class=\"comp mntl-sc-block mntl-sc-block-html\">\n<p>Make sure that both computers are switched on and are able to connect to the internet.<\/p>\n<\/div>\n<div id=\"mntl-sc-block_1-0-24\" class=\"comp mntl-sc-block mntl-sc-block-adslot mntl-block\">\n<div id=\"mntl-block_6-0\" class=\"comp mntl-block\">\n<div id=\"native-placeholder_2-0\" class=\"comp native-placeholder mntl-block\"><\/div>\n<\/div>\n<\/div>\n<div id=\"mntl-sc-block_1-0-25\" class=\"comp mntl-sc-block mntl-sc-block-html\">\n<p>Now open a terminal window and type in the following command:<\/p>\n<\/div>\n<div id=\"mntl-sc-block_1-0-26\" class=\"comp mntl-sc-block mntl-sc-block-adslot mntl-block\"><\/div>\n<div id=\"mntl-sc-block_1-0-27\" class=\"comp mntl-sc-block mntl-sc-block-html\">\n<p><code>arp<\/code><\/p>\n<\/div>\n<div id=\"mntl-sc-block_1-0-28\" class=\"comp mntl-sc-block mntl-sc-block-adslot mntl-block\"><\/div>\n<div id=\"mntl-sc-block_1-0-29\" class=\"comp mntl-sc-block mntl-sc-block-html\">\n<p>The information displayed is the information currently stored in your computer&#8217;s ARP cache.<\/p>\n<\/div>\n<div id=\"mntl-sc-block_1-0-30\" class=\"comp mntl-sc-block mntl-sc-block-adslot mntl-block\"><\/div>\n<div id=\"mntl-sc-block_1-0-31\" class=\"comp mntl-sc-block mntl-sc-block-html\">\n<p>The results may just show your machine, you\u00a0may see nothing at all or the results may include the other computer&#8217;s name if you have connected to it previously.<\/p>\n<\/div>\n<div id=\"mntl-sc-block_1-0-32\" class=\"comp mntl-sc-block mntl-sc-block-adslot mntl-block\"><\/div>\n<div id=\"mntl-sc-block_1-0-33\" class=\"comp mntl-sc-block mntl-sc-block-html\">\n<p>.The information provided by the arp command is as follows:<\/p>\n<\/div>\n<div id=\"mntl-sc-block_1-0-34\" class=\"comp mntl-sc-block mntl-sc-block-adslot mntl-block\"><\/div>\n<div id=\"mntl-sc-block_1-0-35\" class=\"comp mntl-sc-block mntl-sc-block-html\">\n<ul>\n<li>Address<\/li>\n<li>HW Type<\/li>\n<li>HW Address<\/li>\n<li>Flags<\/li>\n<li>Mask<\/li>\n<li>IFace<\/li>\n<\/ul>\n<\/div>\n<div id=\"mntl-sc-block_1-0-36\" class=\"comp mntl-sc-block mntl-sc-block-adslot mntl-block\">\n<div id=\"mntl-block_8-0\" class=\"comp mntl-block\">\n<div id=\"billboard3-sticky_2-0\" class=\"comp billboard3-sticky billboard-sticky scads-to-load right-rail__item scads-stick-in-parent scads-ad-placed\" data-height=\"600\" data-parent=\"\">\n<div class=\"spacer\"><\/div>\n<\/div>\n<\/div>\n<\/div>\n<div id=\"mntl-sc-block_1-0-37\" class=\"comp mntl-sc-block mntl-sc-block-html\">\n<p>If you have nothing displayed then don&#8217;t worry because this will change shortly. If you can see the other computer then you will likely see that the HW address is set to (incomplete).<\/p>\n<\/div>\n<div id=\"mntl-sc-block_1-0-38\" class=\"comp mntl-sc-block mntl-sc-block-adslot mntl-block\"><\/div>\n<div id=\"mntl-sc-block_1-0-39\" class=\"comp mntl-sc-block mntl-sc-block-html\">\n<p>You need to know the name of the computer that you are connecting to. In my case, I am connecting to my Raspberry PI zero.<\/p>\n<\/div>\n<div id=\"mntl-sc-block_1-0-40\" class=\"comp mntl-sc-block mntl-sc-block-adslot mntl-block\"><\/div>\n<div id=\"mntl-sc-block_1-0-41\" class=\"comp mntl-sc-block mntl-sc-block-html\">\n<p>Within the terminal run the following command replacing the words raspberrypizero with the name of the computer you are connecting to.<\/p>\n<\/div>\n<div id=\"mntl-sc-block_1-0-42\" class=\"comp mntl-sc-block mntl-sc-block-adslot mntl-block\"><\/div>\n<div id=\"mntl-sc-block_1-0-43\" class=\"comp mntl-sc-block mntl-sc-block-html\">\n<p><code>ping raspberrypizero<\/code><\/p>\n<\/div>\n<div id=\"mntl-sc-block_1-0-44\" class=\"comp mntl-sc-block mntl-sc-block-adslot mntl-block\">\n<div id=\"mntl-block_9-0\" class=\"comp mntl-block\"><\/div>\n<\/div>\n<div id=\"mntl-sc-block_1-0-45\" class=\"comp mntl-sc-block mntl-sc-block-html\">\n<p>What has happened is that the computer that you are using has looked in its ARP cache and realized it has no information or not enough information about the machine you are trying to ping. It has therefore sent out a request across the network asking all other machines on the network whether they are indeed the computer you are looking for.<\/p>\n<\/div>\n<div id=\"mntl-sc-block_1-0-46\" class=\"comp mntl-sc-block mntl-sc-block-adslot mntl-block\"><\/div>\n<div id=\"mntl-sc-block_1-0-47\" class=\"comp mntl-sc-block mntl-sc-block-html\">\n<p>Each computer on the network will look at the IP address and mask requested and all but the one that has that IP address will discard the request.<\/p>\n<\/div>\n<div id=\"mntl-sc-block_1-0-48\" class=\"comp mntl-sc-block mntl-sc-block-adslot mntl-block\"><\/div>\n<div id=\"mntl-sc-block_1-0-49\" class=\"comp mntl-sc-block mntl-sc-block-html\">\n<p>The computer that has the requested IP address and mask will shout out, &#8220;Hey that is me!!!!&#8221; and will send its HW\u00a0address back to the requesting computer. This will then get added to the ARP cache of the calling computer.<\/p>\n<\/div>\n<div id=\"mntl-sc-block_1-0-50\" class=\"comp mntl-sc-block mntl-sc-block-adslot mntl-block\"><\/div>\n<div id=\"mntl-sc-block_1-0-51\" class=\"comp mntl-sc-block mntl-sc-block-html\">\n<p>Don&#8217;t believe me? Run the arp command again.<\/p>\n<\/div>\n<div id=\"mntl-sc-block_1-0-52\" class=\"comp mntl-sc-block mntl-sc-block-adslot mntl-block\"><\/div>\n<div id=\"mntl-sc-block_1-0-53\" class=\"comp mntl-sc-block mntl-sc-block-html\">\n<p><code>arp<\/code><\/p>\n<\/div>\n<div id=\"mntl-sc-block_1-0-54\" class=\"comp mntl-sc-block mntl-sc-block-adslot mntl-block\"><\/div>\n<div id=\"mntl-sc-block_1-0-55\" class=\"comp mntl-sc-block mntl-sc-block-html\">\n<p>This time you should see the name of the computer you pinged and you will also see the HW address.<\/p>\n<\/div>\n<div id=\"mntl-sc-block_1-0-56\" class=\"comp mntl-sc-block mntl-sc-block-adslot mntl-block\">\n<div id=\"mntl-block_10-0\" class=\"comp mntl-block\"><\/div>\n<\/div>\n<h3 id=\"mntl-sc-block_1-0-57\" class=\"comp mntl-sc-block mntl-sc-block-heading\">Show The IP Addresses Instead Of The Computer&#8217;s Hostname<\/h3>\n<div id=\"mntl-sc-block_1-0-58\" class=\"comp mntl-sc-block mntl-sc-block-html\">\n<p>By default, the arp command will show the hostname of the items within the ARP cache but you can force it to display IP addresses using the following switch:<\/p>\n<\/div>\n<div id=\"mntl-sc-block_1-0-59\" class=\"comp mntl-sc-block mntl-sc-block-adslot mntl-block\"><\/div>\n<div id=\"mntl-sc-block_1-0-60\" class=\"comp mntl-sc-block mntl-sc-block-html\">\n<p><code>arp -n<\/code><\/p>\n<\/div>\n<div id=\"mntl-sc-block_1-0-61\" class=\"comp mntl-sc-block mntl-sc-block-adslot mntl-block\"><\/div>\n<div id=\"mntl-sc-block_1-0-62\" class=\"comp mntl-sc-block mntl-sc-block-html\">\n<p>Alternatively, you might wish to use the following switch which will display the output in a different way:<\/p>\n<\/div>\n<div id=\"mntl-sc-block_1-0-63\" class=\"comp mntl-sc-block mntl-sc-block-adslot mntl-block\"><\/div>\n<div id=\"mntl-sc-block_1-0-64\" class=\"comp mntl-sc-block mntl-sc-block-html\">\n<p><code>arp -a<\/code><\/p>\n<\/div>\n<div id=\"mntl-sc-block_1-0-65\" class=\"comp mntl-sc-block mntl-sc-block-adslot mntl-block\"><\/div>\n<div id=\"mntl-sc-block_1-0-66\" class=\"comp mntl-sc-block mntl-sc-block-html\">\n<p>The output from the above command will be something along the lines of this:<\/p>\n<\/div>\n<div id=\"mntl-sc-block_1-0-67\" class=\"comp mntl-sc-block mntl-sc-block-adslot mntl-block\"><\/div>\n<div id=\"mntl-sc-block_1-0-68\" class=\"comp mntl-sc-block mntl-sc-block-html\">\n<p><code>raspberrypi (172.16.15.254) at d4:ca:6d:0e:d6:19 [ether] on wlp2s0<\/code><\/p>\n<\/div>\n<div id=\"mntl-sc-block_1-0-69\" class=\"comp mntl-sc-block mntl-sc-block-adslot mntl-block\"><\/div>\n<div id=\"mntl-sc-block_1-0-70\" class=\"comp mntl-sc-block mntl-sc-block-html\">\n<p>This time you get the computer&#8217;s name, the IP address, the HW address, the HW type and the network.<\/p>\n<\/div>\n<div id=\"mntl-sc-block_1-0-71\" class=\"comp mntl-sc-block mntl-sc-block-adslot mntl-block\"><\/div>\n<h3 id=\"mntl-sc-block_1-0-72\" class=\"comp mntl-sc-block mntl-sc-block-heading\">How To Delete Entries From The ARP Cache<\/h3>\n<div id=\"mntl-sc-block_1-0-73\" class=\"comp mntl-sc-block mntl-sc-block-html\">\n<p>The ARP cache doesn&#8217;t hold on to its data for very long but if you are having issues connecting to a specific computer and you suspect it is because the address data held is incorrect you can delete an entry from the cache in the following way.<\/p>\n<\/div>\n<div id=\"mntl-sc-block_1-0-74\" class=\"comp mntl-sc-block mntl-sc-block-adslot mntl-block\">\n<div id=\"mntl-block_11-0\" class=\"comp mntl-block\"><\/div>\n<\/div>\n<div id=\"mntl-sc-block_1-0-75\" class=\"comp mntl-sc-block mntl-sc-block-html\">\n<p>First, run the arp command to get the HW address of the entry you wish to remove.<\/p>\n<\/div>\n<div id=\"mntl-sc-block_1-0-76\" class=\"comp mntl-sc-block mntl-sc-block-adslot mntl-block\"><\/div>\n<div id=\"mntl-sc-block_1-0-77\" class=\"comp mntl-sc-block mntl-sc-block-html\">\n<p>Now run the following command:<\/p>\n<\/div>\n<div id=\"mntl-sc-block_1-0-78\" class=\"comp mntl-sc-block mntl-sc-block-adslot mntl-block\"><\/div>\n<div id=\"mntl-sc-block_1-0-79\" class=\"comp mntl-sc-block mntl-sc-block-html\">\n<p><code>arp -d HWADDR<\/code><\/p>\n<\/div>\n<div id=\"mntl-sc-block_1-0-80\" class=\"comp mntl-sc-block mntl-sc-block-adslot mntl-block\"><\/div>\n<div id=\"mntl-sc-block_1-0-81\" class=\"comp mntl-sc-block mntl-sc-block-html\">\n<p>Replace HWADDR with the HW Address for the entry you wish to remove.<\/p>\n<\/div>\n<div id=\"mntl-sc-block_1-0-82\" class=\"comp mntl-sc-block mntl-sc-block-adslot mntl-block\"><\/div>\n<h3 id=\"mntl-sc-block_1-0-83\" class=\"comp mntl-sc-block mntl-sc-block-heading\">Summary<\/h3>\n<div id=\"mntl-sc-block_1-0-84\" class=\"comp mntl-sc-block mntl-sc-block-html\">\n<p>The arp command isn&#8217;t commonly used by your average computer user and will only be relevant to most people when troubleshooting network issues.<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Address Resolution Protocols deal with the way local IP addresses are resolved between computers on a network. In its simplest form imagine you have a computer such as a laptop and you want to communicate with your Raspberry Pi which is both connected as part of your local broadband connection. You can generally see if [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-74","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/kidds.co.za\/index.php\/wp-json\/wp\/v2\/posts\/74","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kidds.co.za\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kidds.co.za\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kidds.co.za\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kidds.co.za\/index.php\/wp-json\/wp\/v2\/comments?post=74"}],"version-history":[{"count":2,"href":"https:\/\/kidds.co.za\/index.php\/wp-json\/wp\/v2\/posts\/74\/revisions"}],"predecessor-version":[{"id":76,"href":"https:\/\/kidds.co.za\/index.php\/wp-json\/wp\/v2\/posts\/74\/revisions\/76"}],"wp:attachment":[{"href":"https:\/\/kidds.co.za\/index.php\/wp-json\/wp\/v2\/media?parent=74"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kidds.co.za\/index.php\/wp-json\/wp\/v2\/categories?post=74"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kidds.co.za\/index.php\/wp-json\/wp\/v2\/tags?post=74"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}