Sau khi hai đối tượng đại lý được định nghĩa và gắn liền với các nút, bạn có thể tạo một kết nối giữa chúng bằng cách sử dụng lệnh kết nốiĐiều này tạo ra sự liên kết giữa các mô hình người gửi UDP và người nhận mô hình NULL. Sau khi kết nối đại lý được tạo ra, bạn có thể sử dụng nó để truyền dữ liệu ứng dụng giữa các nút. | Comparing Application Performance Tools 371 Running the Model After creating and saving the simulation model you can run it using the ns command-line program ns Depending on the speed of your Unix host the simulation may run for a few seconds then finish. After it finishes you should see two files and . The file contains the network simulation data for the nam animator program. The file contains the network simulation regarding the raw data transfers. You can observe the network in action by using the nam program with the file nam This starts the nam application and loads the data from the file. You may want to click the Relayout button a few times until the network layout suits your taste. Figure shows the basic layout of the network simulation along with packets as they are being processed. Figure The nam network simulation display. 372 Chapter 19 You can watch the queue status of the router devices as packets are passed from the remote client to the server device. Interpreting the Results After the ns simulation is run you can analyze the file to observe the data transfers. A sample of the contents looks like 1 0 1 tcp 40 1 0 0 - 1 0 1 tcp 40 1 0 0 1 5 4 tcp 40 2 0 1 - 1 5 4 tcp 40 2 0 1 r 0 1 tcp 40 --- 1 0 .0 0 0 1 2 tcp 40 --- 1 0 .0 0 0 - 1 2 tcp 40 --- 1 0 .0 0 0 r 5 4 tcp 40 --- 2 5 .0 0 1 4 6 tcp 40 --- 2 5 .0 0 1 - 4 6 tcp 40 --- 2 5 .0 0 1 r 4 6 tcp 40 --- 2 5 .0 0 1 The trace file shows the status of each simulated packet at any given time in the simulation. The format of the trace file is event time src dst pkttype pktsize flags fid srcaddr dstaddr seqnum pktid The event field defines the status of the packet record. A plus sign indicates that the packet has been placed in the queue for the associated source and destination node link. A minus .