Communication apparatus, communication system, information processing method, and storage medium

A communication apparatus includes a designation unit configured to designate a connection-destination communication apparatus, a determination unit configured to determine, based on whether identification information about the connection-destination communication apparatus designated by the designation unit is registered, whether to skip protocol switching processing for switching from a first communication protocol to a second communication protocol, and an execution unit configured to execute the protocol switching processing to switch from the first communication protocol to the second communication protocol in a case where the determination unit determines not to skip the protocol switching processing.

BACKGROUND

Technical Field

The present disclosure relates to a communication apparatus, a communication system, an information processing method, and a storage medium.

Description of the Related Art

As a result of the reduction in device size and widespread use of wireless local area networks (LAN), various types of devices are connected to networks today. Further, it has become common to connect a device to another device, a device to a server, and a device to a cloud.

In such a circumstance, there are cases where a device carried by a user is disconnected from a network when the device is carried out of a wireless LAN area, and cases where a device is disconnected from a network when, for example, the mode of the device is changed or the power of the device is turned off.

In such cases, there arises a problem that processing to be performed at the start of communication needs to be executed every time. Japanese Patent Application Laid-Open No. 2004-363993 discusses a method in which service information is acquired through a previous negotiation procedure to skip a negotiation procedure.

However, in a communication apparatus or the like that switches a protocol to use at the time of the start of communication, processing to exchange protocol setting information needs to be executed again to reconnect, etc. This causes a problem that it takes time to establish a connection.

SUMMARY

According to an aspect of the present invention, a communication apparatus includes a designation unit configured to designate a connection-destination communication apparatus, a determination unit configured to determine, based on whether identification information about the connection-destination communication apparatus designated by the designation unit is registered, whether to skip protocol switching processing for switching from a first communication protocol to a second communication protocol, an execution unit configured to execute the protocol switching processing to switch from the first communication protocol to the second communication protocol in a case where the determination unit determines not to skip the protocol switching processing, and a transmission unit configured to transmit, in a case where the determination unit determines to skip the protocol switching processing, a connection start request based on the second communication protocol to the connection-destination communication apparatus without executing the protocol switching processing, or transmit, in a case where the determination unit determines not to skip the protocol switching processing, the connection start request based on the second communication protocol to the connection-destination communication apparatus after the protocol switching processing is executed.

DESCRIPTION OF THE EMBODIMENTS

Various exemplary embodiments will be described below with reference to the drawings.

FIG. 1is a diagram illustrating an example of a system configuration of a communication system.

In the communication system, a communication apparatus101and a server102are communicably connected to each other via a network100. The network100according to a first exemplary embodiment may be a combination of the Internet, a wide area network (WAN), a local area network (LAN), and the like.

The communication apparatus101performs the Hypertext Transfer Protocol version 1.1 (HTTP/1.1) communication and the Hypertext Transfer Protocol version 2 (HTTP/2) communication with the server102via the network100. Examples of the communication apparatus101include a digital camera, etc. The examples, however, are not intended to limit the scope of the present exemplary embodiment. The communication apparatus101is an example of a connection request source communication apparatus and a first communication apparatus. Further, the server102is an example of a connection destination communication apparatus and a second communication apparatus.

FIGS. 2A and 2Bare diagrams each illustrating an example of a hardware configuration of the communication apparatus, etc.

More specifically,FIG. 2Aillustrates an example of a hardware configuration of the communication apparatus101.FIG. 2Billustrates an example of a hardware configuration of the server102.

As illustrated inFIG. 2A, the communication apparatus101includes, as hardware components, a central processing unit (CPU)10, a memory11, a hard disk (HD)12, a network control device13, an operation display device14, and an image capturing device15. The hardware components are connected to one another via a bus16.

The CPU10is a control unit configured to control the entire communication apparatus101. The CPU10executes processing based on a program stored in the memory11, the HD12, and the like to realize a software configuration of the communication apparatus101and processing in a flow chart to be performed by the communication apparatus101, which will be described below. The memory11stores a boot program, predetermined data used in execution of processing by the CPU10, and the like. The HD12stores a program, data used in execution of processing by the CPU10, image data, and the like. The network control device13connects the communication apparatus101to the network100to control communication with other devices via the network100based on the control by the CPU10. The operation display device14displays image data and the like, receives user an operation, and notifies the CPU10of operation information about the received operation, based on the control by the CPU10. The image capturing device15controls the image capturing based on the control by the CPU10. The hardware configuration illustrated inFIG. 2Ais an example of a case where the communication apparatus101is a digital camera.

