Subscribe by Email


Showing posts with label Operating System. Show all posts
Showing posts with label Operating System. Show all posts

Saturday, September 21, 2013

What are the services provided to upper layers by transport layer?

In the field of computer networking, the purpose of the 4th layer or the transport layer is to provide services for the end to end communication for the various operating applications. The services are provided within an architectural framework that consists of protocols and the components and is layered. It also offers convenient services such as the following:
Ø  Connection – oriented data stream support
Ø  Reliability
Ø  Flow control
Ø  Multiplexing and so on.

- Both the OSI (open systems interconnection) and TCP/ IP model include the transport layer. 
- The foundation of the internet is based up on the TCP/ IP model whereas for the general networking, the OSI model is followed. 
- However, the transport layer is defined differently in both of these models. Here we shall discuss about the transport layer in the TCP model since it is used for keeping the API (application programming interface) convenient to the internet hosts. 
- This is in contrast with the definition of the transport layer in the OSI model. 
TCP (transmission control protocol) is the most widely used transport protocol and so the internet protocol suite has been named after it i.e., the TCP/ IP. 
- It is a connection-oriented transmission protocol and so it is quite complex. 
This is also because it incorporates reliable data stream and transmission services in to its state-ful design. 
- Not only TCP there are other protocols in the same category such as the SCTP (stream control transmission protocol) and DCCP (datagram congestion control protocol).

Now let us see what all services are provided by the transport layer to its upper layers:
ØConnection-oriented communication: It is quite easy for the application for interpreting the connection as a data stream instead of having to cope up with the connectionless models that underlie it. For example, internet protocol (IP) and the UDP’s datagram protocol.
Ø Byte orientation: Processing the data stream is quite easy when compared with using the communication system format for processing the messages. Because of such simplification, it becomes possible for the applications to work up on message formats that underlie.
Ø  Same order delivery: Usually, it is not guaranteed by the transport layer that the data packets will be received in the same order in which they were sent. But this is one of the desired features of the transport layer. Segment numbering is used for incorporating this feature. The data packets are thus passed on to the receiver in order. Head of line blocking is a consequence of implementing this.
Ø  Reliability: During the transportation some data packets might be lost because of errors and problems such as network congestion. By using error detection mechanism such as CRC (cyclic redundancy check), the data might be checked by the transport protocol for any corruption and for the verification whether the correct reception of the data by either sending a NACK or an ACK signal to the sending host. Some schemes such as the ARR (automatic repeat request) are sometimes used for the retransmission of the corrupted or the lost data.
Ø  Flow control: The rate with which the data is transmitted between two nodes is managed for preventing a sending host with a fast speed from the transmission of data more than what the receiver’s data buffer can take at a time. Otherwise it might cause a buffer overrun.

Ø  Congestion avoidance: Traffic entry in to the network can be controlled by means of congestion control by avoiding congestive collapse. The network might be kept in a state of congestive collapse by automatic repeat requests. 


Friday, September 13, 2013

What is Portability Testing?

- Portability Testing is the testing of a software/component/application to determine the ease with which it can be moved from one machine platform to another. 
- In other words, it’s a process to verify the extent to which that software implementation will be processed the same way by different processors as the one it was developed on.  
- It can also be understood as amount of work done or efforts made in order to move software from one environment to another without making any changes or modifications to the source code but in real world this is seldom possible.
For example, moving a computer application from Windows XP environment to Windows 7 environment, thereby measuring the efforts and time required to make the move and hence determining whether it is re usable with ease or not.

- Portability testing is also considered to be one of the sub parts of System testing as this covers the complete testing of software and also it’s re-usability over different computer environments that include different Operating systems, web browsers.

What needs to be done before Portability testing is performed (pre requisites/pre conditions)? 
1.   Keep in mind portability requirements before designing and coding of software.
2.   Unit and Integration Testing must have been performed.
3.   Test environment has been set up.

Objectives of Portability Testing
  1. To validate the system partially i.e. to determine if the system under consideration fulfills the portability requirements and can be ported to environments with different :-
