Dns,tcp,ip,http,socket,servlet Concept Finishing

Source: Internet
Author: User
Tags ack error status code nslookup nslookup command

          Concept FinishingAlthough the common protocol is easy to understand, but after looking after a period of time not to see or easy to forget, note the following, more fragmented, reluctantly for you to review. If there is a mistake, please correct me. DNS ProtocolThe role of the DNS protocol is to resolve the domain name to IP, the number of domain names is very large, and the corresponding relationship between the domain name and IP also changes frequently, so a dedicated DNS server is needed to resolve the domain name to IP. Under Windows, the nslookup command can view the results of the domain name resolution. nslookup + URL. There are many DNS servers around the world, and there are some large public DNS servers that can be used, For example, Google's 8.8.8.8 and domestic 114.114.114.114. The DNS server that we directly access is called the local DNS server, which obtains the IP corresponding to our request domain name from the primary DNS server and puts the corresponding relationship in the cache. Domain name also has a lot of times bad use, so navigation page is needed. The navigation page for the applet and the public number is yet to be developed. TCP/IP protocolIP protocol is used to query the address, corresponding to the Internet Interconnect layer, the TCP protocol is used to standardize the transmission rules, corresponding to the transport layer. IP is responsible for locating the address, and TCP is responsible for specific transmissions. This is a two different protocol. TCP in the transmission before the last communication, commonly referred to as the "last handshake", the transmission of data when disconnected four times to communicate, commonly referred to as "four wave". Correlation ordinal and flag bit: the abbreviation for seq:sequence number, which represents the ordinal number of the transmitted data. The abbreviation for ack:acknoledgement number, which indicates the acknowledgement. ACK: It is true that the ACK only works when ack=1. SYN: Synchronous bit, used to synchronize the sequence number when establishing a connection. FIN: The terminating bit, which is used to release the connection after the data transfer is complete. Protocol for the Transport layer and UDP,UDP is not connected, TCP communication is good before the transfer of data, UDP to get the address immediately transfer. TCP is reliable, but inefficient, and UDP is often used for resources with low integrity requirements such as video and voice. The protocol is just a set of rules and does not work exactly like the interface of a program, and the socket is a specific implementation of the TCP/IP protocol. HTTP protocolHTTP is an application-layer protocol that can be used after the TCP/IP protocol receives the data and needs to be parsed by the HTTP protocol.  The encoding and decoding process in the process of sending telegrams is equivalent to the HTTP protocol in the network transmission. Message structure in HTTP protocol: 1, Request message Method URL HTTP version \ r \ n Parameter 1: value parameter 2: value,,, body 2, corresponding message HTTP version status Code short reason \ r \ n Parameter 1: value parameter 2: value,,, master  The status code in the body response: 1XX: Informational status code. 2XX: Success status code. 3XX: Redirect Status code.  301 indicates redirection. 4XX: Client Error status code. 404 5XX: Service-side error status code. 500 indicates an internal error. sockets,Servlets and JavawebThe   servlet is part of the Java EE Standard and is the Javaweb development standard. The role of a servlet is to process the received data and generate the results to be returned to the client. The servlet is processing the received data and generating the results to be returned to the client, and the servlet has developed the standard for processing Web requests in Java, and we need to do it according to standards. To use the servlet requires a corresponding servlet container, such as a common TOMCA is a servlet container t.  1,socket: is a specific implementation of the TCP/IP protocol. The network communication in Java is implemented through the socket, the socket is divided into two categories, ServerSocket and socket,serversocket for the service side, through the Accept method to listen to the request, after hearing the request to return the socket, The socket is used to complete the data transfer, and the client directly uses the socket to initiate the request and transfer data. In addition, jdk1.4 began, Java added new IO mode: NIO, (new IO), greatly improved the IO efficiency, the socket is also a kind of Io, NIO provides the corresponding tools: Serversocketchannel and Socketchannel. corresponding to the original serversocket and sockets respectively. Nio:buffer (data), channel (channels), Selector (Sorter), after the two many-to-many relationship. P29 has a processing process.  2,http protocol is the protocol of the application layer, after the TCP/IP protocol receives the data, it can be used after the HTTP protocol parsing, similar to the encoding and decoding in telegram.  3,servlet is part of the Java EE Standard, Server+applet: Represents a server application whose role is to process the received data and generate the results to be returned to the client, and the servlet has developed a standard for processing Web requests in Java. The standard does not work on its own, so it is necessary to have a servlet container in order to use the servlet, for example, our common tomcat is a servlet. The return value of the Getservletcontext method ServletContext represents the UH make us this application itself. When the parameter selection is saved to application, most of it is saved in ServletContext (application level, and ServletConfig is the servlet level). The method in the Servlet interface, the Init method, is Qidong in the containerCalled, Getservletconfig is used to get the Servletconfig,service method to handle a request specifically, and the Getservletinfo method can obtain some servlet-related information, such as the author. Genericservlet is the default implementation of the servlet, 1, implements the ServletConfig interface, 2, provides the parameterless Init method, 3, provides the log method. HttpServlet is the base class of a servlet implemented with the HTTP protocol, which can be inherited directly when writing a servlet (Dispatchservlet). HttpServlet mainly overrides the service method. In the service method, ServletRequest and Servletresponse are first converted to HttpServletRequest and HttpServletResponse. The requests are then routed to different processing methods based on the different HTTP requests. Doget,dopost,dodelete and so on. HttpServlet, the main way of routing different requests to different processing methods, and SPRINGMVC all the requests are merged into a unified method for processing.   -----White Reference: "Springmvc in Action Source Code and Practice"--Han Lubiao http://www.cnblogs.com/mingbai/p/ Webconceptions.html

Dns,tcp,ip,http,socket,servlet Concept Grooming

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.