Further, as illustrated inFIG. 2B, the server102includes, as hardware components, a CPU20, a memory21, a HD22, a network control device23, a display device24, and an input device25. The hardware components are connected to one another via a bus26.

The CPU20is a control unit configured to control the entire server102. The CPU20executes processing based on a program stored in the memory21, the HD22, or the like to realize a software configuration of the server102and processing in a flow chart to be performed by the server102, which will be described below. The memory21stores a boot program, predetermined data used in execution of processing by the CPU20, or the like. The HD22stores a program, data used in execution of processing by the CPU20, or the like. The network control device23connects the server102to the network100to control communication with other devices via the network100based on the control by the CPU20. The display device24displays data based on the control by the CPU20. The input device25receives a user operation, and notifies the CPU20of operation information about the received operation.

FIG. 3is a block diagram illustrating an example of a software configuration of the communication apparatus101.

A communication unit201performs the Transmission Control Protocol over the Internet Protocol (TCP/IP) processing and transport layer security (TLS) processing.

A display unit202performs the display of connection completion and connection error. The display unit202performs the display using the operation display device14. While the communication apparatus101may display the connection completion and connection error, it is not limited thereto, and event information may be notified to the user by use of sound, vibration, or the like.

A data storage unit203stores and manages setting information (refer toFIG. 8described below) associated with an identifier of a server in the HD12, or the like. While a description is given in the present exemplary embodiment assuming that information illustrated inFIG. 8is stored in the communication apparatus101. However, it is not limited thereto, and the communication apparatus101may refer to and use information registered on other apparatuses connected via a network. The identifier of the server is an example of identification information for identifying a communication apparatus (server) which is a connection destination.

A setting unit204sets communication parameters based on the setting information stored in the data storage unit203.

A determination unit205determines whether to set the stored setting information based on a designated identifier. Further, the determination unit205determines whether the communication is of a security communication and also determines whether a setting phase can be skipped.

A communication procedure switching unit206switches between HTTP/1.1 communication and HTTP/2 communication.

A communication procedure skipping unit207skips a handshake and a setting procedure to be performed at the start of communication.

A selection unit208selects a protocol from HTTP/1.1 and HTTP/2.

An input unit209inputs an identifier such as a universal resource identifier (URI), an Internet protocol (IP) address and a port number, a session identifier (ID). The input unit209may input an identifier according to a user operation performed via a user interface (UI) displayed on the operation display device14, or the like or may input an identifier acquired from another apparatus by use of near field communication (NFC), Bluetooth (registered trademark), or the like. Further, the input unit209may receive an identifier stored in an application or the like of the communication apparatus101from the application or the like and input the received identifier.

While in the present exemplary embodiment, description is given assuming that HTTP/1.1 and HTTP/2 are used as examples of protocols, they are not limited thereto, and SPDY or Quick User Datagram Protocol Internet Connections (QUIC) may also be used. Further, other different protocols may be switched therebetween. HTTP/1.1 is an example of a first communication protocol. HTTP/2 is an example of a second communication protocol.

FIG. 4is a block diagram illustrating an example of a software configuration of the server102.

A communication unit801performs TCP/IP processing and TLS processing.

A responding unit802transmits a reception message in response to a communication switching. In a case where the communication switching method is the client connection preface, the responding unit802transmits HTTP200OK. Further, in a case where the communication switching method is the HTTP/1.1 Upgrade header, the responding unit802transmits HTTP101Switching Protocols. In a case where the communication switching method is a Client Hello with the TLS application-layer protocol negotiation (ALPN) extension (TLS-ALPN) field, the responding unit802transmits Server Hello with TLS-ALPN.

A data storage unit803stores and manages setting information associated with the identifier in the HD22, or the like. While, in the present exemplary embodiment, a description is given assuming that the setting information and the like are stored in the server102. However, it is not limited thereto, and the server102may refer to and use information registered on other apparatuses connected via a network.

A setting unit804sets communication parameters based on the setting information stored in the data storage unit803.

