network notes

network structure example

the example

  1. a PC's Network Interface Card (NIC)
    • configuration parameters:
      • LAN stuff:
        • [NIC] IP address (the IP address the NIC will have on the network)
        • subnet mask (specifies which IP addresses are on the LAN and which aren't)
      • WAN stuff:
        • gateway [IP address] (the IP address of the machine used to get to stuff outside the LAN)
      • both:
        • DNS server [IP address] (the IP address of the machine which resolves names like to IP addresses like
    • configuration methods:
      • static (manually setting parameter values)
      • DHCP (letting PC discover parameter values)
  2. switch (connects LAN machines to each other)
    • if static configuration is used, a switch is all that's needed for a LAN
  3. gateway (machine on the LAN that's a 'gatekeeper' to the WAN)
  4. modem (kind of like a consumer-grade wired "router" that 'converts' ethernet to DOCSIS, DSL, cellular, etc. for access to the WAN)
  5. WAN

what are "routers"?

a consumer-grade "router" is usually a combination of the following:

LAN IP address ranges

source: Wikipedia: "Private network"

maximum wired network speeds

source: me using FTP to copy a file over a 100Mbit connection, then extrapolating for other speeds.
therefore, the observed ~10% overhead is due to a combination of: ethernet, IP, and FTP.
crappy rule of thumb: "divide megabits-per-second by 10 to get megabytes-per-second"

meta: how would I figure this all out on my own?

like [imperative] programming, we can try to figure out what steps are needed to reach our goal and how each step works:
  1. [for our own sake:] what's the simplest way you can connect to the Internet?
    • Wi-Fi: magic microwaves in the air. networks are only distinguished from each other by their name, encryption, and microwave frequency channel
    • wired: you plug one end of a cable into a network thing and the other end into your PC
    let's use wired
  2. you plug in a cable into a network thing, then plug the other end into your PC. what happens? your PC 'connects' to the wired network
    1. how does the PC connect? the PC uses DHCP
    2. what does DHCP do? it sets up your IP configuration
    3. what is IP? a protocol for computers to talk to each other
    4. what is an IP configuration? it's info that DHCP gives your PC
    5. what info does DHCP give your PC? (source)
      • a unique address for your PC to use on this network
      • a subnet mask that allows your PC and other machines to figure out what addresses are part of this network and what addresses are part of other networks
      • a unique address for the gateway
      • an address for a DNS server
    6. what is an address? it's a unique ID that a machine on this network has. think of it like your home address. it lets the network know what machine your PC is trying to communicate with
    7. what is a gateway? it's a middleman between this network and other networks (usually the "other networks" is the Internet)
    8. what is a DNS server? it's a machine that translates human-friendlier names like to addresses
  3. now that your PC is set up on this network, how can it talk to other machines on this network?
    1. it sends out messages to another machine's address
  4. how can it talk to other machines on other networks?
    1. if the destination address doesn't match the subnet mask, the PC sends the message to the gateway's address. the gateway then forwards the messages on to the other networks