Here are a few terms to get started:
An internet: A network of networks. On an internet, each host has an address of the form n/h
where n
is the network number and h
is the number of the host on network n
. As long as all of the networks in the internet have unique network numbers, combining the network number and host number will give unique global names. Therefore from the outside an internet looks like a single network!
You know what doesn’t work? Connecting one billion devices to each other directly. Just connecting 9 devices like that requires 36 bi-directional links; a billion devices would need 499,999,999,500,000,000 (half a quintillion):
If you try such a thing, you will fail, and an internet will just evolve:
An internet may start with a single, global ISP, then multiple ISPs will arise, then some regional ISPs, etc. Then big content providers might build content delivery networks, too.
Internets give us a bunch of advantages:
The field of computer networks is very large and has a few overlapping areas of study. One coarse breakdown of the field into topics is:
Area | Topics |
---|---|
Data Transmission | Hardware Physical media (e.g., wire, satellite, radio, infrared, optical fiber) Data rate, throughput, bandwith Carrier signals Modems How data is encoded and transmitted along links Channels and multiplexing Lots of fun physics and electrical engineering |
Packet Switching | Packet formats Packet flow within a network Routing between networks Dealing with loops and congestion Queueing Theory Lots of math |
Network Architecture | Intranetwork Topologies Internetwork Topologies Layers Protocols The 4-Layer, 5-layer, and 7-layer Models APIs for each layer Management and Governance Standards |
Network Applications | Well known apps, e.g., Email, DNS, FTP, Web Client-server vs. P2P applications Socket APIs Middleware Security Firewalls Performance |
It’s hard to study each section on its own; instead some interesting path through the topics should taken. The approach taken by Douglas Comer in the 5th edition of his popular book is:
Sections 2, 3, and 5 are of course augmented with case studies of these topics on the global Internet.
Before studying each topic in detail, we should get big-picture overviews of the most important conceptual topics that make networking and internetworking possible. These conceptual topics are:
In order to be understood by humans, complex systems must be designed in a hierarchical fashion, with clear separation of concerns between layers. Internets are complex. A commonly accepted approach to network design is the four layer model:
APPLICATION LAYER |
TRANSPORT LAYER |
NETWORK LAYER |
LINK LAYER |
Conceptually, each layer talks to the corresponding layer on the other host via some sort of protocol. Within a host, layers talk only to the layer just below or above. And they don’t care how any of the other layers are implemented; they use inter-layer APIs (e.g. the link library provides services that the network library invokes).
The layers are (yes I know they are “out of order”):
So let’s review:
For an Application on host A to send data to host B:
Other Layer Models
You are likely to come across a 5-layer model (that splits the link layer and renames a couple):5 Application 4 Transport 3 Internet 2 Network Interface 1 PhysicalA much older 7-layer model, called the OSI Reference Model, splits up the application layer to allow for connections and security (in the 4- and 5-layer models, these concerns are part of the apps):7 Application 6 Presentation (incl. encrypt/decrypt) 5 Session (incl. open/close connections) 4 Transport (segments, TCP, UDP) 3 Network (datagrams, packets, IP) 2 Data Link (frames) 1 Physical
Most computer networks are packet switched as opposed to circuit switched. Circuit switching gives you a dedicated, pre-routed, line between the two parties; packet switching breaks up the message into packets and routes them all indepdently throughout the network.
Each packet has a header and a body.
HEADER | BODY |
The body contains the data being sent. The header of course varies depending on the type of packet, but typical header items (these may or may not appear in all packet types) include:
Each packet type specifies the precise location of each value within the header. For example, an IP version 4 packet has the following specification:
Bits | Description |
---|---|
0..3 | Version: this is always 4 in IPv4 |
4..7 | IHL: Internet Header Length. The number of 32-bit words in the header. The minimum value is 5. The protocol allows a number of options (extra 32-bit words that go in the header), so if there were, say, two such options, the value would be 7. |
8..13 | DSCP: Differentiated Services Code Point (see RFC 3260) |
14..15 | ECN: Explicit Congestion Notification (see RFC 3168) |
16..31 | Total Packet Length: The total packet size (header + body) in bytes. Note the minimum is 20, because the smallest possible header is 20 bytes. Because this is a 16-bit field, the maximum value is 65536 bytes. |
32..47 | Identification |
48..50 | Flags |
51..63 | Fragment Offset |
64..71 | Time to Live |
72..79 | Protocol |
80..95 | Header Checksum |
96..127 | Source IP Address |
128..159 | Destination IP Address |
160..(160+oc*32-1) | Options |
(160+oc*32..) | Packet Body |
Woah! Too much, too soon!
Yes and no. Of course this doesn’t feel like the time to discss the intricate details of IP packets. We’re just in overview mode. However, it does help to see real, concrete examples. Focus for now on what’s in the packet, conceptually, not where exactly everything fits. Get a feel, too, for how the protocol designers allowed for customization of packets in the header.
Packet format documentation is rarely shown in tables, but rather laid out in a more compact form. like so:
0 0 | 0 1 | 0 2 | 0 3 | 0 4 | 0 5 | 0 6 | 0 7 | 0 8 | 0 9 | 1 0 | 1 1 | 1 2 | 1 3 | 1 4 | 1 5 | 1 6 | 1 7 | 1 8 | 1 9 | 2 0 | 2 1 | 2 2 | 2 3 | 2 4 | 2 5 | 2 6 | 2 7 | 2 8 | 2 9 | 3 0 | 3 1 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Version | IHL | DSCP | ECN | Total Length | |||||||||||||||||||||||||||
Identification | Flags | Fragment Offset | |||||||||||||||||||||||||||||
TTL | Protocol | Header Checksum | |||||||||||||||||||||||||||||
Source IP Address | |||||||||||||||||||||||||||||||
Destination IP Address | |||||||||||||||||||||||||||||||
Options (if IHL > 5) | |||||||||||||||||||||||||||||||
Body |
Here’s something really important, and very cool. Note how each layer’s packet gets encapsulated within the packet of the layer beneath it:
Routing refers to how the path from source to destination is computed. A routing algorithm determines this. Generally, the routing algorithm is responsible for helping to populate the routing table at each router.
We’ll oversimplify for now. Each router has a table mapping the destination network to the router it needs to foward the packet to.
Classwork: Let’s do a routing worksheet!
Will build (trivial, static) routing tables for each of the networks in the internet example at the top of these notes. I’ll start with the table for network 2:
Dest. Network Forward to 1 3 2 (local) 3 4 4 4 Create the other three tables. After you finished, we’ll discuss ways to simplify the table (since we can't actually list all of the destination networks in one table.)
Routing algorithms have to be adaptive. Routers accept packets and then forward them. Packets may come in faster than they can be sent out, so they are queued in the router’s packet buffer. If too many packets are stored in the queue, incoming packets may have to be dropped. A routing algorithm might then reroute certain traffic because of this.
Network engineers have to take performance into account. There are tons of ways performance can be affected. But there are little calculations you will want to be good at making. Let’s just do a single one for now.
A packet is P bits. The medium transmits R bits/second. The end-to-end delay introduced by the router, if it reads the whole packet into memory before sending it out, is:
So 2(P/R) + T.
That was just a trivial example, of course. A lot was rolled into that T.
Networks are shared resources and need to be convenient to use. Convenience is often at odds with security. The big security questions are: (1) How do you attack? (2) How do you defend? (3) How do you prevent attacks?
Some topics we will be considering:
In real life, networks have to be:
Analysis and troubleshooting is done with various tools:
These will be covered later in the course.
We’ve covered: