introduction:
1: CC attacks are normal business logic. Large concurrency makes it impossible for you to handle XP SP2. The above systems are sealed with RAW format protocol packet customization. In addition to changing the protocol based on the application layer, they are all simulation or request testing the transport layer
2: UDP will not stick packets or reduce packets unless the cache is full
3: The main features of TCP are:
3 handshaking connections
4 wave disconnects
congestion control
Retransmission control
For streaming transmission mode, the server needs additional analysis in terms of: protocol packet sticking, protocol packet shortage, protocol packet loss, exception protocol response, and normal protocol response
The main features of UDP are:
Packet transmission mode
Non stick package and wrong package
No connection, no congestion control, no retransmission mechanism
4: The main features of TCP are:
1.3 Handshake connection:
A test case: The press machine quickly closes after a large number of handshaking links are requested, requiring a large number of concurrent operations
1. Test logic point: test whether the underlying logic of the server can process normally when the socket is closed by the underlying logic of the server and a new socket link request comes
My test project BUG: After the socket port with ID 5000 is created, the server recycles the SOCKET with ID 5000 due to the pressure switch closing the socket, and the new TCP connection request uses the SOCEKT after the release of 5000. At this time, the server reports an error: the new SOCKET cannot be used
II Test case: The press is requesting a large number of handshaking links, which requires a large number of concurrent operations
II. Test logic point: test the maximum number of SOCKETs connected to the server to ensure that the server has available SOCKET resource allocation,
BUG of the project I tested: 5000 SOCKETs cannot be created successfully after the server creates them, because the configured JAVA memory is not enough and the number of open ports of the system is not enough
Test tool implementation of the above two points: only the IOCP and AIO bottom layer tests are the most effective, and the test also observes the bottleneck inflection point at N concurrency/sec
5: 4 wave disconnects:
Test case: The press sets the SOCKET option, which is quickly closed after a large number of handshake links are requested, requiring a large number of concurrent operations
//Quick socket closing:: setsockopt (pUsoc, SOL_SOCKET, SO_REUSEADDR, (const char *)&on, sizeof (bool))// Multiplexing port:: setsockopt (pUsoc, SOL_SOCKET, SO_DONTLINGER, (const char *)&off, sizeof (bool))// Open LINGER:: setsockopt (pUsoc, SOL_SOCKET, SO_LINGER, (const char *)&m_sLinger, sizeof (linger))// Set the forced closing of SOCKET
Test logic point: because the pressure robot modifies the socket configuration, the client actively disconnects, and the server fails to get the notification packet of four waves, resulting in the need for N time nodes to close the socket/not close the socket
Project test BUG: Since we can't get 4 wave packets, the server has a large number of abnormally long connections, leading to a denial of service
6: Congestion control - simply understood as blocking the exhaust hole of the car while stepping on the accelerator
Test case: The press client sets a 1-byte acceptance protocol or 1-byte buffer, and requests the big data that needs to be responded to: for example, ranking
Test logic point: due to the particularity of congestion control, TCP will open memory cache for this part of data. In short, the server generates more protocols, but sends fewer effective ones. The system caches more and more remaining protocols, and the hardware monitoring server's memory surges
Project test bug: Same as above. After setting the SOCKET parameter, the ranking data is requested, and the server memory explodes and crashes directly
7: Retransmission control
Test case: build a test agent tool to configure and forward parameters of packet transmission sequence/packet loss
Test logic point: because the particularity of retransmission is the control of the transport layer, packet loss and disordered requests are simulated at the application layer
The commonly used Kugou music APP uses tools to simulate retransmission control. When listening to music, it conducts packet loss and disorder tests, and the APP crashes
8: Streaming transmission mode, more content, take a look
Test case: protocol package sticking - automatically * N times through proxy tools, i.e. 123 changes to 123123123123123
Test logic point:
1) Test the maximum divisible packet limit of the server,
2) Test whether the server executes the protocol concurrently, such as collecting tasks, purchasing items, creating roles, etc
Project BUG: N 123 roles are created in the database, and the maximum number of complete protocol partitions is 4, and later transferred to 20/Max buffers
Test case: protocol is short of packets - sent through tool 1 byte
Test logic point:
1) Send 1 byte at high speed, and the server reads the processing protocol to consume CPU resources,
2) Occupying the server cache consumes resources for a long time. The above two points test the robustness of the server's protocol reading
Test case: private protocol on the server - construct abnormal data and valid data for testing
Test logic point:
1) Valid data
Packet - The effective data used here is both a super large packet, such as call and other variable protocols, which exceeds the upper limit of the server cache
Protocol interface - for known server protocol response interface traversal, traversal test whether there are unopened or frequent calls
Protocol parameter - A uses B parameters such as user ID, numeric type: 0 negative boundary value positive overflow
2) Abnormal data
Inclusion - modify the boundary value of inclusion or user-defined data, i.e. the inclusion is too short or too long
Protocol interface - traverse the server interface. The nonexistent interface will be modified automatically+N
Protocol parameters - Traversal bytes and protocol auto+N modification
Special protocols - and sending abnormal protocols such as 1 byte 00 11 22 33 - FF
Project BUG:
1) Protocol packet body: the mobile protocol modifies the packet body data, and the packet body is modified to 8 bytes. There is no protocol interface parameter, and the server reports an error and crashes
2) Protocol parameters:
User A logs in with user ID B, and forces user B to offline
The purchase quantity * amount exceeds the upper limit of the server variable, and the value overflows to the player
No need to say more about negative numbers. Sell something - 1, give one more to players
Use the value of 0 where there is division calculation, and the server crashes
3) Protocol interface:
The copy calls the strange self exploding protocol, and kills all strange
Role calls the transmission interface in prison to escape
Attack class, protocol interface for concurrent N/s requests for big data, server memory Cpu explodes, and request frequency is limited later
10: The main features of UDP are: packet transmission, non sticky packet, wrong packet, no connection, no congestion control, no retransmission mechanism
Test case:
application layer
1) Protocol test is the same as TCP
2) Large concurrent requests (the performance test is the same as TCP)
Test logic point:
1) Since the transport layer has no special processing, that is, the transport layer only has three items in protocol testing: packet loss, disorder and delay. The test scheme is the same as the TCP test case
2) The solution of the application layer continues to use the test cases in TCP:
Valid data
Abnormal data
1) Valid data
Packet body - the effective data used here is both super large packet body, such as call and other variable protocols, which exceeds the upper limit of the server cache
2) Abnormal data
Inclusion - modify the boundary value of inclusion or user-defined data, i.e. the inclusion is too short or too long