A determination unit805determines whether to set the held setting information based on a designated identifier. Further, the determination unit805determines whether the communication is of the security communication, and also determines whether a setting phase can be skipped.

A communication procedure switching unit806switches a communication method between HTTP/1.1 communication and HTTP/2 communication.

A communication procedure skipping unit807skips a handshake and a setting procedure to be performed at the start of communication.

A selection unit808selects a protocol from HTTP/1.1 and HTTP/2.

An input unit809inputs an identifier such as a URI, an IP address and a port number, a Session-ID. The input unit809may input an identifier according to a user operation performed via a UI displayed on the input device25, or the like, or may input an identifier acquired from another apparatus by use of NFC, Bluetooth, or the like. Further, the input unit809may receive an identifier stored in an application or the like therefrom and input the received identifier.

FIG. 5is a flow chart illustrating an example of information processing to be performed when the communication apparatus101starts communication with the server102.

In step S301, the input unit209receives an identifier from a user or an application and inputs the received identifier, and the processing proceeds to step S302. The identifier herein refers to a URI, an IP address and a port number, a Session-ID, or any other information for identifying the server102that is a communication partner.

In step S302, the determination unit205determines whether to skip processing such as handshaking, setting, and the like in communication processing based on the input identifier. The determination unit205checks whether the designated identifier is included in a table as illustrated inFIG. 8, and if the designated identifier is included, the determination unit205determines to skip the processing (YES in step S302), and the processing proceeds to step S303. On the other hand, if the designated identifier is not included in the table, the determination unit205determines not to skip the processing (NO in step S302), and the processing proceeds to step S312.

In step S303, the determination unit205checks whether the communication is of the security communication. In the present exemplary embodiment, whether the communication is of the security communication is preset associated with the identifier. However, it is not limited thereto, and the determination unit205may determine that the communication is of the security communication in a case where, for example, use of TLS is explicitly specified. In addition to an identifier, information indicating whether to perform TLS communication may be set associated with the identifier or included in the identifier. In the present exemplary embodiment, the term “security communication” refers to TLS and does not include security communication of other layers (e.g., Internet Protocol Security (IPsec), wireless encryption). If the determination unit205determines that the communication is of the security communication (YES in step S303), the processing proceeds to step S305. On the other hand, if the determination unit205determines that the communication is not of the security communication (NO in step S303), the processing proceeds to step S304.

In step S304, the communication unit201starts a TCP connection to the server102, and the processing proceeds to step S306.

On the other hand, in step S305, the communication unit201starts a TLS connection to the server102, and the processing proceeds to step S306.

In step S306, the communication procedure skipping unit207transmits a client connection preface to the server102to start HTTP/2 communication. The communication procedure skipping unit207has skipped a communication procedure for upgrading HTTP/1.1 to HTTP/2. The client connection preface is an example of a connection start request according to the second communication protocol.

In step S307, the determination unit205determines whether a message indicating the completion of reception of the client connection preface (e.g., HTTP200OK) is received from the server102. If the determination unit205determines that a message indicating the completion of reception is received (YES in step S307), the processing proceeds to step S310. HTTP200OK is an example of a connection start response. On the other hand, if the determination unit205determines that a reception error message (e.g., Internal Server Error, HTTP Bad Request) is received (NO in step S307), the processing proceeds to step S308.

In step S308, the determination unit205determines whether a function to allow protocol switching during the communication is included. If the determination unit205determines that the function to allow protocol switching during the communication is included (YES in step S308), the processing proceeds to step S309. On the other hand, if the determination unit205determines that the function to allow protocol switching during the communication is not included (NO in step S308), the processing proceeds to step S316.

In step S309, the determination unit205disconnects the TCP or TLS connection, and then the processing proceeds to step S312.

In step S310, the setting unit204applies the setting information illustrated inFIG. 8, and the processing proceeds to step S311.

In step S311, the communication procedure skipping unit207skips a communication information setting phase that uses SETTINGS frames, and then the processing illustrated inFIG. 5is ended.

In step S312, the determination unit205checks whether the communication is of the security communication. If the determination unit205determines that the communication is of the security communication (YES in step S312), the processing proceeds to step S313. On the other hand, if the determination unit205determines that the communication is not of the security communication (NO in step S312), the processing proceeds to step S315.

In step S313, the communication unit201starts a TLS connection to the server102, and the processing proceeds to step S314.

