Deploying the best E-Resources for Software Engineering Students

We at IT Engg Portal, provide all the Computer and IT Engineering students of Pune University with well compiled, easy to learn notes and other E-resources based on the curriculum

Power Point Presentations and Video Lectures for Download

We provide the most recommended power point presentations and Video Lectures from the most prominent Universities for most of the difficult subjects to ease your learning process

Bundling Codes for your Lab Practicals

Deploying the best of available E-Resources for Tech Preparation (Campus Placements)

The Complete Placement Guide

Our Team has worked hard to compile this E-Book for all students heading for Campus Placements. The book is a complete solution for Technical Preparation for Campus Placements.

Pune University's most viewed website for Computer and IT Engineering

With more than 4,00,0000 pageviews from 114 countries over the globe, we are now the most viewed website for Ebooks and other E- Resources in Computer and IT Engineering

Showing posts with label Comp. Show all posts
Showing posts with label Comp. Show all posts

Saturday, September 22, 2012

Learn about POP3 and IMAP Protocols : Computer Networks


Article contributed by :

manoj.pisharody99@gmail.com
----------------------------------------------------------



The pre-requisite to understand these two protocols is to know what an E-mail is and how it works. So, we would first take a short tour of E-mail.

Electronic Mail or e-mail, as it is often called, is one of the best forms of communication. Several innovations and researches to the field of Computer Networks have brought about many modifications to the traditional e-mail and today E-mail has become the fastest and most efficient way to communicate.

Working of E-mail

An e-mail system supports five basic functions:

Composition (generation of email),
Transfer (sending of email from sender to receiver), 
Reporting (delivery status of the mail at the receiver’s end), 
Displaying (the mail in the receiver’s mailbox) and
Disposition (what does the receiver does with the mail).

But for now, let us make the long story short, and just discuss about the message transfer phase.

To transfer an email from the source machine (say, A) to destination machine (say, B); the source machine establishes a TCP connection to port 25 of the destination machine. The actual transfer is done by a protocol named SMTP (Simple Mail Transfer Protocol). 

This protocol accepts incoming connections and copies them in to the destination machine with the help of a message transfer agent. If the message cannot be delivered, an error report is sent to the source machine.





Final delivery protocols (POP3 & IMAP)

Now that we have seen the basic idea of how a mail is transferred, now it is the optimal time to learn about the delivery protocols.
As we have seen, sending an email needs the source machine to establish a TCP connection with the destination machine. But suppose A wants to send an email to B, but B is offline. In this case, A cannot establish a TCP connection with B and thus, The SMTP protocol fails.


 
One solution to this problem is to have a message transfer agent residing on an ISP (Internet Service Provider) between the source and destination machines. This agent can remain online 24x7, and thus the source machine can establish a TCP connection with this agent anytime.





-->

POP3 (Post Office Protocol Version 3)

Now, the problem establishing TCP connection is solved. But, does it solve all the problems in delivering the mail? Certainly not. The problem now arising is how to connect the destination machine to the ISP (on which the message transfer agent resides). Note that this ISP is online throughout, but the destination machine is not. So, there must be a protocol to connect the mail transfer agent’s ISP to the destination machine. This is what POP (Post Office Protocol) is all about. This protocol deals with delivering the mail to the destination. But how? Let’s see.

First, the source establishes a TCP connection with the mail transfer agent’s ISP. The agent copies the mail to the ISP’s mailbox. Now, the role of the source machine is over. Delivering the mail to destination is up to the message transfer agent’s ISP.  Whenever the destination machine comes online, it establishes a TCP connection with the mail transfer agent at port 110. Then the message transfer agent gives the control to the POP3 server and this server completely copies the message to the mailbox of the destination machine. Once this is done, the message is deleted from the message transfer agent’s ISP.



IMAP (Internet Message Access Protocol)

