CN105721314A - Method and equipment for sending data packet - Google Patents
Method and equipment for sending data packet Download PDFInfo
- Publication number
- CN105721314A CN105721314A CN201610095934.7A CN201610095934A CN105721314A CN 105721314 A CN105721314 A CN 105721314A CN 201610095934 A CN201610095934 A CN 201610095934A CN 105721314 A CN105721314 A CN 105721314A
- Authority
- CN
- China
- Prior art keywords
- packet
- terminal unit
- network
- network interface
- route table
- 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.)
- Pending
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/74—Address processing for routing
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/32—Flooding
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/36—Backward learning
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The invention relates to the field of data communication technologies, in particular to a method and equipment for sending a data packet for solving a problem that the data packet cannot be sent to a target address and is discarded owing to route misconfiguration or updating of the data packet not in time when terminal equipment connected to a plurality of networks sends the data packet. The terminal equipment provided by the embodiments of the invention comprises a processing module and a sending module, wherein the processing module is used for searching whether a routing table entry matched with the target address of a to-be-sent first data packet exists in a routing table; and the sending module is used for sending the first data packet through each network interface in a plurality of network interfaces when the processing module determines that the routing table entry matched with the target address of the first data packet does not exist. According to the method and the equipment, the problem that the data packet which is sent to one network is sent to the wrong network is avoided, and the problem that the data packet can be discarded when the terminal equipment connected to the plurality of networks sends the data packet is solved.
Description
Technical field
The present invention relates to data communication technology field, particularly relate to the method and apparatus sending packet.
Background technology
Along with constantly strengthening of terminal function and improving constantly of user's request; it is frequently encountered terminal unit and needs to be concurrently accessed the situation of multiple network; such as STB (SetTopBox; Set Top Box) need to be concurrently accessed the Internet and broadcasting and television network, require over STB and browse the Internet and watch the demand of broadcast TV program meeting user.Under this demand scene, STB needs two network interfaces of configuration, is respectively connected to the network of correspondence by two network interfaces configured.
When there being packet to send, STB needs the destination address of this packet and routing table are carried out matched routings, is transmitted according to the route of coupling by packet.
When accessing broadcasting and television network and the Internet at STB, for accessing the network interface allocating default route of the Internet, and it is that the network interface accessing broadcasting and television network manually arranges static routing.Wherein, default route is the route selected by this packet when being and the packet to send carries out matched routings failure, when the route table items not matched with the destination address of the packet to send in routing table, this packet can send to the Internet by accessing the network interface of the Internet according to default route.Static routing can not automatically update, can only by configuring manually.
When the network address of broadcasting and television network equipment changes, such as: when the network segment changes, if not passing through the above-mentioned static routing of artificial time update, or static routing is manually configured mistake, the network interface that then should pass through to access broadcasting and television network sends the packet to broadcasting and television network, can be sent mistakenly to the Internet because of matched routings failure.When the packet that this mistake is sent out carries out routing forwarding in the internet, owing to this packet should send to broadcasting and television network, this packet is carried out matched routings by the router in the Internet will not be successful, and finally this packet can be dropped in the internet.
To sum up, when the terminal unit of such as similar STB accesses multiple network, owing to being provided with static routing for the network interface of access section subnetwork, and be access other network of network interfaces to be configured with default route, if static routing configuration error or do not upgrade in time, then causing should to send the network to mistake according to default route by the packet of static routing transmission a to network, ultimately resulting in packet can be dropped.
Summary of the invention
The embodiment of the present invention provides a kind of method and apparatus sending packet, when terminal unit in order to solve to access multiple network sends packet, the problem causing packet cannot be sent to destination address due to routing configuration mistake or situation about not upgrading in time and being dropped.
First aspect, the application provides a kind of method sending packet, and this is applied in terminal unit, this terminal unit is respectively connected to multiple network by multiple network interfaces, wherein, a corresponding network of network interface, the network that different network interfaces is corresponding different.The method includes:
Whether described terminal unit table of query and routing exists the route table items that the destination address with the first packet to send matches;
If being absent from the route table items matched with the destination address of described first packet, then described first packet is sent by described terminal unit respectively through each network interface in the plurality of network interface.
Adopt such scheme, owing to when being absent from the route table items matched with the destination address of the first packet, the first packet is sent by the terminal unit accessing multiple network respectively through each network interface in multiple network interfaces.Therefore, when occur routing configuration mistake or do not upgrade in time situation time, adopt the technical scheme that the embodiment of the present invention provides not have and the packet that should mail to a network is sent the problem to wrong network, solve the problem that the packet sent when terminal unit accesses multiple network can be dropped.
In a kind of possible implementation, described terminal unit receives the second packet by a network interface in the plurality of network interface;Described terminal unit inquires about the route table items that whether there is the source address matches with described second packet in described routing table;If being absent from the route table items of source address matches with described second packet, then described terminal unit increases the route table items with the source address matches of described second data in described routing table, and record in the route table items increased described second packet from the mark of network interface.
Adopt such scheme, when terminal unit receives the second packet, if being absent from the route table items of source address matches with described second packet, then described terminal unit increases the route table items with the source address matches of described second data in described routing table, and record in the route table items increased described second packet from the mark of network interface.Therefore, when the packet that terminal unit sending destination location is identical with the source address place network segment of the second packet, can be routed according to the route table items of above-mentioned increase, without being again sent in multiple network and again carrying out matched routings in multiple networks.So can speeding up data transmission efficiency, avoid waste Internet resources.Alternatively, if the destination address place network segment of the source address place network segment of the second packet and the first packet is identical, when then terminal unit sends the packet identical with the destination address place network segment of the first packet again, without being sent by multiple network interfaces, so same it can be avoided that network resources waste.
In a kind of possible implementation, if there is the route table items that the destination address with described first packet matches, then described terminal unit obtains the mark of the network interface that described first packet recorded in the route table items of coupling should mail to;The network interface that described first packet is identified by the mark of the described network interface of acquisition is sent by described terminal unit.
In a kind of possible implementation, described terminal unit checks described routing table, deletes invalid route table items.
Adopt such scheme, it is possible to reducing terminal unit needs the number of the route table items safeguarded, it is to avoid network resources waste.
In a kind of possible implementation, the plurality of network includes two networks, respectively the Internet and broadcasting and television network, and described terminal unit is Set Top Box.
Second aspect, the embodiment of the present invention provides a kind of terminal unit, and this terminal unit has and realizes the function of terminal unit behavior in said method.Described function can be realized by hardware, it is also possible to performs corresponding software by hardware and realizes.Described hardware or software include one or more module corresponding with above-mentioned functions.
In the optional implementation of one, described terminal unit includes: processing module and sending module, alternatively, may also include receiver module;Described processing module is configured to support that described terminal unit performs the corresponding function controlled and process in said method;Described sending module is configured to support that described terminal unit performs the function that above-mentioned packet sends;Described receiver module is configured to support that described terminal unit performs the function that above-mentioned packet receives.
The third aspect, embodiments provides a kind of computer-readable storage medium, and for saving as above-mentioned first aspect to the computer software instructions used by the terminal unit described in the either side in second aspect, it comprises for performing the program involved by above-mentioned aspect.
Accompanying drawing explanation
The schematic diagram of the terminal unit that Fig. 1 provides for the embodiment of the present invention;
The flow chart of a kind of method sending packet that Fig. 2 provides for the embodiment of the present invention;
The flow chart of the transmission of packet and process between the terminal unit protocol stack layering that Fig. 3 provides for the embodiment of the present invention;
The schematic diagram of the protocol stack layering of the terminal unit that Fig. 4 provides for the embodiment of the present invention;
The structural representation of the another kind of terminal unit that Fig. 5 provides for the embodiment of the present invention;
Fig. 6 is the structural representation under a kind of optional implementation of the terminal unit shown in Fig. 5.
Detailed description of the invention
In order to be more fully understood that the above-mentioned purpose of the embodiment of the present invention, scheme and advantage, provided hereinafter detailed description.This detailed description, by using the accompanying drawing such as block diagram, flow chart and/or example, illustrates the various embodiments of device and/or method.In these block diagrams, flow chart and/or example, comprise one or more function and/or operation.It will be understood by the skilled person that: each function in these block diagrams, flow chart or example and/or operation, it is possible to separately or cooperatively implemented by various hardware, software, firmware, or implemented by the combination in any of hardware, software and firmware.
In the embodiment of the present invention, terminal unit accesses multiple networks by multiple network interfaces, wherein, a corresponding network of network interface, the network that different network interfaces is corresponding different.The route table items that the destination address of the first packet whether existed in terminal unit table of query and routing and to send matches;If being absent from the route table items matched with the destination address of the first packet, then the first packet is sent by terminal unit respectively through each network interface in multiple network interfaces.
Owing to when being absent from the route table items matched with the destination address of the first packet, the first packet is sent by terminal unit respectively through each network interface in multiple network interfaces.Therefore, when occur routing configuration mistake or do not upgrade in time situation time, adopt the technical scheme that the embodiment of the present invention provides not have and the packet that should mail to a network is sent the problem to wrong network, solve the problem that the packet sent when terminal unit accesses multiple network can be dropped.
Below, in order to make it easy to understand, introduce the concept related in the embodiment of the present invention.
One, the terminal unit of multiple network is accessed
Along with constantly strengthening of terminal function and improving constantly of user's request; it is frequently encountered terminal unit and needs to be concurrently accessed the situation of multiple network; such as STB (SetTopBox; Set Top Box) need to be concurrently accessed the Internet and broadcasting and television network, the user to meet STB requires over STB and browses the Internet and watch the demand of broadcast TV program.One example of the terminal unit accessing multiple networks that the STB being concurrently accessed the Internet and broadcasting and television network is in the embodiment of the present invention.
Generally, if terminal unit is concurrently accessed N number of network, then terminal unit needs to configure N number of network interface, is respectively connected to above-mentioned N number of network by the N number of network interface configured.Wherein, the network that N number of network is independent from, N number of network adopts independent DHCP (DynamicHostConfigurationProtocol, DHCP) and DNS (DomainNameSystem, domain name system).
Two, routing table and matched routings
Routing table is stored in the electrical form in the data communications equipment such as router or terminal unit, which stores the path pointing to particular network address.When carrying out the transmission of packet, it is necessary to find transmission path by table of query and routing for sending this packet.
Routing table mainly comprises purpose IP address, subnet mask, gateway and network interface.Wherein, purpose IP address is the IP address that packet to send destination host extremely;Subnet mask is the subnet mask of destination host place network, can calculate place, the purpose IP address network segment according to subnet mask and purpose IP address;Gateway defines for the purpose IP address sending packet, the Next Hop Server that this packet to be sent to;Network interface defines for the purpose IP address sending packet, and terminal unit is for sending the network interface of this packet.
The process of matched routings includes: when the Internet of terminal unit receives after the packet of application layer, obtains the destination address place network segment of this packet, and whether the destination address of inquiry packet has dropped in the network segment of some route table items.If so, then matched routings success;Otherwise, matched routings failure.
Three, protocol stack
Protocol stack refers to the summation of each layer protocol in network, and it reflects the process of network file transmission.The transmission of packet can realize based on ICP/IP protocol, and ICP/IP protocol stack can be divided into application layer, transport layer, Internet and network interface layer.
Wherein, when sending packet, application layer produces packet and is sent to transport layer;Transport layer provides the transmission of reliable data for packet, to giving network layer handles after processing data packets;Packet is carried out matched routings by Internet, selects route for packet;Network interface layer is connected with network interface, and the packet of automatic network layer is sent by network interface in the future.
When receiving packet, network interface layer receives packet by network interface, will issue Internet, and then issue transport layer, application layer after the processing data packets received.
In the method sending packet that the embodiment of the present invention provides, packet is from application layer, after transport layer transmission to Internet, matched routings the transmission selection route for packet is carried out in Internet, send data packets to network interface layer afterwards, and then send data packets to different networks by network interface.
Below, various embodiments of the present invention are described in detail.
Fig. 1 illustrates the schematic diagram of the terminal unit in the embodiment of the present invention.As it is shown in figure 1, this terminal unit is respectively connected to N number of network, the network that N number of network is independent from by N number of network interface of configuring, N be not less than 2 integer.
Alternatively, each in N number of network interface is configurable to 8 modular interfaces of standard.
Alternatively, can including the Internet, broadcasting and television network etc. in N number of network, a kind of it might be that N=2, namely N number of network includes the Internet and two networks of broadcasting and television network.
The flow chart of a kind of method sending packet that Fig. 2 provides for the embodiment of the present invention, the method can be applicable to access the terminal unit of multiple network, and ratio is in terminal unit as shown in Figure 1.As in figure 2 it is shown, this flow process comprises the steps:
S201: the first packet is carried out matched routings by terminal unit;
First packet is carried out whether there is the route table items that the destination address with the first packet to send matches in matched routings and table of query and routing.
Terminal unit can adopt aforesaid matched routings process when whether there is the route table items matched with the destination address of the first packet to send in table of query and routing, namely after terminal unit receives the first packet, obtain the destination address of the first packet, inquire about in the network segment whether destination address of the first packet has dropped on some route table items.If so, then matched routings success;Otherwise, matched routings failure.
Wherein, terminal unit can be Set Top Box;Multiple networks can be the Internet and broadcasting and television network.
Wherein, the first packet can be from the user of terminal unit when accessing webpage, or during the program of interactive broadcasting television network, the packet that the application layer of terminal unit produces, carries web access requests message or order request message in this packet.
Alternatively, the process of above-mentioned matched routings can be realized by the Internet of terminal unit, and Internet intercepts from the first packet of application layer, such as: can intercept the first packet by arranging Hook Function on the output link of application layer.
S202: judge that whether matched routings is successful;
If matched routings success, perform step S207;If matched routings failure, then perform below step S203.
S203: the first packet is sent by terminal unit respectively through each network interface in multiple network interfaces;
Wherein, if being absent from the route table items matched with the destination address of the first packet, then the first packet is sent to network interface layer by Internet, and indicates network interface layer: each network being respectively sent in multiple network by packet by each network interface in multiple network interfaces.
Wherein, after first packet is sent by terminal unit respectively through each network interface in multiple network interfaces, first packet can be forwarded in multiple network, and then in multiple networks, carry out matched routings, finally, first packet can route in the destination address place network of the first packet that the match is successful, thus being successfully transmitted the first packet to destination address.
S204: terminal unit receives the second packet by a network interface in multiple network interfaces;
Wherein, after the first packet that certain equipment in multiple networks sends in receiving step S203, this first packet can be responded by this equipment, namely sends the second packet to terminal unit.
Alternatively, the response that the first packet is made by this equipment can be web access requests response, then the second packet includes web access requests response message;Or the response that the first packet is made by this equipment can be order request response, then this second packet includes order request response message.
Alternatively, receiving the network interface that the second packet uses in terminal unit is the network interface that transmission the first packet uses.
Wherein, the second packet can also in response to other packets, rather than the first packet, and now the second packet is likely to and is sent to terminal unit by other network interfaces.
S205: whether there is the route table items of source address matches with the second packet in terminal unit table of query and routing;
Wherein, if the source address of the second packet is the destination address of the first packet, then the equipment sending the second packet is the equipment receiving the first packet, and the source address of the second packet is the destination address of the first packet.
S206: if being absent from the route table items of source address matches with the second packet, then terminal unit increases the route table items of the source address matches with the second data in the routing table, and record in the route table items increased the second packet from the mark of network interface.
Wherein, the mark of network interface can identify for network interface, network numbering or network name.
Wherein, because terminal unit adds the route table items of the source address matches with the second data in the routing table, therefore when the packet that terminal unit sending destination location again is identical with the source address place network segment of the second packet, can be routed according to the route table items of above-mentioned increase, without being again sent in multiple network and again carrying out matched routings in multiple networks.So can speeding up data transmission efficiency, avoid waste Internet resources.Alternatively, if the destination address place network segment of the source address place network segment of the second packet and the first packet is identical, when then terminal unit sends the packet identical with the destination address place network segment of the first packet again, then without being sent by multiple network interfaces, same it can be avoided that network resources waste.
Wherein, the second packet can be the response of the first packet, it is also possible to be not the response of the first packet.When the response that the second packet is not for the first packet, step S204~step S206 can perform before performing step S201, it is also possible to performs in step S201 execution process or in step S203 execution process.
S207: terminal unit obtains the mark of the network interface that the first packet recorded in the route table items of coupling should mail to, and is sent by the network interface that the first packet is identified by the mark of the network interface of acquisition.
Alternatively, no matter whether this terminal unit is sending or is receiving data, and this terminal unit can periodically survey the machine routing table, deletes invalid route table items.
Wherein, can pass through each route table items in the routing table arranges intervalometer for judging invalid route table items, this intervalometer starts when increasing route table items, if the timer expiry in certain route table items, then prove that this route table items is invalid, it is possible to deleted from routing table by this route table items.
In flow process shown in Fig. 2, describe terminal unit and carry out a kind of method of processing data packets, in order to be illustrated more clearly that the process of terminal unit internal agreement stack, below, in conjunction with Fig. 3, illustrate in the embodiment of the present invention, the method for terminal unit inter-process.The method can be considered as an example of method shown in Fig. 2, and similarly, the method also apply be applicable to be accessed the terminal unit of multiple networks by multiple network interfaces, and ratio is in terminal unit as shown in Figure 1.
Wherein, the protocol stack layering of terminal unit can be as shown in Figure 4.Protocol stack can be divided into application layer, transport layer, Internet and network interface layer.Wherein, when sending packet, application layer produces packet and is sent to transport layer;Transport layer provides the transmission of reliable data for packet, to giving network layer handles after processing data packets;Packet is carried out matched routings by Internet, selects route for packet;Network interface layer is connected with network interface, and the packet of automatic network layer is sent by network interface in the future.
When receiving packet, network interface layer receives packet by network interface, will issue Internet, and then issue transport layer, application layer after the processing data packets received.
Fig. 3 is in the embodiment of the present invention, the flow chart of the transmission of packet and process between the layering of terminal unit protocol stack, in Fig. 3, sends step performed during packet as follows:
S301: Internet receives the first packet;
Wherein, the first packet can be from the packet of application layer, and the Internet in terminal unit receives the first packet from application layer by transport layer.
Alternatively, the first packet can be from the user of terminal unit when accessing webpage, or during the program of interactive broadcasting television network, the packet that the application layer of terminal unit produces, carries web access requests message or order request message in this packet.
S302: the first packet is carried out matched routings by Internet;
Wherein, the process of matched routings may is that Internet obtains the destination address of the first packet, and inquires about whether there is the route table items that the destination address with the first packet matches in the routing table.If the destination address of the first packet has dropped in routing table in the network segment of some route table items, then matched routings success;Otherwise, matched routings failure.
Alternatively, step S302 can be performed by the matched routings module of Internet, and matched routings module is for performing the operation of matched routings.
S303: if matched routings is unsuccessful, Internet intercepts the first packet;
Wherein, Internet intercepts the process of the first packet and may is that and arrange intercept point in the layer of networking, and registers Hook Function at intercept point place, and Hook Function can intercept the first packet by above-mentioned intercept point.
Alternatively, after intercept point can be arranged on matched routings, if matched routings success, then the first packet is sent to network interface layer according to the route of coupling.If matched routings failure, then perform step S304.
Step S303 can be performed by the packet interception module of Internet alternatively, and this packet interception module can be used for intercepting the packet from application layer.
S304: the first packet is distributed by Internet again;
Wherein, the process again distributed is an example of abovementioned steps S203.
Wherein, again the process distributed can be passed through the Hook Function of registration in step S303 and realize, the concrete mode realized may is that and is configured in Hook Function, is sent respectively through each network interface in multiple network interfaces by the first packet intercepted.
Alternatively, step S304 can be performed by the distribution module again of Internet, this again distribution module can be used for packet distribution.
S305: Internet receives the second packet, is added to routing table by the route table items with the source address matches of the second packet.
After the first packet that certain equipment in multiple networks sends in receiving step S304, the first packet can be responded by this equipment, namely sends the second packet to terminal unit, and Internet receives the second packet by network interface layer.
Alternatively, the response that the first packet is made by this equipment can be web access requests response, then the second packet includes web access requests response message;Or the response that the first packet is made by this equipment can be order request response, then this second packet includes order request response message.
Wherein, send if the second packet is the equipment receiving the first packet sent in step S304, then can increase the route table items with the source address matches of the second packet in the routing table of Internet, namely increase the route table items that mates with the destination address of the first packet, and record in the route table items of increase the second packet from the mark of network interface.
Wherein, the mark of network interface can identify for network interface, network numbering or network name.
Alternatively, the second packet can be the response of the first packet, it is also possible to be the response of other packets.If the second packet is the response of other packets, then step S305 can perform before step S301, it is also possible to performs in the execution process of step S301, step S302, step S303 and step S304.
Step S305 is an example of abovementioned steps S204~step S206.The embodiment not being described in detail in step S305 is referred to the description in step S204~step S206.
The structural representation of the another kind of terminal unit that Fig. 5 provides for the embodiment of the present invention, this terminal unit is respectively connected to multiple network by multiple network interfaces, wherein, and a corresponding network of network interface, the network that different network interfaces is corresponding different.As it is shown in figure 5, this terminal unit includes:
Processing module 502, for inquiring about in the routing table of terminal unit whether there is the route table items that the destination address of the first packet sent with terminal unit matches;
Sending module 503, for when processing module 502 determines the route table items being absent from matching with the destination address of the first packet, sending the first packet respectively through each network interface in multiple network interfaces.
Alternatively, this terminal unit also includes: receiver module 501, for receiving the second packet by a network interface in multiple network interfaces;Processing module 502 is additionally operable in table of query and routing whether to exist the route table items of the source address matches with the second packet;And when being absent from the route table items of the source address matches of the second packet, increase the route table items with the source address matches of the second data in the routing table, and record in the route table items increased the second packet from the mark of network interface.
Alternatively, processing module 502 is additionally operable to, when the route table items that the destination address existed with the first packet matches, obtain the mark of the network interface that the first packet of record should mail in the route table items of coupling;Sending module 503 is additionally operable to the first packet passes through the network interface transmission that the mark of the network interface that processing module 502 obtains identifies.
Alternatively, processing module 502 is additionally operable to check routing table, deletes invalid route table items.
Alternatively, multiple networks include two networks, respectively the Internet and broadcasting and television network, and terminal unit is Set Top Box.
Other optional implementations of this terminal unit can the realization of terminal unit in Fig. 1~Fig. 3, wherein, receiver module 501 can be used for performing the reception operation of terminal unit, and processing module 502 can be used for performing the process operation of terminal unit, and sending module 503 can be used for the transmission operation of terminal unit.Wherein, processing module 502 carries out matched routings, and other the optional modes revising routing table etc. are referred to the method that the terminal unit in Fig. 1~Fig. 3 carries out matched routings, amendment routing table;Sending module 503 sends the method that the terminal unit that the method for packet is referred in Fig. 1~Fig. 3 sends packet;Receiver module 501 receives the method that the terminal unit that the method for packet is referred in Fig. 1~Fig. 3 receives packet.
Fig. 6 is the structural representation under a kind of optional implementation of the terminal unit shown in Fig. 5.
Wherein, receiver module 501 can be realized by the receptor 601 in Fig. 6, and processing module 502 can be realized by the processor 602 in Fig. 6, and sending module 503 can be realized by the transmitter 603 in Fig. 6.
Wherein, terminal unit has N number of network interface, N be not less than 2 integer, terminal unit by N number of network interface access multiple networks.Receptor 601 is connected with N number of network interface, is received from the packet in multiple networks by N number of network interface;Transmitter 603 is connected with N number of network interface, sends packet by N number of network interface in multiple networks.
The embodiment of the present invention provides a kind of method and apparatus sending packet.In embodiments of the present invention, terminal unit accesses multiple networks by multiple network interfaces, wherein, a corresponding network of network interface, the network that different network interfaces is corresponding different.The route table items that the destination address of the first packet whether existed in terminal unit table of query and routing and to send matches;If being absent from the route table items matched with the destination address of the first packet, then the first packet is sent by terminal unit respectively through each network interface in multiple network interfaces.Due to, first packet is sent by terminal unit respectively through each network interface in multiple network interfaces, therefore the method sending packet that the embodiment of the present invention provides is adopted, do not have the packet problem according to default route transmission to wrong network by should mail to a network according to static routing, solve the problem that the packet sent when terminal unit accesses multiple network can be dropped.
Those skilled in the art are it should be appreciated that embodiments of the invention can be provided as method, system or computer program.Therefore, the present invention can adopt the form of complete hardware embodiment, complete software implementation or the embodiment in conjunction with software and hardware aspect.And, the present invention can adopt the form at one or more upper computer programs implemented of computer-usable storage medium (including but not limited to disk memory, CD-ROM, optical memory etc.) wherein including computer usable program code.
The present invention is that flow chart and/or block diagram with reference to method according to embodiments of the present invention, equipment (system) and computer program describe.It should be understood that can by the combination of the flow process in each flow process in computer program instructions flowchart and/or block diagram and/or square frame and flow chart and/or block diagram and/or square frame.These computer program instructions can be provided to produce a machine to the processor of general purpose computer, special-purpose computer, Embedded Processor or other programmable data processing device so that the instruction performed by the processor of computer or other programmable data processing device is produced for realizing the device of function specified in one flow process of flow chart or multiple flow process and/or one square frame of block diagram or multiple square frame.
These computer program instructions may be alternatively stored in and can guide in the computer-readable memory that computer or other programmable data processing device work in a specific way, the instruction making to be stored in this computer-readable memory produces to include the manufacture of command device, and this command device realizes the function specified in one flow process of flow chart or multiple flow process and/or one square frame of block diagram or multiple square frame.
These computer program instructions also can be loaded in computer or other programmable data processing device, make on computer or other programmable devices, to perform sequence of operations step to produce computer implemented process, thus the instruction performed on computer or other programmable devices provides for realizing the step of function specified in one flow process of flow chart or multiple flow process and/or one square frame of block diagram or multiple square frame.
Although preferred embodiments of the present invention have been described, but those skilled in the art are once know basic creative concept, then these embodiments can be made other change and amendment.So, claims are intended to be construed to include preferred embodiment and fall into all changes and the amendment of the scope of the invention.
Obviously, the present invention can be carried out various change and modification without deviating from the spirit and scope of the present invention by those skilled in the art.So, if these amendments of the present invention and modification belong within the scope of the claims in the present invention and equivalent technologies thereof, then the present invention is also intended to comprise these change and modification.
Claims (10)
1. the method sending packet, is applied in terminal unit, and described terminal unit is respectively connected to multiple network by multiple network interfaces, wherein, a corresponding network of network interface, the network that different network interfaces is corresponding different, it is characterized in that, described method includes:
Whether described terminal unit table of query and routing exists the route table items that the destination address with the first packet to send matches;
If being absent from the route table items matched with the destination address of described first packet, then described first packet is sent by described terminal unit respectively through each network interface in the plurality of network interface.
2. the method for claim 1, it is characterised in that described method also includes:
Described terminal unit receives the second packet by a network interface in the plurality of network interface;
Described terminal unit inquires about the route table items that whether there is the source address matches with described second packet in described routing table;
If being absent from the route table items of source address matches with described second packet, then described terminal unit increases the route table items with the source address matches of described second data in described routing table, and record in the route table items increased described second packet from the mark of network interface.
3. method as claimed in claim 1 or 2, it is characterised in that also include:
If there is the route table items that the destination address with described first packet matches, then described terminal unit obtains the mark of the network interface that described first packet recorded in the route table items of coupling should mail to;
The network interface that described first packet is identified by the mark of the described network interface of acquisition is sent by described terminal unit.
4. the method as described in as arbitrary in claims 1 to 3, it is characterised in that described method also includes:
Described terminal unit checks described routing table, deletes invalid route table items.
5. the method as described in as arbitrary in Claims 1 to 4, it is characterised in that the plurality of network includes two networks, respectively the Internet and broadcasting and television network, and described terminal unit is Set Top Box.
6. a terminal unit, described terminal unit is respectively connected to multiple network by multiple network interfaces, wherein, and a corresponding network of network interface, the network that different network interfaces is corresponding different, it is characterised in that described equipment includes:
Processing module, for inquiring about in the routing table of described terminal unit whether there is the route table items that the destination address of the first packet sent with described terminal unit matches;
Sending module, for when described processing module determines the route table items being absent from matching with the destination address of described first packet, sending described first packet respectively through each network interface in the plurality of network interface.
7. terminal unit as claimed in claim 6, it is characterised in that described terminal unit also includes:
Receiver module, for receiving the second packet by a network interface in the plurality of network interface;
Described processing module, is additionally operable to inquire about the route table items that whether there is the source address matches with described second packet in described routing table;And
When being absent from the route table items of the source address matches of described second packet, described routing table increases the route table items with the source address matches of described second data, and record in the route table items increased described second packet from the mark of network interface.
8. terminal unit as claimed in claims 6 or 7, it is characterised in that
Described processing module, is additionally operable to, when the route table items that the destination address existed with described first packet matches, obtain the mark of the network interface that described first packet of record should mail in the route table items of coupling;
Described sending module, the network interface that the mark of described network interface being additionally operable to be obtained by described processing module by described first packet is identified sends.
9. the terminal unit as described in as arbitrary in claim 6~8, it is characterised in that
Described processing module, is additionally operable to check described routing table, deletes invalid route table items.
10. the terminal unit as described in as arbitrary in claim 6~9, it is characterised in that the plurality of network includes two networks, respectively the Internet and broadcasting and television network, and described terminal unit is Set Top Box.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610095934.7A CN105721314A (en) | 2016-02-05 | 2016-02-05 | Method and equipment for sending data packet |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610095934.7A CN105721314A (en) | 2016-02-05 | 2016-02-05 | Method and equipment for sending data packet |
Publications (1)
Publication Number | Publication Date |
---|---|
CN105721314A true CN105721314A (en) | 2016-06-29 |
Family
ID=56156986
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610095934.7A Pending CN105721314A (en) | 2016-02-05 | 2016-02-05 | Method and equipment for sending data packet |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105721314A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106255174A (en) * | 2016-07-25 | 2016-12-21 | 河南科技大学 | The method of directly communication between user in super-intensive network |
CN109996307A (en) * | 2017-12-29 | 2019-07-09 | 华为技术有限公司 | A kind of data routing method and terminal |
CN111352984A (en) * | 2020-02-19 | 2020-06-30 | 中国联合网络通信集团有限公司 | Data distribution method, device and storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101217539A (en) * | 2007-12-29 | 2008-07-09 | 杭州华三通信技术有限公司 | A firewall device and method for treatment of secondary forwarding message |
CN101312400A (en) * | 2007-05-25 | 2008-11-26 | 上海大亚科技有限公司 | Method realizing IGMP interception function on modem device with 4 ethernet interfaces |
CN103905325A (en) * | 2012-12-26 | 2014-07-02 | 中兴通讯股份有限公司 | Two-layer network data transmission method and network node |
US20150312149A1 (en) * | 2014-04-25 | 2015-10-29 | Metaswitch Networks Ltd | Data processing |
-
2016
- 2016-02-05 CN CN201610095934.7A patent/CN105721314A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101312400A (en) * | 2007-05-25 | 2008-11-26 | 上海大亚科技有限公司 | Method realizing IGMP interception function on modem device with 4 ethernet interfaces |
CN101217539A (en) * | 2007-12-29 | 2008-07-09 | 杭州华三通信技术有限公司 | A firewall device and method for treatment of secondary forwarding message |
CN103905325A (en) * | 2012-12-26 | 2014-07-02 | 中兴通讯股份有限公司 | Two-layer network data transmission method and network node |
US20150312149A1 (en) * | 2014-04-25 | 2015-10-29 | Metaswitch Networks Ltd | Data processing |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106255174A (en) * | 2016-07-25 | 2016-12-21 | 河南科技大学 | The method of directly communication between user in super-intensive network |
CN109996307A (en) * | 2017-12-29 | 2019-07-09 | 华为技术有限公司 | A kind of data routing method and terminal |
CN109996307B (en) * | 2017-12-29 | 2021-06-01 | 华为技术有限公司 | Data routing method and terminal |
US11405844B2 (en) | 2017-12-29 | 2022-08-02 | Huawei Technologies Co., Ltd. | Data routing method and terminal |
CN111352984A (en) * | 2020-02-19 | 2020-06-30 | 中国联合网络通信集团有限公司 | Data distribution method, device and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US12047287B2 (en) | Data transmission method and apparatus, network adapter, and storage medium | |
KR100908320B1 (en) | Method for protecting and searching host in internet protocol version 6 network | |
CN102571587B (en) | Method and equipment for forwarding messages | |
CN109156046B (en) | Home gateway and method for forwarding service thereof | |
CN105228150A (en) | A kind of mobile device carries out the method and apparatus of relaying | |
WO2014089799A1 (en) | Method and apparatus for determining virtual machine drifting | |
US11363675B2 (en) | Mesh network system | |
CN101483657B (en) | Implementation method and system for same side private network device access by private user | |
CN113572864B (en) | Data processing method, network element equipment and readable storage medium | |
CN103346970A (en) | SpaceWire dynamic route implementing method | |
CN118018517A (en) | Data processing method, network element equipment and readable storage medium | |
CN104539902A (en) | IPC remote access method and system | |
CN103634214A (en) | Route information generating method and device | |
CN105721314A (en) | Method and equipment for sending data packet | |
JP5526015B2 (en) | Gateway system, gateway device, and load balancing method | |
EP3086530A1 (en) | Network resource sharing processing and sharing method, device and system | |
CN105721189A (en) | Network port configuration method and device for network equipment | |
CN103475626A (en) | Method, equipment and system used for resource requesting | |
CN106375489A (en) | Processing method and apparatus for MAC address | |
US10091106B2 (en) | Method for implementing layer 3 virtual private network and device | |
CN113055191B (en) | Forwarding method and device and forwarding plane of broadband remote access server | |
CN112714202B (en) | Equipment configuration method and device | |
KR101534819B1 (en) | Method for providing different address information selectively on request from a mobile terminal and an apparatus for said method | |
CN104052816B (en) | The method and apparatus that a kind of network equipment is positioned to user terminal | |
WO2011026355A1 (en) | Method for a node accessing a home agent, home agent cluster system and service router |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20160629 |
|
WD01 | Invention patent application deemed withdrawn after publication |