2022 Developer Survey is open! Take survey.

Hot answers tagged

47 votes

How does a switch learn a switch table?

Layer 2 switches (bridges) have a MAC address table that contains a MAC address and physical port number. Switches follow this simple algorithm for forwarding frames: When a frame is received, the ...
user avatar
  • 62.1k
46 votes
Accepted

How does gratuitous ARP work?

Gratuitous ARP is a sort of "advance notification", it updates the ARP cache of other systems before they ask for it (no ARP request) or to update outdated information. When talking about ...
user avatar
28 votes
Accepted

Why do switches need ARP tables when the translation are done on the machines side?

This is a pretty common misconception or more specifically, a terminology problem. In a layer two switch, there is not an ARP table, only a forwarding table. The switch records each src MAC address ...
user avatar
22 votes
Accepted

How are IP addresses mapped to MAC addresses?

The mechanism is called Address Resolution Protocol (ARP). Every ethernet IPv4 device ARPs to resolve ethernet mac addresses for target IPs. IP to mac mappings are stored in each device's ARP table (...
user avatar
  • 1,924
22 votes
Accepted

Can a router send ARP requests to hosts?

ARP is used by a host on a LAN to resolve a layer-3 address to a layer-2 address so that a frame can be built for the LAN. A router is just another host on a LAN, and it will need to resolve layer-3 ...
user avatar
  • 92.9k
21 votes

Does every host on the LAN share the same ARP table, or do hosts keep them individually?

Actually, every interface in a device has its own ARP table. A host could have several ARP tables (one for each interface it has). ARP tables are not shared between hosts, or even among interfaces in ...
user avatar
  • 92.9k
20 votes
Accepted

Should ARP requests be VLAN tagged?

Whether the frame is ARP or not is irrelevent. Anything sent out a trunk port is tagged with the VLAN the frame is a member of: ARP is sent by the client, the client typically has no knowledge of ...
user avatar
  • 13.9k
19 votes

How does gratuitous ARP work?

A Gratuitous ARP is an ARP Response that was not prompted by an ARP Request. The Gratuitous ARP is sent as a broadcast frame, as a way for a node to announce or update its IP to MAC mapping to the ...
user avatar
  • 13.9k
17 votes

How does a host in one subnet know to forward the packet to the router MAC, when trying to send a packet to another subnet

The sending device uses the subnet mask to determine if the remote host is in it's local network or not. If the IP is within the subnet of the local machine, it uses ARP to determine the MAC address ...
user avatar
  • 2,229
15 votes

How are IP addresses mapped to MAC addresses?

Since the question was tagged with IPv6, I'll answer for that because IPv6 is very different from IPv4. To begin with, there is no such thing as ARPv6. The mapping between layer 2 and IPv6 addresses ...
user avatar
15 votes

Why do we need MAC Address if we can uniquely identify each machine with an IP Address

There is a historical reason for this, as @ronmaupin alludes to. In small networks, you don't need a layer 3 protocol. All the devices are directly addressable, so layer 2 addresses work fine. As ...
user avatar
  • 62.1k
12 votes
Accepted

Why is adapter ARPing something it already knows?

It's neighbor unreachability detection (NUD). The node makes sure that the gateway is still alive and reachable.
user avatar
12 votes
Accepted

USE of ICMP echo request in DHCP

An ICMP Echo request from the DHCP server to the IP address its about to allocate is used to determine if the IP address about to be assigned is already in use on the network. If a response is ...
user avatar
  • 661
11 votes
Accepted

ARP request unicast MAC?

In an attempt to refresh an expired, or expiring, ARP entry, many Client OS's will issue a "targeted" ARP query to the MAC address they already expect. Most of the time, this prompts a response from ...
user avatar
  • 13.9k
10 votes

ARP request outside of LAN; Target machine or router response?

Using your original diagram: When Computer A tries to communicate with Computer C, the following steps resolve Router 1's software-assigned address to its hardware-assigned media access control ...
user avatar
10 votes
Accepted

Find MAC address of a remote computer using IP