The above protocol works well if there is a single user in the receiver’s ISP. But that must not be the case all the time. Quite often, in big companies or organizations, a single ISP is shared by many users. The mail sent by a source might be important for all the users sharing the ISP. So, in this case, definitely POP3 won’t work. To solve this problem, another protocol named IMAP (Internet Message Access Protocol) is used. Here, whenever a user in the destination ISP comes online, the user establishes a TCP connection to port 110 of the message transfer agent’s ISP.

  The agent approaches the IMAP server which now displays the whole message to the user. The user can either delete after reading, delete before reading, fully or partially download file(s) (if the message contains any files), and so on. Whatever the user does with the message is not the concern of the message transfer agent’s ISP. The agent does not delete the message from its ISP mailbox. So that, if a new user sharing the same destination ISP logs in, the message is displayed to that user too, after the TCP connection is established.

P.T.O.



Key Differences

The key difference between both the protocols is the role of the message transfer agent and the corresponding protocol server. In POP3, the agent deletes the message (file) from its mailbox after the user PC downloads the file. In the contrary, in IMAP, the agent does not delete the message after displaying it to the user.

Another difference is that, in POP3, the only option left with the destination PC is to completely download the file to its PC. But, IMAP provides additional features- the destination user PC can partially/fully download the file, delete before/after reading the message, without loss of data as the message will always remain in the agent’s ISP mailbox.

-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-



Article contributed by :

ManojPisharody (BE – IT)
manoj.pisharody99@gmail.com

Thursday, August 2, 2012

Free Educational App for learning PPS : [SE - Comp] [Sem 1]

Today we would like to bring to you a free and innovative Java based application for Learning the Subject : 'Programming & Problem Solving'  - A Second Year, first Sem Computer Engineering Subject for Pune University. The app is a freeware and has been successfully tested by our team for malware and other problems. The app was contributed to us by one of our readers : Mr. Ajinkya Borle 

 There are a few details you need to know before you download and use the Application :
  • The application is java based application and hence requires Java 1.6 or 1.7 to be installed on the user's computer.
  • The Download Package contains a Setup file (.exe file) -which can be installed in the same simple and traditional way and an Instructions Manual(PDF) for user help.
  • The software was made free of cost as it was sponsored by a Computer Shop named Swaroop Computers  and hence the name 'Swaroop Computers' appears in the application as a part of the Sponsorship Program. 
  • The sponsor's website opens when the software is launched; this is neither a threat, malware, adware nor a spyware! It is only a part of the sponsorship deal with the application.
  • The application is only distributed by IT Engg Portal and hence for any problems, queries and other help or information you are required to directly contact the developer :  Mr. Ajinkya Borle  ( Contact Information will be provided at the end of this post.)

Our team has tested the software and hence recommends all Second Year, Computer Engineering Students to utilize this application for studying the subject.

Here are  a few screenshots of the Application. 


Screenshot for Welcome Page (Splash Screen)



2. ScreenShot for Main page of the Application







For further details, you can contact the Contributor and Developer of this Application :
Mr. Ajinkya Shishir Borle
aborle@hotmail.com 

Sunday, July 29, 2012

Mutex and Semaphore : A Deeper Explanation - Operating Systems : TE [Comp - Sem 6] [I.T. Sem 5]


Let us first understand, what is Mutex aka Mutual Exclusion.
Mutex is the short-form for mutual exclusion object. In computer programming, a mutex is a program object that allows multiple program threads to share the same resource, such as file access, but not simultaneously. When a program is started, a mutex is created with a unique name. After this stage, any thread that needs the resource must lock the mutex from other threads while it is using the resource. The mutex is set to unlock when the data is no longer needed or the routine is finished.


