Thursday, July 9, 2020

Cookies

Cookies

 It's time for cookies!

 joey mcintyre cookies GIF by Pop TV

It is always favorable for websites to keep track of their visitors so that they can either restrict their usage or deliver content according to their previous search history. Here the role of "Cookies" come into play which are defines in ' RFC 6265 '. As HTTP is a stateless protocol, cookies create a user session layer on top HTTP.

Cookie technology has four components:
  1. A cookie header line in HTTP request message.
  2. A cookie header line in HTTP response message.
  3. A cookie file managed by user's browser.
  4. A backend database at the website. 

Cookie Mechanism: 
                         Slide 8 § Cookies and Session IDs § Grab Bag

  • Suppose Mr X is visiting flipkart.com for the first time.
  •  When the flipkart server receives the request it assigns an unique identification number to Mr X and makes an entry in its backend database which is indexed by the identification number.
  •  Then the flipkart server sends an HTTP response message which includes " Set-cookie: " header containing the identification number. 
  • When Mr X's browser receives the response it interprets the set-cookie header and appends the data to the special cookie file it maintains.
  • The data includes hostname of the server and the identification number.
  • Every time Mr X's computer wants to send a request to flipkart server, the browser adds the " Cookie: " header in its request HTTP message.
  • The server performs a lookup for Mr.X's ID and delivers content accordingly.
  • This is how the flipkart server keeps a track of Mr.X's activity at the site.
  • Although the site does not have Mr. X's name, it does know what he has been browsing and at what times!
  • Now if Mr.X registers by providing his full name, credit-card details, location(address) then the server can associate all this information with the ID. (The site now has a lot of information about Mr.X !!)

Although cookies simplify internet usage they can be controversial !!

brushing season 6 GIF 

$$$$$$$

Thursday, July 2, 2020

HTTP-Hyper Text Transfer Protocol


HTTP

Hyper Text Transfer Protocol


HTTP stands for Hyper Text Transfer Protocol. It is an application layer protocol implemented in client program and server program. The client and the server communicate with each other by exchanging messages which define how clients request webpages and how the server transfers them.

HTTP uses TCP (Transmission Control Protocol) as its underlying transport layer protocol. The HTTP client first initiates a TCP connection with the server and is now ready to exchange messages and data.

HTTP is a stateless protocol i.e. if a client asks for the same webpage twice in period of few seconds then the server does not say that it had just serviced the request few seconds ago, instead it responds with the same object.


HTTP Request Message:

 
HTTP request message: general format - ppt downloadIn Introduction to HTTP Basics


 The above images show the general format of an HTTP request message sent by a client to a server. First we see that every line is separated by a ' cr ' i.e. carriage return and a ' lf ' i.e line feed. Carriage return moves the cursor to the beginning of a line and the line feed moves the cursor to a new line. Both of these combined move the cursor to the beginning of a new line. Here ' sp ' stands for 'space'. The response as well as request messages are written in ASCII text which enables humans to read them too. As you can see the first line is called a request line and the subsequent lines are called header lines. The entity body is often empty with GET method but when POST method is used, it consists of the data to be sent when a form is filled out. The method field can use various values like GET, POST, HEAD, PUT, DELETE etc. Majority of requests use GET method i.e. the the requested object is specified in URL itself. For eg ' xyz.com/somefolder/someimage.jpg '. Here the main object which is an image is specified in URL itself.Hence GET method can be used here. The version specifies the protocol version eg. HTTP/1.1. The host header specifies the server name in which the object resides. The Accept-Language header specifies the language in which the page is displayed as the same page can be stored in different languages.The Accept-Encoding header is used for negotiating content encoding. The User-Agent specifies the browser and its version. The Content-Length specifies the size in bytes.

You must have observed that many forms use GET instead of POST and include the inputted data in the URL itself. For eg. if a form has two input fields and the inputs are 'monkeys' and 'bananas' then the URL would be somewhat like:
' www.somesite.com/animalsearch?monkeys&bananas '  


