Presentation is loading. Please wait.

Presentation is loading. Please wait.

NS-3를 이용한 Proxy Mobile IPv6 Simulation

Similar presentations


Presentation on theme: "NS-3를 이용한 Proxy Mobile IPv6 Simulation"— Presentation transcript:

1 NS-3를 이용한 Proxy Mobile IPv6 Simulation
한국기술교육대학교 컴퓨터공학부 한연희 교수 고려대학교 컴퓨터학과 최현영 NS-2를 이용한 최신 네트워크 시뮬레이션 단기강좌

2 NS-3 & PMIPv6 Introduction

3 NS3 Introduction What is NS3?
ns-3 is a discrete-event network simulator for Internet systems intended to eventually replace the ns-2 simulator not backwards-compatible with ns-2 a free, open source software project organized around research community development and maintenance Main Groups Univ. of Washington, Georgia Tech., Bucknell University Financial Support U.S. National Science Foundation & INRIA

4 NS3 Introduction Architecture ns-3 is not an extension of ns-2 ns-2
simulator core: c++ and Otcl script: Otcl ns-3 simulator core: c++ script: c++ bindings with Python, but can run ns-3 without any knowledge of Python ns-3 is not an extension of ns-2

5 NS3 Introduction Current Release
ns-3.9 (August 20, 2010) Monthly download count of ns-3 releases

6 NS3 Introduction Progress Report (1/2)

7 NS3 Introduction Progress Report (2/2) ns3-3.9 (August 20, 2010)
Spectrum Modeling OFDM Underwater Acoustic Network WiFi patches for bugs, etc. See the page: ns (Current On-going Activity) Initial support for the g PHY Consolidate Wi-Fi MAC high functionality Energy model WiFi additions LTE support, etc. See the page:

8 NS3 Introduction Features Alignment with real systems
sockets, device driver interfaces) conforms to standard input/output formats so that other tools can be reused. e.g., pcap trace output ns-3 is adding support for running implementation code e.g., Linux TCP code P2P link, shared link with CSMA. Routing, ARP A node can be equipped with multiple network interfaces. Support (nearly) complete IPv6 Can run real implementation of applications. Wireless WiFi WiMAX UMTS (PPP)

9 NS3 Introduction Still use ns-2 or move to ns-3? Well-documented
ns-3 does not have all of the models that ns-2 currently has. ns-3 does have new capabilities such as handling multiple interfaces, use of IP addressing, more detailed models. Well-documented extensively documented API (doxygen):

10 NS3 Introduction Network Emulation real machine Testbed
virtual machine ns-3 real Testbed 1) ns-3 interconnects virtual machines 2) testbeds interconnect ns-3 stacks real machine Added in ns-3.5 Added in ns-3.3

11 NS3 Introduction LOG: PCAP Trace File 1

12 NS3 Introduction LOG: PCAP Trace File 2

13 Proxy Mobile IPv6 [IETF RFC 5213, August 2008]
LMA: Localized Mobility Agent MAG: Mobile Access Gateway IP Tunnel IP-in-IP tunnel between LMA and MAG LMA Home Network MN’s Home Network (Topological Anchor Point) MAG LMA Address (LMAA) That will be the tunnel entry-point LMM (Localized Mobility Management) Domain MAG movement Proxy Binding Update/Ack. (PBU/PBA) Control messages exchanged by MAG to LMA to establish a binding between MN-HoA and Proxy-CoA MN’s Home Network Prefix (MN-HNP) CAFE:2:/64 MN’ Home Address (MN-HoA) MN continues to use it as long as it roams within a same domain Proxy Care of Address (Proxy-CoA) The address of MAG That will be the tunnel end-point

14 PMIPv6 Features No Change to Host Stack
IP Mobility handled by the network, and transparent to the host Any MN is just a IPv6 host Home in Any Place MAG sends the RA (Router Advertisement) messages advertising MN’s home network prefix and other parameters MAG will emulate the home link on its access link. RA Unicast RA should be UNICASTed to an MN It will contain MN’s Home Network Prefix Per-MN Prefix M:1 Tunnel LMA-MAG tunnel is a shared tunnel among many MNs. One tunnel is associated to multiple MNs’ Binding Caches. IPv4 Support RFC 5844 (May 2010)

