JP4413121B2 - Data communication apparatus and data communication method using TCP / IP socket - Google Patents

Data communication apparatus and data communication method using TCP / IP socket Download PDF

Info

Publication number
JP4413121B2
JP4413121B2 JP2004292462A JP2004292462A JP4413121B2 JP 4413121 B2 JP4413121 B2 JP 4413121B2 JP 2004292462 A JP2004292462 A JP 2004292462A JP 2004292462 A JP2004292462 A JP 2004292462A JP 4413121 B2 JP4413121 B2 JP 4413121B2
Authority
JP
Japan
Prior art keywords
communication
socket
application
request
tcp
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2004292462A
Other languages
Japanese (ja)
Other versions
JP2006107095A (en
Inventor
伸次 植月
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
SoftBank Corp
Original Assignee
SoftBank Mobile Corp
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 SoftBank Mobile Corp filed Critical SoftBank Mobile Corp
Priority to JP2004292462A priority Critical patent/JP4413121B2/en
Publication of JP2006107095A publication Critical patent/JP2006107095A/en
Application granted granted Critical
Publication of JP4413121B2 publication Critical patent/JP4413121B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Computer And Data Communications (AREA)

Description

本発明は、モバイルコンピューティングのような、通信端末装置のアプリケーションからのアクセスに対してスループットが良好なTCP/IP通信を可能にするデータ通信装置及びデータ通信方法に関する。 The present invention relates to a data communication apparatus and a data communication method that enable TCP / IP communication with good throughput for access from an application of a communication terminal apparatus, such as mobile computing.

近年、コンピュータなどの端末装置間でデータ通信を行なうためのネットワークとしてインターネットが普及している。また、それと共に携帯電話等の無線電話回線等との通信が可能な通信機能を備えた情報処理機器を用いるモバイルコンピューティングやリモートアクセスと呼ばれる利用形態が普及している。また、インターネットに接続される端末装置やルータは、インターネットプロトコル(IP)と呼ばれる経路制御プロトコルを提供するプログラムを有し、IPによって異なるLANに接続された任意の端末装置間のパケット通信を可能にしている。さらに、パケットの消失等のエラーに対処し信頼性を高めるため、トランスミッションコントロールプロトコル(TCP)と呼ばれる通信プロトコルが採用されている。TCP及びIPは、有線のLANに接続された端末装置間におけるデータ通信のみならず、現在はモバイルコンピューティングやリモートアクセスでも一般的に利用されている。 In recent years, the Internet has become widespread as a network for performing data communication between terminal devices such as computers. At the same time, a use form called mobile computing or remote access using an information processing device having a communication function capable of communicating with a wireless telephone line such as a mobile phone has been widespread. In addition, terminal devices and routers connected to the Internet have a program that provides a routing protocol called Internet Protocol (IP), enabling packet communication between arbitrary terminal devices connected to different LANs by IP. ing. Furthermore, in order to cope with errors such as packet loss and improve reliability, a communication protocol called a transmission control protocol (TCP) is adopted. TCP and IP are generally used not only for data communication between terminal devices connected to a wired LAN but also for mobile computing and remote access.

TCP/IPによる通信では一台の端末装置から複数の通信コネクションを設定し、各コネクションを介して複数の通信を同時に行うことが可能である。しかし、データの送信を途切れることなく確実に行うため、あるいは送信エラーが発生した時にエラーとなったパケットを再送するため等の理由により、送信データを一時的に保持するバッファを必要とする。このバッファは設定されたコネクション毎に独立に設定するものであり、通信コネクションの数が増加すると、必要とするバッファメモリの量も増加する。しかし、移動電話機等モバイルコンピューティングに使用される機器は小型化、小電力消費の要求のため、内蔵するメモリの容量も小さくせざるを得ない。そのため、すでに通信コネクションが設定され通信が行われている時、新たに通信コネクションを設定する必要が発生したにもかかわらず、機器搭載のメモリ容量が少なく、新たなコネクション用のバッファとして利用可能なメモリが確保できず、必要とするコネクションが設定できない状況が発生する。 In communication using TCP / IP, a plurality of communication connections can be set from a single terminal device, and a plurality of communications can be simultaneously performed via each connection. However, a buffer that temporarily holds transmission data is required to ensure that data transmission is performed without interruption or to retransmit a packet in error when a transmission error occurs. This buffer is set independently for each set connection, and as the number of communication connections increases, the amount of buffer memory required also increases. However, since devices used for mobile computing such as mobile phones are required to be smaller and consume less power, the capacity of the built-in memory must be reduced. Therefore, when a communication connection has already been set and communication is in progress, the device has a small memory capacity and can be used as a buffer for a new connection, even though a new communication connection needs to be set. A situation occurs in which the memory cannot be secured and the necessary connection cannot be set.

TCP/IP通信におけるソケット管理に関する技術文献には以下の文献が存在する。
特開平7−210485号公報 特開平11−514117号公報 特開2000−165469号公報
The following documents exist as technical documents related to socket management in TCP / IP communication.
Japanese Patent Laid-Open No. 7-210485 Japanese Patent Laid-Open No. 11-514117 JP 2000-165469 A

本発明は、割り当て可能な通信バッファの数以上の通信要求の受付を可能にし、携帯型の通信端末のように、装置内に設定可能な通信バッファの数が限られている装置であっても、効率の良い通信要求の管理が可能な装置と方法に関するものである。
図4はクライアント装置内の第1アプリケーションからサーバ装置内の第2アプリケーションに通信要求を出す場合のシステムコールと、各システムコール間の関連を示すものである。
「socket()」は、アプリケーションのために通信ポートであるソケットの作成をソケット管理層に依頼するシステムコールである。通信を要求するアプリケーションでは通信を要求する時にこのシステムコールをソケット管理層に出力する。クライアントからの通信要求を待つ第2アプリケーションは予め受け付け用のソケットを作成し、システムコール「bind()」により生成したソケットに対してアドレスファミリー、ポート番号を設定しておき、「listen()」「accept()」システムコールを実行することにより待ち受け状態となる。
通信を要求する第1アプリケーションは「socket()」を第1ソケット管理層に出力しソケットの作成を要求する。次に、作成されたソケットを介して第2アプリケーションの待機中のソケットに接続を要求するシステムコール「connect()」を出力する。
コネクションが確立した後、システムコール「read()」, 「write()」によりデータの授受を実行する。データの授受が終了すると、システムコール「close()」によりソケットをクローズする。
The present invention enables reception of communication requests exceeding the number of assignable communication buffers, and even a device with a limited number of communication buffers that can be set in the device, such as a portable communication terminal. The present invention relates to an apparatus and a method capable of efficiently managing communication requests.
FIG. 4 shows a system call when a communication request is issued from the first application in the client device to the second application in the server device, and the relationship between the system calls.
“Socket ()” is a system call that requests the socket management layer to create a socket that is a communication port for an application. An application requesting communication outputs this system call to the socket management layer when requesting communication. The second application that waits for a communication request from the client creates a socket for acceptance in advance, sets the address family and port number for the socket generated by the system call "bind ()", and then "listen ()" A standby state is entered by executing the “accept ()” system call.
The first application requesting communication outputs “socket ()” to the first socket management layer and requests creation of a socket. Next, a system call “connect ()” for requesting connection to the socket waiting for the second application is output via the created socket.
After the connection is established, the system calls “read ()” and “write ()” are used to exchange data. When the data transfer is completed, the socket is closed by the system call “close ()”.

図5乃至図8はTCP/IPプロトコルを用いるデータ通信システムの構成を示す。図5には、クライアント端末装置10、ルータ30、サーバ端末装置20、無線ネットワーク40、及びインターネット50から構成され、端末装置10とルータ30は無線電話回線等の無線ネットワーク40で接続され、ルータ30とサーバ端末装置20はインターネット50で接続されており、各々TCP/IPを用いて通信するデータ通信システムが示されている。 5 to 8 show the configuration of a data communication system using the TCP / IP protocol. 5 includes a client terminal device 10, a router 30, a server terminal device 20, a wireless network 40, and the Internet 50. The terminal device 10 and the router 30 are connected by a wireless network 40 such as a wireless telephone line. The server terminal device 20 is connected to the Internet 50, and a data communication system is shown in which each communicates using TCP / IP.

クライアントの端末装置10は、無線ネットワーク40に接続された情報処理装置であり、第1アプリケーション11、第1ソケット管理層12、第1TCP層13、第1IP層14、第1PPP層15、及び第1無線回線アクセス装置16を有している。ルータ30は、無線ネットワーク40に接続された装置及びインターネット50に接続されるイーサネットインタフェースを備えた情報処理装置であり、第2IP層31、第2PPP層32、第2無線回線アクセス装置33、及びイーサネットアクセス装置34を有している。サーバ端末装置20は、インターネット50に接続可能なイーサネットインタフェースを備えた情報処理装置であり、第2アプリケーション21、第2ソケット管理層22、第2TCP層23、第3IP層24、及び第2イーサネットアクセス装置25を有している。 The client terminal device 10 is an information processing device connected to the wireless network 40, and includes a first application 11, a first socket management layer 12, a first TCP layer 13, a first IP layer 14, a first PPP layer 15, and a first application. A wireless line access device 16 is provided. The router 30 is an information processing apparatus including an apparatus connected to the wireless network 40 and an Ethernet interface connected to the Internet 50, and includes a second IP layer 31, a second PPP layer 32, a second wireless line access apparatus 33, and an Ethernet. An access device 34 is provided. The server terminal device 20 is an information processing device including an Ethernet interface that can be connected to the Internet 50, and includes a second application 21, a second socket management layer 22, a second TCP layer 23, a third IP layer 24, and a second Ethernet access. A device 25 is included.

第1アプリケーション11及び第2アプリケーション21はWeb閲覧ソフト、FTP、メール等、相互にデータの授受を行うアプリケーションプログラムである。アプリケーションプログラムから相手に送信するアプリケーションデータは、パケットで伝送可能な所定のデータ量から成る複数のサブデータ、例えば、図6のサブアプリケーションデータに分割され、サブアプリケーションデータ毎に送信先を示すアドレスや制御情報からなる各種ヘッダが付与されて送信される。なお、図6のPPPトレイラはパケットの最後を示すデータである。 The first application 11 and the second application 21 are application programs that exchange data with each other, such as Web browsing software, FTP, and mail. The application data transmitted from the application program to the other party is divided into a plurality of sub-data consisting of a predetermined amount of data that can be transmitted in packets, for example, sub-application data shown in FIG. Various headers consisting of control information are added and transmitted. Note that the PPP trailer in FIG. 6 is data indicating the end of the packet.

第1アプリケーション11は、第2アプリケーション21との間で通信を行う際に、第1ソケット管理層12によって提供されるソケットを通して通信を行う。第1アプリケーション11から第2アプリケーション21にアプリケーションデータを送信する場合、第1アプリケーション11は第1ソケット管理層12にアプリケーションデータを転送すると共にデータ送信要求を行う。また、第1アプリケーション11で第2アプリケーション21から送信されたアプリケーションデータを受信する場合、第1アプリケーション11は第1ソケット管理層12にデータ受信要求を行い、受信したアプリケーションデータを転送させる。 The first application 11 communicates through the socket provided by the first socket management layer 12 when communicating with the second application 21. When transmitting application data from the first application 11 to the second application 21, the first application 11 transfers the application data to the first socket management layer 12 and makes a data transmission request. When the first application 11 receives application data transmitted from the second application 21, the first application 11 makes a data reception request to the first socket management layer 12 to transfer the received application data.

「ソケット」は、自己のIPアドレスとアプリケーションプログラム識別用のポート番号によって特定され、データ通信を実現するコネクションと呼ばれる仮想的な通信路へのアクセスポイントとなる。第1アプリケーション11と第2アプリケーション21間でアプリケーションデータの通信を行う場合、第1アプリケーション11と第2アプリケーション21間にコネクションが開設され、そのコネクションを介してアプリケーションデータが伝送される。また、アプリケーションデータの通信が終了したらコネクションも閉じられる。また、第1ソケット管理層12は、第1アプリケーション11から渡されたアプリケーションデータを、一時的に保持する送信データバッファを有する。 A “socket” is specified by its own IP address and a port number for identifying an application program, and serves as an access point to a virtual communication path called a connection that realizes data communication. When communication of application data is performed between the first application 11 and the second application 21, a connection is established between the first application 11 and the second application 21, and application data is transmitted via the connection. Further, when the application data communication is completed, the connection is also closed. The first socket management layer 12 has a transmission data buffer that temporarily holds application data transferred from the first application 11.

第1ソケット管理層12がソケットとコネクションを対応付けることにより、第1アプリケーション11は通信に用いるコネクションをソケットによって識別する。また、第1ソケット管理層12は第1TCP層13にソケットの識別子を指定してデータの転送を要求する。第1TCP層13はソケット識別子により対応するコネクションを識別する。第1TCP層13及び第2TCP層23はTCPプロトコルの制御部であり、コネクション制御やデータ通信を実現するためのトランスポート層のプロトコル層として機能する。第1TCP層13は、受信したアプリケーションデータを送信された順序に並べ替える順序制御機能と、パケット損失時に再送処理を行うデータ通信保証機能と、第2TCP層23とのフロー制御機能とを有している。 When the first socket management layer 12 associates the socket with the connection, the first application 11 identifies the connection used for communication by the socket. Further, the first socket management layer 12 requests the first TCP layer 13 to transfer data by designating the socket identifier. The first TCP layer 13 identifies the corresponding connection by the socket identifier. The first TCP layer 13 and the second TCP layer 23 are TCP protocol control units and function as a protocol layer of a transport layer for realizing connection control and data communication. The first TCP layer 13 has an order control function for rearranging received application data in the order of transmission, a data communication guarantee function for performing retransmission processing when a packet is lost, and a flow control function for the second TCP layer 23. Yes.

第1TCP層13は、第1ソケット管理層12からアプリケーションデータを受け取ると、TCPセグメントを生成して第1IP層14に渡す。TCPセグメントとは、図6に示すTCPヘッダのみ、あるいはTCPヘッダとアプリケーションデータから構成される。なお、TCPヘッダは図8に示すようにサブアプリケーションデータの先頭に付加される。また、第1TCP層13は、第1IP層14からTCPセグメントを受け取ると、それに含まれるTCPヘッダから対応するコネクションを識別し、TCPプロトコル制御を行なう。 When receiving the application data from the first socket management layer 12, the first TCP layer 13 generates a TCP segment and passes it to the first IP layer 14. The TCP segment includes only the TCP header shown in FIG. 6 or a TCP header and application data. The TCP header is added to the top of the sub application data as shown in FIG. Further, when the first TCP layer 13 receives the TCP segment from the first IP layer 14, the first TCP layer 13 identifies the corresponding connection from the TCP header included therein, and performs TCP protocol control.

第1IP層14、第2IP層31、及び第3IP層24は、IPプロトコル制御を行うネットワーク層プロトコル層である。各IP層は、ネットワークにアクセスし識別するためのIPアドレスが付与されている。また、IP層はIPデータグラムをどのネットワークインタフェースに送出するかを記録した経路テーブルを有している。上位のTCP層からTCPセグメントを受け取るとIPデータグラムを生成し下位の、例えばPPP層に渡す。 The first IP layer 14, the second IP layer 31, and the third IP layer 24 are network layer protocol layers that perform IP protocol control. Each IP layer is given an IP address for accessing and identifying the network. Further, the IP layer has a route table that records which network interface the IP datagram is sent to. When a TCP segment is received from the upper TCP layer, an IP datagram is generated and passed to the lower layer, for example, the PPP layer.

IP層は、下位層からIPデータグラムを受け取ると、そのIPデータグラムに含まれるIPヘッダから自己の端末装置宛てのIPデータグラムであるか否かを判断する。受け取ったIPデータグラムが自己の端末装置宛ての場合は、IPデータグラムからTCPセグメントを取り出し、上位TCP層に渡す。また、IPデータグラムが自己の端末装置宛てでない場合は、経路制御テーブルを参照してIPデータグラムの宛先に対応するネットワークインタフェースに送出する。または破棄もしくはエラーメッセージで応答する。 When receiving the IP datagram from the lower layer, the IP layer determines whether the IP datagram is addressed to its own terminal device from the IP header included in the IP datagram. If the received IP datagram is addressed to its own terminal device, the TCP segment is extracted from the IP datagram and passed to the upper TCP layer. If the IP datagram is not addressed to its own terminal device, it is sent to the network interface corresponding to the destination of the IP datagram with reference to the routing table. Or respond with a discard or error message.

コネクションの機能は、第1TCP層13及び第2TCP層23によって実現され、それより下位の層はIPデータグラムを送信先の装置に転送する機能を有するのみである。TCPでは二つのソケット間にコネクションが設定され、TCPセグメントは各コネクションの二つのソケット間で送受信される。TCPセグメントとコネクションとの対応は、TCPセグメントのTCPヘッダ中の送信元ポート番号部に送信元のソケットのポート番号を格納し、送信先ポート番号部に送信先のソケットのポート番号を格納することで識別する。また、IPヘッダ中の送信元IPアドレス部に送信元のソケットのIPアドレスを格納し、送信先IPアドレス部に送信先のソケットのIPアドレスを格納することで識別する。 The connection function is realized by the first TCP layer 13 and the second TCP layer 23, and the lower layers only have a function of transferring the IP datagram to the destination device. In TCP, a connection is set between two sockets, and a TCP segment is transmitted and received between two sockets of each connection. The correspondence between the TCP segment and the connection is that the port number of the source socket is stored in the source port number part of the TCP header of the TCP segment, and the port number of the destination socket is stored in the destination port number part. Identify with Further, the IP address of the source socket is stored in the source IP address part of the IP header, and the IP address of the destination socket is stored in the destination IP address part.

任意のコネクションの一方のソケットS1のIPアドレスをA1、ポート番号をP1とし、他方のソケットS2のIPアドレスをA2、ポート番号をP2とすると、第1TCP層は、TCPヘッダ中の送信元ポート番号部にP1を格納し、送信先ポート番号部にP2を格納したTCPセグメントを生成する。さらに、IP層は、IPヘッダ中の送信元IPアドレス部にA1を格納し、送信先IPアドレス部にA2を格納したIPデータグラムを生成する。 If the IP address of one socket S1 of an arbitrary connection is A1, the port number is P1, the IP address of the other socket S2 is A2, and the port number is P2, the first TCP layer is the source port number in the TCP header. A TCP segment in which P1 is stored in the part and P2 is stored in the destination port number part is generated. Further, the IP layer generates an IP datagram in which A1 is stored in the source IP address part of the IP header and A2 is stored in the destination IP address part.

データ通信システムのコネクション開設動作が図7に示されている。
サーバである第2アプリケーション21は、第2ソケット管理層22に待ち受けコネクションの生成を要求する。データ通信用のソケット(S2)が生成され、そのソケットに所定のポート番号(P2)を付与され待ち受けソケットとされる。また、第2アプリケーション21自身をソケットS2によるコネクションの待ち受け状態にする。第2ソケット管理層22は、ソケットS2に対する待ち受けコネクションの開設が要求されると、第2TCP層23にその旨を通知する。第2TCP層23はソケットS2をコネクション開設待ちの状態にする。
The connection opening operation of the data communication system is shown in FIG.
The second application 21 as a server requests the second socket management layer 22 to generate a standby connection. A socket (S2) for data communication is generated, and a predetermined port number (P2) is assigned to the socket to be a standby socket. Further, the second application 21 itself is set in a standby state for a connection through the socket S2. When the second socket management layer 22 is requested to open a standby connection for the socket S2, the second socket management layer 22 notifies the second TCP layer 23 to that effect. The second TCP layer 23 places the socket S2 in a state waiting for connection establishment.

クライアントである第1アプリケーション11から第2アプリケーション21にコネクションを開設する場合、第1アプリケーション11は、第1ソケット管理層12に、データ通信用のソケット(S1)を生成し、ソケットS1を通じてサーバ端末装置20のIPアドレス及びポート番号P2を指定しソケットS2へのコネクション開設を要求する。この要求に基づき、第1ソケット管理層12はソケットS1とソケットS2の関係を記録し、第1TCP層13に対してソケットS2へのコネクション開設を要求する。第1TCP層13はソケットS2に対するコネクション開設要求を受け取ると、未使用のポート番号をソケットS1のポート番号に設定する(P1)。さらに、第1TCP層13は、コネクション開設を要求するため、コネクション設定用のTCPセグメントA1を生成し第2TCP層23に渡す。 When a connection is established from the first application 11 that is a client to the second application 21, the first application 11 generates a data communication socket (S1) in the first socket management layer 12, and the server terminal through the socket S1. The IP address of the apparatus 20 and the port number P2 are specified and a connection establishment request to the socket S2 is requested. Based on this request, the first socket management layer 12 records the relationship between the socket S1 and the socket S2, and requests the first TCP layer 13 to open a connection to the socket S2. When receiving the connection establishment request for the socket S2, the first TCP layer 13 sets an unused port number to the port number of the socket S1 (P1). Further, the first TCP layer 13 generates a connection setting TCP segment A1 and sends it to the second TCP layer 23 in order to request connection establishment.

第2TCP層23は、第1TCP層13からコネクション設定用のTCPセグメントA1を受け取ると、TCPセグメントA1に対する確認応答のTCPセグメントA2を生成して第1TCP層13に渡す。第1TCP層13は、TCPセグメントA2に対する確認応答TCPセグメントA3を第2TCP層23に渡す。第2TCP層23は、第1TCP層13からTCPセグメントA3を受け取ると、第1TCP層13との間でコネクションの開設の確認がとれたと判断する。 When the second TCP layer 23 receives the TCP segment A1 for setting a connection from the first TCP layer 13, the second TCP layer 23 generates a TCP segment A2 as an acknowledgment for the TCP segment A1 and passes it to the first TCP layer 13. The first TCP layer 13 passes an acknowledgment TCP segment A3 for the TCP segment A2 to the second TCP layer 23. When the second TCP layer 23 receives the TCP segment A3 from the first TCP layer 13, the second TCP layer 23 determines that the connection establishment with the first TCP layer 13 has been confirmed.

第2TCP層23は、第2ソケット管理層22にそのコネクション端点と共にコネクションの開設の完了を通知する。第2ソケット管理層22は、コネクションの開設が通知されると当該コネクションに対してソケットS2と共に第2アプリケーション21にコネクションの開設の完了を通知する。 The second TCP layer 23 notifies the second socket management layer 22 of the completion of connection establishment together with the connection end point. When the connection establishment is notified, the second socket management layer 22 notifies the connection establishment completion to the second application 21 together with the socket S2 for the connection.

端末装置10のソケットS1とサーバ端末装置20のソケットS2からなるコネクションを通じて第1アプリケーション11から第2アプリケーション21にアプリケーションデータを送信する場合、第1アプリケーション11がソケットS1を通じて第1ソケット管理層12にアプリケーションデータと共にデータ送信要求を渡すと、第1ソケット管理層12はアプリケーションデータをソケットS1に対応する送信データバッファに格納し、第1TCP層13にデータ送信要求を行う。 When the application data is transmitted from the first application 11 to the second application 21 through the connection including the socket S1 of the terminal device 10 and the socket S2 of the server terminal device 20, the first application 11 transmits to the first socket management layer 12 through the socket S1. When the data transmission request is passed together with the application data, the first socket management layer 12 stores the application data in the transmission data buffer corresponding to the socket S1, and makes a data transmission request to the first TCP layer 13.

第1TCP層13は、送信データバッファの先頭からサブアプリケーションデータ(約1500バイト)を切り出し、切り出したサブアプリケーションデータの先頭にTCPヘッダを付加してTCPセグメントを生成し、IP層、PPP層等を介して第2TCP層23に送信する。以上の処理は、送信データバッファの中のアプリケーションデータが無くなるか、送達確認されていないアプリケーションデータのサイズが送信ウィンドウサイズに達するか、第2TCP層23からの受信データバッファの空き容量不足の通知によるフロー制御の実行まで繰り返される。 The first TCP layer 13 cuts out sub application data (about 1500 bytes) from the head of the transmission data buffer, adds a TCP header to the head of the cut out sub application data, generates a TCP segment, and sets the IP layer, PPP layer, etc. To the second TCP layer 23. The above processing is based on the notification that the application data in the transmission data buffer disappears, the size of the application data whose delivery has not been confirmed reaches the transmission window size, or the lack of free space in the reception data buffer from the second TCP layer 23 Repeated until execution of flow control.

第2TCP層23は、TCPセグメントを受信すると、TCPヘッダ中の送信元ポート番号部の値及び送信先ポート番号部の値から対応するコネクションを識別し、受信したアプリケーションデータをソケットS2に対応する受信データとして第2ソケット管理層22に渡す。
第2ソケット管理層22は、受け取ったアプリケーションデータをソケットS2に対応する受信データバッファに格納する。受信データバッファに格納されたアプリケーションデータは、第2ソケット管理層22に対するデータ受信要求を契機に第2アプリケーション21に渡される。
When receiving the TCP segment, the second TCP layer 23 identifies the corresponding connection from the value of the source port number part and the value of the destination port number part in the TCP header, and receives the received application data corresponding to the socket S2. The data is passed to the second socket management layer 22 as data.
The second socket management layer 22 stores the received application data in the reception data buffer corresponding to the socket S2. The application data stored in the reception data buffer is passed to the second application 21 in response to a data reception request to the second socket management layer 22.

図8にコネクションの終了処理のフローが示されている。コネクションの終了処理は、送信元となるCPUからの終了処理要求を契機に実行される。第1ソケット管理層12は、第1アプリケーション11からコネクションの終了要求を受け取ると、第1TCP層13にソケットの識別子と共にコネクションの終了要求を通知する。第1TCP層13は、コネクションの終了要求を受け取ると、そのソケットに対応するコネクションを終了するため、終了フラグを設定したTCPセグメントB1を第2TCP層23に渡す。第2TCP層23はTCPセグメントB1を受け取ると、確認応答のためのTCPセグメントB2を生成し第1TCP層13に渡す。第1TCP層13はTCPセグメントB2を受け取ると、第1アプリケーション11から第2アプリケーション21に対するコネクションの終了動作を完了する。 FIG. 8 shows a flow of connection termination processing. The connection termination process is executed in response to a termination process request from the transmission source CPU. When receiving the connection termination request from the first application 11, the first socket management layer 12 notifies the first TCP layer 13 of the connection termination request together with the socket identifier. When receiving the connection termination request, the first TCP layer 13 passes the TCP segment B1 in which the termination flag is set to the second TCP layer 23 in order to terminate the connection corresponding to the socket. When the second TCP layer 23 receives the TCP segment B 1, the second TCP layer 23 generates a TCP segment B 2 for an acknowledgment and passes it to the first TCP layer 13. Upon receiving the TCP segment B2, the first TCP layer 13 completes the connection termination operation from the first application 11 to the second application 21.

以上のように、アプリケーションがネットワーク上の他の装置に在るアプリケーションと通信する際、通信を希望するアプリケーションはソケット管理層にソケットの作成を要求する。要求を受けたソケット管理層はソケットを作成し、通信用のバッファを確保すると共にTCP層に相手側のTCP層とコネクションを形成することを要求する。通信バッファは1つのコネクションに対して例えば32Kバイト確保される。コネクションが確立されると2つのアプリケーション間でアプリケーションデータの授受が行われる。アプリケーションデータは1500バイト程度のパケットに分割されて順次通信バッファに蓄積さる。TCP層は通信バッファからパケットを1つずつ取り出し、図9に示されるTCPヘッダを付加してIP層に転送する。通信バッファに蓄積され送信されたパケットは、送信先より正常に受信された旨の報告を受けた後破棄される。破棄され空きとなった通信バッファには、アプリケーションデータの次のデータ部分が取り出され格納される。送信先より正常に受信された旨の報告が無かった等、送信に失敗したと判断されると送信に失敗したパケットを再送信する。転送を要求されたアプリケーションデータの全ての送信が完了すると、前記のコネクションは解除され、通信バッファは解放される。 As described above, when an application communicates with an application in another device on the network, the application that desires communication requests the socket management layer to create a socket. Upon receiving the request, the socket management layer creates a socket, secures a communication buffer, and requests the TCP layer to form a connection with the other TCP layer. A communication buffer is secured, for example, 32 Kbytes for one connection. When the connection is established, application data is exchanged between the two applications. Application data is divided into packets of about 1500 bytes and sequentially stored in the communication buffer. The TCP layer extracts packets one by one from the communication buffer, adds the TCP header shown in FIG. 9, and transfers the packets to the IP layer. The packet stored and transmitted in the communication buffer is discarded after receiving a report indicating that the packet has been normally received from the transmission destination. The next data portion of the application data is extracted and stored in the communication buffer which has been discarded and becomes empty. If it is determined that the transmission has failed, for example, there has been no report that the transmission has been normally received from the transmission destination, the packet that has failed to be transmitted is retransmitted. When the transmission of all the application data requested to be transferred is completed, the connection is released and the communication buffer is released.

通信端末装置は、装置の収容筐体の大きさ、電気容量の制限等から、装置内に設けられているメモリの容量に限度があり、コネクション用に確保可能な通信バッファの数にも限りがある。Webの閲覧とメールの送信を同時に行う等、通信装置内で複数の通信が行われている時に、アプリケーションに新たな通信が必要となり、そのアプリケーションがソケット管理層に新たな通信の要求を出すことがある。このような場合、メモリ中に新たな通信の要求のために新たなバッファを確保し得る空き容量が存在しないと、ソケット管理層は通信の要求を出したアプリケーションに、通信は不可能である旨通知し、処理を終了する。通信は不可能である旨の通知を受けた通信端末装置のユーザーは、しばらく待った後再度アプリケーションを実行し通信要求を出すことになる。また、通信を急ぐ時には、通信不可能の通知を受けた後直ちに通信要求を出す行動を採る場合がしばしばある。この様な状況では、通信不可能の通知と通信要求を繰り返することになり、装置に不必要な負担をかけることになる。 The communication terminal device has a limit on the capacity of the memory provided in the device due to the size of the housing housing of the device, restrictions on the electric capacity, etc., and the number of communication buffers that can be secured for connection is also limited. is there. When multiple communications are performed within the communication device, such as simultaneously browsing the Web and sending email, the application requires new communication, and the application issues a new communication request to the socket management layer. There is. In such a case, if there is not enough free space in the memory to secure a new buffer for a new communication request, the socket management layer cannot communicate with the application that issued the communication request. Notify and finish the process. The user of the communication terminal device that has received the notification that communication is not possible waits for a while and then executes the application again and issues a communication request. Further, when urgently communicating, there is often an action of issuing a communication request immediately after receiving a notification that communication is impossible. In such a situation, the notification of communication failure and the communication request are repeated, and an unnecessary burden is placed on the apparatus.

本発明は、確保可能な通信バッファの数が少なく、通信要求が拒否されることによるユーザーの負担増加、或いは無駄な処理の増加を防止することを目的としている。本目的を達成するため、本発明に係るソケット管理層は、装置内に設定可能な通信バッファが全て使用中であり、アプリケーションから出された新たな通信の要求に対して通信バッファが確保できない場合、アプリケーションからの要求を一時的に保存するキュー手段が設けられている。受け付けることが不可能なアプリケーションからの通信要求は前記キュー手段に接続される。TCP層が行っている通信が終了すると、TCP層は使用していた通信バッファを解放する。ソケット管理層はTCP層が実行中のアプリケーションが終了したことを検知すると、キューに繋がれている通信要求から最も優先度の高い通信要求を取り出し、その要求に基づいてソケットを作成し、TCP層に通信を要求する。TCP層は直前に解放された通信バッファを用いて要求された通信処理を実行する。 An object of the present invention is to prevent an increase in a burden on a user or an increase in useless processing due to a small number of communication buffers that can be secured and a communication request being rejected. In order to achieve this object, the socket management layer according to the present invention uses all the communication buffers that can be set in the device and cannot secure a communication buffer for a new communication request issued by an application. Queue means for temporarily storing requests from applications is provided. A communication request from an application that cannot be accepted is connected to the queue means. When the communication performed by the TCP layer is completed, the TCP layer releases the communication buffer used. When the socket management layer detects that the application being executed by the TCP layer has ended, it extracts the communication request with the highest priority from the communication requests connected to the queue, creates a socket based on the request, and creates a TCP layer. Request communication with The TCP layer executes the requested communication process using the communication buffer released immediately before.

図1はアプリケーション、ソケット管理層、TCP/IP層、及び通信バッファ間で授受される要求あるいは応答を示すものである。同図に示される構成の通信端末装置は3つの通信バッファが確保可能であり、従ってアプリケーションからの3つまでの通信要求を同時に処理可能である。 FIG. 1 shows a request or response exchanged between an application, a socket management layer, a TCP / IP layer, and a communication buffer. The communication terminal apparatus having the configuration shown in the figure can secure three communication buffers, and therefore can process up to three communication requests from an application simultaneously.

(1)アプリケーション1がソケット管理層に対し通信要求を行う。
(2)ソケット管理層はTCP層に対しTCPソケットのオープンを要求する。
(3)ソケット管理層は(2)の要求に先立ち、通信バッファの確保が可能か否かを検査する。即ち、ソケット管理層は現在接続中のソケットの数を検査する。この時点では、接続中のソケットは無いため、ソケットをオープンし通信が可能と判断する。ソケット管理層は通信に必要な通信バッファ1をアプリケーション1の通信要求に割り当てる。次に、(2)の要求に基づいてオープンされたソケットに自己と相手方のIPアドレスとポート番号を関連づけ、通信を開始する。
(4)アプリケーション2がソケット管理層に対し通信要求を行う。
(5)ソケット管理層はTCP層に対しソケットのオープンを要求する。
(6)ソケット管理層は通信に割り当てられている通信バッファの数を検査する。割り当てられているバッファは1つのみであり、通信バッファの新たな割り当て可能と判断される。従って、ソケット管理層は通信バッファ2をアプリケーション2の通信要求に割り当て、上記(3)と同様の処理を行い、通信を開始する。
(7)〜(9) (4)〜(5)をアプリケーシヨン3からの要求に対して繰り返し実行する。
(1) Application 1 makes a communication request to the socket management layer.
(2) The socket management layer requests the TCP layer to open a TCP socket.
(3) Prior to the request in (2), the socket management layer checks whether it is possible to secure a communication buffer. That is, the socket management layer checks the number of currently connected sockets. At this point, since there is no connected socket, it is determined that communication is possible by opening the socket. The socket management layer allocates the communication buffer 1 necessary for communication to the communication request of the application 1. Next, communication is started by associating the IP address and port number of the other party with the socket opened based on the request (2).
(4) Application 2 makes a communication request to the socket management layer.
(5) The socket management layer requests the TCP layer to open a socket.
(6) The socket management layer checks the number of communication buffers allocated for communication. Since only one buffer is allocated, it is determined that a new communication buffer can be allocated. Therefore, the socket management layer allocates the communication buffer 2 to the communication request of the application 2, performs the same processing as the above (3), and starts communication.
(7) to (9) (4) to (5) are repeatedly executed in response to a request from the application 3.

(10)アプリケーション4がソケット管理層に接続要求を行う。ソケット管理層は通信に割り当てられている通信バッファの数を検査する。この時点で既に3つの通信バッファが割り当てられており、装置内に設定可能な通信バッファは全て使用さけていることになる。ソケット管理層はアプリケーション4からの通信要求に対して通信バッファを割り当てることはできないと判断し、要求をキューに接続し保留状態とする。アプリケーション4に対しは、従来のように通信が不可能であることを応答しない。従って、アプリケーション4は接続要求を出した状態で待ち続け、ソケット管理層から相手方とのコネクションが完了し通信が可能となったことの通知がなされるのを待つ。キューには、どのアプリケーションからの接続要求か(ソケット識別子)、接続要求がなされた時刻、優先順位等の情報がキューイングされる。 (10) The application 4 makes a connection request to the socket management layer. The socket management layer checks the number of communication buffers allocated for communication. At this point, three communication buffers have already been allocated, and all communication buffers that can be set in the apparatus are not used. The socket management layer determines that a communication buffer cannot be allocated to the communication request from the application 4, and connects the request to the queue and puts it in a pending state. The application 4 is not responded that communication is impossible as in the prior art. Therefore, the application 4 keeps waiting in a state where the connection request is issued, and waits for a notification from the socket management layer that the connection with the other party is completed and communication is possible. In the queue, information such as from which application the connection request (socket identifier), the time when the connection request is made, and the priority order is queued.

(11)アプリケーション1の通信が終了し、TCPセッションが終了したことがソケット管理層に通知される。ソケット管理層はアプリケーション1にセッションが終了したことを通知し通信バッファ1を開放する。
(12)ソケット管理層はキューを検査し、キューに接続され保留状態となっている通信要求が有るか否かを検査する。キューには上記(10)の処理によりアプリケーション4からの要求が繋げられており保留状態となっている。ソケット管理層はキューから要求を1つ取り出し、キューされたデータを解析する。キューデータを解析することにより、どのアプリケーションがどのIPアドレスのどのポートに対して通信要求を出したのか等、必要な情報を取得する。その情報に基づいてTCP層に対しTCPソケットをオープンし、発側/着側のIPアドレス、発側/着側のポート番号(ソケットペア)の設定等必要な処理を要求する。当該要求に対する処理が完了し通信の開始が可能となった時、ソケット管理層はアプリケーション4にデータの送信を開始する旨通知する。
(13)アプリケーション4のデータを(11)開放された通信バッファ1を使用し通信を開始する。
(11) The communication of the application 1 is finished, and the socket management layer is notified that the TCP session is finished. The socket management layer notifies the application 1 that the session has ended and releases the communication buffer 1.
(12) The socket management layer checks the queue and checks whether there is a communication request that is connected to the queue and is in a pending state. A request from the application 4 is connected to the queue by the process (10), and the queue is in a pending state. The socket management layer retrieves one request from the queue and analyzes the queued data. By analyzing the queue data, necessary information such as which application has issued a communication request to which port of which IP address is acquired. Based on the information, a TCP socket is opened for the TCP layer, and necessary processing such as setting of the IP address of the calling side / destination side and the port number (socket pair) of the calling side / destination side is requested. When the processing for the request is completed and communication can be started, the socket management layer notifies the application 4 that transmission of data is started.
(13) The communication of the data of the application 4 is started (11) using the released communication buffer 1.

図2−1及び図2−2にはキューに登録された通信要求が示されている。キューには通信の要求を出したにもかかわらず、通信バッファの割り当てが受けられず保留状態とされたアプリケーションの情報がブロック化されて登録される。登録情報には、通信を要求したアプリケーションのコード、要求の優先度、要求を出した時刻、要求したポート番号、及び相手方のIPアドレスとポーと番号等が含まれる。新たな通信要求がキューに登録された時、登録されているキューの優先順位、或いは登録さてからの待ち時間等を調査し、予め定められた規則に従って登録順次を調整する構成を採ることも可能である。この処理により、緊急の通信要求が待たされる、あるいは優先順位が低いことにより長時間待たされる要求の発生を防止することが可能となる。
図2−1は、複数の通信要求元アプリケーションからのコネクション要求を一つのキューターミナルに登録して管理する構成であり、同図(a)にキューに登録された要求が、(b)に要求をキューに登録する手順が示されている。
キュー管理部がアプリケーションからのコネクション要求をキューに登録するとき、キュー管理部は既にキューに登録されている要求の優先度と待ち時間から、所定の規則、例えば待ち時間と優先度を重み付け加算する規則に従って登録されている各要求の優先指数を判定する。また、新たに登録する要求の優先指数を要求の優先度から判定する。キュー管理部はこれらの判定結果に基づいて新たな要求を含めた各要求の登録順序を決定し、キューターミナルに登録する。
当該構成において、待ち時間は考慮せず、優先度にのみ基づいてキューへの登録を管理することも可能である。この構成では、新たな要求は同じ優先度を持つ要求の最後に登録される。
図2−2は、キュー管理部に優先度に対応した複数のキューターミナルを設け、要求元アプリケーションからのコネクション要求を、その優先度に対応するキューターミナルに、発生順に登録する構成であり、同図(a)にキューに登録された要求が、(b)に要求をキューに登録する手順が示されている。
キュー管理部がアプリケーションからのコネクション要求をキューに登録するとき、キュー管理部は新たな要求の優先度を判定し、その要求を登録するキューターミナルを決定する。次に管理部はそのキューターミナルに既に登録されている要求の最後の要求を調べ、最後の要求の次に上記新たな要求を最後の要求として登録する。
バッファを割り当てるため、キューから取り出す要求は、各要求が登録されているキュー の優先度とキュー 内の順位によって決定される。最も優先度の高いキューの先頭に登録されている要求からバッファの割り当てが行なわれる。しかし、時間の経過に伴い実行待ち要求の順位を動的に見直し、待ち時間が長い要求の登録をより順位の高いキューに変更することも可能である。
FIG. 2A and FIG. 2B show communication requests registered in the queue. In the queue, the information of the application that has not been assigned a communication buffer but is put on hold despite a communication request is blocked and registered. The registration information includes the code of the application that requested communication, the priority of the request, the time when the request was issued, the requested port number, and the other party's IP address and port number. When a new communication request is registered in the queue, it is possible to investigate the priority of the registered queue or the waiting time after registration and adjust the registration sequence according to a predetermined rule. It is. By this processing, it is possible to prevent an emergency communication request from being waited for or a request from being waited for a long time due to low priority.
FIG. 2-1 shows a configuration in which connection requests from a plurality of communication request source applications are registered and managed in one queue terminal, and the request registered in the queue in FIG. The procedure for registering the URL in the queue is shown.
When the queue management unit registers a connection request from an application in the queue, the queue management unit weights and adds a predetermined rule, for example, the waiting time and the priority from the priority and waiting time of the request already registered in the queue. Determine the priority index of each request registered according to the rules. Further, the priority index of the request to be newly registered is determined from the priority of the request. Based on these determination results, the queue management unit determines the registration order of each request including a new request and registers it in the queue terminal.
In this configuration, it is also possible to manage registration in the queue based on priority only, without considering waiting time. In this configuration, new requests are registered at the end of requests with the same priority.
FIG. 2-2 is a configuration in which a queue management unit is provided with a plurality of queue terminals corresponding to priorities, and connection requests from requesting applications are registered in the queue terminals corresponding to the priorities in the order of occurrence. FIG. 4A shows a request registered in the queue, and FIG. 4B shows a procedure for registering the request in the queue.
When the queue management unit registers a connection request from the application in the queue, the queue management unit determines the priority of the new request and determines a queue terminal to register the request. Next, the management unit examines the last request already registered in the queue terminal, and registers the new request as the last request after the last request.
Since the buffer is allocated, the request to be taken out from the queue is determined by the priority of the queue in which each request is registered and the order in the queue. Buffers are allocated from the request registered at the head of the highest priority queue. However, it is also possible to dynamically review the order of requests waiting for execution as time elapses and change the registration of requests with a long waiting time to a higher-order queue.

図3にはソケット管理層に在って、アプリケーションプログラムから通信要求を受付けると起動され、TCP層に通信を依頼する接続要求処理部と、通信が終了したことの通知を受けると起動され、通信の終了処理を実行する切断要求処理部のフローの例が示されている。同図において「c」はアプリケーションから要求されたソケット数であり、通信を実行中の要求とキューイングされ実行待ちの状態にある要求の総数である。「m」は無線装置に確保可能な通信バッファの最大数である。 In FIG. 3, in the socket management layer, it is activated when a communication request is received from an application program, and is activated when a connection request processing unit that requests communication to the TCP layer is received and a notification that communication has been completed. The example of the flow of the cutting | disconnection request | requirement process part which performs this completion | finish process is shown. In the figure, “c” is the number of sockets requested by the application, and is the total number of requests that are queued for communication and queued for execution. “M” is the maximum number of communication buffers that can be secured in the wireless device.

図3(a)は接続要求処理部の処理フローを示している。
S200:メールプログラム、Web閲覧プログラム等のアプリケーションプログラムがTCP/IPプロトコルによる通信を装置のソケット管理プログラムに要求すると、ソケット管理プログラムは接続要求処理部を起動する。
S201:起動された接続要求処理部は「c」に1加算し、装置内の通信要求が1つ増加したことを表示する。
S202:通信の要求数「c」が装置に確保可能な通信バッファの最大数「m」を超えるか否かを検査する。「c>m」ではない時は空きのバッファが存在しており、新たな通信要求にバッファを割り当てることが可能である。
S203:S202で割り当て可能とされると、通信を要求したアプリケーションプログラムのポート番号、自己のIPアドレス、相手方のIPアドレス、相手方のポート番号に基づいた新たなソケットのオープンをTCP層に要求する。
S204:S203で作成されたソケットに通信バッファを割り当てる。
S205:接続要求処理部は、通信バッファの割り当てが終了したソケットによる通信をTCP層に要求する。TCP層は作成されたソケットに基づいて相手方TCP層とコネクションの設定処理を開始する。
S206:接続要求処理部は自己の処理を終了する。
S207:S202の判断が「c>m」の時は、通信要求の総数が割り当て可能な通信バッファ数を超えたことを意味し、今回の通信要求に通信バッファを割り当てることはできない。従って、今回の通信要求をキューに登録する処理を行う。
S208:キューに登録されている通信要求を、アプリケーションの優先度、待ち時間の長短等、予め定められた規則に従って各要求の優先順位を判定し、キューに登録する順序を変更する。この処理により重要な通信要求が長時間待ち状態とされることを防止する。
S209:接続要求処理部は自己の処理を終了する。
FIG. 3A shows a processing flow of the connection request processing unit.
S200: When an application program such as a mail program or a Web browsing program requests the socket management program of the apparatus for communication using the TCP / IP protocol, the socket management program activates the connection request processing unit.
S201: The activated connection request processing unit adds 1 to “c” and displays that the number of communication requests in the apparatus has increased by one.
S202: It is checked whether or not the communication request number “c” exceeds the maximum number “m” of communication buffers that can be secured in the apparatus. When “c> m” is not satisfied, an empty buffer exists, and a buffer can be allocated to a new communication request.
S203: When assignment is possible in S202, the TCP layer is requested to open a new socket based on the port number of the application program that requested the communication, its own IP address, the other party's IP address, and the other party's port number.
S204: A communication buffer is allocated to the socket created in S203.
S205: The connection request processing unit requests the TCP layer for communication using a socket for which communication buffer assignment has been completed. The TCP layer starts a connection setting process with the counterpart TCP layer based on the created socket.
S206: The connection request processing unit ends its own processing.
S207: When the determination in S202 is “c> m”, it means that the total number of communication requests exceeds the number of allocatable communication buffers, and a communication buffer cannot be allocated to the current communication request. Accordingly, processing for registering the current communication request in the queue is performed.
S208: The priority of each request is determined according to a predetermined rule such as the priority of the application, the length of the waiting time, and the like for the communication request registered in the queue, and the order of registration in the queue is changed. This process prevents important communication requests from waiting for a long time.
S209: The connection request processing unit ends its own processing.

図3(b)は切断要求処理部の処理フローを示している。
S220:アプリケーションプログラムの通信が終了したことにより、ソケット管理プログラムは切断要求処理部を起動する。
S221:切断要求処理部はTCP層に通信が終了したアプリケーションプログラムに割り付けられているソケットのクローズを要求する。
S222:クローズするソケットに割り付けられている通信バッファを解放する。この処理により、解放された通信バッファは他のソケットに割付けることが可能となる。
S223:切断要求が有ったことは、装置内の通信が1つ終了し通信要求が1つ減ったことを意味する。従って、通信の要求数「c」から1減算する。
S224:通信の要求数「c」が装置に確保可能な通信バッファの最大数「m」以上であるか否かを検査する。「c」が「m」未満の時は、切断の要求がなされた時点で、キューに登録された通信要求は存在していないことを示している。
S225:待機中の通信要求は存在せず、切断要求処理部は切断処理以外の処理をする必要がないため、自己の処理を終了する。
S226:「c」が「m」以上であることは、切断の要求がなされた時に少なくとも1つの通信要求がキューに登録されていることを表している。通信の要求キューから登録されている要求を1つ取り出す。
S227:キューから取り出した要求の情報を解析し、通信を要求したアプリケーションプログラムのポート番号、自己のIPアドレス、相手方のIPアドレス、相手方のポート番号を知り、それら情報に基づいた新たなソケットのオープンをTCP層に要求する。
S228:S227で作成されたソケットに通信バッファを割り当てる。
S229:通信バッファの割り当てたソケットによる通信をTCP層に要求する。この要求により、TCP層は相手方TCP層とコネクションの設定処理を開始する。
S230:キューを更新し、切断要求処理部は自己の処理を終了する。
FIG. 3B shows a processing flow of the disconnection request processing unit.
S220: When the communication of the application program is completed, the socket management program activates the disconnection request processing unit.
S221: The disconnection request processing unit requests the TCP layer to close the socket assigned to the application program whose communication is completed.
S222: Release the communication buffer allocated to the socket to be closed. By this process, the released communication buffer can be allocated to another socket.
S223: Having a disconnection request means that one communication within the apparatus is completed and one communication request is reduced. Therefore, 1 is subtracted from the communication request number “c”.
S224: It is checked whether or not the communication request number “c” is equal to or larger than the maximum number “m” of communication buffers that can be secured in the apparatus. When “c” is less than “m”, it indicates that there is no communication request registered in the queue at the time when the disconnection request is made.
S225: There is no waiting communication request, and the disconnection request processing unit does not need to perform any processing other than the disconnection processing, and thus ends its own processing.
S226: “c” being “m” or more indicates that at least one communication request is registered in the queue when a disconnection request is made. One registered request is extracted from the communication request queue.
S227: Analyzing the request information retrieved from the queue, knowing the port number of the application program that requested the communication, its own IP address, the other party's IP address, the other party's port number, and opening a new socket based on that information To the TCP layer.
S228: A communication buffer is allocated to the socket created in S227.
S229: Request communication using the socket allocated to the communication buffer to the TCP layer. In response to this request, the TCP layer starts connection setting processing with the counterpart TCP layer.
S230: The queue is updated, and the disconnection request processing unit ends its own processing.

本発明はTCP/IPプロトコルを用いる通信を要求するアプリケーションとTCP層の間に、TCP層にソケットのオープンを要求すると共にメモリ内に設定される通信バッファの管理を行うソケット管理層を備えている。ソケット管理層はアプリケーションから接続要求があったとき現在接続中のソケット数が装置内に確保可能な通信バッファの最大数を超えているか否かを判定し、装置で確保できるバッファ数以上のソケットのオープン要求はキューに登録する。また、ソケット管理層は実行中の通信が終了しバッファが解放されたことを検知すると、キューに登録された通信要求のためのソケットのオープンをTCP層に要求する構成を有している。この構成により、限られたメモリの中で多くのTCP/IPを使用した通信を行うことが可能となる。また、キューに登録された通信要求の実行順序を要求の優先度、あるいは待ち時間に従って決定することにより、重要な通信要求が長時間待たされることがない装置の実現が可能となる。 The present invention includes a socket management layer for requesting the TCP layer to open a socket and managing a communication buffer set in the memory between an application requesting communication using the TCP / IP protocol and the TCP layer. . When there is a connection request from the application, the socket management layer determines whether the number of sockets currently connected exceeds the maximum number of communication buffers that can be secured in the device. Open requests are queued. The socket management layer is configured to request the TCP layer to open a socket for a communication request registered in the queue when it detects that the ongoing communication is completed and the buffer is released. With this configuration, it is possible to perform communication using many TCP / IPs in a limited memory. Further, by determining the execution order of communication requests registered in the queue according to request priority or waiting time, it is possible to realize an apparatus in which important communication requests are not waited for a long time.

本発明に係るソケット管理層とTCP/IP層の図Diagram of socket management layer and TCP / IP layer according to the present invention 本発明に係るソケット管理層におけるキュー管理の第1の例を示す図The figure which shows the 1st example of the queue management in the socket management layer concerning this invention 本発明に係るソケット管理層におけるキュー管理の第2の例を示す図The figure which shows the 2nd example of the queue management in the socket management layer concerning this invention 本発明に係るソケット管理層の接続要求と切断要求の処理部フローの図Diagram of the processing flow of the connection request and disconnection request processing of the socket management layer according to the present invention クライアントとサーバ間の通信要求の流れ図Flow chart of communication request between client and server TCP/IPによる通信の説明図TCP / IP communication diagram TCP/IPにおれるアプリケーションデータの変化図Changes in application data in TCP / IP 第1及び第2アプリケーションプログラム間のセクション設定処理のフロー図Flow chart of section setting processing between first and second application programs セクション終了のフロー図Section end flow diagram

Claims (2)

所定量の通信バッファが割り当てられたソケットを介して通信を行う情報処理装置のソケット管理層におけるTCP/IP通信の制御方法であって、
前記TCP/IP通信の制御方法は、
情報処理装置のアプリケーションからの通信要求に対してソケットの通信バッファの割り当てが可能か否を判定するステップと、
通信バッファの割り当てが不可能と判定された時前記アプリケーションからの通信要求を待ち行列に登録するステップと、
通信バッファの割り当てが可能と判定された時前記アプリケーションが要求した通信を実行するソケットを生成するステップと、
生成されたソケットを介して通信を行うステップと、
通信が終了したことに応答して対応するソケットを終了し通信バッファを解放するステップと、
前記ソケットの終了に応答して前記待ち行列に通信要求が登録されているか否かを判定するステップと、
通信要求が登録されているか場合優先順位の最も高い通信要求を実行するソケットを生成して通信を行うステップからなり、
前記待ち行列に登録するステップは、前記アプリケーションの優先度に基づいて登録順位を決定するステップと、
登録されている待ち時間の長さによって登録順位を変更するステップを有するTCP/IP通信の制御方法。
A method for controlling TCP / IP communication in a socket management layer of an information processing apparatus that performs communication through a socket to which a predetermined amount of communication buffer is allocated,
The TCP / IP communication control method is as follows:
Determining whether a socket communication buffer can be allocated in response to a communication request from an application of the information processing apparatus;
Registering a communication request from the application in a queue when it is determined that communication buffer allocation is impossible;
Generating a socket for performing communication requested by the application when it is determined that communication buffer allocation is possible;
Communicating via the generated socket;
Ending the corresponding socket in response to the end of communication and releasing the communication buffer;
Determining whether a communication request is registered in the queue in response to termination of the socket;
If the communication request is registered, it consists of the step of communicating by generating a socket that executes the communication request with the highest priority,
Registering in the queue, determining a registration order based on the priority of the application;
A control method of TCP / IP communication including a step of changing a registration order according to a length of a registered waiting time.
所定量の通信バッファが割り当てられたソケットを介して通信を行い、ソケット管理層においてTCP/IP通信を実行する情報処理装置であって、
前記情報処理装置は、
情報処理装置のアプリケーションからの通信要求に対してソケットの通信バッファの割り当てが可能か否を判定するバッファ判定手段と、
前記バッファ判定手段が通信バッファの割り当てが不可能と判定したことに応答して前記アプリケーションからの通信要求を待ち行列に登録する待ち行列登録手段と、
前記バッファ判定手段が通信バッファの割り当てが可能と判定したことに応答して前記アプリケーションが要求した通信用のソケットを生成するソケット生成手段と、
ソケット生成手段が生成したソケットを介して通信を行う通信手段と、
通信が終了したことに応答して対応するソケットを終了し通信バッファを解放するソケットクローズ手段と、
前記ソケットの終了に応答して前記待ち行列に通信要求が登録されているか否かを判定する待ち行列検査手段と、
前期行列検査手段により通信要求が登録されていると判定したことに応答して優先順位の最も高い通信要求を実行するソケットを生成して前期通信手段により通信を行う待ち行列制御手段を有し、
前記待ち行列に登録する手段は、
前記アプリケーションの優先度に基づいて通信要求を登録する登録順位を決定する手段と、
登録されている通信要求の待ち時間の長さによって登録順位を変更する手段を有する情報処理装置


An information processing apparatus that performs communication via a socket to which a predetermined amount of communication buffer is allocated and executes TCP / IP communication in a socket management layer ,
The information processing apparatus includes:
A buffer determination means for determining whether a socket communication buffer can be allocated in response to a communication request from an application of the information processing apparatus;
Queue registration means for registering a communication request from the application in a queue in response to the buffer determination means determining that communication buffer allocation is impossible;
Socket generation means for generating a communication socket requested by the application in response to the buffer determination means determining that communication buffer allocation is possible;
Communication means for performing communication via the socket generated by the socket generation means;
Socket closing means for terminating the corresponding socket in response to the end of communication and releasing the communication buffer;
Queue checking means for determining whether a communication request is registered in the queue in response to the end of the socket;
In response to determining that the communication request has been registered by the previous-term queue checking means, a queue control means for generating a socket for executing the highest priority communication request and performing communication by the previous-term communication means ,
The means for registering in the queue is:
Means for determining a registration order for registering a communication request based on the priority of the application;
An information processing apparatus having means for changing a registration order according to a waiting time of a registered communication request.


JP2004292462A 2004-10-05 2004-10-05 Data communication apparatus and data communication method using TCP / IP socket Expired - Fee Related JP4413121B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2004292462A JP4413121B2 (en) 2004-10-05 2004-10-05 Data communication apparatus and data communication method using TCP / IP socket

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2004292462A JP4413121B2 (en) 2004-10-05 2004-10-05 Data communication apparatus and data communication method using TCP / IP socket

Publications (2)

Publication Number Publication Date
JP2006107095A JP2006107095A (en) 2006-04-20
JP4413121B2 true JP4413121B2 (en) 2010-02-10

Family

ID=36376767

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2004292462A Expired - Fee Related JP4413121B2 (en) 2004-10-05 2004-10-05 Data communication apparatus and data communication method using TCP / IP socket

Country Status (1)

Country Link
JP (1) JP4413121B2 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4894563B2 (en) * 2007-03-07 2012-03-14 日本電気株式会社 Communication device
JP4586873B2 (en) 2008-03-28 2010-11-24 セイコーエプソン株式会社 Socket management apparatus and method
JP5217988B2 (en) * 2008-12-08 2013-06-19 富士通株式会社 Information processing apparatus, program, and control method for information processing apparatus
JP6653230B2 (en) * 2016-09-01 2020-02-26 日本電信電話株式会社 Communication management device, communication management method, and communication management program

Also Published As

Publication number Publication date
JP2006107095A (en) 2006-04-20

Similar Documents

Publication Publication Date Title
US7817634B2 (en) Network with a constrained usage model supporting remote direct memory access
US20170250914A1 (en) In-line network accelerator
JP4327496B2 (en) How to offload the network stack
US7685287B2 (en) Method and system for layering an infinite request/reply data stream on finite, unidirectional, time-limited transports
US10455061B2 (en) Lightweight transport protocol
JP2014524092A (en) System and method for reliable virtual bidirectional data stream communication with single socket point-to-multipoint performance
US7298745B2 (en) Method and apparatus to manage packet fragmentation with address translation
JP2005537764A (en) Mechanism for providing QoS in a network using priority and reserve bandwidth protocols
JP2013511884A (en) Dynamically connected transport service
CN106411767A (en) Transporting operations of arbitrary size over remote direct memory access
US8539089B2 (en) System and method for vertical perimeter protection
CN114363351A (en) Proxy connection suppression method, network architecture and proxy server
CN108809549B (en) Data transmission method and equipment
CN112398754B (en) Data transmission method, device, medium, electronic equipment and network access equipment
JP4413121B2 (en) Data communication apparatus and data communication method using TCP / IP socket
US10498867B2 (en) Network interface device and host processing device field
US7363383B2 (en) Running a communication protocol state machine through a packet classifier
EP1575236B1 (en) Connectivity confirmation method for network storage device and host computer
CN111698274B (en) Data processing method and device
WO2022268137A1 (en) Tcp connection method, system, network device, and storage medium
US20050188070A1 (en) Vertical perimeter framework for providing application services
CN108966319B (en) Data packet transmission control method, mobile terminal and device
JP2000235536A (en) Data communication system and device
US7290055B2 (en) Multi-threaded accept mechanism in a vertical perimeter communication environment
JP2001036581A (en) Communication band setting system and its method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20060306

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20081104

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20081225

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20090310

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20090417

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20091020

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20091026

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20091117

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20091117

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20121127

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20121127

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20151127

Year of fee payment: 6

LAPS Cancellation because of no payment of annual fees