HTTP Response Message:



In Introduction to HTTP Basics

The status line has three fields version, status code, status message. The Date header specifies the date and time when the request was serviced. The Last-Modified header specifies when the requested object was last modified. The ETag HTTP response header is an identifier for a specific version of a resource. The Connection header specifies that the TCP connection can be closed after the data is sent successfully. Content-Type specifies the type or format of requested file. Message Body consists of the actual file which was requested. 


$$$$$$$$$$$$$$$ 

Saturday, June 13, 2020

Internet Architecture

Internet Architecture

We all know that internet evolved with a great pace. One of the main reason for this rapid evolution is that most application developers don't have to write programs that run on network core devices like routers, link-layer switches etc as the 'Internet Architecture' provides certain services to applications.

When an application developer decides to build an application he will most probably choose one of the internet's major architectural paradigms:
  1. Client-Server Architecture: In a client-server architecture a 'server' services requests from 'clients'. The web is a famous application based on client-server architecture in which a web browser like Chrome requests data from a server. One distinct feature of this paradigm is that two clients(browsers) do not communicate directly with each other. Some other applications based on client-server architecture are FTP(File Transfer Protocol), e-mail etc.
  2. What are P2P and Client-Server networks?
    Client-Server VS Peer-to-Peer Architecture
  3. Peer-to-Peer(P2P) Architecture: In P2P architecture two hosts (peers) communicate directly with each other and are not dependent on servers. The two hosts are mainly user controlled. Eg: BitTorrent, Skype.
                             
However some applications have hybrid architecture consisting of both client-server and P2P. Many instant messaging applications use servers to track IP addresses but the messages are exchanged directly without going through intermittent servers.

Process:
Two hosts communicate with each other using 'processes' which are nothing but programs that exchange 'messages'. A sending process generates a message and sends it into the network. From now on wards it is the responsibility of  network services to deliver the message to the receiving host or particularly receiving process, which in turn takes certain actions depending on the message received and probably responds with a message.

Socket:
A process sends message into, and receives message from, the network through a software interface called 'socket'. A process is analogous to a house and socket to it's door. The sending house assumes that there is an architecture that delivers the message to destination house.

Networking in JAVA
Socket

Addressing:
To deliver a message to the destination, two parameters need to be specified:
  • Address of the host: In the internet the host is identified by an IP address.
  • Port Number: It identifies the exact process as a host may be running several processes of several network applications. For example, a web server is identified by port number 80 and an e-mail server is identified by port number 25.
                       TCP Source & Destination Port Number - Section 1


****

Sunday, April 19, 2020

Internet Protocol Stack

Internet Protocol Stack

Internet is governed by its protocols. To give a structured approach to the internet protocols, they are classified into five layers. This not only makes them easy to understand but also provides modularity.

The five layers of the internet protocol stack are:
  1. Application
  2. Transport
  3. Network
  4. Link
  5. Physical
Internet protocol stack :: Computer Systems with Project Operating ...
Five Layer Internet Protocol Stack

Application Layer:
Application layer protocols mainly run on end systems. Application layer packets are called 'messages'. HTTP(Hyper Text Transfer Protocol) is one of the famous application layer protocol designed for web documents. SMTP(Simple Mail Transfer Protocol) governs email services. FTP(File Transfer Protocol) is another application layer protocol for transferring files between two end systems. DNS(Domain Name System) translates the web addresses which humans understand to IP addresses which the internet understands.

Transport Layer:
Transport layer is responsible for transportation of application level messages between communicating end systems.Transport layer messages are called 'segments'. TCP(Transmission Control Protocol) and UDP(User Datagram Protocol) are two important protocols of the transport layer. TCP provides services like reliable data transfer,timing,security etc. UDP is somewhat opposite to TCP and doesn't provide reliable data transfer.

Network Layer:
Network Layer packets are called 'datagrams'. It is the layer which mainly establishes the internet. Network layer houses the famous IP(Internet Protocol). It contains many routing protocols also. However IP and routing protocols are collectively referred to as IP protocols. The first major version of IP is IPv4(Internet Protocol version 4) who is the predecessor of another major version IPv6.