15 Router Advertisement (Home Network Prefix)
PMIPv6 Operation Flow PBU: Proxy Binding Update PBA: Proxy Binding Ack. RA*: MN의 Prefix를 Policy Store에서 수신한 경우의 Router Advertisement RA**: MN의 Prefix를 LMA에서 수신한 경우의 Router Advertisement MN MAG AAA&Policy Store LMA CN MN Attachment AAA Query with MN-ID AAA Reply with Profile PBU with MN-ID, Home Network Prefix option (all zero), Timestamp option PBA with MN-ID, Home Network Prefix option Router Advertisement (Home Network Prefix) Tunnel Setup Optional DHCP Server DHCP Request DHCP Request DHCP Response DHCP Response [MN-HoA:CN](data) [Proxy-CoA:LMAA][MN-HoA:CN](data) [MN-HoA:CN](data)

16 다른 인터페이스의 스위치 를 올려서 단순하게 접속만 시도 플로우 이동은 없음
Flow Mobility in PMIPv6 Scenario 1: Setting up Mobility Sessions on Demand Create additional mobility sessions on demand e.g., additional connection for a particular service A new mobility session with a new prefix is created LMA LMA Mobile IPTV flow Mobile IPTV flow PBU PBU 다른 인터페이스의 스위치 를 올려서 단순하게 접속만 시도 플로우 이동은 없음 MAG MAG MAG MAG VoIP flow VoIP flow WiMax 3G WiMax 3G HTTP flow WiBro 3G WiBro 3G 단말 단말

17 Flow Mobility in PMIPv6 Scenario 2: Flow Mobility
If another access is enabled on the MN, some of the existing flows could be moved over, to achieve, e.g., load balancing and better user experience LMA LMA Mobile IPTV flow Mobile IPTV flow PBU 새로운 인터페이스로 한 개의 세션을 이동 PBU MAG MAG MAG MAG VoIP flow VoIP flow WiMax 3G WiMax 3G WiBro 3G WiBro 3G 단말 단말

18 IETF Core Standards for Mobility Management
[관련 WG: MEXT, MIPSHOP, NETEXT 년 10월 현재] Horizontal Handover Vertical Handover Multiple Interface Management Multiple Flow Management A handover is initiated when mobile device exits the boundaries of an administrative domain. Single interface is used. A mobile device does need to move in order to initiate a handover. Multiple interfaces are required, but use one interface at a time. Simultaneous use of multiple interfaces and access networks. Association of an application with an interface Ability to split individual flows between links with respect to the requirements of the flows and the user preferences Complexity Level Host-based IP Mobility Network-based IP Mobility Mobility Support in IPv6 [RFC 3775, June 2004] Hierarchical Mobile IPv6 [RFC 4140, Aug. 2005] Mobile IPv6 Support for Dual Stack Hosts and Routers [RFC 5555, June 2009] Fast Handovers for Mobile IPv6 [RFC 4068, July 2005] Multiple Care-of Addresses Registration [RFC 5648, Oct. 2009] Flow Bindings in Mobile IPv6 and NEMO Basic Support [draft-ietf-mext-flow-binding-11] Traffic Selectors for Flow Binding [draft-ietf-mext-binary-ts-05] Proxy Mobile IPv6 [RFC 5213, Aug. 2008] IPv4 Support for Proxy Mobile IPv6 [RFC 5844, May 2010] Fast Handovers for Proxy Mobile IPv6 [RFC 5949, Sept. 2010] Multiple Care-of Addresses Registration & Flow Bindings in Proxy Mobile IPv6 [draft-trung-netext-flow-mobility-support-01 & draft-bernardos-netext-pmipv6-flowmob-01]

19 NS3 Tutorial Scenario & Codes