a). RAM and disk space
b). Processor and Processor speed
c). Screen resolution
d). Operating system and its version in use.
e). Browser and its version in use.
To ensure that the look and feel of the web pages is similar and functional in the various browser types and their versions.

2.   To identify the causes of failures regarding the portability requirements, this in turn helps in identifying the flaws that were not found during unit and integration testing.
3.   The failures must be reported to the development teams so that the associated flaws can be fixed.
4.   To determine the potential or extent to which the software is ready for launch.
5.   Help in providing project status metrics (e.g., percentage of use case paths that were successfully tested).
6.   To provide input to the defect trend analysis effort.



Wednesday, July 10, 2013

Explain the concept of piggybacking?

- Piggybacking is a well known technique used in the transmission of data in the third layer of the OSI model i.e., the network layer. 
- It is employed in making a majority of the frames that are transmitted from receiver to the emitter. 
- It adds to the data frame, the confirmation that the sender sent on successful delivery of data frame. 
- This confirmation is called the ACK or acknowledge signal. 
- Practically, this ACK signal is piggybacked on the data frame rather than sending it individually by some other means. 

Principle behind Piggybacking
- The piggybacking technique should not be confused with the sliding window protocols that are also employed in the OSI model. 
- In piggybacking, an additional field for the ACK or the acknowledgement signal is incorporated in to the data frame itself. 
- There is only a difference of bit between the sliding window protocol and piggybacking.
- Whenever some data has to be sent from party to another, the data will be sent along with the field for ACK. 

The piggybacking data transfer is governed by the following three rules:
Ø  If both the data as well as the acknowledgement have to be sent by the party A, it has to include both the fields in the same frame.
Ø  If only the acknowledgement has to be sent by the party A, then it will have use a separate frame i.e., an ACK for that.
Ø  If only the data has to be by the party A, then the ACK field will be included within the data frame and thus transmitted along with it. This duplicate ACK frame is simply ignored by the receiving party B.

- The only advantage of using this technique is that it helps in improving efficiency. 
- The disadvantage is that is the service can be blocked or jammed by the receiving party if there is no data to be transmitted. 
- Enabling a receiver timeout by means of a counter the moment when the party receives the data frame can solve this problem to a great extent. 
- An ACK control frame will be sent by the receiver if the timeout occurs and still there is no data for transfer. 
- A counter called the emitter timeout is also set up by the sender which if ends without getting any confirmation from the receiver will make the sender assume that the data packet got lost in the way and therefore will have to re-transmitted.

- Piggybacking is also used in accessing the internet.
- It is used in establishment of a wireless internet connection by means of wireless internet access service of the subscriber without taking explicit permission from the subscriber. 
- However, according to the various jurisdiction laws around the world, this practice is under ethical and legal controversy. 
- In some places it is completely regulated or outlawed while at other places it is allowed.  
- A business customer who provides services related to hotspots, as of cafe and hotels, cannot be thought of using piggybacking technique via non – customers. - A number of such locations provide services for a fee. 


Monday, July 1, 2013

What is the difference between TCP and UDP?

TCP (transmission control protocol) and UDP (user datagram protocol) are two very important protocols. These two protocols are transportation protocol.  These two protocols are counted in the core protocols of the IP suite. 
These two protocols operate at the 4th layer i.e., the transport layer of the TCP/ IP model but the usage of the both the protocols is used very differently.

1. Reliability: 
- UDP is a connection-less protocol whereas TCP is a protocol that is connection  oriented. 
- Whenever a message is sent, it will not get delivered if there is a connection failure. 
- If during the delivery of the message the connection gets lost, the server will send a request to get the lost part. 
- During the transfer of a message, there is no corruption. 
- The reliability of the UDP is less and if a message is sent, there is no guarantee that it will get delivered, it may get lost on the way. 
- The message might get corrupted during transfer.

2. Ordered: 
- If at the same time two messages are sent along the same connection, one after the other, it is sure that the message which is the first in the line will get delivered there first. 
- The data is therefore delivered always in the same order. 
- You do not have to worry about the order of the arriving data. 
- In the case of UDP, the order of the arrival of data is not sure. 
- The second one can arrive there first before the first one. 