Mutual exclusion, in computer science, refers to the problem of ensuring that no two processes or threads (henceforth referred to only as processes) can be in their critical section at the same time. Here, a critical section refers to a period of time when the process accesses a shared resource, such as shared memory. The problem of mutual exclusion was first identified and solved by Edsger W. Dijkstra in his seminal 1965 paper titled: Solution of a problem in concurrent programming control.
A simple example of why mutual exclusion is important in practice can be visualized using a singly linked list. 
In such a linked list the removal of a node is done by changing the “next” pointer of the preceding node to point to the subsequent node (e.g., if node i is being removed then the “next” pointer of node i-1 will be changed to point to node i+1). In an execution where such a linked list is being shared between multiple processes, two processes may attempt to remove two different nodes simultaneously resulting in the following problem: let nodes i and i+1 be the nodes to be removed; furthermore, let neither of them be the head nor the tail; the next pointer of node i-1 will be changed to point to node i+1 and the next pointer of node iwill be changed to point to node i+2. Although both removal operations complete successfully, node i+1 remains in the list since i-1 was made to point to i+1 skipping node i (which was made to point to i+2). This problem can be avoided using mutual exclusion to ensure that simultaneous updates to the same part of the list cannot occur.

Now, let us understand another very similar terminology called  Semaphore.


What is a Semaphore ?
In programming, especially in Unix systems, semaphores are a technique for coordinating or synchronizing activities in which multiple processes compete for the same operating system resources. A semaphore is a value in a designated place in operating system (or kernel) storage that each process can check and then change. Depending on the value that is found, the process can use the resource or will find that it is already in use and must wait for some period before trying again. Semaphores can be binary (0 or 1) or can have additional values. Typically, a process using semaphores checks the value and then, if it using the resource, changes the value to reflect this so that subsequent semaphore users will know to wait.
Semaphores are commonly use for two purposes: 
  • to share a common memory space and 
  • to share access to files. 
Semaphores are one of the techniques for interprocess communication (IPC). The C programming language provides a set of interfaces or "functions" for managing semaphores.

 In simple terms, a semaphore is a variable or abstract data type that provides a simple but useful abstraction for controlling access by multiple processes to a common resource in a parallel programming environment. 
     A useful way to think of a semaphore is as a record of how many units of a particular resource are available, coupled with operations to safely (i.e., without race conditions) adjust that record as units are required or become free, and if necessary wait until a unit of the resource becomes available. Semaphores are a useful tool in the prevention of race conditions; however, their use is by no means a guarantee that a program is free from these problems. 
     Semaphores which allow an arbitrary resource count are called counting semaphores, while semaphores which are restricted to the values 0 and 1 (or locked/unlocked, unavailable/available) are called binary semaphores (same functionality that mutexes have).
.




What are the differences between Mutex and Semaphore?  and
When to use mutex and when to use semaphore?

Concrete understanding of Operating System concepts is required to design/develop smart applications. 
As per operating system terminology, the mutex and semaphore are kernel resources that provide synchronization services (also called as synchronization primitives). 

Let us understand the difference between semaphore and mutex by considering the 'Producer - Consumer Problem'

The Producer-consumer problem:

Note that the content is generalized explanation. Practical details will vary from implementation.

Consider the standard producer-consumer problem. Assume, we have a buffer of 4096 byte length. A producer thread will collect the data and writes it to the buffer. A consumer thread will process the collected data from the buffer. Objective is, both the threads should not run at the same time.

Using Mutex:
   A mutex provides mutual exclusion, either producer or consumer can have the key (mutex) and proceed with their work. As long as the buffer is filled by producer, the consumer needs to wait, and vice versa.
    At any point of time, only one thread can work with the entire buffer. The concept can be generalized using semaphore.

Using Semaphore:
    A semaphore is a generalized mutex. In lieu of single buffer, we can split the 4 KB buffer into four 1 KB buffers (identical resources). A semaphore can be associated with these four buffers. The consumer and producer can work on different buffers at the same time.

