(i)Client server model and Peer-to-peer
(iii)Socket Programming :
Interface between the Process and the Computer NetworkSocket
• Any message sent from one process to another must go through theunderlying-network.
• A process sends/receives message through a software-interface of underlying-network
called socket.
• Socket is an API between the application-layer and the transport layer within a host
(Figure 1.2).
• The application-developer has complete control at the application-layer side of the
socket.
• But, the application-developer has little control of the transport-layer side of the socket.
For ex: The
application-developer can control:
1) The choice of transport-protocol: TCP or UDP. (API Application Programming Interface)
2) The ability to fix parameters such as maximum-buffer & maximum-segment-sizes.
Wrt HTTP (i)Discuss about Non-Persistant and Persistent Connections with HTTP:
RTT is the time taken for a packet to travel from client to server and then back to the client.
• The total response time is sum of following (Figure 1.4): i) One RTT to initiate TCP
connection (RTT Round Trip Time). ii) One RTT for HTTP request and first few bytes of HTTP
response to return
Example :
Request Line:
Method URL Version
GET /Falcon9/home.html HTTP:/1.1
Header Lines :
Filed name : Values
Host: www.Spacex.com
Connection : Close
User Agent: Mozilla/5.0
Accepted-language: eng
Eng: English as the accepted language
HTTP METHODS :
1) GET is used when the browser requests an object from the
server.
2) POST is used when the user fills out a form & sends to the
server.
3) HEAD is identical to GET except the server must not return a
message-body in the response.
4) PUT is used to upload objects to servers.
5) DELETE allows an application to delete an object on a server
Example :
HTTP/1.1 200 OK
Example :
GET /launches/ HTTP:1.1
Host: www.Spacex.com
If-modified-since : Thu , 4 April 2024 22:40:00
Response :
HTTP:1.1 304 NOT MODIFIED
DATE: Tue , 2 April 2024 08:30:00
////Note Its not modified as the latest launch of Falcon 9 took place on
1st April 7:30 pm Pacific time