A Border Gateway Protocol, BGP, logical topology generation method, wherein the method is applicable to a network system in which control and forwarding are separated, the network system comprises a controller, a first forwarder, and a second forwarder, and a BGP session is established between the first forwarder and the second forwarder; and the method comprises: obtaining, by the controller, node information of the first forwarder and BGP session information of the first forwarder, wherein the node information of the first forwarder comprises a BGP route identifier, Route-ID, of the first forwarder and an autonomous system number of an autonomous system to which the first forwarder belongs; obtaining, by the controller, node information of the second forwarder and BGP session information of the second forwarder, wherein the node information of the second forwarder comprises a BGP Route-ID of the second forwarder and an autonomous system number of an autonomous system to which the second forwarder belongs; and generating, by the controller, a BGP logical topology between the first forwarder and the second forwarder according to the node information of the first forwarder, the BGP session information of the first forwarder, the node information of the second forwarder, and the BGP session information of the second forwarder, wherein the BGP logical topology between the first forwarder and the second forwarder comprises a BGP session relationship between the first forwarder and the second forwarder; wherein the BGP session information of the first forwarder comprises interface address information of the first forwarder for establishing a BGP session, interface address information of the second forwarder that establishes the BGP session with the first forwarder, the autonomous system number of the autonomous system to which the second forwarder belongs, and the Route-ID of the second forwarder; and the BGP session information of the second forwarder comprises interface address information of the second forwarder for establishing a BGP session, interface address information of the first forwarder that establishes the BGP session with the second forwarder, the autonomous system number of the autonomous system to which the first forwarder belongs, and the Route-ID of the first forwarder. obtaining, by the controller, node information of the first forwarder and BGP session information of the first forwarder, wherein the node information of the first forwarder comprises a BGP route identifier, Route-ID, of the first forwarder and an autonomous system number of an autonomous system to which the first forwarder belongs; obtaining, by the controller, node information of the second forwarder and BGP session information of the second forwarder, wherein the node information of the second forwarder comprises a BGP Route-ID of the second forwarder and an autonomous system number of an autonomous system to which the second forwarder belongs; and generating, by the controller, a BGP logical topology between the first forwarder and the second forwarder according to the node information of the first forwarder, the BGP session information of the first forwarder, the node information of the second forwarder, and the BGP session information of the second forwarder, wherein the BGP logical topology between the first forwarder and the second forwarder comprises a BGP session relationship between the first forwarder and the second forwarder; wherein the BGP session information of the first forwarder comprises interface address information of the first forwarder for establishing a BGP session, interface address information of the second forwarder that establishes the BGP session with the first forwarder, the autonomous system number of the autonomous system to which the second forwarder belongs, and the Route-ID of the second forwarder; and the BGP session information of the second forwarder comprises interface address information of the second forwarder for establishing a BGP session, interface address information of the first forwarder that establishes the BGP session with the second forwarder, the autonomous system number of the autonomous system to which the first forwarder belongs, and the Route-ID of the first forwarder.