3. Heavyweight: 
- When the order of arrival of the low level parts of the transmission stream is wrong, the requests have to be sent again and again. 
- All the lost parts of the message have to be put together in a proper sequence. 
- So it takes some time for putting back the parts together. 
- On the other hand, UDP is lightweight.
- After sending the message, the user cannot think about tracking connections or ordering of the messages etc. 
- This indeed makes it lot quicker and therefore there is very less work for the network or the OS card for translating the data obtained from the data packets.

4. Streaming: 
- In TCP, the data is read in form of a stream.
- There is nothing that distinguishes one data from another. 
- Per read call there can be a number of packets. 
- In UDP each of the data packets is sent individually and if they arrive, they do so in whole form. 
- Here per read call, only one packet is sent.

5. Some examples of the TCP are FTP or file transfer protocol, World Wide Web (such as Apache TCP port 80), secure shell such as open SSH port 22 and so on. Examples of UDP are TFTP (trivial file transfer protocol), VoIP (voice over IP), IPTV, online multiplayer games, domain name system (such as DNS UDP port 53) etc.

6. Error-checking: 
- The TCP protocol offers extensive error checking mechanisms for the acknowledgement of the data, flow control and so on. 


In TCP, a connection is a must to be established in order to transfer data. Datagram mode is the mode in which the user data gram protocol operates. You can choose between the two protocols depending up on the requirements. If the guaranteed delivery of data is required, then the transmission control protocol must be chosen. The user data gram protocol comes only with the basic error checking mechanism. It checks the data by the means of the check sums. 


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. 


Saturday, June 29, 2013

What are the reasons for using layered protocols?

Layered protocols are typically used in the field of networking technology. There are two main reasons for using the layered protocols and these are:
  1. Specialization and
  2. Abstraction
- A neutral standard is created by a protocol which can be used by the rival companies for creating programs that are compatible. 
- So many protocols are required in the field and that should also be organized properly and these protocols have to be directed to the specialists that can work up on these protocols. 
- A network program can be created using the layered protocols by a software house if the guidelines of one layer are known. 
- The services of the lower level protocols can be provided by the companies. 
This helps them to specialize. 
- In abstraction, it is assumed that another protocol will provide the lower services. 
- A conceptual framework is provided by the layered protocol architecture that divides the complex task of information exchange into much simpler tasks between the hosts. 
- The responsibility for each of the protocols is narrowly defined. 
- A protocol provides an interface for the successive higher layer protocol. 
- As a result of this, it goes in to hiding the details of the higher protocol layers that underlies. 
- The advantage of using the layered protocols is that the same application i.e., the user level program can be used by a number of diverse communication networks.
- For example, when you are connected to a dial up line or internet via LAN you can use the same browser. 
- For simplifying the networking designs, one of the most common techniques used is the protocol layering. 
- The networking designs are divided in to various functional layers and the protocols are assigned for carrying out the tasks of each layer. 
- It is quite common to keep the functions of the data delivery separate from each other and separate layers for the connection management too.  
Therefore, we have one protocol for performing the data delivery tasks and second one for performing connection management. 
- The second one is layered up on the first one. 
- Since the connection management protocol is not concerned with the data delivery, it is also quite simple. 
- The OSI seven layer model and the DoD model are one of the most important layered protocols ever designed. 
- A fusion of both the models is represented by the modern internet. 
- Simple protocols are produced by the protocol layering with some well defined tasks. 
- These protocols then can be put together to be used as a new whole protocol. - As required for some particular applications, the individual protocols can be either replaced or removed. 
- Networking is such a field involving programmers, electricians, mathematicians, designers, electricians and so on. 
- People from these various fields have very less in common and it is because of the layering that people with such varying skills to make an assumption or feel like others are carrying out their duty. 
- This is what we call abstraction. 
- Protocols at a level can be followed by an application programmer via abstraction assuming that network exists and similarly electricians assume and do their work. 
- One layer can provide services to the succeeding layer and can get services in return too. 
- Abstraction is thus the fundamental foundation for layering. 
- Stack has been used for representing the networking protocols since the start of network engineering. 
- Without stack, it would be unmanageable as well as overwhelming. 
Representing the layers of specialization for the first protocols derived from TCP/ IP.



