Patent attributes
A packet generation method based on a server cluster and a load balancer, where the method includes receiving a client request packet, determining a destination server according to a preset load balancing policy, sending an Address Resolution Protocol (ARP) request packet according to the destination Internet Protocol (IP) address, obtaining an ARP response packet according to the ARP request packet, the initial Media Access Control (MAC) address is different from an actual MAC address of the destination server, and updating the destination IP address according to the initial MAC address to obtain an updated client request packet, where the updated client request packet includes the source IP address and an updated destination IP address. In this way, in a process of transmitting a packet, a source IP address of a client is detected on a network layer without changing a source IP address in a request packet.