Bug 1812 - example/stats wifi program manual is erroneous

This commit is contained in:
Tommaso Pecorella
2013-12-11 10:00:06 +01:00
parent 9499558186
commit ef9dc2aadc
7 changed files with 24 additions and 4 deletions

View File

@@ -359,7 +359,10 @@ Ipv4FlowProbe::DropLogger (const Ipv4Header &ipHeader, Ptr<const Packet> ipPaylo
myReason = DROP_FRAGMENT_TIMEOUT;
NS_LOG_DEBUG ("DROP_FRAGMENT_TIMEOUT");
break;
case Ipv4L3Protocol::DROP_MTU_TOO_LITTLE:
myReason = DROP_MTU_TOO_LITTLE;
NS_LOG_DEBUG ("DROP_MTU_TOO_LITTLE");
break;
default:
myReason = DROP_INVALID_REASON;
NS_FATAL_ERROR ("Unexpected drop reason code " << reason);

View File

@@ -69,6 +69,7 @@ public:
DROP_INTERFACE_DOWN, /**< Interface is down so can not send packet */
DROP_ROUTE_ERROR, /**< Route error */
DROP_FRAGMENT_TIMEOUT, /**< Fragment timeout exceeded */
DROP_MTU_TOO_LITTLE, /**< MTU (or PMTU) lower than minimum */
DROP_INVALID_REASON, /**< Fallback reason (no known reason) */
};

View File

@@ -748,6 +748,15 @@ Ipv4L3Protocol::SendRealOut (Ptr<Ipv4Route> route,
Ptr<Ipv4Interface> outInterface = GetInterface (interface);
NS_LOG_LOGIC ("Send via NetDevice ifIndex " << outDev->GetIfIndex () << " ipv4InterfaceIndex " << interface);
// RFC 791, pg.25:
// Every internet module must be able to forward a datagram of 68
// octets without further fragmentation. This is because an internet
// header may be up to 60 octets, and the minimum fragment is 8 octets.
if (outInterface->GetDevice ()->GetMtu () < 68)
{
m_dropTrace (ipHeader, packet, DROP_MTU_TOO_LITTLE, m_node->GetObject<Ipv4> (), interface);
}
if (!route->GetGateway ().IsEqual (Ipv4Address ("0.0.0.0")))
{
if (outInterface->IsUp ())

View File

@@ -98,8 +98,9 @@ public:
DROP_BAD_CHECKSUM, /**< Bad checksum */
DROP_INTERFACE_DOWN, /**< Interface is down so can not send packet */
DROP_ROUTE_ERROR, /**< Route error */
DROP_FRAGMENT_TIMEOUT /**< Fragment timeout exceeded */
};
DROP_FRAGMENT_TIMEOUT, /**< Fragment timeout exceeded */
DROP_MTU_TOO_LITTLE, /**< MTU (or PMTU) lower than minimum */
};
/**
* \brief Set node associated with this stack.

View File

@@ -888,6 +888,11 @@ void Ipv6L3Protocol::SendRealOut (Ptr<Ipv6Route> route, Ptr<Packet> packet, Ipv6
targetMtu = dev->GetMtu ();
}
if (targetMtu<1280)
{
m_dropTrace (ipHeader, packet, DROP_MTU_TOO_LITTLE, m_node->GetObject<Ipv6> (), interface);
}
if (packet->GetSize () > targetMtu + 40) /* 40 => size of IPv6 header */
{
// Router => drop

View File

@@ -81,6 +81,7 @@ public:
DROP_INTERFACE_DOWN, /**< Interface is down so can not send packet */
DROP_ROUTE_ERROR, /**< Route error */
DROP_UNKNOWN_PROTOCOL, /**< Unknown L4 protocol */
DROP_MTU_TOO_LITTLE, /**< MTU (or PMTU) lower than minimum */
};
/**

View File

@@ -242,7 +242,7 @@ To see what the example program, applications, and stat framework are doing in d
.. sourcecode:: bash
$ export NS_LOG=StatFramework:WiFiDistanceExperiment:WiFiDistanceApps
$ export NS_LOG=WiFiDistanceExperiment:WiFiDistanceApps
Note that this slows down the simulation extraordinarily.