Tuesday, June 25, 2013

Explain about demand paging and page replacements

These are two very important concepts of memory management strategies in the computer operating systems namely demand paging and paging replacements. 

About Demand Paging
- Demand paging is just the opposite concept of the anticipatory paging. 
Demand paging is actually a memory management strategy developed for managing the virtual memory.
- The operating system that makes use of demand paging technique, a copy of the disk page is made and kept in the physical memory whenever a request is made for it i.e., whenever a page fault occurs. 
- It is obvious that the execution of a process starts with none of its page loaded in to the main memory and follows by a number of page faults occurring one after the other until all of its required pages have been loaded in to the main memory. 
- Demand paging comes under the category of the lazy loading techniques. 
This strategy follows that only if the process in execution demands a page, then only it should be brought in to the main memory. 
- That’s why the strategy has been named as demand paging. Sometimes it is even called as the lazy evaluation. 
- Page table implementation is required for using the demand paging technique.
- The purpose of this table is to map the physical memory to the logical memory. 
- This table uses a bit wise operator for marking a page as valid or invalid. 

The following steps are carried out whenever a process demands for a page:
  1. An attempt is made for accessing the page.
  2. If page is present in the memory the usual instructions are followed.
  3. If page is not there i.e., is invalid then a page fault is generated.
  4. Memory reference to a location in the virtual memory is checked if it is valid or not. If it’s an illegal memory access then the process is terminated. If not the requested page has to be paged in.
  5. The disk operations are scheduled for reading the requested page in to the physical memory.
  6. Restarting the instruction that raised the page fault trap.
- The nature of this strategy is itself of great advantage. 
- Upon availability of more space in the physical memory, it allows execution of many processes leading to a decrease in the context switching time.
- At the time of program start up, less latency occurs during loading. 
- This is because the inflow and outflow of the data between main memory and secondary memory is very less.


About Page Replacement
- When less number of real memory frames is available, it leads to invoking a page stealer. 
- This stealer searches through the PFT (page frame table) for pages to steal. 
This table stores references to the pages which are required and modified. 
- If the requested page is found by the page stealer, it does not steal it but the reference flag is reset for that page. 
- So in the pass when the page stealer comes across this page, it steals this page. 
- Note that in this pass the page was flagged as un-referenced. 
- Any change made to the page is indicated by means of the modify flag.
- If the modify flag of the page to be stolen is set, then a page out call has to be made before the page stealer does its work. 
- Thus, the pages that form a part of the currently executing segments are written to so called paging space and the persisting segments are in turn written to the disk. 
- The page replacement is carried by the algorithms called the page replacement algorithms. 
- Besides this, these also keep a track of the faults. 


Monday, June 24, 2013

Explain the page replacement algorithms - FIFO, LRU, and Optimal

- Paging is used by most of the computer operating systems for the purpose of virtual memory management. 
- Whenever a page fault occurs, some pages are swapped in and swapped out. Who decides which pages are to be replaced and how? 
- This purpose is served by the page replacement algorithms. 
- Page replacement algorithms only decide which pages are to be page out or written to the disk when a page of the memory has to be allocated. 
- Paging takes place only upon the occurrence of a page fault.
- In such situations a free cannot suffice because either one is not available or because the number of available pages is less than threshold. 
- If a previously paged out page is reference again, then it has to be read in from the disk again. 
- But for doing this, the operating system has to wait for the completion of the input/ output operation. 
- The quality of a page replacement algorithm is denoted by the time it takes for a page in. 
- The lesser it is, the better the algorithm is. 
- The information about the access to page as provided by the hardware is studied by the page replacement algorithm and then it decides which pages should be replaced so that the number of page faults can be minimized. 

In this article we shall see about some of the page replacement algorithms.

