WO2016187967A1 - 一种实现日志传输的方法及装置 - Google Patents

一种实现日志传输的方法及装置 Download PDF

Info

Publication number
WO2016187967A1
WO2016187967A1 PCT/CN2015/087242 CN2015087242W WO2016187967A1 WO 2016187967 A1 WO2016187967 A1 WO 2016187967A1 CN 2015087242 W CN2015087242 W CN 2015087242W WO 2016187967 A1 WO2016187967 A1 WO 2016187967A1
Authority
WO
WIPO (PCT)
Prior art keywords
log
information
interface
forwarding
generated
Prior art date
Application number
PCT/CN2015/087242
Other languages
English (en)
French (fr)
Inventor
施广帅
Original Assignee
中兴通讯股份有限公司
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 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2016187967A1 publication Critical patent/WO2016187967A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/069Management of faults, events, alarms or notifications using logs of notifications; Post-processing of notifications

Definitions

  • This document relates to, but is not limited to, communication technology, and more particularly to a method and apparatus for implementing log transmission.
  • the system log files (syslog, system log) of the devices such as routers, switches, and servers record all the events in the system. You can check the system status by viewing the system records.
  • the syslog system can receive the log records of remote systems, process the log records of multiple systems in a log sequence in chronological order, and save them as log files. At the same time, you can view the log files of multiple systems received in one location without connecting multiple systems.
  • High-performance routers usually use a distributed architecture, which needs to be used to forward packets through a dedicated network processor and corresponding hardware.
  • the rate of a single interface reaches 40 Gbps or even 100 Gbps, and the integrated functions are rich.
  • a large number of system logs are in the working process of the router. produce.
  • the SOCKET method cannot meet the log transmission of high-performance routers.
  • the SOCKET method uses a single device as a log server of multiple devices, the storage performance of the storage high-performance router cannot be satisfied.
  • the SOCKET method is also prone to packet loss when performing log transmission across the network.
  • Embodiments of the present invention provide a method and apparatus for implementing log transmission, which can meet the requirements of speed and storage performance of log transmission of a high performance router.
  • an embodiment of the present invention provides a method for implementing log transmission, including:
  • the generated log is sent to one or more pre-configured log servers through the fast forwarding channel.
  • the method before sending the generated log to the pre-configured log server, the method further includes:
  • the generated log is matched with the preset alarm level, and only the part of the generated log that reaches the preset alarm level is sent.
  • the pre-configured log server is:
  • the network address information of the log server includes at least:
  • the network address of the log server is the Internet Protocol version 4 IPV4 address or the Internet Protocol version 6 IPV6 address;
  • the log server and the router are directly connected, or the log server and the router are not directly connected to the connection information.
  • the forwarding information of the generated log from the cache includes:
  • the query key value is generated according to the following steps:
  • the destination address of the log is obtained as the next hop of the route; when the log server and the router are not directly connected, the routing table is queried to obtain the next hop of the route;
  • the outbound interface is a real interface or a virtual interface.
  • the virtual interface is at least one of the following interfaces: a link aggregation group Smartgroup interface, a super virtual local area network SuperVlan interface, a multi-link point-to-point protocol MPPP, and a PosGroup interface;
  • the quintuple information of the outbound interface of the router is:
  • the forwarding information includes at least: Ethernet header information ESH sent to the log server, exchange header information, and header information NPH processed by the network processor;
  • the exchange header information is SAIH and ITMH.
  • the method before querying the forwarding information of the generated log in the cache, the method further includes:
  • the forwarding information is obtained from the forwarding plane, and the forwarding information is transmitted to the cache.
  • the method further includes:
  • the generated log is sent to the log server corresponding to the log server address by using the socket SOCKET.
  • an embodiment of the present invention further provides an apparatus for implementing log transmission, including:
  • the query unit is configured to query the forwarding information of the generated log from the cache
  • the sending unit is configured to send the generated log to one or more pre-configured log servers through the fast forwarding channel according to the forwarding information of the query.
  • the device further includes:
  • a filtering unit configured to: match the generated log with a preset alarm level before filtering the generated log to the pre-configured log server, and send only the generated log to the preset The part of the alarm level.
  • the device further includes:
  • the forwarding buffer unit is configured to obtain the forwarding information from the forwarding plane and transmit the information to the cache before querying the forwarding information.
  • the device further includes:
  • the socket unit is configured to send the generated log to the pre-configured log server by using a socket SOCKET mode when the query unit cannot query the forwarding information from the cache.
  • the query unit is set to:
  • the destination address of the log is obtained as the next hop of the route; when the log server and the router are not directly connected, the routing table is queried to obtain the next hop of the route;
  • the quintuple information of the obtained network address of the log server, the next hop of the route, and the outbound interface of the router is used as the query key value;
  • the forwarding information of the generated log is queried from the cache according to the query key value.
  • the embodiment of the invention further provides a computer readable storage medium storing computer executable instructions for performing the above method for implementing log transmission.
  • the technical solution of the embodiment of the present invention includes: querying the generated forwarding information of the log from the cache; and sending the generated log to the pre-configured one or more logs through the fast forwarding channel according to the forwarded information of the query.
  • the method of the embodiment of the present invention solves the problem that the performance of the log transmission of the high performance router cannot be satisfied by using the SOCKET mode by querying the forwarding information from the cache and using the fast forwarding channel to send the generated log to one or more pre-set log servers.
  • the SOCKET method is avoided because of the storage performance problem caused by using a single device as a log server of multiple devices.
  • FIG. 1 is a flowchart of a method for implementing log transmission according to an embodiment of the present invention
  • FIG. 2 is a structural block diagram of an apparatus for implementing log transmission according to an embodiment of the present invention
  • FIG. 3 is a flow chart of a method according to an exemplary embodiment of the present invention.
  • FIG. 1 is a flowchart of a method for implementing log transmission according to an embodiment of the present invention. As shown in FIG. 1 , the method includes:
  • Step 100 Query the forwarding information of the generated log from the cache.
  • the forwarding information of the generated log is queried from the cache according to the query key value
  • the query key value is generated according to the following steps:
  • the destination address of the log is obtained as the next hop of the route.
  • the routing table is queried to obtain the next hop of the route.
  • the quintuple information of the obtained network address of the log server, the next hop of the route, and the outbound interface of the router is used as the query key value;
  • the outgoing interface can be a real interface or a virtual interface.
  • obtaining the quintuple information of the outbound interface of the router belongs to the conventional technical means of those skilled in the art.
  • the virtual interface is at least one of the following interfaces: a link aggregation group (Smartgroup) interface, a super virtual LAN (SuperVlan) interface, a multilink point-to-point protocol (MPPP), and a Pos interface aggregation PosGroup interface.
  • the Pos port is an existing term that refers to the port of a passive fiber splitter.
  • the quintuple information of the outbound interface of the router is:
  • the quintuple information is an existing definition, including the rack number, slot number, port number, sub-port number, and port type. The quintuple information can be used to uniquely determine the egress of the packet.
  • the method of the embodiment of the present invention further includes:
  • the forwarding information is obtained from the forwarding plane, and the forwarding information is transmitted to the cache.
  • the transmission efficiency of the generated log can be improved, and the transmission performance of the generated log can be improved.
  • Step 101 Send the generated log to one or more pre-configured log servers through the fast forwarding channel according to the forwarded information of the query.
  • the pre-configured log server is: receiving network address information of the pre-configured log server through a preset user interface; and a server configured to receive the generated log according to the network address information of the log server.
  • the storage of the generated logs by pre-configuring one or more log servers avoids the storage performance problem caused by the use of a single device as a log server of multiple devices in the SOCKET mode.
  • Log redundancy can be implemented by sending to more than one log server.
  • the technician can query the generated logs on any one of the log servers, which provides convenience for querying log information.
  • the network address information of the log server includes at least:
  • the network address of the log server is the Internet Protocol version 4 (IPV4) address or the Internet Protocol version 6 (IPV6) address; and,
  • the log server is directly connected to the router, or the log server and the router are not directly connected.
  • the forwarding information includes at least: Ethernet header information (ESH) sent to the log server, exchange headers (SAIH and ITMH), and head information NPH headers processed by the network processor.
  • ESH Ethernet header information
  • SAIH and ITMH exchange headers
  • head information NPH headers processed by the network processor.
  • SAIH is a switching header corresponding to the switching channel (SA) 200 switching chip
  • ITMH is a switching header corresponding to the transmission manager (TM).
  • the method of the embodiment of the present invention further includes:
  • the generated log is sent to the log server corresponding to the log server address by means of a socket (SOCKET).
  • SOCKET socket
  • the fast-transferred channel can quickly send the generated log to meet the performance requirements of the high-performance router.
  • the SOCKET can ensure the integrity of the generated log information.
  • the method of the embodiment of the present invention further includes:
  • the generated logs are matched with the preset alarm levels, and only the part of the generated logs that reaches the preset alarm level is sent.
  • the preset alarm level herein refers to a technical requirement analysis performed by a person skilled in the art on the generated log, and a filtering level set according to the importance degree of the log information, such as setting a power source, converting an address, and relating to security.
  • the alarm is performed on key information, that is, the log is forwarded only when an alarm is set.
  • the method of the embodiment of the present invention solves the problem that the performance of the log transmission of the high performance router cannot be satisfied by using the SOCKET mode by querying the forwarding information from the cache and using the fast forwarding channel to send the generated log to one or more pre-set log servers. .
  • the SOCKET method is avoided because of the storage performance problem caused by using a single device as a log server of multiple devices.
  • the apparatus includes a processor and a program storage device, where the program storage device is configured to store an executable command including the processor.
  • the following units include: a query unit and a sending unit; wherein
  • the query unit is configured to query the forwarding information of the generated log from the cache
  • the query unit is specifically set to,
  • the destination address of the log is obtained as the next hop of the route.
  • the routing table is queried to obtain the next hop of the route.
  • the forwarding information of the generated log is queried from the cache according to the query key value.
  • the sending unit is configured to send the generated log to one or more pre-configured log servers through the fast forwarding channel according to the forwarding information of the query.
  • the device of the embodiment of the present invention further includes a filtering unit, configured to match the generated log with a preset alarm level before sending the generated log to the pre-configured log server, and only send the generated log to a preset alarm level. part.
  • the apparatus of the embodiment of the present invention further includes a forwarding buffer unit configured to obtain forwarding information from the forwarding plane and transmit the information to the buffer before querying the forwarding information.
  • the device of the embodiment of the present invention further includes a socket unit, and is configured to send the generated log to the pre-configured log server through the socket SOCKET mode when the query unit cannot query the forwarding information from the cache.
  • the embodiment of the invention further provides a computer readable storage medium storing computer executable instructions for performing the above method for implementing log transmission.
  • FIG. 3 is a flowchart of a method according to an exemplary embodiment of the present invention. As shown in FIG. 3, the method includes:
  • step 300 the generated log is matched with the preset alarm level, and the part of the generated log that reaches the preset alarm level is obtained.
  • step 301 the network address of the log server and the next hop of the route are used as query key values, and the forwarding information is queried from the cache. If the query is successful, go to step 302. If the query fails, go to step 303.
  • the method includes: obtaining a network address of the log server from the forwarding plane;
  • the destination address of the log is obtained as the next hop of the route.
  • the routing table is queried to obtain the next hop of the route.
  • the obtained network address of the log server and the next hop of the route are used as query key values;
  • the key value queries the forwarding information from the cache.
  • the forwarding information of the forwarding plane when updated, new forwarding information is added, or the forwarding information is deleted, the forwarding information in the cache needs to be processed correspondingly to perform corresponding transmission of the generated log. Adjustment.
  • the specific adjustment process is well known to those skilled in the art.
  • the query key value also includes the quintuple information of the outbound interface of the router
  • the outgoing interface is a real interface or a virtual interface:
  • a virtual interface is at least one of the following interfaces: a link aggregation group (Smartgroup) interface, a super virtual LAN (SuperVlan) interface, a multilink point-to-point protocol (MPPP), and a PosGroup interface.
  • Smartgroup link aggregation group
  • SuperVlan super virtual LAN
  • MPPP multilink point-to-point protocol
  • the quintuple information of the outbound interface of the router is:
  • Step 302 Send the part of the generated log that reaches the preset alarm level to one or more pre-configured log servers according to the forwarded information of the query.
  • the forwarding information includes at least: an ESH, a switching header (SAIH and ITMH), and an NPH; the forwarding information is generally combined to generate a cookie, wherein the ESH performs Layer 2 forwarding, and the generated log is sent to the SA chip; the SA chip is switched to the TM based on the SAIH.
  • the chip strips ESH and SAIH; the TM chip sends the generated log to the network processor (NP) based on ITMH; the NP chip sends the TM to the physical panel port based on NPH.
  • Step 303 Send the part of the generated log that reaches the preset alarm level to the log server corresponding to the log server address by using a socket (SOCKET).
  • SOCKET a socket
  • the forwarding message needs to be obtained from the forwarding plane.
  • the subsequent forwarding information will be transmitted to the cache; in this embodiment, the query failure means that the corresponding cookie is not found in the cache.
  • the generated log only obtains the pre-set alarm level, and then queries the obtained forwarding message in the cache to perform log transmission.
  • a flexible log transmission method can send logs quickly through the fast forwarding channel or through the SOCKET method.
  • all or part of the steps of the above embodiments may also be implemented by using an integrated circuit. These steps may be separately fabricated into individual integrated circuit modules, or multiple modules or steps may be fabricated into a single integrated circuit module. achieve. Thus, the invention is not limited to any specific combination of hardware and software.
  • the devices/function modules/functional units in the above embodiments may be implemented by a general-purpose computing device, which may be centralized on a single computing device or distributed over a network of multiple computing devices.
  • each device/function module/functional unit in the above embodiment When each device/function module/functional unit in the above embodiment is implemented in the form of a software function module and sold or used as a stand-alone product, it can be stored in a computer readable storage medium.
  • the above mentioned computer readable storage medium may be a read only memory, a magnetic disk or an optical disk or the like.
  • the log of the high performance router cannot be satisfied by using the socket (SOCKET) method.
  • SOCKET socket

