Subject: ids on netlab machines (This message is being sent to all CPSC 826 students) I have created for you an NIS id and space on a file server. You MUST immediately set a password on that account!!! To do so: (1) telnet or rlogin to machine netlab1. You will not be required to supply a password. (Depending upon where you try to login you may first have to get into a CS machine). (2) use the yppasswd command to set a password. Any accounts not protected by Saturday will be protected by me! Subject: Aaarggh.. (This message is being sent to all CPSC 826 students) netlab1 is actually known to the outside world as netlab-gw Subject: id's (This message is being sent to all CPSC 826 students) I get ID's from University Class rolls. Thus if you wish to get into netlab-gw you MUST use your university id and not some "proprietary" dept id.. Subject: one more time (This message is being sent to all CPSC 822/6 students) If you were having trouble getting it to set your password please try again now. I had failed to restart one of the daemons after changing some stuff around. Subject: Assn 1 (This message is being sent to all CPSC 822/6 students) See assn1.s02 in the class directory Subject: Assn 1 - Correction!!! (This message is being sent to all CPSC 826 students) Today I mistakenly said in class use one sender thread and n-receivers. What I should have said was that you need n senders and one receiver. Sorry about the confusion there. Subject: Violation of rules (1) and (2) regarding assignments (This message is being sent to all CPSC 826 students) Rule 1 - DON"T test on netlab1. It is a critical gateway machine Rule 2 - BE CAREFUL and don't leave high speed pings running 10 minutes ago on netlab1 I observed the following: PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME COMMAND 11619 Mr. X 19 0 316 264 180 R 99.9 0.2 965:51 run 15127 westall 12 0 1224 1224 956 R 2.8 0.9 0:00 top 1 root 8 0 168 128 108 S 0.0 0.1 0:04 init 2 root 8 0 0 0 0 SW 0.0 0.0 0:00 keventd 3 root 9 0 0 0 0 SW 0.0 0.0 0:10 kswapd 4 root 9 0 0 0 0 SW 0.0 0.0 0:00 kreclaimd 5 root 9 0 0 0 0 SW 0.0 0.0 0:01 bdflush Mr. X's true identity has been obscured to save him embarassment... THIS TIME. (and yes it was Mr. X and not Ms. X.) Subject: Ping reachability (This message is being sent to all CPSC 826 students) You will notice that pings sent from netlab2-6 will only be responded to by netlab1-6. This occurs because 192.168.x.x is a reserved block of globally unroutable addresses. I plan to reboot netlab1 tomorrow around 10 a.m. and turn off the ability to create raw sockets. This will make it impossible for other Mr. or Ms X's to run their ping programs at all on netlab1. I will also turn ON IP masquerading at that time so as enable pinging of external addresses. If you are logged on to netlab2-6 at the time of the reboot your session will hang (but should recover after the reboot). Subject: Ping reachability (This message is being sent to all CPSC 826 students) netlab1 has now been modified so that: (1) you can't run your ping program there any more (I hope!) (2) you can reach any system in the world from the other netlabs Thus you need to use EXTREME CARE that you do not launch a ping flood attack on any external machine as Mr. X did to an internal machine yesterday. For this reason you should ping ONLY internal netlab hosts until you are 110% sure your program is working correctly. If you do ping an external host be sure to use a ping interval no SMALLER than 1 second. Subject: Additional gateway + timedwait (This message is being sent to all CPSC 826 students) I am still unsure what caused netlab1 to lose contact with the file server (and thus cause logins to hang). I have set up an alternate gateway: curly Please use this ONLY if netlab1 becomes ill again, and notify me ASAP if this should happen. -------------------------- Apparently how to use the pthread system is a source of great trouble to some. Here is an example of how to use timedwait. The example below works in units of full seconds. Your mission is to convert it to milliseconds. 40 41 while (more) 42 { 43 pthread_cond_timedwait(&t_cond, &t_mtx, &timeout); 44 snmpsend(); 45 timeout.tv_sec += timeinc; 46 sent += 1; 47 } 48 } t_code and t_mutex are initialized cond var and mutex. Subject: Assn clarifications (This message is being sent to all CPSC 826 students) 1) Don't try to use setsockopt to try to set ttl Do build your own header. 2) You should print the statistics just like Linux does (except you will have one set for each dest) 3) No special time out is needed. Just do as regular linux does: [root@jmw4 westall]# ping 192.168.4.5 PING 192.168.4.5 (192.168.4.5) from 192.168.2.66 : 56(84) bytes of data. --- 192.168.4.5 ping statistics --- 19 packets transmitted, 0 packets received, 100% packet loss EOT ==> Subject: Assn clarifications (This message is being sent to all CPSC 826 students) netlab woes. Apparently the netlab-gw has been wedged again. I will check into shortly. Please do not use netlab1 as the TARGET of pings either. It would not surprise me if some seriously corrupted IP packets could cause it to gag. If other machines become hung you may reboot them by pressing the lower of the two buttons on the front of the CPUs (which are located on the shelf in G-30. Subject: Netlab woes (This message is being sent to all CPSC 826 students) netlab (for the moment at least) has recovered. I'm still not exactly sure what precipitated the troubles. netlab4 had transmitted 475,000,000 packets which is quite a lot of pings. At the maximum rate of 100 pings / second that would take 4,750,000 seconds or more than 2 weeks. Therefore please take care to ensure that your timedwait is working correctly. A good plan is to put a printf after each transmission and ensure that lines are appearing on your screen no faster than they should. Another good plan is to NOT implement the ping loop at all until you have successfully sent and received one ping (and thus know that you have successfully constructed an correct IP packet). Finally, please do not ping anything other than netlab2-6 until you are 100% confident that your program is working correctly. I would also appreciate it if whoever was testing around 12:06 today could be especially careful. Home directories are no longer available on netlab1, but that will not prevent you from Since I haven't identified a definitive cause I can't be sure it won't recur. If it does, let me know and I will fix it asap and/or extend the due date. Sorry about these problems. mw Subject: more problems... (This message is being sent to all CPSC 826 students) I'll try to reconfigure some things this time and see if it makes any difference.. Meanwhile things will be out of business again for a while. Subject: netlab reconfigured (This message is being sent to all CPSC 826 students) I think I have finally gotten the configuration back to where it was last semester. Hopefully it will prove to be more stable. If it remains stable, I will add one day to the due date for the assigment to compensate for the lost time today. Subject: Living on the edge (This message is being sent to all CPSC 826 students) Some teams have correctly observed that it is no longer possible to ping the "outside world" and requested that the capability be restored. I will restore that capability on Monday after class. For now it seems to be better to stick with (what appears to be) a more stable configuration.. One team expressed concerns regarding how to test with windows and/or big endian clients. This is, fortunately, not generally a problem in network programming at this level. If you are constructing headers that Linux clients can consume then you have defeated byte order problems. Subject: Mr. X unmasked (This message is being sent to all CPSC 826 students) Apparently some folks can unfortunately learn only the "hard way". Recall last weeks DoS attack (inadvertently?) launched by the intrepid Mr. X from netlab4 PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME COMMAND 11619 rgidwan 19 0 316 264 180 R 99.9 0.2 965:51 run 15127 westall 12 0 1224 1224 956 R 2.8 0.9 0:00 top Well he is back, and yesterday was testing away on netlab1 despite all of my demands, pleas, etc to the contray: rgidwan 4113 0.0 0.1 42692 192 ? S Feb02 0:00 ./a.out -i 1000 - root 4178 0.0 0.0 1716 4 ? S Feb02 0:00 in.telnetd: comet Mr. X has now had is ID disabled. It will remain so until he appears at my office to explain just why it is that he feels my instructions apply to everyone but him!! Thanks to the rest of the class for attempting to follow my instructions (which were put in place to give EVERYONE a stable environment on which to test.) Subject: World available (This message is being sent to all CPSC 826 students) The world is again available from netlab2-6. PLEASE be careful to ensure that you do NOT (1) flood ping anyone external even for 1 second or (2) ping anyone external for more than a few seconds. The last thing we need/want around here is for the CERT to come knocking on our door!! Subject: Interesting problem (This message is being sent to all CPSC 826 students) The current problem with netlab1 appears to be some sort of research exhaustion: 1897 Feb 4 12:14:25 netlab1 kernel: nfs: task 217 can't get a request slot 1898 Feb 4 12:15:28 netlab1 kernel: nfs: task 218 can't get a request slot 1899 Feb 4 12:15:59 netlab1 kernel: nfs: task 219 can't get a request slot which goes on forever. I can't really tell if this is a direct result of masquerading (which is what allows you to reach the outside world). I am going to try one more thing: to reboot and enable masquerading on the ethernet interface but not on the interface that reaches the NIS and NFS server. If that doesn't work we will just go back to no access to the outside world for now. Subject: One more attempt.. (This message is being sent to all CPSC 826 students) In addition to the routing change I am also intentionally not mounting home directories on netlab1 since NFS seemed to be at the root of the problem. Subject: Assignment turnin directories (This message sent to all 822/826 students) Assignments will be placed in the following directories: /local/share/home/turnin/82x/an/your-user-id where x = 2 or 6 and n = 1, 2, 3, .... When working as a team SUBMIT INTO ONLY ONE TEAMMATE's DIRECTORY. Make sure the name of BOTH team members appears on all code though. Do NOT change the permissions on the directories. 826 students should submit ping programs by 23:59 TODAY 822 students should submit semapore device drivers AND test applications by 10:00 AM Thursday. Subject: Ping questions: (This message is being sent to all 826 students) 1 - How do I compute mdev? the value of mdev doesn't seem to be well defined in the ping man page and so you may just compute the stddev if you wish (so that you don't have to remember individual times). If you have computed mean absolute dev already that will be OK to. 2 - Should I print out other ICMP messages (such as caused by TTL reaching 0 and my ping being discarded). NO. Subject: How to dump a packet (This message is being sent to all 826 students) I would not have expected this to be a difficult task, but in case it is this will do it: int xtp_dump( unsigned char *hdr, /* E.G. "Here is my header" */ unsigned char *loc, /* Pointer to data to dump */ int amt) /* number of bytes to dump */ { int i; printf("\n %s \n", hdr); for (i = 0; i < amt; i++) { printf("%02x ", *(loc + i)); if ((i % 4) == 3) printf("\n"); } printf("\n"); } Subject: Ping abnormalities (This message is being sent to all 826 students) I have a had a couple of questions to the effect of "my program used to work fine but now... Is there something wrong with netlab??" 1 - If someones broken program is unleashing a ping flood it IS conceivably possible that a correct program would see unusual loss rates However, 2 - If "regular" ping continues to function just fine then it almost certainly indicates that the problem lies not with the system!! If a pair of systems can be identified in which regular ping fails, let me know and I will either kill the broken program or authorize reboot of the system. Subject: PLEASE be careful in testing (This message is being sent to all CPSC 826 students) A tour of the netlab reveals the following problems: The 9th column reveals the time the process was started. The system time at which the tour was taken is given below. I have killed all of the processes listed below. I would REALLY appreciate it if when I make it into the office tomorrow am there aren't any new editions of these fellows. Netlab2: kpadwal 17744 0.0 1.1 2484 1488 pts/2 S 20:55 0:00 -bash kpadwal 17875 0.1 0.3 1968 428 pts/2 T 21:12 0:04 ./a.out -h 4 -i 1 kpadwal 17888 0.6 0.3 1968 428 pts/2 T 21:20 0:16 ./a.out -h 4 -i 1 kpadwal 17890 0.3 0.3 1968 428 pts/2 T 21:21 0:08 ./a.out -h 4 -i 1 Wed Feb 6 22:01:02 EST 2002 Netlab3: rporuma 16729 0.0 0.7 7876 896 ? S 20:32 0:00 ./a.out 100 netla Wed Feb 6 21:07:03 EST 2002 Netlab4: Netlab5: rporuma 14573 0.0 0.2 11972 260 ? S 01:56 0:00 ./a.out 100 netla rporuma 14674 0.0 0.2 14020 260 ? S 02:09 0:00 ./a.out 100 netla Wed Feb 6 21:17:41 EST 2002 Netlab6 kpadwal 4724 0.0 1.1 2484 1488 pts/4 S 19:44 0:00 -bash kpadwal 4762 0.1 0.3 1968 428 pts/4 T 19:46 0:05 ./a.out -h 4 -i 100 netla kpadwal 4771 0.0 0.3 1968 428 pts/4 T 19:48 0:04 ./a.out -h 4 -i 100 netla kpadwal 4781 0.0 0.3 1968 428 pts/4 T 19:50 0:02 ./a.out -h 4 -i 100 netl Wed Feb 6 21:10:38 EST 2002 Subject: Assn 2 (This message is being sent to all CPSC 826 students) see assn2.s02 Subject: Assn clarifications (This message is being sent to all CPSC 826 students) 1) For implementing dynamic timeout for recovering from lost poll req or response, is it a good idea to create a thread which timesout when a poll response is not received and kills the receiving thread(which is blocked in recvfrom() ) and starts it again after sending the new poll request ? -- It is a good idea to have a thread which periodically timesout to recover from loss poll/stats -- It is unnecessary and a bad idea to kill other threads and restart them. A better idea is to use cond_wait and cond_broadcast 2) By varying burst size, do we only vary number of packets to be sent in each burst or do we also vary the size of each packet? -- The size of the packets should be FIXED for a given run. I failed to specify how the client a.out should be started: a.out host-name port-# packet-size-in-user-bytes e.g. a.out yoda 33333 1250 3) what is rationale behind running the server and client on same machine? -- I'm not sure why this was asked. It should provide the EASIEST environment in which to work so it might be a reasonable place to start. There won't be any drops 4) how do I vary the bandwidth? -- Don't worry about that yet. 5) you had mentioned in class, that we should not use pthread_condtimedwait(),but i can't recollect, where it should not be used and why? Can you please tell it again . -- Its HOW you use it that is the issue. The BEST resolution you can hope to acheive is about 10 m_sec with this function. So if you are trying to use it in a strategy that involves waiting for a few microseconds between transmisssions IT WON"T WORK. However, it should be fine for something like controlling timeouts. Subject: Assn clarifications (This message is being sent to all CPSC 826 students) How many packets should be sent during a run? Ans: That should also be a parameter that can be passed in at startup time. a.out host-name port-# packet-size-in-user-bytes number-of-packets e.g. a.out yoda 33333 1250 100000 Subject: More clarifications (This message is being sent to all CPSC 826 students) Isn't the number of packets going to change as the drop rate changes???? Ans: No. If the parameter is 100,000 you send 100,000 packets. The drop rate is then the number of packets dropped / 100000. Does the packet size include the udp&ip headers as well as the application header or is this size simply the data size???? Ans: Note that both msg.027 and msg.028 described the packet size field in the following manner: a.out host-name port-# packet-size-in-user-bytes This says to me that the size specifed defines the number of user bytes to be sent in each packet. This CLEARLY excludes udp, ip, and link header data, but could be ambiguous with regard to the app header. I do consider the application header to be part of the user data. In other words write(sock, buf, packet-size-in-user-bytes) is what we are after here. Subject: Assn 2 testing (This message is being sent to all CPSC 826 students) Netlab machines are now configured as follows for testing Netlab Tx Bw Rx Bw 2 155Mbps 155 Mbps 3 155Mbps 155 Mbps 4 25Mbps 25 Mbps 5 5Mbps 25 Mbps 6 0.5Mbps 25 Mbps If netlab 5/6 is rebooted it will be necessary to manually reconfig the bandwidth. Subject: Client output (This message is being sent to all CPSC 826 students) Q: What sort of output should the client print? A: When I test your programs I will rely upon my SERVER output to provide throughput / drop figures. It is FINE if you print ERROR info such as failure to connect, fail to close, or your view of final stats. It is BAD if your final submission dumps a mountain of debugging info such as time-stamped records of every packet sent/lost/received. It is IMPERATIVE that YOUR client interoperate correctly with MY server. Any server submissions will NOT be used!!!! mw Subject: Test runs (This message is being sent to all CPSC 825 students) Test runs should be on the order of about 1 minute in duration. Instead of trying to do reservations for time quanta this small, let us use a CSMA-CD approach with random backoff. Before making a run, see if a.out's are running on your intended (source, dest). If so wait a small random amount of minutes and look again. When you find them to be not running start yours and then look again. If you find two running abort yours. If you find a single a.out that runs for more than 2 minutes, flame the owner and copy me so that I can too. Subject: Assignment due date (This message is being sent to all CPSC 826 students) I have received a number of requests to postpone the assignment. From my perspective, because of the minor penalty a 2 day late is virtually free. Anyhow, I will postpone it until Sunday at 11:59pm because of my policy of not having project n+1 due until project n has been returned. Given the way my semester is progressing that may (but hopefully won't) mean that all projects are postponed forever! Subject: netlab1 leaking oil (This message is being sent to all cpsc 826 students) The nsf client code seems to have some sort of resource leak which eventually makes it impossible to access the home directory space. It looks as though I am going to have to reboot it in order to correct the problem. After I do that I am not going to remount the home directories (which I did a few days ago in response to a student request). you can use scp to copy to/from the dept machines. Subject: Assn1 grades (This message is being sent to all CPSC 826 students) I'll be sending them out shortly. If you worked with a partner please forward them a copy. One persistent problem that I noted was the apparently wide-spread view that it is illegal or immoral to break up single logical C statement so that it occupies multiple physical lines. It is perfectly legal and important to do for the sake of code readability. I have deducted a small "reminder" where needed. You might want to ensure that the problem is not also present in assn2 -- as the reminder there may be somewhat larger. E.G: Wrong (line was 255 bytes long!!): printf("%d packets transmitted, %d packets received, %d percentage packet loss\n",h[i].total_send_packets,h[i].total_recv_packets,h[i].total_send_packets != 0?(h[i].total_send_packets-h[i].total_recv_packets)*100.0/h[i].total_send_packets:0); Better: printf("%d packets transmitted, %d packets received, %d percentage packet loss\n", h[i].total_send_packets, h[i].total_recv_packets, h[i].total_send_packets != 0 ? (h[i].total_send_packets-h[i].total_recv_packets) * 100.0 / h[i].total_send_packets : 0); Subject: How to copy files to turnin directory (This message is being sent to all CPSC 826 students) If you have been having trouble copying files from CS dept machines to the turnin directory, please follow these instructions. login to machine curly scp jmw:whatever.ps . scp jmw:whatever.tex . mv whatever.ps /local/share/home/turnin/826/a3/whoever Subject: SNMP assignment now available (This message is being sent to all CPSC 826 students) See assn3.s02 Subject: Assn 3 question (This message is being sent to all CPSC 826 students) > 3. Is it a good idea to create a separate sender thread for each interface > specified or would only using a single sender thread be good enough ? > That one be a bad idea. You should send ONE packet to retreive ALL the needed data. Subject: More assn 3 questions.. (This message is being sent to all CPSC 826 students) - The number of incoming packets is ifInUcastPkts + ifInNUcastPkts, (the same for outgoing), is this correct? No, don't worry about ifInNUcastPkts. Use only ifInUcastPkts - Do bytes "05 00" terminate the whole message or each sequence? These should terminate ONLY the whole message - Do we always have three interfaces specified as a command line parameter, or an arbitrary number? An arbitrary number but you may assume it will NEVER be > 20. - Do we send only to 130.127.48.1? YYYYEEEOOOOWWWWWW NO NO NO NO NO!!!!!!!!!!!!!!!!!!!!!! As I tried to explain in class it is IMPERATIVE that NO ONE send to 130.127.48.1 until they are absolutely, positively convinced that there are ZERO defects in their application. (CAREFULLY) use netlab1 for testing. - And, is it better to create a connected socket and use read and write, or bind and do sendto and recvfrom? This should not really make a significant difference. For debugging purposes I again encourage a hex dump routine Subject: More assn 3 questions.. (This message is being sent to all CPSC 826 students) - Aren't we suppose to use the snmp_api functions like snmp_open, snmp_send,snmp_read,snmp_sess_init etc ... to open an snmp session, send and create snmp messages? You may, if you wish, but I, personally, have never used that API and so I may not be a very good source of insights there. When I did the assignment I just built up and decoded the messages using BER's rules for building TLV encoded messages. Subject: More assn 3 questions.. (This message is being sent to all CPSC 826 students) - Suppose we have 'n' interfaces in the command line, then the packet to be sent should contain 4n requests (4 for ip, ib, op, ob). Is that what you mean by saying ALL requests should be in a single packet ? Yes - What if something like the specification of an invalid interface # causes an error message to be returned. Just print the error status and the error index and exit. Subject: Assn 3 (This message is being sent to all CPSC 826 students) It is apparently the case that 130.127.48.1 no longer responds to snmp gets with the community public. jmw Subject: Assn 3 turnin directory (This message is being sent to all CPSC 826 students) I had failed to create the directory, but it should be available now. mw Subject: Assn3 test hosts (This message is being sent to all CPSC 826 students) The machine killeen-lane has a is running snmpd and has a fairly large number of active interfaces. netlab2 ==> ps -aux | grep a.out kpadwal 24506 0.0 0.1 5976 144 ? S Mar31 0:00 ./a.out netlab1 3 gnaga 27429 0.0 0.1 18116 168 ? S Mar31 0:00 ./a.out killeen-l gnaga 27928 0.0 0.1 18116 168 ? S Mar31 0:00 ./a.out killeen-l westall 21330 0.0 0.4 1620 596 pts/4 S 19:47 0:00 grep a.out netlab3 /home/westall ==> ps -aux | grep a.out rporuma 22226 0.0 0.1 18116 164 ? S Mar31 0:00 ./a.out killeen-l Subject: Assignment evals (This message is being sent to all CPSC 826 students) I have emailed assn 3 reports to the owner of the directory in which it was submitted. These mails were directed to the dept system. I will return the assn 2 reports in class tomorrow along with a cumulative grade summary including exemptions from the final and makeups. Subject: Grade updates I will be sending out grade updates shortly. The first number will be your M2 grade, the second your M1 and the third you current average. M1 had a total of 47 pts and M2 37. However, all quizzes are normalized to a 100 pt scale BEFORE the average is taken. The A cutoff is now 89 and the B 80. Please let me know if you plan on taking the final exam. (There is only one person with an 88 average for which the final has any realistic chance of altering the final grade.) (But that person needs to prepare MUCH more throrougly than was done for the makeups!)