OLD | NEW |
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) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) | 3 * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) |
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 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 m_teidRbidMap.erase (teid); | 188 m_teidRbidMap.erase (teid); |
189 } | 189 } |
190 m_rbidTeidMap.erase (rntiIt); | 190 m_rbidTeidMap.erase (rntiIt); |
191 } | 191 } |
192 } | 192 } |
193 | 193 |
194 void· | 194 void· |
195 EpcEnbApplication::DoInitialContextSetupRequest (uint64_t mmeUeS1Id, uint16_t en
bUeS1Id, std::list<EpcS1apSapEnb::ErabToBeSetupItem> erabToBeSetupList) | 195 EpcEnbApplication::DoInitialContextSetupRequest (uint64_t mmeUeS1Id, uint16_t en
bUeS1Id, std::list<EpcS1apSapEnb::ErabToBeSetupItem> erabToBeSetupList) |
196 { | 196 { |
197 NS_LOG_FUNCTION (this); | 197 NS_LOG_FUNCTION (this); |
| 198 NS_UNUSED(enbUeS1Id); |
198 ·· | 199 ·· |
199 for (std::list<EpcS1apSapEnb::ErabToBeSetupItem>::iterator erabIt = erabToBeSe
tupList.begin (); | 200 for (std::list<EpcS1apSapEnb::ErabToBeSetupItem>::iterator erabIt = erabToBeSe
tupList.begin (); |
200 erabIt != erabToBeSetupList.end (); | 201 erabIt != erabToBeSetupList.end (); |
201 ++erabIt) | 202 ++erabIt) |
202 { | 203 { |
203 // request the RRC to setup a radio bearer | 204 // request the RRC to setup a radio bearer |
204 | 205 |
205 uint64_t imsi = mmeUeS1Id; | 206 uint64_t imsi = mmeUeS1Id; |
206 std::map<uint64_t, uint16_t>::iterator imsiIt = m_imsiRntiMap.find (imsi); | 207 std::map<uint64_t, uint16_t>::iterator imsiIt = m_imsiRntiMap.find (imsi); |
207 NS_ASSERT_MSG (imsiIt != m_imsiRntiMap.end (), "unknown IMSI"); | 208 NS_ASSERT_MSG (imsiIt != m_imsiRntiMap.end (), "unknown IMSI"); |
(...skipping 11 matching lines...) Expand all Loading... |
219 m_rbidTeidMap[rnti][erabIt->erabId] = params.gtpTeid; | 220 m_rbidTeidMap[rnti][erabIt->erabId] = params.gtpTeid; |
220 m_teidRbidMap[params.gtpTeid] = rbid; | 221 m_teidRbidMap[params.gtpTeid] = rbid; |
221 | 222 |
222 } | 223 } |
223 } | 224 } |
224 | 225 |
225 void· | 226 void· |
226 EpcEnbApplication::DoPathSwitchRequestAcknowledge (uint64_t enbUeS1Id, uint64_t
mmeUeS1Id, uint16_t gci, std::list<EpcS1apSapEnb::ErabSwitchedInUplinkItem> erab
ToBeSwitchedInUplinkList) | 227 EpcEnbApplication::DoPathSwitchRequestAcknowledge (uint64_t enbUeS1Id, uint64_t
mmeUeS1Id, uint16_t gci, std::list<EpcS1apSapEnb::ErabSwitchedInUplinkItem> erab
ToBeSwitchedInUplinkList) |
227 { | 228 { |
228 NS_LOG_FUNCTION (this); | 229 NS_LOG_FUNCTION (this); |
| 230 NS_UNUSED(enbUeS1Id); |
| 231 NS_UNUSED(gci); |
229 | 232 |
230 uint64_t imsi = mmeUeS1Id; | 233 uint64_t imsi = mmeUeS1Id; |
231 std::map<uint64_t, uint16_t>::iterator imsiIt = m_imsiRntiMap.find (imsi); | 234 std::map<uint64_t, uint16_t>::iterator imsiIt = m_imsiRntiMap.find (imsi); |
232 NS_ASSERT_MSG (imsiIt != m_imsiRntiMap.end (), "unknown IMSI"); | 235 NS_ASSERT_MSG (imsiIt != m_imsiRntiMap.end (), "unknown IMSI"); |
233 uint16_t rnti = imsiIt->second; | 236 uint16_t rnti = imsiIt->second; |
234 EpcEnbS1SapUser::PathSwitchRequestAcknowledgeParameters params; | 237 EpcEnbS1SapUser::PathSwitchRequestAcknowledgeParameters params; |
235 params.rnti = rnti; | 238 params.rnti = rnti; |
236 m_s1SapUser->PathSwitchRequestAcknowledge (params); | 239 m_s1SapUser->PathSwitchRequestAcknowledge (params); |
237 } | 240 } |
238 | 241 |
239 void· | 242 void· |
240 EpcEnbApplication::RecvFromLteSocket (Ptr<Socket> socket) | 243 EpcEnbApplication::RecvFromLteSocket (Ptr<Socket> socket) |
241 { | 244 { |
242 NS_LOG_FUNCTION (this);·· | 245 NS_LOG_FUNCTION (this);·· |
243 NS_ASSERT (socket == m_lteSocket); | 246 NS_ASSERT (socket == m_lteSocket); |
244 Ptr<Packet> packet = socket->Recv (); | 247 Ptr<Packet> packet = socket->Recv (); |
245 | 248 |
246 EpsBearerTag tag; | 249 EpsBearerTag tag; |
247 bool found = packet->RemovePacketTag (tag); | 250 bool found = packet->RemovePacketTag (tag); |
248 NS_ASSERT (found); | 251 NS_ASSERT (found); |
| 252 (void)found; // make compiler happy |
249 uint16_t rnti = tag.GetRnti (); | 253 uint16_t rnti = tag.GetRnti (); |
250 uint8_t bid = tag.GetBid (); | 254 uint8_t bid = tag.GetBid (); |
251 NS_LOG_LOGIC ("received packet with RNTI=" << (uint32_t) rnti << ", BID=" << (
uint32_t) bid); | 255 NS_LOG_LOGIC ("received packet with RNTI=" << (uint32_t) rnti << ", BID=" << (
uint32_t) bid); |
252 std::map<uint16_t, std::map<uint8_t, uint32_t> >::iterator rntiIt = m_rbidTeid
Map.find (rnti); | 256 std::map<uint16_t, std::map<uint8_t, uint32_t> >::iterator rntiIt = m_rbidTeid
Map.find (rnti); |
253 if (rntiIt == m_rbidTeidMap.end ()) | 257 if (rntiIt == m_rbidTeidMap.end ()) |
254 { | 258 { |
255 NS_LOG_WARN ("UE context not found, discarding packet"); | 259 NS_LOG_WARN ("UE context not found, discarding packet"); |
256 } | 260 } |
257 else | 261 else |
258 { | 262 { |
(...skipping 20 matching lines...) Expand all Loading... |
279 } | 283 } |
280 | 284 |
281 void· | 285 void· |
282 EpcEnbApplication::SendToLteSocket (Ptr<Packet> packet, uint16_t rnti, uint8_t b
id) | 286 EpcEnbApplication::SendToLteSocket (Ptr<Packet> packet, uint16_t rnti, uint8_t b
id) |
283 { | 287 { |
284 NS_LOG_FUNCTION (this << packet << rnti << (uint16_t) bid << packet->GetSize (
));·· | 288 NS_LOG_FUNCTION (this << packet << rnti << (uint16_t) bid << packet->GetSize (
));·· |
285 EpsBearerTag tag (rnti, bid); | 289 EpsBearerTag tag (rnti, bid); |
286 packet->AddPacketTag (tag); | 290 packet->AddPacketTag (tag); |
287 int sentBytes = m_lteSocket->Send (packet); | 291 int sentBytes = m_lteSocket->Send (packet); |
288 NS_ASSERT (sentBytes > 0); | 292 NS_ASSERT (sentBytes > 0); |
| 293 (void)sentBytes; // make compiler happy |
289 } | 294 } |
290 | 295 |
291 | 296 |
292 void· | 297 void· |
293 EpcEnbApplication::SendToS1uSocket (Ptr<Packet> packet, uint32_t teid) | 298 EpcEnbApplication::SendToS1uSocket (Ptr<Packet> packet, uint32_t teid) |
294 { | 299 { |
295 NS_LOG_FUNCTION (this << packet << teid << packet->GetSize ());·· | 300 NS_LOG_FUNCTION (this << packet << teid << packet->GetSize ());·· |
296 GtpuHeader gtpu; | 301 GtpuHeader gtpu; |
297 gtpu.SetTeid (teid); | 302 gtpu.SetTeid (teid); |
298 // From 3GPP TS 29.281 v10.0.0 Section 5.1 | 303 // From 3GPP TS 29.281 v10.0.0 Section 5.1 |
299 // Length of the payload + the non obligatory GTP-U header | 304 // Length of the payload + the non obligatory GTP-U header |
300 gtpu.SetLength (packet->GetSize () + gtpu.GetSerializedSize () - 8);·· | 305 gtpu.SetLength (static_cast<uint16_t>(packet->GetSize () + gtpu.GetSerializedS
ize () - 8));·· |
301 packet->AddHeader (gtpu); | 306 packet->AddHeader (gtpu); |
302 uint32_t flags = 0; | 307 uint32_t flags = 0; |
303 m_s1uSocket->SendTo (packet, flags, InetSocketAddress (m_sgwS1uAddress, m_gtpu
UdpPort)); | 308 m_s1uSocket->SendTo (packet, flags, InetSocketAddress (m_sgwS1uAddress, m_gtpu
UdpPort)); |
304 } | 309 } |
305 | 310 |
306 void | 311 void |
307 EpcEnbApplication::DoReleaseIndication (uint64_t imsi, uint16_t rnti, uint8_t be
arerId) | 312 EpcEnbApplication::DoReleaseIndication (uint64_t imsi, uint16_t rnti, uint8_t be
arerId) |
308 { | 313 { |
309 NS_LOG_FUNCTION (this << bearerId ); | 314 NS_LOG_FUNCTION (this << bearerId ); |
310 std::list<EpcS1apSapMme::ErabToBeReleasedIndication> erabToBeReleaseIndication
; | 315 std::list<EpcS1apSapMme::ErabToBeReleasedIndication> erabToBeReleaseIndication
; |
311 EpcS1apSapMme::ErabToBeReleasedIndication erab; | 316 EpcS1apSapMme::ErabToBeReleasedIndication erab; |
312 erab.erabId = bearerId; | 317 erab.erabId = bearerId; |
313 erabToBeReleaseIndication.push_back (erab); | 318 erabToBeReleaseIndication.push_back (erab); |
314 //From 3GPP TS 23401-950 Section 5.4.4.2, enB sends EPS bearer Identity in Bea
rer Release Indication message to MME | 319 //From 3GPP TS 23401-950 Section 5.4.4.2, enB sends EPS bearer Identity in Bea
rer Release Indication message to MME |
315 m_s1apSapMme->ErabReleaseIndication (imsi, rnti, erabToBeReleaseIndication); | 320 m_s1apSapMme->ErabReleaseIndication (imsi, rnti, erabToBeReleaseIndication); |
316 } | 321 } |
317 } // namespace ns3 | 322 } // namespace ns3 |
OLD | NEW |