|
|
Parent Directory
| Review Questions:
Brett Lee
==============================================================================
1. In establishing a TCP connection, what three packets are exchanged and in
what order?
2. In a /17 subnet, how many usable IP's are there?
3. In a unix filesystem, "files" have three properties associated with them.
What are the names of these properties ?
part 2: what does "ctime" reflect?
4. Rank these actions from fastest to slowest:
- reading from cache
- context switch
- reading from RAM
- reading from a register
5. How many bytes are in a MAC address?
6. What does setting the sticky bit on a directory do?
7. What transport layer protocol does DNS use?
8. Explain the difference between a hard link and a symbolic link?
9. Using your favorite language, how would you print out the lines of a file
in reverse order?
10. Explain the entire process that occurs after typing in 'telnet foo.com'?
11. What is a context switch?
12. What is the valid range of exit codes from an 8-bit program?
13. What do you get when you bitwise AND the IP address && subnet mask?
14. How would the OS determine the broadcast address for an IP subnet?
15. How does the OS determine where to route the packet?
Answers:
----------------
1. SYN, SYN-ACK, ACK
2. 32766
/17 = 255.255.128.0 = 11111111.11111111.10000000.00000000
count the 0's - you get 15, so: (( 2^15 ) - 2) = 32766
or, remember that:
/24 = 11111111.11111111.11111111.00000000 = 256
/16 = 11111111.11111111.00000000.00000000 = 65536
then you can just double (or half) your way between /16 and /24.
i.e. /17 = (( 65536 / 2 ) - 2 ) = 32766
3. mtime, atime, ctime
part 2: the last time the inode (not the file) was changed
4. I don't know for sure. :) Here's what I think.
If both contexts are in the CPU cache:
Reading from a register
Reading from cache
Context switch
Reading from RAM
If one context is (even partially) in RAM:
Reading from a register
Reading from cache
Reading from RAM
Context switch
5. How many bytes are in a MAC address?
Six: 01:02:03:04:05:06
A MAC address is 48 bits long.
This means that there are 281,474,976,710,656 (2^48) possible MAC addresses.
A byte is 8 bits, and the range of decimal values for 8 bits is 256 (0-255).
In Hex format, this range is represented by two characters (00-FF).
Remember your bits: 0000 = 0
0001 = 1
0010 = 2
...
1111 = F
So 4 bits makes up half a byte (a nibble), and 8 bits make a byte (FF).
A MAC is 6 bytes, and six bytes times 8 bits per byte is 48 bytes.
6. What does setting the sticky bit on a directory do?
see: http://www.etpenguin.com/docs/pub/Reference/DOC_permissions.txt
7. What transport layer protocol does DNS use?
It can use either UDP or TCP. UDP is typically used for requests, but
TCP must be used for zone transfers.
8. Explain the difference between a hard link and a symbolic link?
see: http://www.etpenguin.com/docs/pub/Reference/DOC_inodes.txt
9. Using your favorite language, how would you print out a file in reverse?
see:
http://www.etpenguin.com/docs/pub/Language/_C-C++/C/file/reverseAfile.c
or, from Perl:
perl -0777e 'print scalar reverse <>' f1 f2 f3 ...
courtesy of http://www.ibm.com/developerworks/linux/library/l-p102.html
10. Explain the entire process that occurs after typing in 'telnet foo.com'?
see: http://www.etpenguin.com/docs/pub/Reference/DOC_TCPconnect.txt"
11. What is a context switch?
see: http://www.etpenguin.com/docs/pub/Reference/DOC_operation.txt
12. What is the valid range of exit codes from an 8-bit program?
see: http://www.etpenguin.com/docs/pub/Reference/DOC_exit-codes.txt
13. What do you get when you bitwise AND the IP address && subnet mask?
Answer: The network ID.
example:
192.168.0.2/24 =
192.168.0.2 && 192.168.0.0 =
11000000.10101000.00000000.00000010 && 11111111.11111111.00000000.00000000 =
11000000.10101000.00000000.00000000/24 =
192.168.0.0/24 ( 11000000.10101000.00000000 )
14. How would the OS determine the broadcast address for an IP subnet?
Find the network ID (Q.13) and fill the remaining bits with "ones."
15. How does the OS determine where to route the packet?
see: http://www.etpenguin.com/docs/pub/Reference/DOC_packetrouting.txt
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
In an effort to provide a service of value to the open source community, I've put together this website that containing many of my notes and references.
This website is not authoritative and it is certainly not without errors; it is a work in progress.
In addition to my contributions you will also find the work of others. Where the work is not mine, I have tried to indicate that, and to reference the source of the work: by citing the original author, retaining the authors' name and license wherever present, or by placing the work in a suitably named URL containg /external/ in the path. If you find any work here that should not be publically available, please send me a note and it will be removed.
As for my contributions, you are free to use any of *MY* notes or code from this website unless specifically instructed otherwise.
Brett Lee, Ph.D., President & CEO
Everything Penguin, Inc.
|
|
|