The present invention relates to a communication apparatus, a communication method, and a program.
In order to achieve real-time communication by using a low-performance central processing unit (CPU) such as an embedded CPU, it is necessary to reduce a load of a CPU, and to preform high-precision control of transmission and reception of data. For this reason, devices equipped with a function of controlling a transmission rate of a network and a priority control function as functions on a network interface card (NIC) have appeared.
The rate control function and the priority control function installed in these NICs are mounted as hardware functions on the NIC. Thus, when the number of flows being a series of data using the NIC increases, a hardware processing capacity of the NIC decreases. Note that, a flow is formed of a plurality of communication packets.
Then, in PTL 1, as illustrated in
The destination distributing unit in
In
It is considered herein that the group change applying unit changes a distribution destination of packets for the destination b from the packet processing unit 1 to the packet processing unit 2, from a state as in (1) of
In (2) of
[PTL 1] Japanese Unexamined Patent Application Publication No. 2010-161546
According to a communication apparatus in PTL 1 illustrated in
A communication apparatus, a communication method, and a program according to the present invention are able to efficiently transmit data in comparison with a related technology.
In order to achieve the above-described object, a communication apparatus according to the present invention includes a plurality of buffers configured to cause a communication packet to wait therein, and an intra-buffer packet switching means for moving a predetermined communication packet among packets waiting in the plurality of buffers from a first buffer in which the predetermined communication packet waits to a second buffer among the plurality of buffers.
In order to achieve the above-described object, a communication method according to the present invention includes moving a predetermined communication packet among communication packets waiting in a plurality of buffers from a first buffer in which the predetermined communication packet waits to a second buffer among the plurality of buffers.
In order to achieve the above-described object, a program according to the present invention includes moving a predetermined communication packet among communication packets waiting in a plurality of buffers from a first buffer in which the predetermined communication packet waits to a second buffer among the plurality of buffers.
According to a communication apparatus, a communication method, and a program of the present invention, data are able to be efficiently transmitted in comparison with a related technology.
Next, an example embodiment of the present invention will be described in detail with reference to
An overall configuration of a first example embodiment is illustrated in
A communication terminal 100 in the present example embodiment includes, as hardware, a CPU 13 that controls the communication terminal 100, a root complex 14, an NIC 11, and a memory 15.
The CPU 13 is a central processing unit described above. Each device of the communication terminal 100 is connected to the root complex 14. The NIC 11 is a network interface card described above. Note that, the NIC 11 is a structural component of the communication terminal 100, but the NIC 11 may be referred to as a communication apparatus. The memory 15 is a storage element.
Further, the communication terminal 100 includes, as software, an application 10 that generates data transmitted to another communication terminal and a device driver 12 that performs control of transmission and reception of data on the NIC 11.
Next, a configuration of the NIC 11 is illustrated in
The NIC 11 includes a direct memory access (DMA) unit 110, a destination distributing unit 111, buffers 121 to 12n, rate control units 131 to 13n, an output interface (I/F) 114, and a group change applying unit 115.
The DMA unit 110 reads data saved in the memory 15 by the device driver 12 and the application 10. Furthermore, the DMA unit 110 is a means for generating a plurality of communication packets (hereinafter packets) from data read from the memory 15, based on a communication method used for transmission to another communication terminal, and sending the packets to the destination distributing unit 111.
The packet is a transmission unit of data. The packet includes a data unit and a header unit. Further, the header unit is provided with a flow ID and a packet number.
The flow ID is an identification (ID) commonly provided to a series of packets (referred to as a flow) generated from data before the packets are generated.
Further, the packet number is an order of packets in a flow.
The group change applying unit 115 is a means for instructing the destination distributing unit 111 to divide a plurality of flows into groups for each of the buffers 121 to 12n and distribute the groups. Note that, the instruction from the group change applying unit 115 to the destination distributing unit 111 is performed by transmitting information in which numbers of the buffers 121 to 12n are associated with flow IDs assigned to the buffers as in an example illustrated in
The buffer 121 to the buffer 12n are memories in which a packet sent from the destination distributing unit 111 is caused to temporarily wait.
The rate control units 131 to 13n perform processing of setting a packet in the buffer 121 to the buffer 12n at a predetermined rate and sending the packet to the output interface 114. The rate control units 131 to 13n may be referred to as packet processing units. The output interface 114 is an output means for transmitting data to another communication terminal.
The group change applying unit 115 is a means for changing a group setting performed by the destination distributing unit 111 by an appropriate procedure according to an instruction from a user or a management node.
Herein, an example of a configuration of the group change applying unit 115 is illustrated in
The setting input-completion notifying interface 1150 notifies a notification destination that a request to change a setting of the destination distribution unit has been received from a user or a management node and the change in the setting has been completed by the destination distributing unit as necessary. The intra-buffer packet switching unit 1151 moves, when receiving a request to change a group setting from a user or a management node, a packet included in a buffer to another buffer according to a content of the change.
The packet sending start commanding unit 1152 includes a CPU that controls another structural component of the group change applying unit. The memory 1153 is a storage element that stores a current group setting and a group setting after a change when the change is instructed. When a group change in the NIC 11 is completed, the memory 1153 rewrites a content of the group setting after the change as a content of a current group setting.
Next, operations in the present example embodiment will be described with reference to
Operations when the NIC 11 receives a command to change packets having b as the flow ID from the rate control unit 131 to the rate control unit 13n from a state of the NIC 11 where packets having a as the flow ID and the packets having b as the flow ID wait in a mixed manner as illustrated in (1) of
Note that, a condition and a method of changing a rate control unit of a flow are not the point of the present invention, and thus description thereof will be omitted.
In a flowchart illustrated in
Furthermore, in Step S101, the memory 1153 stores the group setting after the change received by the setting input-completion notifying interface 1150 (S101).
Next, in Step S102, the intra-buffer packet switching unit 1151 of the group change applying unit 115 refers to the memory 1153 and compares the group setting after the change with a current group setting. Then, as illustrated in (2) of
In (1) of
Note that, in Step S102, when a packet is moved between buffers, a packet to be sent from a buffer to a rate control unit, such as the packet b-1 illustrated in (1) of
Further, the packet sending start commanding unit 1152 causes a packet that has arrived at the destination distributing unit 111 during the operation in Step S102 to wait in the destination distributing unit 111 without sending the packet to the buffers 121 to 12n.
Furthermore, in Step S102, when the setting input-completion notifying interface 1150 receives the command to change a group setting, the packet sending start commanding unit 1152 instructs a buffer being a movement destination of a packet to stop sending a moved packet to a rate control unit (S102).
In the example of (2) of
Herein, a method of moving a packet waiting in a buffer to another buffer will be described.
The packet includes, as a header, information about a flow ID and an order of packets (hereinafter a packet number) in the same flow ID together with data. Further, the intra-buffer packet switching unit 1151 is always able to refer to a header of each packet waiting in each buffer.
The intra-buffer packet switching unit 1151 refers to the memory 1153, compares the group setting after the change with a current group setting, and recognizes a buffer being a current distribution destination of a flow ID (hereinafter a movement flow ID) having a distribution destination changed and a buffer after the change. Then, the intra-buffer packet switching unit 1151 refers to a header of a packet waiting in a buffer to which the movement flow ID is currently distributed.
The intra-buffer packet switching unit 1151 refers to the header, extracts a packet having the smallest packet number from packets having the movement flow ID, and moves the packet to an end of packets waiting in a buffer being a movement destination. The work of extracting a packet having the smallest packet number from packets having the movement flow ID and moving the packet to an end of packets waiting in the buffer being the movement destination is repeated until there is no packet having the movement flow ID in the buffer being the current distribution destination.
As described above, a packet waiting in a buffer is moved to another buffer.
In Step S103 subsequent to Step S102, the memory 1153 rewrites information about a current group setting to a content of the group setting after the change. Further, the packet sending start commanding unit 1152 instructs the destination distributing unit 111 to change the group setting to the group setting after the change. Then, the destination distributing unit 111 distributes a packet, based on the group setting after the change, and starts sending the packet to a buffer being a distribution destination (S103).
Next, the packet sending start commanding unit 1152 determines whether or not all packets (packets b in
In Step S104, when it is determined that all the packets being the switching targets have been sent from the buffer (Y in S104), processing proceeds to Step S105. In Step S104, when it is determined that all the packets being the switching targets have not been sent from the buffer (N in S104), processing returns to Step S104.
In Step S105, the buffer (buffer 12n in
The work of changing a group setting of a packet is then terminated.
In the NIC illustrated in PTL 1, when a buffer being a distribution destination of a packet is changed, a packet cannot be sent from a destination distributing unit to a buffer after the change until all packets waiting in a buffer before the change are sent from the buffer and the buffer is empty.
On the other hand, in the NIC 11 in the present example embodiment, when a buffer being a distribution destination of a packet is changed, a packet while waiting is moved between buffers. Thus, in the NIC 11 in the present example embodiment, a packet is able to be sent from the destination distributing unit to a buffer even when all packets are not sent from a buffer before the change.
Thus, data are able to be efficiently transmitted to another communication apparatus in the NIC 11 in the present example embodiment in comparison with the NIC illustrated in PTL 1.
Next, a second example embodiment will be described with reference to
An overall configuration of the second example embodiment is illustrated in
A communication terminal 200 in the second example embodiment illustrated in
Next, a configuration of the NIC 21 in the second example embodiment is illustrated in
The configuration of the NIC 21 includes schedulers 141 to 14n located between the rate control units 131 to 13n and buffers 151 to 15n in the configuration of the NIC 11 in the first example embodiment illustrated in
Further, the buffers 151 to 15n have functions different from those of the buffers 121 to 12n in the first example embodiment, and includes pointers each indicating a waiting position on a buffer as described later.
Furthermore, the group change applying unit 115 in the first example embodiment illustrated in
The schedulers 141 to 14n each select an appropriate packet from a packet group in a buffer connected to each of the schedulers 141 to 14n, and each send the packet to the rate control units 131 to 13n connected to the respective schedulers 141 to 14n.
Further, as illustrated in
Each of the schedulers 141 to 14n possesses information about a buffer connected to each of the schedulers.
Herein, the buffer information will be described.
The flow ID is the same as that in the description of the first example embodiment.
The pointer indicates a position in which a packet waits in a buffer. In the example of
Further, the schedulers 141 to 14n possess information referred to as a coupling list in which an order of packets waiting in a buffer is associated with pointers of the waiting packets for each flow ID.
Herein, the coupling list will be described by using an example in which packets are waiting on a buffer as in
The scheduler possesses a coupling list in which an order of packets waiting on a buffer is associated with pointers of the waiting packets for each flow ID. Coupling lists when the packets wait as in
(1) of
(2) of
Note that, a pointer corresponding to a first in an order in a coupling list is referred to as a top pointer.
Then, a new packet waits in an empty pointer after a top pointer is sent from a buffer.
The scheduler then deletes a sent packet from a coupling list. Then, the scheduler shifts the order of the pointers in the coupling list by one, and replaces the top pointer with a second pointer. Then, the scheduler associates a pointer of a packet newly waiting in the buffer with an end of the order of the coupling list.
The effective flag is a flag indicating whether or not a flow ID is effective. When the effective flag is effective (Enable), the schedulers 141 to 14n send packets from the buffers 151 to 15n to the rate control units 131 to 13n. Further, when the effective flag is ineffective (Disable), the schedulers 141 to 14n do not send packets from the buffers 151 to 15n to the rate control units 131 to 13n.
Note that, the schedulers 141 to 14n possess buffer information about buffers connected to the respective schedulers in the present example embodiment. However, each of the schedulers 141 to 14n may not possess the buffer information, and the group change applying unit 1200 may possess all pieces of the buffer information of all of the schedulers 141 to 14n.
Timer is a period of time in which a buffer waits after sending a certain packet until a next packet in the same flow is sent. When a buffer sends a certain packet, the timer value calculating unit 1254 of the group change applying unit 1200 illustrated in
A rate at which the schedulers 141 to 14n send packets to the rate control units 131 to 13n is able to be ensured by setting the timer value to be greater than a rate of each packet.
Then, the schedulers 141 to 14n each select a packet in a flow in which the timer value is zero and timer is not set from packets waiting in the buffers 151 to 15n, and each send the packet to the respective rate control units 131 to 13n.
Next, operations in the present example embodiment will be described with reference to
In the flowchart in
In Step S201, it is assumed as in (1) of
At the time of (1) of
Next, the group change applying unit 1200 changes a setting of groups of the destination distributing unit 111, based on a command to change a group setting received in Step S201 (S202).
Subsequent to Step S202, the timer value calculating unit 1254 starts timing (S203).
Subsequently, the intra-buffer packet switching unit 1251 of the group change applying unit 1200 refers to the memory 1253 and compares the group setting after the change with a current group setting. Then, the intra-buffer packet switching unit 1251 moves a packet of a flow having a distributed destination buffer changed due to the change in the group setting among packets retained in the buffers 151 to 15n to a buffer after the change (S204). With an example of the operation in Step S204 being described with reference to
Subsequent to Step S204, a scheduler having a distribution destination of a flow ID changed among the schedulers 141 to 14n shifts a pointer next to a top pointer in an order in a coupling list possessed by the scheduler to a top pointer. Similarly, other pointers in the order are shifted by one. Furthermore, the scheduler having the distribution destination of the flow ID changed rewrites a top pointer in buffer information to a pointer identical to the top pointer in the coupling list (S205).
Then, the scheduler having the distribution destination of the flow ID changed sets an effective flag associated with the changed flow ID to Disable in the buffer information possessed by the scheduler. Then, the packet sending start commanding unit 1252 stops sending the flow set to Disable from the buffer to the rate control unit (S206).
The pieces of information about the buffer 151 and the buffer 15n respectively possessed by the scheduler 141 and the scheduler 14n at a stage when Step S205 and Step S206 are completed are illustrated in (2) of
Herein, packets are retained in the destination distributing unit 111 without being distributed from the destination distributing unit 111 to a buffer while the intra-buffer packet switching unit 1151 switches the packets in Step S102 in
On the other hand, packets are allowed to be distributed from the destination distributing unit 111 to the buffers 151 to 15n even while the intra-buffer packet switching unit 1251 switches the packets in Step S204 in
Subsequent to Step S206, the packet sending start commanding unit 1252 determines whether or not all the packets (packets b in
In Step S207, when it is determined that all the packets being the switching targets have been sent from the buffer (Y in S207), processing proceeds to Step S208. In Step S207, when it is determined that not all the packets being the switching targets have been sent from the buffer (N in S207), processing returns to Step S207.
In Step S208, the packet sending start commanding unit 1252 instructs a scheduler being a movement destination of the flow to set an effective flag associated with the flow ID being the switching target to Enable (S208).
In Step S209 subsequent to Step S208, the timer value calculating unit 1254 refers to a timer value (assumed to be Td) at which the timing starts in Step S203. Then, the timer value calculating unit 1254 subtracts Td from a timer value of the flow ID corresponding to the flow in which the packets are switched between the buffers. Further, the memory 1253 rewrites information about a current group setting to a content of the group setting after the change (S209).
(3) of
In this way, a timer value corresponding to a flow moved from a buffer is transferred before and after movement.
Note that, in Step S209, Td is a negative value when sending of a packet in a flow being a switching target from a buffer before movement to a scheduler has been finished before switching of the packet between buffers is completed. In this case, a last packet in the flow being the switching target, which has been waiting in the buffer before the switching of the packet, has been sent from the buffer at an earlier time by X than an absolute value of Td.
Then, even when a timer value of a packet being sent next from a buffer after switching is set to a value obtained by subtracting an absolute value of Td from X, a rate of a previous packet is guaranteed, and the next packet is efficiently sent from the buffer without unnecessary waiting time.
After Step S209 is completed, the work of changing a group setting of a packet is then terminated.
In the NIC 11 in the first example embodiment, a packet arriving at the destination distributing unit cannot be sent to a buffer during the work of switching a packet.
However, in the NIC 21 in the present example embodiment, a packet arriving at the destination distributing unit is able to be sent to a buffer even during the work of switching a packet. Furthermore, a timer value reflecting time for the work of changing a group setting is able to be set to a packet in a flow having no opportunity to be sent during the work of changing a group setting by the group change applying unit.
Next, a third example embodiment of the present invention will be described with reference to
A communication apparatus 31 in the present example embodiment includes a plurality of buffers 161 to 16n that cause a communication packet to wait therein. The communication apparatus 31 further includes an intra-buffer packet switching unit 1500. The intra-buffer packet switching unit 1500 moves a predetermined communication packet among packets waiting in the plurality of buffers 161 to 16n from a first buffer in which the predetermined communication packet waits to a second buffer among the plurality of buffers.
As described above, the communication apparatus 31 in the present example embodiment is able to efficiently transmit data to another communication apparatus in comparison with the communication apparatus illustrated in PTL 1.
Note that, the present invention is also applicable when an information processing program achieving functions of the example embodiments is supplied to a device directly or remotely.
A part or the whole of the above-described example embodiments may also be described as in supplementary notes below, but is not limited thereto.
A communication apparatus including:
a plurality of buffers configured to cause a communication packet to wait therein; and
an intra-buffer packet switching unit which moves a predetermined communication packet among packets waiting in the plurality of buffers from a first buffer in which the predetermined communication packet waits to a second buffer among the plurality of buffers.
The communication apparatus according to supplementary note 1, further including:
a destination distributing unit which distributes a communication packet to the plurality of buffers and send the communication packet; and
a plurality of rate control units which sends the communication packet sent from the plurality of buffers at a predetermined rate.
The communication apparatus according to supplementary note 1 or 2, further including:
a packet sending start commanding unit which instructs stop of sending the predetermined communication packet from the second buffer when the movement starts, and instructs sending of the predetermined communication packet from the second buffer when sending of all communication packets of a kind identical to a kind of the predetermined communication packet from the first buffer is detected.
The communication apparatus according to supplementary note 1 or 2, further including:
a timer which indicates, when a timer value greater than a rate of the predetermined communication packet is set and the communication packet is sent from the buffer, a display value decreased from the timer value with a lapse of time; and
a timer value calculating unit which replaces a value obtained by subtracting the display value from the timer value with the timer value when the display value at a time of completion of the movement is a positive value, and replaces a value obtained by adding an absolute value of the display value to the timer value with the timer value when the display value at a time of completion of the movement is a negative value, wherein
the buffer is able to send a next communication packet of a kind identical to a kind of the communication packet waiting in the buffer when the display value becomes zero.
A communication method including:
moving a predetermined communication packet among communication packets waiting in a plurality of buffers from a first buffer in which the predetermined communication packet waits to a second buffer among the plurality of buffers.
The communication method according to supplementary note 5, wherein
the plurality of buffers output the communication packet to a plurality of rate control means configured to control a rate of a communication packet.
The communication method according to supplementary note 5 or 6, further including:
stop sending the predetermined communication packet from the second buffer when the movement starts, and sending the predetermined communication packet from the second buffer when sending of all communication packets of a kind identical to a kind of the predetermined communication packet from the first buffer is detected.
The communication method according to supplementary note 5 or 6, further including:
indicating, when a timer value greater than a rate of the predetermined communication packet is set and the communication packet is sent from the buffer, a display value decreased from the timer value with a lapse of time; and
replacing a value obtained by subtracting the display value from the timer value with the timer value when the display value at a time of completion of the movement is a positive value, and replacing a value obtained by adding an absolute value of the display value to the timer value with the timer value when the display value at a time of completion of the movement is a negative value, wherein
a next communication packet of a kind identical to a kind of the communication packet waiting in the buffer is able to be sent when the display value becomes zero.
A program including:
moving a predetermined communication packet among communication packets waiting in a plurality of buffers from a first buffer in which the predetermined communication packet waits to a second buffer among the plurality of buffers.
The program according to supplementary note 9, wherein
the plurality of buffers output the communication packet to a plurality of rate control means configured to control a rate of a communication packet.
The program according to supplementary note 9 or 10, further including:
stop sending the predetermined communication packet from the second buffer when the movement starts, and sending the predetermined communication packet from the second buffer when sending of all communication packets of a kind identical to a kind of the predetermined communication packet from the first buffer is detected.
The program according to supplementary note 9 or 10, further including:
indicating, when a timer value greater than a rate of the predetermined communication packet is set and the communication packet is sent from the buffer, a display value decreased from the timer value with a lapse of time;
replacing a value obtained by subtracting the display value from the timer value with the timer value when the display value at a time of completion of the movement is a positive value, and replacing a value obtained by adding an absolute value of the display value to the timer value with the timer value when the display value at a time of completion of the movement is a negative value; and
being able to send a next communication packet of a kind identical to a kind of the communication packet waiting in the buffer when the display value becomes zero.
The present invention has been described above by taking the above-mentioned example embodiments as exemplary examples. However, the present invention is not limited to the above-mentioned example embodiments. In other words, various aspects apparent to those skilled in the art may be applied to the present invention within the scope of the present invention.
This application is based upon and claims the benefit of priority from Japanese Patent Application No. 2016-085014, filed on Apr. 21, 2016, the disclosure of which is incorporated herein in its entirety by reference.
10 Application
11 NIC
12 Device driver
13 CPU
14 Root complex
15 Memory
21 NIC
31 Communication apparatus
100 Communication terminal
110 DMA unit
111 Destination distributing unit
114 Output interface
115 Group change applying unit
121, 12n Buffer
131, 13n Rate control unit
141, 14n Scheduler
151, 15n Buffer
161, 16n Buffer
200 Communication terminal
1150 Setting input-completion notifying interface
1151 Intra-buffer packet switching unit
1152 Packet sending start commanding unit
1153 Memory
1200 Group change applying unit
1250 Setting input-completion notifying interface
1251 Intra-buffer packet switching unit
1252 Packet sending start commanding unit
1253 Memory
1254 Timer value calculating unit
1500 Intra-buffer packet switching unit
Number | Date | Country | Kind |
---|---|---|---|
2016-085014 | Apr 2016 | JP | national |
Filing Document | Filing Date | Country | Kind |
---|---|---|---|
PCT/JP2017/015216 | 4/14/2017 | WO | 00 |