20 Tutorial Scenario Simulation Topology Simulation Scenario
Ping(UDP) from n4 to n0

21 Tutorial Scenario Simulation Script Create nodes Attach devices
int nCsma=3; NodeContainer p2pNodes; p2pNodes.Create (2); NodeContainer csmaNodes; csmaNodes.Add (p2pNodes.Get (1)); csmaNodes.Create (nCsma); PointToPointHelper pointToPoint; pointToPoint.SetDeviceAttribute ("DataRate", StringValue ("5Mbps")); pointToPoint.SetChannelAttribute ("Delay", StringValue ("2ms")); NetDeviceContainer p2pDevices; p2pDevices = pointToPoint.Install (p2pNodes); CsmaHelper csma; csma.SetChannelAttribute ("DataRate", StringValue ("100Mbps")); csma.SetChannelAttribute ("Delay", TimeValue (NanoSeconds (6560))); NetDeviceContainer csmaDevices; csmaDevices = csma.Install (csmaNodes);

22 Tutorial Scenario Install IPv4/IPv6 network stack Assign IP address
InternetStackHelper stack; stack.Install (p2pNodes.Get (0)); stack.Install (csmaNodes); Ipv4AddressHelper address; address.SetBase (" ", " "); Ipv4InterfaceContainer p2pInterfaces; p2pInterfaces = address.Assign (p2pDevices); address.SetBase (" ", " "); Ipv4InterfaceContainer csmaInterfaces; csmaInterfaces = address.Assign (csmaDevices);

23 Tutorial Scenario Install UDP Echo server/client application
Setup trace Start simulation UdpEchoServerHelper echoServer (9); ApplicationContainer serverApps = echoServer.Install (csmaNodes.Get (nCsma)); serverApps.Start (Seconds (1.0)); serverApps.Stop (Seconds (10.0)); UdpEchoClientHelper echoClient (csmaInterfaces.GetAddress (nCsma), 9); echoClient.SetAttribute ("MaxPackets", UintegerValue (1)); echoClient.SetAttribute ("Interval", TimeValue (Seconds (1.))); echoClient.SetAttribute ("PacketSize", UintegerValue (1024)); ApplicationContainer clientApps = echoClient.Install (p2pNodes.Get (0)); clientApps.Start (Seconds (2.0)); clientApps.Stop (Seconds (10.0)); pointToPoint.EnablePcapAll ("second"); csma.EnablePcap ("second", csmaDevices.Get (1), true); Simulator::Run (); Simulator::Destroy ();

24 Tutorial Scenario PCAP trace

25 PMIPv6 Implementation in NS-3

26 PMIPv6 Implementation Overview Based-on NS-3 3.8
Implements some part of Mobile IPv6 Mobility header, BU/BA handler Designed for easy porting to newer version of NS-3 Link-layer support: Wifi only MIPv6 functionality PMIPv6 IPv6

27 Class Diagram for PMIPv6

28 Major Classes Tunneling Routing Mobility header process PMIPv6 agent
TunnelNetDevice – IPv6-in-IPv6 creator (Encapsulator) Ipv6TunnelL4Protocol – IPv6-in-IPv6 handler (Decapsulator) Routing Ipv6StaticSourceRouting – Source address based routing Mobility header process Ipv6MobilityL4Protocol – Mobility header handler Ipv6MobilityDemux Ipv6MobilityBindingUpdate – BU handler Ipv6MobilityBindingAck – BA handler PMIPv6 agent Pmipv6Mag/ Pmipv6Lma – PBU/PBA processing BindingUpdateList/BindingCache – Store binding information Helper MagHelper/ LmaHelper – Create and aggregate objects Application UnicastRadvd – Mac Unicast of RA in Wifi network

29 Header Classes

30 Header Classes Important functions in Header class Serialize()
Compose packet data from member variables Deserialize() Fill the variables in the class from the packet data GetSerializedSize() Get total bytes of packetized data Print() Print each field of header (used for ASCII-based trace)