Abstract

一种实现日志传输的方法及装置,包括:从缓存中查询生成的日志的转发信息;根据查询的转发信息,通过快速转发通道发送生成的日志至预先配置的一个或一个以上日志服务器上。本发明实施例方法通过从缓存中查询转发信息,利用快速转发通道将生成的日志发送到一个或一个以上预先设置的日志服务器,解决了采用套接字(SOCKET)方式无法满足高性能路由器的日志传输的性能问题。同时,避免了采用SOCKET方式时由于采用单个设备作为多台设备的日志服务器出现的存储性能问题。

Description

一种实现日志传输的方法及装置 技术领域
本文涉及但不限于通信技术,尤指一种实现日志传输的方法及装置。
背景技术
随着互联网的发展,网络规模日益扩大,应用日趋复杂。为了能够及时了解网络带宽的负载和业务的占用情况、发现和检测异常流量、审计用户的上网行为,以及为将来的网络优化、扩容提供分析数据的转发面管理,网络的事件信息的采集分析势在必行。路由器、交换机、服务器等设备的系统日志文件(syslog,system log)(以下简称日志)记录着系统中的所有事件,通过查看系统记录可以掌握系统状况。syslog系统能够接收远程系统的日志记录,在一个日志中按时间顺序处理多个系统的日志记录,并以日志文件形式存盘。同时在无需连接多个系统的情况下,可以在一个位置查看接收的多个系统的日志文件。
目前,大部分存储syslog的日志服务器,采用套接字(SOCKET)方式,使用用户数据报协议(UDP)作为传输协议,通过目的端口514(或其它定义的端口号)将设备的日志管理配置发送到安装有syslog系统的日志服务器中,日志服务器自动接受日志数据并写到日志文件中。
高性能路由器通常采用分布式架构,需要通过专门的网络处理器和相应的硬件用来转发报文,单个接口的速率达到40Gbps甚至100Gbps,且集成的功能丰富,大量的系统日志在路由器工作过程中产生。采用SOCKET方式无法满足高性能路由器的日志传输。且由于SOCKET方式多采用单个设备作为多台设备的日志服务器,无法满足存储高性能路由器的存储性能。另外,采用SOCKET方式在跨网络进行日志传输时还容易发生丢包的问题。
发明内容
以下是对本文详细描述的主题的概述。本概述并非是为了限制权利要求 的保护范围。
本发明实施例提供一种实现日志传输的方法及装置,能够满足高性能路由器的日志传输在速度及存储性能上的要求。
一方面,本发明实施例提供了一种实现日志传输的方法,包括:
从缓存中查询生成的日志的转发信息;
根据查询的转发信息,通过快速转发通道发送生成的日志至预先配置的一个或多个日志服务器上。
可选地,在发送生成的日志到预先配置的日志服务器之前,该方法还包括:
将所述生成的日志与预先设置的告警级别进行匹配过滤,仅发送所述生成的日志中达到所述预先设置的告警级别的部分。
可选地,所述预先配置的日志服务器为:
通过预先设置的用户界面接收预先配置的所述日志服务器的网络地址信息,根据所述日志服务器的网络地址信息配置的接收所述生成的日志的服务器。
可选地,日志服务器的网络地址信息至少包括:
所述日志服务器的网络地址为互联网协议第四版IPV4地址或互联网协议第六版IPV6地址;和,
所述日志服务器和路由器直连,或所述日志服务器和路由器非直连的连接信息。
可选地,从缓存中查询生成的日志的转发信息包括:
根据查询键值从缓存中查询生成的日志的转发信息;
所述查询键值根据以下步骤生成:
从转发面获取所述日志服务器的网络地址;
当所述日志服务器和路由器直连时,获取日志发送的目的地址作为路由下一跳;当所述日志服务器和路由器非直连时,查询路由表获取路由下一跳;
获取所述路由器的出接口的五元组信息;
将获取的日志服务器的网络地址、路由下一跳及所述路由器的出接口的五元组信息作为所述查询键值;
所述出接口为实接口或虚接口。
可选地,所述虚接口为以下接口至少之一:链路聚合组Smartgroup接口、超级虚拟局域网SuperVlan接口、多链路点对点协议MPPP、PosGroup接口;
当出接口为虚接口时,所述路由器出接口的五元组信息为:
查询接口端口状态信息以选取一条激活的物理接口,将选取的激活的物理接口及所述虚接口的信息作为路由器出接口的五元组信息。
可选地,转发信息至少包括:发往日志服务器的以太网头信息ESH、交换头信息和网络处理器处理的头信息NPH;
所述交换头信息为SAIH和ITMH。
可选地,在缓存中查询生成的日志的转发信息之前,该方法还包括:
从转发面获取所述转发信息,将转发信息传输至所述缓存中。
可选地,当缓存中查询不到所述转发信息时,该方法还包括:
将所述生成的日志通过套接字SOCKET方式发送到日志服务器地址对应的日志服务器上。
另一方面,本发明实施例还提供一种实现日志传输的装置,包括:
查询单元,设置为从缓存中查询生成的日志的转发信息;
发送单元,设置为根据查询的转发信息,通过快速转发通道发送生成的日志至预先配置的一个或多个日志服务器上。
可选地,该装置还包括:
过滤单元,设置为在发送所述生成的日志到预先配置的日志服务器之前,将所述生成的日志与预先设置的告警级别进行匹配过滤,仅发送所述生成的日志中达到所述预先设置的告警级别的部分。
可选地,该装置还包括:
转发缓存单元,设置为在查询转发信息之前,从转发面获取所述转发信息并传输至缓存中。
可选地,该装置还包括:
套接字单元,设置为当查询单元从缓存中查询不到所述转发信息时,将所述生成的日志通过套接字SOCKET方式发送到所述预先配置的日志服务器上。
可选地,查询单元是设置为:
从转发面获取所述日志服务器的网络地址;
所述日志服务器和路由器直连时,获取日志发送的目的地址作为路由下一跳;所述日志服务器和路由器非直连时,查询路由表获取路由下一跳;
获取路由器的出接口的五元组信息;
将获取的日志服务器的网络地址、路由下一跳及路由器的出接口的五元组信息作为所述查询键值;
根据查询键值从缓存中查询生成的日志的所述转发信息。
本发明实施例还提供一种计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令用于执行上述实现日志传输的的方法。
与现有技术相比,本发明实施例的技术方案包括:从缓存中查询生成的日志的转发信息;根据查询的转发信息,通过快速转发通道发送生成的日志至预先配置的一个或一个以上日志服务器上。本发明实施例的方法通过从缓存中查询转发信息,利用快速转发通道将生成的日志发送到一个或一个以上预先设置的日志服务器,解决了采用SOCKET方式无法满足高性能路由器的日志传输的性能问题。同时,避免了采用SOCKET方式由于采用单个设备作为多台设备的日志服务器出现存储性能问题。
在阅读并理解了附图和详细描述后,可以明白其它方面。
附图概述
此处所说明的附图用来提供对本发明实施例的进一步理解,构成本申请的一部分,本发明的示意性实施例及其说明用于解释本发明实施例,并不构成对本发明的不当限定。在附图中:
图1为本发明实施例实现日志传输的方法的流程图;
图2为本发明实施例实现日志传输的装置的结构框图;
图3为本发明一示例性实施例的方法流程图。
本发明的较佳实施方式
下文中将结合附图对本发明的实施例进行详细说明。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互任意组合。
图1为本发明实施例实现日志传输的方法的流程图,如图1所示,包括:
步骤100、从缓存中查询生成的日志的转发信息;
本步骤中,根据查询键值从缓存中查询生成的日志的转发信息;
查询键值根据以下步骤生成:
从转发面获取日志服务器的网络地址;
日志服务器和路由器直连时,获取日志发送的目的地址作为路由下一跳;日志服务器和路由器非直连时,查询路由表获取路由下一跳;
获取路由器的出接口的五元组信息;
将获取的日志服务器的网络地址、路由下一跳及路由器的出接口的五元组信息作为所述查询键值;
出接口可以是实接口或虚接口。
这里,获取路由器的出接口的五元组信息属于本领域技术人员的惯用技术手段。
虚接口为以下接口至少之一:链路聚合组(Smartgroup)接口、超级虚拟局域网(SuperVlan)接口、多链路点对点协议(MPPP)、Pos口聚合PosGroup接口。Pos口是现有名词,是指无源光纤分路器的端口。
当出接口为虚接口时,路由器出接口的五元组信息为:
查询接口端口状态信息以选取一条激活的物理接口,将选取的激活的物理接口及虚接口的信息作为路由器出接口的五元组信息。
需要说明的是,当出接口是虚接口时,通过现有的选路算法选取激活的物理接口。五元组信息为现有定义,包括机架号、槽位号、端口号、子端口号、端口类型,通过五元组信息可以唯一的确定报文的出口。
从缓存中查询生成的日志的转发信息之前,本发明实施例的方法还包括:
从转发面获取转发信息,将转发信息传输至缓存中。
需要说明的是,将转发信息传输至缓存中,可以提高生成的日志的传输效率,达到提高生成的日志的传输性能的目的。
步骤101、根据查询的转发信息,通过快速转发通道发送生成的日志至预先配置的一个或一个以上日志服务器上。
这里,预先配置的日志服务器为:通过预先设置的用户界面接收预先配置的日志服务器的网络地址信息;根据日志服务器的网络地址信息配置的接收生成的日志的服务器。
需要说明的是,通过预先配置一个或一个以上日志服务器进行生成的日志的接收,避免了由于SOCKET方式多采用单个设备作为多台设备的日志服务器出现的存储性能问题。发送到一个以上日志服务器上可以实现日志冗余;另外,技术人员可以在任意的一个日志服务器上进行生成的日志的查询,为查询日志信息提供了便捷。
可选地,日志服务器的网络地址信息至少包括:
日志服务器的网络地址为互联网协议第四版(IPV4)地址或互联网协议第六版(IPV6)地址;和,
日志服务器和路由器直连,或日志服务器和路由器非直连的连接信息。
转发信息至少包括:发往日志服务器的以太网头信息(ESH)、交换头(SAIH和ITMH)和网络处理器处理的头信息NPH头。
需要说明的是,SAIH是交换通道(SA)200交换芯片对应的交换头;ITMH是传输管理器(TM)对应的交换头。根据转发信息进行数据传输属于本领域技术人员的公知常识,在此不再赘述。
当缓存中查询不到转发信息时,本发明实施例的方法还包括:
将生成的日志通过套接字(SOCKET)方式发送到日志服务器地址对应的日志服务器上。
需要说明的是,通过快速转发通道快速发送生成的日志,满足了高性能路由器的性能要求;当出现从缓存中查询转发信息失败时,通过SOCKET方式可以保证生成的日志信息的完整。
发送生成的日志到预先配置的日志服务器之前,本发明实施例的方法还包括:
将生成的日志与预先设置的告警级别进行匹配过滤,仅发送生成的日志中达到预先设置的告警级别的部分。
需要说明的是,这里预先设置的告警级别是指本领域技术人员对生成的日志进行技术需求分析,根据日志信息的重要程度设置的过滤级别,例如设置电源、转换地址、涉及到安全的某些关键信息等进行告警,即只有设置了告警才进行日志的转发。
本发明实施例的方法通过从缓存中查询转发信息,利用快速转发通道将生成的日志发送到一个或一个以上预先设置的日志服务器,解决了采用SOCKET方式无法满足高性能路由器的日志传输的性能问题。同时,避免了采用SOCKET方式由于采用单个设备作为多台设备的日志服务器出现存储性能问题。
图2为本发明实施例实现日志传输的装置的结构框图,如图2所示,所述装置包括处理器和程序存储设备,所述程序存储设备用于存储包含所述处理器可执行命令的以下单元,包括:查询单元和发送单元;其中,
查询单元,设置为从缓存中查询生成的日志的转发信息;
查询单元具体设置为,
从转发面获取日志服务器的网络地址;
日志服务器和路由器直连时,获取日志发送的目的地址作为路由下一跳;日志服务器和路由器非直连时,查询路由表获取路由下一跳;
获取路由器的出接口的五元组信息;
将获取的日志服务器的网络地址、路由下一跳及路由器的出接口的五元 组信息作为所述查询键值;
根据查询键值从缓存中查询生成的日志的转发信息。
发送单元,设置为根据查询的转发信息,通过快速转发通道发送生成的日志至预先配置的一个或一个以上日志服务器上。
本发明实施例装置还包括过滤单元,设置为发送生成的日志到预先配置的日志服务器之前,将生成的日志与预先设置的告警级别进行匹配过滤,仅发送生成的日志中达到预先设置的告警级别的部分。
本发明实施例装置还包括转发缓存单元,设置为查询转发信息之前,从转发面获取转发信息并传输至缓存中。
本发明实施例装置还包括套接字单元,设置为查询单元从缓存中查询不到转发信息时,将生成的日志通过套接字SOCKET方式发送到预先配置的日志服务器上。
本发明实施例还提供一种计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令用于执行上述实现日志传输的方法。
以下通过示例性实施例对本发明实施例方法进行清楚详细的说明,实施例仅用于陈述本发明,并不用于限制本发明方法的保护范围。
实施例1
图3为本发明一示例性实施例的方法流程图,如图3所示,包括:
步骤300、将生成的日志与预先设置的告警级别进行匹配过滤,获得生成的日志中达到预先设置的告警级别的部分。
步骤301、以日志服务器的网络地址和路由下一跳作为查询键值,从缓存中查询转发信息。查询成功时,执行步骤302;查询失败时,执行步骤303。
具体包括“从转发面获取日志服务器的网络地址;
日志服务器和路由器直连时,获取日志发送的目的地址作为路由下一跳;日志服务器和路由器非直连时,查询路由表获取路由下一跳;
将获取的日志服务器的网络地址和路由下一跳作为查询键值;通过查询 键值从缓存中查询转发信息。
需要说明的是,当转发面的转发信息发生更新、增加了新的转发信息或对转发信息进行删除时,首先需要对缓存中的转发信息进行相应的处理,以对生成的日志的传输进行相应的调整。具体调整过程属于本领域技术人员的公知常识。
查询键值还包括路由器的出接口的五元组信息;
出接口为实接口或虚接口:
虚接口为以下接口至少之一:链路聚合组(Smartgroup)接口、超级虚拟局域网(SuperVlan)接口、多链路点对点协议(MPPP)、PosGroup接口。
当出接口为虚接口时,路由器出接口的五元组信息为:
查询接口端口状态信息以选取一条激活的物理接口,将选取的激活的物理接口及虚接口的信息作为路由器出接口的五元组信息。
步骤302、根据查询的转发信息将生成的日志中达到预先设置的告警级别的部分发往预先配置的一个或一个以上日志服务器。
转发信息至少包括:ESH、交换头(SAIH和ITMH)和NPH;转发信息一般组合生成cookie,其中,基于ESH进行二层转发,将生成的日志发往SA芯片;SA芯片基于SAIH将交换至TM芯片,剥离ESH和SAIH;TM芯片基于ITMH将生成的日志送至网络处理器(NP);NP芯片基于NPH将TM发往物理面板口。
步骤303、将生成的日志中达到预先设置的告警级别的部分通过套接字(SOCKET)方式发送到日志服务器地址对应的日志服务器上。这里通过SOCKET方式进行日志传输时,仍需要从转发面获取转发消息。经过一次传输后,之后的转发信息将被传输至缓存中;本实施例中,查询失败是指在缓存中找不到相应的cookie。
本实施例,生成的日志只有达到预先设置的告警级别时,才查询获取缓存中的转发消息,进行日志传输。灵活的日志传输方法,既可以通过快速转发通道快速发送日志,也可以通过SOCKET方式发送生成的日志。支持IPV4、IPV6地址,虚接口、实接口,直连和非直连情形下,生成的日志的传输,通 过转发信息进行缓存有效提高了生成的日志的传输效率;通过快速传输通道保证了传输速度。
本领域普通技术人员可以理解上述实施例的全部或部分步骤可以使用计算机程序流程来实现,所述计算机程序可以存储于一计算机可读存储介质中,所述计算机程序在相应的硬件平台上(如系统、设备、装置、器件等)执行,在执行时,包括方法实施例的步骤之一或其组合。
可选地,上述实施例的全部或部分步骤也可以使用集成电路来实现,这些步骤可以被分别制作成一个个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。这样,本发明不限制于任何特定的硬件和软件结合。
上述实施例中的各装置/功能模块/功能单元可以采用通用的计算装置来实现,它们可以集中在单个的计算装置上,也可以分布在多个计算装置所组成的网络上。
上述实施例中的各装置/功能模块/功能单元以软件功能模块的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。上述提到的计算机可读取存储介质可以是只读存储器,磁盘或光盘等。
任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应以权利要求所述的保护范围为准。
工业实用性
本发明实施例方法通过从缓存中查询转发信息,利用快速转发通道将生成的日志发送到一个或一个以上预先设置的日志服务器,可以解决采用套接字(SOCKET)方式无法满足高性能路由器的日志传输的性能问题,同时可以避免采用SOCKET方式时由于采用单个设备作为多台设备的日志服务器出现的存储性能问题。

