Subscribe by Email


Showing posts with label files. Show all posts
Showing posts with label files. Show all posts

Monday, October 7, 2013

What is Wifi technology? How does it work?

- Wifi has emerged as a very popular technology. 
- This technology has enabled the electronic devices to exchange information between them and to share the internet connection without using any cables or wires. 
- It is a wireless technology. 
- This technology works with the help of the radio waves. 
- The Wifi is defined as a WLAN (wireless local area network) product by the wifi alliance that is based on the standards defined by IEEE (802.11 standards). 
Most of the WLANs are based upon these standards only and so this technology has been named as wifi which is the synonymous with the term WLAN. 
- The wifi-certified trademark might be used by only those wifi products which have the complete certification for the wifi alliance inter-operability. 
- A number of devices now use wifi such as the PCs, smart phones, video game consoles, digital cameras, digital audio players, tablet computers and so on. 
- All these devices can connect to the network and access internet by means of a wireless network access point. 
- Such an access point is more commonly known as a ‘hotspot’. 
- The range of an access point is up to 20 m. 
- But it has a much greater range outside.  
- An access point can be installed in a single room or in an area of many square miles. 
- This can be achieved by using a number of overlapping access points. 
However, the security of the wifi is less compared to the wired connections for example Internet.
- This is so because a physical connection is not required by an intruder. 
- The web pages using SSL have security but the intruders can easily access the non-encrypted files on the internet. 
- It is because of this, that the various encryption technologies have been adopted by the wifi. 
- The earlier WEP encryption was weak and so was easy to break.
- Later, came the higher quality protocols such as the WPA2 and WPA. 
- The WPS or the wifi protected set up was an optional feature that was added in the year of 2007. 
- This option a very serious flaw which is that it allowed the recovery of the password of the router by an attacker.
- The certification and the test plan has been updated by the wifi alliance for ensuring that there is resistance against attacks in all the devices that have been newly certified.
- For connecting to a wifi LAN, a wireless network interface controller has to be incorporated in to the computer system.
- This combination of the interface controller and the computer is often called as the station. 
- The same radio frequency communication channel is shared by all the stations.
- Also, all the stations receive any transmission on this channel. 
- Also, the user is not informed of the fact that the data was delivered to the recipient and so is termed as the ‘best–effort delivery mechanism’. 
- For transmitting the data packets, a carrier wave is used. 
- These data packets are commonly known as the ‘Ethernet frames’. 
Each station regularly tunes in to the radio frequency channel for picking up the transmissions that are available. 
- A device that is wifi enabled can connect to the network if it lies in the range of the wireless network. 
- One condition is that the network should have been configured for permitting such a connection. 
- For providing coverage in a large area multiple hotspots are required. 
- For example, wireless mesh networks in London. 
- Through wifi, services can be provided in independent businesses, private homes, public spaces, high street chains and so on. 
- These hotspots have been set up either commercially or free of charge. 
- Free hotspots are provided at hotels, restaurants and airports. 


Friday, August 9, 2013

What are applications of flooding algorithm?

- Flooding algorithm and its many other variants are used as material distributing algorithm.
- This algorithm distributes the messages to all the hosts in the entire graph. 
This algorithm since it acts like a flood and therefore has been named so. 
- In this simple yet useful distribution or routing algorithm, every packet that a node receives is transmitted to every other outgoing link. 
This algorithm is available in many variants but in every variant the following two things are common:
1. Each node acting as receiver and transmitter.
2. Each node responsible for forwarding received message to all its neighboring nodes except the one from which the message came. 
- Thus, the messages are eventually delivered to the hosts spread across the network. 
- Flooding algorithm might have been more useful if it would have been more complex. 
- Also, then it would have been possible to avoid the duplicate messages and infinite loops that occur because of them. 

Applications of Flooding Algorithm

