The present invention claims priority of Korean Patent Application No. 10-2009-0075021, filed on Aug. 14, 2009, which is incorporated herein by reference.
The present invention relates to a communication technology based on user datagram protocol (UDP), and, more particularly, relates to a communication method and apparatus suitable for reliably and effectively transmitting massive massages based on UDP.
An Internet-based communication service is provided based on transmission control protocol (TCP) which serves reliable communications, or user datagram protocol (UDP) which serves unreliable communications, on the basis of the internet protocol (IP).
TCP communication guarantees stable receipt of transmitted messages in a receiver by exchanging a variety of control messages to check the receipt status of the messages and by controlling transmission speed. However, TCP may have low efficiency due to exchange of a variety of control messages and has a disadvantage of only supporting one to one transmission for retransmission of the messages.
On the contrary, in UDP communication, since a transmitter may continuously transmit messages without considering whether a receiver is ready to receive the messages, UDP communication has good transmission efficiency. However, the transmitter does not check receipt status of messages in the receiver and also does not perform retransmission of messages depending on the check result of the message receipt status, so that UDP communication cannot guarantee reliability of the messages. Since the receiver does not need to keep received messages, such a UDP may be a communication service capable of multicasting or broadcasting.
Recently, a necessity of both efficiency in message transmission provided by UDP and reliability in message transmission provided by TCP has been raised.
In case of transmitting a message using TCP and UDP, since one packet cannot carry a large amount of information, a transmitter segments a message in each packet size and a receiver reassembles the segmented message in good order. Generally, a size of a message which one packet can carry is 64 Kbytes in TCP and UDP communication. Segmentation and reassembly (SAR) process of the message are performed in IP, so that if one packet (IP packet) is missing, the entire message needs to be retransmitted, thereby increasing network loads and reducing transmission efficiency. Therefore, an effective retransmission mechanism is required for an efficient and reliable transmission of messages.
In view of the above, the present invention provides a communication method and apparatus based on user datagram protocol (UDP) using messages segmentation and reassembly (SAR) process and messages retransmission technique.
In accordance with a first aspect of the present invention, there is provided a communication method based on user datagram protocol (UDP) in a transmitter, including:
segmenting a message provided thereto into packets of a predetermined size;
allocating a serial number to each of the segmented packets;
storing the segmented packets in a packet buffer to transmit the packets to a receiver in order of the allocated serial numbers; and
waiting for a control message indicating packet receipt completion from the receiver.
In accordance with a second aspect of the present invention, there is provided a communication method based on user datagram protocol (UDP) in a receiver, including:
receiving packets segmented by a predetermined size in order of serial numbers from a transmitter; and
when the received segmented packets are message packets and there is no missing packet, assembling the segmented packets in order of the serial numbers to complete a message.
In accordance with a third aspect of the present invention, there is provided a transmitter in a communication apparatus based on user datagram protocol (UDP), including:
a message receipt unit for receiving a message provided thereto;
a message segmentation unit for segmenting the message provided from the message receipt unit into packets of predetermined size;
a packet buffer for storing the packets segmented by the message segmentation unit;
a packet transmission unit for transmitting the segmented packets stored in the packet buffer as a single UDP datagram;
a control packet generation unit for generating a control packet for checking receipt status of the message in receiver when any of the segmented packets is missing;
an event processing unit for processing timer set-up and time-out event; and
a control packet processing unit for requiring the control packet generation unit to generate a control packet when receiving a response control packet from the receiver.
In accordance with a fourth aspect of the present invention, there is provided a receiver in a communication apparatus based on user datagram protocol (UDP), including:
a packet receipt unit for receiving packets segmented by a predetermined size from a transmitter;
a message packet processing unit for checking status of the segmented packets provided from the packet receipt unit;
a control packet processing unit for processing the segmented packets provided from the packet receipt unit when the segmented packets are control packets and transmitting a response control packet to the transmitter if necessary; and
a packet assembly unit for assembling the segmented packets delivered from the message packet processing unit in order of serial numbers of the segmented packets to complete a message.
The above features of the present invention will become apparent from the following description of embodiments given in conjunction with the accompanying drawings, in which:
Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings.
The transmitter 100 includes a message receipt unit 102, a message segmentation unit 104, a packet buffer 106, a packet transmission unit 108, a control packet generation unit 110, an event processing unit 112, and a control packet processing unit 114.
The message receipt unit 102 receives one or more messages from an application service to provide them to the message segmentation unit 104. The message segmentation unit 104 segments the received messages into packets, for example, single UDP packets, and allocates serial numbers to the packets. The packet buffer 106 stores the segmented packets so as to transmit or retransmit the segmented packets. The packet transmission unit 108 transmits the segmented packets stored in the packet buffer 106 as a UDP datagram. The control packet generation unit 110 generates a control packet when a loss of the packets has occurred to check the receipt status of the message in receiver 200. The event processing unit 112 performs processing of events such as timer setup or time-out. The control packet processing unit 114 requires the control packet generation unit 110 to generate a control packet in case of receiving a respond control packet from the receiver 200.
The receiver 200 includes a packet receipt unit 202, a message packet processing unit 204, a control packet processing unit 206, a packet assembly unit 208, and a complete message transmission unit 210.
The packet receipt unit 202 receives the packets, for example, single UDP packets from the transmitter 100 to provide the packets to both the message packet processing unit 204 and the control packet processing unit 206.
The message packet processing unit 204 checks the packets received from the packet receipt unit 202. Depending on the check result, the message packet processing unit 204 delivers the received packets to the packet assembly unit 208 or transmits a message which requires generation of a control packet for packet retransmission to the control packet generation unit 110 of the transmitter 100. Specifically, when it is determined that the packets provided from the packet receipt unit 202 are message packets and there is no loss of the packets, i.e., normally received packets, the message packet processing unit 204 delivers the packets to the packet assembly unit 208. If, however, it is determined that there is a loss of the packets, in other words, the packets have been abnormally received, the message packet processing unit 204 transmits the message which requires generation of a control packet for packet retransmission to the control packet generation unit 110 of the transmitter 100.
When the packets provided from the packet receipt unit 202 are control packets, the control packet processing unit 206 of the receiver 200 performs processing of the control packets. At this time, the control packet processing unit 206 may transmit a respond control packet to the control packet processing unit 114 of the transmitter 100 if necessary.
The packet assembly unit 208 assembles the packets provided from the message packet processing unit 204 in order of serial numbers of the packets to complete the message. The complete message transmission unit 210 receives the complete message from the packet assembly unit 208 to transmit the complete message to an application service.
Hereinafter, a communication method based on UDP will be described in detail with reference to
When a message from an application service is transmitted to the message receipt unit 102 of the transmitter 100 in step S200, the message receipt unit 102 adds both a service identifier and a message identifier to a header of the message in step S202 and delivers the message to the message segmentation unit 104.
Referring to
Next, in step S210, the segmented packets given the packet serial numbers 504 are stored in the packet buffer 106 and are then transmitted to the receiver 200 in order of the packet serial numbers 504 via the packet transmission unit 108.
If, in step S204, a size of the message delivered from the message receipt unit 102 is not bigger than that of a single UDP packet or a predetermined size of UDP datagram, the transmitter 100 transmits the message to the receiver 200 without performing the segmentation of the message in step S212.
The receiver 200 may recognize whether a transmitted packet is a final packet, using the final packet identifier 506 in the message header shown in
When all of the packets which belong to the same message identifier have been transmitted, the transmitter 100 waits for a control message indicating packet receipt completion from the receiver 200. If the transmitter 100 receives the control message indicating the packet receipt completion from the receiver 200, the transmitter 100 empties the packet buffer 106 and starts to transmit a subsequent message.
The packet receipt unit 202 of the receiver 200 receives a message segmented into packets of a predetermined size, i.e., segmented packets from the transmitter 100 in step S300. The segmented packets are delivered to the message packet processing unit 204. Then, the message packet processing unit 204 detects respective message identifiers from the segmented packets in step S302, and checks whether the respective message identifiers of the segmented packets are identical to each other in step S304.
Subsequently, in step S306, the message packet processing unit 204 determines whether the packets have arrived in numerical order without any missing packets by checking the packet serial numbers 504.
If the respective message identifiers of the segmented packets are identical to each other, and the segmented packets are arrived in order of the packet serial numbers 504, the message packet processing unit 204 sends the segmented packets to the packet assembly unit 208.
Thereafter, the packet assembly unit 208 assembles the segmented packets in order of the packet serial numbers to generate a complete message in step S308. At this time, the packet assembly unit 208 generates the complete message when having received all of the segmented packets which belong to the same message.
The complete message is provided to the complete message transmission unit 210, and the complete message transmission unit 210 transmits the complete message to the application service in step S310.
In the meantime, when having received a final packet of the segmented packets, the message packet processing unit 204 transmits a control message, which indicates that the receiver 200 has received all the segmented packets, to the transmitter 100 via the control packet generation unit 110.
Then, the transmitter 100 empties the packet buffer 106 and may start to transmit a new subsequent message.
Meanwhile, in step S306, if the message packet processing unit 204 of the receiver 200 determines that there is any missing packet by checking the packet serial numbers 504 of the segmented packets received from the packet receipt unit 202, the message packet processing unit 204, in step S312, transmits a serial number of a first missing packet to the transmitter 100 via the control packet generation unit 110. Also, the message packet processing unit 204 generates a control message requiring retransmission of the first missing packet and subsequent packets, and transmits the control message to the transmitter 100 via the control packet generation unit 110 in step S314.
Then, the transmitter 100 stops packet transmission currently being performed, and allows the packet buffer 106 of the transmitter 100 to retransmit the packets required by the message packet processing unit 204 of the receiver 200 in step S316.
Thereafter, the process returns to step S304, so that the transmitter 100 may transmit all packets which belong to the same message. After that, the transmitter 100 waits for receiving a control message which indicates that the receiver 200 has received all packets which belong to the same message.
It has been shown and described above that the receiver 200 can detect a loss of packets during packet transmission. And such detection may also be made in the transmitter 100.
When a final packet is missing or a control message indicating packet receipt completion from the receiver 200 is missing, the transmitter 100 can detect a loss of the packets, by a time-out event set up after transmitting the final packet. A subsequent process will be described in detail with reference to
Referring to
However, if there is no loss of the control message transmitted from the control packet generation unit 110 in step S404, the receiver 200 normally receives the control message for confirming packet receipt status to confirm the status of the received packets. As a result of the confirmation, if missing packets exist, the receiver 200 transmits a serial number of a first missing packet, and if the receiver 200 has received all the packets without any missing packet, the receiver 200 transmits a control message indicating packet receipt completion to the transmitter 100 in step S408. Then, in step S410, when receiving the serial number of the first missing packet from the receiver 200, the transmitter 100 retransmits a packet of the received serial number, i.e., the first missing packet, together with packets of the subsequent serial numbers, or, when receiving the control message indicating packet receipt completion from the receiver 200, the transmitter 100 starts to transmit a new subsequent message.
When the receiver 200 receives a message identifier of a new message, the packet assembly unit 208 clears all buffers which have stored packets for packet combination and allocates the buffers for the new message so as to store new packets.
As described above, the present invention provides segmentation and reassembly (SAR) process for application service messages and provides a message retransmission method using exchange of control messages, thereby enabling an implementation of a simple, effective and reliable communication system.
While the invention has been shown and described with respect to the embodiments, it will be understood by those skilled in the art that various changes and modification may be made without departing from the scope of the invention as defined in the following claims.
Number | Date | Country | Kind |
---|---|---|---|
10-2009-0075021 | Aug 2009 | KR | national |