0
0
Computer-networksHow-ToBeginner ยท 3 min read

Types of Computer Networks: Overview and Examples

Computer networks are classified by size and purpose into types like LAN (Local Area Network), WAN (Wide Area Network), MAN (Metropolitan Area Network), and PAN (Personal Area Network). Each type connects devices over different distances and serves different needs.
๐Ÿ“

Syntax

Computer networks are categorized by their coverage area and typical use cases. The main types include:

  • LAN (Local Area Network): Connects devices in a small area like a home or office.
  • WAN (Wide Area Network): Covers large geographic areas, often connecting multiple LANs.
  • MAN (Metropolitan Area Network): Spans a city or campus, larger than LAN but smaller than WAN.
  • PAN (Personal Area Network): Very small network around a person, like Bluetooth devices.

These types define how networks are structured and how far they reach.

text
Network Types:
- LAN: Local Area Network
- WAN: Wide Area Network
- MAN: Metropolitan Area Network
- PAN: Personal Area Network
๐Ÿ’ป

Example

This example shows a simple scenario of different network types in use:

  • LAN: Your home Wi-Fi connecting your laptop and phone.
  • WAN: The internet connecting your home network to websites worldwide.
  • MAN: A university campus network connecting multiple buildings.
  • PAN: Bluetooth connection between your phone and wireless earbuds.
python
def describe_network_type(device):
    if device == 'home_wifi':
        return 'LAN: Connects devices in a small area like your home.'
    elif device == 'internet':
        return 'WAN: Connects networks over large distances worldwide.'
    elif device == 'campus_network':
        return 'MAN: Connects multiple buildings in a city or campus.'
    elif device == 'bluetooth':
        return 'PAN: Connects personal devices over short distances.'
    else:
        return 'Unknown network type.'

# Example usage
print(describe_network_type('home_wifi'))
print(describe_network_type('internet'))
print(describe_network_type('campus_network'))
print(describe_network_type('bluetooth'))
Output
LAN: Connects devices in a small area like your home. WAN: Connects networks over large distances worldwide. MAN: Connects multiple buildings in a city or campus. PAN: Connects personal devices over short distances.
โš ๏ธ

Common Pitfalls

People often confuse network types by their size or purpose. For example, thinking a Wi-Fi hotspot is a WAN when it is actually a LAN. Another mistake is mixing up MAN and WAN, since both cover large areas but differ in scale and ownership.

Also, assuming all networks use the internet is wrong; LANs and PANs can work without internet access.

python
def wrong_network_type():
    # Incorrect: Treating a home Wi-Fi as WAN
    network = 'home_wifi'
    if network == 'home_wifi':
        return 'WAN: Incorrect, this is actually a LAN.'


def correct_network_type():
    # Correct: Home Wi-Fi is LAN
    network = 'home_wifi'
    if network == 'home_wifi':
        return 'LAN: Correct, local network in a small area.'

print(wrong_network_type())
print(correct_network_type())
Output
WAN: Incorrect, this is actually a LAN. LAN: Correct, local network in a small area.
๐Ÿ“Š

Quick Reference

Network TypeCoverage AreaTypical UseExample
LANSmall area (home, office)Connects local devicesHome Wi-Fi
WANLarge area (countries, continents)Connects multiple LANsInternet
MANCity or campusConnects buildings in a cityUniversity network
PANVery short range (a few meters)Connects personal devicesBluetooth earbuds
โœ…

Key Takeaways

Computer networks are mainly classified by their size and coverage area.
LANs connect devices in small, local areas like homes or offices.
WANs cover large geographic areas and connect multiple LANs.
MANs serve medium-sized areas like cities or campuses.
PANs connect personal devices over very short distances.