IP only guarantees best effort delivery of datagrams. In other words, IP may drop, delay, reorder, and corrupt messages.
Because this guarantee is very weak, IP can be implemented with relatively little effort on top of almost any other network technology. For example, IP runs on top of Ethernet, FDDI, ATM, and point-to-point links with very little overhead.
The most challenging networks for implementing IP might be the connection oriented network technologies (ATM, X.25). We can do this by caching connections.
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |Version| HLen |Type of Service| Total Length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Identification |Flags| Fragment Offset | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Time to Live | Protocol | Header Checksum | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Source Address | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Destination Address | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Options | Padding | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Why the version number comes first. The IP described here is IPv4. Talk briefly about IPv6 being "up and coming".
What do we need HLen?
Does anybody use Type of Service?
Leave fragmentation for later.
Explain TTL is a hop count (and that's what it's called in IPv6).
Standard protocols above IP include: ICMP (1), TCP (6), UDP (17, 0x11).
Explain about checksum.
Leave options for later.
Every internet module must be able to forward a datagram of 68 octets without further fragmentation. This is because an internet header may be up to 60 octets, and the minimum fragment is 8 octets.
Every internet destination must be able to receive a datagram of 576 octets either in one piece or in fragments to be reassembled.
Fragmentation, transmission and reassembly across a local network which is invisible to the internet protocol module is called intranet fragmentation and may be used.
Also because packets may be delivered out of order, the fragment offset field records the position of the first byte in the fragment relative to the start of the packet.
An IP packet may be up to 2^{16} - 1 bytes long, but the fragment offset field is only 13 bits. The fragment offset is in multiples of 8 bytes (64 bits), and each fragment but the last must be a multiple of 8 bytes.
Fragmentation can happen anywhere in the network; reassembly only takes place at the final receiver.
If at any time the per-packet timer expires, discard the reassembly context for that packet.
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Option ID | Length | Option Value .... +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Notice the option ID is only 1 byte long -- only 256 possible options.
ARP converts the IP address of an interface on an attached network to a hardware address.
It does this by broadcasting a request which lists the desired IP address, and caching the (non-broadcast) request.
If host A asks for my address, I will cache A's IP and hardware addresses, since it is likely A will want to talk to me soon. The ARP messages carry source and destination hardware and physical addresses.
In general, every host on the Internet implements some subset of ICMP, which is why ping is useful.
What if we send packets with TTL 1, 2, 3, ...?
The first router will send an ICMP error for the first packet, the second router will send one for the second packet, and so on until we reach the destination. If we keep track of which routers send us ICMP packets, we will know what route our packets are following.
Traceroute is installed on the ICS machines. Try using it with www.stanford.edu and www.mit.edu, and compare the results.
With this information, we can build an Internet node or even a simple router (as long as we have a "default router" to give messages to). To build an entire internet, we will need to know how to route.
We have also not explored some of the limitations of IP. These are addressed by a new version of the IP protocol, IPv6.