IPv4 addresses
Goal of Internet Protocol Address
- Stitch many different networks together
- Need network-independent, unique address
IPv4
- An IPv4 address identifies a device on the Internet
- 32 bits long: a.b.c.d
- Netmask: apply this mask, if it matches, in the same network
Netmask
- In addition to an address, a device typically also has something called a netmask.
- A netmask tells the device which IP addresses are local and which requiring going through an IP router.
- A netmask is written as a string of consecutive 1s, starting with the most significant bit.
- You tell whether two computers are in the same network by taking a bitwise AND of their addresses with
the netmask. If the resulting addresses are equal, they are in the same network.
Address Structure Historical
- Originally hierarchical: network + host
- Network to get to correct netowrk (administrative domain)
- Host to get to correct device in network (within administrative domain)
- Originally 3 classes of addresses: class A, class B, class C.
Address Structure Today
- Classless Inter-Domain Routing
- Address block is a pair: address,count
Counts are powers of 2, specify netmask length
171.64.0.0/16 means any address in the range 171.64.0.0 to 171.64.255.255
IPv4 Address Assignment