• No results found

The multicast server generates a multicast stream from the content that it receives as input. The server reads in the data starting at the beginning of the stream. Steps from to  in Figure 6 are repeated by the server until no more input is available.

Before multicast data generation is started, a few variables need to be given starting values. At the beginning of the following pieces of pseudocode, q is set to be the sequence number of the first packet in the generated stream.

The variable q also needs to be a multiple of s.

Packet stream generation

In step , the multicast server generates u packets from the beginning of the unprocessed input content. Each of the packets are equal in size, and these packets will become the payload in the multicast stream.9 The size of the packets needs to be small enough to fit the entire packet into the MTU of the network even after the lower layer protocol headers have been added to the packet.

Next, each packet is given a sequence number. The first packet taken from the remaining input content is given the sequence number q. Each following packet is given the sequence number one larger than the previous packet, until each u packets have been assigned a sequence number. The sequence number given to each packet is added into the headers in the packets.

 

The pseudocode reads u packets from a queue which is holding content that is waiting to be encoded and sent into the network. A sequence number

9If packets are not of equal size, the smaller packets can be padded to the size of the largest packet in the FEC block before processing them.

is assigned to each packet.

Data encryption

In step , the payload of the packets created in step are encrypted. The encryption is done using a block cipher. The cipher is used in CBC mode, and the sequence number in the packet is used as the initialization vector for the cipher. The encryption covers only the payload part of the packet. The sequence number in the packet remains in plaintext. The payload is padded to a multiple of the size of the cipher before encryption, if needed.

 

The pseudocode pads each one of the u packets into the size required by the cipher and encrypts the packets using the sequence number as the initialization vector. At the end of this step, the content of each packet will be as follows.

SeqNum, Encr(Payload Padding)

That is, the packet consists of an encrypted payload and the sequence number.

FEC generation

In step , f forward error correction packets are computed from the u packets generated in step . The error correction data is computed over the payload of the original packets. That is, the sequence numbers in the packets are not included. Each one of the FEC packets are also given a sequence number, starting with the sequence number q + u.

 

The pseudocode generates f forward error correction packets from the u packets created in the previous steps. Each FEC packet is also assigned a sequence number. In the pseudocode, the first parameter to  is a pointer to all content packets from which the FEC packets are computed.

The second parameter is the identity number of the FEC packet which is to be generated. The identity number is needed again by the FEC algorithm when the error correction packets are used for recreating lost packets.

At the end of this step the content of the original packets from the previous step will be as follows.

SeqNum, Encr(Payload Padding)

The packets which were created by the FEC operation will have the fol-lowing format.

SeqNum, FEC data

Source authentication

In step , hash trees are computed from the packets generated so far. The roots of the hash trees are then signed using a public key signature algorithm.

Usually more than one hash trees are generated from the packets of one FEC block, because FEC blocks are typically wider than the authentication trees.

Figure 7 illustrates the creation of an authentication tree. As the first step in creating a hash tree, a cryptographic hash is computed over every w packets used to create a tree. The hash is computed over the entire packet, including the sequence number field and the possible padding in the packet.

Also, the source and destination addresses which will be later added to the packet are included in the hash computation. That is the hash is computed as

hash = cryptohash(Dest Src SeqNum Encr(Payload Padding) ) for packets generated from the data packets. For the packets generated from the FEC packets, the hash is computed as follows.

hash = cryptohash(Dest Src SeqNum FEC data )

Next, a hash tree is computed from the generated cryptographic hashes.

The hashes generated above directly from the packets are called the level 0 in the hash tree. The levels starting from number 1 in the tree are computed from the data in the previous level. The next level consist of hashes of the concatenation of hashes in the previous level. Each pair of hashes in the previous level are concatenated together and hashed to create the next level.

That is, if the hashes H0,0and H0,1are concatenated together, the hash H1,0

is its hash. Likewise, the hashes H0,2 and H0,3 are used to compute the hash H1,1. New levels are created in the hash tree until only one hash is available to the algorithm. This hash is called the root of the hash tree. The root of the tree is then signed to create a root signature for the tree. The process is illustrated in Figure 7 for a tree 8 packets wide.

Several parallel authentication trees are built if one authentication tree is not wide enough to cover the entire FEC block. Each of the separate authentication trees will have a different root signature. The pseudocode below shows how an authentication tree is created.

 

H0,0 H0,1 H0,2 H0,3 H0,4 H0,5 H0,6 H0,7

Figure 7: The authentication process.

Once the authentication tree has been created and signed, the required authentication hashes are added into the packets. The hashes which are added to a packet are the ones required to reconstruct the hash path from the hash of the packet to the root hash. That is, each packet needs to contain the minimum number of hashes from the hash tree, which can be used to reconstruct the hash path from the packet to the root of the tree. The pseu-docode below performs this operation for each packet in the hash tree that was created above.

Figure 8 shows which hashes from the tree are added into the packet when constructing the hash path for packet number 5. This same example will be used again in Section 6.5 where the packet is authenticated using the data in the packet. The circled hashes and the root signature in the picture are added into the headers of the packet. For example, the packet number 5 from the tree in Figure 8 will include the hashes H0,4, H1,3, and H2,0, in this order. This can be verified by running following pseudocode. The pseudocode chooses the hashes for all packets in the authentication tree. The hashes for packet number 5 are selected when the counter i has the value 5.

The variable w, the width of the authentication tree, is assume to be 8 as is the figure.

H0,0 H0,1 H0,2 H0,3 H0,4 H0,5 H0,6 H0,7

Figure 8: Example of source authenticating packet number 5 in the tree.



At the end of this step, the content of each packet will be as follows.

PacketType, Hash-path, Signature, SeqNum, { Encr(Payload) Padding / FEC data }

When the execution of the multicast packet creation reaches this point, one entire FEC block of multicast data has been created. The value for q is incremented by s and the process continues at step as long as more content data is available. When the entire FEC-block of packets has been processed, the packets are moved into a transmission queue. From the queue, the packets are sent into the network.