examples/csma-packet-socket.cc
changeset 3257 ba198dad54a2
parent 3026 4ef834f6b67d
child 3381 3cdd9d60f7c7
equal deleted inserted replaced
3256:11a21b053e95 3257:ba198dad54a2
    65   PacketSocketHelper packetSocket;
    65   PacketSocketHelper packetSocket;
    66   packetSocket.Install (c);
    66   packetSocket.Install (c);
    67 
    67 
    68   // create the shared medium used by all csma devices.
    68   // create the shared medium used by all csma devices.
    69   NS_LOG_INFO ("Create channels.");
    69   NS_LOG_INFO ("Create channels.");
    70   Ptr<CsmaChannel> channel = CreateObject<CsmaChannel> ("BitRate", DataRateValue (DataRate(5000000)), 
    70   Ptr<CsmaChannel> channel = CreateObject<CsmaChannel> (
    71                                                         "Delay", TimeValue (MilliSeconds(2)));
    71     "DataRate", DataRateValue (DataRate(5000000)), 
       
    72     "Delay", TimeValue (MilliSeconds(2)));
    72 
    73 
    73   // use a helper function to connect our nodes to the shared channel.
    74   // use a helper function to connect our nodes to the shared channel.
    74   NS_LOG_INFO ("Build Topology.");
    75   NS_LOG_INFO ("Build Topology.");
    75   CsmaHelper csma;
    76   CsmaHelper csma;
    76   csma.SetDeviceParameter ("EncapsulationMode", StringValue ("Llc"));
    77   csma.SetDeviceParameter ("EncapsulationMode", StringValue ("Llc"));