Showing posts with label 2 Marks. Show all posts
Showing posts with label 2 Marks. Show all posts

Saturday, December 19, 2015

CS2363-Computer Networks



Define computer network.

Computer network is a connection of autonomous computers and network devices for:
Resource sharing (data/devices) in an efficient manner Communication amongst them.

Compare simplex and duplex communication with example.

In simplex mode, the communication is unidirectional (Eg: keyboard, monitor).
In half-duplex mode, each station can both transmit and receive, but not simultaneously (Eg. walkie-talkie).
In full-duplex (also called duplex), both stations can transmit and receive simultaneously (Eg. telephone network). 

List the criteria based on which a network can be assessed.

Performance is based on its throughput (no. of packets delivered) and delay. Reliability is how much the network is fault tolerant.

Security includes preventing unauthorized access and recovery from breaches.

What are the two types of line configuration?

A point-to-point connection provides a dedicated link between two nodes.
In a multipoint connection, more than two nodes share a single link, i.e., bandwidth is shared amongst the nodes..

Classify LAN, WAN, MAN and Internetwork.

LAN is privately owned and links the devices in a single office, building, or campus. The LAN size is limited to a few kilometers. A LAN will use only one type of transmission medium. The speed of LAN is in the range 10–1000 Mbps.

WAN provides long-distance transmission of data, image, audio, and video information over large geographic areas that may comprise a country, a continent, or the whole world.
MAN is a network with a size between a LAN and a WAN. It normally covers the area inside a town or a city. It is designed for customers who need a high-speed connectivity to the Internet, and have endpoints spread over a city or part of city.

When two or more independent networks are connected, it becomes an internetwork or internet.

List the advantages of layering.

It decomposes the problem of building a network into more manageable components.

It provides a more modular design. To add a new service, then it is only needed to modify the functionality at one layer, reusing the functions at all the other layers.
Uses abstraction to hide complexity of network from application.

Define protocol.

The abstract objects that make up the layers of a network system are called protocols. Each protocol defines two different interfaces.

o  Service interface that specifies the set of operations

o    Peer-to-peer interface for messages to be exchanged amongst peers Protocol is a set of rules that govern communications between devices.

Friday, December 18, 2015

I/O SYSTEMS



1.How free-space is managed using bit vector implementation?

The free-space list is implemented as a bit map or bit vector. Each block is represented by 1 bit. If the block is free,the bit is 1; if the block is allocated, the bit is 0.

2.Define buffering.

A buffer is a memory area that stores data while they are transferred between two devices or between a device and an application. Buffering is done for three reasons

a.   To cope with a speed mismatch between the producer and consumer of a data stream
b.  To adapt between devices that have different data transfer sizes

c.   To support copy semantics for application I/O

3.Define caching.

A cache is a region of fast memory that holds copies of data. Access to the cached copy is more efficient than access to the original. Caching and buffering are distinct functions, but sometimes a region of memory can be used for both purposes.

4.Define spooling.

A spool is a buffer that holds output for a device, such as printer, that cannot accept interleaved data streams. When anapplication finishes printing, the spooling system queues the corresponding spool file for output to the printer. The spooling system copies the queued spool files to the printer one at a time.

5.What are the various disk-scheduling algorithms?

The various disk-scheduling algorithms are
a.  First Come First Served Scheduling
b.  Shortest Seek Time First Scheduling
c.  SCAN Scheduling
d. C-SCAN Scheduling
f. LOOK scheduling

Thursday, December 17, 2015

I/O SYSTEMS



1.What are the allocation methods of a disk space?
Methods of allocating disk space which are widely in use are
a.  Contiguous allocation
b.  Linked allocation
c.  Indexed allocation

2.What are the advantages of Contiguous allocation?

The advantages are
a.  Supports direct access
b.  Supports sequential access
c.  Number of disk seeks is minimal.

3.What are the drawbacks of contiguous allocation of disk space?

The disadvantages are
a.  Suffers from external fragmentation
b.  Suffers from internal fragmentation
c.  Difficulty in finding space for a new file
d. File cannot be extended
e.  Size of the file is to be declared in advance

4.What are the advantages of Linked allocation?

The advantages are
a.  No external fragmentation
b.  Size of the file does not need to be declared

5.What are the disadvantages of linked allocation?

The disadvantages are
a.  Used only for sequential access of files.
b.  Direct access is not supported
c.  Memory space required for the pointers.
d. Reliability is compromised if the pointers are lost or damaged

Wednesday, December 16, 2015

FILE SYSTEMS


1.What is a file?

A file is a named collection of related information that is recorded on secondary storage. A file contains either programs or data. A file has certain "structure" based on its type.

2.List the various file attributes.

A file has certain other attributes, which vary from one operating system to another, but typically consist of these:Name, identifier, type, location, size, protection, time, date and user identification