Link Layer:
Link Layer packets are called 'frames'. Some of the famous link layer protocols are Ethernet, WiFi, DOCSIS(Data Over Cable Service Interface Specification), PPP(Point-to-Point Protocol) etc. Link is the physical connection between two nodes and link layer protocol operates only between two nodes.

Physical Layer:
Physical Layer is responsible for actual transmission of bits. Protocols in physical layer are link dependent. This layer is implemented mainly using hardware.

⧪⧪⧪

Saturday, March 28, 2020

Through The Internet

Through The Internet

Before proceeding, have a look at the video....



Traceroute:

Following are the steps which one can follow to get familiar with the traceroute program:

  • If you are using Windows, open the command prompt.
  • Type in the command tracert google.com
  • You can type any destination address like 'yahoo.com' , 'blogger.com' etc. Also the command may vary depending upon which OS you are using.
  • From here on the program will do the rest of the work.
  • Here is a screenshot of the output.Lets try to understand it.




  • As you can see after the command is typed in, the next row displays the server name (google.com) followed by its address [216.58.203.174]
  • The next line indicates that the program will log records for maximum 30 nodes (routers or end systems).
  • The main output has five columns, the first being the number of router along the route.Technically, they represent TTL (Time To Live) of the packets sent by traceroute program. TTL prevents the packets from being forwarded till the destination.
  • The second column is the time elapsed from the instant packet is sent till the message arrives back to client PC (have a look at the video for better understanding) in milliseconds.
  • Actually three packets are sent to each router instead of one and the round-trip time required for subsequent two packets is logged into the third and fourth column.
  • The fifth column displays the address of the router.
  • In above output we can see that there are 12 routers between our client and the server.
  • At the 13th hop the destination address is reached.
  • The second output displays ' Request Timed Out ' error which implies that the router has blocked ICMP (Internet Control Message Protocol) traffic and doesn't respond to requests for information.
  • The traceroute program is used to measure the end-to-end delay.
  • They are often used to diagnose speed issues in computer networking.

Now go on, experiment with the traceroute program yourself !

Monday, March 16, 2020

Internet Jargon



Internet Jargon

Internet:

           Internet is a global computer network which provides services to various                applications by using standardized protocols.

Image result for internet
Internet

End Systems:

  • End systems are devices like laptop,desktop,mobile etc which sit at the end of computer networks and run various applications like email,web browser program, web server programs etc.
  • End systems are also referred to as hosts.

    Image result for end system
    End Systems

  • There are two types of hosts:clients and servers
  • The clients can access data or services provided by the server.

Image result for clients and servers
Clients and Servers

Communication Links:

Communication links are physical media like optic fiber,coaxial cable or radio spectrum which connects two communicating devices.
Image result for radio spectrum for communication
Radio Spectrum for Communication

Image result for types of cables
Network Cables

Transmission Rate:

  • Transmission Rate is defined as number of bits transmitted in unit time.
  • Its unit is Bits/Second.

Packets:


  • When data is to be sent through a communication link from one end system to the other it is segmented into packets.
  • Every packet has header bits which contain information about the destination where it is to be sent.

Packet Switch:


A packet switch takes packet arriving at one of its incoming communication link and sends it to one of its outbound link according to destination address.
Image result for packet switch
Packet Switch

Route/Path:

Route or Path is the sequence of communication links and packet switches traversed by a packet from sending end system to receiving end system.

ISP(Internet Service Provider):

                      According to Wikipedia ISP(Internet Service Provider) is an organization that provides services for accessing, using, or participating in the Internet. 

   Image result for broadband service providers in india

Protocols:

  • Protocols define the format and order of messages exchanged between two communicating devices.
  • Internet standard protocols are developed by IETF(Internet Engineering Task Force).
  • The standard documents are called RFCs (Requests For Comments).


Image result for protocols

