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) 2005, 2009 INRIA | 3 * Copyright (c) 2005, 2009 INRIA |
4 * Copyright (c) 2009 MIRKO BANCHI | 4 * Copyright (c) 2009 MIRKO BANCHI |
5 * Copyright (c) 2014, INDIAN INSTITUTE OF TECHNOLOGY, MADRAS(NETWORK ENGINEERIN
G AND ANALYTICS GROUP) | 5 * Copyright (c) 2014, INDIAN INSTITUTE OF TECHNOLOGY, MADRAS(NETWORK ENGINEERIN
G AND ANALYTICS GROUP) |
6 * | 6 * |
7 * This program is free software; you can redistribute it and/or modify | 7 * This program is free software; you can redistribute it and/or modify |
8 * it under the terms of the GNU General Public License version 2 as | 8 * it under the terms of the GNU General Public License version 2 as |
9 * published by the Free Software Foundation; | 9 * published by the Free Software Foundation; |
10 * | 10 * |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 | 183 |
184 if (hash_it->second != 0) | 184 if (hash_it->second != 0) |
185 weight = hash_it->second; | 185 weight = hash_it->second; |
186 } | 186 } |
187 else if (m_wfq->m_mode == WeightedFairQueue::SOURCE) | 187 else if (m_wfq->m_mode == WeightedFairQueue::SOURCE) |
188 { | 188 { |
189 src_ip = GetIpAddressfromPacket(packet, std::string("source")); | 189 src_ip = GetIpAddressfromPacket(packet, std::string("source")); |
190 hash_it = m_wfq->m_weightsTable.find(std::make_pair(src_ip, '\0')); | 190 hash_it = m_wfq->m_weightsTable.find(std::make_pair(src_ip, '\0')); |
191 | 191 |
192 if (hash_it->second != 0) | 192 if (hash_it->second != 0) |
193 weight = hash_it->second; | 193 weight = hash_it->second; |
194 } | 194 } |
195 else if (m_wfq->m_mode == WeightedFairQueue::SOURCE_DESTINATION) | 195 else if (m_wfq->m_mode == WeightedFairQueue::SOURCE_DESTINATION) |
196 { | 196 { |
197 src_ip = GetIpAddressfromPacket(packet, std::string("source")); | 197 src_ip = GetIpAddressfromPacket(packet, std::string("source")); |
198 dest_ip = GetIpAddressfromPacket(packet, std::string("destination")); | 198 dest_ip = GetIpAddressfromPacket(packet, std::string("destination")); |
199 hash_it = m_wfq->m_weightsTable.find(std::make_pair(src_ip, dest_ip)); | 199 hash_it = m_wfq->m_weightsTable.find(std::make_pair(src_ip, dest_ip)); |
200 | 200 |
201 if (hash_it->second != 0) | 201 if (hash_it->second != 0) |
202 weight = hash_it->second; | 202 weight = hash_it->second; |
203 } | 203 } |
(...skipping 13 matching lines...) Expand all Loading... |
217 } | 217 } |
218 else if (m_wfq->m_mode == WeightedFairQueue::SOURCE_DESTINATION) | 218 else if (m_wfq->m_mode == WeightedFairQueue::SOURCE_DESTINATION) |
219 { | 219 { |
220 if (GetIpAddressfromPacket(it->packet, std::string("source")) == s
rc_ip && GetIpAddressfromPacket(it->packet, std::string("destination")) == dest_
ip) | 220 if (GetIpAddressfromPacket(it->packet, std::string("source")) == s
rc_ip && GetIpAddressfromPacket(it->packet, std::string("destination")) == dest_
ip) |
221 endOfFlow = j + 1; | 221 endOfFlow = j + 1; |
222 } | 222 } |
223 } | 223 } |
224 | 224 |
225 if (m_size > 0) | 225 if (m_size > 0) |
226 { | 226 { |
227 //now start assigning values to the "newFinishnumber" variable | 227 //now start assigning values to the "newFinishnumber" variable |
228 if (endOfFlow == 0) | 228 if (endOfFlow == 0) |
229 { | 229 { |
230 it = m_queue.begin(); | 230 it = m_queue.begin(); |
231 newFinishNumber = it->finish_number; | 231 newFinishNumber = it->finish_number; |
232 /**We approximate the SCFQ queing mechanism by using the head of l
ine packet in the queue instead of using the | 232 /**We approximate the SCFQ queing mechanism by using the head of l
ine packet in the queue instead of using the |
233 * finish number of the packet in transmission for ease of impleme
ntation. This algorithm normalises the packet's | 233 * finish number of the packet in transmission for ease of impleme
ntation. This algorithm normalises the packet's |
234 * tranmission rate ie. one byte of the packet is transmitted in o
ne time slot. Hence we simply use the packet sizes | 234 * tranmission rate ie. one byte of the packet is transmitted in o
ne time slot. Hence we simply use the packet sizes |
235 * and weights to arrange the packets in the queue that will event
ually determine their order of transmission | 235 * and weights to arrange the packets in the queue that will event
ually determine their order of transmission |
236 * */ | 236 * */ |
237 } | 237 } |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
538 } | 538 } |
539 } | 539 } |
540 return 0; | 540 return 0; |
541 } | 541 } |
542 Ptr<WeightedFairQueue> | 542 Ptr<WeightedFairQueue> |
543 WifiMacQueue::GetWfq() | 543 WifiMacQueue::GetWfq() |
544 { | 544 { |
545 return m_wfq; | 545 return m_wfq; |
546 } | 546 } |
547 } // namespace ns3 | 547 } // namespace ns3 |
LEFT | RIGHT |