Vehicle-mounted network communication method and device based on L2TP, equipment and medium
By establishing an L2TP tunnel between vehicle-end devices and the platform in an intelligent connected car, the problem of vehicle-end devices accessing the private network is solved, security, management and identity verification are achieved, and the security and stability of the vehicle-end network is ensured.
Patent Information
- Application Number
- CN202411050459.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-01
- Publication Date
- 2024-12-03
AI Technical Summary
In intelligent connected vehicles, how to access the private network through public network addresses to achieve better in-vehicle network communication is an urgent problem.
By establishing an L2TP tunnel between the vehicle terminal device and the platform gateway, the vehicle terminal device can access the private network address through the public network tunnel link. The specific steps include establishing a communication link to obtain LAC configuration information, establishing an L2TP tunnel link, and performing message forwarding processing .
It realizes the establishment of secure connections in various network environments, supports multi-tunnel management, ensures the security of network transmission between vehicles, provides an identity verification mechanism, supports disconnection and reconnection, and ensures smooth links.
Smart Images

Figure CN119071318A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of intelligent automobile networking, and specifically to an L2TP-based vehicle network communication method, device, equipment and medium. Background Art
[0002] Intelligent networked vehicles refer to the organic combination of Internet of Vehicles and smart cars. Intelligent networked vehicles are equipped with advanced on-board sensors, controllers, actuators and other devices, integrating modern communication and network technologies to achieve intelligent information exchange and sharing between vehicles and people, vehicles, roads, and backgrounds, and are safe, comfortable, energy-saving, and efficient. Intelligent networked vehicles are a new generation of multi-vehicle systems with vehicles as the main body and main nodes, integrating modern communication and network technologies, enabling vehicles and external nodes to achieve information sharing and collaborative control, so as to achieve safe, orderly, efficient, and energy-saving driving of vehicles.
[0003] With the popularization of intelligent connected cars, all vehicle-side devices have networking functions. In the communication between vehicle-side devices and platforms, public network addresses are often used for direct communication, while platforms are generally deployed in private networks. Therefore, how to enable vehicle-side devices to access private networks through public network addresses to better realize vehicle network communication has become an urgent problem to be solved. Summary of the invention
[0004] The present application provides an L2TP-based vehicle network communication method, device, equipment and medium, which establishes an L2TP tunnel between a vehicle-side device and a platform gateway, so that the vehicle-side device can access a private network address through a public network tunnel link.
[0005] In a first aspect, an embodiment of the present application provides an in-vehicle network communication method based on L2TP, and the in-vehicle network communication method based on L2TP includes:
[0006] Establish a communication link between the vehicle-side device and the platform to enable the vehicle-side device to obtain LAC configuration information from the platform;
[0007] Based on the obtained LAC configuration information, a tunnel link is established between the vehicle-side device and the platform through the L2TP protocol;
[0008] Based on the established tunnel link, the message forwarding process is carried out between the vehicle-side equipment and the platform to realize the vehicle network communication.
[0009] In combination with the first aspect, in one implementation, establishing a communication link between the vehicle-side device and the platform to enable the vehicle-side device to obtain LAC configuration information from the platform specifically includes:
[0010] When the vehicle-side device is started, a websocket link is established between the vehicle-side device and the platform;
[0011] Based on the established websocket link, the vehicle-side device obtains LAC configuration information related to the L2TP service from the platform, and the LAC configuration information includes the LNS server address, username and password, and five-tuple information.
[0012] In combination with the first aspect, in one implementation, the step of establishing a tunnel link between the vehicle-side device and the platform based on the acquired LAC configuration information and through the L2TP protocol specifically includes:
[0013] According to the LNS server address and five-tuple information in the LAC configuration information, check whether there is an L2TP-based tunnel link between the vehicle-side device and the platform;
[0014] If yes, the message forwarding between the vehicle-side device and the platform is carried out through the L2TP-based tunnel link between the vehicle-side device and the platform;
[0015] If not, the L2TP-based tunnel link creation step is executed, and then the message forwarding process between the vehicle-side device and the platform is performed through the tunnel link between the vehicle-side device and the platform.
[0016] In combination with the first aspect, in one implementation, the L2TP-based tunnel link creation step specifically includes:
[0017] The vehicle sends the local tunnel ID to the LNS through a SCCRQ message request, and waits for the LNS to reply with a SCCRQ message to determine the tunnel ID of the other end;
[0018] The vehicle creates a virtual L2TP port and defines the MTU;
[0019] Establish a tunnel session between the vehicle and LNS. The vehicle sends an ICRQ message to the LNS to determine the local session ID, and waits for the LNS to reply with an ICRP message to determine the peer session ID.
[0020] Establish a PPP connection between the vehicle and LNS, and determine the MRU size and PPP authentication method based on the PPP LCP message;
[0021] Perform PPP identity authentication according to the determined PPP authentication method, establish a PPP link, and the vehicle side receives the IP address and subnet mask assigned by the LNS side to create a tunnel link based on L2TP between the vehicle side device and the platform.
[0022] In combination with the first aspect, in one implementation, the forwarding process of the message between the vehicle-side device and the platform is performed according to the established tunnel link to realize the vehicle network communication, wherein the L2TP message forwarding process between the vehicle-side device and the platform specifically includes:
[0023] Based on the destination address of the L2TP message, determine whether the L2TP message is sent to the local computer:
[0024] If yes, the L2TP message is processed through the L2TP process;
[0025] If not, the L2TP message forwarding process is performed between the vehicle-side device and the platform through the established tunnel link.
[0026] In combination with the first aspect, in one implementation, the forwarding process of the L2TP message between the vehicle-side device and the platform is performed through the established tunnel link, wherein the process of the vehicle-side device receiving the L2TP message includes:
[0027] The vehicle-side device receives the L2TP message and parses the message header of the L2TP message to obtain the local tunnel ID, the remote tunnel ID, the local session ID, the remote session ID, the local port number, the remote port number, the local IP address, and the remote IP address, and saves the obtained information in a hash table;
[0028] The tunnel ID of the L2TP message is saved in the session;
[0029] Strip the public network IP header and TCP header of the L2TP message to obtain the private network message with the L2TP header; strip the L2TP header information and PPP header information to obtain the private network message.
[0030] In combination with the first aspect, in one implementation, the forwarding process of the L2TP message between the vehicle-side device and the platform is performed through the established tunnel link, wherein the process of the vehicle-side device sending the L2TP message includes:
[0031] When the vehicle sends an L2TP message, it determines the destination address of the L2TP message based on the pre-configured routing information to determine whether the L2TP message needs to go through a tunnel link:
[0032] If not, the packet is sent through the next hop found by the route;
[0033] If so, obtain the tunnel ID corresponding to the current session, obtain the corresponding tunnel node information from the hash table, splice the original skb message, add the public network IP header, TCP header and L2TP header information in front of the skb message, fragment and encapsulate the skb message, find the corresponding next one by searching the route for the encapsulated skb message, encapsulate the Ethernet header information according to the arp information, and send it from the corresponding network port.
[0034] In a second aspect, an embodiment of the present application provides an L2TP-based vehicle network communication device, the L2TP-based vehicle network communication device comprising:
[0035] The acquisition module is used to establish a communication link between the vehicle-side device and the platform so that the vehicle-side device can obtain the LAC configuration information from the platform;
[0036] A building module is used to build a tunnel link between the vehicle-side device and the platform through the L2TP protocol based on the acquired LAC configuration information;
[0037] The execution module is used to forward the messages between the vehicle-side device and the platform according to the established tunnel link to realize the vehicle network communication.
[0038] In a third aspect, an embodiment of the present application provides an L2TP-based in-vehicle network communication device, wherein the L2TP-based in-vehicle network communication device includes a processor, a memory, and an L2TP-based in-vehicle network communication program stored in the memory and executable by the processor, wherein when the L2TP-based in-vehicle network communication program is executed by the processor, the steps of the above-mentioned L2TP-based in-vehicle network communication method are implemented.
[0039] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which an L2TP-based in-vehicle network communication program is stored. When the L2TP-based in-vehicle network communication program is executed by a processor, the steps of the above-mentioned L2TP-based in-vehicle network communication method are implemented.
[0040] The beneficial effects brought by the technical solution provided in the embodiments of the present application include:
[0041] (1) L2TP VPN has strong penetration capabilities and can ensure the establishment of secure connections in various network environments. Supporting the establishment of multiple tunnels means that the vehicle-side network can be managed more finely, ensuring the network transmission security of the Internet of Vehicles.
[0042] (2) Supports the allocation of private network addresses. For private network servers, only the allocated IP addresses can be accessed, effectively ensuring data security;
[0043] (3) Provides security features (such as PAP and CHAP) to authenticate access users. Flexible authentication mechanisms can effectively protect the network from unauthorized access threats.
[0044] (4) Supports disconnection reconnection. When the tunnel link is disconnected, it can reconnect at a scheduled time and establish a new tunnel to ensure smooth connection. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 This is a flow chart of the vehicle network communication method based on L2TP in this application;
[0046] Figure 2 This is a functional module diagram of the L2TP-based vehicle network communication device of the present application;
[0047] Figure 3 This is a schematic diagram of the hardware structure of the L2TP-based in-vehicle network communication device of this application. DETAILED DESCRIPTION
[0048] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0049] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0050] In a first aspect, an embodiment of the present application provides an in-vehicle network communication method based on L2TP, which establishes an L2TP tunnel between a vehicle-side device and a platform gateway, so that the vehicle-side device can access a private network address through a public network tunnel link.
[0051] In one embodiment, referring to Figure 1 , Figure 1 This is a flow chart of the vehicle network communication method based on L2TP in this application. Figure 1 As shown, the vehicle network communication method based on L2TP includes:
[0052] S1: Establish a communication link between the vehicle-side device and the platform to enable the vehicle-side device to obtain the configuration information of LAC (L2TP Access Concentrator) on the platform;
[0053] Furthermore, in one embodiment, a communication link is established between the vehicle-side device and the platform to enable the vehicle-side device to obtain the LAC configuration information from the platform, specifically including:
[0054] S101: When the vehicle-side device is started, a websocket (a protocol for full-duplex communication on a single TCP connection) link is established between the vehicle-side device and the platform;
[0055] S102: Based on the established websocket link, the vehicle-side device obtains LAC configuration information related to the L2TP service from the platform, wherein the LAC configuration information includes an LNS server address, a user name and password, and five-tuple information. The LNS server address is the address of the L2TP network server.
[0056] L2TP is a type of Virtual Private Dial-up Network (VPDN) technology. L2TP allows dial-up users to initiate a VPN (Virtual Private Network) connection from an L2TP client or L2TP access concentrator (LAC) and connect to an L2TP network server (LNS) through a point-to-point protocol (PPP). After the connection is successful, the LNS will assign an IP address to the legitimate user and allow it to access the private network address.
[0057] Specifically, when the vehicle-side device is started, it establishes a websocket link with the platform to pull the LAC configuration information related to the L2TP service from the platform. After that, the vehicle-side device parses the obtained LAC configuration information and establishes a corresponding virtual tunnel port, which will be responsible for the subsequent tunnel link interaction with the platform.
[0058] S2: Based on the obtained LAC configuration information, a tunnel link is established between the vehicle-side device and the platform through the L2TP protocol;
[0059] Further, in one embodiment, based on the obtained LAC configuration information, a tunnel link is established between the vehicle-side device and the platform through the L2TP protocol, specifically including:
[0060] According to the LNS server address and five-tuple information in the LAC configuration information, check whether there is an L2TP-based tunnel link between the vehicle-side device and the platform;
[0061] If yes, the message forwarding between the vehicle-side device and the platform is carried out through the L2TP-based tunnel link between the vehicle-side device and the platform;
[0062] If not, the L2TP-based tunnel link creation step is executed, and then the message forwarding process between the vehicle-side device and the platform is performed through the tunnel link between the vehicle-side device and the platform.
[0063] The chicken leg is true. According to the LAC configuration information pulled from the platform, the LNS server address, user password and other information can be obtained. Therefore, the vehicle-side device can use the five-tuple information such as the LNS server address, the local address and the port number to find out whether there is a tunnel link based on L2TP between the vehicle-side device and the platform. If the tunnel exists, it means that the L2TP connection has been established. When a new message is transmitted, it is directly sent to the data message interaction process; if it does not exist, an L2TP-based tunnel link is established between the vehicle-side device and the platform.
[0064] Furthermore, in one embodiment, the steps of establishing a tunnel link based on L2TP specifically include:
[0065] S201: The vehicle sends a local tunnel ID to the LNS via a SCCRQ (Start-Control-Connection-Request) message, and waits for the LNS to reply with a SCCRQ message to determine the tunnel ID of the other end.
[0066] That is, the vehicle side actively sends a SCCRQ message request to send the local tunnel ID to the LNS side, and then waits for the LNS side to reply to the SCCRQ message to determine the other side tunnel ID. After the vehicle side receives the SCCRQ message replied by the LNS side, it can confirm the establishment of the tunnel link.
[0067] S202: The vehicle side creates a virtual L2TP port and defines the MTU (Maximum Transmission Unit);
[0068] Specifically, create a virtual L2TP port on the vehicle side and define the MTU. Because the header information of the original message needs to be extended, the MTU is defined as 1400.
[0069] S203: Establish a tunnel session between the vehicle and the LNS. The vehicle sends an ICRQ (Incoming-Call-Request) message to the LNS to determine the local session ID, and waits for the LNS to reply with an ICRP message to determine the peer session ID.
[0070] That is, a tunnel session is established between the vehicle and the LNS. The vehicle sends an ICRQ message to the LNS to determine the local session ID, waits for the LNS to reply with an ICRP message to determine the peer session ID, and then replies with an ICCN message to confirm the tunnel establishment.
[0071] S204: Establish a PPP connection between the vehicle end and the LNS end, and determine the MRU (Maximum-Transfer-Unit) size and the PPP authentication method based on the PPP LCP (Link Control Protocol) message;
[0072] That is, establish a PPP connection between the vehicle and the LNS, negotiate through PPP LCP messages, and negotiate the MRU size and PPP authentication method;
[0073] S205: Perform PPP identity authentication according to the determined PPP authentication method, establish a PPP link, and the vehicle side receives the IP address and subnet mask assigned by the LNS side to achieve the creation of an L2TP-based tunnel link between the vehicle side device and the platform.
[0074] In the actual application process, for PPP authentication, the vehicle side supports two authentication modes, PAP authentication and CHAP challenge authentication mechanism. PAP authentication means that the vehicle side can directly send the username and password to the LNS side for verification. After successful authentication, a PPP link can be established, and the vehicle side receives the IP address and subnet mask assigned by the LNS side. At this time, a PPP port can be seen through the ifconfig command, and the IP address is the assigned address.
[0075] It should be noted that in the actual application process, the vehicle side can establish multiple L2TP tunnel links at the same time to facilitate access to different platform services and configure routing on the vehicle side to point to different next-hop addresses, such as:
[0076] ip route 192.168.1.0 255.255.255.0 5.5.5.5
[0077] IP route 192.168.2.0 255.255.255.0 4.4.4.4.
[0078] S3: Based on the established tunnel link, forward the messages between the vehicle-side device and the platform to realize vehicle network communication.
[0079] Further, in one embodiment, according to the established tunnel link, the message forwarding process is performed between the vehicle-side device and the platform to realize the vehicle network communication, wherein the L2TP message forwarding process between the vehicle-side device and the platform specifically includes:
[0080] Based on the destination address of the L2TP message, determine whether the L2TP message is sent to the local computer:
[0081] If yes, the L2TP message is processed through the L2TP process;
[0082] If not, the L2TP message forwarding process is performed between the vehicle-side device and the platform through the established tunnel link.
[0083] Specifically, after the tunnel link is established, if the message is sent to the local, it is directly handed over to the L2TP process for processing; when the message is not sent to the local, the data message processing process needs to be carried out.
[0084] Furthermore, in one embodiment, the L2TP message forwarding process is performed between the vehicle-side device and the platform through the established tunnel link, wherein the process of the vehicle-side device receiving the L2TP message includes:
[0085] S301: The vehicle-side device receives the L2TP message and parses the message header of the L2TP message to obtain the local tunnel ID, the remote tunnel ID, the local session ID, the remote session ID, the local port number, the remote port number, the local IP address, and the remote IP address, and saves the obtained information in a hash table to facilitate subsequent reverse search. The structure maintained can be:
[0086] Struct l2tp_hash_node{
[0087] Int addr;
[0088] Int peer_addr;
[0089] Int vaddr;
[0090] Int peer_vaddr;
[0091] Int tunnel_id;
[0092] Int peer_tunnel_id;
[0093] Int session_id;
[0094] Int peer_session_id;
[0095] Int port;
[0096] Int peer_port;
[0097] };
[0098] S302: The tunnel ID of the L2TP message is saved in the session. The subsequent response message needs the value of the ID to reversely search for the node information.
[0099] S303: stripping the public network IP header and TCP header of the L2TP message to obtain a private network message with an L2TP header, stripping the L2TP header information and the PPP header information to obtain a private network message.
[0100] Specifically, strip the public network IP header and TCP header of the L2TP message to obtain the private network message with the L2TP header, and then continue to strip the L2TP header information and ppp header information to obtain the private network message, recalculate the checksum of the new skb (control structure used to send and receive data packets), and call the ip_rcv function again. At this time, the source and destination IP are both private network addresses, and the destination port is also the real access port number. The routing search will be called again to find the corresponding real network port to send.
[0101] Regarding the processing flow of receiving L2TP messages, specifically, after receiving the L2TP message, port identification is performed to determine whether it is an L2TP port. If not, it is a normal message and the forwarding process of the normal message is executed; if so, the public network IP header of the L2TP message is stripped, and then the L2TP header information is parsed, and the L2TP VPN public network address and private network address five-tuple hash are saved to obtain a new private network message.
[0102] Furthermore, in one embodiment, the L2TP message forwarding process is performed between the vehicle-side device and the platform through the established tunnel link, wherein the process of the vehicle-side device sending the L2TP message includes:
[0103] When the vehicle sends an L2TP message, it determines the destination address of the L2TP message based on the pre-configured routing information to determine whether the L2TP message needs to go through a tunnel link:
[0104] If not, the packet is sent through the next hop found by the route;
[0105] If so, obtain the tunnel ID corresponding to the current session, obtain the corresponding tunnel node information from the hash table, splice the original skb message, add the public network IP header, TCP header and L2TP header information in front of the skb message, fragment and encapsulate the skb message, find the corresponding next one by searching the route for the encapsulated skb message, encapsulate the Ethernet header information according to the arp (Address Resolution Protocol) information, and send it from the corresponding network port.
[0106] Specifically, when the vehicle sends an L2TP message, it first needs to determine whether the current destination address needs to go through the tunnel entrance according to the configured routing information. If it does not need to go through the tunnel entrance, it will be sent directly through the next hop found by the route. If it needs to go through the tunnel entrance, the tunnel ID corresponding to this session is obtained, and then the relevant information of the corresponding tunnel node is obtained from the hash table, and the original skb message is spliced, and the public network IP header, TCP header, L2TP header and other information are added to the front. At this time, the structure of skb is public network IP header + public network TCP header + L2TP header + data, where data is the real message information. Because the message passing through the tunnel needs to add the public network IP header + public network TCP header + L2TP header, it may exceed the original MTU value of the interface. At this time, the message needs to be fragmented. For example, if the tunnel entrance MTU is set to 1400, a message with an MTU of 1500 will be encapsulated into two fragmented messages of 1400+100. 7. Send the encapsulated skb back to ip_send, search the route to find the corresponding next one, encapsulate the Ethernet header information according to the arp information, and send it from the corresponding network port.
[0107] Regarding the processing flow of sending L2TP messages, specifically, first determine whether it is sent to the tunnel port. If not, it is a normal message and goes through the physical interface. If so, obtain the virtual tunnel port information, splice the skb tunnel message header information, and fragment the message according to the MTU of the tunnel port. When the header information is modified, the spliced message is re-sent.
[0108] Furthermore, when forwarding non-L2TP messages between the vehicle-side equipment and the platform, the non-L2TP messages are not processed by the virtual tunnel port, but are directly sent to the real network port for processing; while the packet receiving and processing process of the L2TP message is to receive the packet at the real network port, forward it to the virtual tunnel port for processing, and after processing by the virtual network port, send the message with the header information removed back to the real network port for forwarding. The packet sending process is to determine to which address segment the message needs to be sent to the virtual tunnel port based on the configured routing information, encapsulate the message at the tunnel port, and then send it to the real network port for sending.
[0109] The L2TP-based vehicle network communication method of the embodiment of the present application enables the vehicle side to access the platform resources of the intranet through the public network address; the security of the link is ensured through tunnel link authentication; the vehicle side supports the implementation of the LAC function; it supports multi-tunnel links, and different tunnels can access different platform resources to ensure data security.
[0110] L2TP VPN has strong penetration ability and can ensure the establishment of secure connections in various network environments. Supporting the establishment of multiple tunnels means that the vehicle-side network can be managed more finely to ensure the network transmission security of the Internet of Vehicles. It supports the allocation of private network addresses. For private network servers, only the allocated IP addresses can be accessed, which effectively ensures data security. It provides security features (such as PAP and CHAP) to authenticate access users. This flexible authentication mechanism can effectively protect the network from the threat of unauthorized access. It supports disconnection and reconnection. When the tunnel link is disconnected, it can reconnect at a scheduled time and establish a new tunnel to ensure smooth connection.
[0111] In a second aspect, an embodiment of the present application also provides an in-vehicle network communication device based on L2TP.
[0112] In one embodiment, referring to Figure 2 , Figure 2 This is a functional module diagram of the L2TP-based vehicle network communication device of this application. Figure 2 As shown, the L2TP-based vehicle network communication device includes an acquisition module, a creation module and an execution module.
[0113] The acquisition module is used to establish a communication link between the vehicle-side device and the platform so that the vehicle-side device can obtain the LAC configuration information on the platform; the establishment module is used to establish a tunnel link between the vehicle-side device and the platform based on the acquired LAC configuration information and through the L2TP protocol; the execution module is used to forward the messages between the vehicle-side device and the platform according to the established tunnel link to realize vehicle network communication.
[0114] In a third aspect, an embodiment of the present application provides an L2TP-based in-vehicle network communication device. The L2TP-based in-vehicle network communication device may be a personal computer (PC), a laptop computer, a server, or other device with data processing capabilities.
[0115] Reference Figure 3 , Figure 3 The hardware structure diagram of the L2TP-based vehicle network communication device involved in the embodiment of the present application is shown in FIG. In the embodiment of the present application, the L2TP-based vehicle network communication device may include a processor, a memory, a communication interface, and a communication bus.
[0116] The communication bus may be of any type and is used to interconnect the processor, the memory, and the communication interface.
[0117] The communication interface includes input / output (I / O) interfaces, physical interfaces, and logical interfaces, which are used to interconnect devices within the L2TP-based vehicle network communication device, and interfaces used to interconnect the L2TP-based vehicle network communication device with other devices (such as other computing devices or user devices). The physical interface can be an Ethernet interface, a fiber optic interface, an ATM interface, etc.; the user device can be a display, a keyboard, etc.
[0118] The memory can be various types of storage media, such as random access memory (RAM), read-only memory (ROM), non-volatile RAM (NVRAM), flash memory, optical storage, hard disk, programmable ROM (PROM), erasable PROM (EPROM), electrically erasable PROM (EEPROM), etc.
[0119] The processor may be a general-purpose processor, which may call the L2TP-based vehicle network communication program stored in the memory and execute the L2TP-based vehicle network communication method provided in the embodiment of the present application. For example, the general-purpose processor may be a central processing unit (CPU). The method executed when the L2TP-based vehicle network communication program is called may refer to the various embodiments of the L2TP-based vehicle network communication method of the present application, which will not be described in detail here.
[0120] Those skilled in the art will understand that Figure 3 The hardware structure shown in the figure does not constitute a limitation on the present application, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0121] In a fourth aspect, an embodiment of the present application also provides a computer-readable storage medium.
[0122] The computer-readable storage medium of the present application stores an L2TP-based vehicle network communication program, wherein when the L2TP-based vehicle network communication program is executed by a processor, the steps of the L2TP-based vehicle network communication method as described above are implemented.
[0123] Among them, the method implemented when the L2TP-based in-vehicle network communication program is executed can refer to the various embodiments of the L2TP-based in-vehicle network communication method of the present application, and will not be repeated here.
[0124] It should be noted that the serial numbers of the above-mentioned embodiments of the present application are only for description and do not represent the advantages or disadvantages of the embodiments.
[0125] The terms "including" and "having" and any variations thereof in the specification and claims of this application and the above-mentioned drawings are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices. The terms "first", "second" and "third" are used to distinguish different objects, etc., and do not represent a sequence, nor do they limit "first", "second" and "third" to different types.
[0126] In the description of the embodiments of the present application, "exemplary", "for example" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary", "for example" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary", "for example" or "for example" is intended to present related concepts in a specific way.
[0127] In the description of the embodiments of the present application, unless otherwise specified, “ / ” means or, for example, A / B can mean A or B; the “and / or” in the text is merely a description of the association relationship of associated objects, indicating that three relationships may exist, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, “multiple” refers to two or more than two.
[0128] In some processes described in the embodiments of the present application, multiple operations or steps that appear in a specific order are included, but it should be understood that these operations or steps may not be executed in the order in which they appear in the embodiments of the present application or in parallel, and the sequence number of the operation is only used to distinguish the different operations, and the sequence number itself does not represent any execution order. In addition, these processes may include more or fewer operations, and these operations or steps may be executed in sequence or in parallel, and these operations or steps may be combined.
[0129] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, disk, CD) as described above, and includes a number of instructions for a terminal device to execute the methods described in each embodiment of the present application.
[0130] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A vehicle network communication method based on L2TP, It is characterized in that The L2TP-based vehicle network communication method includes: Establish a communication link between the vehicle-side device and the platform to enable the vehicle-side device to obtain LAC configuration information from the platform; Based on the obtained LAC configuration information, a tunnel link is established between the vehicle-side device and the platform through the L2TP protocol; Based on the established tunnel link, the message forwarding process is carried out between the vehicle-side equipment and the platform to realize the vehicle network communication.
2. The vehicle network communication method based on L2TP as claimed in claim 1, It is characterized in that The establishment of a communication link between the vehicle-side device and the platform to enable the vehicle-side device to obtain the LAC configuration information from the platform specifically includes: When the vehicle-side device is started, a websocket link is established between the vehicle-side device and the platform; Based on the established websocket link, the vehicle-side device obtains LAC configuration information related to the L2TP service from the platform, and the LAC configuration information includes the LNS server address, username and password, and five-tuple information.
3. The vehicle network communication method based on L2TP as claimed in claim 1, It is characterized in that The step of establishing a tunnel link between the vehicle-side device and the platform based on the obtained LAC configuration information and through the L2TP protocol specifically includes: According to the LNS server address and five-tuple information in the LAC configuration information, check whether there is an L2TP-based tunnel link between the vehicle-side device and the platform; If yes, the message forwarding between the vehicle-side device and the platform is carried out through the L2TP-based tunnel link between the vehicle-side device and the platform; If not, the L2TP-based tunnel link creation step is executed, and then the message forwarding process between the vehicle-side device and the platform is performed through the tunnel link between the vehicle-side device and the platform.
4. The L2TP-based vehicle network communication method according to claim 3, It is characterized in that The L2TP-based tunnel link creation step specifically includes: The vehicle sends the local tunnel ID to the LNS through a SCCRQ message request, and waits for the LNS to reply with a SCCRQ message to determine the tunnel ID of the other end; The vehicle creates a virtual L2TP port and defines the MTU; Establish a tunnel session between the vehicle and LNS. The vehicle sends an ICRQ message to the LNS to determine the local session ID, and waits for the LNS to reply with an ICRP message to determine the peer session ID. Establish a PPP connection between the vehicle and LNS, and determine the MRU size and PPP authentication method based on the PPP LCP message; Perform PPP identity authentication according to the determined PPP authentication method, establish a PPP link, and the vehicle side receives the IP address and subnet mask assigned by the LNS side to create a tunnel link based on L2TP between the vehicle side device and the platform.
5. The vehicle network communication method based on L2TP as claimed in claim 1, It is characterized in that According to the established tunnel link, the message forwarding process is performed between the vehicle-side device and the platform to realize the vehicle network communication, wherein the L2TP message forwarding process between the vehicle-side device and the platform specifically includes: Based on the destination address of the L2TP message, determine whether the L2TP message is sent to the local computer: If yes, the L2TP message is processed through the L2TP process; If not, the L2TP message forwarding process is performed between the vehicle-side device and the platform through the established tunnel link.
6. The L2TP-based vehicle network communication method according to claim 5, It is characterized in that The L2TP message forwarding process is performed between the vehicle-side device and the platform through the established tunnel link, wherein the process of the vehicle-side device receiving the L2TP message includes: The vehicle-side device receives the L2TP message and parses the message header of the L2TP message to obtain the local tunnel ID, the remote tunnel ID, the local session ID, the remote session ID, the local port number, the remote port number, the local IP address, and the remote IP address, and saves the obtained information in a hash table; The tunnel ID of the L2TP message is saved in the session; Strip the public network IP header and TCP header of the L2TP message to obtain the private network message with the L2TP header; strip the L2TP header information and PPP header information to obtain the private network message.
7. The L2TP-based vehicle network communication method according to claim 6, It is characterized in that The L2TP message forwarding process is performed between the vehicle-side device and the platform through the established tunnel link, wherein the process of the vehicle-side device sending the L2TP message includes: When the vehicle sends an L2TP message, it determines the destination address of the L2TP message based on the pre-configured routing information to determine whether the L2TP message needs to go through a tunnel link: If not, the packet is sent through the next hop found by the route; If so, obtain the tunnel ID corresponding to the current session, obtain the corresponding tunnel node information from the hash table, splice the original skb message, add the public network IP header, TCP header and L2TP header information in front of the skb message, fragment and encapsulate the skb message, find the corresponding next one by searching the route for the encapsulated skb message, encapsulate the Ethernet header information according to the arp information, and send it from the corresponding network port.
8. A vehicle network communication device based on L2TP, It is characterized in that The L2TP-based vehicle network communication device includes: The acquisition module is used to establish a communication link between the vehicle-side device and the platform so that the vehicle-side device can obtain the LAC configuration information from the platform; A building module is used to build a tunnel link between the vehicle-side device and the platform through the L2TP protocol based on the acquired LAC configuration information; The execution module is used to forward the messages between the vehicle-side device and the platform according to the established tunnel link to realize the vehicle network communication.
9. An in-vehicle network communication device based on L2TP, It is characterized in that The L2TP-based vehicle network communication device includes a processor, a memory, and an L2TP-based vehicle network communication program stored in the memory and executable by the processor, wherein when the L2TP-based vehicle network communication program is executed by the processor, the steps of the L2TP-based vehicle network communication method as described in any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores an L2TP-based in-vehicle network communication program, wherein when the L2TP-based in-vehicle network communication program is executed by the processor, the steps of the L2TP-based in-vehicle network communication method as described in any one of claims 1 to 7 are implemented.