31 Header Classes Header implementation example
class Ipv6MobilityHeader : public Header { private: uint8_t m_payload_proto; uint8_t m_header_len; uint8_t m_mh_type; uint8_t m_reserved; uint16_t m_checksum; }; void Ipv6MobilityHeader::Print (std::ostream& os) const { os << "( payload_proto = " << (uint32_t)GetPayloadProto() << " header_len = " << (uint32_t)GetHeaderLen() << " mh_type = " << (uint32_t)GetMhType() << " checksum = " << (uint32_t)GetChecksum() <<")"; } uint32_t Ipv6MobilityHeader::GetSerializedSize () const { return 6; } uint32_t Ipv6MobilityHeader::Deserialize (Buffer::Iterator start) { Buffer::Iterator i = start; m_payload_proto = i.ReadU8(); m_header_len = i.ReadU8(); m_mh_type = i.ReadU8(); m_reserved = i.ReadU8(); m_checksum = i.ReadNtohU16(); return GetSerializedSize (); } void Ipv6MobilityHeader::Serialize (Buffer::Iterator start) const { Buffer::Iterator i = start; i.WriteU8 (m_payload_proto); i.WriteU8 (m_header_len); i.WriteU8 (m_mh_type); i.WriteU8 (m_reserved); i.WriteU16 (0); }

32 BUL&BCache

33 Binding Update Process

34 Binding Update Process
(1) – MN attachment event trigger Create binding update list (2) – Sending PBU (3)~(5) – IPv6 packet transmission among nodes Packet(PBU) will be arrived at the LMA (6) – Received by mobility header handler (7)~(9) – Demultiplexing mobility header based on Mhtype field in the packet (10) – Received by PBU handler Create or update binding cache Setup tunneling and routing

35 Binding Update Process
(11) – Sending PBA (12)~(14) – IPv6 packet transmission among nodes Packet(PBA) will be arrived at the MAG (15) – Received by mobility header handler (16) –(18) – Demultiplexing (19) – Received by PBA handler Update binding update list setup tunneling and routing

36 Data Process

37 Data Process (1)~(2) – IPv6 packet arrival
Data packet from source node, either CN or MN (3)~(4) – Incoming packet process in IPv6 Query to routing module (3)’~(4)’ – Subsequent routing query (default) (3)”~(4)” – Source based routing query only in MAG Source based routing is higher priority than static routing (5) – Forwarding the packet to the MAG via tunnel device IPv6-in-IPv6 Encapsulation performed

38 Data Process (6) – Sending encapsulated packet
(7)~(9) – IPv6 packet transmission among nodes (10)~(11) – Incoming packet process in IPv6 Query to routing module (12) – Received by IPv6-in-IPv6 packet handler Decapsulation performed (13) – Sending decapsulated packet (14) – Sending Data Packet to the destination node, either CN or MN

39 Helpers MagHelper Function Install(node)
Create PMIPv6 related objects and aggregate into Node Register callback for MN attachment trigger to WifiMac in node Install(node, addr, Ptr<Node> ap_node) Register callback for MN attachment trigger to WifiMac in ap_node SetProfileHelper(Pmip6ProfileHelper) Set profile helper

40 Helpers LmaHelper Pmip6ProfileHelper Function
Install(node) Create PMIPv6 related objects and aggregate into Node SetProfileHelper(Pmip6ProfileHelper) Set profile helper SetPrefixPoolBase(prefix, prefix_len) Set Prefix Pool information Pmip6ProfileHelper Manage each MN’s profile information AddProfile(MN_ID, LL_ID, LMAA, Prefixes) Add profile for an MN

41 PMIPv6 Simulation Scenario