Misconception:
    There is an ambiguity between binary semaphore and mutex. We might have come across that a mutex is binary semaphore. But they are not! The purpose of mutex and semaphore are different. May be, due to similarity in their implementation a mutex would be referred as binary semaphore.
  Strictly speaking, a mutex is locking mechanism used to synchronize access to a resource. Only one task (can be a thread or process based on OS abstraction) can acquire the mutex. It means there will be ownership associated with mutex, and only the owner can release the lock (mutex).
  
   Semaphore is signaling mechanism (“I am done, you can carry on” kind of signal). For example, if you are listening songs (assume it as one task) on your mobile and at the same time your friend called you, an interrupt will be triggered upon which an interrupt service routine (ISR) will signal the call processing task to wakeup.


FAQS on Mutex and Semaphore

 1. Can a thread acquire more than one lock (Mutex)?
Yes, it is possible that a thread will be in need of more than one resource, hence the locks. If any lock is not available the thread will wait (block) on the lock.

2. Can a mutex be locked more than once?
A mutex is a lock. Only one state (locked/unlocked) is associated with it. However, a recursive mutexcan be locked more than once (POSIX complaint systems), in which a count is associated with it, yet retains only one state (locked/unlocked). The programmer must unlock the mutex as many number times as it was locked.

3. What will happen if a non-recursive mutex is locked more than once.
Deadlock. If a thread which had already locked a mutex, tries to lock the mutex again, it will enter into the waiting list of that mutex, which results in deadlock. It is because no other thread can unlock the mutex. An operating system implementer can exercise care in identifying the owner of mutex and return if it is already locked by same thread to prevent deadlocks.

4. Are binary semaphore and mutex same?
No. We will suggest to treat them separately, as it was explained signalling vs locking mechanisms. But a binary semaphore may experience the same critical issues (e.g. priority inversion) associated with mutex. We will cover these later article.
A programmer can prefer mutex rather than creating a semaphore with count 1.

5. What is a mutex and critical section?
Some operating systems use the same word critical section in the API. Usually a mutex is costly operation due to protection protocols associated with it. At last, the objective of mutex is atomic access. There are other ways to achieve atomic access like disabling interrupts which can be much faster but ruins responsiveness. The alternate API makes use of disabling interrupts.

6. What are events?
The semantics of mutex, semaphore, event, critical section, etc… are same. All are synchronization primitives. Based on their cost in using them they are different. We should consult the OS documentation for exact details.

7. Can we acquire mutex/semaphore in an Interrupt Service Routine?
An ISR will run asynchronously in the context of current running thread. It is not recommended to query (blocking call) the availability of synchronization primitives in an ISR. The ISR are meant be short, the call to mutex/semaphore may block the current running thread. However, an ISR can signal a semaphore or unlock a mutex.

8. What we mean by “thread blocking on mutex/semaphore” when they are not available?
Every synchronization primitive will have waiting list associated with it. When the resource is not available, the requesting thread will be moved from the running list of processor to the waiting list of the synchronization primitive. When the resource is available, the higher priority thread on the waiting list will get resource (more precisely, it depends on the scheduling policies).

9. Is it necessary that a thread must block always when resource is not available?
Not necessarily. If the design is sure ‘what has to be done when resource is not available‘, the thread can take up that work (a different code branch). To support application requirements the OS provides non-blocking API.
For example POSIX pthread_mutex_trylock() API. When the mutex is not available the function will return immediately where as the API pthread_mutex_lock() will block the thread till resource is available.


References:







Saturday, June 30, 2012

Understanding REST : Representational State Transfer


(Material Referenced From @Computing Explored)

The Web is made up of many resources and a resource can be any item of interest, for example, an online book store may define book as a resource and clients may access that resource with this URL : http://www.myEbookStore.com/Books.



As a result of accessing the above URL is that the representation of the resource is returned (e.g., books.html) which results in a state change of the client. Now the end users browser is displaying more than just the home page of the online book store, a more informative and detailed state than the previous.


