Networking

Overview

Computer networking is the practice of interfacing two or more computing devices to share resources and exchange data. It involves a combination of hardware (routers, switches, cables) and software (protocols, drivers) that allow devices to communicate across various distances, from a local area network (LAN) to the global internet.

Core Concepts

  • Network Topology: The physical or logical arrangement of a network.
    • Bus: All devices share a single communication line.
    • Star: All devices connect to a central hub or switch (most common in modern LANs).
    • Mesh: Every device is connected to every other device, providing high redundancy.
  • Addressing: How devices are identified on a network.
    • MAC Address: A unique physical identifier assigned to a network interface card (NIC).
    • IP Address: A logical address used for routing data across networks (IPv4 and IPv6).
  • Protocols: A standardized set of rules that determine how data is transmitted and received.
  • Network Types:
    • LAN (Local Area Network): Limited to a small geographic area (e.g., a home or office).
    • WAN (Wide Area Network): Covers a large geographic area (e.g., the Internet).
    • VPN (Virtual Private Network): An encrypted tunnel over a public network.

Key Components

  • NIC (Network Interface Card): The hardware that allows a device to connect to a network.
  • Switch: Connects devices within a single LAN and forwards data based on MAC addresses.
  • Router: Connects different networks together and forwards data based on IP addresses.
  • Firewall: A security system that monitors and controls incoming and outgoing network traffic.

Use Cases

  • Distributed Systems: Allowing multiple servers to work together as a single system.
  • Cloud Computing: Accessing remote resources over the internet.
  • IoT (Internet of Things): Connecting everyday objects to the network for remote monitoring and control.

Gotchas

  • Latency vs. Throughput: High throughput (large amount of data) doesn’t always mean low latency (fast response time).
  • Packet Loss: Data can be lost during transmission, requiring protocols like TCP to handle retransmissions.
  • Security: Networks are inherently open to attacks; encryption (TLS/SSL) and authentication are mandatory for sensitive data.

Related Notes