- The network layer is split into two “planes”:
- Control plane: rules for forwarding
- Monitors traffic
- Coordinates with other routers
- Data plane: forwarding packets
- Implements/executes control plane rules
- IP is best-effort: packets can be dropped
- IP address: 32-bit numbers expressed as “dotted quads” (4x8-bit numbers)
- Subnets:
- Chunks of IP addresses that can communicate directly
- No router needed; dense network
- Subnets are expressed via subnet mask or CIDR block
- CIDR notation: indicate the number of bits indicating the subnet (remainder indicate host)
- So 223.1.1.3/24 means that the high 24 bits identify the subnet
- In this case, range is 223.1.1.0 to 223.1.1.255
- The x.x.x.3 was ignored b/c specific to host
- Subnet mask can be bitwise
anded to get host addresses
- Doesn’t tell you what the subnet IP address is; you infer this from the IP address of a host on the subnet
- Subnet lets us decide where to send packet
- If in same subnet, send directly
- Otherwise, send to gateway router
- ICANN distributes chunks of IP addresses
- Classless InterDomain Routing (CIDR) distributes blocks in powers of 2
- Routers encode forwarding rules in a forwarding table
- Maps address ranges to links
- If more than rule matches, choose rule with the longest prefix
- In other words, prefer more specific to more general
- IP packet header:
- IP protocol version
- Source and destination IP addresses
- Header length
- Number of bytes ⇐ measured in remaining hops
- TTL
- Protocol for inner packet: TCP, UDP, ICMP
- ICMP is a protocol for administrative messages between routers
- Checksum
- Also contains fields for fragmentation: ID, flags, offset
- Fragmentation is considered to be obsolete
- No longer supported in IPv6
- Enables links with small maximum message size to communicate with larger ones
- For a host to operate on the Internet, it needs to know:
- Its own IP address
- To set source address for outbound packets
- The mask for its subnet
- To decide whether to route traffic locally
- The IP address for its Internet gateway
- For messages that must be sent out of the subnet
- The IP address for a DNS server
- To get IP addresses for hostnames
- These four addresses can be configured in two ways:
- Manually: usually not done
- Via Dynamic Host Configuration Protocol (DHCP)
- DHCP is sent by local broadcast
- Occurs at the link layer; no IP addresses needed