In step S314, the communication procedure switching unit206transmits to the server102a protocol upgrade request using the TLS-ALPN field of a Client Hello message, and the processing proceeds to step S317.

In the case where the processing has proceeded to step S317from step S314, in step S317, the communication procedure switching unit206analyzes a message contained in the ALPN field of a Server Hello message received from the server102and determines whether the protocol upgrade is successfully completed.

In step S315, the communication unit201starts a TCP connection to the server102, and the processing proceeds to step S316.

In step S316, the communication procedure switching unit206transmits to the server102a protocol upgrade request using the HTTP Upgrade header, and the processing proceeds to step S317.

In the case where the processing has proceeded to step S317from step S316, in step S317, the communication procedure switching unit206analyzes a Switching Protocols response received from the server102and determines whether the protocol upgrade is successfully completed.

In step S317, if the communication procedure switching unit206determines that the protocol upgrade is successfully completed and a HTTP/2 connection can be established (YES in step S317), the processing proceeds to step S318. On the other hand, if the communication procedure switching unit206determines that the protocol upgrade is not successfully completed and a HTTP/2 connection cannot be established (NO in step S317), the processing proceeds to step S321.

The processing performed in step S317is an example of communication possibility determination processing.

In step S318, the communication procedure switching unit206transmits a client connection preface according to the HTTP/2 communication procedure, and the processing proceeds to step S319.

In step S319, the communication procedure switching unit206acquires the setting information by exchange of SETTINGS frames, and the processing proceeds to step S320. The setting information to be acquired by exchange of SETTINGS frames is, for example, the header table size, information indicating whether server push is enabled/disabled, the maximum number of streams, the initial window size, information indicating whether data compression is enabled/disabled.

In step S320, the data storage unit203associates the exchanged setting information with the identifier of the server102and stores the setting information associated with the identifier thereof, and then the processing illustrated inFIG. 5is ended.

In step S321, the communication unit201starts HTTP/1.1 communication, and the processing proceeds to step S322.

In step S322, the data storage unit203associates, with the identifier of the server102, information indicating that the server102is compatible only with HTTP/1.1 connections, and stores the information associated with the identifier of the server102. Then, the process illustrated inFIG. 5is ended.

FIG. 6is a sequence diagram illustrating an example of information processing to be performed in the case where the communication setting between the communication apparatus101and the server102is skipped.

In the present exemplary embodiment, the communication apparatus101determines to skip the setting between the communication apparatus101and the server102depending on the designated identifier. The communication apparatus101and the server102perform TLS security communication (YES in step S302or S303inFIG. 5). The communication apparatus101acquires the identifier (session-ID) designated by the application of the communication apparatus101. Then, the communication apparatus101searches the table illustrated inFIG. 8by use of the identifier as a key, determines whether setting information is included, and if setting information corresponding to the identifier is included, the communication apparatus101uses the setting information.

In step M401, the communication apparatus101transmits a Client Hello to the server102(step S305inFIG. 5).

In step M402, the server102transmits Server Hello to the communication apparatus101(step S305inFIG. 5).

While the protocol upgrade designated in the ALPN field is omitted in steps M401and M402in the present exemplary embodiment, it is not limited thereto, and the protocol upgrade may be described without omission.

The communication apparatus101determines to start HTTP/2 communication.

In step M403, the communication apparatus101transmits a client connection preface to the server102. If the server102determines to start HTTP/2 communication, in step M404, the server102transmits HTTP200OK to the communication apparatus101.

Then, the communication apparatus101and the server102apply past setting information and star HTTP/2 communication.

In the present exemplary embodiment, the setting information refers to, for example, the header table size, information indicating whether server push is enabled/disabled, the maximum number of streams, the initial window size, information indicating whether data compression is enabled/disabled, and the header compression dictionary. The communication apparatus101and the server102may use a dictionary preset as a header compression dictionary or a dictionary added and/or updated by a procedure performed after the start of the communication. Further, while in the present exemplary embodiment, the description has been given assuming that the communication apparatus101and the server102apply past setting information, it is not limited thereto. For example, each of the communication apparatus101and the server102may download predetermined setting information stored in a database on other apparatuses and apply the downloaded setting information.

FIG. 7is a flow chart illustrating an example of information processing to be performed when the server102starts communication with the communication apparatus101.

