(五岁以下儿童)NS3:桥模块演示样品csma-bridge.cc凝视程序


1、Ns3 bridge模csma-bridge.cc演示示例程序的目光

// Network topology
//
// n0 n1
// | |
// ----------
// | Switch |
// ----------
// | |
// n2 n3
//
//
// - CBR/UDP flows from n0 to n1 and from n3 to n0 恒定的比特流从n0转发到n1。从n3转发到n0
// - DropTail queues 队尾丢弃队列
// - Tracing of queues and packet receptions to file "csma-bridge.tr" 追踪队列和包的接收 //该程序为网桥节点安装了四个NetDevice,分别与n0,n1,n2,n4相连,即属于同一个局域网。 通过网桥节点,终于实现了在二层链路层的数据交换
#include <iostream>
#include <fstream> #include "ns3/core-module.h"
#include "ns3/network-module.h"
#include "ns3/applications-module.h"
#include "ns3/bridge-module.h"
#include "ns3/csma-module.h"
#include "ns3/internet-module.h" using namespace ns3; NS_LOG_COMPONENT_DEFINE ("CsmaBridgeExample"); int
main (int argc, char *argv[])
{
//
// Users may find it convenient to turn on explicit debugging
// for selected modules; the below lines suggest how to do this
//我们能够通过选择执行模块,进行方便的调试
#if 0
LogComponentEnable ("CsmaBridgeExample", LOG_LEVEL_INFO);
#endif //
// Allow the user to override any of the defaults and the above Bind() at
// run-time, via command-line arguments
//同意用户执行时,通过命令行參数覆盖属性默认值
CommandLine cmd;
cmd.Parse (argc, argv); //
// Explicitly create the nodes required by the topology (shown above).
//
NS_LOG_INFO ("Create nodes.");//自己定义logging输出语句,程序执行到此时会输出此语句
NodeContainer terminals;
terminals.Create (4); //创建4个终端 NodeContainer csmaSwitch;
csmaSwitch.Create (1); //创建一个网桥 NS_LOG_INFO ("Build Topology");//自己定义logging输出语句
CsmaHelper csma;//CsmaHelper类,帮助设置设备和信道属性。
csma.SetChannelAttribute ("DataRate", DataRateValue (5000000));//每条与网桥连接链路属性设置,数据率有Channel属性指定,而非Device属性指定。
csma.SetChannelAttribute ("Delay", TimeValue (MilliSeconds (2))); // Create the csma links, from each terminal to the switch
//创建每一个终端到网桥的链路
NetDeviceContainer terminalDevices;//终端设备
NetDeviceContainer switchDevices; //网桥设备 for (int i = 0; i < 4; i++)
{
NetDeviceContainer link = csma.Install (NodeContainer (terminals.Get (i), csmaSwitch)); //有两个节点的容器,为它们安装csma设备和信道。它们属于一个局域网
terminalDevices.Add (link.Get (0));//将相应设备加入到终端设备,设备的编号是按这个安装先后顺序编号。
switchDevices.Add (link.Get (1));//加入到网桥
} // Create the bridge netdevice, which will do the packet switching
Ptr<Node> switchNode = csmaSwitch.Get (0);//获取网桥节点
BridgeHelper bridge;
bridge.Install (switchNode, switchDevices);//安装网桥到网桥节点 // Add internet stack to the terminals
InternetStackHelper internet;
internet.Install (terminals); // We've got the "hardware" in place. Now we need to add IP addresses.
//
NS_LOG_INFO ("Assign IP Addresses.");//自己定义logging输出语句
Ipv4AddressHelper ipv4;
ipv4.SetBase ("10.1.1.0", "255.255.255.0");
ipv4.Assign (terminalDevices);//仅仅有终端设备须要配置ip地址 //
// Create an OnOff application to send UDP datagrams from node zero to node 1.
//建立了一个onoff应用。
NS_LOG_INFO ("Create Applications.");//自己定义logging输出语句
uint16_t port = 9; // Discard port (RFC 863) 丢弃端口??? OnOffHelper onoff ("ns3::UdpSocketFactory",
Address (InetSocketAddress (Ipv4Address ("10.1.1.2"), port)));//Address具有多态性。Create an address from another address. ? ??
onoff.SetConstantRate (DataRate ("500kb/s")); //CBR 恒定速率的比特流从n0转发到n1,从n3转发到n0 ApplicationContainer app = onoff.Install (terminals.Get (0));//OnOffApplication
// Start the application
app.Start (Seconds (1.0));
app.Stop (Seconds (10.0)); // Create an optional packet sink to receive these packets,创建一个节点可选的包接收,主要用于多播情形,支持对仅仅感兴趣的二层多播帧接收。
PacketSinkHelper sink ("ns3::UdpSocketFactory",
Address (InetSocketAddress (Ipv4Address::GetAny (), port))); app = sink.Install (terminals.Get (1));//安装PacketSink (Applications)到n1
app.Start (Seconds (0.0)); //
// Create a similar flow from n3 to n0, starting at time 1.1 seconds
//
onoff.SetAttribute ("Remote",
AddressValue (InetSocketAddress (Ipv4Address ("10.1.1.1"), port)));
app = onoff.Install (terminals.Get (3));
app.Start (Seconds (1.1));
app.Stop (Seconds (10.0)); app = sink.Install (terminals.Get (0));//安装PacketSink (Applications)到n0
app.Start (Seconds (0.0)); NS_LOG_INFO ("Configure Tracing.");//自己定义logging输出语句 //
// Configure tracing of all enqueue, dequeue, and NetDevice receive events.配置文件来跟踪入队,出队和NetDevice的接收事件
// Trace output will be sent to the file "csma-bridge.tr"
//
AsciiTraceHelper ascii;//以ASCII格式的tracing追踪信息输出
csma.EnableAsciiAll (ascii.CreateFileStream ("csma-bridge.tr")); //
// Also configure some tcpdump traces; each interface will be traced.配置tcpdump, 跟踪每一个接口
// The output files will be named:
// csma-bridge-<nodeId>-<interfaceId>.pcap
// and can be read by the "tcpdump -r" command (use "-tt" option to
// display timestamps correctly)
//
csma.EnablePcapAll ("csma-bridge", false); //
// Now, do the actual simulation.
//
NS_LOG_INFO ("Run Simulation.");//自己定义logging输出语句
Simulator::Run ();
Simulator::Destroy ();
NS_LOG_INFO ("Done.");
}

