CN113992568B - Multilink communication system method and system for mixed forwarding of layer 2 and layer 3 services - Google Patents

Multilink communication system method and system for mixed forwarding of layer 2 and layer 3 services Download PDF

Info

Publication number
CN113992568B
CN113992568B CN202111112173.9A CN202111112173A CN113992568B CN 113992568 B CN113992568 B CN 113992568B CN 202111112173 A CN202111112173 A CN 202111112173A CN 113992568 B CN113992568 B CN 113992568B
Authority
CN
China
Prior art keywords
transmission
forwarding
data packet
service data
preset
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111112173.9A
Other languages
Chinese (zh)
Other versions
CN113992568A (en
Inventor
张凯
郑应强
刘同鹤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing LSSEC Technology Co Ltd
Original Assignee
Beijing LSSEC Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing LSSEC Technology Co Ltd filed Critical Beijing LSSEC Technology Co Ltd
Priority to CN202111112173.9A priority Critical patent/CN113992568B/en
Publication of CN113992568A publication Critical patent/CN113992568A/en
Application granted granted Critical
Publication of CN113992568B publication Critical patent/CN113992568B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/24Multipath
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/02Network architectures or network communication protocols for network security for separating internal from external traffic, e.g. firewalls
    • H04L63/0227Filtering policies
    • H04L63/0236Filtering by address, protocol, port number or service, e.g. IP-address or URL
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/141Setup of application sessions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/143Termination or inactivation of sessions, e.g. event-controlled end of session
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/146Markers for unambiguous identification of a particular session, e.g. session cookie or URL-encoding
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/161Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields
    • H04L69/162Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields involving adaptations of sockets based mechanisms

Abstract

The invention discloses a multilink communication method and a system for mixed forwarding of layer 2 and layer 3 services, wherein the method comprises the following steps: creating a first original socket and a second original socket, binding the first original socket and a service port with each other, binding the second original socket and a veth interface, starting a preset thread to monitor transmission service data packets of the two original sockets respectively, and performing branch processing on the transmission service data packets by using a preset rule. The method has the advantages that the receiving and the forwarding of the service data can be realized by constructing the sockets corresponding to different modes, the service data in multiple modes can be processed and forwarded on the same equipment, the functions of soft switching and soft routing are realized, the hardware does not need to be changed, more flexible and powerful forwarding service can be provided, the working efficiency is improved, the equipment cost, the labor cost and the fault tolerance rate are reduced, and the data processing efficiency and the processing stability are improved.

Description

Multilink communication system method and system for mixed forwarding of layer 2 and layer 3 services
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a method and a system for a multilink communication system for forwarding mixed layer 2 and layer 3 services.
Background
With the continuous development and improvement of the information technology, the convenience brought by the existing ground-based communication and satellite communication cannot meet the needs of people, the structure of the communication system tends to be more and more three-dimensional, and the airborne communication technology as an important link of the three-dimensional information system becomes a research hotspot in recent years. Meanwhile, the airborne communication network is used as an information carrier in an informatization and networked operation environment, and has the effect of playing a vital role. In military application, an airborne communication network has the characteristics of heterogeneous nodes, multiple communication links, dynamic change of network topology and the like. With the increasing demand of the onboard communication network on data transmission performance, a multi-radio-multi-channel (MRMC) technology is proposed to form an MRMC onboard communication network. In an MRMC on-board communication network, a master communication device and a plurality of slave communication devices are usually included, and the master communication device can establish a link with the plurality of slave communication devices at the same time for data transmission. The MRMC airborne communication network has the advantages of improving the data transmission rate, enhancing the reliability of data transmission and the like.
The current multilink communication equipment can support a 2-layer mode or a 3-layer mode to work independently, namely, business data of the 2-layer mode or the 3-layer mode is received and forwarded, but along with continuous expansion of business processes, the business data of the current multilink communication equipment needs to be supported by the 2-layer mode and the 3-layer mode simultaneously, the current single multilink equipment cannot meet requirements, two or more common working parties are needed to process the business data, the complexity and the fault tolerance rate are improved, meanwhile, the labor cost and the material cost are greatly consumed, and the working efficiency is reduced.
Disclosure of Invention
Aiming at the problems shown above, the invention provides a multilink communication system method and system for mixed forwarding of layer 2 and layer 3 services, which are used for solving the problems that a single multilink device mentioned in the background technology cannot meet the requirements, two or more common working parties are needed to realize the processing of service data, the complexity and the fault tolerance rate are improved, meanwhile, the labor cost and the material cost are greatly consumed, and the working efficiency is reduced.
A multilink communication method for mixed forwarding of layer 2 and layer 3 services comprises the following steps:
creating a first raw socket and a second raw socket;
binding the first original socket and a service port with each other, and binding the second original socket and a path interface;
starting a preset thread to monitor transmission service data packets of two original sockets respectively;
and forwarding the transmission service data packet by using a preset rule.
Preferably, the first original socket and the second original socket belong to the field of AF _ PACKET, the type of the first original socket is SOCK _ RAW, and the draft of the first original socket is ETH _ P _ ALL.
Preferably, the creating the first original socket and the second original socket includes:
receiving a connection request sent by target multilink equipment;
determining a first connection identifier of the target multilink device based on the connection request;
confirming whether the first connection identifiers belong to a plurality of second connection identifiers which are historically interacted with a preset database, if so, not needing subsequent operation, and otherwise, disconnecting the target multilink equipment;
the first raw socket is created for a layer 2 mode of operation of the target multilink device and the second raw socket is created for a layer 3 mode of operation of the target multilink device.
Preferably, the starting a preset thread to monitor the transmission service data packets of the two original sockets respectively includes:
calling three preset threads, screening out a first preset thread and a second preset thread from the three preset threads, and respectively configuring the first socket and the veth interface;
detecting the connection state of a service port of the target multilink equipment;
when the connection state is idle, the connection with the service port is connected by using a third preset thread;
respectively monitoring transmission service data packets of a first original socket and a veth interface by using the first preset thread and the second preset thread;
the third preset thread is a preset thread except the first preset thread and the second preset thread in the three preset threads.
Preferably, after the preset threads are started to monitor the transmission service data packets of the two original sockets respectively, before the transmission service data packets are forwarded by using a preset rule, the method further includes:
when a transmission service data packet is monitored, acquiring a source IP and a target IP of the transmission service data packet;
determining an ip address of the veth interface;
filtering the transmission service data packet according to the source IP and the destination IP of the transmission service data packet and the IP address of the veth interface to obtain a filtering result;
and processing the filtering result by utilizing the preset thread.
Preferably, the forwarding processing on the transmission service data packet by using a preset rule includes:
acquiring a target mac of the transmission service data packet, confirming whether the target mac is a preset mac of a veth interface, and if so, sending the transmission service data packet to the veth interface through the second original socket;
confirming whether a source IP of the transmission service data packet and an IP address of a veth interface are in the same network segment, if so, sending the transmission service data packet to the veth interface through the second original socket;
confirming whether a destination IP of the transmission service data packet and an IP address of a veth interface are in the same network segment, if so, sending the transmission service data packet to the veth interface through the second original socket;
and transmitting the transmission service data packet except the condition to a service interface of the target multilink equipment through the first original socket.
Preferably, the method further comprises:
converting the transmission service data packet into a service data packet with a custom format;
determining a target service attribute corresponding to the user-defined format data packet;
based on the target service attribute and the service data packet with the custom format, acquiring analysis logic for transmitting the service data packet by using a preset service model;
analyzing and processing the service data in the transmission service data packet by using the analysis logic to obtain a processing result;
and converting the processing result into a model analysis result for displaying.
Preferably, the method further comprises:
detecting the forwarding state of the transmission service data packet in real time;
confirming whether the transmission service data packet is successfully forwarded according to the forwarding state, if so, not needing to carry out subsequent operation, otherwise, acquiring a current data transmission result received by a forwarding service end;
comparing the current data transmission result with a standard data transmission result to adjust preset transmission parameters, wherein the preset transmission parameters comprise; transmission efficiency and transmission period;
after the adjustment is finished, generating a protection path for the data transmission channel of each forwarding service end;
acquiring configuration information corresponding to a protection path of each forwarding service end;
importing a service forwarding instruction into configuration information corresponding to a protection path of each forwarding service end;
acquiring and analyzing a data transmission identifier of each forwarding service end to acquire an analysis result;
confirming the standardized data transmission period of each forwarding service end according to the analysis result of each forwarding service end;
setting a data transmission starting time point of each forwarding service terminal according to a standardized data transmission period of each forwarding service terminal and a transmission period in a preset transmission parameter;
detecting whether a preset time length of each forwarding service end before a data transmission starting time point of each forwarding service end is in a data transmission state, if so, not performing subsequent operation, otherwise, generating a reminding instruction to send to a target forwarding service end which is not in the data transmission state so as to remind the target forwarding service end to start the data transmission state;
and when the data transmission starting time point of each forwarding service end is reached, retransmitting the transmission data packet to each forwarding service end through the protection path.
A multi-link communication system for hybrid forwarding of layer 2 and layer 3 traffic, the system comprising:
the system comprises a creating module, a receiving module and a processing module, wherein the creating module is used for creating a first original socket and a second original socket;
a binding module, configured to bind the first original socket and a service port to each other, and bind the second original socket and a veth interface;
the monitoring module is used for starting a preset thread to monitor the transmission service data packets of the two original sockets respectively;
and the forwarding module is used for forwarding the transmission service data packet by using a preset rule.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and drawings.
The technical solution of the present invention is further described in detail by the accompanying drawings and embodiments.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the principles of the invention and not to limit the invention.
Fig. 1 is a flowchart of a multilink communication method for layer 2 and layer 3 service hybrid forwarding according to the present invention;
fig. 2 is another working flowchart of the multilink communication method for layer 2 and layer 3 service hybrid forwarding provided by the present invention;
fig. 3 is another flowchart of the multilink communication method for layer 2 and layer 3 service hybrid forwarding according to the present invention;
fig. 4 is a schematic structural diagram of a multilink communication method for layer 2 and layer 3 service hybrid forwarding provided by the present invention.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the disclosure, as detailed in the appended claims.
With the continuous development and improvement of the information technology, the convenience brought by the existing ground-based communication and satellite communication cannot meet the needs of people, the structure of the communication system tends to be more and more three-dimensional, and the airborne communication technology as an important link of the three-dimensional information system becomes a research hotspot in recent years. Meanwhile, the airborne communication network is used as an information carrier in an informatization and networked operation environment, and has the effect of playing a vital role. In military application, an airborne communication network has the characteristics of heterogeneous nodes, multiple communication links, dynamic change of network topology and the like. With the increasing demand of the onboard communication network on data transmission performance, a multi-radio-multi-channel (MRMC) technology is proposed to form an MRMC onboard communication network. In an MRMC on-board communication network, a master communication device and a plurality of slave communication devices are usually included, and the master communication device can establish a link with the plurality of slave communication devices at the same time for data transmission. The MRMC airborne communication network has the advantages of improving the data transmission rate, enhancing the reliability of data transmission and the like.
The current multilink communication equipment can support a 2-layer mode or a 3-layer mode to work independently, namely, business data of the 2-layer mode or the 3-layer mode is received and forwarded, but along with continuous expansion of business processes, the business data of the current multilink communication equipment needs to be supported by the 2-layer mode and the 3-layer mode simultaneously, the current single multilink equipment cannot meet requirements, two or more common working parties are needed to process the business data, the complexity and the fault tolerance rate are improved, meanwhile, the labor cost and the material cost are greatly consumed, and the working efficiency is reduced. In order to solve the above problem, this embodiment discloses a multilink communication method for layer 2 and layer 3 service hybrid forwarding.
A multi-link communication method for layer 2 and layer 3 service hybrid forwarding, as shown in fig. 1, includes the following steps:
step S101, a first original socket and a second original socket are created;
step S102, binding the first original socket and a service port with each other, and binding the second original socket and a veth interface;
step S103, starting a preset thread to monitor transmission service data packets of the two original sockets respectively;
step S104, forwarding the transmission service data packet by using a preset rule;
in this embodiment, the first raw socket is used to process the traffic data in layer 2 mode, and the second raw socket is used to process the socket in layer 3 mode.
The working principle of the technical scheme is as follows: creating a first original socket and a second original socket, binding the first original socket and a service port with each other, binding the second original socket and a veth interface, starting a preset thread to monitor transmission service data packets of the two original sockets respectively, and forwarding the transmission service data packets by using a preset rule.
The beneficial effects of the above technical scheme are: the method has the advantages that the receiving and the forwarding of the service data can be realized by constructing the sockets corresponding to different modes, the service data of multiple modes can be processed and forwarded on the same equipment, the functions of soft switching and soft routing are realized, hardware does not need to be changed, more flexible and powerful forwarding service can be provided, the working efficiency is improved, the equipment cost, the labor cost and the fault tolerance rate are reduced, the data processing efficiency and the processing stability are improved, the problems that in the prior art, due to the fact that a single multilink device cannot meet requirements, two or more common working parties are needed to process the service data, the complexity and the fault tolerance rate are improved, meanwhile, the labor cost and the material cost are greatly reduced, and the working efficiency is reduced are solved.
In one embodiment, the first and second original sockets are of the type SOCK _ RAW and ETH _ P _ ALL.
The beneficial effects of the above technical scheme are: the range and the type of the service data to be processed can be limited by setting the parameters of the first original socket and the second original socket, so that the interference of useless data is avoided, and the stability and the working efficiency are further improved.
In one embodiment, as shown in fig. 2, the creating the first original socket and the second original socket includes:
step S201, receiving a connection request sent by a target multilink device;
step S202, determining a first connection identifier of the target multi-link device based on the connection request;
step S203, confirming whether the first connection identifier belongs to a plurality of second connection identifiers which are interacted with a preset database history, if so, not needing subsequent operation, and otherwise, disconnecting the target multilink equipment;
step S204, the first original socket is created aiming at the layer 2 working mode of the target multilink equipment, and the second original socket is created aiming at the layer 3 working mode of the target multilink equipment.
The beneficial effects of the above technical scheme are: whether the target multilink device has the authority of connecting the preset database or not is determined according to the connection identification of the target multilink device, the safety and privacy of business data stored in the preset database can be guaranteed, the risk of data leakage is reduced, the stability is improved, furthermore, different sockets are set according to different working modes of the target multilink device, each working mode can correspond to one unique socket for data processing, and the working efficiency is further improved.
In one embodiment, the starting a preset thread to listen to the transport service data packets of two original sockets respectively includes:
calling three preset threads, screening out a first preset thread and a second preset thread from the three preset threads, and respectively configuring the first socket and the veth interface;
detecting the connection state of a service port of the target multilink equipment;
when the connection state is idle, the connection with the service port is connected by using a third preset thread;
respectively monitoring transmission service data packets of a first original socket and a veth interface by using the first preset thread and the second preset thread;
the third preset thread is a preset thread except the first preset thread and the second preset thread in the three preset threads.
The beneficial effects of the above technical scheme are: the preset thread is called to connect the service port and the veth interface, so that single stable control of different operation flows of the service data can be realized, the stability is further improved, complete and stable receiving and forwarding of the service data are realized, and the integrity of data receiving and forwarding is ensured.
In one embodiment, after starting a preset thread to monitor the transmission service data packets of two original sockets respectively, before performing forwarding processing on the transmission service data packets by using a preset rule, the method further includes:
step S301, after a transmission service data packet is monitored, a source IP and a destination IP of the transmission service data packet are obtained;
step S302, determining an ip address of the veth interface;
step S303, filtering the transmission service data packet according to the source IP and the destination IP of the transmission service data packet and the IP address of the veth interface to obtain a filtering result;
step S304, processing the filtering result by utilizing the preset thread;
in this embodiment, the filtering the transmission service data packet according to the source IP and the destination IP of the transmission service data packet and the IP address of the veth interface to obtain a filtering result includes:
aiming at a first preset thread, filtering a data packet needing to be processed by 3 layers, wherein the filtering rule is as follows: if the source IP and the destination IP of the acquired transmission service data packet are not in the same network segment, discarding the packet, waiting for the processing of a packet capturing thread of a layer 3, and otherwise, going through a layer 2 processing flow;
and aiming at a second preset thread, filtering the data packet needing to be processed by the layer 2, wherein the filtering rule is as follows: and if the source IP and the destination IP of the acquired transmission service data packet are in the same network segment and the source IP and the destination IP of the data packet are not in the same network segment with the IP address of the internal veth internal forwarding gateway, discarding the packet, waiting for the processing of a 2-layer packet capturing thread, and otherwise, going through a 3-layer processing flow.
The beneficial effects of the above technical scheme are: the processing data of the first original socket and the second original socket can be effectively distinguished by filtering the transmission service data packet, so that the occurrence of processing error caused by data mixing is avoided, and the stability is further improved.
In one embodiment, the forwarding processing on the transmission service data packet by using a preset rule includes:
acquiring a target mac of the transmission service data packet, confirming whether the target mac is a preset mac of a veth interface, and if so, sending the transmission service data packet to the veth interface through the second original socket;
confirming whether a source IP of the transmission service data packet and an IP address of a veth interface are in the same network segment, if so, sending the transmission service data packet to the veth interface through the second original socket;
confirming whether a destination IP of the transmission service data packet and an IP address of a veth interface are in the same network segment, if so, sending the transmission service data packet to the veth interface through the second original socket;
and transmitting the transmission service data packet except the condition to a service interface of the target multilink equipment through the first original socket.
The beneficial effects of the above technical scheme are: the processing data corresponding to the first original socket and the second original socket can be further distinguished, the working stability and the working efficiency are further improved, meanwhile, the transmission service data packet is accurately divided, the situations that the data processing flow is wrong, the last data is lost and the like are avoided, and the safety and the integrity of the service data are improved.
In one embodiment, the method further comprises:
converting the transmission service data packet into a service data packet with a custom format;
determining a target service attribute corresponding to the user-defined format data packet;
based on the target service attribute and the service data packet with the custom format, acquiring analysis logic for transmitting the service data packet by using a preset service model;
analyzing and processing the service data in the transmission service data packet by using the analysis logic to obtain a processing result;
and converting the processing result into a model analysis result for displaying.
The beneficial effects of the above technical scheme are: the data type and the data information of the transmission service data packet are determined to be convenient to store by carrying out data analysis on the transmission service data packet, and then the subsequent record query is carried out, and meanwhile, whether the service data is reasonable service data or not can be further monitored.
In one embodiment, the method further comprises:
detecting the forwarding state of the transmission service data packet in real time;
confirming whether the transmission service data packet is successfully forwarded according to the forwarding state, if so, not needing to carry out subsequent operation, otherwise, acquiring a current data transmission result received by a forwarding service end;
comparing the current data transmission result with a standard data transmission result to adjust preset transmission parameters, wherein the preset transmission parameters comprise; transmission efficiency and transmission period;
after the adjustment is finished, generating a protection path for the data transmission channel of each forwarding service end;
acquiring configuration information corresponding to a protection path of each forwarding service end;
importing a service forwarding instruction into configuration information corresponding to a protection path of each forwarding service end;
acquiring and analyzing a data transmission identifier of each forwarding service end to acquire an analysis result;
confirming the standardized data transmission period of each forwarding service end according to the analysis result of each forwarding service end;
setting a data transmission starting time point of each forwarding service terminal according to the standardized data transmission period of each forwarding service terminal and the transmission period in the preset transmission parameters;
detecting whether a preset time length of each forwarding service end before a data transmission starting time point of each forwarding service end is in a data transmission state, if so, not performing subsequent operation, otherwise, generating a reminding instruction to send to a target forwarding service end which is not in the data transmission state so as to remind the target forwarding service end to start the data transmission state;
and when the data transmission starting time point of each forwarding service end is reached, retransmitting the transmission data packet to each forwarding service end through the protection path.
The beneficial effects of the above technical scheme are that: whether the data forwarding work of each forwarding service end is completed or not can be known in real time by detecting whether each forwarding service end completely receives the transmission service data packet or not, the practicability is improved, further, the transmission service data packet can be completely received by each forwarding service end in the retransmission process by changing the preset transmission parameters, the working efficiency is improved, further, the stable and safe transmission of the transmission service data packet is further ensured by setting a protection path and the data forwarding starting time point of each forwarding service end, so that each forwarding service end can completely receive the forwarded transmission service data packet, the working efficiency is further improved, and the experience of a user is also improved.
In one embodiment, the method comprises the following steps:
the method comprises the steps that 2-layer data is directly obtained from a service port, 3-layer data is filtered by using a veth interface, the veth interface is equivalent to an internal forwarding gateway of equipment, data needing 3-layer forwarding can flow to the interface finally, two domains are created, namely AF _ PACKET, type is SOCK _ RAW, protocol is an original socket of ETH _ P _ ALL and is recorded as SOCK _ l2, SOCK _ l3, SOCK _ l2 is bound with the service port, SOCK _ l3 is bound with the veth interface, 3 threads are started, one thread is used for monitoring a SOCK _ l2 data PACKET and is recorded as l2_ monitor, one thread is used for monitoring data of the veth interface and is recorded as l3_ monitor, and the other thread is used for sending data to the service port and is recorded as send _ to _ user;
receiving and processing user service data:
l2_ monitor thread, filtering the data packet needing to be processed by the layer 3, wherein the filtering rule is that if the source IP and the destination IP of the obtained data packet are not in the same network segment, discarding the packet, waiting for the processing of the layer 3 packet capturing thread, and otherwise, going through the layer 2 processing flow;
l3_ monitor thread, filtering the data packet needing to be processed by layer 2, wherein the filtering rule is that the source IP and the destination IP of the obtained data packet are in the same network segment, and the source IP and the destination IP of the data packet are not in the same network segment with the internal veth forwarding gateway IP, discarding the packet, waiting for the processing of the layer 2 packet capturing thread, and otherwise, going through a layer 3 processing flow;
and (3) user service data sending and processing:
the send _ to _ user thread receives the reorganized user data, and performs distribution processing by using the following filtering rules:
if the destination mac of the data packet is the mac of the veth of the internal forwarding gateway, sending the data packet to the veth interface through sock _ l 3;
if the source IP of the data packet is in the same network segment with the IP of the veth of the internal forwarding gateway, the data packet is sent to the veth interface through sock _ l 3;
if the destination IP of the data packet and the IP of the veth of the internal forwarding gateway are in the same network segment, the data packet is sent to the veth interface through sock _ l 3;
otherwise, the message is sent to an external service interface of the equipment through the sock _ l 2.
The technical scheme can achieve the following beneficial effects: through the 2, 3-layer mixed forwarding communication technology, the functions of soft switching and soft routing are simultaneously realized on a single device, and more flexible and powerful forwarding service can be provided without changing hardware.
This embodiment also discloses a multilink communication system for forwarding mixed services of layer 2 and layer 3, as shown in fig. 4, the system includes:
a creating module 401, configured to create a first raw socket and a second raw socket;
a binding module 402, configured to bind the first original socket and a service port to each other, and bind the second original socket and a veth interface;
a monitoring module 403, configured to start a preset thread to monitor transmission service data packets of two original sockets respectively;
a forwarding module 404, configured to forward the transmission service data packet by using a preset rule.
The working principle and the advantageous effects of the above technical solution have been explained in the method claims, and are not described herein again.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (7)

1. A multilink communication method for layer 2 and layer 3 service hybrid forwarding is characterized by comprising the following steps:
creating a first original socket and a second original socket;
binding the first original socket and a service port with each other, and binding the second original socket and a path interface;
starting a preset thread to monitor transmission service data packets of two original sockets respectively;
forwarding the transmission service data packet by using a preset rule;
wherein the creating the first raw socket and the second raw socket comprises:
receiving a connection request sent by target multilink equipment;
determining a first connection identifier of the target multilink device based on the connection request;
confirming whether the first connection identifiers belong to a plurality of second connection identifiers which are historically interacted with a preset database, if so, not performing subsequent operation, and otherwise, disconnecting the connection with the target multilink equipment;
creating the first original socket aiming at a layer 2 working mode of a target multilink device, and creating the second original socket aiming at a layer 3 working mode of the target multilink device;
the forwarding processing of the transmission service data packet by using a preset rule includes:
acquiring a target mac of the transmission service data packet, confirming whether the target mac is a preset mac of a veth interface, and if so, sending the transmission service data packet to the veth interface through the second original socket;
confirming whether a source IP of the transmission service data packet and an IP address of a veth interface are in the same network segment, if so, sending the transmission service data packet to the veth interface through the second original socket;
confirming whether a destination IP of the transmission service data packet and an IP address of a veth interface are in the same network segment, if so, sending the transmission service data packet to the veth interface through the second original socket;
and transmitting the transmission service data packet except the condition to a service interface of the target multilink equipment through the first original socket.
2. The method of claim 1, wherein the first RAW socket and the second RAW socket belong to AF _ PACKET, SOCK _ RAW, and ETH _ P _ ALL.
3. The method of claim 1, wherein the starting a predetermined thread to listen to the transport service packets of two original sockets respectively comprises:
calling three preset threads, screening out a first preset thread and a second preset thread from the three preset threads, and respectively configuring the first socket and the veth interface;
detecting the connection state of a service port of the target multilink equipment;
when the connection state is idle, the connection with the service port is connected by using a third preset thread;
respectively monitoring transmission service data packets of a first original socket and a veth interface by using the first preset thread and the second preset thread;
the third preset thread is a preset thread except the first preset thread and the second preset thread in the three preset threads.
4. The method for multi-link communication with mixed forwarding of layer 2 and layer 3 services according to claim 3, wherein after starting a preset thread to monitor the transmission service data packets of two original sockets respectively, before performing forwarding processing on the transmission service data packets by using a preset rule, the method further comprises:
when a transmission service data packet is monitored, acquiring a source IP and a target IP of the transmission service data packet;
determining an ip address of the veth interface;
filtering the transmission service data packet according to the source IP and the destination IP of the transmission service data packet and the IP address of the veth interface to obtain a filtering result;
and processing the filtering result by utilizing the preset thread.
5. The method of claim 1, wherein the method further comprises:
converting the transmission service data packet into a service data packet with a user-defined format;
determining a target service attribute corresponding to the user-defined format data packet;
based on the target service attribute and the service data packet with the custom format, acquiring analysis logic for transmitting the service data packet by using a preset service model;
analyzing and processing the service data in the transmission service data packet by using the analysis logic to obtain a processing result;
and converting the processing result into a model analysis result for displaying.
6. The method of claim 1, wherein the method further comprises:
detecting the forwarding state of the transmission service data packet in real time;
confirming whether the transmission service data packet is successfully forwarded according to the forwarding state, if so, not needing to carry out subsequent operation, otherwise, acquiring a current data transmission result received by a forwarding service end;
comparing the current data transmission result with a standard data transmission result to adjust preset transmission parameters, wherein the preset transmission parameters comprise; transmission efficiency and transmission period;
after the adjustment is finished, generating a protection path for the data transmission channel of each forwarding service end;
acquiring configuration information corresponding to a protection path of each forwarding service end;
importing a service forwarding instruction into configuration information corresponding to a protection path of each forwarding service end;
acquiring and analyzing a data transmission identifier of each forwarding service end to acquire an analysis result;
confirming the standardized data transmission period of each forwarding service end according to the analysis result of each forwarding service end;
setting a data transmission starting time point of each forwarding service terminal according to the standardized data transmission period of each forwarding service terminal and the transmission period in the preset transmission parameters;
detecting whether a preset time length of each forwarding service end before a data transmission starting time point of each forwarding service end is in a data transmission state, if so, not performing subsequent operation, otherwise, generating a reminding instruction to send to a target forwarding service end which is not in the data transmission state so as to remind the target forwarding service end to start the data transmission state;
and when the data transmission starting time point of each forwarding service end is reached, retransmitting the transmission data packet to each forwarding service end through the protection path.
7. A multi-link communication system with hybrid forwarding of layer 2 and layer 3 services, the system comprising:
the system comprises a creating module, a receiving module and a processing module, wherein the creating module is used for creating a first original socket and a second original socket;
a binding module, configured to bind the first original socket and a service port to each other, and bind the second original socket and a veth interface;
the monitoring module is used for starting a preset thread to monitor the transmission service data packets of the two original sockets respectively;
the forwarding module is used for forwarding the transmission service data packet by using a preset rule;
wherein the creating the first raw socket and the second raw socket comprises:
receiving a connection request sent by target multilink equipment;
determining a first connection identifier of the target multilink device based on the connection request;
confirming whether the first connection identifiers belong to a plurality of second connection identifiers which are historically interacted with a preset database, if so, not needing subsequent operation, and otherwise, disconnecting the target multilink equipment;
creating the first original socket aiming at a layer 2 working mode of a target multilink device, and creating the second original socket aiming at a layer 3 working mode of the target multilink device;
the forwarding processing of the transmission service data packet by using a preset rule includes:
acquiring a target mac of the transmission service data packet, confirming whether the target mac is a preset mac of a veth interface, and if so, sending the transmission service data packet to the veth interface through the second original socket;
confirming whether a source IP of the transmission service data packet and an IP address of a veth interface are in the same network segment, if so, sending the transmission service data packet to the veth interface through the second original socket;
confirming whether a destination IP of the transmission service data packet and an IP address of a veth interface are in the same network segment, if so, sending the transmission service data packet to the veth interface through the second original socket;
and transmitting the transmission service data packet except the condition to a service interface of the target multilink equipment through the first original socket.
CN202111112173.9A 2021-09-23 2021-09-23 Multilink communication system method and system for mixed forwarding of layer 2 and layer 3 services Active CN113992568B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111112173.9A CN113992568B (en) 2021-09-23 2021-09-23 Multilink communication system method and system for mixed forwarding of layer 2 and layer 3 services

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111112173.9A CN113992568B (en) 2021-09-23 2021-09-23 Multilink communication system method and system for mixed forwarding of layer 2 and layer 3 services

Publications (2)

Publication Number Publication Date
CN113992568A CN113992568A (en) 2022-01-28
CN113992568B true CN113992568B (en) 2022-06-14

Family

ID=79736349

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111112173.9A Active CN113992568B (en) 2021-09-23 2021-09-23 Multilink communication system method and system for mixed forwarding of layer 2 and layer 3 services

Country Status (1)

Country Link
CN (1) CN113992568B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100745727B1 (en) * 2006-09-29 2007-08-03 한국전자통신연구원 Method for transmitting a packet in a portable terminal supporting a multiple of network interface
CN102833155A (en) * 2012-08-03 2012-12-19 中兴通讯股份有限公司 Method and device for realizing three-layer communication on two-layer single board
CN111817988A (en) * 2020-06-23 2020-10-23 天津芯海创科技有限公司 Ethernet switch and network system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100745727B1 (en) * 2006-09-29 2007-08-03 한국전자통신연구원 Method for transmitting a packet in a portable terminal supporting a multiple of network interface
CN102833155A (en) * 2012-08-03 2012-12-19 中兴通讯股份有限公司 Method and device for realizing three-layer communication on two-layer single board
CN111817988A (en) * 2020-06-23 2020-10-23 天津芯海创科技有限公司 Ethernet switch and network system

Also Published As

Publication number Publication date
CN113992568A (en) 2022-01-28

Similar Documents

Publication Publication Date Title
US7751394B2 (en) Multicast packet relay device adapted for virtual router
CN110326345B (en) Method, device and system for configuring network slice
CN110324165B (en) Network equipment management method, device and system
EP3958509A1 (en) Method, apparatus and system for communication between controllers in tsn
CN107613506B (en) Automatic configuration method for north interface LTE service and north interface device
CN102201999B (en) A kind of method and system for realizing multicast service load sharing
US9350651B2 (en) Packet forwarding device and wireless communication system
US11736962B2 (en) Methods, apparatus and computer-readable mediums relating to configuration of redundant paths
EP3402130A1 (en) Information transmission method and device
CN104270309A (en) Method for achieving multi-hop BFD under IP RAN equipment
CN104980355A (en) Source controllable multicast data transmission method and system thereof under SDN Environment
CN104301252A (en) Data sending system and method
CN106411750B (en) Data distributing method and system
US11533604B2 (en) Method and system for controlling ID identifier network mobility based on programmable switch
EP1944918A1 (en) A method and system for realizing the consistency of the virtual circuit status
US20120224488A1 (en) Method of connectivity monitoring by subscriber line terminating apparatus
CN109120657B (en) Service configuration method and node
CN113992568B (en) Multilink communication system method and system for mixed forwarding of layer 2 and layer 3 services
CN110120906A (en) For realizing the method and apparatus at the dual-active access garden TRILL edge
CN112566183A (en) SDN controller capable of automatically turning on 5G transmission circuit
CN104320322A (en) Message control method and equipment
JP3625156B2 (en) Network configuration method and route determination apparatus
CN114025033B (en) Interconnection and intercommunication method for IP services of satellite multi-network system
CN110445708A (en) Communication means and system in a kind of Convergence gateway
CN101997724A (en) Method and device for updating multicast forwarding entries

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant