Working Princples of Websites
Working Princples of Websites
WEBSITES
• Browser is a client and after you have typed a URL, it
sends requests to a DNS server and gets the IP
address of the URL.
• It finds the server in that IP address and asks to setup
TCP connections.
• When the browser is finished sending HTTP requests,
the server starts handling your request packages and
then returns HTTP response packages to your browser.
• Finally, the browser renders the body of the web
pages and disconnects from the server.
• web server also known as a HTTP server; it uses
HTTP protocol to communicate with clients. All
web browsers can be seen as clients.
• We can divide web working principles into the
following steps:
– Client uses TCP/IP protocol to connect to server.
– Client sends HTTP request packages to server.
– Server returns HTTP response packages to client. If
request resources includes dynamic scripts, then the
server calls the script engine first.
– Client disconnects from server, starts rendering HTML.
• URL is Uniform Resource Locator and it's for describing resources
on the internet. Its basic form is as follows.
DNS:
• It's the name system for computer network services and it
converts domain name to actual IP addresses (just like a
translator).
DNS:It's the name system for computer network
services and it converts domain name to actual
IP addresses (just like a translator).
• HTTP protocol is the core part of web services.
• HTTP is the protocol that used for communicating
between browsers and web servers.
• It is based on TCP protocol, and it usually uses
port 80 in the web server side.
• It is a protocol that uses the request-response
model: clients send request and servers respond.
• According to HTTP protocol, clients always setup
a new connection and send a HTTP request to
server in every affair.
• The server is not able to connect to client
proactively (or via a call back connection).
• The connection between the client and the server can
be closed by either side. For example, you can cancel
your download task and HTTP connection. It
disconnects from server before you finish downloading.
• HTTP protocol is stateless, which means the server has
no idea about the relationship between the two
connections even though they are both from same
client.
• To solve this problem, web applications use Cookies to
maintain sustainable state of connections.
• Because HTTP protocol is based on TCP protocol, all TCP
attacks will affect the HTTP communication in your
server, such as SYN Flood, DoS and DDoS.
HTTP REQUSET
• GET and POST are most commonly used in HTTP.
• GET appends data to the URL and uses ? to break
them up, uses & between arguments,
like EditPosts.aspx?name=test1&id=123456.
• POST puts data in the request body because URL has
length limitation by browsers, so POST can submit
much more data than GET method.
• Also when we submit our user name and password,
we don't want this kind of information appear in the
URL, so we use POST to keep them invisible.
HTTP RESPONSE
• Status code tells the client that it is a HTTP server
and it has an expectation for the response.
• In HTTP/1.1, we defined 5 kinds of status code.
• - 1xx Informational
• - 2xx Success
• - 3xx Redirection
• - 4xx Client Error
• - 5xx Server Error