Homework 6 Solutions

 

12.1     Consider a file currently consisting of 100 blocks. Assume that the file control block (and the index block, in the case of indexed allocation) is already in memory. Calculate how many disk I/O operations are required for contiguous, linked, and indexed (single-level) allocation strategies, if, for one block, the following conditions hold. In the contiguous allocation case, assume that there is no room to grow in the beginning, but there is room to grow in the end. Assume that the block information to be added is stored in memory.

a. The block is added at the beginning.

b. The block is added in the middle.

c. The block is added at the end.

d. The block is removed from the beginning.

e. The block is removed from the middle.

f. The block is removed from the end.

 

 

Contiguous

Linked

Indexed

A

201

1

1

B

101

52

1

C

1 (or 101ish)

3

1

D

198

1

0

E

98

52

0

F

0

100

0

 

 

12.4     Why must the bit map for file allocation be kept on mass storage, rather than in main memory?

 

In case of system crash (memory failure) the free-space list would not be lost as it would be if the bit map had been stored in main memory

 

 

12.12   Explain why logging metadata updates ensures recovery of a file system after a file system crash.

 

                In the case of a system crash, the system will be able to determine all metadata updates that did not finish. Using this information, it will be able to redo those updates to keep the file system in a consistent state.

 

 

12.13    Explain how the VFS layer allows an operating system easily to support multiple types of file systems.

 

            The VFS provides a layer of abstraction for the operating system. It allows the operating system to make general file system calls without knowing which specific file system it is talking to. The VFS deals with figuring out how to translate these calls into something that the current file system will understand.

           

 

15.4     What network configuration would best suit the following environments?

a. A dormitory floor

b. A university campus

c. A state

d. A nation

 

a.        LAN

b.       LAN

c.        WAN

d.       WAN

 

 

15.8     Why would it be a bad idea for gateways to pass broadcast packets between networks? What would be the advantages of doing so?

 

All broadcasts would be propagated to all networks, causing a lot of network traffic. If broadcast traffic were limited to important data (and very little of it), then broadcast propagation would save gateways from having to run special software to watch for this data (such as network routing information) and rebroadcast it.

 

 

15.11   The original HTTP protocol used TCP/IP as the underlying network protocol. For each page, graphic, or applet, a separate TCP session was constructed, used, and torn down. Because of the overhead of building and destroying TCP/IP connections, there were performance problems with this implementation method. Would using UDP rather than TCP have been a good alternative? What other changes could be made to improve HTTP performance?

 

UDP would probably not be a good alternative. Although UDP would alleviate the overhead of creating and destroying connections, it has the potential to drop packets.

 

If you came up with any reasonable ideas for other improvements, I accepted them.

               

 

15.15   Process migration within a heterogeneous network is usually impossible, given the differences in architectures and operating systems. Describe a method for process migration across different architectures running:

a. The same operating system

b. Different operating systems

 

a.        You could attempt to implement a protocol that is invisible to the process. The OS would handle transferring the process around.

b.       This would probably be very complicated because there is virtually no common ground. Processes would need to have knowledge of different OS/hardwares and a protocol would need to be established with some layer of abstraction (possibly similar to the VFS).