All About IP * "Internet Protocol" packets are encapsulated in link-layer packets * Design ideas: * Carry IP packets in arbitrary link layers; easily transfer between different link layers * Route packets * Provide support for interacting with gateways / routers * Provide support for higher-level protocols * Replaces "NCP" IPv4 * Conceptually like Ethernet * Source and dest address * Length information * Type * Payload * Checksum * Several common types * UDP * TCP * ICMP IPv4 Addressing * 32 bits written in bytewise "dotted-decimal" e.g. 127.0.0.1 * Four kinds of bits "left-to-right" (maybe) * Address class = how to interpret remaining bits * Network part = where the core should send the packet * Subnet part = where on the local collection of link-level networks the network should send the packet * Host part = which IP interface on the link-level network should get the packet * Allocated by Internet Assigned Numbers Authority (IANA) through retail chain involving core providers, ISPs * We are essentially out of IPv4 addresses * However, this has as much to do with router constraints as it does with address bits Addresses For Interfaces * Given host may have multiple interfaces * Link or IP layer * Physical or virtual * No explicit binding between addresses and hosts * Creates issues around "the host address" * Issues of address assignment / binding between layers deferred for several weeks: ARP, DNS, DHCP etc Forwarding * Steps to forward an IP packet * Mask off the network and subnet parts * If the subnet is yours, forward to the host using link layer * "Overlaid subnets" * If the network is yours, forward toward the subnet * Otherwise, forward toward the Internet gateway * Masks * Bitmasks might be dotted-decimal or /# * Simply anded with address to get network / subnet * Usually prefixes Local networks and NAT * 10.0.0.0/8, 196.168.0.0/16 * Not routable through the core Internet * "Network Address Translation" does source / dest address change between single core and multiple local Fragmentation * IP Maximum Transmission Unit ("MTU") must be at least 68 bytes ("path MTU" -- "host MTU" is 576 bytes) * Each link-level network between source and destination may have different MTU * Want to be able to send "big" packets * Solution: IP "Fragmentation" * Break the big payload into pieces and send them separately * Use ID and Segment bits in IP header for construction and reassembly * Arguably should have been end-to-end IPv6 * Main difference is addresses: 32-bit vs 128-bit * Also a bunch of details * Designed to let IP scale farther * Somewhat stalled * Transition details * Router capacity * Lack of demand UDP, TCP, ICMP * Protocols encapsulated in IP * User Datagram Protocol "UDP": Thin layer under IP providing "port" abstraction and data checksum * Transmission Control Protocol "TCP": Provides sequenced, reliable streams with out-of-band data etc via windowing, acks * Internet Control Message Protocol "ICMP": Host-to-router and router-to-router messages for "out of band" IP activities, e.g. "ICMP echo" AKA "ping"