mirror of
https://gitlab.ibr.cs.tu-bs.de/tschuber/ns-3-leo.git
synced 2025-06-08 10:03:58 +02:00
Remove broadcast hack
This commit is contained in:
parent
751daa724b
commit
e05dc827cc
2 changed files with 17 additions and 57 deletions
|
@ -68,11 +68,7 @@ IslMockChannel::TransmitStart (
|
||||||
if (dst == nullptr)
|
if (dst == nullptr)
|
||||||
{
|
{
|
||||||
NS_LOG_LOGIC ("destination address " << destAddr << " unknown on channel");
|
NS_LOG_LOGIC ("destination address " << destAddr << " unknown on channel");
|
||||||
for (uint32_t i = 0; i < GetNDevices (); i++)
|
return false;
|
||||||
{
|
|
||||||
Deliver (p, src, DynamicCast<MockNetDevice> (GetDevice (i)), txTime);
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -49,67 +49,31 @@ LeoMockChannel::TransmitStart (Ptr<const Packet> p,
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Hack for NDP and ARP caches
|
|
||||||
// TODO check if NDP or ARP address
|
|
||||||
bool isBroadcast = (m_groundDevices.find (dst) == m_groundDevices.end ()
|
|
||||||
&& m_satelliteDevices.find (dst) == m_satelliteDevices.end ());
|
|
||||||
|
|
||||||
bool fromGround = m_groundDevices.find (srcDev->GetAddress ()) != m_groundDevices.end ();
|
bool fromGround = m_groundDevices.find (srcDev->GetAddress ()) != m_groundDevices.end ();
|
||||||
|
|
||||||
if (isBroadcast)
|
if (fromGround)
|
||||||
{
|
{
|
||||||
NS_LOG_DEBUG (">>>broadcast for " << srcDev->GetAddress () << " -> " << dst);
|
// Satellites can always directly be addresses
|
||||||
// Broadcast hack for ARP and neighbor cache
|
// Assume beams are narrow enough to not also receive the signal at other
|
||||||
// TODO remove if found a way to fill neighbor cache / ARP by hand
|
// satellites for performance reasons.
|
||||||
if (fromGround)
|
DeviceIndex::iterator it = m_satelliteDevices.find (dst);
|
||||||
|
if (it == m_satelliteDevices.end ())
|
||||||
{
|
{
|
||||||
for (DeviceIndex::iterator it = m_satelliteDevices.begin ();
|
NS_LOG_ERROR ("unable to find satellite with address " << dst);
|
||||||
it != m_satelliteDevices.end ();
|
return false;
|
||||||
it++)
|
|
||||||
{
|
|
||||||
// TODO deliver only to devices in the same beam
|
|
||||||
NS_LOG_DEBUG ("from ground " << srcDev->GetAddress () << " -> " << it->second->GetAddress ());
|
|
||||||
Deliver (p, srcDev, it->second, txTime);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
for (DeviceIndex::iterator it = m_groundDevices.begin ();
|
|
||||||
it != m_groundDevices.end ();
|
|
||||||
it++)
|
|
||||||
{
|
|
||||||
// TODO deliver only to devices in the same beam
|
|
||||||
NS_LOG_DEBUG ("from space " << srcDev->GetAddress () << " -> " << it->second->GetAddress ());
|
|
||||||
Deliver (p, srcDev, it->second, txTime);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
NS_LOG_DEBUG ("BOOOOM " << srcDev->GetAddress () << " -> " << dst);
|
||||||
|
return Deliver (p, srcDev, it->second, txTime);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
// space to ground delivers to everything within the beam
|
||||||
{
|
{
|
||||||
if (fromGround)
|
for (DeviceIndex::iterator it = m_groundDevices.begin ();
|
||||||
|
it != m_groundDevices.end ();
|
||||||
|
it++)
|
||||||
{
|
{
|
||||||
// Satellites can always directly be addresses
|
// TODO deliver only to devices in the same beam
|
||||||
// Assume beams are narrow enough to not also receive the signal at other
|
Deliver (p, srcDev, it->second, txTime);
|
||||||
// satellites for performance reasons.
|
|
||||||
DeviceIndex::iterator it = m_satelliteDevices.find (dst);
|
|
||||||
if (it == m_satelliteDevices.end ())
|
|
||||||
{
|
|
||||||
NS_LOG_ERROR ("unable to find satellite with address " << dst);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
NS_LOG_DEBUG ("BOOOOM " << srcDev->GetAddress () << " -> " << dst);
|
|
||||||
return Deliver (p, srcDev, it->second, txTime);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
// space to ground delivers to everything within the beam
|
|
||||||
{
|
|
||||||
for (DeviceIndex::iterator it = m_groundDevices.begin ();
|
|
||||||
it != m_groundDevices.end ();
|
|
||||||
it++)
|
|
||||||
{
|
|
||||||
// TODO deliver only to devices in the same beam
|
|
||||||
Deliver (p, srcDev, it->second, txTime);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue