Testers need to have knowledge of computer network

A: network classification

  Telecommunications network (telephone network), cable television networks, computer networks (focus on talking about this)

II: Computer network according to the classification of the coverage: MAN, LAN, WAN (other classification much, no explanation)

  1. metropolitan area network (MAN)

    MAN (Metropolitan Area Network) is a network between a scope and a wide area network LAN, which may generally extend network coverage to the entire city, a plurality of local area network link to form a large urban public communication network by means of an optical fiber, so that only LAN the resources can be shared, resources can be shared between the local area network.

  2. Local Area Network (LAN, Intranet)

    LAN (Local Area Network) is used in a small area, a network of multiple computers, the coverage is usually confined to a range of 10 km, belonging to a unit or department organized a small range fence, LAN file can be achieved management, application sharing, printer sharing, shared scanner, scheduling within the working group, e-mail and fax communication services and other functions. LAN is closed, you can make up the two computers office may be composed of thousands of computers within a company composed.

  3. Wide Area Network (WAN, extranet)

    WAN (Wide Area Network) is a big leap, a collection of regional computer networks. Usually across the province, city, or even a country. WAN including large and small different subnets, subnet may be a local area network, it can also be a small WAN.

Three: OSI seven-layer network model

  

  1. First layers: the physical  

    Activating, maintaining, close communication between endpoints mechanical properties, electrical properties, functional properties and process characteristics. This layer provides a reliable physical medium for data transmission upper layer protocols. Briefly, the physical layer ensures that the original data can be transferred in a variety of physical media. Remember that two important physical layer device name, the repeater (the Repeater, also called an amplifier) ​​and the hub.

    For example, we are more familiar with: card, twisted pair cables.

  2. Second layer: data link layer

    Physical addressing, while the original bit stream into logical transmission lines, the effect layer comprising: addressing a physical address, data framing, flow control, error detection data, such as retransmission.

    Knowledge about the data link layer: can be understood as a simple channel data.  

    1> The data link layer provides reliable data transport network layer;

       2> The basic data unit is a frame;

       3> Main protocols: Ethernet protocol;  

       4> Name two important devices: bridges and switches

  3. The third layer: The network layer

    Operation control subnet addressing logic, packet transmission, routing. Involved in numerous network layer protocols, including the most important protocol is IP protocol. The main function of the IP protocol are: connectionless data transmission, data packet routing and error control.

    Focus on network layer:  

    1> Network sub-layer is responsible for inter-network routing packets. Further, the network layer may also implement congestion control, internetworking functions;

       2> is the basic data unit of an IP datagram;  

    3> including the main agreements:

       IP protocol (Internet Protocol, Internet Protocol);  

       ICM protocol (Internet Control Message Protocol, Internet Control Message Protocol);  

       ARP protocol (Address Resolution Protocol, ARP);  

       RARP protocol (Reverse Address Resolution Protocol, Reverse Address Resolution Protocol)  

    4> important equipment: routers.

  4. Fourth layer: the transport layer

    Is an end, that is host to the level of the host. The transport layer is responsible for the data segment and the upper-end reliable or unreliable transport. In addition, the transport layer process also end to end error control and flow control problems. The task of the transport layer characteristics of the communication subnetwork is, the best use of network resources, session layer between two end systems, providing the establishment, maintenance, and the transport connection cancellation function is responsible for reliable end to end data transmission. In this layer, the protocol data unit information transfer is called a segment or message. (TCP protocol belongs to this layer)

    The network layer packet networks only transmit the address of the source node to the destination node is sent, a transport layer is responsible for reliably transferring data to the corresponding fracture.

    Related to the transport layer of focus:  

    1> is responsible for the transport layer data segment and an upper-end reliable or unreliable transport and end to end error control and flow control issues;

       2> comprising a main protocol: TCP (Transmission Control Protocol, Transmission Control Protocol), UDP protocol (User Datagram Protocol, User Datagram Protocol);  

    3> important equipment: a gateway.

  5. Fifth Layer: Session Layer

    Established between users on different machines and session management

    To establish a connection between a session entity. To give two peer session service users to establish a session connection, you should do the following tasks:

      Session addresses are mapped to address transportation

      Select the transport quality of service parameters required (QOS)

      Session parameters negotiated

      Identifying each session connection

      Limited transmission of user data transparent

  6. Sixth Layer: The presentation layer

    Syntax and semantics and their associated information, such as encryption and decryption, translation conversion, compression and decompression

    The presentation layer is to provide a common language for the heterogeneous computer communication, in order to interoperate. The need for this type of service, because the data using a different computer architectures represents a different method. For example, IBM hosts using EBCDIC coding, while most of the PC using the ASCII code. In this case, the session layer will need to complete this conversion.

  7. Seventh layer: Application Layer

    Application layer provides services to the application, these features provide their services to the applications are divided into groups, and called service elements. Some can be for a variety of applications used together, some less, compared with the use of a class of applications.

    A variety of application protocols: such as HTTP, FTP, SMTP, POP3.

    HTTP: Hypertext Transfer Protocol; FTP (port number 21): File Transfer Protocol; SMTP (port number 25): Simple Mail Transfer Protocol; POP3 (port number 110): Post Office Protocol version 3; Finger: User Information protocol.

