Here is a quick list of the various patches for NS-2 available here.
nsaggregator.py FILENAME|- GRANULARITY NODE EVENT_RE PKT_TYPE_RE WITH_POS [NODE EVENT_RE PKT_TYPE_RE WITH_POS ...]For example, to extract both the TCP and DCCP (DCCP_Data and DCCP_DataAck) traffics received (r) by node 1 (but reporting the node's position only once per row), NsAggregator would be used as follows.
nsaggregator.py dccp-simple.tr .5 r 1 tcp yes 1 r DCCP_Data.* no > dccp-simple.datThis will examine tracefile dccp-simple.tr every half a second for tcp traffic to node 1, and report 4 columns being the average bandwidth over the last interval, the cumulative average, the number of packets, and the cumulative number of packets, as well as the geographical location of the node (if available). At the same time traffic which name match regexp DCCP_Data.* to node 1 will also be reported in a similar manner, without the geographical location of the node. Following is a sample result.
#time #1 tcp BW (Mbps) AVG Pkts Pkts tot X Y #1 DCCP_Data.* BW (Mbps) AVG Pkts Pkts tot 0.5 6.38000488281 6.38000488281 403 403 1.00 400.00 0.112060546875 0.112060546875 30 30 1.0 7.58544921875 6.98272705078 478 881 1.00 400.00 0.102630615234 0.107345581055 27 57 1.5 7.58544921875 7.1836344401 478 135 1.00 400.009 0.0989379882812 0.10454305013 26 83 2.0 7.58544921875 7.28408813477 478 183 1.00 400.007 0.1064453125 0.105018615723 28 111 2.5 7.58544921875 7.34436035156 478 231 1.00 400.005 0.106262207031 0.105267333984 28 139 3.0 7.60131835938 7.3871866862 479 279 1.00 400.004 0.113708496094 0.106674194336 30 169 3.5 7.60131835938 7.41777692522 479 327 1.00 400.003 0.117340087891 0.108197893415 31 200 4.0 7.6171875 7.44270324707 480 375 1.00 400.003 0.113586425781 0.108871459961 30 230 4.5 7.60131835938 7.46032714844 479 423 1.00 400.002 0.106140136719 0.108567979601 28 258