cs398 Lecture Notes Spring 2000 Week 8, Thursday For today, you should have started reading Chapter 4. As usual, you should be doing hierarchical reading so you don't get bogged down in boring things like the implementation of reassembly and miss the entertaining humorous joke on page 266 (in the blue box). Also, you should have written answers for questions 29, 30 and 35 on page 243. Chapter 4, at last! Quick note, we will probably do Chapters 5 and 6 in order and then skip to Chapter 9. Chances are, that's all we'll have time for. Internetworking --------------- With lower-case i, any network made up of smaller, heterogeneous networks. What used to be bridges are now routers, where the primary distinction is that routers have to convert from one network format to another. Canonical example: Ethernet onto FDDI or ATM. With capital I, the Internet is specifically the global internet that uses IP (Internet Protocol) as its lingua franca. Figure 4.2 on page 249 shows a protocol diagram for an Internet path. Hosts are running protocols on top of IP. Routers need to be able to "speak" IP as well as two different network frame formats. IP packets are encapsulated inside network-level frames. Service model ------------- datagrams -- all packets contain all info needed for delivery. no setup before sending no way of knowing if there is a path, or if the recipient is up unreliable -- packets can get lost, reordered, or delivered more than once! best-effort -- if a router discovers that something has gone wrong, it has no obligation to inform either party (although sometimes is does) Header format ------------- Notice: things that handle IP packets tend to be written in software, so 1) byte alignment is nice 2) CRC is less appealing Header is 20 bytes (5 words) long; most fields are byte-aligned Version (4 bits): IPv4 or IPv6 Hlen: length of header including options (in words) Example option: source routing... up to nine router IP addresses route tracing... same thing TOS: type of service. In theory there is min delay, min cost, etc. Length: total length of packet including header (in bytes) Indent: unique identifier used when packet is fragmented Flags: most important, M=are there More fragments in this packet? Offset: where in the fragmented packet does this fragment fall (specified in 8-byte units) (Why?) TTL: literally time to live, but actually number of hops to live, but actually number of well-behaved routers to live Protocol: used at the next level up TCP = 6, UDP = 17 Checksum: just protects the header, fast algorithm for software Source addr and dest addr: 32 buts each, as explained below Options, padding. Fragmentation ------------- Each network has a maximum frame size. MTU = maximum transmission unit = maximum frame size - IP header size We _could_ require IP to use a packet size = min packet size over all network types, but that's bad because 1) new network types all the time, and IP needs to be universal 2) not all paths include all network types. We want hosts to be able to use large packet sizes when possible. Therefore, hosts can send any packet size (usually up the the MTU of the network they are connected to directly), and the network fragments if necessary along the way. The fragments are themselves valid IP packets that are delivered independently to the destination. Once fragmented, packets are not reassembled until they arrive at the destination. If one fragment is lost, the whole packet is dropped, since there is no one we can get just the dropped fragment from. Fragments might themselves get fragmented, if they pass through a link with an even smaller MTU. Not a particularly efficient process, since reassembly is non-trivial (possibly multi-level). Better if hosts do MTU discovery before sending. Global addresses ---------------- Every interface on every host has a 32-bit IP address that is globally unique (this is now only almost true). How many addresses are there? How many interfaces are out there now? Hierarchical: 32-bit address contains a network part and a host part. Pro: simplifies routing information... the router need only look at the network part Con: not the most efficient allocation scheme. Not all networks have the maximum number of hosts on them, so many IP addresses are wasted. (Actually it's even worse than that, because ranges of network numbers have been allocated to institutions that are not using them.) The split between the network part and the host part depends on the class of the address. Addresses are written as 4 decimal numbers with . between them first byte class split 0 -127 A 1 byte network, 3 bytes host 128-195 B 2 byte network, 2 bytes host 196-255 C 3 byte network, 1 bytes host Rocky is 137.146.194.45 First bit is 1, second is 0, so this is a Class B address. 137.146 is Colby, there can be 65536 interfaces on campus. Colby uses one byte to identify Ethernet, one byte for each host on the net.