A data transmission method, wherein the method is applied to a computer system in which multiple hosts share one or more input/output I/O devices, the one or more I/O devices access respective DMA memory addresses of the multiple hosts in a direct memory access DMA manner, the DMA memory addresses are mapped, in a one-to-one manner, to virtual addresses in a global virtual address space, and the method comprises: obtaining a DMA packet sent by the I/O device, wherein the DMA packet carries a DMA virtual address, and the DMA virtual address is a virtual address in the global virtual address space; determining, according to a correspondence among DMA virtual addresses, DMA memory addresses, and hosts, a DMA memory address and a target host that correspond to the DMA virtual address by querying a correspondence table, wherein the DMA memory address is a DMA memory address mapped to the DMA virtual address, and the target host is a host to which the DMA memory address mapped to the DMA virtual address belongs, and the correspondence among DMA virtual addresses, DMA memory addresses, and hosts comprises: the DMA memory addresses of the multiple hosts form multiple DMA memory address intervals, and each host corresponds to one or more DMA memory address intervals; the global virtual address space comprises multiple non-overlapping virtual address intervals, the multiple virtual address intervals correspond to the multiple DMA memory address intervals in a one-to-one manner, and virtual addresses in a virtual address interval correspond to DMA memory addresses in a corresponding DMA memory address interval in a one-to-one manner; modifying the DMA virtual address in the DMA packet to the DMA memory address mapped to the DMA virtual address; and sending the modified DMA packet to the target host, wherein the determining, according to a correspondence among DMA virtual addresses, DMA memory addresses, and hosts, a DMA memory address and a target host that correspond to the DMA virtual address comprises: determining, according to a virtual address interval to which the DMA virtual address belongs, a DMA memory address interval corresponding to the virtual address interval; and determining, according to the DMA memory address interval, a host corresponding to the DMA memory address interval and a DMA memory address that is in the DMA memory address interval and that is mapped to the DMA virtual address. obtaining a DMA packet sent by the I/O device, wherein the DMA packet carries a DMA virtual address, and the DMA virtual address is a virtual address in the global virtual address space; determining, according to a correspondence among DMA virtual addresses, DMA memory addresses, and hosts, a DMA memory address and a target host that correspond to the DMA virtual address by querying a correspondence table, wherein the DMA memory address is a DMA memory address mapped to the DMA virtual address, and the target host is a host to which the DMA memory address mapped to the DMA virtual address belongs, and the correspondence among DMA virtual addresses, DMA memory addresses, and hosts comprises: the DMA memory addresses of the multiple hosts form multiple DMA memory address intervals, and each host corresponds to one or more DMA memory address intervals; the global virtual address space comprises multiple non-overlapping virtual address intervals, the multiple virtual address intervals correspond to the multiple DMA memory address intervals in a one-to-one manner, and virtual addresses in a virtual address interval correspond to DMA memory addresses in a corresponding DMA memory address interval in a one-to-one manner; modifying the DMA virtual address in the DMA packet to the DMA memory address mapped to the DMA virtual address; and sending the modified DMA packet to the target host, wherein the determining, according to a correspondence among DMA virtual addresses, DMA memory addresses, and hosts, a DMA memory address and a target host that correspond to the DMA virtual address comprises: determining, according to a virtual address interval to which the DMA virtual address belongs, a DMA memory address interval corresponding to the virtual address interval; and determining, according to the DMA memory address interval, a host corresponding to the DMA memory address interval and a DMA memory address that is in the DMA memory address interval and that is mapped to the DMA virtual address. determining, according to a virtual address interval to which the DMA virtual address belongs, a DMA memory address interval corresponding to the virtual address interval; and determining, according to the DMA memory address interval, a host corresponding to the DMA memory address interval and a DMA memory address that is in the DMA memory address interval and that is mapped to the DMA virtual address.