In this article we list some of the application of the flooding algorithm.
1. Used in computer networking
2. Used in graphics
3. These algorithms are quite useful for solving numerous mathematical problems such as the maze problems.
4. Used for solving problems in the graph theory. 
5. Used in systems which make use of bridging. 
6. Used in systems like usenet.
7. Implemented in peer – to – peer file sharing
8. Flooding algorithms are often implemented as a part of some of the routing protocols as in OSPF, DVMRP and so on. 
9. It is also used in the protocols used in the ad hoc wireless networks.
10.There is a variant of flooding algorithm called the selective flooding which is capable on addressing various issues of flooding algorithm partially by allowing the packets to be sent only in the appropriate right direction. The packets are not sent on each and every line. 
11. Another variant of the flooding algorithm called the similarity algorithm is used graph matching algorithm. 
- This variant of the flooding algorithm is quite versatile and has got an application in the schema matching. 
- Matching the contents of the two data schemas has got an important role to play in many biochemical applications, e – business and other data warehousing applications etc. 
- The similarity flooding algorithm is based on a computation that is fixed and can be used across a number of scenarios. 
- Two graphs are passed to the algorithm as the input parameters. 
- These graphs might be of catalogs, schemas or even data structures etc. 
- The algorithm then produces a mapping between the corresponding nodes of the two graphs as output. 
- It depends on the goal of the matching what subset of the mapping has to be chosen using filters. 
- After the algorithm has been executed, a human tester is expected is expected to check and verify the results. 
- The results might be adjusted by the tester if required. 
- In this method, the accuracy of the algorithm is evaluated by number of the adjustments that are necessary.
- In some cases, an accuracy metric might be used for the estimation of the labor savings that could be obtained by the users by means of this similarity flooding algorithm for obtaining a first matching pair.
- Finally, this algorithm can be deployed as an operator of very high level in a test bed that has been implemented for the management of the output mappings and the information models. 
- There are different types of matching problems and thus each type requires following a different approach. 
- For example, the relational schemas can only be matched using SQL data types.


Sunday, June 30, 2013

Explain the single and two level directory structures

About Directory Structure
- Directory structure is referred to the way that the operating system follows for displaying the files and file system to the user in the field of computing. 
- A hierarchical tree structure is used for displaying the files in a typical way. 
- The special kind of string the file name uses or the unique identification of a particular file that is stored in the computer’s file system. 
- Before the 32 bit operating systems actually came in to the scenario; short names of about 6 to 14 characters in size were used for the file names. 
However, the modern operating systems give permission for file names of longer length i.e., of 250 character and that too per path name element. 
- The drive:\ is the root directory in the operating systems such as the OS/2, windows and DOS for example, “C:\”. 
- The “\” is the directory separator but the forward slash “/” is also internally recognized by the operating system.
- A drive letter is use for naming the drives either physically or virtually. 
- This also implies there does not exist a root directory that is formal. 
- Rather, we have root directories in each drive that are independent of each other. 
- However, one virtual drive letter can be formed by combining in to one. 
- This is done by keeping a RAID setting of 0 for the hard drive. 
- The file system hierarchy standard is used by the operating systems such as the UNIX and other UNIX like systems. 
- This is the most common form for the directory structures used by the UNIX operating systems. 
- It is under the root directory “/” that all the files and the directories are stored even if they are actually present on a number of different physical devices.

About Single – level Directory
- This is the simplest of the directory structures. 
- All files are stored in the same directory itself because it is quite easy to understand as well as support. 
- The first computer of the world i.e., the CDC 6600 also operated on just one directory and it could be used by a number of users at the same time. 
- There are significant limitations of the single-level directory. 
- These limitations come in to play when there are more than one users using the system or when the system has to deal with a large number of files. 
- All the files have to be assigned unique names since they are all stored under the same directory. 
- No two files can have the same file name. 
- It may become difficult to keep the names of the files in mind if they are large in number.


About Two–level Directory
- The limitations of the single level directory structure can be overcome by creating an individual directory for every user. 
- This is the most standard solution for the problems of the single level directories. 
- In this two-level directory structure, a UFD or user file directory is made for every user. 
- The structure of all the user file directories is almost the same, but the difference is that only the files of the individual user are stored in one.
- When a user tries to log in or when he starts a task, the system searches for the MFD or master file directory. 
- The name of the user or his/ her account number is used for indexing the MFDs in the operating system. 
- Each of those entries points to the UFD belonging to that user. 
- When a reference is made to some file, the system only searches for the user file directory for example, when a file has to be deleted or created. 