In step S501, the communication unit801performs a TCP or TLS connection to the communication apparatus101, and the processing proceeds to step S502.

In step S502, the determination unit805determines whether a client connection preface is received from the communication apparatus101. If the determination unit805determines that a client connection preface is received (YES in step S502), the processing proceeds to step S503. On the other hand, if the determination unit805determines that no client connection preface is received (NO in step S502), the processing proceeds to step S507.

In step S503, the determination unit805performs the following determination based on whether an entry corresponding to the identifier (e.g., IP address and port number, URI, and session-ID) of the communication apparatus101exists in the data storage unit803. More specifically, the determination unit805determines whether the communication apparatus101is a communication partner that the communication processing setting can be skipped thereto based on whether the entry exists. While the determination unit805determines whether the entry is stored in the data storage unit803in the present exemplary embodiment, it is not limited thereto, and the determination unit805may check whether the entry is stored in a database on other apparatuses connected via a network. If the entry exists, the determination unit805determines that the setting can be skipped (YES in step S503), and the processing proceeds to step S504. On the other hand, if the entry does not exist, the determination unit805determines that the setting cannot be skipped (NO in step S503), and the processing proceeds to step S516.

In step S504, the setting unit804applies the setting information based on the entry stored in the data storage unit803, and the processing proceeds to step S505. While, in the present exemplary embodiment, a description is given assuming that the setting unit804applies the past setting information, it is not limited thereto, and predetermined setting information stored in a database on other apparatuses may be downloaded and applied.

In step S505, the communication procedure skipping unit807skips the communication information setting phase that uses SETTINGS frames, and the processing proceeds to step S506. While, in the present exemplary embodiment, the description has been given assuming that the communication procedure skipping unit807skips the entire setting phase, it is not limited thereto, and it is also possible to skip only a predetermined part of the setting phase.

In step S506, the responding unit802returns an HTTP200OK response indicating the reception of the client connection preface to the communication apparatus101, and then the processing illustrated inFIG. 7is ended.

In step S516, if the client is a communication partner that the setting cannot be skipped, the responding unit802returns an error message (Invalid method) to the communication apparatus101, and the processing proceeds to step S507. On the other hand, in step S516, if the entry does not exist because the server102is turned on/off or the like, the responding unit802transmits an error message (Internal server error) to the communication apparatus101, and the processing proceeds to step S507.

In step S507, the determination unit805determines whether a protocol upgrade request is received. If the determination unit805determines that a protocol upgrade request is received (YES in step S507), the processing proceeds to step S508. On the other hand, if the determination unit805determines that no protocol upgrade request is received (NO in step S507), the processing proceeds to step S515.

In step S508, the communication procedure switching unit806checks the protocol upgrade method. The communication procedure switching unit806determines the protocol upgrade method based on the contents or the like received from the communication apparatus101. If the communication procedure switching unit806determines that the protocol upgrade using a Client Hello with the TLS-ALPN field is to be performed (Client Hello ALPN in step S508), the processing proceeds to step S509. On the other hand, if the communication procedure switching unit806determines that the protocol upgrade method is a switching using the HTTP/1.1 Upgrade header (Protocol Upgrade Header in step S508), the processing proceeds to step S511.

In step S509, the communication procedure switching unit806receives from the communication apparatus101a protocol upgrade request using the TLS-ALPN field of a Client Hello message, and the processing proceeds to step S510.

In step S510, the responding unit802returns a Server Hello with the TLS-ALPN field acknowledging the reception of the protocol upgrade to the communication apparatus101, and the processing proceeds to step S513.

In step S511, the communication procedure switching unit806receives the HTTP/1.1 Upgrade header from the communication apparatus101, and the processing proceeds to step S512.

In step S512, the responding unit802returns HTTP101Switching Protocols acknowledging the reception of the protocol upgrade to the communication apparatus101, and the processing proceeds to step S513.

In step S513, the communication unit201exchanges SETTINGS frames to receive communication setting information, and the processing proceeds to step S514.

In step S514, the data storage unit803stores the exchanged setting information, and the processing illustrated inFIG. 7is ended.

In step S515, on the other hand, the communication unit201continues the HTTP/1.1 communication, and the processing illustrated inFIG. 7is ended.