FIFO (first – in, first – out): 
- This one being the simplest of all the page replacement algorithms has the lowest overhead and works by book – keeping in place of the OS. 
- All pages are stored in a queue in the memory by the operating system.
- The ones that have recently arrived are kept at the back while the old ones stand at the front end of the queue.
- While making replacement, the oldest page is selected and replaced. 
- Even though this replacement algorithm is cheap as well as intuitive, practically it does not perform well. 
- Therefore, it is rarely used in its original form. 
- VAX/ VMS operating systems make use of the FIFO replacement algorithm after making some modifications. 
- If a limited number of entries are skipped you get a partial second chance. 

Least recently used (LRU): 
- This replacement algorithm bears resemblance in name with the NRU. 
However, difference is there which is that this algorithm follows that the page usage is tracked for a certain period of time. 
- It is based on the idea that the pages being used many times in current set of instructions will be used heavily in the next set of the instructions also. 
- Near optimal performance is provided by LRU algorithm in the theory however in practical it is quite expensive to be implemented. 
- For reducing the costs of the implementation of this algorithm, few implementation methods have been devised. 
- Out of these the linked list method proves to be the costliest. 
- This algorithm is so expensive because it involves moving the items about the memory which is indeed a very time consuming task. 
- There is another method that requires hardware support.

Optimal page replacement algorithm: 
- This is also known as the clairvoyant replacement algorithm. 
- The page that has to be swapped in, it is placed in place of the page which according to the operating system will be used in future after a very long time. - In practical, this algorithm is impossible to be implemented in case of the general purpose OS because approximate time when a page will be used is difficult to be predicted. 


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 21, 2013

Explain about the Paged Memory and Segmentation techniques?

Paging and segmentation, both are memory management techniques. 

What is Paging?

- This technique has been designed so that the system can store or retrieve data from the virtual memory or secondary memory of the system to be loaded in the main memory and used. 
- In this scheme, the data from the secondary memory is retrieved by the operating system in blocks of same size commonly known as the paging. 
- This is why the technique has been called the paging memory – management scheme. 
- This memory management scheme has a major advantage over the segmentation scheme. 
- The advantage is that non-contiguous address spaces are allowed. 
- In segmentation, non-contiguous physical address spaces are not allowed. 
Before the paging actually came in to use, the whole program had to be fitted in to the contiguous memory space by the systems. 
- This in turn led to a number of issues related to fragmentation and storage. 
Paging is very important for the implementation of the virtual memory in many of the operating systems that are general purpose. 
- With the help of paging memory management technique, the data that cannot be fitted in to the physical memory i.e., RAM can be easily used. 
- Paging actually comes in to play whenever a program makes an attempt for accessing the pages that have not been presently mapped to the main memory (RAM). 
- Such situation is termed as the page fault. 
- At this point the control is handed over to the operating system for handling the page fault.
- This is done in a way that it is not visible to the interrupt raising program. 

The operating system has to carry out the following instructions:
  1. Determining the location of the requested data from the auxiliary storage.
  2. Obtaining a page frame in the main memory that is empty to be used for storing the requested data.
  3. Loading the data requested in to the empty page obtained above.
  4. Making updates to the page table so that new data is only available.
  5. Returning the control interrupting program and retrying to execute the same instruction that caused the fault.

What is Segmentation?

- This memory management technique involves dividing the main memory in to various sections or segments.
- In the system that makes use of this management technique, a value identifying the segment and its offset is contained in the reference to that memory location. 
- Object files that are produced during the compilation of the programs make use of the segments when they have to be linked together to form an image of the program and this image has to be loaded in to the memory.  
- For different program modules, different segments might be created. 
- Some programs may even share some of the segments.
- In one way, memory protection is implemented by means of memory segmentation only.
- Paging and segmentation can be combined together for memory protection. 
- The size of memory segment is not always fixed and can be as small as a byte. 
- Natural divisions such as the data tables or the individual routines are represented by the segments.
This is to make the segmentation visible to the programmer. 
- With every segment, a set of permissions and length is associated. 
- A segment can be referred to by the process only in a way that is permitted by this set of permissions. 
- If this is not done, a segmentation fault is raised by the operating system. 
Segments also consist of a flag that indicates the presence of the segment in the main memory of the system. 


Facebook activity