Thanks to:
for the contents of these slides.
A host is a thing on a network; anything with an IP address. My house contains these hosts:
What is a network? Hosts connected by a single medium.
┌────────┐ ┌────────┐ │ │ │ │ │ laptop │····················│ NAS │ │ │ ethernet │ │ └────────┘ cable └────────┘
Media include cat-5, Wi-Fi, cable-tv cable, fiber-optics, infrared light, phone lines, power lines, short-wave radio, lasers, sub-space pulses, etc. Pick one! If you have more than one, you have several networks.
Singular: “medium”
Plural: “media”
A LAN is a Local Area Network; a small-scale network. I have two LANs in my house: wired & wireless.
LAN ≠ Ethernet!
What is a (lower-case “i”) internet(work)? It’s a collection of connected networks.
┌────────┐ ┌────────┐ ┌─────────┐ │ │ │ │ │ │ │ laptop │···········│ router │··············│ printer │ │ │ wi-fi │ │ ethernet │ │ └────────┘ └────────┘ └─────────┘
I have an internet at home (wi-fi + Ethernet).
What is the (upper-case “I”) Internet? It’s all the connected networks in the world. There are many internets, but only one Internet.
┌────────┐ ┌────────┐ ┌──────┐ │ │ │ │ │ │ │ laptop │···········│ router │··············│ eBay │ │ │ wi-fi │ │ Internet │ │ └────────┘ └────────┘ └──────┘
or, more simply:
┌────────┐ ┌──────┐ │ │ │ │ │ laptop │··············│ eBay │ │ │ Internet │ │ └────────┘ └──────┘
What is the (World-Wide-)Web? It’s a use of the Internet.
┌────────┐ ┌──────┐ │ laptop │··············│ eBay │ └────────┘ Internet └──────┘
Consider a web browser, on your laptop, connected to ebay.com.
The laptop and the web server are both end systems, or hosts.
End systems can also include printers, surveillance cameras, cell phones, and generally any device using the network to communicate.
End systems are located at the network edge and connected to the network using communication links.
┌────────┐ ┌──────┐ │ laptop │··············│ eBay │ └────────┘ Internet └──────┘
End systems may be classified as clients, servers, both, or neither.
Client vs. server depends on what programs the end system is running. A given host may be both. Most hosts are DNS clients.
┌─────────────────┐ ┌───────────────┐ ┌───────────────┐ │ ct320-1 │ lan1 │ router │ │ boise │ │ 192.168.110.101 │·······│ 192.168.110.1 │ ····│ 129.82.46.197 │ └─────────────────┘ : ├ ─ ─ ─ ─ ─ ─ ─ ┤ : └───────────────┘ ┌─────────────────┐ : │ acushla │ : ┌───────────────┐ │ ct320-2 │ : │ 129.82.47.50 │·······│ salem │ │ 192.168.110.102 │···· └───────────────┘ lan2 │ 129.82.46.233 │ └─────────────────┘ └───────────────┘
┌─────────────────┐ ┌───────────────┐ ┌───────────────┐ │ ct320-1 │ lan1 │ router │ │ boise │ │ 192.168.110.101 │·······│ 192.168.110.1 │ ····│ 129.82.46.197 │ └─────────────────┘ : ├ ─ ─ ─ ─ ─ ─ ─ ┤ : └───────────────┘ ┌─────────────────┐ : │ acushla │ : ┌───────────────┐ │ ct320-2 │ : │ 129.82.47.50 │·······│ salem │ │ 192.168.110.102 │···· └───────────────┘ lan2 │ 129.82.46.233 │ └─────────────────┘ └───────────────┘
┌─────────────────┐ ┌───────────────┐ ┌───────────────┐ │ ct320-1 │ lan1 │ router │ │ boise │ │ 192.168.110.101 │·······│ 192.168.110.1 │ ····│ 129.82.46.197 │ └─────────────────┘ : ├ ─ ─ ─ ─ ─ ─ ─ ┤ : └───────────────┘ ┌─────────────────┐ : │ acushla │ : ┌───────────────┐ │ ct320-2 │ : │ 129.82.47.50 │·······│ salem │ │ 192.168.110.102 │···· └───────────────┘ lan2 │ 129.82.46.233 │ └─────────────────┘ └───────────────┘
┌─────────────────┐ ┌───────────────┐ ┌───────────────┐ │ ct320-1 │ lan1 │ router │ │ boise │ │ 192.168.110.101 │·······│ 192.168.110.1 │ ····│ 129.82.46.197 │ └─────────────────┘ : ├ ─ ─ ─ ─ ─ ─ ─ ┤ : └───────────────┘ ┌─────────────────┐ : │ acushla │ : ┌───────────────┐ │ ct320-2 │ : │ 129.82.47.50 │·······│ salem │ │ 192.168.110.102 │···· └───────────────┘ lan2 │ 129.82.46.233 │ └─────────────────┘ └───────────────┘
┌─────────────────┐ ┌───────────────┐ ┌───────────────┐ │ ct320-1 │ lan1 │ router │ │ boise │ │ 192.168.110.101 │·······│ 192.168.110.1 │ ····│ 129.82.46.197 │ └─────────────────┘ : ├ ─ ─ ─ ─ ─ ─ ─ ┤ : └───────────────┘ ┌─────────────────┐ : │ acushla │ : ┌───────────────┐ │ ct320-2 │ : │ 129.82.47.50 │·······│ salem │ │ 192.168.110.102 │···· └───────────────┘ lan2 │ 129.82.46.233 │ └─────────────────┘ └───────────────┘
┌─────────────────┐ ┌───────────────┐ ┌───────────────┐ │ ct320-1 │ lan1 │ router │ │ boise │ │ 192.168.110.101 │·······│ 192.168.110.1 │ ····│ 129.82.46.197 │ └─────────────────┘ : ├ ─ ─ ─ ─ ─ ─ ─ ┤ : └───────────────┘ ┌─────────────────┐ : │ acushla │ : ┌───────────────┐ │ ct320-2 │ : │ 129.82.47.50 │·······│ salem │ │ 192.168.110.102 │···· └───────────────┘ lan2 │ 129.82.46.233 │ └─────────────────┘ └───────────────┘
┌─────────────────┐ ┌───────────────┐ ┌───────────────┐ │ ct320-1 │ lan1 │ router │ │ boise │ │ 192.168.110.101 │·······│ 192.168.110.1 │ ····│ 129.82.46.197 │ └─────────────────┘ : ├ ─ ─ ─ ─ ─ ─ ─ ┤ : └───────────────┘ ┌─────────────────┐ : │ acushla │ : ┌───────────────┐ │ ct320-2 │ : │ 129.82.47.50 │·······│ salem │ │ 192.168.110.102 │···· └───────────────┘ lan2 │ 129.82.46.233 │ └─────────────────┘ └───────────────┘
┌─────────────────┐ ┌───────────────┐ ┌───────────────┐ │ ct320-1 │ lan1 │ router │ │ boise │ │ 192.168.110.101 │·······│ 192.168.110.1 │ ····│ 129.82.46.197 │ └─────────────────┘ : ├ ─ ─ ─ ─ ─ ─ ─ ┤ : └───────────────┘ ┌─────────────────┐ : │ acushla │ : ┌───────────────┐ │ ct320-2 │ : │ 129.82.47.50 │·······│ salem │ │ 192.168.110.102 │···· └───────────────┘ lan2 │ 129.82.46.233 │ └─────────────────┘ └───────────────┘
┌─────────────────┐ ┌───────────────┐ ┌───────────────┐ │ ct320-1 │ lan1 │ router │ │ boise │ │ 192.168.110.101 │·······│ 192.168.110.1 │ ····│ 129.82.46.197 │ └─────────────────┘ : ├ ─ ─ ─ ─ ─ ─ ─ ┤ : └───────────────┘ ┌─────────────────┐ : │ acushla │ : ┌───────────────┐ │ ct320-2 │ : │ 129.82.47.50 │·······│ salem │ │ 192.168.110.102 │···· └───────────────┘ lan2 │ 129.82.46.233 │ └─────────────────┘ └───────────────┘
┌─────────────────┐ ┌───────────────┐ ┌───────────────┐ │ ct320-1 │ lan1 │ router │ │ boise │ │ 192.168.110.101 │·······│ 192.168.110.1 │ ····│ 129.82.46.197 │ └─────────────────┘ : ├ ─ ─ ─ ─ ─ ─ ─ ┤ : └───────────────┘ ┌─────────────────┐ : │ acushla │ : ┌───────────────┐ │ ct320-2 │ : │ 129.82.47.50 │·······│ salem │ │ 192.168.110.102 │···· └───────────────┘ lan2 │ 129.82.46.233 │ └─────────────────┘ └───────────────┘
Each layer assumes that the layer below it will do its job.
OSI Model | TCP/IP Hierarchy | Protocols |
---|---|---|
7: Application Layer | Application Layer |
domain (DNS, hostname→IP address) |
6: Presentation Layer | ||
5: Session Layer | ||
4: Transport Layer | Transport Layer |
TCP (connection-oriented reliable packets) |
3: Network Layer | Network Layer |
IP (it all boils down to this) |
2: Link Layer | Link Layer (alias Data Link Layer) |
ARP (Mac address→IP address) |
1: Physical Layer |
┌──────────────────┐ Layer N+1 protocol ┌──────────────────┐ │ Layer N+1 entity │<–––––––––––––––––––––>│ Layer N+1 entity │ └──────────────────┘ └──────────────────┘ │ ∧ │ ∧ ∨ │ ∨ │ ┌──────────────────┐ Layer N protocol ┌──────────────────┐ │ Layer N entity │<–––––––––––––––––––––>│ Layer N entity │ └──────────────────┘ └──────────────────┘ │ ∧ │ ∧ ∨ │ ∨ │ ┌──────────────────┐ Layer N-1 protocol ┌──────────────────┐ │ Layer N-1 entity │<–––––––––––––––––––––>│ Layer N-1 entity │ └──────────────────┘ └──────────────────┘
A layer N+1 entity sees the lower layers only as a service provider:
┌──────────────────┐ Layer N+1 protocol ┌──────────────────┐ │ Layer N+1 entity │<–––––––––––––––––––––>│ Layer N+1 entity │ └──────────────────┘ └──────────────────┘ │ ∧ │ │ │request indicate│ │delivery delivery│ │ │ ∨ │ ┌─────────────────────────────────────────────────────────────┐ │ Service provider │ └─────────────────────────────────────────────────────────────┘
Application job: write the web browser (client) or web server (server)
┌─────────┐ ┌──────────┐ ┌──────┐ │ laptop │ │ │ │ │ │ running │···········│ Internet │···········│ eBay │ │ browser │ │ │ │ │ └─────────┘ └──────────┘ └──────┘
Assume network provides way to send a messages between hosts.
Transport job: implement the connection-(oriented/less) service
┌─────────┐ ┌──────────┐ ┌──────┐ │ laptop │ │ │ │ │ │ running │···········│ Internet │···········│ eBay │ │ browser │ │ │ │ │ └─────────┘ └──────────┘ └──────┘
Network layer job: get a message from a source to a destination
┌─────────┐ │ laptop │ ┌───────┐ ┌───────┐ ┌───────┐ │ running │·····│ ISP A │····│ ISP B │····│ ISP C │ │ browser │ └───────┘ └───────┘ └───────┘ └─────────┘ : : : : : : ┌───────┐ ┌───────┐ ┌───────┐ ┌──────┐ │ ISP D │····│ ISP E │····│ ISP F │······│ eBay │ └───────┘ └───────┘ └───────┘ └──────┘
Link Layer job: get a message sent across some medium
┌────────┐ ┌────────┐ │ host A │·····························│ host B │ └────────┘ direct connection └────────┘
┌─────────┐ ┌───────────┐ ┌─────────┐ A │ Layer N │ │ PDU │ B │ Layer N │ │ entity │···········│ (layer N) │···········│ entity │ └─────────┘ └───────────┘ └─────────┘
My wife is visiting her family in France, and I miss her dearly, so I write a passionate love letter:
Dear Wife, Warmest regards. Lonely Husband
Say that a web browser wants to see eBay’s home page. It might construct this 34-byte HTTP request:
However, to send this over a TCP connection, the Transport level adds a 20-byte header, so now we have this:
The Transport level hands this off to the Network level, which will create an IP packet with its own 20-byte header:
The Network level hands this off to the Data Link layer, which will add its own overhead, depending on the medium:
Packet | Protocol Level | ||||
---|---|---|---|---|---|
Data | Application | ||||
TCP header | Data | Transport | |||
IP header | TCP header | Data | Network | ||
Frame header | IP header | TCP header | Data | Frame footer | Data Link |
When sending, each level treats the data from the previous level as a black box, an unintelligible blob of stuff, and adds its own header or footer.
Similarly, when receiving, each level removes its overhead.
┌──────────┐ ┌──────────┐ │ HTTP │ │ HTTP │ └──────────┘ └──────────┘ │ │ ┌──────────┐ ┌──────────┐ │ TCP │ │ TCP │ └──────────┘ └──────────┘ │ │ ┌──────────┐ ┌──────────┐ ┌──────────┐ │ IP │ │ IP │ │ IP │ └──────────┘ └──────────┘ └──────────┘ │ │ │ │ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │ Link │······│ Link │ │ Link │······│ Link │ └──────────┘ └──────────┘ └──────────┘ └──────────┘ ct320-1 router acushla salem 192.168.110.101 192.168.110.1 129.82.47.50 129.82.46.233
Preamble | Dest. address | Source address | Length | Data | CRC |
8 bytes | 6 bytes | 6 bytes | 2 bytes | 64–1500 bytes | 4 bytes |
(Note lack of IP addresses.)
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 |
Version | IHL | Type of service | Total length | ||||||||||||||||||||||||||||
Identification | Flags | Fragment offset | |||||||||||||||||||||||||||||
Time to live | Protocol | Header checksum | |||||||||||||||||||||||||||||
Source IP address | |||||||||||||||||||||||||||||||
Destination IP address | |||||||||||||||||||||||||||||||
Options (optional) | |||||||||||||||||||||||||||||||
IP data payload (many bytes) |
Protocol: 1=ICMP, 6=TCP, 17=UDP
┌─────────────┐ ┌─────────────┐ │ Application │ │ Application │ ├─────────────┤ ├─────────────┤ │ Transport │ │ Transport │ ├─────────────┤ ┌─────────────┐ ├─────────────┤ │ Network │ │ Network │ │ Network │ ├─────────────┤ ├─────────────┤ ├─────────────┤ │ Link │··········│ Link │··········│ Link │ └─────────────┘ └─────────────┘ └─────────────┘
20 bytes | 1 byte | 1 byte | 2 bytes | more bytes |
IP header | Type | Code | Checksum | ICMP data |
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 |
Source port | Destination port | ||||||||||||||||||||||||||||||
Sequence number | |||||||||||||||||||||||||||||||
Acknowledgement number | |||||||||||||||||||||||||||||||
Data offset | - | - | - | - | CWR | ECNE | URG | ACK | PSH | RST | SYN | FIN | Window | ||||||||||||||||||
Checksum | Urgent pointer | ||||||||||||||||||||||||||||||
Options (0–10 32-bit words) | |||||||||||||||||||||||||||||||
TCP payload (many bytes) |
These all work in my browser:
http://www.cs.colostate.edu
http://%77%77%77%2e%63%73%2e%63%6f%6c%6f%73%74%61%74%65%2e%65%64%75
http://129.82.45.114
http://0x81.0x52.0x2d.0x72
http://0201.0122.055.0162
http://2169646450
http://0x81522d72
http://020124426562
┌─────────────────┐ ┌───────────────┐ ┌───────────────┐ │ ct320-1 │ lan1 │ router │ │ boise │ │ 192.168.110.101 │·······│ 192.168.110.1 │ ····│ 129.82.46.197 │ └─────────────────┘ : ├ ─ ─ ─ ─ ─ ─ ─ ┤ : └───────────────┘ ┌─────────────────┐ : │ acushla │ : ┌───────────────┐ │ ct320-2 │ : │ 129.82.47.50 │·······│ salem │ │ 192.168.110.102 │···· └───────────────┘ lan2 │ 129.82.46.233 │ └─────────────────┘ └───────────────┘
Class | Pattern | Networks | Hosts per network | Addresses |
---|---|---|---|---|
A | 0nnnnnnn hhhhhhhh hhhhhhhh hhhhhhhh | 27 | 224 | 0–127.*.*.* |
B | 10nnnnnn nnnnnnnn hhhhhhhh hhhhhhhh | 214 | 216 | 128–191.*.*.* |
C | 110nnnnn nnnnnnnn nnnnnnnn hhhhhhhh | 221 | 28 | 192–223.*.*.* |
┌─────────────────┐ ┌───────────────┐ ┌───────────────┐ │ ct320-1 │ lan1 │ router │ │ boise │ │ 192.168.110.101 │·······│ 192.168.110.1 │ ····│ 129.82.46.197 │ └─────────────────┘ : ├ ─ ─ ─ ─ ─ ─ ─ ┤ : └───────────────┘ ┌─────────────────┐ : │ acushla │ : ┌───────────────┐ │ ct320-2 │ : │ 129.82.47.50 │·······│ salem │ │ 192.168.110.102 │···· └───────────────┘ lan2 │ 129.82.46.233 │ └─────────────────┘ └───────────────┘
┌─────────────────┐ ┌───────────────┐ ┌───────────────┐ │ ct320-1 │ lan1 │ router │ │ boise │ │ 192.168.110.101 │·······│ 192.168.110.1 │ ····│ 129.82.46.197 │ └─────────────────┘ : ├ ─ ─ ─ ─ ─ ─ ─ ┤ : └───────────────┘ ┌─────────────────┐ : │ acushla │ : ┌───────────────┐ │ ct320-2 │ : │ 129.82.47.50 │·······│ salem │ │ 192.168.110.102 │···· └───────────────┘ lan2 │ 129.82.46.233 │ └─────────────────┘ └───────────────┘
Why bother with routers or subnets? Just put all of your computers
on one giant LAN, and be done with it!
CIDR: Classless Inter Domain Routing
Consider this unusual network. In the center is a router,
with several LAN ports, connecting three LANs.
Note that 217.1.145.12 and 217.1.99.66
are also connected by a dedicated super-high-speed LAN,
because they exchange tons of data.
┌───────────┐ ┌───────────┐ ┌──────────────┐ │ 10.12.1.3 │·······│ 10.12.1.1 │ ····│ 217.1.34.252 │ └───────────┘ : ├ ─ ─ ─ ─ ─ ┤ : └──────────────┘ ┌───────────┐ : │ 217.1.2.1 │···: ┌──────────────┐ │ 10.12.1.5 │···: ├ ─ ─ ─ ─ ─ ┤ :···│ 217.1.145.12 │ └───────────┘ : │ 22.3.4.18 │ : └──────────────┘ ┌───────────┐ : └───────────┘ : : │ 10.12.1.6 │···· : : ┌──────────────┐ └───────────┘ : ····│ 217.1.99.66 │ to Comcast └──────────────┘
┌───────────┐ ┌───────────┐ ┌──────────────┐ │ 10.12.1.3 │·······│ 10.12.1.1 │ ····│ 217.1.34.252 │ └───────────┘ : ├ ─ ─ ─ ─ ─ ┤ : └──────────────┘ ┌───────────┐ : │ 217.1.2.1 │···: ┌──────────────┐ │ 10.12.1.5 │···: ├ ─ ─ ─ ─ ─ ┤ :···│ 217.1.145.12 │ └───────────┘ : │ 22.3.4.18 │ : └──────────────┘ ┌───────────┐ : └───────────┘ : : │ 10.12.1.6 │···· : : ┌──────────────┐ └───────────┘ : ····│ 217.1.99.66 │ to Comcast └──────────────┘
How would 217.1.99.66 send data to:
How’s it supposed to know all that‽
┌───────────┐ ┌───────────┐ ┌──────────────┐ │ 10.12.1.3 │·······│ 10.12.1.1 │ ····│ 217.1.34.252 │ └───────────┘ : ├ ─ ─ ─ ─ ─ ┤ : └──────────────┘ ┌───────────┐ : │ 217.1.2.1 │···: ┌──────────────┐ │ 10.12.1.5 │···: ├ ─ ─ ─ ─ ─ ┤ :···│ 217.1.145.12 │ └───────────┘ : │ 22.3.4.18 │ : └──────────────┘ ┌───────────┐ : └───────────┘ : : │ 10.12.1.6 │···· : : ┌──────────────┐ └───────────┘ : ····│ 217.1.99.66 │ to Comcast └──────────────┘
Each host (remember, that includes end-user computers and routers) has
a routing table. Here’s a routing table for 217.1.99.66:
Destination | Cost | Interface |
---|---|---|
217.1.145.12/32 | 1 | top |
217.1.0.0/16 | 2 | left |
gateway | 3 | left |
Is the second entry really needed? Note the the table does not
try to get a packet all the way to 10.12.1.5; it only specifies
the next hop.
┌───────────┐ ┌───────────┐ ┌──────────────┐ │ 10.12.1.3 │·······│ 10.12.1.1 │ ····│ 217.1.34.252 │ └───────────┘ : ├ ─ ─ ─ ─ ─ ┤ : └──────────────┘ ┌───────────┐ : │ 217.1.2.1 │···: ┌──────────────┐ │ 10.12.1.5 │···: ├ ─ ─ ─ ─ ─ ┤ :···│ 217.1.145.12 │ └───────────┘ : │ 22.3.4.18 │ : └──────────────┘ ┌───────────┐ : └───────────┘ : : │ 10.12.1.6 │···· : : ┌──────────────┐ └───────────┘ : ····│ 217.1.99.66 │ to Comcast └──────────────┘
A routing table for the router:
Destination | Cost | Interface |
---|---|---|
217.1.0.0/16 | 1 | right |
10.0.0.0/8 | 1 | left |
gateway | 2 | bottom |
┌───────────┐ ┌───────────┐ ┌──────────────┐ │ 10.12.1.3 │·······│ 10.12.1.1 │ ····│ 217.1.34.252 │ └───────────┘ : ├ ─ ─ ─ ─ ─ ┤ : └──────────────┘ ┌───────────┐ : │ 217.1.2.1 │···: ┌──────────────┐ │ 10.12.1.5 │···: ├ ─ ─ ─ ─ ─ ┤ :···│ 217.1.145.12 │ └───────────┘ : │ 22.3.4.18 │ : └──────────────┘ ┌───────────┐ : └───────────┘ : : │ 10.12.1.6 │···· : : ┌──────────────┐ └───────────┘ : ····│ 217.1.99.66 │ to Comcast └──────────────┘
A routing table for 10.12.1.6:
Destination | Cost | Interface |
---|---|---|
gateway | 1 | right |
It only has one LAN interface. Everything’s got to go through that!
Once a (non-local) packet gets to the router, then it’s the router’s
task to figure out where it should go next.
Protocol
ARP cache
Modified: 2016-10-20T13:57 User: Guest Check: HTML CSSEdit History Source |
Apply to CSU |
Contact CSU |
Disclaimer |
Equal Opportunity Colorado State University, Fort Collins, CO 80523 USA © 2015 Colorado State University |