The setting information in the communication apparatus101and the server102may be updated according to the exchange of SETTINGS frames or addition of a dictionary after the initial setting. In this way, the communication apparatus101and the server102can share the same setting information. Further, the communication apparatus101or the server102may upload the setting information to another apparatus, and at the time of reconnection, the communication apparatus101and the server102may download and use the uploaded setting information. In this way, the communication apparatus101and the server102are no longer required to store the entry, so that the use of the resource can be reduced.

FIG. 8is a table illustrating the entry of the setting information of the communication apparatus101.

In the present exemplary embodiment, the server identifier refers to a session-ID, an IP address and a port number, a URI, or the like. However, it is not limited thereto, and any other identifier with which the communication partner can uniquely be identified, for example, a Session Initiation Protocol (SIP) URI can be used.

Examples of the setting information include the header table size, information indicating whether server push is enabled/disabled, the maximum number of streams, the initial window size, information indicating whether data compression is enabled/disabled, the header compression dictionary, information indicating whether cipher communication is enabled/disabled. While, In the present exemplary embodiment, the description has been given assuming that only the information exchanged using SETTINGS frames is stored as the setting information, it is not limited thereto, and setting information of another layer or the like may also be used. Examples include the size of the maximum transmission unit (MTU), the TCP window size, application protocol information, and application setting information.

Although not described for the purpose of simplification of description, an entry similar to that illustrated inFIG. 8is also stored in the server102. In this case, the portion indicating the identifier of the server indicates the identifier of the communication apparatus101. The identifier of the communication apparatus101is an example of the identification information of the communication apparatus which is the connection request source.

FIG. 9is a sequence diagram illustrating an example of information processing to be performed in a case where the communication apparatus101and the server102switch a communication method to HTTP/2 communication during the HTTP/1.1 communication.

In step M701, the communication apparatus101performs a TCP connection to the server102to start HTTP/1.1 communication.

In step M702, the server102receives the TCP connection from the communication apparatus101to start HTTP/1.1 communication.

The communication apparatus101has been using HTTP/1.1 but switches the communication method to HTTP/2 communication according to the determination by the application.

In step M703, the communication apparatus101transmits a HTTP/1.1 Upgrade header to the server102to upgrade the protocol to HTTP/2.

In step M704, when the server102receives the protocol upgrade from the communication apparatus101, the server102returns HTTP101Switching Protocols.

In steps M703and M704, the communication apparatus101and the server102determine whether to skip the communication procedure, and if the communication apparatus101and the server102determine to skip the communication procedure, then in step M705, the communication apparatus101and the server102apply the setting information and then perform HTTP/2 communication.

As described above, the processing according to the present exemplary embodiment is applicable to the protocol upgrade during the communication. In the case of HTTP/1.1 and HTTP/2, it is not possible to return the communication method to HTTP/1.1, but in a case where the protocol can be downgraded (changed), the processing for protocol switching processing can be reduced, so that waiting time can be reduced.

Further, if optimum parameters may be preset between the communication apparatus101and the server102or provided on a database for the setting information, the complicated setting processing at the start of the protocol can be reduced. For example, in a case where the communication apparatus101and the server102are embedded devices such as a camera, connection and disconnection of communication occur frequently. At that time, the above-described advantage according to the present exemplary embodiment can be expected, because the number of times the communication procedure and the parameter setting processing are performed between the communication apparatus101and the server102increases.

Other Exemplary Embodiment

An exemplary embodiment of the present invention can also be realized by processing in which a program realizing one or more functions of the above-described exemplary embodiment is supplied to a system or apparatus via a network or a storage medium, and one or more processors included in the system or the apparatus read and execute the program. Further, an exemplary embodiment of the present invention can also be realized by a circuit (e.g., application-specific integrated circuit (ASIC)) realizing one or more functions.

According to any of the above-described exemplary embodiments, the setting processing to be performed at the time of reconnection to a connection destination to which a device was connected in the past can be reduced. Further, the time until the data transmission start processing begins at the time of reconnection of the device can also be reduced. Furthermore, the time required for communication connection can be reduced.

According to configurations of the exemplary embodiments, the time required for a connection of communication can be reduced.

OTHER EMBODIMENTS

This application claims the benefit of Japanese Patent Application No. 2014-197319, filed Sep. 26, 2014, which is hereby incorporated by reference herein in its entirety.