Sunday, June 23, 2013

Explain the various File Operations

A number of operations can be carried out on a file. However, there are 6 basic file operations. As we know a file is an ADT or abstract data type. Certain operations need to be considered for defining a file. Operating systems makes calls to these operations. 

Following are the six basic operations:

1. Creation of a file: 
- This operation involves two steps. 
- Firstly, a sufficient space has to be found for storing the file in the file system. - Secondly, for this new file an entry should be made in the directory.

2. Writing to a file: 
- For writing data to a file, a system call has to be made with name and the data to be written as its arguments. 
- A writer pointer is kept by the system at the location in the file where the next write operation is to be carried out. 
- This pointer is updated whenever a write operation occurs.

3. Reading from a file: 
- Just like the write operation, in order to read information from a file, a system call has to be generated along with the name of the file and the location of the content to be read as its arguments. 
- Here, instead of a write pointer there is a read pointer that will indicate the location where the next read operation is to take place. 
- The location at which the current operation is being carried out is kept as a “per – process current – file – position” pointer since the process is either writing to or reading from the file. 
- The same pointer can be used by both the read and write operations in order to reduce the complexity of the system as well as for saving space.

4. Re-positioning within a file: 
- System carries out search in the directory looking for the appropriate entry. 
When found, the current file position pointer is re-pointed to this position. 
This file operation does not require carrying out any input or output operation in actual. 
- Another name for this file operation is the file seek.

5. Deletion of a file: 
- For deletion of the file, the system searches through the directory to find the appropriate entry. 
- When found, the space held by this file is released and the entry in the directory is destroyed so that this space can be reused by other files.  

6. Truncating a file: 
- Sometimes you may require deleting only the contents of a file while keeping it attributes. 
- Deleting the file and recreating it is not an efficient solution. 
- This file operation lets you to erase the contents of the file but save its attributes.
- But here the length attribute of the file will be changed to zero after truncation. 
- The file space is released after truncating.


The above mentioned six basic file operations constitute the minimal file operations set. These operations are primary ones and if combined can perform some other secondary file operations such as copying. A table known as the open file table is maintained by the operating system that stores all the information about the files that are currently open. When the file is closed, its entry is deleted from the open file table. Some files have to be opened explicitly with the function open() before using it. The name of the file is passed as an argument to this function. Then it looks in the directory for this file and an entry is made in the open file table.  Each file has some access rights. It is in these access modes that a process uses the file. A process can perform only those operations which are permitted by the access rights of the file. 


Friday, June 14, 2013

Explain the methods for free space management? – Part 2

- Managing the free space is easy only when the space that has to be managed is divided in to units of fixed size. 
- If this is the case, the list of these fixed size units can be kept. 
- The first entry can be returned if it is requested by the client. 
- Managing free space gets difficult when the space to be managed consists of units of variable sizes. 
- This is the case with the memory allocation library at the user level. 
- This is also the case in the physical memory where the segmentation is used for the implementation of the virtual memory. 
- In such cases, external fragmentation is the main problem. 
- This leads to the splitting up of the disk space in to pieces of variable size. 
The next coming requests might fail because of unavailability of contiguous free space. 
- For example, the request might fail even if 20 bytes are available and the request requires only 15 bytes because this 20 bytes space is non-contiguous. 
Thus, the main problem is how the free space should be managed while satisfying the variable sized variables. 
How these strategies can manage free space while at the same time keeping the fragmentation in control.