Claims (15)

  1. 一种实现日志传输的方法,包括:
    从缓存中查询生成的日志的转发信息;
    根据查询的转发信息,通过快速转发通道发送所述生成的日志至预先配置的一个或多个日志服务器上。
  2. 根据权利要求1所述的方法,其中,在所述发送生成的日志到预先配置的日志服务器之前,还包括:
    将所述生成的日志与预先设置的告警级别进行匹配过滤,仅发送所述生成的日志中达到所述预先设置的告警级别的部分。
  3. 根据权利要求1或2所述的方法,其中,所述预先配置的日志服务器为:
    通过预先设置的用户界面接收预先配置的所述日志服务器的网络地址信息,根据所述日志服务器的网络地址信息配置的接收所述生成的日志的服务器。
  4. 根据权利要求3所述的方法,其中,所述日志服务器的网络地址信息至少包括:
    所述日志服务器的网络地址为互联网协议第四版IPV4地址或互联网协议第六版IPV6地址;和,
    所述日志服务器和路由器直连,或所述日志服务器和路由器非直连的连接信息。
  5. 根据权利要求3所述的方法,其中,所述从缓存中查询生成的日志的转发信息包括:
    根据查询键值从缓存中查询生成的日志的转发信息;
    所述查询键值根据以下步骤生成:
    从转发面获取所述日志服务器的网络地址;
    当所述日志服务器和路由器直连时,获取日志发送的目的地址作为路由 下一跳;当所述日志服务器和路由器非直连时,查询路由表获取路由下一跳;
    获取所述路由器的出接口的五元组信息;
    将获取的日志服务器的网络地址、路由下一跳及所述路由器的出接口的五元组信息作为所述查询键值;
    所述出接口为实接口或虚接口。
  6. 根据权利要求5所述的方法,其中,所述虚接口为以下接口至少之一:链路聚合组Smartgroup接口、超级虚拟局域网SuperVlan接口、多链路点对点协议MPPP、PosGroup接口;
    当出接口为虚接口时,所述路由器出接口的五元组信息为:
    查询接口端口状态信息以选取一条激活的物理接口,将选取的激活的物理接口及所述虚接口的信息作为路由器出接口的五元组信息。
  7. 根据权利要求1或2所述的方法,其中,所述转发信息至少包括:发往日志服务器的以太网头信息ESH、交换头信息和网络处理器处理的头信息NPH;
    所述交换头信息为SAIH和ITMH。
  8. 根据权利要求1或2所述的方法,其中,在所述从缓存中查询生成的日志的转发信息之前,还包括:
    从转发面获取所述转发信息,将转发信息传输至所述缓存中。
  9. 根据权利要求1或2所述的方法,其中,当缓存中查询不到所述转发信息时,还包括:
    将所述生成的日志通过套接字SOCKET方式发送到日志服务器地址对应的日志服务器上。
  10. 一种实现日志传输的装置,包括:
    查询单元,设置为从缓存中查询生成的日志的转发信息;
    发送单元,设置为根据查询的转发信息,通过快速转发通道发送生成的日志至预先配置的一个或多个日志服务器上。
  11. 根据权利要求10所述的装置,还包括:
    过滤单元,设置为在发送所述生成的日志到预先配置的日志服务器之前,将所述生成的日志与预先设置的告警级别进行匹配过滤,仅发送所述生成的日志中达到所述预先设置的告警级别的部分。
  12. 根据权利要求10或11所述的装置,还包括:
    转发缓存单元,设置为在查询转发信息之前,从转发面获取所述转发信息并传输至缓存中。
  13. 根据权利要求10或11所述的装置,还包括:
    套接字单元,设置为当查询单元从缓存中查询不到所述转发信息时,将所述生成的日志通过套接字SOCKET方式发送到所述预先配置的日志服务器上。
  14. 根据权利要求10或11所述的装置,其中,所述查询单元是设置为:
    从转发面获取所述日志服务器的网络地址;
    所述日志服务器和路由器直连时,获取日志发送的目的地址作为路由下一跳;所述日志服务器和路由器非直连时,查询路由表获取路由下一跳;
    获取路由器的出接口的五元组信息;
    将获取的日志服务器的网络地址、路由下一跳及路由器的出接口的五元组信息作为所述查询键值;
    根据查询键值从缓存中查询生成的日志的所述转发信息。
  15. 一种计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令用于执行权利要求1-9任一项的方法。