Four: Common Agreement

    1.TCP agreement

      TCP transport layer protocol is the fourth layer of the OSI model, communication is connection-oriented protocol, done by three-way handshake to establish a connection, communication connection is to be dismantled, since TCP is a connection-oriented so only for end to end communications.

      TCP three-way handshake protocol: the so-called three-way handshake (Three-Way Handshake) namely the establishment of a TCP connection, refers to the establishment of a TCP connection, the client and the server needs to send a total of three packages to confirm the establishment of the connection.

      

      Similar to our call

        A: in it? I find you something [send a SYN, requesting a connection]

          B: I'm in, can you hear me? [Enter connection, ACK = 1, then send a request SYN]

          A: I heard [the other party to confirm the link, the connection is established]

      

      Why can not two-way handshake or four-way handshake?

       Two-way handshake => client requests the server can only know their own voices received, the server does not know the server to the client send the client can not receive information.

       Four-way handshake => Client and server communicate with each other have knowledge and ability, if we send a confirmation message, that is a waste of resources.

    2.IP protocol (network layer of the OSI model)

      Each network adapter on the TCP / IP protocol network has a unique IP address. An IP address is a 32-bit address, the end address is usually divided into four, each is a length of eight binary, but for ease of reading, each segment will usually be converted to decimal display, such as very familiar 192.168.0.1.

       IP address into two parts: a network ID, host ID, which part belongs to the specific network ID, which does not belong to a predetermined host ID.

      Most of the IP address belongs to the following categories:

         Class A addresses: The first 8 bits represent the network ID IP address, 24 bits represent the host ID.

         Class B addresses: the first 16 bits represent the network ID IP address, the next 16 bits represent the host ID.

         Class C addresses: the first 24 bits represent the network ID IP address, for 8 bits represent the host ID.

      Here it is evident that can be less able to provide a Class A addresses the network ID, but each can have a lot of network hosts.

        How to see an IP address in the end is what kind of address it?

        If the 32-bit IP address starts with 0, then it is a class A address.

        If the 32-bit IP address starts with 10, then it is a class B address.

        If the 32-bit IP address starts with 110, then it is a Class C address.

        If the 32-bit IP address starts with 111, then it is a class D address.                           

        If the 32-bit IP address begins with 1111, then it is a Class E address.

      Then converted to decimal (four), we will be able to decimal numbers in the first paragraph to distinguish between IP addresses in the end is what kind of address.

      Note: Each class has a number of excluded addresses that do not belong to the class, they are using the address in some special cases

    3.TCP / IP protocol  

      TCP / IP is a protocol-based system, which is a set of protocols for network communications. Accurate for TCP / IP is not a protocol, but a family of protocols collectively. Which includes the IP protocol, IMCP protocol, TCP protocol, and we are more familiar with http, ftp, pop3 protocol and so on. Traditionally, TCP / IP is considered to be a four-layer protocol:

      

    4.UDP protocol (the transport layer in the OSI model)

      Internet protocol suite supports a connectionless transport protocol, the protocol called User Datagram Protocol (UDP, User Datagram Protocol). UDP provides a method for IP datagrams can be sent without establishing a connection for the application package. Internet has two main transport layer protocols, complement each other. No connection is UDP, in addition to its function to send packets to the application and allow them to own protocol architecture at the desired level, there is little special things to do. Is connection-oriented TCP, the protocol to do almost everything.

      UDP protocols include: TFTP (Trivial File Transfer Protocol), SNMP (Simple Network Management Protocol), DNS (Domain Name Resolution Protocol), NFS (Network File System), BOOTP.

      TCP and UDP difference:  

      TCP is connection-oriented, reliable byte stream service;  

      UDP is a connectionless, unreliable datagram service.  

      TCP reliable to ensure data integrity and error control and retransmission, UDP unreliable.      

      How to choose: high level of security: use a TCP not less important: use UDP

    5.HTTP protocol (application layer in the OSI model)

      Hypertext Transfer Protocol (HTTP, Hyper Text Transfer Protocol) is the Internet's most widely used network protocol. All WWW documents must comply with this standard.

      (1) HTTP protocol which includes a request? (There are eight remaining not common, no more explanation)

         GET: request to read information from the URL of the logo.

         POST: add information to the server (such as comments).

         PUT: a document stored in the given URL.

         DELETE: Delete URL resources given the flag.

      The difference (2) GET and POST requests

        <1> get data from the server is obtained, and the post is used to transfer data to a server.

        <2> get the data in the form of variable = value form, appended to the url action points, and between them using "?" Connection, used between the various variables "&" connected, i.e. URL? Parameter value = & parameter = value ... so transmitted in plain text, a smaller amount of data transmitted can not be greater than (HTTP protocol does not specify the maximum length of the URL of 2KB, but if the server can not handle a predetermined url too long, have to return status code 414, url maximum length of the user's browser related, and also the server can handle the maximum extent url a). post is placed in the data form in the data form in the body, and in accordance with the variable value corresponding manner, is transmitted to the action pointed url.

        <3> post can transmit large amounts of data, it can only be used to upload files post.

        <4> get security is very low, because the url during transmission, the data are on request, so there may be some privacy information being viewed by third parties. In addition, users can directly see the data submitted in the browser, some of the internal system messages will be displayed together in front of the user. post all operations are invisible to the user, so the higher post security. (Post request interface needs the tools to do interface testing, get a request interface directly with the browser can, of course, can make use of interface testing tool).

        <5> get form form is the default method.

      (3) HTTP status code is returned

       1XX: class information response indicating receipt of the request and continue processing

       2XX: treatment success response class that represents the action was successfully received and processed

        200 OK: client request is processed normally made on the server side, and provides the requested page; (common)

        204 No Content: The client sends a request has been processed normally, but the server is not responding resources can be returned, the browser displays the page does not update;

        206 Partial Content: client requests a range, the server successfully executed GET request entity returns the corresponding content;  

       3XX: Redirection response class, no further action needs to complete the request 

        301 Moved Permanently: permanent redirect, represent the requested resource has been assigned a new URI, the future should use the new URI is accessed; 

        302 Found: temporary redirect, indicate the requested resource is temporarily assigned a new URI (later also may change), this time want the user to use the new URI to access the resource;  

        303 See Other: indicates due to the presence of another resource corresponding to the request URI, using the GET method should be directed acquiring resource request. Status code 302 with the same function, but the 303 status code indicates that the client should use the GET method of access to resources;  

        304 Not Modified: If the page is not updated since the last time the requestor, then use the 304 code tells the search engine robots can save bandwidth and overhead;

        307 Temporary Redirect: temporary redirection status code 302 with the same function, but the browser 307 in accordance with the standard, does not become the GET from POST;  

       4XX: client error, the client request contains a syntax error or can not fulfill the request 

        400 Bad Request: Request packet client in a syntax error ( Solution: Check the syntax, try again, if there is an error still submit work orders );  

        401 Unauthorized request sent by the client needs to have the relevant certification information, you try to access restricted pages but not authorized, the site returns an HTTP 401 error. Bad login attempt is the main reason that led to this error. ( Solution: contact the site administrator to obtain the correct account to submit tickets contact technical staff. .);  

        403 Forbidden: client server denied access to the resource, usually the default home page or site does not bind Binds the default home page error ( Solution: Check the default home page of your own program what kind of background you can add a default home page ); (common)

        404 Not Found: Unable to find the requested resources on the server, the file may be moved to somewhere else, or simply do not exist ( solution: 1 Please log in ftp to check whether a file or web page does not exist, the missing pages file recovery to the correct position 2 to restore the data you submit a ticket the day of the week. ); (common)

       5XX: server error, the server can not properly perform a proper request (to go look at the server logs, look thrown exception, then concrete analysis of what causes)

        500 Internal Server Error: server error occurred while performing the request, the server-side web application design problem and the server does not turn on verbose error; (common)

        503 Service Unavailable: the server is temporarily being in an overload state or is down for maintenance, are unable to process the request ( solution:. 1Linux virtual host by restarting the site can be restored back to normal, if not, please submit a ticket 2widows Hosting please submit a ticket contact. technical staff to handle ). (common)

        500 error is a problem often encountered on my experience, causes and solutions are summarized as follows:

          1, running too many users, resulting in pressure on the server is too large, the server can not respond, the report HTTP500 error. The reason is the site reported a 500 error is the main reason, why the sudden a lot of sites will be reported 500 errors (service unavailable) it? 90% is due to the excessive pressure space, beyond the limit set in space caused. Encounter this problem, it is best to find space for the first time after-sales service providers, they generally will help you recover what application pool, the problem will be solved. If the service is not found, you can manage your own space in the background, find the "recycle application pools" that project he performed manually click. However, some space management background and does not provide this service.   

         2. If the first possibility is ruled out, then there is a problem on big reason is the program. Can do a simple test page to see if it can run successfully, then detect an error page, thus targeted to be modified. The association places do not do the association, the report HTTP500 error. Manual or automatic correlation, the problem is resolved.

         3, if the operation performed in the test data needs to be inserted into the database, if the result in the database table is full, or buffer pool in the case of large data amount can not meet the small access to data, are likely to cause errors HTTP500 . The solution is to adjust the database, modify the connection pool size, etc., can be corrected according to individual circumstances.

      (4) the difference between HTTP and HTTPS and contact

        HTTP is the Hypertext Transfer Protocol, is used between the Web browser and the web server to transmit information, HTTP protocol to send the content in plain text, data encryption does not provide any way, so the HTTP protocol is not suitable for transmission of sensitive information, such as: credit card numbers, passwords and other payment information. To ensure the privacy of data transmission can be encrypted, so designed Netscape SSL for HTTP protocol data transmission is encrypted, thus born HTTPS.

        The main difference between the two:

        CA 1.https agreement needs to apply for a certificate, generally less free certificates, thus requiring a fee. Personal website, small sites do not need to use.

        2.http is hypertext transfer protocol, information is transmitted in the clear, https is encrypted with security of SSL transfer protocol (https is not absolute security, hacker attacks, denial of service attacks, hijacking and other aspects of the server almost does not work, the most critical SSL certificate credit chain system is not safe, especially in certain countries can control the CA root certificate, the man in the middle attacks as you can).

        3.http https and use a completely different connection, with the port are not the same, http is 80, https is 443.

        4.https connection is very simple, stateless, https protocol is SSL + HTTP protocol may build encrypted transmission, network authentication protocol.

        5.https connection cache as good as http efficient and will increase the cost and power consumption data, even with established safety practices and therefore will be affected.

        6.https protocol handshake stage time-consuming

    6.FTP protocol (application layer in the OSI model)

      FTP protocol file transfer protocol, as with most Internet services, FTP is a client / server system. Users connect to the server program running on a remote computer through a client program. Providing computer services in accordance with the FTP protocol, file transfer is an FTP server, FTP server and computer connections, follow FTP file transfer protocol server is the FTP client.

      Windows usually comes with "ftp" command, which is a command-line FTP client, another popular FTP clients as well as CuteFTP, Ws_FTP, Flashfxp (our company uses this, what used to upload code), LeapFTP, meteor shower - cat's eye and so on.

Five: Cookie and Session

   Cookie and the difference 1.Session

      (1) .session stored on the server side, users can not modify, relatively safe, the client cookie store, the user can be modified by means of relatively insecure.

      (2) .session be saved within a certain time on the server when accessing the increase, it would be more tying up server resources and limit a single cookie in the client is 3k, a site that is stored in a cookie client can not exceed 3k.

      (3) .cookie suitable for users to save personal settings, hobbies, etc., session suitable for client authentication.

      (4). Both can be set by the time length of time.

      (5) prohibit the cookie, session can not start.

   2.Session and Cookie agreements and principles

      Session server to each client is assigned a unique number, as the identification of each client. When a program needs to create a session for the request of a client, the server first checks the client's request whether which already contains a session identifier (called a session id), previously if already contains instructions have been created over the session for the client, server session id will follow this session retrieved using (not retrieved, it will create one).

      Cookie is a clip information sent from the server to the client, the client is stored in the browser's memory or hard disk, every time that a page request, which are the data sent to the server side, it can be utilized in the remote browser and storing data identifying the user and thus tracking mechanism.

   3.Session operating mechanism, multiple web servers how to share session

      Each share is a shared server, it is clear that this session is to put a special place such as a database, each server call this inside the database session.

Guess you like

Origin www.cnblogs.com/ttxcs/p/11627528.html