Low level Mechanisms: 
- Most of the allocator use some common mechanisms as these: coalescing and splitting.
- Here, the free list consists of a set of elements describing about all the free spaces available in the heap. 
- Once a pointer to a space is handed over to the program, the determination of the pointers to this space becomes somewhat difficult. 
- These pointers are stored either in the registers or in the variables at some point of execution. 
- However, this is not the case of garbage collected and strongly typed languages as a measure for enabling compaction for combating fragmentation. - Suppose the program makes a request for a single byte of memory.
- In such a case the action performed by the allocator is called splitting. 
- Here a free memory chunk is searched for and split in to two. 
- The first one is returned to the calling request and the second one stays in the list itself. 
- This approach is used in the allocators where small requests are made requesting space that is of size smaller than the chunk. 
- Most of the allocators use a corollary mechanism called the coalescing of the free space. 
- Suppose a small heap is given and an application calls a function to obtain some memory. 
- This function returns the space available in the middle of the heap. 
- All these strategies are based up on simple policies. 
- An ideal allocator is the one that both minimizes fragmentation and is fast. 
But since it is possible for the stream of free requests and allocation to be arbitrary, any strategy would go wrong if wrong inputs are given. 
- Thus, the best approach cannot be described. 
There are 4 major approaches in this regard:

1. Best fit: 
- Simplest and first searches the list for free chunks of memory that might be bigger than the size requested. 
- The smallest one in the searched ones is returned and this is known as the best fitting chunk or smallest fitting too. 
- One pass is enough for finding the appropriate block to be returned.

2. Worst fit: 
- This one is just the opposite of the best fit. 
- It looks for the largest chunk and returns the amount requested while keeping the remaining memory space.

3. First fit: 
- This one also looks for the first bigger block and out of it allocates the amount requested by the thread.

4. Next fit: 
- Here, one extra pointer is kept at the location where the last search was done. 


Saturday, June 8, 2013

Explain the methods for free space management? – Part 1

- For efficient working of the programs and the entire operating system, it is important that the memory of the system should be managed. 
- When the files and programs are allocated memory space, some free space is left in the storage area. 
- It is required that these free spaces must be managed properly. 
- Since there is a limitation to the disk space, this same space has to be used again and again after deleting and creating new files. 
- A free space list is maintained by the operating system for keeping the track of the available free space. 
- All the free disk spaces are listed in free space list. 
- For the creation of a new file this free space list is searched in order to get the amount of space needed and then if the space is available, it is allocated to the file to be created. 
- In the case of deletion, after deleting the file, its space is added to the list of free spaces.

Methods for Free Space Management

There are 4 methods for the management of free space namely:
- Bit vector
- Linked list
- Grouping
- Counting

What is Bit Vector?
- Quite a many times, the free space list about which we mentioned above, is implemented as the bit vector (also known as the bitmap). 
- Here, 1 bit is used for representing each block. 
- If a particular block has been allocated to some file or program, its representative bit is set to 0 and when the block is available, the bit is set to one.
- Consider an example, suppose the following disk blocks are free and rest are allocated: 1, 2, 4, 5, 6, 7, 9, 10, 12, 13, 14, 18, 19, 21, 26, 27, 28. 
- Then for this allocation we have the following free – space bit map:
01101111011011100011010000111…
- This method of free space management is relatively simple and has good efficiency. 
- This method is known for its efficiency to locate the n consecutive free blocks or the first free block available in the storage area. 
- But this method can be inefficient if it is not kept in the main memory of the system. 
- Also, when required occasionally for the recovery needs, this map can also be written to the disk. 
- Keeping such maps in the physical memory is an easy thing if the system has a small memory but this is not always possible in the case of the systems with larger memories.

What is a Linked list?
- In this method, all the free spaces are linked together and the first block in this linked list is assigned a pointer which is stored in the cache memory. 
Similarly, the pointer to the second block is stored in the first block.

What is Grouping?
- This method is a modified version of the free list approach and it stores the addresses of the all the free blocks in the first block that is free. 
- Here, actually the first n- 1 blocks only are free and the address of another n free blocks is stored in the last block. 
- This lets the system to find the addresses of a number of free blocks which is not possible in the case where the approach being used is the linked list approach.


What is Counting?
- This approach takes advantage of the simultaneous allocation or freeing of the contiguous blocks through clustering or by using contiguous allocation algorithm. 
- Thus, it requires only to keep the address of the first free block and the rest of the blocks follow it. 


Thursday, June 6, 2013

Explain the structure of the operating systems.

