3.3.1 Buffer Management
In previous describes, we know the routing method for our algorithm. The concept is source can transmit new segment sequence if it receives ACKs. Unfortunately buffer in each node
p’’ β
Figure 3.4: When node 6 receives sufficient packets to decode, it send ACKs to source
If globalMaxETXHost
> former node, change former node = R2
Figure 3.5: The condition for F ormer node is changed
is not infinite, so how to make the performance increase is important. If buffer size is 6, for example, meaning every node can store 6 segments at most. With CodeOR, segment stored in node dependent on source transmits which segments. If source transmits six segments from zero to five, then all of node just can save these segments. It wastes bandwidth because of some segments have stored in node that closer to destination but the far nodes cannot clear buffer and receive new segment packets.The time for total segments transmit over also be late for this condition. So we do not using this method for each node stores the same segment.
Our method is describing following:
First, when current node broadcasts packet to another forwarder then the forwarder can receive packet if buffer in node is not full.In other condition, when node receives packet but no empty buffer to store data. We compare ETX of receiving node and globalMaxETXHost
to decide packet dropped or stored. If ETX of globalMaxETXHost smaller than node number means packet can be stored because the older segment has been transmitted closer to des-tination. Hence, we can clear buffer before globalMaxETXHost. For example, if s want to broadcast new segment to other forwarding node, as shown in Figure 3.6, the current glob-alMaxETXHost is node 5 so the node from 1 to 4 can clear buffer and store new segment packet. By this way can help more segments in flight in the network and improve perfor-mance.Especial in scale-up and poor link quality environment our algorithm is more efficient because we do not wait long delay time from destination send ACKs to source.
!
"
#
$ % &
'
( )*+,
*-.
*/ 0
Figure 3.6: When new segment packet transmitted and buffer is full
The best buffer size is the same with sliding window size. Similar to TCP, the size of the sending window should approximately equals the delay-bandwidth. CodeOR [13] has present how to calculate to sending window size. In this paper, we focus on how to replace the segment in buffer.
3.3.2 Reduce redundant packets transmission
Collision and bandwidth contention is a influence for performance. On the other hand, if we decrease node transmission that may avoid collision happening. In random network topology, as shown in Figure 3.7, some node like node 1, 2, 3 may always receive the same packets but the same packets are invalid for decoding. In general solution, as shown in [4], we calculate how many packets does forwarder send dependent on transmission probability between nodes.
For any two nodes, i and j, let i>j denote that node j is closer to the destination than node i, meaning j has a smaller ETX than i. Let pij denote the transmission probability in sending a packet from i to j. Let ni be the expected number of transmissions that forwarder i must make to route one packet from the source to the destination. In this section, we focus on
Figure 3.7: Random nework topology
delivering one packet from source to destination. The number of packets that a forwarder j must forward to transmit one packet from source to destination is calculating in following.
The expected number of packets that j receives from nodes with higher ETX is P
i>jnipij. For each packet j receives, j should forward it only if no node with lower ETX metric hears the packet. This happens with probability Q
k<j(1 − pik). Thus, in expectation, the number of packets that j must forward, denoted by Lj, is:
Lj =P
i>jnipijQ
k<j(1 − pik)
We assume Ls = 1 because the source generates the packet. Now, consider the expected number of transmissions a node j must make. J should transmit each packet until a node with lower ETX has received it. Thus, the number of transmissions that j makes for each packet it forwards is a geometric random variable with success probability (1-Q
k<j(1 − pj k)).
This is the probability that some node with ETX lower than j receives the packet. Thus, the expected number of transmissions that j must make is:
nj = Lj/(1 −Q
k<j(1 − pj k))
We first prune the node i if its ni smaller than a threshold. In addition, we also set a counting number CNT, if packets from upstream nodes are dependent then CNT+1. The bandwidth is wasting, when some nodes always transmit the same packets to receiver. Therefore, we define a threshold h and time if CNT over h or over time the node does not receive new packet.
This node will reply to upstream node and let it to stop transmit packet. More importantly, We can know how many remainder packets that downstream node may receive, As shown in Figure 3.8, node 7 has two packets and node 1 has three packets and node 7 included in node 2. We could presume node 1 just re-encoding one packet that independent for node 7. In this case if node 7 has receive this independent packet and through specific time, we stop node 1 avoid it transmits redundant data to it downstream node 7. Each node can know how many
packet that it upstream nodes can receive. Therefore, current node can decide whether stop upstream node.
Figure 3.8: How Many Remainder Packet between a pair nodes
3.3.3 Faster Packet Combining
In traditional operations in finite field, for example in GF(7), shows in Table 3.3: With linear Operation Result
Addition 3 + 5 = 1 Subtraction 3 - 5 = 5 Multiplication 3 * 5 = 1
Division 3 / 5 = 2 Table 3.3: Operations in finite field
combination we present a packet as a sequence of symbol (i.e. one byte) in a finite field.
Therefore the finite field is in GF(28) and primitive polynomial is f(x) =x8 + x4+ x3 + x + 1.
Let be the root of f(x) then the set 1, α, α2,. . ., α7 can be used as a basis for GF(28) so any byte can be presented as Table 3.4 . In GF(28), addition and subtraction operations are using
ASCII Binary Binary
0 00000000 0
1 00000001 1
2 00000010 α
3 00000011 α+1
... ... ...
255 11111111 α7+α6+α5+α4+α3+α2+α+1 Table 3.4: Byte presentation in GF(28)
bit-wise xor, for example, 00000010 ⊕ 00010110 = 00010100.Multiplication is multiplying two operand and mod primitive polynomial. Division detail sees in [5].Actually, in multimedia applications the computing of previous is slowly so using lookup table [6] is important for this. For example, we build a Table 3.5 for GF(7) and the multiplication is changed to 3 ∗ 4=55*52=57=51=5.The Division is change to 6/3=53/55=5−2=54=2.
50 1 51 5 52 4 53 6 54 2 55 3 56 1
Table 3.5: Change table for GF(7)
More advance, we can using two table, ltable = [0,3,1,2](array start from 1) and atable
= [1,3,4,2](array start from 0) to calculate result show in Figure 3.9. For example, 3*4 =
Figure 3.9: Lookup Table in GF(7)
ltable[3]+ltable[4]=3 then takes 3 to atable[3]=2. In GF(28) the ltable and atable are shown in Figure 3.10.
Figure 3.10: The table for GF(28)
The detailed steps of PipelineOR are described in the following Algorithm. Algorithm 1 illustrates all initial value. In Algorithm 2 and Algorithm 3, describing the action for node broadcast and reply message. The condition for each node receives packet describing in Algorithm 4 and Algorithm 5.
Algorithm 1: Initial all value using in our algorithm
1: Initialize localMaxET XHost, globalMaxET XHost and F ormer are source.
2: Initialize two array named dataArray[ ][ ]=0 and checkArray[ ][ ]=0.
3: Initialize T otal − Segment, this value depend on packet size,k and total data size.
4: Clear buffer in each node.
5: Initialize Finish-Flag=0.
Algorithm 2: Node in broadcasts case
1: if Node occupies channel, and has data in buffer then
2: if Current number is source then
3: Encoding the data using fast packet combining method and set table 3.1 into transmitting packet except extra packet coefficient.
4: else
5: Encoding the data using fast packet encoding method and set table 3.1 into transmitting packet.
Algorithm 3: Node in replies case
1: if CheckArray[ ][ ] is equal to k and
the ETX of node is smaller than globalMaxET XHost then
2: Replying ACKs(Reply message in table 3.2) to F ormer.
3: if Node receives new message then
4: Replying ACKs to F ormer.
5: if All Segment has decoded in destination then
6: Replying F inish − F lag.
Algorithm 4: Node in receives broadcasting packet case
1: if Node receives packet and node in forwarding list then
2: if Buffer in node is not full then
3: Using Gaussian Elimination checks the packet is independent or not.
4: if Packet is independent then
5: Storing this packet in dataArray[ ][ ].
6:
7: Check extra packet coefficient are independent or not.
8: if Extra packet is independent then
9: Storing packet in checkArray[ ][ ].
10: if CheckArray[ ][ ] is equal to k and
the ETX of node is smaller than globalMaxET XHost then
11: Replying ACKs to F ormer.
12: if The globalMaxET XHost is smaller than StoreF orMaxET XHost then
13: Change StoreF orMaxET XHost value to globalMaxET XHost
14: if The globalMaxET XHost is smaller than F ormer in each node and current ETX of node is smaller than globalMaxET XHost then
15: Change F ormer value to globalMaxET XHost
16: else
17: if The ETX of node larger than globalMaxET XHost then
18: New segment can clear older segment and be stored in buffer.
19: Repeat step 3-15.
Algorithm 5: Node in receives replying packet case
1: if Node receives F inish − F lag then
2: Replying F inish − F lag to source by shortest path.
3: if localMaxET XHost is less than StoreF orMaxET XHost then
4: Change StoreF orMaxET XHost value to localMaxET XHost.
5: if Source receives a message for Segment i has sufficient packet to decode in forwarding nodes then
6: Broadcasting new segment.