PCT/CN2015/087242 2015-05-28 2015-08-17 一种实现日志传输的方法及装置 WO2016187967A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510284692.1 2015-05-28
CN201510284692.1A CN106301844B (zh) 2015-05-28 2015-05-28 一种实现日志传输的方法及装置

Publications (1)

Publication Number Publication Date
WO2016187967A1 true WO2016187967A1 (zh) 2016-12-01

Family

ID=57393733

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/087242 WO2016187967A1 (zh) 2015-05-28 2015-08-17 一种实现日志传输的方法及装置

Country Status (2)

Country Link
CN (1) CN106301844B (zh)
WO (1) WO2016187967A1 (zh)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108989314A (zh) * 2018-07-20 2018-12-11 北京木瓜移动科技股份有限公司 一种流式数据传输、处理方法及装置
CN111177013A (zh) * 2020-01-06 2020-05-19 北京达佳互联信息技术有限公司 日志数据获取方法、装置、计算机设备及存储介质
CN111190871A (zh) * 2019-12-18 2020-05-22 中移(杭州)信息技术有限公司 日志生成方法、装置、计算机设备及存储介质
CN115118583A (zh) * 2022-06-29 2022-09-27 北京奇艺世纪科技有限公司 日志查询方法、装置、电子设备及计算机可读存储设备

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114780353B (zh) * 2022-06-15 2022-09-27 统信软件技术有限公司 一种文件日志监控方法、系统及计算设备

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11265349A (ja) * 1998-03-17 1999-09-28 Toshiba Corp コンピュータシステムならびに同システムに適用される機密保護方法、送受信ログ管理方法、相互の確認方法および公開鍵世代管理方法
CN101022662A (zh) * 2007-02-26 2007-08-22 华为技术有限公司 一种呼叫日志服务器、系统及其方法
CN103778049A (zh) * 2012-10-19 2014-05-07 北京市三希电子科技开发公司 一种嵌入式设备开发日志系统
CN104036025A (zh) * 2014-06-27 2014-09-10 蓝盾信息安全技术有限公司 一种基于分布式的海量日志采集系统
CN104572351A (zh) * 2014-12-23 2015-04-29 中国工商银行股份有限公司 基于主机系统的数据恢复系统及方法

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11265349A (ja) * 1998-03-17 1999-09-28 Toshiba Corp コンピュータシステムならびに同システムに適用される機密保護方法、送受信ログ管理方法、相互の確認方法および公開鍵世代管理方法
CN101022662A (zh) * 2007-02-26 2007-08-22 华为技术有限公司 一种呼叫日志服务器、系统及其方法
CN103778049A (zh) * 2012-10-19 2014-05-07 北京市三希电子科技开发公司 一种嵌入式设备开发日志系统
CN104036025A (zh) * 2014-06-27 2014-09-10 蓝盾信息安全技术有限公司 一种基于分布式的海量日志采集系统
CN104572351A (zh) * 2014-12-23 2015-04-29 中国工商银行股份有限公司 基于主机系统的数据恢复系统及方法

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108989314A (zh) * 2018-07-20 2018-12-11 北京木瓜移动科技股份有限公司 一种流式数据传输、处理方法及装置
CN111190871A (zh) * 2019-12-18 2020-05-22 中移(杭州)信息技术有限公司 日志生成方法、装置、计算机设备及存储介质
CN111177013A (zh) * 2020-01-06 2020-05-19 北京达佳互联信息技术有限公司 日志数据获取方法、装置、计算机设备及存储介质
CN111177013B (zh) * 2020-01-06 2023-09-26 北京达佳互联信息技术有限公司 日志数据获取方法、装置、计算机设备及存储介质
CN115118583A (zh) * 2022-06-29 2022-09-27 北京奇艺世纪科技有限公司 日志查询方法、装置、电子设备及计算机可读存储设备
CN115118583B (zh) * 2022-06-29 2024-03-26 北京奇艺世纪科技有限公司 日志查询方法、装置、电子设备及计算机可读存储设备

