139 |
139 |
140 <li><b>Wifi Promisc Sniff interface modified </b> |
140 <li><b>Wifi Promisc Sniff interface modified </b> |
141 <p> |
141 <p> |
142 To accommodate support for the radiotap and prism headers in PCAP traces, the interface for promiscuos mode sniff in the wifi device was changed. The new implementation was heavily inspired by the way the madwifi driver handles monitor mode. A distinction between TX and RX events is introduced, to account for the fact that different information is to be put in the radiotap/prism header (e.g., RSSI and noise make sense only for RX packets). The following are the relevant modifications to the WifiPhy class: |
142 To accommodate support for the radiotap and prism headers in PCAP traces, the interface for promiscuos mode sniff in the wifi device was changed. The new implementation was heavily inspired by the way the madwifi driver handles monitor mode. A distinction between TX and RX events is introduced, to account for the fact that different information is to be put in the radiotap/prism header (e.g., RSSI and noise make sense only for RX packets). The following are the relevant modifications to the WifiPhy class: |
143 <pre> |
143 <pre> |
144 - void NotifyPromiscSniff (Ptr<const Packet> packet); |
144 - void NotifyPromiscSniff (Ptr<const Packet> packet); |
145 + void NotifyPromiscSniffRx (Ptr<const Packet> packet, uint16_t channelFreqMhz, uint32_t rate, bool isShortPreamble, double signalDbm, double noiseDbm); |
145 + void NotifyPromiscSniffRx (Ptr<const Packet> packet, uint16_t channelFreqMhz, uint32_t rate, bool isShortPreamble, double signalDbm, double noiseDbm); |
146 + void NotifyPromiscSniffTx (Ptr<const Packet> packet, uint16_t channelFreqMhz, uint32_t rate, bool isShortPreamble); |
146 + void NotifyPromiscSniffTx (Ptr<const Packet> packet, uint16_t channelFreqMhz, uint32_t rate, bool isShortPreamble); |
147 - TracedCallback<Ptr<const Packet> > m_phyPromiscSnifferTrace; |
147 - TracedCallback<Ptr<const Packet> > m_phyPromiscSnifferTrace; |
148 + TracedCallback<Ptr<const Packet>, uint16_t, uint32_t, bool, double, double> m_phyPromiscSniffRxTrace; |
148 + TracedCallback<Ptr<const Packet>, uint16_t, uint32_t, bool, double, double> m_phyPromiscSniffRxTrace; |
149 + TracedCallback<Ptr<const Packet>, uint16_t, uint32_t, bool> m_phyPromiscSniffTxTrace; |
149 + TracedCallback<Ptr<const Packet>, uint16_t, uint32_t, bool> m_phyPromiscSniffTxTrace; |
150 </pre> |
150 </pre> |
151 The above mentioned callbacks are expected to be used to call the following method to write Wifi PCAP traces in promiscuous mode: |
151 The above mentioned callbacks are expected to be used to call the following method to write Wifi PCAP traces in promiscuous mode: |
152 <pre> |
152 <pre> |
153 + void WriteWifiMonitorPacket(Ptr<const Packet> packet, uint16_t channelFreqMhz, uint32_t rate, bool isShortPreamble, bool isTx, double signalDbm, double noiseDbm); |
153 + void WriteWifiMonitorPacket(Ptr<const Packet> packet, uint16_t channelFreqMhz, uint32_t rate, bool isShortPreamble, bool isTx, double signalDbm, double noiseDbm); |
154 </pre> |
154 </pre> |
155 In the above method, the isTx parameter is to be used to differentiate between TX and RX packets. For an example of how to implement these callbacks, see the implementation of PcapSniffTxEvent and PcapSniffRxEvent in src/helper/yans-wifi-helper.cc |
155 In the above method, the isTx parameter is to be used to differentiate between TX and RX packets. For an example of how to implement these callbacks, see the implementation of PcapSniffTxEvent and PcapSniffRxEvent in src/helper/yans-wifi-helper.cc |
156 </p> |
156 </p> |
157 </li> |
157 </li> |
158 |
158 |
179 ip_route_output() and ip_route_input(). However, |
179 ip_route_output() and ip_route_input(). However, |
180 the general nature of these calls (synchronous routing lookup for |
180 the general nature of these calls (synchronous routing lookup for |
181 locally originated packets, and an asynchronous, callback-based lookup |
181 locally originated packets, and an asynchronous, callback-based lookup |
182 for forwarded packets) is still the same. |
182 for forwarded packets) is still the same. |
183 <pre> |
183 <pre> |
184 - typedef Callback<void, bool, const Ipv4Route&, Ptr<Packet>, const Ipv4Header&> RouteReplyCallback; |
184 - typedef Callback<void, bool, const Ipv4Route&, Ptr<Packet>, const Ipv4Header&> RouteReplyCallback; |
185 + typedef Callback<void, Ptr<Ipv4Route>, Ptr<const Packet>, const Ipv4Header &> UnicastForwardCallback; |
185 + typedef Callback<void, Ptr<Ipv4Route>, Ptr<const Packet>, const Ipv4Header &> UnicastForwardCallback; |
186 + typedef Callback<void, Ptr<Ipv4MulticastRoute>, Ptr<const Packet>, const Ipv4Header &> MulticastForwardCallback; |
186 + typedef Callback<void, Ptr<Ipv4MulticastRoute>, Ptr<const Packet>, const Ipv4Header &> MulticastForwardCallback; |
187 + typedef Callback<void, Ptr<const Packet>, const Ipv4Header &, uint32_t > LocalDeliverCallback; |
187 + typedef Callback<void, Ptr<const Packet>, const Ipv4Header &, uint32_t > LocalDeliverCallback; |
188 + typedef Callback<void, Ptr<const Packet>, const Ipv4Header &> ErrorCallback; |
188 + typedef Callback<void, Ptr<const Packet>, const Ipv4Header &> ErrorCallback; |
189 - virtual bool RequestInterface (Ipv4Address destination, uint32_t& interface) = 0; |
189 - virtual bool RequestInterface (Ipv4Address destination, uint32_t& interface) = 0; |
190 + virtual Ptr<Ipv4Route> RouteOutput (Ptr<Packet> p, const Ipv4Header &header, uint32_t oif, Socket::SocketErrno &errno) = 0; |
190 + virtual Ptr<Ipv4Route> RouteOutput (Ptr<Packet> p, const Ipv4Header &header, uint32_t oif, Socket::SocketErrno &errno) = 0; |
191 - virtual bool RequestRoute (uint32_t interface, |
191 - virtual bool RequestRoute (uint32_t interface, |
192 - const Ipv4Header &ipHeader, |
192 - const Ipv4Header &ipHeader, |
193 - Ptr<Packet> packet, |
193 - Ptr<Packet> packet, |
194 - RouteReplyCallback routeReply) = 0; |
194 - RouteReplyCallback routeReply) = 0; |
195 + virtual bool RouteInput (Ptr<const Packet> p, const Ipv4Header &header, Ptr<const NetDevice> idev, |
195 + virtual bool RouteInput (Ptr<const Packet> p, const Ipv4Header &header, Ptr<const NetDevice> idev, |
196 + UnicastForwardCallback ucb, MulticastForwardCallback mcb, |
196 + UnicastForwardCallback ucb, MulticastForwardCallback mcb, |
197 + LocalDeliverCallback lcb, ErrorCallback ecb) = 0; |
197 + LocalDeliverCallback lcb, ErrorCallback ecb) = 0; |
198 </pre> |
198 </pre> |
199 |
199 |
200 </li> |
200 </li> |
240 to an Ipv4 interface are instead named "interface". |
240 to an Ipv4 interface are instead named "interface". |
241 <pre> |
241 <pre> |
242 - static const uint32_t Ipv4RoutingProtocol::IF_INDEX_ANY = 0xffffffff; |
242 - static const uint32_t Ipv4RoutingProtocol::IF_INDEX_ANY = 0xffffffff; |
243 + static const uint32_t Ipv4RoutingProtocol::INTERFACE_ANY = 0xffffffff; |
243 + static const uint32_t Ipv4RoutingProtocol::INTERFACE_ANY = 0xffffffff; |
244 |
244 |
245 - bool Ipv4RoutingProtocol::RequestIfIndex (Ipv4Address destination, uint32_t& ifIndex); |
245 - bool Ipv4RoutingProtocol::RequestIfIndex (Ipv4Address destination, uint32_t& ifIndex); |
246 + bool Ipv4RoutingProtocol::RequestInterface (Ipv4Address destination, uint32_t& interface); |
246 + bool Ipv4RoutingProtocol::RequestInterface (Ipv4Address destination, uint32_t& interface); |
247 (N.B. this particular function is planned to be renamed to RouteOutput() in the |
247 (N.B. this particular function is planned to be renamed to RouteOutput() in the |
248 proposed IPv4 routing refactoring) |
248 proposed IPv4 routing refactoring) |
249 |
249 |
250 - uint32_t Ipv4::GetIfIndexByAddress (Ipv4Address addr, Ipv4Mask mask); |
250 - uint32_t Ipv4::GetIfIndexByAddress (Ipv4Address addr, Ipv4Mask mask); |
251 + int_32t Ipv4::GetInterfaceForAddress (Ipv4Address address, Ipv4Mask mask) const; |
251 + int_32t Ipv4::GetInterfaceForAddress (Ipv4Address address, Ipv4Mask mask) const; |
252 |
252 |
253 - bool Ipv4::GetIfIndexForDestination (Ipv4Address dest, uint32_t &ifIndex) const; |
253 - bool Ipv4::GetIfIndexForDestination (Ipv4Address dest, uint32_t &ifIndex) const; |
254 + bool Ipv4::GetInterfaceForDestination (Ipv4Address dest, uint32_t &interface) const; |
254 + bool Ipv4::GetInterfaceForDestination (Ipv4Address dest, uint32_t &interface) const; |
255 (N.B. this function is not needed in the proposed Ipv4 routing refactoring) |
255 (N.B. this function is not needed in the proposed Ipv4 routing refactoring) |
256 </pre> |
256 </pre> |
257 |
257 |
258 |
258 |
259 <li><b>Allow multiple IPv4 addresses to be assigned to an interface (bug 188)</b> |
259 <li><b>Allow multiple IPv4 addresses to be assigned to an interface (bug 188)</b> |
267 + virtual uint32_t GetNAddresses (uint32_t interface) const = 0; |
267 + virtual uint32_t GetNAddresses (uint32_t interface) const = 0; |
268 </pre> |
268 </pre> |
269 <li>Regarding legacy API usage, typically where you once did the following, |
269 <li>Regarding legacy API usage, typically where you once did the following, |
270 using the public Ipv4 class interface (e.g.): |
270 using the public Ipv4 class interface (e.g.): |
271 <pre> |
271 <pre> |
272 ipv4A->SetAddress (ifIndexA, Ipv4Address ("172.16.1.1")); |
272 ipv4A->SetAddress (ifIndexA, Ipv4Address ("172.16.1.1")); |
273 ipv4A->SetNetworkMask (ifIndexA, Ipv4Mask ("255.255.255.255")); |
273 ipv4A->SetNetworkMask (ifIndexA, Ipv4Mask ("255.255.255.255")); |
274 </pre> |
274 </pre> |
275 you now do: |
275 you now do: |
276 <pre> |
276 <pre> |
277 Ipv4InterfaceAddress ipv4IfAddrA = Ipv4InterfaceAddress (Ipv4Address ("172.16.1.1"), Ipv4Mask ("255.255.255.255")); |
277 Ipv4InterfaceAddress ipv4IfAddrA = Ipv4InterfaceAddress (Ipv4Address ("172.16.1.1"), Ipv4Mask ("255.255.255.255")); |
278 ipv4A->AddAddress (ifIndexA, ipv4IfAddrA); |
278 ipv4A->AddAddress (ifIndexA, ipv4IfAddrA); |
279 </pre> |
279 </pre> |
280 <li> At the helper API level, one often gets an address from an interface |
280 <li> At the helper API level, one often gets an address from an interface |
281 container. We preserve the legacy GetAddress (uint32_t i) but it |
281 container. We preserve the legacy GetAddress (uint32_t i) but it |
282 is documented that this will return only the first (address index 0) |
282 is documented that this will return only the first (address index 0) |
283 address on the interface, if there are multiple such addresses. |
283 address on the interface, if there are multiple such addresses. |
291 </ul> |
291 </ul> |
292 |
292 |
293 <li><b>New WifiMacHelper objects</b> |
293 <li><b>New WifiMacHelper objects</b> |
294 <p>The type of wifi MAC is now set by two new specific helpers, NqosWifiMacHelper for non QoS MACs and QosWifiMacHelper for Qos MACs. They are passed as argument to WifiHelper::Install methods.</li> |
294 <p>The type of wifi MAC is now set by two new specific helpers, NqosWifiMacHelper for non QoS MACs and QosWifiMacHelper for Qos MACs. They are passed as argument to WifiHelper::Install methods.</li> |
295 <pre> |
295 <pre> |
296 - void WifiHelper::SetMac (std::string type, std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (),...) |
296 - void WifiHelper::SetMac (std::string type, std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (),...) |
297 |
297 |
298 - NetDeviceContainer WifiHelper::Install (const WifiPhyHelper &phyHelper, NodeContainer c) const |
298 - NetDeviceContainer WifiHelper::Install (const WifiPhyHelper &phyHelper, NodeContainer c) const |
299 + NetDeviceContainer WifiHelper::Install (const WifiPhyHelper &phyHelper, const WifiMacHelper &macHelper, NodeContainer c) const |
299 + NetDeviceContainer WifiHelper::Install (const WifiPhyHelper &phyHelper, const WifiMacHelper &macHelper, NodeContainer c) const |
300 |
300 |
301 - NetDeviceContainer WifiHelper::Install (const WifiPhyHelper &phy, Ptr<Node> node) const |
301 - NetDeviceContainer WifiHelper::Install (const WifiPhyHelper &phy, Ptr<Node> node) const |
302 + NetDeviceContainer WifiHelper::Install (const WifiPhyHelper &phy, const WifiMacHelper &mac, Ptr<Node> node) const |
302 + NetDeviceContainer WifiHelper::Install (const WifiPhyHelper &phy, const WifiMacHelper &mac, Ptr<Node> node) const |
303 |
303 |
304 - NetDeviceContainer WifiHelper::Install (const WifiPhyHelper &phy, std::string nodeName) const |
304 - NetDeviceContainer WifiHelper::Install (const WifiPhyHelper &phy, std::string nodeName) const |
305 + NetDeviceContainer WifiHelper::Install (const WifiPhyHelper &phy, const WifiMacHelper &mac, std::string nodeName) const |
305 + NetDeviceContainer WifiHelper::Install (const WifiPhyHelper &phy, const WifiMacHelper &mac, std::string nodeName) const |
306 </pre> |
306 </pre> |
307 See src/helper/nqos-wifi-mac-helper.h and src/helper/qos-wifi-mac-helper.h for more details. |
307 See src/helper/nqos-wifi-mac-helper.h and src/helper/qos-wifi-mac-helper.h for more details. |
308 </p> |
308 </p> |
309 |
309 |
310 <li><b>Remove Mac48Address::IsMulticast</b> |
310 <li><b>Remove Mac48Address::IsMulticast</b> |
569 <li> |
569 <li> |
570 bug 273: constify packet pointers.<br> |
570 bug 273: constify packet pointers.<br> |
571 The normal and the promiscuous receive callbacks of the NetDevice API |
571 The normal and the promiscuous receive callbacks of the NetDevice API |
572 have been changed from: |
572 have been changed from: |
573 <pre> |
573 <pre> |
574 Callback<bool,Ptr<NetDevice>,Ptr<Packet>,uint16_t,const Address &> |
574 Callback<bool,Ptr<NetDevice>,Ptr<Packet>,uint16_t,const Address &> |
575 Callback<bool,Ptr<NetDevice>, Ptr<Packet>, uint16_t, |
575 Callback<bool,Ptr<NetDevice>, Ptr<Packet>, uint16_t, |
576 const Address &, const Address &, enum PacketType > |
576 const Address &, const Address &, enum PacketType > |
577 </pre> |
577 </pre> |
578 to: |
578 to: |
579 <pre> |
579 <pre> |
580 Callback<bool,Ptr<NetDevice>,Ptr<const Packet>,uint16_t,const Address &> |
580 Callback<bool,Ptr<NetDevice>,Ptr<const Packet>,uint16_t,const Address &> |
581 Callback<bool,Ptr<NetDevice>, Ptr<const Packet>, uint16_t, |
581 Callback<bool,Ptr<NetDevice>, Ptr<const Packet>, uint16_t, |
582 const Address &, const Address &, enum PacketType > |
582 const Address &, const Address &, enum PacketType > |
583 </pre> |
583 </pre> |
584 to avoid the kind of bugs reported in |
584 to avoid the kind of bugs reported in |
585 <a href="http://www.nsnam.org/bugzilla/show_bug.cgi?id=273">bug 273</a>. |
585 <a href="http://www.nsnam.org/bugzilla/show_bug.cgi?id=273">bug 273</a>. |
586 Users who implement a subclass of the NetDevice base class need to change the signature |
586 Users who implement a subclass of the NetDevice base class need to change the signature |
587 of their SetReceiveCallback and SetPromiscReceiveCallback methods. |
587 of their SetReceiveCallback and SetPromiscReceiveCallback methods. |
646 public: |
646 public: |
647 - UdpEchoServerHelper (); |
647 - UdpEchoServerHelper (); |
648 - void SetPort (uint16_t port); |
648 - void SetPort (uint16_t port); |
649 + UdpEchoServerHelper (uint16_t port); |
649 + UdpEchoServerHelper (uint16_t port); |
650 + |
650 + |
651 + void SetAttribute (std::string name, const AttributeValue &value); |
651 + void SetAttribute (std::string name, const AttributeValue &value); |
652 ApplicationContainer Install (NodeContainer c); |
652 ApplicationContainer Install (NodeContainer c); |
653 |
653 |
654 class UdpEchoClientHelper |
654 class UdpEchoClientHelper |
655 { |
655 { |
656 public: |
656 public: |
657 - UdpEchoClientHelper (); |
657 - UdpEchoClientHelper (); |
658 + UdpEchoClientHelper (Ipv4Address ip, uint16_t port); |
658 + UdpEchoClientHelper (Ipv4Address ip, uint16_t port); |
659 - void SetRemote (Ipv4Address ip, uint16_t port); |
659 - void SetRemote (Ipv4Address ip, uint16_t port); |
660 - void SetAppAttribute (std::string name, const AttributeValue &value); |
660 - void SetAppAttribute (std::string name, const AttributeValue &value); |
661 + void SetAttribute (std::string name, const AttributeValue &value); |
661 + void SetAttribute (std::string name, const AttributeValue &value); |
662 ApplicationContainer Install (NodeContainer c); |
662 ApplicationContainer Install (NodeContainer c); |
663 </pre> |
663 </pre> |
664 </li> |
664 </li> |
665 </ul> |
665 </ul> |
666 |
666 |