WWW is like a REST system and many of such services are being used in our day to day activities like purchasing something from Amazon.com, using Facebook, and even using GMail. So you are using REST, and you didn't even know it.


REST stands for Representational State Transfer. REST is not a standard but an architecture. However REST does make use of certain standards like http, URL, XML , html etc.

Consider the case of myEbookStore.com which enables its customers to : 
1. get list of books
get 2. get detailed information about a book
3. purchase books on-line







Get List of Books : 

-----------------------

http://www.myEbooksStore.com/books

Note that "how" the web service generates the books list is completely transparent to the client. All that the client knows is, if he/she submits the above URL then a document containing the list of books is returned which is obviously displayed in the browser. Since the implementation is transparent to clients, myEbooksStore.com owner is free to modify the underlying implementation of this resource without impacting clients.So we can consider REST as a loosely coupled architecture. 

Here's the document that the client receives:

        
             xmlns:xlink="http://www.w3.org/1999/xlink">
         
            
Note that the books list has links to get detailed information about each book. This is a key feature of REST. The client transfers from one state to the next by examining and choosing from among the alternative URLs in the response document. This is something like zooming the view on Google Maps. If you want to see the map of a location in Pune, the satellite will first zoom onto India, then Maharashtra and then Pune. At first level we get a list of countries from which we select India , then list of states in India from which Maharashtra is selected and then finally we get a list of districts in Maharashtra from which Pune is selected. We can see how data is refined gradually by taking decisions at each level. Lets get back to our BookStore example.

Get Detailed Information about a Book
-----------------------------------------------------
The web service makes available a URL to each book resource.For example, here's how a client requests book 0122:

http://www.myEbooksStore.com/books/0122

Here's the document that the client receives:

   
     
            xmlns:xlink="http://www.w3.org/1999/xlink">
          0122
          JSON explored
          This book explains JSON
         
          9.20
          10
   

Again observe how this data is linked to still more detailed data - the versions for this book may be found by traversing the versions hyperlink. Each response document allows the client to drill down to get more detailed information. Thats the whole idea of REST, Representational State Transfer.

In-short lets summarize some important points related to REST/Web Services :

1. Client-Server model, where the client pulls representations.

2. Stateless, meaning state of the data provider is not important. So each request from client to server should contain all the information necessary to understand the request. For example searching google.com for the word "computer" is sent to google server ashttp://www.google.com/#hl=en&output=search&q=computer ... so the required information is sent from client to server irrespective of the state of the server... that's true because before searching, we never worry about the state of google's server.

3. Common interface. For example : All google search queries are accessed with a generic interface (e.g., HTTP GET, POST, PUT, DELETE) and there is no static page for all searches. Imagine having a static page like : http://www.google.com/computer.html for search results of "computer" keyword... a bad idea.

4. Interconnected representations - the representations of any resource are interconnected using URLs, thereby enabling a client to progress from one state to another.

5. Cache to improve network efficiency. Hence once a website is loaded all the external javascripts needed by the site will be cached.

6. Categorizing the resources according to the requirement of a particular resource. Clients can just receive a representation of the resource, or even modify the resource. For the former, make those resources accessible using an HTTP GET. For the later, make those resources accessible using HTTP POST, PUT, and/or DELETE.

7. Underlying implementation of REST needs to be independent of the URL or type of REST service (GET, PUT, POST, DELETE). This means a website can be built using either JSP or ASP, without impacting the service being provided to the client. Also data can be represented in JSON format or as XML format or any other structured format.

Note :  APIs built using REST or conforming to REST design/architecture are said to be RESTful.

Thursday, June 14, 2012

Information Assurance and Security :[BE: IT/Comp]