2、解读输出的ASCII Tracing文件:cama-bridge.tr

+:设备队列入队操作,-:设备队列的出队操作,r:网络设备接收到数据包。

//网桥操作,主要涉及ARP逆向地址解析协议
//节点n0開始广播请求ipv4: 10.1.1.2的mac地址
+ 1.00919 /NodeList/0/DeviceList/0/$ns3::CsmaNetDevice/TxQueue/Enqueue
ns3::EthernetHeader ( length/type=0x806, source=00:00:00:00:00:01, destination=ff:ff:ff:ff:ff:ff)
ns3::ArpHeader (request source mac: 00-06-00:00:00:00:00:01 source ipv4: 10.1.1.1 dest ipv4: 10.1.1.2)
Payload (size=18) ns3::EthernetTrailer (fcs=0)
- 1.00919 /NodeList/0/DeviceList/0/$ns3::CsmaNetDevice/TxQueue/Dequeue
ns3::EthernetHeader ( length/type=0x806, source=00:00:00:00:00:01, destination=ff:ff:ff:ff:ff:ff)
ns3::ArpHeader (request source mac: 00-06-00:00:00:00:00:01 source ipv4: 10.1.1.1 dest ipv4: 10.1.1.2)
Payload (size=18) ns3::EthernetTrailer (fcs=0)
//网桥设备在某个port收到n0的广播帧后。通过其它port在其它局域网内广播,接收port即n4节点的1NetDevice不再广播,仅仅是接收了广播帧
+ 1.01129 /NodeList/4/DeviceList/1/$ns3::CsmaNetDevice/TxQueue/Enqueue ns3::EthernetHeader ( length/type=0x806, source=00:00:00:00:00:01, destination=ff:ff:ff:ff:ff:ff) ns3::ArpHeader (request source mac: 00-06-00:00:00:00:00:01 source ipv4: 10.1.1.1 dest ipv4: 10.1.1.2) Payload (size=18) ns3::EthernetTrailer (fcs=0)
- 1.01129 /NodeList/4/DeviceList/1/$ns3::CsmaNetDevice/TxQueue/Dequeue ns3::EthernetHeader ( length/type=0x806, source=00:00:00:00:00:01, destination=ff:ff:ff:ff:ff:ff) ns3::ArpHeader (request source mac: 00-06-00:00:00:00:00:01 source ipv4: 10.1.1.1 dest ipv4: 10.1.1.2) Payload (size=18) ns3::EthernetTrailer (fcs=0)
+ 1.01129 /NodeList/4/DeviceList/2/$ns3::CsmaNetDevice/TxQueue/Enqueue ns3::EthernetHeader ( length/type=0x806, source=00:00:00:00:00:01, destination=ff:ff:ff:ff:ff:ff) ns3::ArpHeader (request source mac: 00-06-00:00:00:00:00:01 source ipv4: 10.1.1.1 dest ipv4: 10.1.1.2) Payload (size=18) ns3::EthernetTrailer (fcs=0)
- 1.01129 /NodeList/4/DeviceList/2/$ns3::CsmaNetDevice/TxQueue/Dequeue ns3::EthernetHeader ( length/type=0x806, source=00:00:00:00:00:01, destination=ff:ff:ff:ff:ff:ff) ns3::ArpHeader (request source mac: 00-06-00:00:00:00:00:01 source ipv4: 10.1.1.1 dest ipv4: 10.1.1.2) Payload (size=18) ns3::EthernetTrailer (fcs=0)
+ 1.01129 /NodeList/4/DeviceList/3/$ns3::CsmaNetDevice/TxQueue/Enqueue ns3::EthernetHeader ( length/type=0x806, source=00:00:00:00:00:01, destination=ff:ff:ff:ff:ff:ff) ns3::ArpHeader (request source mac: 00-06-00:00:00:00:00:01 source ipv4: 10.1.1.1 dest ipv4: 10.1.1.2) Payload (size=18) ns3::EthernetTrailer (fcs=0)
- 1.01129 /NodeList/4/DeviceList/3/$ns3::CsmaNetDevice/TxQueue/Dequeue ns3::EthernetHeader ( length/type=0x806, source=00:00:00:00:00:01, destination=ff:ff:ff:ff:ff:ff) ns3::ArpHeader (request source mac: 00-06-00:00:00:00:00:01 source ipv4: 10.1.1.1 dest ipv4: 10.1.1.2) Payload (size=18) ns3::EthernetTrailer (fcs=0)
r 1.01129 /NodeList/4/DeviceList/0/$ns3::CsmaNetDevice/MacRx
ns3::EthernetHeader ( length/type=0x806, source=00:00:00:00:00:01, destination=ff:ff:ff:ff:ff:ff)
ns3::ArpHeader (request source mac: 00-06-00:00:00:00:00:01 source ipv4: 10.1.1.1 dest ipv4: 10.1.1.2)
Payload (size=18) ns3::EthernetTrailer (fcs=0)
//目的节点n1收到了发给它的广播帧
r 1.0134 /NodeList/1/DeviceList/0/$ns3::CsmaNetDevice/MacRx
ns3::EthernetHeader ( length/type=0x806, source=00:00:00:00:00:01, destination=ff:ff:ff:ff:ff:ff)
ns3::ArpHeader (request source mac: 00-06-00:00:00:00:00:01 source ipv4: 10.1.1.1 dest ipv4: 10.1.1.2)
Payload (size=18) ns3::EthernetTrailer (fcs=0)
//n1回复n0,不仅有IP 地址,还知道了mac地址。逆向地址学习
+ 1.0134 /NodeList/1/DeviceList/0/$ns3::CsmaNetDevice/TxQueue/Enqueue
ns3::EthernetHeader ( length/type=0x806, source=00:00:00:00:00:03, destination=00:00:00:00:00:01)
ns3::ArpHeader (reply source mac: 00-06-00:00:00:00:00:03 source ipv4: 10.1.1.2 dest mac: 00-06-00:00:00:00:00:01 dest ipv4: 10.1.1.1)
Payload (size=18) ns3::EthernetTrailer (fcs=0)
- 1.0134 /NodeList/1/DeviceList/0/$ns3::CsmaNetDevice/TxQueue/Dequeue ns3::EthernetHeader ( length/type=0x806, source=00:00:00:00:00:03, destination=00:00:00:00:00:01) ns3::ArpHeader (reply source mac: 00-06-00:00:00:00:00:03 source ipv4: 10.1.1.2 dest mac: 00-06-00:00:00:00:00:01 dest ipv4: 10.1.1.1) Payload (size=18) ns3::EthernetTrailer (fcs=0)
//n2接收到n1原始广播帧
r 1.0134 /NodeList/2/DeviceList/0/$ns3::CsmaNetDevice/MacRx
ns3::EthernetHeader ( length/type=0x806, source=00:00:00:00:00:01, destination=ff:ff:ff:ff:ff:ff)
ns3::ArpHeader (request source mac: 00-06-00:00:00:00:00:01 source ipv4: 10.1.1.1 dest ipv4: 10.1.1.2)
Payload (size=18) ns3::EthernetTrailer (fcs=0)
//n3接收到n1原始广播帧
r 1.0134 /NodeList/3/DeviceList/0/$ns3::CsmaNetDevice/MacRx ns3::EthernetHeader ( length/type=0x806, source=00:00:00:00:00:01, destination=ff:ff:ff:ff:ff:ff) ns3::ArpHeader (request source mac: 00-06-00:00:00:00:00:01 source ipv4: 10.1.1.1 dest ipv4: 10.1.1.2) Payload (size=18) ns3::EthernetTrailer (fcs=0) //由于n1的回复帧有目的mac地址,网桥知道仅仅需在0port转发到n0所在局域网
+ 1.0155 /NodeList/4/DeviceList/0/$ns3::CsmaNetDevice/TxQueue/Enqueue ns3::EthernetHeader ( length/type=0x806, source=00:00:00:00:00:03, destination=00:00:00:00:00:01) ns3::ArpHeader (reply source mac: 00-06-00:00:00:00:00:03 source ipv4: 10.1.1.2 dest mac: 00-06-00:00:00:00:00:01 dest ipv4: 10.1.1.1) Payload (size=18) ns3::EthernetTrailer (fcs=0)
- 1.0155 /NodeList/4/DeviceList/0/$ns3::CsmaNetDevice/TxQueue/Dequeue ns3::EthernetHeader ( length/type=0x806, source=00:00:00:00:00:03, destination=00:00:00:00:00:01) ns3::ArpHeader (reply source mac: 00-06-00:00:00:00:00:03 source ipv4: 10.1.1.2 dest mac: 00-06-00:00:00:00:00:01 dest ipv4: 10.1.1.1) Payload (size=18) ns3::EthernetTrailer (fcs=0) //n0接收n1节点的回复帧
r 1.0176 /NodeList/0/DeviceList/0/$ns3::CsmaNetDevice/MacRx ns3::EthernetHeader ( length/type=0x806, source=00:00:00:00:00:03, destination=00:00:00:00:00:01) ns3::ArpHeader (reply source mac: 00-06-00:00:00:00:00:03 source ipv4: 10.1.1.2 dest mac: 00-06-00:00:00:00:00:01 dest ipv4: 10.1.1.1) Payload (size=18) ns3::EthernetTrailer (fcs=0) //n0继续给n1发送数据,发了两个数据包
+ 1.0176 /NodeList/0/DeviceList/0/$ns3::CsmaNetDevice/TxQueue/Enqueue
ns3::EthernetHeader ( length/type=0x800, source=00:00:00:00:00:01, destination=00:00:00:00:00:03)
ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 64 id 0 protocol 17 offset (bytes) 0 flags [none] length: 540 10.1.1.1 > 10.1.1.2)
ns3::UdpHeader (length: 520 49153 > 9)
Payload (size=512) ns3::EthernetTrailer (fcs=0)
- 1.0176 /NodeList/0/DeviceList/0/$ns3::CsmaNetDevice/TxQueue/Dequeue ns3::EthernetHeader ( length/type=0x800, source=00:00:00:00:00:01, destination=00:00:00:00:00:03) ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 64 id 0 protocol 17 offset (bytes) 0 flags [none] length: 540 10.1.1.1 > 10.1.1.2) ns3::UdpHeader (length: 520 49153 > 9) Payload (size=512) ns3::EthernetTrailer (fcs=0)
+ 1.0176 /NodeList/0/DeviceList/0/$ns3::CsmaNetDevice/TxQueue/Enqueue ns3::EthernetHeader ( length/type=0x800, source=00:00:00:00:00:01, destination=00:00:00:00:00:03) ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 64 id 1 protocol 17 offset (bytes) 0 flags [none] length: 540 10.1.1.1 > 10.1.1.2) ns3::UdpHeader (length: 520 49153 > 9) Payload (size=512) ns3::EthernetTrailer (fcs=0)
- 1.01852 /NodeList/0/DeviceList/0/$ns3::CsmaNetDevice/TxQueue/Dequeue ns3::EthernetHeader ( length/type=0x800, source=00:00:00:00:00:01, destination=00:00:00:00:00:03) ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 64 id 1 protocol 17 offset (bytes) 0 flags [none] length: 540 10.1.1.1 > 10.1.1.2) ns3::UdpHeader (length: 520 49153 > 9) Payload (size=512) ns3::EthernetTrailer (fcs=0) //网桥依据mac地址直接将第一个数据包由port1转发到n1所在局域网
+ 1.0205 /NodeList/4/DeviceList/1/$ns3::CsmaNetDevice/TxQueue/Enqueue
ns3::EthernetHeader ( length/type=0x800, source=00:00:00:00:00:01, destination=00:00:00:00:00:03)
ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 64 id 0 protocol 17 offset (bytes) 0 flags [none] length: 540 10.1.1.1 > 10.1.1.2)
ns3::UdpHeader (length: 520 49153 > 9) Payload (size=512) ns3::EthernetTrailer (fcs=0)
- 1.0205 /NodeList/4/DeviceList/1/$ns3::CsmaNetDevice/TxQueue/Dequeue ns3::EthernetHeader ( length/type=0x800, source=00:00:00:00:00:01, destination=00:00:00:00:00:03) ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 64 id 0 protocol 17 offset (bytes) 0 flags [none] length: 540 10.1.1.1 > 10.1.1.2) ns3::UdpHeader (length: 520 49153 > 9) Payload (size=512) ns3::EthernetTrailer (fcs=0) //n1节点接收第一个数据包
r 1.02339 /NodeList/1/DeviceList/0/$ns3::CsmaNetDevice/MacRx
ns3::EthernetHeader ( length/type=0x800, source=00:00:00:00:00:01, destination=00:00:00:00:00:03)
ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 64 id 0 protocol 17 offset (bytes) 0 flags [none] length: 540 10.1.1.1 > 10.1.1.2)
ns3::UdpHeader (length: 520 49153 > 9) Payload (size=512) ns3::EthernetTrailer (fcs=0) //网桥依据mac地址直接将第二个数据包由port1转发到n1所在局域网
+ 1.02347 /NodeList/4/DeviceList/1/$ns3::CsmaNetDevice/TxQueue/Enqueue
ns3::EthernetHeader ( length/type=0x800, source=00:00:00:00:00:01, destination=00:00:00:00:00:03)
ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 64 id 1 protocol 17 offset (bytes) 0 flags [none] length: 540 10.1.1.1 > 10.1.1.2)
ns3::UdpHeader (length: 520 49153 > 9) Payload (size=512) ns3::EthernetTrailer (fcs=0)
- 1.02347 /NodeList/4/DeviceList/1/$ns3::CsmaNetDevice/TxQueue/Dequeue ns3::EthernetHeader ( length/type=0x800, source=00:00:00:00:00:01, destination=00:00:00:00:00:03) ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 64 id 1 protocol 17 offset (bytes) 0 flags [none] length: 540 10.1.1.1 > 10.1.1.2) ns3::UdpHeader (length: 520 49153 > 9) Payload (size=512) ns3::EthernetTrailer (fcs=0) //n0发送第三个数据包
+ 1.02458 /NodeList/0/DeviceList/0/$ns3::CsmaNetDevice/TxQueue/Enqueue
ns3::EthernetHeader ( length/type=0x800, source=00:00:00:00:00:01, destination=00:00:00:00:00:03)
ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 64 id 2 protocol 17 offset (bytes) 0 flags [none] length: 540 10.1.1.1 > 10.1.1.2) ns3::UdpHeader (length: 520 49153 > 9) Payload (size=512) ns3::EthernetTrailer (fcs=0)
- 1.02458 /NodeList/0/DeviceList/0/$ns3::CsmaNetDevice/TxQueue/Dequeue ns3::EthernetHeader ( length/type=0x800, source=00:00:00:00:00:01, destination=00:00:00:00:00:03) ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 64 id 2 protocol 17 offset (bytes) 0 flags [none] length: 540 10.1.1.1 > 10.1.1.2) ns3::UdpHeader (length: 520 49153 > 9) Payload (size=512) ns3::EthernetTrailer (fcs=0) //n1接收第2个数据包
r 1.02636 /NodeList/1/DeviceList/0/$ns3::CsmaNetDevice/MacRx
ns3::EthernetHeader ( length/type=0x800, source=00:00:00:00:00:01, destination=00:00:00:00:00:03)
ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 64 id 1 protocol 17 offset (bytes) 0 flags [none] length: 540 10.1.1.1 > 10.1.1.2) ns3::UdpHeader (length: 520 49153 > 9) Payload (size=512) ns3::EthernetTrailer (fcs=0)/ //网桥转发第3个数据包
+ 1.02747 /NodeList/4/DeviceList/1/$ns3::CsmaNetDevice/TxQueue/Enqueue ns3::EthernetHeader ( length/type=0x800, source=00:00:00:00:00:01, destination=00:00:00:00:00:03)
ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 64 id 2 protocol 17 offset (bytes) 0 flags [none] length: 540 10.1.1.1 > 10.1.1.2) ns3::UdpHeader (length: 520 49153 > 9) Payload (size=512) ns3::EthernetTrailer (fcs=0)
- 1.02747 /NodeList/4/DeviceList/1/$ns3::CsmaNetDevice/TxQueue/Dequeue ns3::EthernetHeader ( length/type=0x800, source=00:00:00:00:00:01, destination=00:00:00:00:00:03) ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 64 id 2 protocol 17 offset (bytes) 0 flags [none] length: 540 10.1.1.1 > 10.1.1.2) ns3::UdpHeader (length: 520 49153 > 9) Payload (size=512) ns3::EthernetTrailer (fcs=0) //n1接收第3个数据包
r 1.03036 /NodeList/1/DeviceList/0/$ns3::CsmaNetDevice/MacRx ns3::EthernetHeader ( length/type=0x800, source=00:00:00:00:00:01, destination=00:00:00:00:00:03)
ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 64 id 2 protocol 17 offset (bytes) 0 flags [none] length: 540 10.1.1.1 > 10.1.1.2) ns3::UdpHeader (length: 520 49153 > 9) Payload (size=512) ns3::EthernetTrailer (fcs=0) //发送接收转发第4个数据包
+ 1.03277 /NodeList/0/DeviceList/0/$ns3::CsmaNetDevice/TxQueue/Enqueue ns3::EthernetHeader ( length/type=0x800, source=00:00:00:00:00:01, destination=00:00:00:00:00:03)
ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 64 id 3 protocol 17 offset (bytes) 0 flags [none] length: 540 10.1.1.1 > 10.1.1.2) ns3::UdpHeader (length: 520 49153 > 9) Payload (size=512) ns3::EthernetTrailer (fcs=0)
- 1.03277 /NodeList/0/DeviceList/0/$ns3::CsmaNetDevice/TxQueue/Dequeue ns3::EthernetHeader ( length/type=0x800, source=00:00:00:00:00:01, destination=00:00:00:00:00:03) ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 64 id 3 protocol 17 offset (bytes) 0 flags [none] length: 540 10.1.1.1 > 10.1.1.2) ns3::UdpHeader (length: 520 49153 > 9) Payload (size=512) ns3::EthernetTrailer (fcs=0)
+ 1.03566 /NodeList/4/DeviceList/1/$ns3::CsmaNetDevice/TxQueue/Enqueue ns3::EthernetHeader ( length/type=0x800, source=00:00:00:00:00:01, destination=00:00:00:00:00:03)
ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 64 id 3 protocol 17 offset (bytes) 0 flags [none] length: 540 10.1.1.1 > 10.1.1.2) ns3::UdpHeader (length: 520 49153 > 9) Payload (size=512) ns3::EthernetTrailer (fcs=0)
- 1.03566 /NodeList/4/DeviceList/1/$ns3::CsmaNetDevice/TxQueue/Dequeue ns3::EthernetHeader ( length/type=0x800, source=00:00:00:00:00:01, destination=00:00:00:00:00:03) ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 64 id 3 protocol 17 offset (bytes) 0 flags [none] length: 540 10.1.1.1 > 10.1.1.2) ns3::UdpHeader (length: 520 49153 > 9) Payload (size=512) ns3::EthernetTrailer (fcs=0)
r 1.03855 /NodeList/1/DeviceList/0/$ns3::CsmaNetDevice/MacRx ns3::EthernetHeader ( length/type=0x800, source=00:00:00:00:00:01, destination=00:00:00:00:00:03)
ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 64 id 3 protocol 17 offset (bytes) 0 flags [none] length: 540 10.1.1.1 > 10.1.1.2) ns3::UdpHeader (length: 520 49153 > 9) Payload (size=512) ns3::EthernetTrailer (fcs=0)
//发送接收转发第5个数据包
+ 1.04096 /NodeList/0/DeviceList/0/$ns3::CsmaNetDevice/TxQueue/Enqueue ns3::EthernetHeader ( length/type=0x800, source=00:00:00:00:00:01, destination=00:00:00:00:00:03)
ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 64 id 4 protocol 17 offset (bytes) 0 flags [none] length: 540 10.1.1.1 > 10.1.1.2) ns3::UdpHeader (length: 520 49153 > 9) Payload (size=512) ns3::EthernetTrailer (fcs=0)
- 1.04096 /NodeList/0/DeviceList/0/$ns3::CsmaNetDevice/TxQueue/Dequeue ns3::EthernetHeader ( length/type=0x800, source=00:00:00:00:00:01, destination=00:00:00:00:00:03) ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 64 id 4 protocol 17 offset (bytes) 0 flags [none] length: 540 10.1.1.1 > 10.1.1.2) ns3::UdpHeader (length: 520 49153 > 9) Payload (size=512) ns3::EthernetTrailer (fcs=0)
+ 1.04385 /NodeList/4/DeviceList/1/$ns3::CsmaNetDevice/TxQueue/Enqueue ns3::EthernetHeader ( length/type=0x800, source=00:00:00:00:00:01, destination=00:00:00:00:00:03)
ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 64 id 4 protocol 17 offset (bytes) 0 flags [none] length: 540 10.1.1.1 > 10.1.1.2) ns3::UdpHeader (length: 520 49153 > 9) Payload (size=512) ns3::EthernetTrailer (fcs=0)
- 1.04385 /NodeList/4/DeviceList/1/$ns3::CsmaNetDevice/TxQueue/Dequeue ns3::EthernetHeader ( length/type=0x800, source=00:00:00:00:00:01, destination=00:00:00:00:00:03) ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 64 id 4 protocol 17 offset (bytes) 0 flags [none] length: 540 10.1.1.1 > 10.1.1.2) ns3::UdpHeader (length: 520 49153 > 9) Payload (size=512) ns3::EthernetTrailer (fcs=0)
r 1.04675 /NodeList/1/DeviceList/0/$ns3::CsmaNetDevice/MacRx ns3::EthernetHeader ( length/type=0x800, source=00:00:00:00:00:01, destination=00:00:00:00:00:03)
ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 64 id 4 protocol 17 offset (bytes) 0 flags [none] length: 540 10.1.1.1 > 10.1.1.2) ns3::UdpHeader (length: 520 49153 > 9) Payload (size=512) ns3::EthernetTrailer (fcs=0) ...... + 1.1065 /NodeList/0/DeviceList/0/$ns3::CsmaNetDevice/TxQueue/Enqueue ns3::EthernetHeader ( length/type=0x800, source=00:00:00:00:00:01, destination=00:00:00:00:00:03)
ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 64 id 12 protocol 17 offset (bytes) 0 flags [none] length: 540 10.1.1.1 > 10.1.1.2) ns3::UdpHeader (length: 520 49153 > 9) Payload (size=512) ns3::EthernetTrailer (fcs=0)
- 1.1065 /NodeList/0/DeviceList/0/$ns3::CsmaNetDevice/TxQueue/Dequeue ns3::EthernetHeader ( length/type=0x800, source=00:00:00:00:00:01, destination=00:00:00:00:00:03) ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 64 id 12 protocol 17 offset (bytes) 0 flags [none] length: 540 10.1.1.1 > 10.1.1.2) ns3::UdpHeader (length: 520 49153 > 9) Payload (size=512) ns3::EthernetTrailer (fcs=0)
+ 1.10939 /NodeList/4/DeviceList/1/$ns3::CsmaNetDevice/TxQueue/Enqueue ns3::EthernetHeader ( length/type=0x800, source=00:00:00:00:00:01, destination=00:00:00:00:00:03) ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 64 id 12 protocol 17 offset (bytes) 0 flags [none] length: 540 10.1.1.1 > 10.1.1.2) ns3::UdpHeader (length: 520 49153 > 9) Payload (size=512) ns3::EthernetTrailer (fcs=0)
- 1.10939 /NodeList/4/DeviceList/1/$ns3::CsmaNetDevice/TxQueue/Dequeue ns3::EthernetHeader ( length/type=0x800, source=00:00:00:00:00:01, destination=00:00:00:00:00:03) ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 64 id 12 protocol 17 offset (bytes) 0 flags [none] length: 540 10.1.1.1 > 10.1.1.2) ns3::UdpHeader (length: 520 49153 > 9) Payload (size=512) ns3::EthernetTrailer (fcs=0) 第二部分,节点n3到n0的发送过程開始,内容相似(n0到n1同一时候在通信)
+ 1.11119 /NodeList/3/DeviceList/0/$ns3::CsmaNetDevice/TxQueue/Enqueue ns3::EthernetHeader ( length/type=0x806, source=00:00:00:00:00:07, destination=ff:ff:ff:ff:ff:ff)
ns3::ArpHeader (request source mac: 00-06-00:00:00:00:00:07 source ipv4: 10.1.1.4 dest ipv4: 10.1.1.1) Payload (size=18) ns3::EthernetTrailer (fcs=0)
- 1.11119 /NodeList/3/DeviceList/0/$ns3::CsmaNetDevice/TxQueue/Dequeue ns3::EthernetHeader ( length/type=0x806, source=00:00:00:00:00:07, destination=ff:ff:ff:ff:ff:ff) ns3::ArpHeader (request source mac: 00-06-00:00:00:00:00:07 source ipv4: 10.1.1.4 dest ipv4: 10.1.1.1) Payload (size=18) ns3::EthernetTrailer (fcs=0)
r 1.11228 /NodeList/1/DeviceList/0/$ns3::CsmaNetDevice/MacRx ns3::EthernetHeader ( length/type=0x800, source=00:00:00:00:00:01, destination=00:00:00:00:00:03) ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 64 id 12 protocol 17 offset (bytes) 0 flags [none] length: 540 10.1.1.1 > 10.1.1.2) ns3::UdpHeader (length: 520 49153 > 9) Payload (size=512) ns3::EthernetTrailer (fcs=0)
+ 1.11329 /NodeList/4/DeviceList/0/$ns3::CsmaNetDevice/TxQueue/Enqueue ns3::EthernetHeader ( length/type=0x806, source=00:00:00:00:00:07, destination=ff:ff:ff:ff:ff:ff) ns3::ArpHeader (request source mac: 00-06-00:00:00:00:00:07 source ipv4: 10.1.1.4 dest ipv4: 10.1.1.1) Payload (size=18) ns3::EthernetTrailer (fcs=0)
- 1.11329 /NodeList/4/DeviceList/0/$ns3::CsmaNetDevice/TxQueue/Dequeue ns3::EthernetHeader ( length/type=0x806, source=00:00:00:00:00:07, destination=ff:ff:ff:ff:ff:ff) ns3::ArpHeader (request source mac: 00-06-00:00:00:00:00:07 source ipv4: 10.1.1.4 dest ipv4: 10.1.1.1) Payload (size=18) ns3::EthernetTrailer (fcs=0)
......

