Showing posts with label PL 4 Question Bank. Show all posts
Showing posts with label PL 4 Question Bank. Show all posts

Thursday, 13 April 2017

Proxy Servers

1) Explain the difference between Web server and Proxy server?
-Both are computers but difference is in the functionalities they offer.
-Basically a proxy server works as a mediator between clients and requested server while a normal server is pretty direct.
-The Proxy server's function is to sit in between the client program and the external server and to filter the requests to be able to improve the performance.
-Proxy servers also cache the pages viewed so as to reduce latency for next request.
-The web server's function is to serve static content to the client by loading the files and documents from disk and serve it across the network to the end user.
-When a client accesses a web server its IP address and location are recognized by the web server but when approaching via a proxy server the IP address is disguised and thus not recognized by the web server.

2) Types of proxy servers?
-Normal (Regular/Caching) Proxy: A regular caching proxy server is a server which listens on a separate port (e.g. 3128) and the clients (browsers) are configured to send requests for connectivity to that port. So the proxy server receives the request, fetches the content and stores a copy for future use. So next time when another client requests for the same webpage the proxy server just replies to the request with the content in its cache thus improving the overall request-reply speed.

-Transparent Proxy : This type of proxy server identifies itself as a proxy server and also makes the original IP address available through the http headers. These are generally used for their ability to cache websites and do not effectively provide any anonymity to those who use them. However, the use of a transparent proxy will get you around simple IP bans. They are transparent in the terms that your IP address is exposed, not transparent in the terms that you do not know that you are using it (your system is not specifically configured to use it.)
  
-Anonymous Proxy: This type of proxy server identifies itself as a proxy server, but does not make the original IP address available. This type of proxy server is detectable, but provides reasonable anonymity for most users.
   
-Distorting Proxy: This type of proxy server identifies itself as a proxy server, but make an incorrect original IP address available through the http headers.

-High Anonymity Proxy:This type of proxy server does not identify itself as a proxy server and does not make available the original IP address.

3) Why we should use SAN?
-Because of the following features:
    -A high-speed network of storage devices.
    -Connects the storage devices with servers.
    -Can be accessed by applications on networked servers.
    -Particularly helpful in backup and disaster recovery.
    -Uses networking protocols to span longer distances geographically.
    -SAN can also simplify some management tasks.
    -Offers flexibility, availability and performance.

4) What is squid?
-Squid is a Unix-based proxy server that caches Internet content closer to a requestor than its original point of origin.
- Squid supports caching of many different kinds of Web objects, including those accessed through HTTP and FTP.
-Caching frequently requested Web pages, media files and other content reduces bandwidth congestion and latency.
-Squid works by tracking object use over the network. Squid will initially act as an intermediary, simply passing the client's request on to the server and saving a copy of the requested object. If the same client or multiple clients request the same object before it expires from Squid's cache, Squid can then immediately serve it, accelerating the download and saving bandwidth.

5) What is default port of squid proxy?
-3128

6) What are the functionalities of squid proxy server?
-Squid is open source and freely available under GNU General Public License.
-Squid is not a generic proxy.It normally proxies only HTTP connections. It also does support other protocols like FTP,Gopher,SSL and WAIS but it does not support other internet protocols like real audio, news or video streaming because squid only supports UDP protocol for communication.
-It helps accelerate downloads and reduce latency by storing data in cache.
-ISP's have used squid since long back as it also helps for load balancing and handling traffic spikes

HTTP Header Analysis

1. What is Hypertext Transfer Protocol (HTTP)?
-It is an application layer protocol , designed to enable communications between clients and servers.
-HTTP works as a request-response protocol between a client and server.
-It is a generic and stateless protocol which can be used for other purposes using extensions of its request methods, error codes, and headers.
-Basically it is a TCP/IP based communication protocol used to access data on WWW.
-Also it is a connectionless protocol and uses default port as 80.

2. Port number for HTTP protocol.
-80

