Summary
---------
merger is a tool to merge multiple traffic streams.
It merges multiple input traffic streams in a FIFO/Drop tail queue.
The input to the tool consists of several traffic trace files. 
The output is written to a traffic trace file.

Execution
---------
merger <Number of input ports> <Buffer size of output port in kBytes> < Transmission rate of output port in Mb/s>

Input traffic trace file format
-------------------------------
    - Name: res<ipport>.in
    - Format: timestamp pktid srcaddr srcport dstaddr dstport size
        pktid: Unique number identifying each packet of a trace file.
        ipport: Input port that the packet arrived on.
        timestamp: Arrival time of packet to queue. 

Output traffic trace file format
-------------------------------
    - Name: res0.out
    - Format: timestamp ipport:pktid srcaddr srcport dstaddr dstport size
        timestamp: Time when the packet reaches the end of the output link.
        ipport: Input port that the packet arrived on.
    *NOTE: the timestamp in the output file reflects when the packet reaches the end of the 
     output link. i.e. the timestamp is the time when the router FINISHES outputting the packet

Authors
-------
This code is primarily by 
Purushotham Kamath <pkamath@ISI.EDU>
with contributions by
Kun-chan Lan
Gautam Thatte

It has been used in the following papers:

Purushotham Kamath, Kun-chan Lan, John Heidemann, Joe Bannister, and Joe Touch. 
Generation of High Bandwidth Network Traffic Traces. In Proceedings of the International 
Symposium on Modeling, Analysis and Simulation of Computer and Telecommunication Systems,
pp. 401-410. Fort Worth, Texas, USA, USC/Information Sciences Institute, IEEE. October, 2002. 
<http://www.isi.edu/~johnh/PAPERS/Kamath02a.html>.

Example - Taken from Test Suite
-------------------------------

TEST 01
---------
Input packets occur back-to-back ... 10 Mbps input and output bitrates

Input Trace File
1.000000 2 1677277 1942 1677256 80 1500
1.001200 4 1677277 1942 1677256 80 40
1.001232 6 1677277 1942 1677256 80 40
1.001264 8 1677277 1942 1677256 80 800
1.001904 10 1677277 1942 1677256 80 1500
1.003104 12 1677277 1942 1677256 80 40
1.003136 14 1677277 1942 1677256 80 1500
1.004336 16 1677277 1942 1677256 80 800
1.004976 18 1677277 1942 1677256 80 40
1.005008 20 1677277 1942 1677256 80 40

Output Trace File
1.001200000000 0:2 1677277 1942 1677256 80 1500
1.001232000000 0:4 1677277 1942 1677256 80 40
1.001264000000 0:6 1677277 1942 1677256 80 40
1.001904000000 0:8 1677277 1942 1677256 80 800
1.003104000000 0:10 1677277 1942 1677256 80 1500
1.003136000000 0:12 1677277 1942 1677256 80 40
1.004336000000 0:14 1677277 1942 1677256 80 1500
1.004976000000 0:16 1677277 1942 1677256 80 800
1.005008000000 0:18 1677277 1942 1677256 80 40
1.005040000000 0:20 1677277 1942 1677256 80 40

TEST 07
----------
Both input line speeds at 5 Mbps each, and *slightly staggered* packets
(have included random time increments into the second stream to cause overlapping)
output line speed set at 5 Mbps.

Input Trace Files
((stream01))
1.000000 1 1677277 1942 1677256 80 1500
1.004800 3 1677277 1942 1677256 80 40
1.004928 5 1677277 1942 1677256 80 40
1.005056 7 1677277 1942 1677256 80 800
1.007616 9 1677277 1942 1677256 80 1500
1.012416 11 1677277 1942 1677256 80 40
1.012544 13 1677277 1942 1677256 80 1500
((stream02))
1.002000 2 1677277 1942 1677256 80 1500
1.004850 4 1677277 1942 1677256 80 40
1.004950 6 1677277 1942 1677256 80 40
1.005750 8 1677277 1942 1677256 80 800
1.009016 10 1677277 1942 1677256 80 1500
1.012450 12 1677277 1942 1677256 80 40
1.014000 14 1677277 1942 1677256 80 1500

Output Trace File
1.002400000000 0:1 1677277 1942 1677256 80 1500
1.004800000000 1:2 1677277 1942 1677256 80 1500
1.004864000000 0:3 1677277 1942 1677256 80 40
1.004928000000 1:4 1677277 1942 1677256 80 40
1.004992000000 0:5 1677277 1942 1677256 80 40
1.005056000000 1:6 1677277 1942 1677256 80 40
1.006336000000 0:7 1677277 1942 1677256 80 800
1.007616000000 1:8 1677277 1942 1677256 80 800
1.010016000000 0:9 1677277 1942 1677256 80 1500
1.012416000000 1:10 1677277 1942 1677256 80 1500
1.012480000000 0:11 1677277 1942 1677256 80 40
1.012544000000 1:12 1677277 1942 1677256 80 40
1.014944000000 0:13 1677277 1942 1677256 80 1500
1.017344000000 1:14 1677277 1942 1677256 80 1500