Comp 343/443 Fall 2008, 25EP-602, 4:15-6:45 Week 4, Sept 17 [mac address validation & arp/dhcp] Finish Sliding Windows Ethernet CRC error-check code Datagram forwarding CRC: quickie example of "mod2-polynomial" long division: addition = subtraction = XOR Suppose we are given two messages, msg1 and msg2. There are straightforward mathematical means for tweaking last bytes of msg2 so crc(msg1) == crc(msg2) secure hashes (md5, etc) Nobody knows at all how to produce two messages with same hash 2-D parity (corrects 1-bit errors) fundamental role of error-correcting codes (= "forward error correction") ======================================================= 2.6: Ethernet. See also my notes (link on web page). Ethernet: Read section 2.6 on Ethernet logical: broadcast bus NI interrupts CPU if any of the following apply: * packet destaddr matches NI's physical addr * packet destaddr is b'cast addr * packet destaddr is multicast and NI has "subscribed" to that m'cast addr * NI is in promiscuous mode Why we need a TYPE field That covers RECEIVING; what about SENDING? Ethernet (addresses, collisions, performance) traditional broadcast-bus; role of hub eavesdropping story: In 1994 I changed the admin password on several remote unix machines, using telnet. I told no one. Within two hours, someone else logged into one of the remote machines, using the new password, from inria.fr (then rife with hackers, as I suppose was Loyola) Two months later was the Kevin Mitnick "Christmas Day Attack", launched _from_ apollo.it.luc.edu. physical addresses, bcast address operation of sending csma/cd collisions how CD (collision detect) works Signal propagation on the line: 1 bit = 23 m for 10 megabit min packet size / max diameter requirement[!] SLOT TIME: min packet size collision detection time max diameter of network compare max packet size repeaters: simple amplifiers; max segment length need collision signal to be strong enough to be detected! change geometry too repeaters == hubs! Two issues relating to cable length: faintness of signal window of opportunity for an undetected collision scaling to 100Mbps; min packet revisited collisions and hubs collisions and switches Exponential backoff algorithm Transmit immediately when line is free. This leads to a collision if someone else was waiting also. After N collisions (including N=1): choose a random k, 0<=k<2^N (choose an N-bit random k) wait k slots try again to transmit. Options: idle/seize_channel, idle/collide, busy hidden bias against hosts that have been waiting longest: "unfairness" Timeline of typical exponential backoff Ethernet myths re capacity Ethernet BRIDGING WHy switching avoids collisions, mostly Half-duplex: data flows in one direction at a time Full-duplex: packets can be sent in opposite directions simultaneously; collision-free! usually implemented via two half-duplex lines, each with a dedicated direction. Bridge Learning: first look IP (with addressing, classes, routing basics) "virtual" addresses, assigned hierarchically addr = net+host local delivery routing *inter*networking 2.7: FDDI. Omit, except for brief discussion of token idea. Basic introduction to Ethernet and Token Ring physical networks Ethernet: (below) Token Ring: Tokens Fairness, round-robin allocation uniform performance under heavy loads Basics of Datagram Routing A--S1-----S2--D | | | | B--S3-----S4----S5---F | | C E Basics of Adaptive (Learning) Bridges (Ethernet Switches) * table size issues * table updates * learning algorithm * b'cast as fallback * bridges v hubs * problem of cycles; spanning-tree algorithm P&D 3.2: Bridges and Adaptive Bridges; cycles; scalability Bridges join separate physical ethernets. Packets are propagated, but collisions are *not*. Limit to total size: total traffic Limits to size: b'cast, table sizes (10^4 v. 10^6) Cannot use loop topology Delay (we don't want packets arriving late) bridges & security: other parties cannot listen in. ===================================================================== CRC error code [We'll do an example of this in class, but no more] Look at adding up the digits of 123456789. Their sum is 45. 45 is divisible by 9, so 123456789 is also. This is the famous "rule of 9's", that is based on the fact that 9 = 10-1 and 123456789 was a base-10 number. Look at adding up the BYTES of a message M. Bytes are essentially the base-256 "digits" of M, expressed as a huge number. Internet checksum: fill in checksum field so sum of bytes (actually DWORDS, 16-bit words) is zero, with overflow ignored. That means that the sum is divisible by 255. By analogy with the Rule of 9's, that means that M as a mega-number was evenly divisible by 255. Checksum field is (-remainder), essentially So, check SUM can be seen as a form of long division. Good things about division: * divisors other than 255 are pretty much immune to reordering! * divisors other than 255 are pretty darn good at catching errors Problems: * takes too long Fix: do CRC division: fast (relatively), & work is simplified by doing long division of "mod 2 polynomials". * no carries * 1+1 = 0, 0-1 = 1