Deterministic Scheduling of SpaceWire Data Streams

0 downloads 0 Views 125KB Size Report
SpaceWire-D provides several types of schedule table, but does not offer any algorithm of constructing such a tables. By routing data streams through one or ...
Deterministic Scheduling of SpaceWire Data Streams Networks and Protocols, Short Paper

Dmitry Raszhivin, Yuriy Sheynin, Alexey Abramov St.Petersburg University of Aerospace Instrumentation Saint-Petersburg, Russia [email protected]

Abstract—The topology of an onboard computer network is determined by the physical location of nodes (sensors, computer modules, databases, etc). Data flows in network are determined by a sender and receiver pair (or set of receivers in case of multicasting). A packet flow could be organized through a number of intermediate switches. Time division multiple access allows several users to share the same channel by dividing their channel access time into different time slots. Operation of a network is managed by a schedule that defines which node is allowed to initiate a transmission at any particular time. This table shall be compiled on the one hand to prevent conflicts in the network resources usage, and on the other hand to utilize the resources as the highest level as possible. The aim of the work presented in this paper is to develop a method of finding the best routes for all data flows in a network and compiling an optimal schedule table, which guarantees deterministic data transmission. Index Terms— SpaceWire-D, Scheduling

I. INTRODUCTION

graph G is the smallest number of colors K needed to correctly color all the vertices of G, i.e. the smallest value of k possible to obtain a k-coloring. Scheduling task can be referred to vertex coloring task. Consider matrix M

n

data

flows

{J i }(Ni−1) and

≡ {mij } , where mij is equal to one if J i competes

with J j , and to zero otherwise. Representing every flow J i with node Ai and connect with undirected edge eij nodes Ai

= 1 , schedule table making task can be considered as a coloring task for graph G witch consist of N nodes V (G ) ≡ { Ai }( i −1) and edges E (G ) ≡ {eij } . Minimal and Aj if mij

value of time-slots, required for deterministic schedule organization, is equal to the chromatic number k (G ) of a graph G [6]. Examine a the network shown in Fig. 1. This network consists of five nodes and includes five data flows defined in table I.

Nowadays time-scheduled protocols over SpaceWire [1] (SpaceWire-D [2], SpaceWire-T [3]) are actively discussed and developed. These protocols can be developed as a network service running at existing SpaceWire equipment [8]. Deterministic data delivery with predictable characteristics is achieved by using time-division multiplexing, that is managed by a schedule table. SpaceWire-D provides several types of schedule table, but does not offer any algorithm of constructing such a tables. By routing data streams through one or another path using different intermediate switches different scheduling tables with discrepant characteristics would be obtained. II. GRAPH COLORING APPROACH TO SOLVE SCHEDULING TASK In the graph theory, graph coloring is a procedure of the assignment of labels traditionally called "colors" to the elements of the graph, in such a way that no two adjacent vertices share the same color [5]. The chromatic number of a

competition

Fig. 1 Example network

TABLE I.

CORRESPONDENCE BETWEEN FLOWS AND NODES

Flow

X1 X2 X3

Source a

Destination b

a

c

a

d

b

d

c

e

X4 X5

A competition matrix for this data flows is presented in table II. In this example flow X 1 competes with flows X 2 and

X 4 , flow X 2 competes with flows X 1 and X 5 etc. TABLE II. SAMPLE OF COMPETITION MATRIX X1 X2 X3 X4 X5

X1 * 1 0 1 0

X2 1 * 0 0 1

X3 0 0 * 1 0

X4 1 0 1 * 1

X5 0 1 0 1 *

This competition matrix can be interpreted as adjacency matrix for a new graph H. The result of coloring procedure for this graph H is shown in Fig. 2. For given example coloring is absolutely trivial and chromatic number is two. The network resources are allocated for data flows X 1 , X 3 and X 5 in first time-slot and for data flows X 2 and X 4 in the second time-slot.

B. Liquid scheduling The capacity of a network can be called as its liquid throughput. The liquid throughput corresponds to the flow of a liquid in an equivalent network of pipes. E. Gabrielyan and R.D. Hersch [7] proposed to schedule the data flows of a network in accordance with a schedule yielding the liquid throughput. Such a schedule called liquid schedule takes into account the underlying network topology and ensures an optimal utilization of all bottleneck links. In order to build a liquid schedule the traffic is partitioned into time slots comprising mutually non-congesting flows which keep all bottleneck links busy during all time slots. The search for mutually non-congesting flows utilizing all bottleneck links is of exponential complexity. An efficient algorithm presented in [7] traverses the search space non-redundantly and limits the search to only those sets of flows, which are non-congesting and use all bottleneck links. C. Heuristic coloring with QoS requirements Time division of a bandwidth guarantees deterministic delays, but it is very important to predict throughput as well as transmission delays. Greedy coloring and liquid scheduling don't take in mind any throughput requirements for data flows, so we developed an algorithm that builds scheduling table based on several QoS requirements. Several steps are performed to reduce a search tree of the NP-complete bruteforce problem: 1. Find all possible routes for all data flows. Different routes can use different switches and channels.

X i = Ri1 , Ri 2 , Ri 3 ,... 2. Group non-congesting routes with close transmission times (Fig. 3)

Gα = Ri1 , R j 3 , Rk1 ,...

Fig. 2 Competition matrix colored graph Fig. 3 Grouping routes

