Most of the operation of a computer is about the routing of signals; there is necessarily large amounts of signaling going through inside the computer, but sometimes signals go outside of the computer also.
We will concern ourselves primarily with networking of computers at the interaction level; read the OSI networking model article on Wikipedia for more.
Daily life involves the use of domain names, e.g. wikipedia.org
;
these identify computers. The way the computer is identified is by a
network query to a Domain Name System server; it returns an Internet Protocol
address, typically in the form of a 32bit unsigned integer, called an
IPv4 address.
Exercise: show that every IPv4 can be represented by four 8bit unsigned integers, and that every 8bit unsigned integer is between 0 and 255.
Exercise: how many IPv4 addresses are there? Is it enough? Explain.
Exercise: use ping
in a terminal to resolve a domain name.
Copy-paste the command you used, and the result.
Read the IP address article on Wikipedia.
Two obvious insufficiencies in this explanation: first, how does the computer know the DNS server? Second, we have just traded a name for a number; but how does the number help to communicate with the destination?
The DNS server is assigned either manually by the computer itself, or else is automatically obtained by configuration on the network. Dynamic Host Configuration Protocol is a protocol whereby a computer newly joining a network can request both an IP address and a DNS server from someone on the network. (This also explains how your computer got its own IP address.)
The IP address itself is part of a worldwide hierarchical routing system: if the computer network is viewed as a tree, each node of the tree is responsible for some portion of the IP address space. When a signal is destined for an IP inside this space, the node knows who next to send it on to. If it is not inside this space, it passes it up to the next level. (This is a simplification; for a fuller picture, see the article on routing on Wikipedia.)
IP transmissions are broken into small packets; the packet size depends on the specific configuration of the network link and the protocol being used.
The Transmission Control Protocol (TCP) is an IP protocol which includes a series of messages used as a sort of quality control: it includes connection establishment, acknowledgement (so that the sender knows what has been received), retransmit (in case a packet is lost), and many others. Read the article on TCP on Wikipedia.
The User Datagram Prtocol (UDP) is an IP protocol is a connection-free "fire-and-forget" protocol; this removes much of the overhead of TCP, but at the cost of the quality control features. Read the article on UDP on Wikipedia.
The value of a network link is measured in several different ways: bandwidth, latency, and reliability.
The bandwidth is the amount of data per unit time which is able to flow; it is the "thickness" of the pipe; a typical network cable provides 1 gigabit per second, which is 125 megabytes per second.
The latency of a network link is how long a signal takes to traverse the link; it is the "length" of the pipe; the latency between a laptop and the wireless access point it is connected to is 3 milliseconds.
The reliability of a link is the percentage of transmissions which are successfully received; it is measured in percentage of "packets" which are lost.
Read: the 500-mile e-mail, a small portion of network lore.
Exercise: The Multipath TCP project aims to allow TCP packets to be split across multiple network links and reassembled at the destination. For example, if you were uploading a 100 megabyte file to a server from your phone, it would allow you to send 75 megabytes by WiFi and 25 megabytes by cellular automatically. How should the ratio be chosen if you want to minimise transmission time? Minimise cellular bandwidth use? Explain.
Exercise: UDP is popular for streaming media; explain why.
Exercise: Read the Wikipedia articles on multicast and anycast routing. Why is anycast good for content delivery networks, and why is multicast good for live-streaming? What are some other uses for these?