LEFT | RIGHT |
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2007,2008 INRIA | 3 * Copyright (c) 2007,2008 INRIA |
4 * | 4 * |
5 * This program is free software; you can redistribute it and/or modify | 5 * This program is free software; you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 2 as | 6 * it under the terms of the GNU General Public License version 2 as |
7 * published by the Free Software Foundation; | 7 * published by the Free Software Foundation; |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 NS_ASSERT_MSG (connection->HasPackets (), | 92 NS_ASSERT_MSG (connection->HasPackets (), |
93 "SS: Error while scheduling packets: The selected connectio
n has no packets"); | 93 "SS: Error while scheduling packets: The selected connectio
n has no packets"); |
94 } | 94 } |
95 | 95 |
96 Ptr<Packet> packet; | 96 Ptr<Packet> packet; |
97 | 97 |
98 while (connection && connection->HasPackets (packetType)) | 98 while (connection && connection->HasPackets (packetType)) |
99 { | 99 { |
100 NS_LOG_INFO ("FRAG_DEBUG: SS Scheduler" << std::endl); | 100 NS_LOG_INFO ("FRAG_DEBUG: SS Scheduler" << std::endl); |
101 | 101 |
102 uint32_t availableByte = static_cast<uint32_t>(m_ss->GetPhy ()-> | 102 uint32_t availableByte = static_cast<uint32_t> (m_ss->GetPhy ()-> |
103 GetNrBytes (availableSymbols, modulationType)); | 103 GetNrBytes (availableSymbols, modulationType)); |
104 | 104 |
105 uint32_t requiredByte = connection->GetQueue ()->GetFirstPacketRequiredByt
e (packetType); | 105 uint32_t requiredByte = connection->GetQueue ()->GetFirstPacketRequiredByt
e (packetType); |
106 | 106 |
107 NS_LOG_INFO ("\t availableByte = " << availableByte << | 107 NS_LOG_INFO ("\t availableByte = " << availableByte << |
108 ", requiredByte = " << requiredByte); | 108 ", requiredByte = " << requiredByte); |
109 | 109 |
110 if (availableByte >= requiredByte) | 110 if (availableByte >= requiredByte) |
111 { | 111 { |
112 // The SS could sent a packet without a other fragmentation | 112 // The SS could sent a packet without a other fragmentation |
113 NS_LOG_INFO ("\t availableByte >= requiredByte" | 113 NS_LOG_INFO ("\t availableByte >= requiredByte" |
114 "\n\t Send packet without other fragmentation" << std::en
dl); | 114 "\n\t Send packet without other fragmentation" << std::en
dl); |
115 | 115 |
116 packet = connection->Dequeue (packetType); | 116 packet = connection->Dequeue (packetType); |
117 burst->AddPacket (packet); | 117 burst->AddPacket (packet); |
118 | 118 |
119 nrSymbolsRequired = static_cast<uint16_t>(m_ss->GetPhy ()-> | 119 nrSymbolsRequired = static_cast<uint16_t> (m_ss->GetPhy ()-> |
120 GetNrSymbols (packet->GetSize (), modulationType)); | 120 GetNrSymbols (packet->GetSize (), modulationType)); |
121 availableSymbols -= nrSymbolsRequired; | 121 availableSymbols -= nrSymbolsRequired; |
122 } | 122 } |
123 else | 123 else |
124 { | 124 { |
125 if (connection->GetType () == Cid::TRANSPORT) | 125 if (connection->GetType () == Cid::TRANSPORT) |
126 { | 126 { |
127 NS_LOG_INFO ("\t availableByte < requiredByte" | 127 NS_LOG_INFO ("\t availableByte < requiredByte" |
128 "\n\t Check if the fragmentation is possible"); | 128 "\n\t Check if the fragmentation is possible"); |
129 | 129 |
130 uint32_t headerSize = connection->GetQueue ()->GetFirstPacketHdrSi
ze (packetType); | 130 uint32_t headerSize = connection->GetQueue ()->GetFirstPacketHdrSi
ze (packetType); |
131 if (!connection->GetQueue ()->CheckForFragmentation (packetType)) | 131 if (!connection->GetQueue ()->CheckForFragmentation (packetType)) |
132 { | 132 { |
133 NS_LOG_INFO ("\t Add fragmentSubhdrSize = 2"); | 133 NS_LOG_INFO ("\t Add fragmentSubhdrSize = 2"); |
134 headerSize += 2; | 134 headerSize += 2; |
135 } | 135 } |
136 NS_LOG_INFO ("\t availableByte = " << availableByte << | 136 NS_LOG_INFO ("\t availableByte = " << availableByte << |
137 " headerSize = " << headerSize); | 137 " headerSize = " << headerSize); |
138 | 138 |
139 if (availableByte > headerSize) | 139 if (availableByte > headerSize) |
140 { | 140 { |
141 NS_LOG_INFO ("\t Fragmentation IS possible"); | 141 NS_LOG_INFO ("\t Fragmentation IS possible"); |
142 packet = connection->Dequeue (packetType, availableByte); | 142 packet = connection->Dequeue (packetType, availableByte); |
143 burst->AddPacket (packet); | 143 burst->AddPacket (packet); |
144 | 144 |
145 nrSymbolsRequired = static_cast<uint16_t>(m_ss->GetPhy ()-> | 145 nrSymbolsRequired = static_cast<uint16_t> (m_ss->GetPhy ()-> |
146 GetNrSymbols (packet->GetSize (), modulationType)); | 146 GetNrSymbols (packet->GetSize (), modulationType)); |
147 availableSymbols -= nrSymbolsRequired; | 147 availableSymbols -= nrSymbolsRequired; |
148 } | 148 } |
149 else | 149 else |
150 { | 150 { |
151 NS_LOG_INFO ("\t Fragmentation IS NOT possible" << std::endl); | 151 NS_LOG_INFO ("\t Fragmentation IS NOT possible" << std::endl); |
152 break; | 152 break; |
153 } | 153 } |
154 } | 154 } |
155 else | 155 else |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 | 243 |
244 if (m_ss->GetBroadcastConnection ()->HasPackets ()) | 244 if (m_ss->GetBroadcastConnection ()->HasPackets ()) |
245 { | 245 { |
246 return m_ss->GetBroadcastConnection (); | 246 return m_ss->GetBroadcastConnection (); |
247 } | 247 } |
248 NS_LOG_INFO ("NO connection is selected!"); | 248 NS_LOG_INFO ("NO connection is selected!"); |
249 return 0; | 249 return 0; |
250 } | 250 } |
251 | 251 |
252 } // namespace ns3 | 252 } // namespace ns3 |
LEFT | RIGHT |