WO2005066807A1 - Microcomputer and data receiving method - Google Patents

Microcomputer and data receiving method Download PDF

Info

Publication number
WO2005066807A1
WO2005066807A1 PCT/JP2003/016855 JP0316855W WO2005066807A1 WO 2005066807 A1 WO2005066807 A1 WO 2005066807A1 JP 0316855 W JP0316855 W JP 0316855W WO 2005066807 A1 WO2005066807 A1 WO 2005066807A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
ram
event
program
tcp
Prior art date
Application number
PCT/JP2003/016855
Other languages
French (fr)
Japanese (ja)
Inventor
Junichiro Takahashi
Original Assignee
Renesas Technology 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 Renesas Technology Corp. filed Critical Renesas Technology Corp.
Priority to PCT/JP2003/016855 priority Critical patent/WO2005066807A1/en
Priority to JP2005513090A priority patent/JP4252577B2/en
Publication of WO2005066807A1 publication Critical patent/WO2005066807A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/382Information transfer, e.g. on bus using universal interface adapter
    • G06F13/385Information transfer, e.g. on bus using universal interface adapter for adaptation of a particular data processing system to different peripheral devices

Definitions

  • the present invention relates to the realization of a protocol with a small program capacity. More specifically, the present invention relates to a method for receiving a micro computer with a TCP / IP protocol stack. The present invention relates to technology that is effective when applied to home appliances that can be connected to a network. Background art
  • TCP / IP Transmission 'Control Protocol / Internet Protocol
  • IETF Internal Network Engineering 'Task Force'
  • data communication using the TCP / IP protocol is conventionally performed by a software protocol stack processed by the CPU (central processing unit) and hardware that performs packet communication processing on the MAC (media 'access' control) layer. This is realized by the network interface.
  • Patent Document 1 Japanese Unexamined Patent Application Publication No. 2003-143221
  • Patent Document 1 Japanese Unexamined Patent Application Publication No. 2003-143221
  • Patent Document 2 Japanese Unexamined Patent Application Publication No. 2003-263323
  • mounting a protocol block together with 0S increases the program capacity.
  • a simple communication program and a self-rewriting program are included.
  • the self-rewriting program makes it possible to upgrade the download function and deal with advanced functions. Disclosure of the invention
  • the present inventor has studied support for the TCP / IP protocol in network home appliances and the like.
  • TCP / IP protocol protocols that can operate on internal ROM / RAM such as a 16-bit microcomputer for embedded control. According to this, there is no idea that the already defined protocols will save resources extremely.
  • Implementing the TCP / IP protocol according to the details of such a protocol requires a large storage ROM to store the protocol stack, and a large work RAM to execute the protocol stack. .
  • the technology described in the above-mentioned patent document differs from the technology studied by the present inventor in the point of view.
  • An object of the present invention is to make it possible to realize a network connection by a TCP / IP protocol for a small-scale system such as a network home appliance.
  • Another object of the present invention is to provide a data processing method that can contribute to the realization of a compact TCP / IP protocol stack.
  • a microcomputer is formed on one semiconductor chip including a central processing unit, a RAM, and a ROM, and the ROM is an operating system, an application program, and the application program.
  • a TCP / IP processing program called and executed by the content program is stored.
  • the TCP / IP processing program has a connection request, event waiting, data transmission, and connection disconnection processing programs.
  • the central processing unit reads a part of the packet data into the RAM in response to an evening switch command, for example, a data overnight reception interrupt during execution of the processing program waiting for the event, and reads the packet data and needs the packet data overnight. Wakes up from the event wait state, executes the application program, and loads the corresponding bucket data into RAM.
  • a part of the received packet data in the MAC layer can be fetched into the on-chip RAM of the microcomputer and analyzed, so there is no need to process all the bucket data into the work RAM and expand it.
  • the size of the work RAM to be used is small.
  • the process of loading the packet data into the on-chip RAM according to the result of the analysis is performed directly by the application program, and does not use the protocol block. Therefore, it can contribute to making the protocol stack compact.
  • a microcomputer includes a central processing unit, a RAM, and a ROM, and is formed on one semiconductor chip.
  • the ROM includes an operating system, an application program, and the application program.
  • the RAM is used as a work area when the CPU executes the program, and the TCP / IP processing program is called a service program. It has a start, connection request, event wait, data transmission, and disconnection processing programs.
  • the events to wait for the event wait may be a connection establishment, a connection disconnection, a data reception, and an event wait timeout.
  • the type of event to wait in the event waiting processing program is preferably specified by the application program.
  • the event waiting processing program needs to take a predetermined bucket of the packet data from the outside into the RAM in response to a predetermined interrupt, and check the received data for a corresponding bucket. It is determined whether the bucket is a proper bucket or not, and if it is determined that it is necessary, the event waiting state is ended. Then, the application program may take in the data of the corresponding reception bucket into the RAM in response to the end of the data reception event waiting state.
  • the storage capacity of the on-chip RAM can be about 2 to 4 kilobytes.
  • the data receiving method is a method of reading out a predetermined portion of packet data stored in a buffer memory of a communication device constituting a TCP / IP MAC layer, and reading the data from an on-chip RAM of a microcomputer.
  • a first process for storing the data in the on-chip RAM a second process for determining whether or not a corresponding bucket is necessary by checking the data stored in the on-chip RAM.
  • a part of the received bucket data can be fetched into the on-chip RAM of the microcomputer and analyzed in the second process, so that all the bucket data is fetched and expanded in the peak RAM. Where Requires no work, and the required work RAM size is small.
  • the first process and the second process are defined by the protocol stack
  • the third process is defined by the application program, so that the packet data is loaded into the on-chip RAM in accordance with the result of the analysis by the third process.
  • the processing is performed directly by the application program and does not use the protocol block, so it can contribute to making the protocol stack compact.
  • the data of the predetermined portion is data of 13 bytes to 42 bytes from the head of the packet format in the in-net protocol. It is evening.
  • ARP Adresor Resolution Protocol
  • I CMP Inner Network Control Message
  • FIG. 1 is a block diagram of a microcomputer according to the present invention.
  • Figure 2 shows the CUP's quadruple map.
  • Fig. 3 is an explanatory diagram showing the seven types of API programs held by the TCP / IP protocol.
  • FIG. 4 is an explanatory diagram showing a list of events recognized by the event waiting API program.
  • Fig. 5 is a flowchart of the bucket data overnight reception process by TCP / IP.
  • FIG. 6 is an illustration showing the packet format of the TCP / IP protocol in a broad sense.
  • FIG. 4 is an explanatory view schematically showing the appearance.
  • FIG. 8 is a flowchart showing details of the protocol analysis processing (S4) of FIG.
  • FIG. 9 is a flowchart of a passive connection process by TCP / IP.
  • FIG. 10 is a flowchart of the active connection processing by TCP / IP.
  • FIG. 11 is a flowchart of the overnight transmission processing by TCP / IP.
  • FIG. 12 is a flowchart of the forced disconnection for the TCP / IP connection.
  • Fig. 13 is a flowchart of normal disconnection for TCP / IP connection.
  • FIG. 1 shows a block diagram of a microcomputer according to the present invention.
  • the micro-computer 1 shown in the figure is not particularly limited, but is formed on a single semiconductor substrate such as single-crystal silicon by a complementary MOS integrated circuit manufacturing technology or the like, and is configured as a single chip or a single chip. Pelletized and packaged as needed.
  • the microcomputer 1 is not particularly limited, but is rewritten as a CPU (central processing unit) 2, a clock oscillator 3, an interrupt controller 4, a DMAC (direct 'memory'access' controller) 5, and a flash memory.
  • ROM read-only-memory
  • RAM 7 composed of SRAM (static random access memory), refresh controller 8, clock Abnormal operation of the system due to the number of cycles Monitor WD T (Watch 'Dog' evening) 9, TCU (East 'Counter' unit) 10, SCI (Serial 'Communication' interface) 1 1, US ⁇ (Universal 'Serial' It has a bus 12, an AD (analog-to-digital) converter 13, a bus controller 14, and an input / output port 15, which are connected to an internal bus represented by reference numeral 16.
  • the CPU 2 has an instruction control unit and an execution unit.
  • the instruction control unit accesses a program stored in the ROM 6 or the like to fetch an instruction, decodes the fetched instruction, and generates control information.
  • the execution unit executes an instruction by performing an operation, an operand access, or the like according to the control information. .
  • the input / output port 15 is connected to an Ethernet device 20 constituting a network interface card (NIC).
  • the Ethernet device 20 is connected to the Ethernet cable 21 and implements a network interface of hardware that performs bucket communication processing of the MAC layer.
  • the Ethernet device 20 includes an Ethernet controller 22, a buffer memory 23, and a transceiver / receiver 24 coupled to the Ethernet cable 21.
  • Micro-combination 1 is a protocol protocol for hardware that performs bucket communication processing and software that is processed by CPU 2 for data communication using the TCP / IP protocol.
  • Use a TCP / IP processing program also simply called TCP / IP protocol block).
  • the TCP / IP protocol stack is called from the application program and executed. What is an application program? Browser software Email software And so on.
  • the TCP / IP protocol and application programs are owned by the R0M6 together with the operating system (OS).
  • OS operating system
  • FIG. 2 illustrates an address map of the CPU 2.
  • OS work In the address space of R0M6, vectors, OS, TCP / IP protocol blocks, and application programs are arranged from the top.
  • Application programs include programs other than data communication, and may be understood as so-called user programs that are incorporated as needed by the user of the microcomputer.
  • RAM7 In the address space of RAM7, there are an OS work area (OS work), a work area, a work area for TCP / IP protocol work (TCPZIP work), and a work area for application programs (user work). Is assigned.
  • FIG. 3 shows the seven types of API programs held by the TCP / IP protocol.
  • the service start API program is a processing program that performs initial settings for TCP / IP communication.
  • the initial setting items include, for example, initialization of the Ethernet device 20, initialization of the TCP / IP work, and the like.
  • the passive connection setting API program is a processing program that sets the IP address and port number of its own port in order to wait for connection.
  • the active connection request API program is a processing program that sets the partner port that requests connection.
  • the event waiting API program is a processing program that waits for a response to a setting or request.
  • Data transmission API program is a processing program that transmits data.
  • the API program is a processing program that disconnects its own connection and leaves the disconnection of the partner to the partner. Forcibly disconnecting the connection
  • the API program is a processing program that forcibly cuts off both its own connection and the connection of the other side.
  • Awaiting event API program starts a specified event It is a processing program for waiting for life.
  • FIG. 4 shows a list of events recognized by the API program waiting for events.
  • the events to be recognized are: passive / active connection establishment to be confirmed after the execution of the passive connection setting API program or active connection API program, closing of the connection to be confirmed after execution of the closing API program, and forced disconnection of the connection API program To be confirmed after execution of data transmission, data reception indicating that data has been received, completion of data transmission to be confirmed after execution of the API program for data transmission, timeout of event waiting by event waiting API program (waiting) ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ ) ⁇ ⁇ ⁇ . Which event to wait for is indicated from the application program by a flag or the like.
  • FIG. 5 illustrates a flow chart of the bucket data overnight receiving process by TCP / IP.
  • the service start API program is executed to complete the initialization of the communication settings, and then the passive connection setting or active connection setting API program is executed to establish the connection.
  • the application program sets a flag for the overnight reception event, and the API program is called and executed while waiting for the event. The content of the execution by this is the processing of FIG. 5. First, it waits for a packet data—evening reception interrupt from the Ethernet device 20 (S 1).
  • the Ethernet device 20 sequentially receives the received packet data into the buffer memory 23, and outputs a reception interrupt of the packet data to the microcomputer 1 in response to the data reception.
  • the Internet Protocol Protocol Purge 4 has the format shown in Fig. 6 and uses the ARP (address resolution solution protocol) included in the broadly defined TCP / IP protocol. Tokor), IC In the bucket format of MP (Internet 'control' message 'protocol), TCP, and UDP (user datagram protocol), the first 14 bytes are the MAC layer. This is followed by a header and necessary data.
  • ICMP is a protocol for transferring IP error messages and control messages, and is used to confirm the status of computers connected by TCP / IP.
  • TCP is a protocol of the network transport layer.
  • UDP is a transport layer communication protocol that does not guarantee reliability.
  • the last two bytes of the 14-byte MAC layer control information indicate the type of the bucket, from which a reference can be made by referring to the data of at least 42 bytes.
  • the protocol type, destination IP address, port number, etc. of the packet data are understood.
  • the packet data is a packet data required by the microcomputer as a function of the communication channel.
  • S2 the RAM 7
  • S3 From the read data, it is determined whether or not the bucket is data addressed to its own IP address (S3). Otherwise, the packet is discarded.
  • Discarding means that the bucket data is not read from the buffer memory 23 to the RAM 7. If it is determined in step S3 that the data is destined for its own IP address, the packet data is read from the buffer memory 23 into the RAM 7 and the protocol is analyzed (S4). According to this, a part of the received packet data in the MAC layer can be taken into the on-chip RAM 7 of the microcomputer 1 and analyzed, so that all the packet data is stored in the work area of the RAM 7. There is no need for processing to capture and deploy The size of the on-chip RAM 7 to be used can be small. Incidentally, the capacity of RAM 7 is about 2K to 4K bytes.
  • FIG. 7 schematically shows a state in which 42 bytes of a packet data are taken out from the buffer memory 23.
  • the buffer memory 23 operates as a ring buffer.
  • the packet data of the ring buffer is managed in page units.
  • the Ethernet controller 23 has an MMU function for the RAM 7, and the CPU 2 uses this to transfer the data from the 13th byte to the 42th byte of the packet data in the page from the 13th byte to the packet data in the page.
  • FIG. 8 illustrates details of the protocol analysis processing (S4) in FIG.
  • the CPU 2 determines whether the protocol of the packet data corresponds to ARP, I CMP, TCP, UDP, or the like.
  • ARP an ARP reply is transmitted
  • I CMP an I CMP reply is returned.
  • TCP the port number and IP address are checked, and if it is not addressed to its own address, the packet data is discarded.
  • TCP the port number and IP address are checked, and if it is not addressed to its own address, the packet data is discarded.
  • it is addressed to its own address if it is a control packet, it returns a TCP reply, and if it is a data packet, it wakes up from the event wait state.
  • connection establishment S LEV—CONNECT
  • connection request success data transmission complete
  • S LEV—TEND data transmission complete
  • SL EV—RST connection disconnection
  • SEV_CLS The disconnection request succeeded
  • the data reception event SEV—RX
  • the CPU wakes up from the corresponding event waiting state, and shifts the processing of the CPU 2 to the application program or shifts to another API program according to the event.
  • FIG. 8 does not particularly show the processing when the UDP is recognized, it can be considered in substantially the same manner as in the case of TCP. However, it is simpler than TCP. For other protocols not supported by the system, the bucket data is discarded.
  • FIG. 9 shows a flow chart of the passive connection processing by TCP / IP.
  • the API program for the passive connection setting is called from the protocol interface, and the IP address and port number of its own port are set. Then, it waits for the event of the connection establishment by executing the API waiting API program. When the event occurs, it wakes up from the event waiting state and the connection is established.
  • FIG. 10 illustrates a flow chart of the active connection processing by TCP / IP.
  • the API program of the active connection request is called from the protocol interface, and the IP address and port number of the partner port are set.
  • the event is set, and then the event waiting API program is executed to wait for an event to establish a connection.
  • the computer wakes up from the event waiting state and the connection is established.
  • FIG. 11 illustrates a flowchart of a data transmission process by TCP / IP. Wait for event Executes the API program and waits for the occurrence of an overnight reception event. When a data reception event occurs, it wakes up from the event wait state, performs the processing described in FIG. 5 according to the application program, and stores the reception page number and data length on the Ethernet device required for transmission in the buffer memory 23. From RAM 7 Next, the process shifts to execution of the data transmission API program, and transfers the data in the RAM 7 to the buffer memory 23 to be transmitted to the Ethernet device.
  • FIG. 12 illustrates a flowchart of the forced disconnection for the TCP / IP connection.
  • CPU 2 only needs to execute the API program forcibly disconnecting the connection.
  • FIG. 13 illustrates a flow chart of normal disconnection for the TCP / IP connection.
  • CPU 2 executes the API program to close the connection, waits for an event, executes the API program, and waits for the occurrence of a close completion event from the connection partner. The communication by the port number is terminated due to the occurrence of the close completion event.
  • the storage capacities of RAM and ROM are not limited to the above description and can be changed as appropriate.
  • the term “microcomputer” is a general term for a system-on-chip semiconductor integrated circuit having a CPU.
  • the CPU is not limited to a 16-bit CPU, but may be a 32-bit CPU or the like. From an application point of view, no specially sophisticated CPU is required.
  • the type and processing content of the protocol processing program can be changed as appropriate.
  • the task switching when transferring a part of the bucket data from the buffer memory to the on-chip RAM is not limited to the data reception interrupt, and may be performed in response to another task switch command. Industrial applicability
  • the present invention can be widely applied to a TCP / IP interface in a small-scale system with relatively low data processing performance typified by network home appliances and mobile terminals.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer And Data Communications (AREA)

Abstract

A microcomputer (1), which includes a central processing unit (2), a RAM (7) and a ROM (6), is formed in a single semiconductor chip. The ROM has stored therein an operating system, application programs, and TCP/IP processing programs that can be invoked from the application programs to be executed. The TCP/IP processing programs include processing programs of connection request, event waiting, data transmission and disconnection. When the central processing unit requires packet data by reading a portion of the packet data into the RAM in response to a data reception interrupt during execution of a processing program of event waiting, it starts up from the event waiting state to execute an application program to further import the corresponding packet data into the RAM.

Description

明 細 書 マイクロコンビユー夕及びデータ受信方法 技術分野  Description Microcombination and data receiving method
本発明は、プログラム容量の小さなプロ トコルス夕ックの実現に係り、 具体的には、 TCP/I Pのプロ トコルスタックを有するマイクロコン ピュー夕ゃデ一夕受信方法に関し、例えば T CP/I Pによるネッ トヮ ーク接続可能な家電製品等に適用して有効な技術に関する。 背景技術  The present invention relates to the realization of a protocol with a small program capacity. More specifically, the present invention relates to a method for receiving a micro computer with a TCP / IP protocol stack. The present invention relates to technology that is effective when applied to home appliances that can be connected to a network. Background art
TCP/I P ( トランスミ ッション ' コン トロール · プロ トコル/ィ ン夕ーネッ ト ·プロ トコル) はネヅ トワークのコア技術として発展し、 現在通信のデファク トスタンダードとされる。そのプロ トコルの詳細は イン夕一ネヅ 卜の問題点を解決するための組織である I E T F (イン夕 —ネッ ト ·エンジニアリング 'タスク · フォース) が取りまとめている 膨大な数の R F C (リクエス ト 'ォブ 'コメンッ) で各種定義されてい る。従来 TCP/I Pプロ トコルによるデ一夕通信は CPU (セントラ ル .プロセッシング .ュニヅ ト) が処理するソフ トウエアのプロ トコル スタックと MAC (メディア 'アクセス 'コントロール) 層のパケッ ト 通信処理を行なうハードウェアのネッ トワークイン夕フェースにより 実現されている。  TCP / IP (Transmission 'Control Protocol / Internet Protocol) has evolved as a core network technology and is currently the de facto standard for communications. The details of the protocol are described in the huge number of RFCs (requests) compiled by the IETF (Internal Network Engineering 'Task Force'), an organization that solves the problems of the Internet. Various comments are defined. Conventionally, data communication using the TCP / IP protocol is conventionally performed by a software protocol stack processed by the CPU (central processing unit) and hardware that performs packet communication processing on the MAC (media 'access' control) layer. This is realized by the network interface.
前記プロ トコルスタックの実現に関し、 特許文献 1 (特開 2003 - 1432 2 1号公報) では、 0 Sの制御とは独立した状態で実行できる ハードウェアによるプロ トコルスタックを提供する。 0 S制御下のソフ トウエアで実行されるプロ トコル処理が他の優先処理に阻まれないよ うにして、 通信処理のリアルタイム性を保証しょうとする。 Regarding the realization of the protocol stack, Patent Document 1 (Japanese Unexamined Patent Application Publication No. 2003-143221) provides a protocol stack by hardware that can be executed independently of the control of OS. 0 Protocol processing executed by software under S control is not blocked by other priority processing. In this way, we try to guarantee real-time communication processing.
特許文献 2 (特開 2003-263323号公報) では、 0 Sと共に プロ トコルス夕ックを実装するとプログラム容量が増大するので、これ を減少させるのに、簡易な通信プログラムと共に自己書き換えプログラ ムを含め、自己書き換えプログラムによってダウンロード機能のアップ グレードや高機能への対処を可能にする。 発明の開示  In Patent Document 2 (Japanese Unexamined Patent Application Publication No. 2003-263323), mounting a protocol block together with 0S increases the program capacity. To reduce this, a simple communication program and a self-rewriting program are included. In addition, the self-rewriting program makes it possible to upgrade the download function and deal with advanced functions. Disclosure of the invention
本発明者は、 ネヅ トワーク家電等で TCP/ I Pのプロトコルをサポー トすることについて検討した。 特に組込み制御用途の 16ビットマイクロコ ンピュー夕等の内蔵 ROM/RAM上で動作可能な T CP/I Pのプロトコ ルス夕ヅクについて検討した。 これによれば、 既に各種定義されているプロ トコルではリソースを極端に節約すると言う思想はない。そのようなプロ ト コルの詳細にしたがって T CP/I Pプロ トコルを実装するにはプロ トコルスタックを格納する大きな記憶容量の ROM、そしてプロ トコル スタックの実行に大きな記憶容量のワーク R A Mが必要になる。上記特 許文献に記載の技術は本発明者による検討技術とは着眼点が異なる。 本発明の目的は、 ネッ トワーク家電のような小規模システムに対して T C P/I Pプロトコルによるネットワーク接続を実現可能にすることにある。 本発明の別の目的は、 TCP/I Pのプロトコルスタックのコンパクト化 の実現に資することができるデータ処理方法を提供することにある。  The present inventor has studied support for the TCP / IP protocol in network home appliances and the like. In particular, we examined TCP / IP protocol protocols that can operate on internal ROM / RAM such as a 16-bit microcomputer for embedded control. According to this, there is no idea that the already defined protocols will save resources extremely. Implementing the TCP / IP protocol according to the details of such a protocol requires a large storage ROM to store the protocol stack, and a large work RAM to execute the protocol stack. . The technology described in the above-mentioned patent document differs from the technology studied by the present inventor in the point of view. An object of the present invention is to make it possible to realize a network connection by a TCP / IP protocol for a small-scale system such as a network home appliance. Another object of the present invention is to provide a data processing method that can contribute to the realization of a compact TCP / IP protocol stack.
本発明の上記並びにその他の目的と新規な特徴は本明細書の以下の 記述と添付図面から明らかにされるであろう。  The above and other objects and novel features of the present invention will become apparent from the following description of the present specification and the accompanying drawings.
〔 1〕本発明に係るマイクロコンピュー夕は、 中央処理装置、 RAM及 び R OMを含み 1個の半導体チップに形成され、前記 R OMはオペレー ティングシステムと、 アプリケ一ションプログラムと、 前記アプリケー シヨンプログラムから呼び出されて実行される T C P/ I P用処理プ ログラムとが格納され、 前記 T CP/I P用処理プログラムは、接続要 求、 イベント待ち、 データ送信、 及び接続切断の処理プログラムを有す る。前記中央処理装置は、 ィベント待ちの処理プログラムの実行中に夕 スクスィ ツチ指令例えばデ一夕受信割込みに応答してパケッ トデ一夕 の一部を RAMに読み込み当該パケッ トデ一夕を必要とするときはィ ベン 卜待ち状態から起床し、アプリケーションプログラムを実行して対 応するバケツ トデ一夕を RAMに取り込む。 [1] A microcomputer according to the present invention is formed on one semiconductor chip including a central processing unit, a RAM, and a ROM, and the ROM is an operating system, an application program, and the application program. A TCP / IP processing program called and executed by the content program is stored. The TCP / IP processing program has a connection request, event waiting, data transmission, and connection disconnection processing programs. You. The central processing unit reads a part of the packet data into the RAM in response to an evening switch command, for example, a data overnight reception interrupt during execution of the processing program waiting for the event, and reads the packet data and needs the packet data overnight. Wakes up from the event wait state, executes the application program, and loads the corresponding bucket data into RAM.
M A C層における受信パケッ トデータの一部をマイクロコンピュー 夕のオンチップ RAMに取り込んで解析すればよいからワーク RAM にそのバケツ トデ一夕の全てを取り込んで展開するような処理を要せ ず、 必要とするワーク RAMのサイズが小さくて済む。 また、 前記解析 の結果に従ってパケッ トデ一夕をオンチップ RAMに取り込む処理は アプリケーションプログラムで直接行い、プロ トコルス夕ックを用いな い。 よって、 プロ トコルスタックのコンパク ト化に資することができる。 〔2〕本発明の別の観点によるマイクロコンピュー夕は、 中央処理装置、 RAM及び ROMを含み 1個の半導体チップに形成され、前記 ROMは オペレーティングシステムと、 アプリケ一ションプログラムと、 前記ァ プリケーシヨンプログラムから呼び出されて実行される T C P / I P 用処理プログラムとが格納され、前記 RAMは C PUがプログラムを実 行するときのワーク領域に用いられ、前記 T C P/I P用処理プログラ ムは、 サービス開始、 接続要求、 イベント待ち、 データ送信、 及び接続 切断の処理プログラムを有する。  A part of the received packet data in the MAC layer can be fetched into the on-chip RAM of the microcomputer and analyzed, so there is no need to process all the bucket data into the work RAM and expand it. The size of the work RAM to be used is small. Also, the process of loading the packet data into the on-chip RAM according to the result of the analysis is performed directly by the application program, and does not use the protocol block. Therefore, it can contribute to making the protocol stack compact. [2] A microcomputer according to another aspect of the present invention includes a central processing unit, a RAM, and a ROM, and is formed on one semiconductor chip. The ROM includes an operating system, an application program, and the application program. The RAM is used as a work area when the CPU executes the program, and the TCP / IP processing program is called a service program. It has a start, connection request, event wait, data transmission, and disconnection processing programs.
前記ィベン ト待ちの処理プログラムにィベン ト待ち状態からの起床 要因が与えられることによってアプリケーションプログラムに戻って 必要なパケッ トデ一夕の取り込み等を直接行うことが可能になる。 本発明の具体的な一形態として、前記ィベント待ちで待つべきィベン トは、 接続確立、 接続切断、 データ受信、 イベント待ちのタイムアウ ト としてよい。前記ィベント待ちの処理プログラムにて待つべきィベント の種類は前記アプリケーションプログラムによって指定するのがよい。 このとき、 前記ィベント待ちの処理プログラムは、 所定の割込みに応答 して外部よりパケッ トデ一夕の所定の一部デ一夕を R A Mに取り込み、 取り込んだデータを検査することで対応バケツ 卜が必要なバケツ トか 否かを判定し、必要と判定されたときにィベント待ちの状態を終了する。 そして、 前記アプリケーションプログラムは、 データ受信のィベント待 ちの状態が終了されるのに応答して、対応受信バケツ トのデ一夕を R A Mに取り込めばよい。 By giving the wake-up factor from the event waiting state to the event waiting processing program, it becomes possible to return to the application program and directly take in the necessary packet data and the like. As a specific form of the present invention, the events to wait for the event wait may be a connection establishment, a connection disconnection, a data reception, and an event wait timeout. The type of event to wait in the event waiting processing program is preferably specified by the application program. At this time, the event waiting processing program needs to take a predetermined bucket of the packet data from the outside into the RAM in response to a predetermined interrupt, and check the received data for a corresponding bucket. It is determined whether the bucket is a proper bucket or not, and if it is determined that it is necessary, the event waiting state is ended. Then, the application program may take in the data of the corresponding reception bucket into the RAM in response to the end of the data reception event waiting state.
上記構成のマイク口コンピュータにおいて前記ォンチップ R A Mの 記憶容量は 2〜 4キロバイ ト程度で済ませることが可能である。  In the microphone computer having the above configuration, the storage capacity of the on-chip RAM can be about 2 to 4 kilobytes.
〔3〕本発明に係るデ一夕受信方法は、 T C P / I Pの M A C層を構成 する通信デバイスのバヅファメモリに格納されたパケッ トデータの所 定部分のデータを読み出してマイクロコンピュー夕のオンチップ R A Mに格納する第 1処理と、前記オンチップ R A Mに格納された前記デー 夕を検査することで、対応バケツ 卜が必要か否かを判定する第 2処理と、 前記判定する処理で前記バケツ トデ一夕が必要と判定された場合、前記 バッファメモリから対応バケツ トデータの必要な部分を前記オンチッ プ R A Mに格納する第 3処理と、 を含む。前記判定する処理で前記パケ ッ トデ一夕が不必要と判定された場合、対応バケツ トデ一夕は廃棄され る。 廃棄とはオンチップ R A Mに格納しないということである。  [3] The data receiving method according to the present invention is a method of reading out a predetermined portion of packet data stored in a buffer memory of a communication device constituting a TCP / IP MAC layer, and reading the data from an on-chip RAM of a microcomputer. A first process for storing the data in the on-chip RAM, a second process for determining whether or not a corresponding bucket is necessary by checking the data stored in the on-chip RAM. And a third process for storing a necessary portion of the corresponding bucket data from the buffer memory in the on-chip RAM when it is determined that evening is necessary. If it is determined in the determining process that the packet data is unnecessary, the corresponding packet data is discarded. Discarding means not storing in on-chip RAM.
第 1処理にて受信バケツ トデ一夕の一部をマイクロコンピュー夕の オンチップ R A Mに取り込んで第 2処理にて解析すればよいからヮー ク R A Mにそのバケツ トデータの全てを取り込んで展開するような処 理を要せず、 必要とするワーク RAMのサイズが小さくて済む。 In the first process, a part of the received bucket data can be fetched into the on-chip RAM of the microcomputer and analyzed in the second process, so that all the bucket data is fetched and expanded in the peak RAM. Where Requires no work, and the required work RAM size is small.
第 1処理及び第 2処理をプロ トコルスタックで規定し、第 3処理をァ プリケ一シヨンプログラムで規定することにより、前記第 3処理による 解析の結果に従ってパケッ トデ一夕をオンチップ RAMに取り込む処 理はアプリケーションプログラムで直接行い、プロ トコルス夕ヅクを用 いないから、プロ トコルスタックのコンパク ト化に資することができる。 本発明の具体的な一形態では、 前記所定部分のデータは、 ィン夕ーネ ッ ト ·プロ トコル .バ一ジヨン 4におけるパケッ トフォーマッ トの先頭 より 13バイ ト目から 42バイ トのデ一夕である。最大ここまでの範囲 で解析すれば、 広義の T CP/I Pプロ トコルに含まれる ARP (ァド レス · リゾリュ一ション · プロ トコル) 、 I CMP (ィン夕一ネッ ト · コントロール ·メッセージ 'プロ トコル) 、 T C P、 UD P (ユーザ · データグラム · プロ トコル) の全てに対処することが可能になる。 図面の簡単な説明  The first process and the second process are defined by the protocol stack, and the third process is defined by the application program, so that the packet data is loaded into the on-chip RAM in accordance with the result of the analysis by the third process. The processing is performed directly by the application program and does not use the protocol block, so it can contribute to making the protocol stack compact. In a specific embodiment of the present invention, the data of the predetermined portion is data of 13 bytes to 42 bytes from the head of the packet format in the in-net protocol. It is evening. By analyzing up to this range, the ARP (Adresor Resolution Protocol) and I CMP (Inner Network Control Message) included in the TCP / IP protocol in a broad sense can be analyzed. Protocol, TCP, and UDP (user datagram protocol). Brief Description of Drawings
第 1図は本発明に係るマイクロコンピュー夕のブロック図である。 第 2図は C P Uのァドレスマツプである。  FIG. 1 is a block diagram of a microcomputer according to the present invention. Figure 2 shows the CUP's quadruple map.
第 3図は TCP/I Pプロ トコルス夕ックが保有する 7種類の A P Iプログラムの種類を示す説明図である。  Fig. 3 is an explanatory diagram showing the seven types of API programs held by the TCP / IP protocol.
第 4図はィベン ト待ち AP Iプログラムで認識するィベン卜の一覧 を示す説明図である。  FIG. 4 is an explanatory diagram showing a list of events recognized by the event waiting API program.
第 5図は TCP/I Pによるバケツ トデ一夕受信処理のフローチヤ ートである。  Fig. 5 is a flowchart of the bucket data overnight reception process by TCP / IP.
第 6図は広義の T C P/ I Pプロ トコルのパケッ トフォーマッ トを 示す説明である。  FIG. 6 is an illustration showing the packet format of the TCP / IP protocol in a broad sense.
第 7図はバッファメモリからバケツ トデ一夕の 42バイ トを取り出 す様子を模式的に示す説明図である。 Fig. 7 shows 42 bytes of bucket data from buffer memory FIG. 4 is an explanatory view schematically showing the appearance.
第 8図は第 5図のプロ トコル解析処理( S 4 )の詳細を示すフローチ ヤー卜である。  FIG. 8 is a flowchart showing details of the protocol analysis processing (S4) of FIG.
第 9図は TCP/I Pによる受動接続処理のフローチャートである。 第 10図は TCP/I Pによる能動接続処理のフローチヤ一トであ る。  FIG. 9 is a flowchart of a passive connection process by TCP / IP. FIG. 10 is a flowchart of the active connection processing by TCP / IP.
第 1 1図は T C P/ I Pによるデ一夕送信処理のフローチヤ一トで ある。  FIG. 11 is a flowchart of the overnight transmission processing by TCP / IP.
第 1 2図は T C P/I P接続に対する強制切断のフローチヤ一卜で ある。  FIG. 12 is a flowchart of the forced disconnection for the TCP / IP connection.
第 13図は T CP/I P接続に対する通常切断のフローチヤ一トで ある。 発明を実施するための最良の形態  Fig. 13 is a flowchart of normal disconnection for TCP / IP connection. BEST MODE FOR CARRYING OUT THE INVENTION
第 1図には本発明に係るマイクロコンピュー夕のブロック図が示さ れる。 同図に示されるマイクロコンビュー夕 1は、 特に制限されないが、 相補型 M 0 S集積回路製造技術などにより、単結晶シリコンのような 1 個の半導体基板上に形成されて 1個のチップ若しくはペレツ ト状にさ れ、 必要に応じてパッケージングされている。  FIG. 1 shows a block diagram of a microcomputer according to the present invention. The micro-computer 1 shown in the figure is not particularly limited, but is formed on a single semiconductor substrate such as single-crystal silicon by a complementary MOS integrated circuit manufacturing technology or the like, and is configured as a single chip or a single chip. Pelletized and packaged as needed.
マイクロコンピュー夕 1は、 特に制限されないが、 CPU (中央処理 装置) 2、 クロック発振器 3、 割込みコントロ一ラ 4、 DMAC (ダイ レク ト 'メモリ 'アクセス 'コントローラ) 5、 フラッシュメモリのよ うな書換え可能な不揮発性メモリ又はマスク ROMなどによって構成 される ROM (リード -オンリ -メモリ) 6、 SRAM (スタティ ック · ランダム 'アクセス ·メモリ) 等によって構成される RAM 7、 リフレ ヅシュコントローラ 8、クロックサイクル数によりシステムの動作異常 を監視する WD T (ウォッチ ' ドッグ '夕イマ) 9、 TCU (夕イマ ' カウン夕 'ユニッ ト) 10、 SC I (シリアル 'コミュニケーション ' ィン夕フェース) 1 1、 U S Β (ユニバーサル 'シリアル 'バス) 12、 AD (アナログ 'ディジタル) 変換器 13、 バスコントローラ 14、 及 び入出力ポート 15を有し、それらは参照符号 16で代表される内部バ スに接続される。 The microcomputer 1 is not particularly limited, but is rewritten as a CPU (central processing unit) 2, a clock oscillator 3, an interrupt controller 4, a DMAC (direct 'memory'access' controller) 5, and a flash memory. ROM (read-only-memory) 6, composed of possible non-volatile memory or mask ROM, RAM 7, composed of SRAM (static random access memory), refresh controller 8, clock Abnormal operation of the system due to the number of cycles Monitor WD T (Watch 'Dog' evening) 9, TCU (East 'Counter' unit) 10, SCI (Serial 'Communication' interface) 1 1, US Β (Universal 'Serial' It has a bus 12, an AD (analog-to-digital) converter 13, a bus controller 14, and an input / output port 15, which are connected to an internal bus represented by reference numeral 16.
前記 CPU 2は、 図示は省略するが、 命令制御部と実行部を有する。 命令制御部は R OM 6などに格納されているプログラムをアクセスし て命令をフェッチし、フェッチした命令を解読して制御情報を生成する。 実行部は前記制御情報に従って演算やオペランドアクセスなどを行な つて命令を実行する。 .  Although not shown, the CPU 2 has an instruction control unit and an execution unit. The instruction control unit accesses a program stored in the ROM 6 or the like to fetch an instruction, decodes the fetched instruction, and generates control information. The execution unit executes an instruction by performing an operation, an operand access, or the like according to the control information. .
特に制限されないが、入出力ポート 15にはネッ トワークィン夕フエ ースカード (N I C)を構成するイーサネヅ トデバイス 20が接続され る。イーサネッ トデバイス 20はイーサネッ トケーブル 2 1に接続され、 M A C層のバケツ ト通信処理を行なうハードウェアのネッ トワークィ ン夕フヱースを実現する。特に制限されないが、 ィーサネッ トデバイス 20はイーサネッ トコントローラ 22、 バッファメモリ 23、 及びィー サネッ トケーブル 2 1に結合する トランシーバ ·レシーバ 24等を有す o  Although not particularly limited, the input / output port 15 is connected to an Ethernet device 20 constituting a network interface card (NIC). The Ethernet device 20 is connected to the Ethernet cable 21 and implements a network interface of hardware that performs bucket communication processing of the MAC layer. Although not particularly limited, the Ethernet device 20 includes an Ethernet controller 22, a buffer memory 23, and a transceiver / receiver 24 coupled to the Ethernet cable 21.
マイクロコンビユー夕 1は、 TCP/ I Pプロ トコルによるデ一夕通 信を行なうのに、バケツ ト通信処理を行なうハードウエアのイーサネッ トデバイス 20と CPU2が処理するソフ トウエアのプロ トコルス夕 ヅクとしての TCP/I P用処理プログラム(単に T CP/ I Pプロ ト コルス夕ヅクとも称する) を用いる。 T C P/ I Pプロ トコルスタック はアプリケ一ションプログラムから呼び出されて実行される。アプリケ ーションプログラムとはブラゥザソフ トウェァゃメールソフ トウェア などである。それら TCP/I Pプロ トコルス夕ック及びアプリケ一シ ョンプログラムはォペレ一ティングシステム (OS)等と一緒に前記 R 0M 6が保有する。 Micro-combination 1 is a protocol protocol for hardware that performs bucket communication processing and software that is processed by CPU 2 for data communication using the TCP / IP protocol. Use a TCP / IP processing program (also simply called TCP / IP protocol block). The TCP / IP protocol stack is called from the application program and executed. What is an application program? Browser software Email software And so on. The TCP / IP protocol and application programs are owned by the R0M6 together with the operating system (OS).
第 2図には CPU2のアドレスマツプが例示される。 R0M6のアド レス空間には、 先頭から、 ベクタ、 OS、 T CP/I Pプロ トコルス夕 ック、 及びアプリケ一ションプログラムが配置される。 アプリケーショ ンプログラムはデータ通信以外のプログラムも含まれ、マイクロコンピ ユー夕 1の利用者の必要に応じて組み込まれる所謂ユーザプログラム として把握してよい。 RAM7のァドレス空間には、 OSのワーク領域 (OSワーク) 、 ス夕ック領域、 T CP/I Pプロ トコルス夕ヅク用の ワーク領域 (TCPZI Pワーク) 、 アプリケーションプログラム用の ワーク領域 (ユーザワーク) が割当てられる。  FIG. 2 illustrates an address map of the CPU 2. In the address space of R0M6, vectors, OS, TCP / IP protocol blocks, and application programs are arranged from the top. Application programs include programs other than data communication, and may be understood as so-called user programs that are incorporated as needed by the user of the microcomputer. In the address space of RAM7, there are an OS work area (OS work), a work area, a work area for TCP / IP protocol work (TCPZIP work), and a work area for application programs (user work). Is assigned.
第 3図には T C P/ I Pプロ トコルス夕ックが保有する 7種類の A P Iプログラムの種類が示される。サービス開始 A P Iプログラムは T CP/I P通信のための初期設定を行なう処理プログラムである。初期 設定項目として例えばイーサネッ トデバイス 20の初期化、 T CP/I Pワークの初期化などがある。受動接続設定 A P Iプログラムは、 接続 されるのを待っために自ポートの I Pアドレスとポート番号を設定す る処理プログラムである。能動接続要求 A P Iプログラムは接続を要求 する相手ポートを設定する処理プログラムとされる。イベント待ち AP Iプログラムは設定や要求に対する応答を待つ処理プログラムである。 デ一夕送信 AP Iプログラムはデータを送信する処理プログラムであ る。接続のクローズ A P Iプログラムは自らの接続を遮断し、 相手側の 接続遮断は相手に任せる処理プログラムとされる。接続の強制切断 AP Iプログラムは自らの接続と相手側の接続を共に強制遮断する処理プ ログラムとされる。イベント待ち AP Iプログラムは所定のィベント発 生を待っための処理プログラムとされる。 Figure 3 shows the seven types of API programs held by the TCP / IP protocol. The service start API program is a processing program that performs initial settings for TCP / IP communication. The initial setting items include, for example, initialization of the Ethernet device 20, initialization of the TCP / IP work, and the like. The passive connection setting API program is a processing program that sets the IP address and port number of its own port in order to wait for connection. The active connection request API program is a processing program that sets the partner port that requests connection. The event waiting API program is a processing program that waits for a response to a setting or request. Data transmission API program is a processing program that transmits data. Closing a connection The API program is a processing program that disconnects its own connection and leaves the disconnection of the partner to the partner. Forcibly disconnecting the connection The API program is a processing program that forcibly cuts off both its own connection and the connection of the other side. Awaiting event API program starts a specified event It is a processing program for waiting for life.
第 4図にはイベン ト待ち A P Iプログラムが認識するィベントのー 覧が示される。認識すべきィベントは、 受動接続設定 A P Iプログラム 又は能動接続 A P Iプログラムの実行後に確認すべき受動/能動接続 の確立、接続のクローズ A P Iプログラムの実行後に確認すべきクロー ズ完了、接続の強制切断 A P Iプログラムの実行後に確認すべき強制ク ローズ、 データ受信があつたというデータ受信、 データ送信の A P Iプ ログラムの実行後に確認すべきデータ送信完了、ィベント待ち A P Iプ ログラムによるイベン ト待ちのタイムアウ ト (ウェイ 卜のタイムァゥ ト) 、 とされる。 どのイベントを待つのかはフラグなどによってアプリ ケ一シヨンプログラムから指示される。  FIG. 4 shows a list of events recognized by the API program waiting for events. The events to be recognized are: passive / active connection establishment to be confirmed after the execution of the passive connection setting API program or active connection API program, closing of the connection to be confirmed after execution of the closing API program, and forced disconnection of the connection API program To be confirmed after execution of data transmission, data reception indicating that data has been received, completion of data transmission to be confirmed after execution of the API program for data transmission, timeout of event waiting by event waiting API program (waiting)タ イ ム タ イ ム) 、 と と. Which event to wait for is indicated from the application program by a flag or the like.
第 5図には T C P / I Pによるバケツ トデ一夕受信処理のフローチ ャ一卜が例示される。パケッ トデ一夕受信処理は、 サービス開始 A P I プログラムが実行されて通信設定の初期化が完了され、 その上で、 受動 接続設定又は能動接続設定の A P Iプログラムが実行されて接続が確 立されていることが前提とされる。 この前提の下で、 アプリケーション プログラムからデ一夕受信ィベン卜のフラグがセッ 卜され、ィベント待 ち A P Iプログラムが呼び出されて実行される。これによる実行内容が 第 5図の処理であり、 先ず、 ィーサネッ トデバイス 2 0からパケッ トデ —夕の受信割り込みを待つ ( S 1 ) 。  FIG. 5 illustrates a flow chart of the bucket data overnight receiving process by TCP / IP. In the packet data overnight reception process, the service start API program is executed to complete the initialization of the communication settings, and then the passive connection setting or active connection setting API program is executed to establish the connection. It is assumed that Under this premise, the application program sets a flag for the overnight reception event, and the API program is called and executed while waiting for the event. The content of the execution by this is the processing of FIG. 5. First, it waits for a packet data—evening reception interrupt from the Ethernet device 20 (S 1).
イーサネッ トデバイス 2 0は受信したパケヅ トデ一夕を順次バッフ ァメモリ 2 3に受信し、データ受信に呼応してパケッ トデ一夕の受信割 り込みをマイクロコンピュー夕 1に出力する。 T C P / I Pによるパケ ッ トデ一夕は、 例えばインターネッ ト 'プロ トコル ·パージヨン 4では 第 6図に示されるフォーマツ トを有し、広義の T C P / I Pプロ トコル に含まれる A R P (ァドレス · リゾリユーシヨン · プロ トコル) 、 I C MP (インターネッ ト 'コント口ール 'メッセージ 'プロ トコル) 、 T C P、 UD P (ユーザ ·デ一夕グラム ·プロ トコル) の全てのプロ トコ ルのバケツ トフォーマツ 卜において、先頭 14バイ 卜が MAC層の制御 情報とされ、 これに続いて、 ヘッダ及び必要なデ一夕が付随する。 I C MPは I Pのエラ一メッセージや制御メヅセージを転送するプロ トコ ルであり T C P/I P接続されているコンピュータ間で互いの状態を 確認するのに用いられる。 TCPはネヅ トワークのトランスポート層の プロ トコルである。 UD Pは信頼性を保証しないトランスポ一ト層の通 信プロ トコルである。第 6図のパケヅ トフォ一マツ 卜において 14バイ トの M A C層制御情報の最後の 2バイ トはバケツ 卜のタイプを示し、そ こから少なく とも 42バイ トのデ一夕を参照することによって当該パ ケッ トデ一夕のプロ トコルの種別、送信先 I Pァドレス及びポート番号 等が解る。要するに、 そのパケッ トデ一夕が通信チャネルとしての機能 上マイクロコンピュー夕が必要とするバケツ トデ一夕であるかがわか る。第 5図の処理フローではパケッ トデ一夕の受信割り込みがあつたと き、バケツ トデ一夕の 42バイ トをバッファメモリ 23から RAM 7に 読み込む (S 2)。 読み込んだデータから当該バケツ 卜が自らの I Pァ ドレス宛てデータであるかを判定し (S 3) 、 そうでなければ当該パケ ッ トデ一夕を廃棄する。廃棄するとは、 当該バケツ トデ一夕をバッファ メモリ 23から RAM7に読み込まないという意味である。ステツプ S 3にて自らの I Pアドレス宛てデ一夕であるかことを判別したときは、 当該パケヅ トデ一夕をバッファメモリ 23から RAM 7に読み込んで、 プロ トコル解析を行なう (S4) 。 これによれば、 MAC層における受 信バケツ トデ一夕の一部をマイクロコンビュー夕 1のオンチップ RA M 7に取り込んで解析すればよいから RAM 7のワーク領域にそのパ ケッ トデータの全てを取り込んで展開するような処理を要せず、必要と するオンチップ RAM 7のサイズが小さくて済む。ちなみに RAM 7の 容量は 2 K〜4 Kバイ ト程度とされる。 The Ethernet device 20 sequentially receives the received packet data into the buffer memory 23, and outputs a reception interrupt of the packet data to the microcomputer 1 in response to the data reception. For example, the Internet Protocol Protocol Purge 4 has the format shown in Fig. 6 and uses the ARP (address resolution solution protocol) included in the broadly defined TCP / IP protocol. Tokor), IC In the bucket format of MP (Internet 'control' message 'protocol), TCP, and UDP (user datagram protocol), the first 14 bytes are the MAC layer. This is followed by a header and necessary data. ICMP is a protocol for transferring IP error messages and control messages, and is used to confirm the status of computers connected by TCP / IP. TCP is a protocol of the network transport layer. UDP is a transport layer communication protocol that does not guarantee reliability. In the packet format shown in FIG. 6, the last two bytes of the 14-byte MAC layer control information indicate the type of the bucket, from which a reference can be made by referring to the data of at least 42 bytes. The protocol type, destination IP address, port number, etc. of the packet data are understood. In other words, it can be seen that the packet data is a packet data required by the microcomputer as a function of the communication channel. In the processing flow of FIG. 5, when a reception interrupt of the packet data is received, 42 bytes of the packet data are read from the buffer memory 23 to the RAM 7 (S2). From the read data, it is determined whether or not the bucket is data addressed to its own IP address (S3). Otherwise, the packet is discarded. Discarding means that the bucket data is not read from the buffer memory 23 to the RAM 7. If it is determined in step S3 that the data is destined for its own IP address, the packet data is read from the buffer memory 23 into the RAM 7 and the protocol is analyzed (S4). According to this, a part of the received packet data in the MAC layer can be taken into the on-chip RAM 7 of the microcomputer 1 and analyzed, so that all the packet data is stored in the work area of the RAM 7. There is no need for processing to capture and deploy The size of the on-chip RAM 7 to be used can be small. Incidentally, the capacity of RAM 7 is about 2K to 4K bytes.
第 7図にはバッファメモリ 23からパケヅ トデ一夕の 42バイ トを 取り出す様子が模式的に示される。バッファメモリ 23はリングバッフ ァとして動作される。リングバッファのパケッ トデ一夕はページ単位で 管理される。イーサネッ トコントローラ 23は RAM 7に対する MM U 機能を有し、 CPU 2はこれを利用して、 ページ内のパケッ トデ一夕に 対して 13バイ ト目から 42バイ トのデ一夕を RAM 7のワーク領域 (TCP/I Pワーク) に読み込む。  FIG. 7 schematically shows a state in which 42 bytes of a packet data are taken out from the buffer memory 23. The buffer memory 23 operates as a ring buffer. The packet data of the ring buffer is managed in page units. The Ethernet controller 23 has an MMU function for the RAM 7, and the CPU 2 uses this to transfer the data from the 13th byte to the 42th byte of the packet data in the page from the 13th byte to the packet data in the page. Read in the work area (TCP / IP work).
第 8図には第 5図のプロ トコル解析処理(S 4)の詳細が例示される。 FIG. 8 illustrates details of the protocol analysis processing (S4) in FIG.
CPU2は RAM7に読み込んだ 42バイ トのバケツ トデ一夕に基づ いて当該パケッ トデ一夕のプロ トコルが ARP、 I CMP、 TCP, U D Pなどのどれに該当するかを判定する。 AR Pの場合には AR P返答 を送信し、 I CMPの場合には I CM P返答を返す。 TCPに対しては ポ一ト番号と I Pァドレスを確認し、自らのァドレス宛てでなければ当 該パケッ トデ一夕は廃棄されている。 自らのァドレス宛ての場合に、 そ れが制御用パケッ トであれば T C P返信を返し、データパケッ トであれ ばィベント待ち状態から起床する。 ここで、 ィベント待ち状態から起床 するとは、イベント待ち AP Iプログラムの実行を終了することであり、 CPU 2の制御はアプリケーションプログラムに移行し、アプリケ一シ ョンプログラムにしたがって対応するバケツ トデ一夕のデータ部(転送 データ) がバッファメモリ 23から RAM 7に転送される。 アプリケー シヨンプログラムは RAM 7に転送されたパケヅ トデ一夕に対して所 要のデータ処理を行なう。 これによれば、 前記解析の結果に従ってパケ ッ トデータをオンチップ RAM 7に取り込む処理はアプリケ一ション プログラムで直接行い、 プロ トコルスタックを用いない。 よって、 プロ トコルスタックのコンパク ト化に資することができる。例えば R 0 M 6 の容量は 32 Kバイ トである。 Based on the 42-byte packet data read into the RAM 7, the CPU 2 determines whether the protocol of the packet data corresponds to ARP, I CMP, TCP, UDP, or the like. In the case of ARP, an ARP reply is transmitted, and in the case of I CMP, an I CMP reply is returned. For TCP, the port number and IP address are checked, and if it is not addressed to its own address, the packet data is discarded. When it is addressed to its own address, if it is a control packet, it returns a TCP reply, and if it is a data packet, it wakes up from the event wait state. Here, to wake up from the event waiting state means to end the execution of the event waiting API program, control of the CPU 2 is shifted to the application program, and the data of the corresponding bucket data is transferred according to the application program. Part (transferred data) is transferred from the buffer memory 23 to the RAM 7. The application program performs necessary data processing on the packet data transferred to the RAM 7. According to this, the process of taking the packet data into the on-chip RAM 7 according to the result of the analysis is directly performed by the application program, and does not use the protocol stack. Therefore, professional This can contribute to the compactness of the Tocol stack. For example, the capacity of R0M6 is 32K bytes.
T CPの場合 42バイ 卜のパケッ トデ一夕に対するプロ トコル解析 によってィベン卜の発生が認識されるものがある。そのようなィベント の認識は、 第 8図では、 接続確立 (S LEV— CONNE CT)、 接続 要求の成功、 デ一夕送信完了 (S LEV— TEND)、 接続切断 (SL E V— R S T)、 及び切断要求の成功 (SLEV_CLS) とされる。 ちなみにデ一夕受信ィベント (SLEV— RX)は Rx割り込みで認識 される。 ィベン卜が認識されると、 対応するィベント待ち状態から起床 され、そのィベントに応じて C P U 2の処理がアプリケ一ションプログ ラムに移行され、 或いは別の A P Iプログラムに移行される。  In the case of TCP, the occurrence of an event is recognized by protocol analysis for a packet of 42 bytes. In FIG. 8, the recognition of such an event is as follows: connection establishment (S LEV—CONNECT), connection request success, data transmission complete (S LEV—TEND), connection disconnection (SL EV—RST), and The disconnection request succeeded (SLEV_CLS). Incidentally, the data reception event (SLEV—RX) is recognized by the Rx interrupt. When the event is recognized, the CPU wakes up from the corresponding event waiting state, and shifts the processing of the CPU 2 to the application program or shifts to another API program according to the event.
第 8図では U D Pが認識されたときの処理について特に図示してい ないが、 T C Pの場合とほぼ同様に考えることが可能である。 但し、 T CPよりは簡素化される。 また、 システムで対応していないその他のプ 口 トコルに対してはそのバケツ トデ一夕は廃棄される。  Although FIG. 8 does not particularly show the processing when the UDP is recognized, it can be considered in substantially the same manner as in the case of TCP. However, it is simpler than TCP. For other protocols not supported by the system, the bucket data is discarded.
第 9図には TCP/I Pによる受動接続処理のフローチヤ一トが例 示される。アプリケーションプログラムによって受動接続 AP Iプログ ラムの実行が指定されると、受動接続設定の A P Iプログラムがプロ ト コルス夕ックから呼び出され、自ポー卜の I Pアドレスとポ一ト番号が 設定され、 次に、 ィベント待ち AP Iプログラムを実行して接続確立の イベント発生を待つ。 そのイベント発生により、 ィベント待ち状態から 起床し、 接続が確立される。  FIG. 9 shows a flow chart of the passive connection processing by TCP / IP. When the execution of the passive connection API program is specified by the application program, the API program for the passive connection setting is called from the protocol interface, and the IP address and port number of its own port are set. Then, it waits for the event of the connection establishment by executing the API waiting API program. When the event occurs, it wakes up from the event waiting state and the connection is established.
第 10図には TCP/I Pによる能動接続処理のフローチヤ一トが 例示される。アプリケ一シヨンプログラムによって能動接続 AP Iプロ グラムの実行が指定されると、能動接続要求の A P Iプログラムがプロ トコルス夕ックから呼び出され、相手ポー卜の I Pアドレスとポート番 号が設定され、 次に、 イベント待ち AP Iプログラムを実行して接続確 立のィベント発生を待つ。 そのイベント発生により、 ィベント待ち状態 から起床し、 接続が確立される。 FIG. 10 illustrates a flow chart of the active connection processing by TCP / IP. When the execution of the active connection API program is specified by the application program, the API program of the active connection request is called from the protocol interface, and the IP address and port number of the partner port are set. The event is set, and then the event waiting API program is executed to wait for an event to establish a connection. When the event occurs, the computer wakes up from the event waiting state and the connection is established.
第 1 1図には T CP/I Pによるデータ送信処理のフローチヤ一ト が例示される。ィベント待ち AP Iプログラムを実行してデ一夕受信ィ ベントの発生を待つ。データ受信ィベントが発生すると、 イベント待ち 状態から起床し、アプリケ一シヨンプログラムに従って第 5図で説明し た処理が行なわれ、送信に必要なイーサネッ トデバイス上の受信ページ 番号とデータ長をバッファメモリ 23から RAM 7に取得する。次にデ 一夕送信 A P Iプログラムの実行に移行し、 RAM 7上のデータをバッ ファメモリ 23に転送し、 イーサネッ トデバイスに送信させる。  FIG. 11 illustrates a flowchart of a data transmission process by TCP / IP. Wait for event Executes the API program and waits for the occurrence of an overnight reception event. When a data reception event occurs, it wakes up from the event wait state, performs the processing described in FIG. 5 according to the application program, and stores the reception page number and data length on the Ethernet device required for transmission in the buffer memory 23. From RAM 7 Next, the process shifts to execution of the data transmission API program, and transfers the data in the RAM 7 to the buffer memory 23 to be transmitted to the Ethernet device.
第 12図には T CP/I P接続に対する強制切断のフローチヤ一ト が例示される。 C P U 2は接続の強制切断 A P Iプログラムを実行すれ ばよい。  FIG. 12 illustrates a flowchart of the forced disconnection for the TCP / IP connection. CPU 2 only needs to execute the API program forcibly disconnecting the connection.
第 13図には T C P / I P接続に対する通常切断のフローチヤ一ト が例示される。 C P U 2は接続のクローズ A P Iプログラムを実行して からイベント待ち AP Iプログラムを実行して接続相手先からのク口 ーズ完了のィベント発生を待つ。クローズ完了のィベント発生に起因し て当該ポート番号による通信を終了する。  FIG. 13 illustrates a flow chart of normal disconnection for the TCP / IP connection. CPU 2 executes the API program to close the connection, waits for an event, executes the API program, and waits for the occurrence of a close completion event from the connection partner. The communication by the port number is terminated due to the occurrence of the close completion event.
以上本発明者によってなされた発明を実施例に基づいて具体的に説 明したが本発明はそれに限定されるものではなく、その要旨を逸脱しな い範囲において種々変更可能である。  The invention made by the present inventor has been specifically described based on the embodiments, but the present invention is not limited thereto, and can be variously modified without departing from the gist thereof.
例えば、 RAM及び ROMの記憶容量は上記説明に限定されず適宜変 更可能である。 また、 マイクロコンピュータとは CPUを有するシステ ムオンチップの半導体集積回路を総称する概念のものでさる。 CPUは 1 6ビッ ト CPUに限定されず、 32ビッ ト CPUなどであってもよい。 用途から言えば特別に高機能な C P Uは必要ない。 また、 プロ トコルス 夕ックの処理プログラムの種類や処理内容についても適宜変更可能で ある。更に、 バケツ トデ一夕の一部をバッファメモリからオンチップ R A Mに転送するときのタスク切替はデ一夕受信割り込みに限定されず、 その他のタスクスィッチ指令に応答して行なってもよい。 産業上の利用可能性 For example, the storage capacities of RAM and ROM are not limited to the above description and can be changed as appropriate. The term “microcomputer” is a general term for a system-on-chip semiconductor integrated circuit having a CPU. The CPU is not limited to a 16-bit CPU, but may be a 32-bit CPU or the like. From an application point of view, no specially sophisticated CPU is required. In addition, the type and processing content of the protocol processing program can be changed as appropriate. Further, the task switching when transferring a part of the bucket data from the buffer memory to the on-chip RAM is not limited to the data reception interrupt, and may be performed in response to another task switch command. Industrial applicability
本発明は、ネッ トワーク家電や携帯端末等に代表される小規模でデー 夕処理性能が比較的低いシステムにおける T C P / I Pイ ン夕フエ一 ス等に広く適用することができる。  INDUSTRIAL APPLICABILITY The present invention can be widely applied to a TCP / IP interface in a small-scale system with relatively low data processing performance typified by network home appliances and mobile terminals.

Claims

請 求 の 範 囲 The scope of the claims
1. 中央処理装置、 RAM及び ROMを含み 1個の半導体チップに形成 されたマイクロコンピュ一夕であって、 1. A micro-computer formed on a single semiconductor chip including a central processing unit, RAM and ROM,
前記 ROMはオペレーティングシステムと、アプリケーションプログ ラムと、前記アプリケ一シヨンプログラムから呼び出されて実行される T CP/I P用処理プログラムとが格納され、  The ROM stores an operating system, an application program, and a TCP / IP processing program called and executed by the application program.
前記 T CP/I P用処理プログラムは、 接続要求、 ィベント待ち、 デ The TCP / IP processing program executes a connection request, an event wait,
—夕送信、 及び接続切断の処理プログラムを有し、 —Having a program for evening transmission and disconnection,
前記中央処理装置は、ィベント待ちの処理プログラムの実行中にタス クスィツチ指令に応答してバケツ トデ一夕の一部を RAMに読み込み 当該バケツ トデ一夕を必要とするときはィベント待ち状態から起床し、 アプリケーションプログラムを実行して対応するバケツ トデ一夕を R AMに取り込むことを特徴とするマイクロコンピュー夕。  The central processing unit reads a part of the bucket data into the RAM in response to the task switch command during execution of the event waiting processing program, and wakes up from the event waiting state when the bucket data is needed. The microcomputer is characterized by executing an application program and loading the corresponding bucket data into the RAM.
2.前記タスクスィツチ指令はデータ受信割り込みであることを特徴と する請求の範囲第 1項記載のマイクロコンビュー夕。 2. The micro computer system according to claim 1, wherein the task switch command is a data reception interrupt.
3. 中央処理装置、 RAM及び R OMを含み 1個の半導体チップに形成 されたマイクロコンピュー夕であって、 3. A microcomputer formed on a single semiconductor chip, including a central processing unit, RAM and ROM,
前記 ROMはオペレーティングシステムと、アプリケーションプログ ラムと、前記アプリケーションプログラムから呼び出されて実行される T C P/I P用処理プログラムとが格納され、  The ROM stores an operating system, an application program, and a TCP / IP processing program called and executed by the application program.
前記 RAMは C P Uがプログラムを実行するときのワーク領域に用 いられ、  The RAM is used as a work area when the CPU executes a program,
前記 T CP/I P用処理プログラムは、 サービス開始、 接続要求、 ィ ベント待ち、 データ送信、 及び接続切断の処理プログラムを有すること を特徴とするマイクロコンピュー夕。 The microcomputer according to claim 1, wherein the TCP / IP processing program includes a service start, connection request, event wait, data transmission, and connection disconnection processing programs.
4 . 前記ィベント待ちで待つべきィベントは、 接続確立、 接続切断、 デ —夕受信、ィベント待ちのタイムァゥ トであることを特徴とする請求の 範囲第 3項記載のマイクロコンピュー夕。 4. The microcomputer according to claim 3, wherein the events to be waited for in the event wait are connection establishment, connection disconnection, data reception, and event wait time intervals.
5 .前記ィベント待ちの処理プログラムにて待つべきィベン卜の種類は 前記アプリケーシヨンプログラムによって指定されることを特徴とす る請求の範囲第 4項記載のマイクロコンピュー夕。  5. The microcomputer according to claim 4, wherein a type of an event to be waited in the event waiting processing program is specified by the application program.
6 . 前記ィベント待ちの処理プログラムは、 所定の割込みに応答して外 部よりバケツ トデ一夕の一部のデータを R A Mに取り込み、取り込んだ データを検査することで対応パケッ トが必要なバケツ トか否かを判定 し、必要と判定されたときにィベント待ちの状態を終了することを特徴 とする請求の範囲第 5項記載のマイクロコンピュー夕。  6. In response to a predetermined interrupt, the processing program waiting for the event fetches a part of the data of the bucket from the outside into the RAM, inspects the fetched data, and executes a packet requiring a corresponding packet. 6. The microcomputer according to claim 5, wherein it is determined whether or not the event has occurred, and when it is determined that the event is necessary, the event waiting state is terminated.
7 . 前記アプリケーションプログラムは、 データ受信のィベント待ちの 状態が終了されるのに応答して、対応受信パケッ トのデ一夕を R A Mに 取り込むことを特徴とする請求の範囲第 6項記載のマイクロコンピュ 一夕。  7. The microcontroller according to claim 6, wherein the application program fetches the data of the corresponding reception packet into the RAM in response to the end of the data reception event waiting state. Compu overnight.
8 .前記 R A Mは 2〜4キロバイ トであることを特徴とする請求の範囲 第 7項記載のマイクロコンピュー夕。  8. The microcomputer according to claim 7, wherein said RAM is 2 to 4 kilobytes.
9 .通信デバイスのバッファメモリに格納されたパケッ トデ一夕の一部 のデータを読み出してマイクロコンピュー夕のオンチップ R A Mに格 納する処理と、  9.A process of reading a part of the packet data stored in the buffer memory of the communication device and storing it in the on-chip RAM of the microcomputer,
前記オンチップ R A Mに格納された前記データを検査することで、対 応バケツ 卜が必要か否かを判定する処理と、  Inspecting the data stored in the on-chip RAM to determine whether a corresponding bucket is required; and
前記判定する処理で前記バケツ トデ一夕が必要と判定された場合、前 記バッファメモリから対応パケッ トデ一夕の必要な部分を前記オンチ ップ R A Mに格納する処理と、を含むことを特徴とするデータ受信方法。 Storing the necessary portion of the corresponding packet data from the buffer memory in the on-chip RAM when the packet data is determined to be necessary in the determining process. Data receiving method.
1 0 . 前記第 1処理及び第 2処理はプロ トコルスタックで規定され、 前 記第 3処理はアプリケーションプログラムで規定されることを特徴と する請求の範囲第 9項記載のデータ受信方法。 10. The first process and the second process are defined by the protocol stack. 10. The data receiving method according to claim 9, wherein the third processing is specified by an application program.
1 1 .前記判定する処理で前記バケツ トデ一夕が不必要と判定された場 合、対応バケツ トデ一夕は廃棄されることを特徴とする請求の範囲第 9 項記載のデータ受信方法。  11. The data receiving method according to claim 9, wherein, if the bucket data is determined to be unnecessary in the determination processing, the corresponding bucket data is discarded.
1 2 . 前記所定部分のデータは、 ィン夕ーネッ ト ·プロ トコル ·パージ ヨン 4におけるバケツ トフォーマツ 卜の先頭より 1 3バイ ト目から 4 2バイ トのデ一夕であることを特徴とする請求の範囲第 1 0項又は第 1 1項記載のデ一夕受信方法。  12. The data of the predetermined portion is characterized in that it is a data of 42 bytes from the 13th byte from the beginning of the bucket format in the Internet Protocol Protocol 4. 12. The data receiving method according to claim 10 or 11.
PCT/JP2003/016855 2003-12-26 2003-12-26 Microcomputer and data receiving method WO2005066807A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/JP2003/016855 WO2005066807A1 (en) 2003-12-26 2003-12-26 Microcomputer and data receiving method
JP2005513090A JP4252577B2 (en) 2003-12-26 2003-12-26 Microcomputer and data receiving method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2003/016855 WO2005066807A1 (en) 2003-12-26 2003-12-26 Microcomputer and data receiving method

Publications (1)

Publication Number Publication Date
WO2005066807A1 true WO2005066807A1 (en) 2005-07-21

Family

ID=34746760

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2003/016855 WO2005066807A1 (en) 2003-12-26 2003-12-26 Microcomputer and data receiving method

Country Status (2)

Country Link
JP (1) JP4252577B2 (en)
WO (1) WO2005066807A1 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20010015984A1 (en) * 2000-02-23 2001-08-23 Dirk-Holger Lenz Creation of a protocol stack
JP2003518788A (en) * 1999-10-22 2003-06-10 ローク マナー リサーチ リミテッド Fully integrated web-operated control and monitoring device
JP2003308262A (en) * 2002-04-08 2003-10-31 Wiznot Corp Internet communication protocol system realized by hardware protocol processing logic and data parallel processing method using the system
JP2003333066A (en) * 2002-05-09 2003-11-21 Nippon Telegr & Teleph Corp <Ntt> Communication method and device using network interface provided with ip network connecting function

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003518788A (en) * 1999-10-22 2003-06-10 ローク マナー リサーチ リミテッド Fully integrated web-operated control and monitoring device
US20010015984A1 (en) * 2000-02-23 2001-08-23 Dirk-Holger Lenz Creation of a protocol stack
JP2003308262A (en) * 2002-04-08 2003-10-31 Wiznot Corp Internet communication protocol system realized by hardware protocol processing logic and data parallel processing method using the system
JP2003333066A (en) * 2002-05-09 2003-11-21 Nippon Telegr & Teleph Corp <Ntt> Communication method and device using network interface provided with ip network connecting function

Also Published As

Publication number Publication date
JP4252577B2 (en) 2009-04-08
JPWO2005066807A1 (en) 2007-07-26

Similar Documents

Publication Publication Date Title
US10789191B2 (en) Real-time embedded system
US8938610B2 (en) Computing device and method for wireless remote boot in a networked environment
JP5278222B2 (en) Wireless communication apparatus, wireless communication method, and wireless communication program
US7428690B2 (en) Packet communication apparatus
JP2514303B2 (en) Method and system for transferring message to network using virtual device driver
US20180357199A1 (en) Slave-to-slave communication in i3c bus topology
JP2004503855A (en) Integrated processor platform supporting wireless portable multimedia devices
US20080256271A1 (en) Methods and apparatus for reducing storage usage in devices
US20080279098A1 (en) Wireless Receiver Code Download and Boot Sequence
EP3793176A1 (en) Data processing method, device and apparatus
US8469267B2 (en) Method for implementing a wireless personal communication protocol for an IC card
JP4151198B2 (en) Interrupt controller and microcomputer
Bender et al. Unix for nomads: Making unix support mobile computing
US6654865B2 (en) Netbufs: communication protocol packet buffering using paged memory management
WO2005066807A1 (en) Microcomputer and data receiving method
WO2023240941A1 (en) Method and apparatus for downloading data, and secure element
Ribeiro et al. Deploying a Real-Time Operating System on a Reconfigurable Internet of Things End-device
US7568021B2 (en) Hybrid mode network stack under EFI/Tiano based BIOS in modular computing environment
Rajbharti The Microchip TCP/IP Stack
JP2009253723A (en) Communication protocol processing circuit, communication protocol processing method, and communication terminal
Artail A distributed system of network-enabled microcontrollers for controlling and monitoring home devices
JP2002325111A (en) Communication data processing unit, communication data processing program and recording medium
CN115100840B (en) Equipment control method, device, electronic equipment and storage medium
WO2002075568A1 (en) A method and a single chip system capable of loading and running specific operating system
TWI775112B (en) System and method for accessing registers

Legal Events

Date Code Title Description
AK Designated states

Kind code of ref document: A1

Designated state(s): CN JP KR SG US

AL Designated countries for regional patents

Kind code of ref document: A1

Designated state(s): AT BE BG CH CY CZ DE DK EE ES FI FR GB GR HU IE IT LU MC NL PT RO SE SI SK TR

DFPE Request for preliminary examination filed prior to expiration of 19th month from priority date (pct application filed before 20040101)
121 Ep: the epo has been informed by wipo that ep was designated in this application
WWE Wipo information: entry into national phase

Ref document number: 2005513090

Country of ref document: JP

122 Ep: pct application non-entry in european phase