版权声明:本文博主原创文章。博客,未经同意不得转载。

(五岁以下儿童)NS3样本演示:桥模块演示样品csma-bridge.cc凝视程序的更多相关文章

  1. linux下一个Oracle11g RAC建立(五岁以下儿童)

    linux下一个Oracle11g RAC建立(五岁以下儿童) 四.建立主机之间的信任关系(node1.node2) 建立节点之间oracle .grid 用户之间的信任(通过ssh 建立公钥和私钥) ...

  2. python学习笔记(五岁以下儿童)深深浅浅的副本复印件,文件和文件夹

    python学习笔记(五岁以下儿童) 深拷贝-浅拷贝 浅拷贝就是对引用的拷贝(仅仅拷贝父对象) 深拷贝就是对对象的资源拷贝 普通的复制,仅仅是添加了一个指向同一个地址空间的"标签" ...

  3. PE文件结构(五岁以下儿童)基地搬迁

    PE文件结构(五岁以下儿童) 參考 书:<加密与解密> 视频:小甲鱼 解密系列 视频 基址重定位 链接器生成一个PE文件时,它会如果程序被装入时使用的默认ImageBase基地址(VC默认 ...

  4. ExtJs4得知(五岁以下儿童)主要的Ext分类

    Ext类是ExtJs最常见的.最基本的类,它是一个全局对象,它封装了全班.辛格尔顿和 Sencha 该方法提供了一种有用的库. 嵌套在该命名空间中一个较低的水平最用户界面组件. 但是提供了很多有用的功 ...

  5. NGUI 3.5课程(五岁以下儿童)button-图片切换

    然后,我们去了一个样本,做一个button画面切换. 特征,像球员"开始"和"暂停". 写TestButton.cs脚本: using UnityEngine; ...

  6. Scrapy研究和探索(五岁以下儿童)——爬行自己主动多页(抢别人博客所有文章)

    首先.在教程(二)(http://blog.csdn.net/u012150179/article/details/32911511)中,研究的是爬取单个网页的方法.在教程(三)(http://blo ...

  7. 阐述linux IPC(五岁以下儿童):system V共享内存

    [版权声明:尊重原创.转载请保留源:blog.csdn.net/shallnet 要么 .../gentleliu,文章学习交流,不用于商业用途]         system V共享内存和posix ...

  8. nagios二次开发(五岁以下儿童)---nagios和nagiosql关系

    基于nagios和nagiosql理解.这将是这两个梳理比较粗糙的简单关系,有关详细信息,请参阅下面的图如:      从上面的关系图中能够看出,nagios与nagiosql共享了主机.主机组.服务 ...

  9. 开玩笑Web它servlet(五岁以下儿童)---- 如何解决servlet线程安全问题

    servlet默认值是安全线的存在,但说白,servlet安全线实际上是一个多线程线程安全问题.因为servlet它正好是一个多线程的安全问题出现. 每次通过浏览器http同意提交请求,将一个实例se ...

随机推荐

  1. 找工作笔试面试那些事儿(8)---常问的CC++基础题

    这一部分是C/C++程序员在面试的时候会被问到的一些题目的汇总.来源于基本笔试面试书籍,可能有一部分题比较老,但是这也算是基础中的基础,就归纳归纳放上来了.大牛们看到一笑而过就好,普通人看看要是能补上 ...

  2. class 添加样式,删,开关 【选择】addClass,removeClass,toggleClass

    <1> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>< ...

  3. 利用Nginx构建负载均衡server

    大家都知道.一个域名相应一个IP地址,而一个WebSite则相应一个IP地址上相应port服务的应用程序(或位置).而大型站点的并发訪问量很大,这些站点是怎样在一台Webserver上实现负载均衡的呢 ...

  4. Javascript异步数据的同步处理方法

    数据处理方法封装 var DataWatch=(function(){ var gWatch={},cursor= 0,callback_key = 'callback',gMap={}; var c ...

  5. uva 11722 - Joining with Friend(概率)

    题目连接:uva 11722 - Joining with Friend 题目大意:你和朋友乘火车,而且都会路过A市.给定两人可能到达A市的时段,火车会停w.问说两人能够见面的概率. 解题思路:y = ...

  6. Spark1.0.0 属性配置

    1:Spark1.0.0属性配置方式       Spark属性提供了大部分应用程序的控制项,而且能够单独为每一个应用程序进行配置.       在Spark1.0.0提供了3种方式的属性配置: Sp ...

  7. 关于埃博拉(Ebola)基础研究病毒

    关于埃博拉(Ebola)病毒的基础研究 2005年.美国哈佛大学医学研究院(Harvard Medical School)James Cunningham教授关于埃博拉病毒有一项基础研究,研究成果发表 ...

  8. windows phone (13) 样式继承

    原文:windows phone (13) 样式继承 在上一遍文章中已经介绍到可以在Resources集合中定义样式,我们也可以在一个样式上引用其他的样式,这就是继承的概念,使用方法是将引用的样式放置 ...

  9. J2EE请求和响应—Servlet

    一.什么是Servlet? Servlet是执行Webserver上的一个特殊Java类.其特殊用途是响应client请求并做出处理.使得client与server端进行交互. 二.生命周期  Ser ...

  10. BZOJ 1269 文本编辑器 Splay

    题目大意:维护一个文本编辑器,支持下列操作: 1.将光标移动到某一位置 2.在光标后插入一段字符串 3.删除光标后的一段字符 4.翻转光标后的一段字符 5.输出光标后的一个字符 6.光标-- 7.光标 ...