Warning: preg_match(): Delimiter must not be alphanumeric, backslash, or NUL in /var/www/html/activities/books/networking/labbook/exp/exp12.2.php on line 2

Warning: preg_match(): Delimiter must not be alphanumeric, backslash, or NUL in /var/www/html/activities/books/networking/labbook/exp/exp12.2.php on line 2

Warning: preg_match(): Delimiter must not be alphanumeric, backslash, or NUL in /var/www/html/activities/books/networking/labbook/exp/exp12.2.php on line 3

Warning: preg_match(): Delimiter must not be alphanumeric, backslash, or NUL in /var/www/html/activities/books/networking/labbook/exp/exp12.2.php on line 4

Warning: preg_match(): Delimiter must not be alphanumeric, backslash, or NUL in /var/www/html/activities/books/networking/labbook/exp/exp12.2.php on line 5

Warning: preg_match(): Delimiter must not be alphanumeric, backslash, or NUL in /var/www/html/activities/books/networking/labbook/exp/exp12.2.php on line 8

 

 


Douglas E. Comer


Computer Science Department
Purdue University
West Lafayette, IN 47907

webmaster: W. David Laverell


Companion Topics

Home

Book Information

Purpose of Site

Getting Started

Students

Faculty

"What's New"

"Coming Attractions"

"C Pointers"

Acknowledgements

 

 
Hands-On Networking: Experiment 12.2 Home > Student > Experiments > 12.2

Experiment 12.2

Chapter 12
12.1 12.2 12.3 12.4
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 Number 11 which asks you to look at values from the options field.



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