Local Area Network
This page provides introduction to Local Area Network.
Overview
It is a network contained with relatively small area. For example office network. Routers are used to connect LANs.
Media Access Control (MAC) Address
- Mac address is -byte (-bit) physical address assigned to device when it is made.
- It is also know as Burned-In-Address.
- It is globally unique.
- The first bytes are the OUI(organizationally unique identifier), which is assigned to the company making the device.
- The last bytes are unique to the device itself.
Ethernet LAN Switching
Let's say we have ethernet setup as shown in below diagram:
Now, suppose PC wants to send data to PC. The Ethernet frame will include the following MAC and IP addresses:
Source IP: 192.168.1.01
Destination IP: 192.168.1.03
Source MAC: 002F.B012.1001
Destination MAC: FFFF.FFFF.FFFF # This is broadcast MAC address
The destination MAC address is initially unknown because PC does not know PC's MAC address. However, since switches are layer devices that operate using MAC addresses, PC must first learn PC's MAC address.
ARP Process
To learn the MAC address, PC uses the Address Resolution Protocol (ARP). It sends an ARP request, and PC responds with an ARP reply. The ARP request is a broadcast message sent to all hosts on the network, while the ARP reply is a unicast message sent only to PC.
Below are the steps involved in ARP process:
-
PC sends an ARP request on its interface (G0/1), which is received by Switch .
-
Upon receiving the ARP request, Switch adds PC's MAC address to its MAC address table. This entry is called a dynamic MAC address because it is learned automatically.
-
Since the destination MAC address is a broadcast address (FFFF.FFFF.FFFF), Switch forwards the ARP request to all its network interfaces except the one on which it was received.
-
PC receives the ARP request but discards it since the destination IP does not match its own.
-
Switch receives the ARP request and adds PC's MAC address to its MAC address table.
-
Since the destination MAC address is a broadcast, Switch also forwards the ARP request to all its network interfaces except the one it came from.
-
PC discards the frame for the same reason as PC.
-
PC recognizes that the destination IP matches its own. It processes the ARP request and sends an ARP reply frame with the following details:
Source IP: 192.168.1.03
Destination IP: 192.168.1.01
Source MAC: 002F.B012.2001
Destination MAC: 002F.B012.1001
-
Switch receives the ARP reply, updates its MAC address table with PC's MAC address, and forwards the reply to Switch .
-
Switch forwards the ARP reply to PC since it knows that PC's MAC address is associated with the G0/1 interface.
-
PC receives the ARP reply and stores an entry for PC in its ARP table, associating PC's IP address with its MAC address.
-
PC can now use this information to send data directly to PC.