III. COLORING During our work we studied and developed several algorithms for graph coloring. A. Greedy coloring A greedy coloring is a coloring of the vertices of a graph formed by a greedy algorithm that considers the vertices of the graph in sequence and assigns to each vertex an available color. Generally, greedy colorings do not use the minimum number of possible colors, however they have been deployed in mathematics as a technique for proving other results about colorings as well as in computer science as a heuristic to find colorings with few colors.

This grouping consists of two stages: • Calculating transmission time for all data flows through all routes with formula above: N

di N + ∑(mi ×bti−1 + Tωi + Tbi ) + L× max(bt0 ,K, btN ) i =0 ci i =1 where: N is the number of transit channels, d i is the length of channel i , ci is the propagation speed of transmission medium of channel i , mi is size of buffer in switch i , Tωi is the processing time in switch i , Tbi is the blocking time in t =∑

switch i , L is the length of packet in bits, and bt is the one bit transmission time in channel i . Tbi considered to be zero at SpaceWire-D. • Calculating normalized transmission time for all data flows through all routes:

t i' =

ti max(t1KN )

'

where ti - normalized transmission time for route i . • Calculating normalized average transmission time for all data flows:

∑ ∑ = N

Taverage

i =1

N

t − t 'j

' j =i +1 i

N × ( N − 1) 2

• Creating groups, using breadth-first search. Resulting groups must not compete one with other and satisfy next condition:

t − t ≤ Taverage ' i

' j

3. Form a schedule table from a set of groups, using one group as one time-slot. Breadth-first or depth-first search are used to find acceptable for all QoS requirements schedule table.

Fig. 5 Network TDMA Scheduler interface

All schedule tables, compiled with the algorithms examined above, have some characteristics that affect network performance. The time-slot length, the number of time-slots in the epoch, and the number of data flows transmitted during one time-slot are related to the schedule table characteristics. A packet transfer delay and the aggregate throughput are related to the network characteristics. The aggregate network throughput can be calculated as following: k

s=∑ i =0

Fig. 4 Schedule table creating

IV. SOFTWARE A software tool "Network TDMA Scheduler" implements the algorithms described above. It has GUI (Fig. 5) and allows compiling schedule table and predicting time characteristics of the obtained schedule. The workflow consists of the following steps: 1. Creating a network with one of several ways: • drawing with build-in primitives, • loading from a XML file, • using build-in network generator with several topologies: star, tree or ring. 2. Defining data flows with one of several ways: • choosing by hands, • loading from XML file, • using build-in random generator. 3. Calculating a network schedule with one of the coloring algorithms. 4. Computing characteristics of the obtained schedule.

( Li × ti ) E

where: k is the number of streams, t is the number of time-slots assigned to the stream i , E is the epoch length in sec. Build-in network generator allows creating networks with star, tree or ring topologies. Automated tool permits compute different network characteristics on dynamic topologies. Fig. 6 shows growth of aggregate throughput on dynamically scaling ring network. At first step the network consists of 4 switches, 8 nodes and 4 data flows between nodes. At every new step one switch, two nodes and two data flows are added to the network. Aggregate throughput of the network at each step is shown at Fig. 6, Fig. 7 shows number of time-slots (lower values are the best).

that such QoS requirements as throughput and latency can be guaranteed only by heuristic coloring. V. CONCLUSION

Fig. 6 Aggregate throughput of network

In the paper the task of deterministic data transmission with guaranteed delivery time in SpaceWire network was studied, methods of scheduling tables construction for networks with time division multiplexing were reviewed. Algorithms of compiling such tables were proposed. A software tool "Network TDMA Scheduler" implements the algorithms described above. It allows compiling schedule table and predicting time characteristics of the obtained schedule. All schedule tables, compiled with the algorithms examined above, have some characteristics that affect network performance. The time-slot length, the number of time-slots in the epoch, and the number of data flows transmitted during one time-slot are related to the schedule table characteristics. These characteristics were studied for several networks with standard topologies, advantages and disadvantages of algorithms were discovered. REFERENCES

Fig. 7 Number of Time-Slots

Liquid schedule gives results close to results by heuristic coloring as it is seen above, but it is important to remember

[1] ECSS, "SpaceWire - Links, nodes, routers and networks", ECSS-E-ST-50-12C, July 2008 [2] S.Parkes, A. Ferrer "SpaceWire-D: Deterministic Data Delivery with SpaceWire", Proceedings of the 3rd International SpaceWire Conference, St. Petersburg, 2010 [3] S.M. Parkes, A. Ferrer-Florit, "SpaceWire-T Initial Protocol Definition", Draft 3.1, August 2009. [4] "Remote Memory Access Protocol", ECSS-E-50-11, Draft E, December 2005. [5] N. Christofides. Graph Theory - an Algorithmic Approach. Academic Press 1975. [6] Marx, Daniel (2004), "Graph colorings problems and their applications in scheduling", Periodica Polytechnica, Electrical Engineering, 48, pp. 11-16 [7] E. Gabrielyan and R.D. Hersch, "Efficient Liquid Schedule Search Strategies for Collective Communications", ReCALL, 2004, pp. 760-766. [8] Liudmila Koblyakova, Yuriy Sheynin, Dmitry Raszhivin. Realtime signaling in networked embedded systems. International SpaceWire Conference, St.Petersburg 2010. Conference Proceedings. ISBN: 978-0-9557196-2-2, p 385-388

Suggest Documents