We all are addicted to using computers but we all never really bother to known what is actually there inside it i.e., who is operating the whole system. Then something inevitable occurs. Your computer system crashes and the machine is not able to boot. Then you call a software engineer and he tells you that the operating system of the computer has to be reloaded. You are of course familiar with the term operating system but you know what it is exactly. 

About Operating System

- Operating system is the software that actually gives life to the machine. 
- Basic intelligence is the requirement of every computer system to start with. 
Unlike we humans, computers do not have any inborn intelligence. 
- This basic intelligence is required because this is what the system will use to provide essential services for running the programs such as providing access to various peripherals, using the processor and allocation of memory and so on. 
One type of service is also provided by the computer system for the users. 
- As a user, you may require to create, copy or delete files. 
- This is the system that manages the hardware of the computer system. 
- It also sets up a proper environment in which the programs can be executed. 
It is actually an interface between the software and the hardware of the system.
- On booting of the computer, the operating system is loaded in to the main memory. 
- This OS remains active as long as the system is running. 

Structure of Operating Systems

- There are several components of the operating system about which we shall discuss in this article.
- These components make up the structure of the operating system.

1. Communications: 
- Information and data might be exchanged by the processes within the same computer or different computers via a network. 
- This information might be shared via memory if in the same computer system or via message passing if through some computer network. 
- In message passing, the messages are moved by the operating system.

2. Error detection: 
- The operating system has to be alert about all the possible errors that might occur. 
- These errors may occur anywhere ranging from CPU to memory hardware devices in the peripheral devices in the user application. 
- For all types of error, proper action must be taken by the operating system for ensuring that correct and consistent computing takes place. 
- The users and the abilities of the programmers are enhanced greatly by the debugging facilities.

3. Resource allocation: 
- Resources have to be allocated to all of the processes running. 
- A number of resources such as the main memory, file storage, CPU cycles etc have some special allocation code while other resources such as I/O devices may have request and release codes.

4. Accounting: 
- This component is responsible for keeping the track of the computer resources being used and released.

5. Protection and Security: 
- The owners of data and information might want it to be protected and secured against theft and accidental modification.
- Above all, there should be no interference of the processes with working of each other. 
- The protection aspect involves controlling the access to all the resources of the system. 
- Security involves ensuring safety concerning user authentication in order to prevent devices from invalid attempts.

6. Command line interface or CLI: 
- This is the command interpreter that allows for the direct entry of the command. 
- This is either implemented by systems program or by the kernel.
- There are a number of shells also for multiple implementations.

7. Graphical User Interface: 
This is the interface via which the user is actually able to interact with the hardware of the system. 


Sunday, June 2, 2013

Explain the various Disk Allocation methods? – Part 2

In this article we discuss about the non-contiguous disk allocation methods i.e., the linked allocation and the indexed allocation. 

What is a Linked Allocation?

- In linked allocation a single file might be stored all over the disk and these scattered parts are linked to each other just like a linked list. 
- Few bytes in the memory block are used for storing the address of the following linked block.
- This type of allocation has two major advantages mentioned below:
  1. Simplicity and
  2. Non – requirement of disk compaction
- Since the nature of the allocation method is non-contiguous, it does not lead to any external fragmentation of the disk space.
- And since all the memory blocks have been linked to each other, a memory block available anywhere in the memory can be used for satisfying the requests made by the processes. 
- Declaring the file size for the linked allocation is not required during its creation. 
- There are no issues even if the file continues to grow as long as free blocks are available and since the blocks can always be linked up. 
- As a consequence of all this, the need for disk compaction is eliminated. 

Disadvantages of Linked Allocation

But there are disadvantages of using linked allocation. They are:

Direct access to the disk blocks becomes slow: 
For finding a particular block of the file, the search has to begin at the starting point of the file and the successive pointers have to be followed till the destination block is reached.

Space required by the pointers: 
- Suppose out of 512 words of a memory block, 2 are required for storing the pointers, then we have 39 percent of the total disk being used by the pointers rather than for data. 
- This adds to the space requirement of the file blocks.