Getting a MAC address requires the ability to get broadcast traffic. ARP is a broadcast protocol and is therefore only available on a LAN. Once traffic is routed you are unable to get the MAC ...
user avatar
  • 387
10 votes

How will be the ARP Request (Unicast/Broadcast) if Subnet Mask is Unknown

A device NEVER knows the subnet mask of another device. A device knows its IP address and its own subnet mask and based on this information knows in which network it resides. When host A sends a ...
user avatar
  • 18.3k
10 votes
Accepted

Is there a way to capture only gratuitous ARP's using tcpdump?

In the usual tcpdump for Unix systems, only some fields are known by their name. Try specifying the opcode field by offset and size, and comparing with 2 ("reply") tcpdump -i eth99 arp and arp[6:2] =...
user avatar
  • 15.9k
9 votes

Why is adapter ARPing something it already knows?

Many devices will send these types of ARP requests after entries in the ARP table reach a "certain" age to refresh those entries. The reason they do this is so they can maintain valid ARP entries ...
user avatar
  • 26.7k
9 votes
Accepted

Won't GLBP confuse a switch's mac address-table?

GLBP doesn't use gratuituous ARP. When someone asks which MAC does the virtual IP have, the AVG will reply saying "This IP is at this MAC", using the field "Sender MAC Address", which is invisible to ...
user avatar
9 votes

What is first? ARP vs ICMP

Short Answer: The answer is that it depends. Longer Explanation: Naturally, when a device is sending out unicast IP traffic, it needs to add the layer 2 headers (including destination MAC address) to ...
user avatar
  • 26.7k
9 votes

Find MAC address of a remote computer using IP

No. MAC addresses only have significance on a LAN. Different LAN types have difference kinds of MAC addresses. Knowing the MAC address of a host on a different LAN is meaningless.
user avatar
  • 92.9k
9 votes

Does every host on the LAN share the same ARP table, or do hosts keep them individually?

To answer the question another way: what mechanisms might be available to share an ARP table? This is one of the fundamentals for IP over ethernet (and any similar layer 2 network). If a device was ...
user avatar
  • 15.9k
9 votes
Accepted

ARP Router issue

I think you are confused about ARP requests. ARP requests are sent from a source host to the broadcast address, and every host on the broadcast domain will inspect the request. Only the host with the ...
user avatar
  • 92.9k
8 votes
Accepted

malloc failures and ARP packed on a Cisco 2901

show arp comes back with 60,000+ entries. That would explain the memory consumption and poor performance but I'm not 100% sure as to why this is happening. When you configured ip route 0.0.0.0 0.0.0....
user avatar
8 votes
Accepted

Why do we need MAC Address if we can uniquely identify each machine with an IP Address

Don't confuse the network layers. Each layer has a specific purpose. Also, don't assume that there is only one protocol for each layer. Layer-2 has many protocols, some of which use MAC addresses, and ...
user avatar
  • 92.9k
8 votes
Accepted

When exactly is ARP protocol is used

Address Resolution Protocol (ARP) is used to resolve an IPv4 address (32 bit Logical Address) to the physical address (48 bit MAC Address). Network Applications at the Application Layer use IPv4 ...
user avatar
  • 390
8 votes

How does a host in one subnet know to forward the packet to the router MAC, when trying to send a packet to another subnet

To complement the other answers: The first thing a host (or router, which is just a host with multiple interfaces and packet forwarding between interfaces enabled) does is check its routing table. ...
user avatar
  • 643
7 votes

Why do switches need ARP tables when the translation are done on the machines side?

Every device utilizing the IP protocol has an ARP table. Since IP is an L3 protocol and requires an underlying L2 protocol, this is a requirement for a device to be able to translate an L3 IP address ...
user avatar
  • 26.7k
7 votes
Accepted

Why my computer is making this ARP requests to external (Gov) IP addresses?

169.254.0.0/16 is reserved for link-local addresses as per RFC 3927. Link-local address space is used when there is no authority for IP address control (DHCP or static configuration). Some device with ...
user avatar
  • 69.7k

Only top scored, non community-wiki answers of a minimum length are eligible