Also Published As

Publication number Publication date
CN106301844A (zh) 2017-01-04
CN106301844B (zh) 2020-03-24

Similar Documents

Publication Publication Date Title
US11533248B2 (en) Method and system of resiliency in cloud-delivered SD-WAN
US10419327B2 (en) Systems and methods for controlling switches to record network packets using a traffic monitoring network
US10243826B2 (en) Diagnosis and throughput measurement of fibre channel ports in a storage area network environment
JP6518697B2 (ja) コントローラにスイッチモデリングインターフェイスを使用してネットワークスイッチを制御するためのシステム及び方法
US11233720B2 (en) Hierarchical time stamping
WO2016187967A1 (zh) 一种实现日志传输的方法及装置
US20130304915A1 (en) Network system, controller, switch and traffic monitoring method
WO2020238835A1 (zh) 一种主主集群的控制方法以及控制节点
US9008080B1 (en) Systems and methods for controlling switches to monitor network traffic
US11115346B2 (en) Systems and methods for generating network flow information
US9787567B1 (en) Systems and methods for network traffic monitoring
WO2022253087A1 (zh) 一种数据传输方法、节点、网络管理器及系统
WO2013146808A1 (ja) コンピュータシステム、及び通信経路変更方法
US10817505B2 (en) Maintaining consistency within a federated cloud environment
US20220286409A1 (en) Method and apparatus for configuring quality of service policy for service, and computing device
US9667540B2 (en) Fiber channel over ethernet (FCoE) frame forwarding system
JP4638849B2 (ja) 機能分散型通信装置および経路制御方法
US20230113518A1 (en) Distributed Network Flow Record
JP4477073B2 (ja) リソース検索システムおよびリソース検索用情報処理装置
James Design of a New Network Infrastructure using Routing Control Platform for the University of Huddersfield Campus Grid

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 15893048

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 15893048

Country of ref document: EP

Kind code of ref document: A1