42 PMIPv6 Simulation Scenario
Setup mobility MobilityHelper mobility; Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> (); positionAlloc->Add (Vector (-100.0, 0.0, 0.0)); //MAG1AP positionAlloc->Add (Vector (100.0, 0.0, 0.0)); //MAG2AP mobility.SetPositionAllocator (positionAlloc); mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel"); mobility.Install (aps); Ptr<ListPositionAllocator> staPositionAlloc = CreateObject<ListPositionAllocator> (); staPositionAlloc->Add (Vector (-100.0, 100.0, 0.0)); //STA mobility.SetPositionAllocator (staPositionAlloc); mobility.SetMobilityModel ("ns3::ConstantVelocityMobilityModel"); mobility.Install(sta); Ptr<ConstantVelocityMobilityModel> cvm = sta.Get(0)->GetObject<ConstantVelocityMobilityModel>(); cvm->SetVelocity(Vector (20.0, 0, 0)); //move to left to right 20.0m/s

43 PMIPv6 Simulation Scenario
Setup Wifi Ssid ssid = Ssid("MAG"); YansWifiPhyHelper wifiPhy = YansWifiPhyHelper::Default (); wifiPhy.SetPcapDataLinkType (YansWifiPhyHelper::DLT_IEEE802_11_RADIO); WifiHelper wifi = WifiHelper::Default (); NqosWifiMacHelper wifiMac = NqosWifiMacHelper::Default (); YansWifiChannelHelper wifiChannel = YansWifiChannelHelper::Default (); wifiPhy.SetChannel (wifiChannel.Create ()); wifiMac.SetType ("ns3::NqapWifiMac", "Ssid", SsidValue (ssid), "BeaconGeneration", BooleanValue (true), "BeaconInterval", TimeValue (MilliSeconds(100))); mag1ApDev = wifi.Install (wifiPhy, wifiMac, mag1Net.Get(1)); //WLAN interface wifiMac.SetType ("ns3::NqstaWifiMac", "Ssid", SsidValue (ssid), "ActiveProbing", BooleanValue (false)); staDevs.Add( wifi.Install (wifiPhy, wifiMac, sta));

44 PMIPv6 Simulation Scenario
Setup PMIPv6 //attach PMIPv6 agents Pmip6ProfileHelper *profile = new Pmip6ProfileHelper(); //adding profile for each station Identifier(Mac48Address::ConvertFrom(staDevs.Get(0)->GetAddress())), backboneIfs.GetAddress(0, 1), std::list<Ipv6Address>()); Pmip6LmaHelper lmahelper; lmahelper.SetPrefixPoolBase(Ipv6Address("3ffe:1:4::"), 48); lmahelper.SetProfileHelper(profile); lmahelper.Install(lma.Get(0)); Pmip6MagHelper maghelper; maghelper.SetProfileHelper(profile); maghelper.Install (mags.Get(0), mag1Ifs.GetAddress(0, 0), aps.Get(0)); maghelper.Install (mags.Get(1), mag2Ifs.GetAddress(0, 0), aps.Get(1));

45 PMIPv6 Simulation Scenario
Setup traffic Udp6ServerHelper udpServer(6000); ApplicationContainer apps = udpServer.Install (sta.Get (0)); apps.Start (Seconds (1.0)); apps.Stop (Seconds (10.0)); uint32_t packetSize = 1024; uint32_t maxPacketCount = 0xffffffff; Time interPacketInterval = MilliSeconds(10); Udp6ClientHelper udpClient(Ipv6Address("3ffe:1:4:1:200:ff:fe00:c"), 6000); udpClient.SetAttribute ("Interval", TimeValue (interPacketInterval)); udpClient.SetAttribute ("PacketSize", UintegerValue (packetSize)); udpClient.SetAttribute ("MaxPackets", UintegerValue (maxPacketCount)); apps = udpClient.Install (cn.Get (0)); apps.Start (Seconds (1.5));

46 PMIPv6 Simulation Scenario
PBU Trace in the LMA

47 PMIPv6 Simulation Scenario
Trace for Handover in the MN

48 PMIPv6 Simulation Scenario
Tunneling Trace in the LMA

49 PMIPv6 Simulation Scenario
Tunneling Trace in the LMA

50 PMIPv6 Simulation Scenario

51 Thank you - Q&A -


Download ppt "NS-3를 이용한 Proxy Mobile IPv6 Simulation"

Similar presentations


Ads by Google