Access Networks:

  • An access network is a type of network which physically connects an end system to the immediate router (also known as the “edge router”) on a path from the end system to any other distant end system.
  • Example of access networks are DSL(Digital Subscriber Link), FTTH(Fiber To The Home), HFC(Hybrid Fiber Coaxial Network) etc.

Friday, March 6, 2020

Evolution of Internet

EVOLUTION OF THE INTERNET

Evolution of the Internet

1964:

  • Leonard Kleinrock was the first person to publish his work on packet  switching in 1964.
  • Paul Baran in 1964 at Rand Institute used packet switching for voice over military network.
  • Roger Scantlebury worked with Donald Davies on his pioneering packet switching concept at NPL i.e. National Physical Laboratory in England.

Image result for leonard kleinrock
Leonard Kleinrock


Image result for Paul Baran
Paul Barran

Image result for Roger scantlebury
Rojer Scantlebury

Image result for donald davies
Donald Davies

1969:

  • For the first time in 1969, Lawrence Roberts published the complete plan for ARPAnet ,first packet switched computer network.
  • On May 1 1969 i.e. Labor Day first packet switch was installed at (UCLA) University Of California, Los Angeles followed by (SRI) Stanford Research Institute and University Of Utah.
Image result for Lawrence Roberts
Lawrence Roberts

1972:

  • ARPAnet had grown to 15 nodes and its demonstration was given by Robert Kahn.
  • The first host-to-host protocol known as (NCP) Network Controlled Protocol was completed by 1972.
  • Ray Tomlinson wrote e-mail program in 1972.


Image result for robert kahn
Robert Kahn


Image result for ray tomlinson
Ray Tomlinson

Other networks which used packet switching:

  • ALOHAnet
  • DARPA's packet satellite and packet-radio network
  • Cyclades
  • IBM's SNA

1980:


  • Minitel was launched in France .
  • The Minitel was a videotex online service accessible through telephone lines, and was the world's most successful online service prior to the World Wide Web.
  •  It was invented in Cesson-Sévigné, near Rennes in Brittany, France.
  • The service was rolled out experimentally in July 1980 in Saint-Malo, France, and from autumn 1980 in other areas, and introduced commercially throughout France in 1982 by the PTT (Postes, Télégraphes et Téléphones; divided since 1991 between France Télécom and La Poste).

1983:


  • On January 1, 1983, in what is known as a "flag day", NCP was officially rendered obsolete when the ARPANET changed its core networking protocols from NCP to the more flexible and powerful TCP/IP protocol suite, marking the start of the modern Internet.

1989:


  • The web was invented at CERN by Tim Berners-Lee in 1989.
  • Berners-Lee proposed an information management system, on 12 March 1989, then implemented the first successful communication between a Hypertext Transfer Protocol (HTTP) client and server via the internet, in mid-November of the same year.
Image result for berners-lee
Tim Berners-Lee

1990: 


  • ARPANET shuts down in 1990.

1991:


  •  NSFNET lifted its restriction for use in commercial purposes in 1991.

  • For much of the period from 1987 to 1995, following the opening up of the Internet through NSFNET and in particular after the creation of the for-profit ANS CO+RE in May 1991, some Internet stakeholders were concerned over the effects of privatization and the manner in which ANS, IBM, and MCI received a perceived competitive advantage in leveraging federal research money to gain ground in fields in which other companies allegedly were more competitive.

                                                      Image result for nsfnet

2006:


  • In 2006, Amazon launched its Elastic Compute Cloud (EC2) as a commercial web service that allows small companies and individuals to rent computers on which to run their own computer applications.
  • Amazon announced a limited public beta test of EC2 on August 25, 2006, offering access on a first-come, first-served basis.
  •                                 
                                           Image result for elastic compute cloud

THE INTERNET CONTINUES TO EVOLVE AND CHANGE OUR LIVES IN ALL ASPECTS UNIMAGINABLE!!

⧪⧪⧪

Cookies

Cookies   It's time for cookies!   It is always favorable for websites to keep track of their visitors so that they can either ...