Common Misconceptions Programmers Have About Local Area Networks
2 min read
Local area networks (LANs) are fundamental to modern computing, yet many programmers maintain misconceptions about how they operate. These falsehoods span several key areas, including Network Address Translation (NAT), network protocols, MAC addresses, reachability and performance, DHCP, and IP addressing.
Regarding NAT, programmers often assume their LAN is behind a single NAT or that having a private IP address (RFC 1918) guarantees NAT usage. However, NAT configurations can be more complex, and IPv6 hosts may also be behind NATs despite common beliefs. Additionally, NAT does more than just translate addresses or ports, and it can affect more than just packet headers. NAT is not exclusive to LAN environments.
In terms of protocols, some believe only IPv4 or IP-based protocols operate on their LANs. In reality, multiple protocols such as IPX/SPX, AppleTalk, and others may coexist. There is also a misconception that one can easily block certain traffic types or fully know all traffic on a LAN, which is often not the case.
MAC address assumptions include beliefs that they are globally unique and immutable. While MAC addresses are intended to be unique, duplicates and changes do occur. Their length and vendor-specific portions can vary, and not all MAC addresses are unicast. Furthermore, assumptions about ARP behavior, such as only one host responding to a request or ARP entries always being accurate, are not always reliable.
When it comes to reachability and performance, programmers may overestimate LAN speed or assume all devices on the same subnet can communicate directly without routing. The equivalence of Wi-Fi and Ethernet clients on a LAN is also misunderstood, as is the uniformity of MTU sizes and the reliability of hostname uniqueness or multicast DNS (mDNS) functionality.
DHCP-related misconceptions include the assumption that there is always a DHCP server, that only one exists, or that IP addresses assigned will remain static during use. The relationship between DHCP servers, gateways, and DNS servers is often oversimplified. Additionally, the presence of 169.254.0.0/16 addresses is commonly interpreted as DHCP failure, which may not always be accurate.
Finally, in IP addressing, it is often assumed each host has a single IP address and that LANs exclusively use private or RFC 1918 addresses. These assumptions do not always hold true, as hosts can have multiple addresses and LANs may use various IP schemes.
Understanding these nuances is crucial for network professionals and programmers alike, as it impacts network configuration, security, and troubleshooting efforts.