1. Web service:
Run in user space
Application Layer Protocol: http, HTTPS
Transport Layer Protocol: tcp, udp, SCTP
2, Transport Layer Port Division:
0-1023: Privileged port, Well known, is permanently assigned to the fixed app for Use.
1024-41951: also for the registered port, but the requirements are not particularly strict, assigned to the program to register for the use of an application; mysql:tcp3306
41952+: the client program randomly uses the port, the dynamic port, or the private port. Its scope is defined in//proc/sys/net/ipv4/ip_local_port_range;
3. A BSD SOCKET:IPC implementation that allows communication between processes located on different hosts (or the same host)
Socket API: encapsulates the system calls related to socket communication in the Kernel.
4. TCP FSM: finite state machine
Closed: off
Listen: Monitoring
Syn_sent:
Syn_recv
Establish
Fin_wait1: Breakup wait Stage 1
Close_wait
Fin_wait2
Last_wait
Time_wait
CLOSED
5. Socket Type:
Partition based on Transport layer protocol
SOCKET_STREAM:TCP sockets
SOCKET_DGRAM:UDP sockets
Socket_raw: Bare Socket
Based on the address format (socket Domain) used by the Socket:
Af_inet:address Family,ipv4
Af_inet6:address Family,ipv6
Af_unix: a different process on the same host, based on the use of the socket socket communication address, Unix_sock (not to the TCP downlevel encapsulation, but instead put the process in memory as a file for other processes to access Traffic)
6, the characteristics of the TCP protocol:
①, establishing connection: Three-time handshake
②, package data into segments, test and (crc32)
③, confirmation, retransmission, Timeout mechanism
④, sort: based on logical number control
⑤, Flow control: sliding window algorithm
⑥, congestion Control: slow start and congestion avoidance algorithms
7, http:hyper Text Transfer protocol: application layer protocol, is a text protocol, using tcp:80 port,
Html:hyper text Mark Language: Hypertext Markup language, which is a programming language.
Css:cascading style sheet: define page styles
js: javascript, Script Development language , client script (run on client), source hypertext file download to the client engine run, and Java is not related ;
8, Wen Service has two kinds of development technology:
Client Technology: JavaScript
Server-side technology: php, JSP (server-side scripting, running on the Server)
9. Http:
Text protocol, which means that the transfer of HTML to ASCII code transfer, the picture is binary storage, early can not be transmitted with HTTP.
Protocol Version:
Http/0.9: prototype version, less functionality and inadequate, rudimentary
Http/1.0: introduced the cache, mime, method
Mime:multipurpose Internet Mail extension: Multi-Purpose Internet Mail Extension protocol; It can transmit non-textual information and encode different format files
method:get, POST, HEAD, PUT, DELETE, TRACE, OPTIONS ... Wait a minute
Http/1.1: Enhanced Cache functionality
Http/2.0:
HTTP protocol Operating mode:
HTTP Request Message: HTTP requests
HTTP Response message: HTTP response
Note: an HTTP thing: an event consisting of an HTTP request and a corresponding HTTP Response.
Web Resource: The web Resource,web consists of (many) Resources.
Static resources: pictures, jpg, png, text, js, css, mp3,
Static resources do not require additional processing by the server, client requests, and the service sends resources directly
Dynamic Resources: The service side needs to be processed by the execution program, sent to the client is the result of the operation of the program, such as php, JSP
Note: there may be multiple resources on one page, and each resource requires a separate Request.
Identity mechanism for Web resources: url,uniform resource locator: a Uniform Resource locator that describes the location of a particular resource on a server.
URL format: scheme://server[:p Ort]/path/to/somesource
URL format example: http://www.sina.com.cn/index.html
Scheme: Specify protocol, http, ftp, etc.
Server[:p ort]: Www.sina.com.cn//default 80 port
File Path: index.html; can be omitted, default path (main Page)
10, a complete HTTP request processing process (server Side)
①, establishing, or processing a connection: accepting a request or rejecting a request
②: the process of receiving a request from a host request packet on a network for a specific resource, after three handshakes and four Disconnects.
③, processing request: to parse the request message, to obtain the resources requested by the client and the request method and other related information
④, Access Resources: Gets the requested resource in the request packet (typically to find resources on the hard disk, requires disk I/o)
⑤, Building Response Messages
⑥, Sending response messages
⑦, logging: used to analyze user wording
19. HTTP protocol and web base service