Information Assurance and Security is one of the most important, most interesting and an extremely useful subject you will come across in your Engineering Career. This subject is introduced as a regular subject for IT in the 7th Semester and as an elective subject for Computer Engineering in the 8th Semester with the name Network Information Security. The contents of the syllabus for both Computer and IT Engineering is almost the same with just a few minor changes.

 Never use any available local author books for this subject, I would suggest you to prefer only  References for this subject. The subject contains many security based algorithms, brief introduction to Digital Certificates, Digital Signatures and many other security related concepts. The subject is very interesting to learn and extremely easy. Scoring 65+ in this subject is an extremely easy task. Many students even score 70+ easily. Every year the question paper for this subject is a bit applicative and not that straight forward. But still students manage to score well as the subject is totally conceptual : no theory at all.

Let us have a brief analysis of the subject.

Unit 1:
Relatively simple unit. This unit includes the most important concept in Security : 'CIA' .You will find this principle applied whenever security comes into the picture in any subject. A very simple concept and extremely important. This unit includes basics of a few security implementation techniques and a few algorithms and theorems. Among the algorithms and theorems Modular Arithmetic, GCD, Euclid’s Algorithms  are extremely simple ,only the chinese remainder theorem is a bit confusing . We would be providing a detailed implementation of the Chinese Remainder theorem in the upcoming tutorials. Rest of the unit is very simple. Questions from this unit are easily predictable.

Unit 2:
Introduces to you cryptography and associated algorithms and its implementation techniques. This unit will be a little time consuming as it includes various new algorithms and not that easy to understand in the first go. AES , DES, RSA, Blowfish,SHA -1 and MD5 are a few algorithms in this unit. The first attempt to understand these algorithms will be a little time consuming process. But , we have provided animations for most of the tutorials in our website. You can easily understand these algorithms using our animations. But overall this unit is very intersting.

Unit 3:
Easier than 2nd unit. This unit introduces to you the basics of Key Management Techniques and a few protocols (easier ones, not like the previous ones).

Unit 4 :
A very important unit ,as it introduces to you to most widely used security implementations for the network : SSL , Transport layer security. IPSEC,  a few protocols and brief introduction to Intrusion Detection Systems. Easy to understand as there are huge examples and tutorials available over the net.

Unit 5:
Easiest unit. Most of you would not even require to read this unit as it includes all new technologies which are well known to the youth like Electronic Payment, Smart Cards, Payment over Internet, Mobile Payment, Electronic cash and related terms. Easy and extremely scoring unit.

Unit 6:
Again a very simple unit, gives you a short introduction to cyber crimes,forensics, IT Laws  and recovering electronic evidence etc. Very easy and most questions are easily predictable.


Verdict:
Very interesting, extremely important and easy to learn subject. Totally conceptual.
Difficulty Level : Easy to Learn
Scoring Pattern :  easy to score 65+

Books Recommended :


Local  Author : 
Only Technical Publications was available for 2012 Batch. This book should only be used for Question papers, few sums and a few important topics in the last unit. Rest should be referred from Reference Books.


References :


 From exam point of View :
 The most important books are
(For Units 1- 4)

Computer Security : Principles and Practices - William Stallings
or
Cryptography and Network Security - Behrouz Forouzan



(For Unit 5)

Network Security and Cryptography - Bernard Menzes
---------------------------------------------------------------------------------

Even though,  the university recommends Bruice Schneier's books, the language used in this book is not that lucid. William Stalling or Behrouz Forouzan would be the best choice for the first 4 units.

One book recommended for Information Security is  'Cryptography and Network Security - Atul Kahate'. this book even though not recommended by the university, this book has one of the most amazingly organized contents and easiest language used. The book is so easy to learn, that you would end up reading the entire book as a novel in no time. All concepts about security can be easily understood using this book. Users rating for the book by Atul Kahate is 5 star. Unfortunately, there are no PDF Ebooks of this book available for download . You can order one from Flipkart, it would cost RS 300 only. It is definitely worth spending 300 bucks for this book.
    
Books for Download



Cryptography and Network Security
William Stallings


------------------------------------------------------------------------

Applied Cryptography
Bruce Schneier


-------------------------------------------------------------------------