3.What are the various file operations?

The six basic file operations are

•  Creating a file
•  Writing a file
•  Reading a file
•  Repositioning within a file
•  Deleting a file
•  Truncating a file 

4.What are the information associated with an open file?

Several pieces of information are associated with an open file which may be:
•  File pointer
•  File open count
•  Disk location of the file
•  Access rights

Tuesday, December 15, 2015

Page Replacement Algorithms



1.What is Demand paging?

Virtual memory is commonly implemented by demand paging. In demand paging, the pager brings only those necessary pages into memory instead of swapping in a whole process. Thus it avoids reading into memory pages that will not be used anyway, decreasing the swap time and the amount of physical memory needed.

2.Define lazy swapper.

Rather than swapping the entire process into main memory, a lazy swapper is used. A lazy swapper never swaps a page into memory unless that page will be needed.

3.What is a pure demand paging?

When starting execution of a process with no pages in memory, the operating system sets the instruction pointer to the first instruction of the process, which is on a non-memory resident page, the process immediately faults for the page. After this page is brought into memory, the process continues to execute, faulting as necessary until every page that it needs is in memory. At that point, it can execute with no more faults.This schema is pure demand paging.

4.Define effective access time.

Let p be the probability of a page fault (0£p£1). The value of p is expected to be close to 0; that is, there will be only a few page faults. The effective access time is Effective access time = (1-p) * ma + p* page fault time.ma : memory-access time

5.Define secondary memory.

This memory holds those pages that are not present in main memory. The secondary memory is usually a high speed disk. It is known as the swap evice, and the section of the disk used for this purpose is known as swap space.

Monday, December 14, 2015

STORAGE MANAGEMENT



1.What is the main function of the memory-management unit?

The runtime mapping from virtual to physical addresses is done by a hardware device called a memory management unit (MMU).

2.Define dynamic loading.

To obtain better memory-space utilization dynamic loading is used. With dynamic loading, a routine is not loaded until it is called. All routines are kept on disk in a relocatable load format. The main program is loaded into memory and executed. If the routine needs another routine, the calling routine checks whether the routine has been loaded. If not, the relocatable linking loader is called to load the desired program into memory.

3.Define dynamic linking.

Dynamic linking is similar to dynamic loading, rather that loading being postponed until execution time, linking is postponed. This feature is usually used with system libraries,such as language subroutine libraries. A stub is included in the image for each library-routine reference. The stub is a small piece of code that indicates how to locate the appropriate memory-resident library routine, or how to load the library if the routine is not already present.

4.What are overlays?

To enable a process to be larger than the amount of memory allocated to it, overlays are used. The idea of overlays is to keep in memory only those instructions and data that are needed at a given time. When other instructions are needed, they are loaded into space occupied previously by instructions that are no longer needed.

5.Define swapping.

A process needs to be in memory to be executed. However a process can be swapped temporarily out of memory to a backing store and then brought back into memory for continued execution.This process is called swapping.

Sunday, December 13, 2015

banker’s algorithm



1.Define deadlock prevention.

Deadlock prevention is a set of methods for ensuring that at least one of the four necessaryconditions like mutual exclusion, hold and wait, no preemption and circular wait cannot hold. By ensuring that that at least one of these conditions cannot hold, the occurrence of a deadlock can be prevented.

2.Define deadlock avoidance.

An alternative method for avoiding deadlocks is to require additional information about how resources are to be requested.Each request requires the system consider the resources currently available, the resources currently allocated to each process, and the future requests and releases of each process, to decide whether the could be satisfied or must wait to avoid apossible future deadlock.
3.What are a safe state and an unsafe state?

A state is safe if the system can allocate resources to each process in some order and still avoid a deadlock. A system is in safe state only if there exists a safe sequence. A sequence of processes <P1,P2,....Pn> is a safe sequence for the current allocation state if, for each Pi, the resource that Pi can still request can be satisfied by the current available resource plus the resource held by all the Pj, with j<i. if no such sequence exists, then the system state is said to be unsafe.

4.What is banker’s algorithm?

Banker’s algorithm is a deadlock avoidance algorithm that is applicable to a resource-allocation system with multiple instances of each resource type.The two algorithms used for its implementation are:

a.   Safety algorithm: The algorithm for finding out whether or not a system is in a safe state.

b.     Resource-request algorithm: if the resulting resourceallocation is safe, the transaction is completed and process Pi is allocated its resources. If the new state is unsafe Pi must wait and the old resource-allocation state is restored.

5.Define logical address and physical address.

An address generated by the CPU is referred as logical address. An address seen by the memory unit that is the one loaded into the memory address register of the memory is commonly referred to as physical address.

6.What is logical address space and physical address space?

The set of all logical addresses generated by a program is called a logical address space; the set of all physical addresses corresponding to these logical addresses is a physical address space.