CIS 456-102, Spring 2006. Assignments It is recommended that students go to the CIS 456 General Pages on my website and read the the page on ``Computer Access at NJIT'', preferably before the first class session. It is recommended that students do all excercises on that page that are not old hat to them, preferably before the first class session. If you do not do them before the first class session, it is compulsory before the second class session. It is recommended that students who have not recently logged in from home to an NJIT computer do so now. It is strongly recommended students set up ssh in their laptop or in a computer at home. It is recommended you read Comer I chapters 1, 2, and 3 before the first class session. It is compulsory to read them before the second class session. In these chapters 1 - 3 Comer tries to give the ``big picture'' that will make it easier to understand the details he gives later. He often succeeds, but sometimes gives a ``big picture'' that is hard to understand until after you have seen the details. It is recommended you re-read chapters 1 - 3 later. A good time may be after we have covered chapters 4 - 13. Assignments: ----- 01/27/06. Lecture 2 Read Comer I chapters 1 - 4. (pp 1 - 53). Read the page on ``Computer Access at NJIT'' and do all excercises that are not old hat to you. Get IETF RFC 1700 and read the overview and page 1. (In the days before www people used ftp to get remote files!) Get RFC 3232 and read the whole thing. Go to the IANA Database and get the Ethertype of IPv4. To prove you got the information from the IANA database (and not from somewhere else), hand in 5 lines from the IANA database: The IPV4 ethertype line, 2 lines before, 2 lines after (5 lines total). (Hand in). Example: had I asked for the ethertype of Appletalk, you would have handed in: 32896 8080 - - Vitalink TransLAN III [XEROX] 32897 8081-8083 - - Counterpoint Computers [XEROX] 32923 809B - - Appletalk [XEROX] 32924 809C-809E - - Datability [XEROX] 32927 809F - - Spider Systems Ltd. [XEROX] ----- 02/03/06 Lecture 3. Read Comer I chapter 5 (pp 57 - 67) You already have access to the computers afs1, ... , afs36. (Walk-up, telnet, ssh. Possibly more.) (These are Solaris computers.) You will soon have access to afs48, ... , afs57. (Telnet only.) (These are old sgi computers.) You will soon have access to lafite and mouton. (lafite.njit.edu etc.) (Ssh only.) (These are linux computers.) Some of those machines are often down. Try another one in the same group. group 1: afs1 , ... , afs36 . group 2: afs48, ... , afs57 . group 3: lafite, mouton. 1. Log on to one of the afs computers (afs1, ... , afs36). Preferably from home. (Use ssh, vpn, telnet, rlogin, rsh, or whatever). Do man nslookup Use Google to find the name of the computer that hosts the website of the ``Nizhni Novgorod State University''. Use nslookup to find the IP address of that computer. Hand in the entire output from nslookup. (Also the line you typed, including prompt. I want to see your login ID there! MUST be on one of afs1 ... afs36.) 2. Log in to at least 1 computer from each of the 3 groups. Do ``man ifconfig''. Use ifconfig to find IPaddress and Mask of that computer. (Actually: of the one ethernet card on that computer. lafite and mouton have 4 ethernet cards each, but on both lafite and mouton only one ethernet card is ``active'', i.e. has an IP address.) Note the different behavior of ifconfig on the various computers. Find the network address of the LAN the computer is on. For three computers (one from each group) hand in: IP address, network address (in slash notation). Example: For maan.njit.edu that would be: 128.235.32.243 , 128.235.32.0/22 . 3. Log in to one computer from afs1, ... , afs36 . Do ``man arp''. Use arp to look at the arp cache. Use ``arp -a'' as well as ``arp -an''. Compare the outputs. Then use arp to figure out how these Solaris computers implement ``soft state'' in their arp cache. (How ``stale'' entries are removed.) Hint: for several minutes, at least 8 minutes, do ``arp -a'' or ``arp -an'' once every 30 seconds or so. Hand in a SHORT paragraph describing what you saw, and what your conclusion is for how the Time-Out mechanism for ``Resolved'' works on these computers. Recommended: do the same for at least one computer from each group. But hand in only for one from afs1, ... , afs36. ----- 02/10/06 Lecture 4. Read Comer I chapter 6 (pp 71 - 90) In excercise 1, assume ``classful addressing''. 1. For each of the following IPv4 addresses, give the class. a. 248.248.248.248 b. 125.125.125.125 c. 224.224.224.224 d. 239.239.239.239 e. 133.133.133.133 f. 193.193.193.193 Hand in, in hardcopy, BEFORE 6:01 on 02/10/2006. I will discuss this in class so I can ask similar questions in the midterm. 2. Suppose we have a LAN with network address 128.235.32.0/22 . a. What is the length of the mask of this LAN? b. Write down the mask in bits. c. Write down the mask in dotted decimal d. Write down the mask in hexadec. e. For each of the following INET addresses: Is it allowed as IPv4 interface address on this LAN? Is it allowed as source address in an IPv4 packet in this LAN (say on coaxial cable, or in switch)? Is it allowed as destination address in an IPv4 packet in this LAN? (same). Answer x/y/z , each of x, y, z yes (y) or no (n). Give a BRIEF explanation. i 128.235.32.0 ii 128.235.32.1 iii 128.235.31.2 iv 128.235.33.3 v 128.235.35.254 vi 128.235.35.255 vii 128.236.32.4 viii 255.255.255.255 ix 127.0.0.1 x 224.1.2.3 Examples: 128.235.33.33 y/y/y perfectly legal in all three cases. 128.237.5.5 n/y/y illegal as interface address here, but legal on other LAN, can be on its way from or to there. 128.235.35.35 y/y/y perfectly legal in all three cases. 0.0.0.0 n/y/n ``I am stupid'' source address 225.2.3.4 n/n/y Multicast Address. I forgot to mention in class: Multicast Addresses are legal as destination address, illegal as source address or interface address. 128.235.32.0 n/n/n This is the network address. In my class not allowed, not even as surrogate for directed broadcast. Hand in BEFORE 6:01 on 02/10/2006. Hardcopy. I will go over this in class so I can ask these question in the midterm. 3. Write two programs. C++ or Java. If you want to use another language ask permission first. Program A takes 32 bits in ``pseudo-binary'' and outputs the IPv4 address in dotted decimal. Program B takes an IPv4 address in ``dotted decimal'' and outputs the 32 bits (in ``pseudo-binary''). Hand in the programs. They must run on afs computers! Do your developement and testing on afs machines. (afs1, ... , afs36). In particular with C++, if you do the development on a PC, the code is likely not to run on a Solaris machine. Hand in the programs by Email, in .txt format. NOT in .doc format. If you write the program on a PC, that means you should use ``notepad''. If you write the program on an afs machine, or on any Unix / Solaris / Linux machine, using any editor I know of (ed, vi, emacs, pico, etc), the result will be in .txt format. In that case the ``postfix'' indicates the language used. E.g. dott2bits.cc means ``this file contains a C++ program''. (Aside about editors: ed is an old clunker that 30 years ago was ``state of the art''. emacs and vi are powerful editors, but take some time mastering. One of my students says that pico is easiest to learn for newbies. It is like notepad in windows. There is a tutorial on pico in http://web.njit.edu/~deepcs/tutorials.php ) Of course, you can give any file a postfix .cc , but if it isn't a C++ program and you feed it to a C++ compiler (such as CC , gcc , g++) the compiler will say rude things. Try it: nobody but you will read the rude things. Formats: If you use C++ both your programs must contain the declarations --- char bits[33]; /* the bits of the address, plus one for '\0' */ char dotteddec[20]; /* dotted decimal address. 16 would be enough. check! */ Program A then must contain the input statement cin >> bits ; while program B must contain the input statement cin >> dotteddec ; --- and also all output must be to standard output. (I will use input and output redirection when testing your program). If you use Java (or any language I have OKed) your input/output must use only standard input and standard output, the same way as just described for C++. See also the example on my website, CIS 456 General Pages. Example: Program A, if given the input 10000000111010110010000011110011 , would answer 128.235.32.243 . Program B, if given the input 128.235.32.243 , would answer 10000000111010110010000011110011 . Suggestion: Try to do something similar where the output also is the 32 bit ``unsigned int'' form of the address. Do not hand in. This will come in handy when checking whether an address is in some network. That's it for 02/10/2006. ----- 02/17/2006. Lecture 5. Midterm I will be on 02/17/2006. Comprehensive: All classnotes up to 02/10/2066, All reading in Comer I up to for 02/17/2006, All homework up to for 02/17/2006. Read Comer I Ch 7. (pp 93 - 105) CAN be asked in exam. Read Comer I pp 109 - 114 (Ping). CAN be asked in exam. A router receives an IPv4 packet with in the header: HLEN = 5, TL = 4348, Identifier = 43210 (numerical value of 16 bit unsigned int), U = 0 (Unused bit in Fragmentatin Flags), DF = 0, M = 1, Fragmentation Offset = 1082, TTL = 25, i. How many data bytes does this packet contain? ii. How many data bytes are there in preceding fragments? (THIS router may not have seen those preceding fragments!) The router determines the next hop and finds the next hop goes through an ethernet LAN (MTU = 1500 Bytes), so that further fragmentation is needed. iii. Into how many fragments is this packet fragmented? iv. For ech of these fragments, give: HLEN, TL, Identifier, U, DF, M, Fragmentation Offset, TTL, and number of data bytes in that fragment. Hand in. A question like this could be asked in the exam! ----- 02/24/2006. Lecture 6. Read Comer I pp 115 - 124 (rest of Ch 8) Read Comer I pp 127 - 151 (Ch 9) Most of this we already did in class. Read carefully and ask questions. I do not plan to cover this again in class, unless you ask questions. Comer's discussion of tries is (in my opinion) fairly incomprehensible. Give it a shot, but don't spend too much time om it. Ask questions. Longest Prefix problem: You remember, it is possible that when a router needs to forward a packet it finds in its forwarding table a ``fit'' with more than one route. In that case it chooses (uses) the route with the longest mask. We then say that the route with the shorter mask is a ``prefix'' to the other route. Example: 129.129.128.0/20 and 129.129.136.0/22 . The destination address 129.129.137.1 fits both (check!), so it uses route 129.129.136.0/22. Please check: the two network addresses have the same first 20 bits. That is why we call 129.129.128.0/20 a PREFIX to 129.129.136.0/22. Definition: a.b.c.d/m is a prefix to w.x.y.z/n if m < n and a.b.c.d and w.x.y.z have the same first m bits. Every destination address that fits w.x.y.z/n also fits a.b.c.d/m , but not the other way around. Please check: If route A is a prefix to route B, and route B is prefix to route C, then also route A is a prefix to route C. (Do not hand in.) 1. Some router R0 has forwarding table Route mask netw interface NextHop 1 255.255.255.255 128.235.32.243 eth1 R1 2 255.255.0.0 128.235.0.0 eth2 R2 3 255.255.224.0 136.136.64.0 eth3 R3 4 255.255.240.0 136.136.80.0 eth3 DD 5 255.255.252.0 136.136.88.0 eth4 R4 6 0.0.0.0 0.0.0.0 eth5 R5 A. Compute and give the lengths of each of the 6 masks. B. Which routes are prefixes for which other routes? C. For each of the following destination addresses, give the route (number) R0 would put a packet with that destination address on. (There are many ``longest prefix'' issues.) C1 128.235.32.242 C2 128.234.32.243 C3 136.136.89.89 C4 136.136.72.72 C5 136.136.81.81 C6 136.136.96.96 Hand in. ------ 03/10/2006. There will be a quiz on 03/10/2006. One question ``very similar'' to one of the questions I asked on 02/17. One question ``I could have asked 02/17 but did not''. While grading midterm I, my impression was that there are a few students who work hard but not efficiently. Try to study more efficiently. How do you prepare for the question ``draw an IP header ...'' (etc)? Answer: Do it! Look (briefly) at you notes. Then answer the hypothetical question. Then compare, see where you went wrong, do it again. If you do this a couple of times on a couple of nights the material will be firmly embedded in your brain. Also: Make sure you think of items ``in context'', not as a bunch of loose facts. For example, the fragmentation offset has 13 bits and is expressed in units of 8 bytes. These are not 2 facts: Together they are one fact. (If we had only 12 bits for the fragmentation offset, the units would have to be units of 16 bytes.) Because I missed a class meeting we will henceforth meet Friday 6:00 - 9:25. That starts 03/10. Read Comer Ch pp 155 - 172 (Ch 10). I already covered most of that in class. I will not cover it again, unless you have questions. Read carefully and ask questions. Please play with ping and traceroute. Inside NJIT as well as outside NJIT (public ping sites and public traceroute sites, etc). Do not hand in. On 03/10 I will cover some more ``ping - related'' stuff (not in the book) and assign homework about it for 03/24. --- 03/20/2006 (Monday) Noon. Hand in project A. By Email. Try to have project B essentially done. --- 03/24/2006 Read Comer pp 175 - 184 (Ch 11: UDP) Read Comer pp 187 - 211 (first half Ch 12: TCP) Find two computers that you can log on to and that are on the same LAN. (For example lafite and mouton). Use arp to verify that they are indeed on the same LAN. (How can you force computer A to add computer B to its ARP cache, assuming they are on the same LAN? Do not hand in.) 1. Determine the DataRate of that LAN using ping. Hand in. Also hand in the plot of RTT vs ping size that you use for this determination. Do, but do not hand in, the following: Do the same experiment with two computers not on the same LAN. Use traceroute to measure the number of routers in-between the computers. Make the plot of RTT vs ping size. See whether the results make sense. See whether you can observe the effect of fragmentation. --- 03/31/2006 Tentatively: Midterm II. Read Comer pp 211 - 231 (second half of Ch 12: TCP) Read Comer pp 235 - 245 (Ch 13: start of Routing) It is strongly recommended that students re-read Chapters 1, 2, 3, and 10, as soon as we finish covering TCP. These chapters may make more sense now that you have seen 4 layers! --- 04/07/2006 Read Comer pp 249 - 268 (Ch 14: more Routing) Read Comer pp 271 - 294 (Ch 15: finish Routing) Read the FTP tutorial on the CIS456 General Pages. Read the TCPdump tutoril in the CIS456 Spring 2006 Pages. Look at the other files there as needed. Do the ``homework'' in the TCPdump tutorial. Do not hand in. Midterm II. Comprehensive. All notes, reading, etc up to 03/31/2006. All home work up to 04/07/2006. That includes TCPdump homework for 04/07/2006. Sample question 1. Draw in detail the header of a TCP packet without options. For each field, give size (bits) and meaning. Where appropriate, explain units. Flags: try to give them all, and in right order. If you give them in wrong order, don't worry. (Similar: IP header, UDP header.) 2. Question like in the TCPdump tutorial are likely! --- 04/14/2006 no class: Good Friday. --- 04/17/1006 (Monday) Noon. Hand in project B. By Email. This is a HARD deadline. If you hand in later I will certainly deduct points and there is a good chance I will not grade your project due to finals etc. Try to hand in your projects A and B both on 03/20. --- 04/21/2006 Read Comer pp 297 - 324 (Ch 16: Multicast, IGMP) Read Comer pp 349 - 361 (Ch 19: NAT and VPN) (out of sequence) If you did not do so before: Read the TCPdump Tutorial on my website. Do the excercises described there. Make that for each of the three files clean1twopack , clean2twopack , clean3twopack you study a couple of the packets in detail. WILL be asked on final! STRONGLY recommended: On a computer you have ``root'' or ``superuser'' or ``owner'' access to (for example your PC or your laptop), get a ``packet sniffer'' working. Turn on your packet sniffer and do something like ftp a couple of files, ssh to another computer, surf the web. Then look at the trace you created. Make sense out of it. --- 04/28/2006 Read Comer pp 561 - 580 (Ch 31: IPv6) (out of sequence) And (hopefully) 2 more chapters, to be determined. Likely topics are: VoIP, FTP, MPLS. Do the next problem. Do not hand in. A variation on this problem WILL be asked in the Final exam. Router R1 is in a domain that uses RIP1. It has a combination routing table / forwarding table as follows: network 1 2 3 4 5 6 7 8 9 10 11 12 13 14 distance 1 1 1 2 2 2 2 4 5 6 7 8 9 9 outp interf 1 2 3 1 1 2 3 1 1 2 3 1 2 3 next hop DD DD DD R2 R3 R4 R5 R2 R3 R4 R5 R2 R4 R3 (To save space, networks are given by name, not address, next hops are given by name, not address, and many networks that should be there are not listed). 1. Suppose the domain uses ``Split Horizon''. Give the Router Update R1 next sends to R2. 2. Suppose the domain uses ``Poison Reverse''. Give the Router Update R1 next sends to R2. 3. Further disregard 1 and 2 above. R1 still has the same Routing / Forwarding Table. Suppose R1 next receives the following Router Update from R3: network 1 2 3 4 5 6 7 8 9 10 11 13 14 15 distance 16 16 16 16 1 16 3 3 5 4 6 5 7 5 3A. Does this domain use Split Horizon? Poison Reverse? 3B. Based on the above, what is the ``actual'' hopcount from R3 to Network 4? In R3, what is the ``next hop'' for the route to network 4? 3B. Construct the new routing / forwarding table in R1 after is has received and digested the update fom Router R3. Hint: Formally speaking, you do not need to make a drawing of the domain (the part that you know about) in order to answer questions 3A and 3C. I recommend you do it anyhow (the first time). So during the exam you may not need to: you have seen it all. :-) . When you make a drawing, put a ``dotted line'' from (e.g.) Router R2 to network 12: I have not given you information about other networks and routers on that path. But you ``know'' the hopcount. Similar for other paths you can not completely reconstruct. --- 05/02/2006 We have class on TUESDAY May 02(!) 6:00 - 9:25. I plan to handle IPv6 on Tuesday 05/02, plus other unfinished business. I will NOT do a review, but I WILL answer all question. --- 05/05/2006 Final Exam. There WILL be a question on material covered on 05/02/2006. --- I recommend you keep the textbook. Homework for the summer (do not hand in :-) ): Try to read Comer I chapters 20 and 21. If you absorbed the material in this course it will not be difficult, but it still will be a lot of work. And a good investment. You can also take the graduate course CIS 604 (Client-Server Programming, or Network Programming). You do NOT need CIS 456 as a prerequisite for CIS 604, but it helps put things in context. There are more graduate courses in networking you can take. For example CIS 656 (the graduate version of CIS 456), CIS 652 (take it from Professor Borcea if you have the chance), etc. In the fall of 2005 the two best students in my section of CIS 656 were undergraduate students! Other recommended courses: CIS 458, CIS 696. More homework for the summer: read the rest of Comer I. If you absorbed the material in this course, you know enough to further do a lot of studying on your own. Hope you learned a lot, and a lot of useful stuff, in this class.