1. Field of the Invention
The present invention relates to a communication apparatus which receives data from an external apparatus.
2. Description of the Related Art
Conventionally, the cause of a communication fault can be ascertained using software to acquire packet data flowing in a network. Thus, the packet data, when the fault occurred, can be obtained and analyzed.
Further, the cause of the fault can be ascertained by reproducing the occurrence of the fault by resending the acquired packet data through the network and analyzing the reproduced fault.
For example, Japanese Patent Application Laid-Open No. 8-116334 discuses an apparatus which monitors and collects packet data on a network. In the technique discussed in Japanese Patent Application Laid-Open No. 8-116334, the collected packet data is stored in a storage device, and that packet data is sent over the network to reproduce a fault.
However, in a method which resends acquired packet data over a network to reproduce the sending of the packet data, unnecessary packet data is flowed through the network, so that there is the possibility of superfluous network traffic being generated. Further, there is the drawback that it takes time and effort to reproduce the sending of the packet data, such as having to decide when to resend the data without any adverse impact even if the occurrence of a fault is reproduced.
On the other hand, rather than reproducing the sending of packet data under the original network environment, a method can also be considered of separately constructing a pseudo-network environment, and sending the packet data over the separate network environment. According to this method, the possibility of superfluous network traffic being generated under the original network environment is eliminated. However, since the pseudo-network environment is different from the original network environment, there is the possibility that the occurrence of the fault is not reproduced or the substance of the reproduced fault is different. If the cause of the fault is an apparatus present in the original network environment, there is the possibility that the occurrence of the fault is not reproduced under a pseudo-network environment using a substitute for that apparatus. Further, separately constructing such a pseudo-network environment creates a large amount of work.
The present invention is directed to a communication apparatus, a data processing method, and a program, which can reproduce the sending of packet data while suppressing unnecessary network traffic.
According to an aspect of the present invention, a communication apparatus includes a receiving unit configured to receive data including a destination address from an external apparatus, a change unit configured to change the destination address to an address of the communication apparatus, and a sending unit configured to send the data whose destination address was changed by the change unit to an address of the communication apparatus.
Further features and aspects of the present invention will become apparent from the following detailed description of exemplary embodiments with reference to the attached drawings.
The accompanying drawings, which are incorporated herein and constitute a part of the specification, illustrate exemplary embodiments, features, and aspects of the invention and, together with the description, serve to explain the principles of the invention.
Various exemplary embodiments, features, and aspects of the invention will be described in detail below with reference to the drawings.
A central processing unit (CPU) 101 controls the whole apparatus by executing a software program which controls the communication apparatus 100. A read-only memory (ROM) 102 stores a boot program of the communication apparatus 100, various programs for controlling the communication apparatus 100, and fixed parameters. A random access memory (RAM) 103 stores the temporary data required for the CPU 101 to control the communication apparatus 100.
A printer interface (I/F) control unit 104 controls a printer unit 110 according to an order from the CPU 101. A non-volatile random access memory (NVRAM) 105 stores the values for various settings of the communication apparatus 100. A panel control unit 106 controls an operation panel 109 according to an order from the CPU 101, displays various pieces of information on the operation panel 109, and acquires instructions input by a user from the operation panel 109. A network I/F control unit 107 controls the sending/receiving of data by a local area network (LAN) 113 according to an order from the CPU 101.
A hard disk drive (HDD) 108 stores print data and various other kinds of data. The operation panel 109 has a display apparatus and a button, which are used to display various kinds of information and input instructions from a user. The printer unit 110 prints an image on a sheet based on print data. A timer 112 measures the elapsed time in the timer processing.
A bus 111 is connected to the CPU 101, the ROM 102, the RAM 103, the printer I/F control unit 104, the NVRAM 105, the panel control unit 106, the network I/F control unit 107, the HDD 108, and the timer 112. The bus 111 is a system bus for transferring control signals and data signals among these units.
The LAN 113 is a communication medium for data communication among a plurality of communication apparatuses. The LAN 113 may be wired or wireless.
Various network applications are present in the protocol stack 201 upper layer. A mail send/receive unit 202 sends/receives mail via the protocol stack 201. To send/receive mail, a protocol such as Post Office Protocol Version 3 (POP3) or Simple Mail Transfer Protocol (SMTP) is used. A print application unit 203 uses, for example, port number 9100 to receive a print request or print data via the protocol stack 201, and controls printing based on the print request or print data. A print application unit 204 uses, for example, port number 515 to receive a print request or print data via the protocol stack 201, and controls printing based on the print request or print data. The port numbers mentioned above are just examples. A user may change the number to any port numbers. A packet analysis unit 205 analyzes the packet data.
The packet analysis unit 205 is located in the application layer. However, packet data can be hooked and acquired inside the protocol stack 201 by using a promiscuous mode at the socket interface with respect to the protocol stack 201. Namely, in parallel with the print application unit 203 acquiring packet data addressed to the print application unit 203 from an external apparatus, the packet analysis unit 205 can also acquire that packet data. Further, packet data addressed to an external apparatus can also be acquired from the print application unit 203 as illustrated by the arrows of the dotted lines in
The packet control unit 301 performs the exchange of data with the protocol stack 201. The user interface unit 302 displays, on the operation panel 109, a settings screen which is used by a user to set the condition for filtering packet data (hereinafter, filtering condition) and the packet data acquiring function to ON/OFF. Further, the user interface unit 302 stores the set values which show the contents of what has been set on the settings screen in the storage device 305.
The filter determination unit 303 reads the filter condition set by a user from the storage device 305, and determines whether the packet data corresponds to the filter condition. If packet data is acquired from the protocol stack 201, the packet control unit 301 passes the TCP/IP-related information of that packet data (hereinafter, “TCP/IP information”) to the filter determination unit 303. Based on this TCP/IP information, the filter determination unit 303 determines whether the packet data corresponds to the filter condition, and communicates the determination result to the packet control unit 301. Although the packet control unit 301 temporarily retains all of the packet data acquired from the protocol stack 201 in a cache, packet data which does not correspond to the filter condition is discarded from the cache. On the other hand, packet data which does correspond to the filter condition is stored in the storage device 305.
Examples of filter conditions which can be specified include destination port number, source port number, destination IP address, and source IP address. How a filter condition is set will be described below.
The packet managing unit 304 performs the editing, sending and saving of the packet data stored in the storage device 305. In the case of editing packet data, the packet managing unit 304 reads packet data from the storage device 305, and edits an attribute value of the packet data to an arbitrary value based on the condition set by the user. The packet managing unit 304 can again store the edited packet data in the storage device 305. Further, in the case of sending packet data, the packet managing unit 304 reads packet data from the storage device 305, and sends the packet data via the packet control unit 301.
Although the client apparatus 1603 does not execute packet acquisition software, it temporarily receives packet data from the client apparatus 1601 due to the fact that it is within the same link as the client apparatus 1601. However, after receiving the packet data, based on a determination that the destination IP address of that packet data is not the client apparatus 1603, the client apparatus 1603 discards the packet data.
For example, the client apparatus 1601 sent a print request to the print apparatus 1600, and a network fault has occurred at the print apparatus 1600. In this case, the packet acquisition apparatus 1602 acquires packet data when the fault occurred, and stores such packet data in its own storage device. In order to ascertain the cause of the fault, the user or network administrator analyzes the packet data stored in the storage device of the packet acquisition apparatus 1602.
As illustrated in
In
If the packet data acquisition function is set to OFF (NO in step S502), in step S503 the packet control unit 301 discards the acquired packet data.
If the packet data acquisition function is set to ON (YES in step S502), the packet control unit 301 passes the packet data TCP/IP information to the filter determination unit 303. Then, the processing proceeds to step S504. In step S504, the filter determination unit 303 determines whether the packet data matches the filter condition by comparing the TCP/IP information with the filter condition. How the filter condition is set will be described below.
If the packet data does not match the filter condition (NO in step S504), in step S503 the packet control unit 301 discards the acquired packet data based on that determination result.
If the packet data does match the filter condition (YES in step S504), in step S505, the packet control unit 301 stores the acquired packet data in the storage device 305 based on that determination result.
Even if the print application unit 203 or 204 sends packet data to an external apparatus via the protocol stack 201, the packet analysis unit 205 acquires the packet data from the protocol stack 201 and executes processing based on
In
In
When a user wishes to confirm the details of a given packet data, the user may select that packet data from the list, and pushes the “Edit/Details” button. Then, the user interface unit 302 displays on the operation panel 109 the details screen which shows the details of the packet data based on the packet data stored in the storage device 305.
If the user pushes the “Start Acquisition” button, the packet data acquisition function is set to “ON”, and if the user pushes the “Finish Acquisition” button, the packet data acquisition function is set to “OFF”.
If a user wishes to send a desired packet data to the network, the user may select that packet data from the packet data list, and push the “Send” button. When a user wishes to edit the data of a desired packet data, he/she may select that packet data from the list of packet data, and push the “Edit/Details” button. Then, the user may edit the packet data in the details screen of the packet data. When the user wishes to delete a particular packet data from the storage device 305, he/she may select that packet data from the list of packet data, and push the “Delete” button. The “Filter Condition Setting” button will be described below.
If the user selects the desired packet data and pushes the “Local Loopback Address” button on a screen like that illustrated in
It will now be assumed, for example, that a fault occurred when the communication apparatus 100 received the No. 2 packet data of the screen illustrated in
In
If the destination IP address does not match the IP address of the communication apparatus 100 (NO in step S802), the processing proceeds to the below-described step S805.
If the destination IP address does match the IP address of the communication apparatus 100 (YES in step S802), in step S803, the packet managing unit 304 acquires the local loopback address in the communication apparatus 100 from the NVRAM 105. The local loopback address is a special address defining itself. For IPv4, it is defined as “127.0.0.1-127.255.255.254”, and for IPv6, defined as “::1”.
Once the local loopback address is acquired, in step S804, the packet managing unit 304 converts the destination IP address of the read packet data into the acquired local loopback address. In addition, the packet managing unit 304 stores the converted packet data in the storage device 305.
Subsequently, in step S805, the packet managing unit 304 determines whether all of the packet data selected by the user have been read from the storage device 305. If all of the packet data have been read from the storage device 305 (YES in step S805), the processing based on
It will now be assumed that the IP address of the communication apparatus 100 is “192.168.0.6”, and that the local loopback addresses of the communication apparatus 100 are “127.0.0.1” and “::1”. Further, it will be assumed that the No. 3 packet data has been selected by the user. If the packet managing unit 304 ascertains the “Version” of the No. 3 packet data, since “Version” is set to 4, the packet managing unit 304 determines that the packet data is IPv4 packet data. Thus, the packet managing unit 304 changes the destination IP address “192.168.0.6” of the No. 3 packet data to “127.0.0.1”.
If the packet managing unit 304 ascertains that the “Version” of the packet data is set to 6, the packet managing unit 304 determines that the packet data is IPv6 packet data. Thus, the packet managing unit 304 changes the destination IP address of the packet data to “::1”.
How the filter condition is set will now be described. When a user wishes to set the filter condition, the user pushes the “Set Filter Condition” button on the screen illustrated in
One example of the filter attributes constituting the filter condition is: “destination port number”, “source port number”, “destination IP address”, “source IP address”, “print data format”, and “print copies”. Each of these filter attributes can be set to “ANY”, which is an arbitrary value. “ANY” denotes that any port numbers, IP addresses, or print data format is accepted.
If a user wishes to set an arbitrary value, the user can set the destination port number to “9100” and the destination IP address to “192.168.0.6”, for example. In the example of
In the example of
“Print Data Format” and “Print Copies” are filter attributes which have a meaning with respect to the print protocol packet data. “Print Data Format” specifies the format of the print data relating to the packet data which should be filtered. In the example of
The filter attributes may be different to those illustrated in
If the No. 3 packet data in
The advanced settings of the discard mode can be set, for example, at the settings screen of
Once the received data is received from the protocol stack 201, in step S1301, the print application unit 203 determines whether the destination IP address of the received data is the local loopback address. This determination is performed based on notification from the protocol stack 201.
If the destination IP address is not the local loopback address (NO in step S1301), in step S1302 the print application unit 203 performs print processing as normal. In normal print processing, the print application unit 203 analyzes the received data and passes the received data to an image data conversion unit. At the image data conversion unit, the received data is converted into image data in a printable format, and the image data is transferred to an image data input unit. The image data input unit inputs image data into the printer unit 110. The printer unit 110 prints an image based on the image data.
If the destination IP address is the local loopback address (YES in step S1301), in step S1303, the print application unit 203 determines whether the discard mode is set to ON or OFF. This determination is performed by reading the settings value stored in the NVRAM 105, and basing the determination on that settings value.
If the discard mode is set to OFF (NO in step S1303), in step S1302, the print application unit 203 performs print processing as normal. On the other hand, if the discard mode is set to ON (YES in step 1303), in step S1304, the print application unit 203 determines which layer is to be discarded. This determination is performed by reading the settings values stored in the NVRAM 105, and basing the determination on that settings value.
If the layer to be discarded is the print application layer (PRINT APPLICATION LAYER in step S1304), in step S1305, the print application unit 203 performs the discard setting on itself. In addition, in step S1306, the print application unit 203 discards the received data before analyzing the received data and passing on the received data to the image data conversion unit. For example, if in step S1306, a print error occurs, the print application unit 203 infers that the cause of the error lies in the section analyzing the received data.
If the layer to be discarded is the layer which converts the image data (IMAGE DATA CONVERSION LAYER in step S1304), in step S1307, the print application unit 203 transmits the discard order to the image data conversion unit, and performs the discard setting on the image data conversion unit. In addition, in step S1308, the print application unit 203 analyzes the received data and passes the received data on to the image data conversion unit. At the image data conversion unit, the received data is converted into a printable format by the printer unit 110. However, the image data conversion unit discards the image data before transferring the image data to the image data input unit. For example, if in step S1308, a print error occurs, the print application unit 203 infers that the cause of the error lies in the section analyzing the received data or in the image data conversion unit.
If the layer to be discarded is the layer in which image data is input into the printer unit 110 (IMAGE DATA INPUT LAYER in step S1304), in step S1309, the print application unit 203 transmits the discard order to the image data input unit, and performs the discard setting on the image data input unit. In addition, in step S1310, the print application unit 203 analyzes the received data and passes the received data on to the image data conversion unit. At the image data conversion unit, the received data is converted into a printable format by the printer unit 110, and the image data is transferred to the image data input unit. The image data input unit discards the image data before transferring the image data to the printer unit 110. For example, if in step S1310, a print error occurs, the print application unit 203 infers that the cause of the error lies in the section analyzing the received data, in the image data conversion unit, or in the image data input unit.
Further, if a print error only occurs in step S1302, it is inferred that the cause of the error lies in the printer unit 110, meaning that the cause of the error can be narrowed down to a hardware problem.
Further, even if the image data conversion unit or the image data input unit is a part of the print application unit 203, these units may be different software or hardware from the print application unit 203.
Thus, by providing a discard mode, not only can unnecessary printing be reduced, but the possible location of the cause of an error can be narrowed down.
Below, an example other than packet data relating to the print request will be described.
In the above description, the address of the packet data is explained as an IP address. However, the address is not limited to an IP address, and may be derived from some other protocol having an address indicating itself.
The present invention can also be achieved by directly or remotely supplying to a system or an apparatus a software program for realizing the function of the above-described exemplary embodiment, and having a computer of that system or apparatus read and execute the supplied program. In this case, the mode does not have to be a program, so long as it has the function of a program.
Therefore, to realize the functional processing of the present invention with a computer, the program code itself which is to be installed in the computer also realizes the present invention. Namely, the computer program for realizing the functional processing of the present invention is itself also included in the present invention. In this case, the mode of the program is not limited so long as it has the function of a program, and may be an object code, a program executed by an interpreter, script data supplied to the OS, and the like.
Various recording media can be used for supplying the program. Examples thereof include a floppy disk, a hard disk, an optical disk, a magneto optical disk (MO), a compact disc recordable (CD-R), a CD-rewritable (CD-RW), a magnetic tape, a non-volatile memory card, a ROM, a digital versatile disk (DVD) (DVD-ROM, DVD-R), and the like.
In addition, an example of a method for supplying the program is to use the browser of a client computer to connect to an Internet homepage, and download from the homepage onto a recording medium such as a hard disk and the like. In such a case, what is downloaded may be the computer program itself according to the exemplary embodiments of the present invention, or a compressed file containing an automatic installation function.
Further, the present invention can also be realized by dividing the program code constituting the program according to the exemplary embodiments of the present invention into a plurality of files, and downloading each of those files from different homepages. Namely, a WWW server which allows a plurality of users to download the program files for realizing the functional processing according to the exemplary embodiments of the present invention by a computer is also included in the present invention.
Further, the present invention may be a mode wherein the program according to the exemplary embodiment of the present invention is encrypted, stored on a recording medium such as a CD-ROM, and distributed to a user. In such a case, a user satisfying certain conditions is allowed to download key information for unlocking the encryption from a homepage via the Internet, so that by using that key information the encrypted program is installed on a computer in an executable format.
Further, the present invention can also be realized in a mode other than those in which the function of the above-described exemplary embodiment is realized, by having a computer execute a read program. For example, based on an instruction from that program, the OS or the like running on the computer performs part or all of the actual processing, and from that processing the function of the above-described exemplary embodiment can be realized.
In addition, the present invention may be configured so that a program read from a recording medium is read into a memory which is provided on a function expansion board inserted into the computer or a function expansion unit connected to the computer. In such a case, subsequently, based on an instruction from the program, a CPU (or the like) provided on the function expansion board or function expansion unit performs part or all of the actual processing. As such, the processing of the function of the above-described exemplary embodiment is realized.
While the present invention has been described with reference to the exemplary embodiments, it is to be understood that the invention is not limited to the disclosed exemplary embodiments. The scope of the following claims is to be accorded the broadest interpretation so as to encompass all modifications, equivalent structures, and functions.
This application claims priority from Japanese Patent Application No. 2007-161430 filed Jun. 19, 2007, which is hereby incorporated by reference herein in its entirety.
Number | Date | Country | Kind |
---|---|---|---|
2007-161430 | Jun 2007 | JP | national |