Experiment 12.2

Chapter Notes Sample Output
12.1 12.3
Everything said in the notes on Experiment 12.1 applies here. If you have finished 12.1, this experiment should not be too difficult and could be a lot of fun. On my SunBlade 100 running Solaris 8 I used /usr/include/inet/ip.h. One fascinating issue comes up in the computation of the payload. If you consult Professor Comer's description of The IP Datagram Header Format on page 324 of Computer Networks and Internets you will see that the header length is a half-octet. By the way, using the sizeof your ip header structure is cheating! So you have to figure out how to get the correct 4 bits from it. You have the advantage of knowing that it is 5, the unit being 32-bit words. The other 4 bits are 4 (at least at the time of this writing). So try this experiment: guess ahead of time whether you and the byte with 0xf0 or with 0xf. (Either way you have to shift the get the count in bytes.) In a survey of bitheads in our department two out of three said 0xf. That's correct. Please let me know if it is the opposite on your platform!

The Optional Extensions are well worth doing, especially the last which asks you to look at values from the options field.



This site is maintained by by W. David Laverell of the Computer Science Department at Calvin College.
For assistance or corrections, please contact him at lave@calvin.edu.