One student asked me how to read options. That bothers me! A graduate student in CS should not need to ask that. OK, some help. 1. If (HLEN == 5) There are no options. just read the 5 lines and do your thing. 2. If (HLEN > 5) There are options. Read the first 5 lines, do your thing. Then: Loop: Read the next octet. (i) If this is 1 it is No-Op and the next octet is the first octet of the next option. Else (ii) If this is 0 it is EoO and ... Else (iii) If this 137 it is the first octet of a SSR option. In that case read the next octet: the Length octet. That gives L. Read the next L-2 octets. This completes reading the SSR option. Handle it. Compute how many option octets you have read thus far. If it equals HLEN*4 - 20, you are done with reading options. If it is less than HLEN*4 - 20, you must read the next option. Else (iv) If it is 7 it is the first octet of a RR option. (similar) etc. Until you are done with the option. Than: check how many option octets you read. If it equals HLEN*4 - 20, you are done with reading options. If it is less than HLEN*4 - 20, you must read the next option. (Do the loop again). Teun Ott. Warning: There are always HLEN lines of input for a packet. That I will never do wrong. It is conceivable I will have other errors in my input, so you can not read (L-2) more octets after reading L, etc. I do not greatly care you report that kind of things correctly, but make sure your program recovers and does the next packet right.