A Packet's Journey (Pt. 1: NAT)
Sid Shanker - 06/07/2018
Impress upon you that:
- Networks are cool and worth learning about
- Networks are very inelegant (but still worth learning about)!
Information gets from your computer to the internet...somehow
Lots of different protocols in play here!
- Uses Ethernet to get data to the router
- Uses IP to move packets across the internet
- Uses TCP to implement that actual web application
- You've seen 'em: 172.16.254.1
- Used to designated different devices on a computer network
- Two protocols, ipv4 and ipv6, we're running out of ipv4 addresses!
- There are both private IPs and public IPs
An IP Header
Source and destination address are both IP Addresses
TCP Very Quickly
- Higher Level network protocol that ensures reliability of packet delivery
- TCP data is inside the IP packets
- IP can be used to transmit other protocols too
A typical TCP packet
has public ip
My question: if all Google knows is the public IP address of my router, how do packets make it back to me?
Introducing: the NAT
Answer: A Disappointing Hack
Exercise for the reader: How could this work with a transport-protocol that doesn't use ports?
Moral of the story: sometimes you have to make compromises for things to work in the real world.
A Packet's Journey Pt. 1
By Sid Shanker