Thanks to:
for the contents of these slides.
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) |
The problem:
┌───────────┐ ┌──────────────┐ │ Dr. McCoy │···· ····│ Dr. Faustus │ └───────────┘ : : └──────────────┘ ┌───────────┐ : : ┌──────────────┐ │ Dr. Evil │···: :···│ Dr. Jekyll │ └───────────┘ : : └──────────────┘ ┌───────────┐ : : ┌──────────────┐ │ Dr. Who │···: :···│ Dr. Pepper │ └───────────┘ : : └──────────────┘ ┌───────────┐ : ┌───────┐ : ┌──────────────┐ │ Dr. Zaius │···:···│ PBX │···:···│ Dr. Dolittle │ └───────────┘ : └───────┘ : └──────────────┘ ┌───────────┐ : : : ┌──────────────┐ │ Dr. Doom │···: : :···│ Dr. Zoidberg │ └───────────┘ : phone : └──────────────┘ ┌───────────┐ : network : ┌──────────────┐ │ Dr. Teeth │···· ····│ Dr. Watson │ └───────────┘ └──────────────┘
Consider a doctors’ office. It has a dozen doctors. Each doctor has an office with a phone.
The solution: an internal phone exchange (PBX).
Internet ┌────────┐ ┌─────────────┐ ·············│ NAT │·······│ 192.168.1.2 │ 22.33.44.55 │ router │ : └─────────────┘ └────────┘ : ┌─────────────┐ :···│ 192.168.1.2 │ : └─────────────┘ : ┌─────────────┐ ····│ 192.168.1.4 │ └─────────────┘
Similarly, NAT hides many hosts behind a NAT router.
CIDR range | Number of hosts |
---|---|
10.0.0.0/8 | 2²⁴ ~ 16 million |
172.16.0.0/12 | 2²⁰ ~ 1 million |
192.168.0.0/16 | 2¹⁶ ~ 65 thousand |
Internet ┌────────┐ ┌─────────────┐ ·············│ NAT │·······│ 192.168.1.2 │ 22.33.44.55 │ router │ : └─────────────┘ └────────┘ : ┌─────────────┐ :···│ 192.168.1.2 │ : └─────────────┘ : ┌─────────────┐ ····│ 192.168.1.4 │ └─────────────┘
Let’s not forget how TCP works:
For example, if I initiate an ssh connection to denver.cs.colostate.edu from home, the connection looks like this:
Why have the port 6234? So that when a reply packet from denver arrives, we know which program to send the reply to: the program listening on port 6234.
How does a typical transaction occur without NAT?
Internet ┌────────┐ ┌─────────────┐ ·············│ NAT │·······│ 192.168.1.2 │ 22.33.44.55 │ router │ : └─────────────┘ └────────┘ : ┌─────────────┐ :···│ 192.168.1.2 │ : └─────────────┘ : ┌─────────────┐ ····│ 192.168.1.4 │ └─────────────┘
WAN | LAN |
---|---|
ebay.com, 3345 | 192.168.1.4, 5001 |
hp.com, 8765 | 192.168.1.3, 5010 |
A NAT router must:
┌─────────────┐ ┌────────┐ ┌─────────────┐ │ denver.cs.… │·············│ NAT │·······│ 192.168.1.2 │ └─────────────┘ │ router │ └─────────────┘ 129.82.46.205 └────────┘ jack-rulez.com
How does a typical transaction occur with NAT?
Modified: 2016-10-24T21:12 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 |