A method for allocating an internet protocol, IP, address, comprising: receiving, by a session management network element, a request message from a mobility management network element, wherein the request message comprises a session establishment request message and first indication information, wherein the session establishment request message is from a terminal apparatus and is forwarded by the mobility management network element and comprises a session identifier and indication information indicating a session type, wherein the session type is one of internet protocol version 6, IPv6, hybrid internet protocol version 4 and version 6, IPv4v6, and internet protocol version 4, IPv4, and wherein the first indication information is sent directly from the mobility management network element and comprises control plane data transmission indication information, the control plane data transmission indication information being control plane cellular Internet of Things 5G system, CIoT 5GS, optimisation indication information, or being control plane cellular Internet of Things EPS, CIoT EPS, optimisation indication information; establishing, by the session management network element, a session for the terminal apparatus, wherein the session is used for transmitting a data packet via a control plane; allocating based on the indication information indicating the session type, by the session management network element, an IP address to the terminal apparatus; and receiving, by the session management network element, an uplink data packet, wherein the uplink data packet includes an router solicitation, RS, packet or a dynamic host configuration protocol, DHCP, discovery packet and the uplink data packet is from a terminal apparatus and is forwarded by the mobility management network element, sending, by the session management network element, a downlink data packet to the terminal apparatus based on the first indication information, wherein the downlink data packet comprises the IP address allocated to the terminal apparatus, the downlink data packet being a router advertisement, RA, packet carrying the IP address, or a DHCP offer packet carrying the IP address; wherein the first indication information further indicates the session management network element to send the downlink data packet to the terminal apparatus via the mobility management network element based on the control plane data transmission indication information. receiving, by a session management network element, a request message from a mobility management network element, wherein the request message comprises a session establishment request message and first indication information, wherein the session establishment request message is from a terminal apparatus and is forwarded by the mobility management network element and comprises a session identifier and indication information indicating a session type, wherein the session type is one of internet protocol version 6, IPv6, hybrid internet protocol version 4 and version 6, IPv4v6, and internet protocol version 4, IPv4, and wherein the first indication information is sent directly from the mobility management network element and comprises control plane data transmission indication information, the control plane data transmission indication information being control plane cellular Internet of Things 5G system, CIoT 5GS, optimisation indication information, or being control plane cellular Internet of Things EPS, CIoT EPS, optimisation indication information; establishing, by the session management network element, a session for the terminal apparatus, wherein the session is used for transmitting a data packet via a control plane; allocating based on the indication information indicating the session type, by the session management network element, an IP address to the terminal apparatus; and receiving, by the session management network element, an uplink data packet, wherein the uplink data packet includes an router solicitation, RS, packet or a dynamic host configuration protocol, DHCP, discovery packet and the uplink data packet is from a terminal apparatus and is forwarded by the mobility management network element, sending, by the session management network element, a downlink data packet to the terminal apparatus based on the first indication information, wherein the downlink data packet comprises the IP address allocated to the terminal apparatus, the downlink data packet being a router advertisement, RA, packet carrying the IP address, or a DHCP offer packet carrying the IP address; wherein the first indication information further indicates the session management network element to send the downlink data packet to the terminal apparatus via the mobility management network element based on the control plane data transmission indication information.