Common surface Pilots for PHP network protocols

Source: Internet
Author: User
Tags snmp file transfer protocol ftp protocol
This article introduces the content of the PHP network protocol common surface of the pilot, has a certain reference value, now share to everyone, the need for friends can refer to

  <?php/** * Created by Phpstorm. * User:weisheng * DATE:2018/3/15 * time:15:08 *//* * Common Research points * 1.http Protocol status Code * 2.OSI Seven layer model * 3.http of work characteristics and working principle * 4.http Common protocol request/alarm How-to headers and request methods * 5.HTTPS Protocol Works * 6. Common network protocol meaning and port * *//* * I. HTTP protocol status code * 2 Start (successful request) indicates that the processing request successfully status code * 200 (Success) The server has successfully processed the request * 20 1 (created) The request was successful and a new resource was created * 201 (Received) the server has accepted the request but has not processed * 203 (non-authoritative information) the server has successfully processed the request, the information from the SLR returned from another source * 204 (no content) the server successfully processed the request, but did not return any Content * 205 (reset content) the server successfully processed the request, but did not return anything * 206 (partial) The server successfully processed a partial GET request * * * 3 start (Request redirection) indicates to complete the request, further action is required. Usually these states are used to redirect * 300 (multiple choices) for requests, the server can perform a variety of operations. Service it selects an action based on the requestor (user agent) or provides a list of actions that the requestor chooses * 301 (permanently moved) The requested page to move permanently to the new location. When the server returns this response (a response to a GET or head request), the requestor is automatically forwarded to the new location * 302 (Temporary Move) The server is currently responding to the request from a Web page in a different location, but the request should continue to use the original location for subsequent requests * 303 (see other locations) the requestor should Use a separate GET request for different locations to retrieve the response, the server returns this code * 304 (unmodified) The requested webpage has not been modified since the last request. When the server returns this response, the Web page content * 307 (temporary redirection) server is currently responding to requests from different locations of the Web page, but the request should continue to use the original location for subsequent requests (following the browser standard, does not change from post to get request) * * * * 4 start (Request error) These status codes Indicates that the request may be faulted, which prevents the server from processing * 400 (Bad Request) The server does not understand the syntax of the request * 401 (Unauthorized)Request authentication required. For network logon Web pages, the server may return this response * 403 (Forbidden) server denied request * 404 (not found) the server could not find the requested Web page * * * * 5 Start (server error) These status codes indicate that the server has an internal error while trying to process the request. These errors may be the server itself error, not the request error * 500 (server internal error) the server encountered an error, unable to complete the request * 501 (not implemented) the server does not have the ability to complete the request. For example, this code may be returned when the server does not recognize the request method. * 502 (Error Gateway) server as a gateway or proxy that receives an invalid response from the upstream server * 503 (server unavailable) The server is currently unavailable (due to overloading or downtime maintenance).  Usually only temporary status * 504 (Gateway Timeout) server as gateway or proxy, but not in time to receive requests from upstream server * 505 (HTTP version not supported) server does not support the HTTP protocol version used in the request * * * *//* * OSI seven layer model * First layer: Physical layer establish, maintain, disconnect physical connection * Second layer: Data link layer establishes logical connection, hardware address addressing, error checking and other functions * Third layer: Logical address of Network layer             Addressing, enabling path selection between different networks * Layer Fourth: Transport layer defines the protocol port number of the transmission, and the flow control and error checking (protocol: TCP UDP, the packet goes to the network transport layer once it leaves the NIC) * Layer Fifth: Session layer Set up, manage, terminate a session * Layer sixth: Representation of layer data, security, compression * Layer Seventh: Application-layer Network service with end-user interface (protocol has: HTTP FTP (file transfer) TFTP S  MTP (Simple Mail send) SNMP DNS (domain name resolution) TELNET (for Telnet) HTTPS POP3 (accept mail) DHCP) * * Operating characteristics: Based on B/S mode communication overhead is small, simple and fast, low transmission cost without status * * How it works: The client sends a request to the server, creates a TCP connection, specifies the port number, defaults to 80, connects to the server, the server listens to the browser request, once the customer is tappedEnd request, after parsing the request type, the server returns the status information and data contents to the client * *//* * HTTP protocol Common request/Response header * Request Header: * Request method: GET POST Accept: Data type supported by client accept- Charset: The encoding accept-encoding used by the client: The data compression format supported by the client Accept-language: The client's locale host: the hostname the client wants to access If-modi Fied-since: Cache time for client resources Referer: from which resource the client accesses the server (anti-theft chain) User-agent: Client's software Environment Cookie: Data response header to the server: location: This head Use with 302 status codes to tell the client who to look for server: type content-encoding: Data compression format content-length: Length of loopback data content-type: Type of loopback data last-modified : Current resource Cache time refresh: How often refreshes content-disposition: Open Data transfer-encoding: Data transfer format ETag: Cache-Related header expires: How long is the resource cache,- 1 or 0, is not cache Cache-control:no-cachepragma:no-cache Common request method: 1, Options returns the HTTP request method that the server supports for a specific resource, or it can be used to send ' * ' to the Web server Request to test the functionality of the server 2, the head to the server with the GET request consistent response, but the response body will not be returned. This method can get the meta information contained in the response small message header without having to transmit the entire response content. 3. Get makes a request to a specific resource. Note: The Get method should not be used in operations that produce "side effects", such as in Web application, where a get can be accessed randomly by a spider. The GET Request function in LoadRunner: Web_link and Web_url4, Post submits data to the specified resource for processing requests (such as submitting a form or uploading a file). The data is included in the request body. A POST request may result in the creation of new resources and/or modification of existing resources. Corresponding POST request in LoadRunnerFunction: WEB_SUBMIT_DATA,WEB_SUBMIT_FORM5, put uploads its latest content to the specified resource location 6, delete request server deletes request-url identified by the resource 7, trace echoes the request received by the server, Primarily for testing or diagnostics 8, the connecthttp/1.1 protocol is reserved for proxy servers that can change connections to pipelines. Note: 1) The method name is case-sensitive, and the server should return a status code 405 (method not allowed) when a request is directed to a resource that does not support the corresponding request method, and the status Code 501 (not) should be returned when the server does not recognize or support the corresponding request method. Implemented). 2) The HTTP server should at least implement the Get and Head/post methods, the other methods are optional, and in addition to the methods described above, a specific HTTP server supports extending the custom method. *//* * Two. Common network Protocols Internetwork Protocol: IP Protocol, ICMP protocol, ARP protocol, RARP protocol. Transport Layer Protocol: TCP protocol, UDP protocol. Application layer protocol: FTP, Telnet, SMTP, HTTP, RIP, NFS, DNS. Common ports that use the TCP protocol are mainly the following: (1) FTP: Defines the file transfer protocol, using 21 ports. Often said that a computer opened the FTP service is to start the file transfer service. The FTP service is used to download files and upload the homepage. (2) Telnet: It is a port for remote login, the user can remotely connect to the computer as their own identity, through which can provide a DOS-based communication service. As the previous BBS is a pure character interface, support BBS server will open 23 ports, external services. (3) SMTP: Defines the Simple mail delivery protocol, which is now used by many mail servers to send mail. such as the common free mail service is the use of this mail service port, so in the e-mail settings are often seen so SMTP port settings This column, the server is open Port 25th (4) POP3: It is and SMTP correspondence, POP3 used to receive mail. Typically, the POP3 protocol uses 110 ports. Common with UDP protocol ports are: (1) HTTP: Hypertext Transfer Protocol. When surfing the web, you have to open port 80th on the computer that provides the Web resources to provide the service. It is often said that the "WWW service", "Web Server" is the use of this port. (2) DNS: For Domain name resolution services, this service is used most in Windows NT systems. DNS is using port 53rd. (3) SNMP: Simple Network Management protocol, using port 161th, is used to manage network equipment. In addition, agent serviceThe following ports are commonly used by the service: (1). HTTP protocol Proxy Server common port number: 80/8080/3128/8081/9080 (2). Socks Proxy Protocol Server common port number: 1080 (3). FTP protocol Proxy Server common port number: 21 (4). Telnet protocol proxy Server Common port: 23 */

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.