3. What are the HTTP request methods?
-GET  : Requests data from a specified resource
-POST : Submits data to be processed to a specified resource
-HEAD :    Same as GET but returns only HTTP headers and no document body
-PUT  :    Uploads a representation of the specified URI
-DELETE  :     Deletes the specified resource
-OPTIONS :     Returns the HTTP methods that the server supports
-CONNECT :    Converts the request connection to a transparent TCP/IP tunnel

4. What HTTP response headers do?
-The information, in the form of a text record, that a Web server sends back to a client's browser in response to receiving an HTTP request.
-The response header contains the date, size and type of file that the server is sending back to the client and also data about the server itself. The header is attached to the files being sent back to the client.

5. What happens to an undeliverable datagram?
-An undeliverable datagram is discarded and and ICMP error message is sent to source host.

6. What is HTTP session state?
-Session state, in the context of .NET, is a method keep track of the a user session during a series of HTTP requests.
-Session state allows a developer to store data about a user as he/she navigates through ASP.NET web pages in a .NET web application.
-The HTTP protocol is stateless, which means that HTTP has no built-in way to keep track of a user as they navigate from one webpage to another.
-As a result, there are a number of other methods used to maintain state. These include session state, cookies, hidden form fields (known as viewstate in .NET), passing variables through the querystring, and form posts.
-Storing session state in the application pool also means that data is lost if the server is rebooted.

7. What is the work of http in the server?
-A web server processes requests via HTTP, the basic network protocol used to distribute information on the World Wide Web.
-The primary function of a web server is to store, process and deliver web pages to clients.
-The communication between client and server takes place using the Hypertext Transfer Protocol (HTTP).
-A user agent, commonly a web browser initiates communication by making a request for a specific resource using HTTP and the server responds with the content of that resource or an error message if unable to do so.
-While the primary function is to serve content, a full implementation of HTTP also includes ways of receiving content from clients.

8. What are Status codes?
-The Status-Code element in a server response, is a 3-digit integer where the first digit of the Status-Code defines the class of response and the last two digits do not have any categorization role. There are 5 values for the first digit:
-1xx: Informational(It means the request has been received and the process is continuing)
-2xx: Success (It means the action was successfully received, understood, and accepted)
-3xx: Redirection (It means further action must be taken in order to complete the request)
-4xx: Client Error (It means the request contains incorrect syntax or cannot be fulfilled)
-5xx: Server Error (It means the server failed to fulfill an apparently valid request)




9. What s a Request message?
-An HTTP client sends an HTTP request to a server in the form of a request message to get certain data from server.
-A request message has following format:
    i) A Request-line
    ii) Zero or more header (General|Request|Entity) fields followed by CRLF
    iii) An empty line (i.e., a line with nothing preceding the CRLF) indicating the end of the header fields
    iv) Optionally a message-body

10. What are Persistent connections?
-HTTP persistent connection, also called HTTP keep-alive, or HTTP connection reuse, is the idea of using a single TCP connection to send and receive multiple HTTP requests/response,as opposed to opening a new connection for every single request/response pair.


11. In non – persistent HTTP connection, how can HTTP inform the TCP protocol that the end of the message has been reached?
-The HTTP client initiates a TCP connection to the server .
-The HTTP client sends a HTTP request message into the socket associated with the TCP connection that was established in step 1.
-The HTTP server:
    i) receives the request message via the socket associated with the connection that was established in step 1,
    ii) retrieves the object /someDepartment/home.index from its storage (RAM or disk),
    iii) encapsulates the object in a HTTP response message, and
    iv) sends the response message into the TCP connection.
-The HTTP server tells TCP to close the TCP connection. (But TCP doesn't actually terminate the connection until the client has received the response message intact.)
-The HTTP client receives the response message.The TCP connection terminates. The message indicates that the encapsulated object is an HTML file.

12. Difference between URL, URI & URN.
-All three are used to identify any resource or name on the internet but URI is superset of both URN and URL.
-Main difference between URL and URI is protocol to retrieve resource; URL includes network protocols i.e. HTTP,HTTPS,FTP etc while URI in case of URN uniquely identifies the resource eg. ISBN numbers.