Reliability: 
- Because of all the blocks being linked via the pointers, even if one pointer gets damaged or wrong, the successive blocks can become inaccessible. 
- This problem is quite common and thus most of the operating systems avoid this problem by keeping redundant copies of these pointers in a special file. 
The basic idea here is to keep the list of the pointers in the physical memory of the system. 
- This also allows for the faster access to the disk blocks.

What is Indexed allocation?

- The linked allocation method does not provide support for the direct access and this problem is solved by the indexed allocation method. 
- In this method, all the pointers are placed over an index. 
- Thus, these pointers together form the index block. 
- The address of this address block is then stored in the directory. 
- The pointer at the nth number in the index block points to the nth block of the associated file. 
- The purpose of the index blocks is somewhat similar to that of the page map tables; however both of these are implemented in a different way.
- First level index is used for searching the index of second level and the second one is used for searching the third one and the process may continue till the fourth level. 
- But in most of the cases the indexes of the first two levels are sufficient. 
- With this method, second level index blocks (128 x 128) can be easily addressed and files of size of up to 8mb can be supported. 
- Assuming the same thing, files of size up to 1 gb can be addressed.

Advantages and Disadvantage of Indexed Allocation

- The major advantage of this allocation technique is that it does not give rise to external fragmentation and offers a high level of efficiency in random accessing. 
- Also, using this technique mapping can be done around the disk blocks that are known to be bad. 
-Bit mapping can be used for indexing the free space. 

The biggest disadvantage of this allocation technique is the large number disk accesses required for the retrieval of the address of the destination block in the memory. 


Saturday, June 1, 2013

Explain the various Disk Allocation methods? – Part 1

Management of space of the secondary data storage devices is one of the most necessary functions of the file system. This includes tracking which blocks of memory or disk are being allocated to the files and which blocks are free to be allocated. 
There are two main problems faced by the system during allocation of the space to different files. Firstly, the access to the files has to be fast and secondly, the disk space has to be effectively utilized. Both of these combine to form the big problem of disk management. These two problems are more common with the physical memory of the system. 

However, the secondary storage of the system also introduces 2 additional problems which are long disk access time and blocks of larger size to deal with. In spite of all these problems, there are considerations that are common for both the storage such as the non – contiguous and contiguous space allocation. 

Types of Disk Allocation Methods


The following are the 3 widely used allocation techniques:
Ø  Contiguous
Ø  Linked
Ø  Indexed
- The linked and the indexed allocation techniques fall under the category of the non-contiguous space allocation. 
- All the methods have their own pros and cons.
- It is in the term of blocks that all the input and output operations are carried out on the disk. 
- Software is responsible for converting from the logical record to physical storage blocks.

Contiguous Allocation: 
- This allocation technique assigns only the contiguous memory blocks to the files. 
- The size of the memory required is mentioned by the user in advance for the holding the file. 
- The file is then created only if that much amount of memory is available otherwise not. 
- It is the advantage of the contiguous memory allocation technique that all the successive file records are saved adjacent to each other physically. 
- This causes an increase on the disk access time of the files. 
- This can be concluded from the fact that if the files are scattered all about the disk, then it takes a lot more time to access them. 
- Accessing files when they have been organized in a proper order is quite easy.
- To access the files sequentially, the system uses the address of the last memory block and if required moves to the next one. 
- Both direct and sequential accesses are supported by the contiguous memory allocation technique. 
- The problem with this allocation method is that every time a new contiguous space cannot be found for the new files if a majority of the memory is already in use and if the file size is larger than the available memory.  


Non–Contiguous Memory Allocation: 
- It happens a lot of time that the files grow or shrink in size with usage and time. 
- Therefore, it becomes difficult to determine the exact space required for the files since the users do not have any advance knowledge about the growing size of their files. 
- This is why the systems using the contiguous memory allocation techniques are being replaced by the ones with the non-contiguous storage allocation which is more practical and dynamic in nature. 
- The linked allocation technique mentioned above in the article, is a disk – based implementation of the linked list. 
- Each file is considered to be a list of the disk blocks linked to each other. 
- It does not matter whether the blocks are scattered about the disk. 
- In each block, few bytes are reserved for storing the address of the next block in chain.
- The pointer to the first and the last block of the file is stored in the directory. 


Facebook activity