730 likes | 752 Views
ns-2 기초 및 무선 / 이동 네트워크 시뮬레이션 단기강좌. Proxy Mobile IPv6(PMIPv6) 을 위한 ns-2 코드 및 예제 . 한국기술교육대학교 한연희 교수 (yhhan@kut.ac.kr) 고려대학교 컴퓨터학과 최현영 (neongas@korea.ac.kr). 2010 년 2 월 2 일. Table of Contents. PMIPv6 Overview PMIPv6 Feature & Operation Next Research Items Code Overview
E N D
ns-2 기초 및 무선/이동 네트워크 시뮬레이션 단기강좌 Proxy Mobile IPv6(PMIPv6)을 위한 ns-2 코드 및 예제 한국기술교육대학교한연희 교수(yhhan@kut.ac.kr) 고려대학교 컴퓨터학과 최현영(neongas@korea.ac.kr) 2010년 2월 2일
Table of Contents • PMIPv6 Overview • PMIPv6 Feature & Operation • Next Research Items • Code Overview • Major Objects & Block Diagram • Code Details • Initialization • Binding Update Process • Data Process • Simulation Example
Recent Trend of IP Mobility • Network-based! • No change to host • Mobility handled by the network, often transparent to the host • 2006~2009 IETF’s much activities • Working Groups • NetLMM (Network-based Localized Mobility Management) • NetExt, Mext, Mipshop, Mif, Mip4 • 3GPP/PP2 and WiMAX operators are now showing their STRONG interests for network-based IP mobility solution
Why Network-based? • [CMIPv6’s Problems] • 1) Too heavy specification to be implemented at a small terminal • - RFC 3344 (MIPv4): 99 pages • - RFC 3775 (MIPv6): 165 pages • 2) Battery problem • 3) Waste of air resource • 4) No Stable MIPv4/v6 stack executed in Microsoft Windows (Mobile) OS • Host-based IP Mobility (CMIPv4/v6) has not been widely deployed due to several factors • Implementation issues • IPsec and IKEv1 • Deployment issues • Negligible deployment of IPv6 • no cohesive mobility architecture • Operational issues • Layer 3 signalling via radio link • Layer 8 issues (Financial/Human/Political/FUD/…) • Many operators elected to create their own protocols (e.g., GTP), or • They picked other IETF mobility protocols (Proxy MIP etc.) • Money!
Proxy Mobile IPv6 [IETF RFC 5213, August 2008] LMA: Localized Mobility AgentMAG: 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
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 with its protocol operation consistent with the base IPv6 specification. • 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 • draft-ietf-netlmm-pmip6-ipv4-support-17.txt (Sept. 2009)
PBU: Proxy Binding UpdatePBA: Proxy Binding Ack. PMIPv6 Operation Flow MN MAG AAA&Policy Store LMA CN MN Attachment AAA Query with MN-ID • RA*: MN의 Prefix를 Policy Store에서 수신한 경우의 Router Advertisement • RA**: MN의 Prefix를 LMA에서 수신한 경우의 Router Advertisement AAA Reply with Profile RA* PBU with MN-ID, Home Network Prefix option, Timestamp option PBA with MN-ID, Home Network Prefix option RA** 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)
DNS HA or LMA NMS IP Network Internet AAA/Policy Store E R E R ACR/MAG L2 Switch BS/RAS PSS ACR ACR TTA 단체표준, “와이브로에서의 프록시 모바일 IPv6 적용,”TTAK.KO-10.0284, Dec. 2008 PMIPv6 over WiBro/WiMAX "WiMAX Forum Network Architecture (Stage 3: Detailed Protocols and Procedures) Release 1 Version 1.2.3“, Jul 2008. PreviousMAG PreviousMAG
PMIPv6 over 3GPP LTE/EPC LMA LMA
WiBro IP Network Cellular IP network Dual Stack Support in PMIPv6 IPv4 Application(VoD, IP-Phone…) RAS DS-PMIPv6LMA • Dual-Stack Support in Proxy MIPv6 • draft-ietf-netlmm-pmip6-ipv4-support-17.txt (Sept. 2009) • PMIPv6 기반 IPv4 Transport 지원 + IPv4 Home Address Mobility 지원 • DS-MIPv6와 같은 설계 목표와 원칙 • DS-PMIPv6가 고려하는 시나리오 MN IPv4 DS-PMIPv6MAG IPv4 LTE BS IPv6 WLANIP Network DS-PMIPv6MAG IPv6 NAT Private IPv4 AAA WLAN AP DS-PMIPv6MAG IPv6 Application(VoD, IP-Phone…)
DS(Dual Stack)-PMIPv6 [Mobility Binding] HoAv4 and HoAv6 PBU (HoAv6, Proxy CoAv6, HoAv4) Proxy CoAv6 Dual Stack MNor IPv4 MN IPv4 traffic CNv4 HoAv4 • PMIPv6’s Dual-Stack Support IPv6 Tunnel (LMAAv6Proxy CoAv6) IPv6 traffic CNv6->HoAv6 Dual Stack MAG Only-IPv6 enabled (Proxy CoAv6) Dual Stack LMA Only-IPv6 enabled (LMMAv6) <MN in IPv6 domain> [Mobility Binding] HoAv4 and HoAv6 PBU (HoAv6, Proxy CoAv4, HoAv4) Dual Stack MNor IPv4 MN Proxy CoAv4 IPv4 traffic CNv4 HoAv4 IPv4 Tunnel (LMAAv4Proxy CoAv4) IPv6 traffic CNv6->HoAv6 Dual Stack MAG Only-IPv4 enabled (Proxy CoAv4) Dual Stack LMA Only-IPv4 enabled (LMAAv4) <MN in IPv4 domain>
DS-PMIPv6 Testbed CN v4/v6 VoD Server eth1) 192.168.2.1 3ffe:2::1/64 LMA V4/V6 network MN has Dual Stack and both addresses are always enabled eth0) 192.168.2.2 3ffe:2::2/64 LMA가 MN에게 할당할 Prefix Pool 3ffe:1:3:1::/64 ~ 3ffe:1:3:ffff::/64 eth0) 192.168.1.1 3ffe:1::1/64 NAT 192.168.1.3 Private V4 network V6 network MAG3 eth0) 10.0.0.1 V4 network eth0) 3ffe:1::2/64 MAG1 eth0) 192.168.1.2 MAG2 ra0) 10.0.1.1 3ffe:1:3::1/64 fe80::1 ra0) 192.168.101.1 3ffe:1:1::1/64 fe80::1 ra0) 192.168.102.1 3ffe:1:2::1/64 fe80::1 SSID: PMIP3 SSID: PMIP1 SSID: PMIP2 초기 실행: v4 VoD Client 초기 실행: v6 VoD Client
Test: MIPv6 vs. PMIPv6 • Test Results with Heavy Traffic (presented at MobiWorld 2008 conference) • Encoding Rate: 2Mbps UDP Throughput of MIPv6 UDP Throughput of PMIPv6
New Issues in PMIPv6 (1/3) • What Issues in IETF NetEXT WG ? • 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 IPTVflow PBU(HI=1) Mobile IPTVflow PBU(HI=1) 다른 인터페이스의 스위치를 올려서 단순하게 접속만 시도했군 !세션이동성은 없고… MAG MAG MAG MAG VoIPflow VoIPflow WiMax 3G WiMax 3G HTTPflow WiBro 3G WiBro 3G MN MN
New Issues in PMIPv6 (2/3) • What Issues in NetEXT2 BoF ? • 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 IPTVflow PBU(HI=2) Mobile IPTVflow PBU(HI=1) 새로운 인터페이스로 세션을 이동하고 있네?Vertical 핸드오버군 ! MAG MAG MAG MAG VoIPflow VoIPflow WiMax 3G WiMax 3G WiBro 3G WiBro 3G MN MN
New Issues in PMIPv6 (3/3) Host-based CMIPv6 Network-basedPMIPv6 이동성 관리 연구주제와 IETF 표준화 진행상황 [2009년 12월] Proxy Mobile IPv6 [RFC 5213, Aug. 2008] IPv4 Support for Proxy Mobile IPv6 [draft-ietf-netlmm-pmip6-ipv4-support-17] Fast Handovers for Proxy Mobile IPv6 [draft-ietf-mipshop-pfmipv6-11] Multiple Care-of Addresses Registration & Flow Bindings in Proxy Mobile IPv6 [draft-krishnan-netext-intertech-ps-02] [draft-hui-netext-multihoming-00] [draft-melia-netext-muho-solution-00] [draft-xia-netext-flow-binding-00] [draft-hui-netext-service-flow-identifier-01] [draft-koodli-netext-flow-handover-00] Mobility Support in IPv6 [RFC 3775, June 2004] 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-04] Traffic Selectors for Flow Binding [draft-ietf-mext-binary-ts-01] Horizontal Handover A handover is initiated when mobile device exits the boundaries of an administrative domain. Single interface is used. Vertical Handover A mobile device does need to move in order to initiate a handover. Multiple interfaces are required, but use one interface at a time. Complexity Level Multiple Interface Management Simultaneous use of multiple interfaces and access networks. Association of an application with an interface Multiple Flow Management Ability to split individual flows between links with respect to the requirements of the flows and the user preferences Next Research Items
Code Overview • NS-2 version: 2.29 (NIST-modified) • without IEEE 802.21 MIH function • Supported MAC: IEEE 802.11, IEEE 802.16
Code Overview (Major Objects) • Agents • LMAAgent, MAGAgent • Packet Headers • PMIPv6, IP6Encap • Classifiers • PMIPv6Src, PMIPv6Dest • Tunneling Objects • PMIPv6Encapsulator, PMIPv6Decapsulator
Code Overview (Block Diagram) LMA MAG LMAAgent Encap Decap MAGAgent Encap Decap PBU/PBA Classifier(Routing) Classifier(Routing) Link/MAC Link/MAC From CN To MN From MN To CN
PMIPv6Agent (Agent/PMIPv6) • Super class of LMAAgent and MAGAgent • Fields • Functions
LMAAgent (Agent/PMIPv6/LMA) • LMA 기능 수행 • Fields • Functions
MAGAgent (Agent/PMIPv6/MAG) • MAG 기능 수행 • Fields
MAGAgent (Agent/PMIPv6/MAG) • Functions
Packet Headers • PMIPv6 (PacketHeader/PMIPv6) • PBU/PBA packet 헤더 • Packet Type(PT_PBU, PT_PBA) 정의 • Fields
Packet Headers • IP6Encap (PacketHeader/IP6Encap) • IP-in-IP tunneling 헤더 • 단일 tunneling만 고려함 • Fields
Classifiers • PMIPv6Src (Addr/Classifier/PMIPv6Src) • Source address based classifier • Packet의 source IP 주소로 구분함 • PMIPv6Dest (Addr/Classifier/PMIPv6Dest) • Destination address based classifier • 기존의 classifier와 동일
Tunneling Objects • PMIPv6Encapsulator • Data packetencapsulation • Fields • PMIPv6Decapsulator (Addr/Classifier/PMIPv6Decapsulator) • Data packet decapsulation
Node Object • New Fields
Node Object • New Functions
Overview • Initialization (Initial Object Setup) • Binding Update Process • Data Process MAG LMA PBU MN attached Layer 2 Trigger “new-mn{}” MAC MAG Agent LMA Agent PBA LMA MAG To MN Encap Decap From CN Decap Encap To CN From MN
Initialization - LMA • Setting up LMAAgent, Dest Classifier, and Decapsulator by calling “install-lma{}” function
Initialization - LMA • install-lma{} function (in Node object) <tcl/lib/pmip6.tcl> #attach agent set lma [new Agent/PMIPv6/LMA] $self attach $lma [$lma set default_port_] set pmip6_agent_ $lma #insert dest classifier set old_classifier_ $classifier_ set dst_classifier_ [new Classifier/Addr/PMIPv6Dest] $dst_classifier_ set mask_ 0xffffffff $dst_classifier_ set shift_ 0 $dst_classifier_ defaulttarget $old_classifier_ set nodetype [[Simulator instance] get-nodetype] $self insert-entry [$self get-module $nodetype] $dst_classifier_ $dst_classifier_ install-by-dest 0 $old_classifier_
Initialization - LMA • install-lma{} function (cont’d) • Install Decapsulator <tcl/lib/pmip6.tcl> #install decapsulator set decap_ [new Classifier/Addr/PMIPv6Decapsulator] $decap_ set mask_ 0xffffffff $decap_ set shift_ 0 $decap_ defaulttarget $old_classifier_ #PMIPv6_TUNNEL_PORT=1 lappend $agents_ $decap_ $dmux_ install [Simulator set PMIPv6_TUNNEL_PORT] $decap_
Initialization - MAG • Setting up MAGAgent, Src Classifier, and Decapsulator by calling “install-mag{}” function
Initialization - MAG • install-mag{} function (in Node object) <tcl/lib/pmip6.tcl> #attach agent, default_port_ = 250 set mag [new Agent/PMIPv6/MAG] $self attach $mag [$mag set default_port_] set pmip6_agent_ $mag #insert src classifier set old_classifier_ $classifier_ set src_classifier_ [new Classifier/Addr/PMIPv6Src] $src_classifier_ set mask_ 0xffffffff $src_classifier_ set shift_ 0 $src_classifier_ defaulttarget $old_classifier_ set nodetype [[Simulator instance] get-nodetype] $self insert-entry [$self get-module $nodetype] $src_classifier_ $src_classifier_ install-by-src 0 $old_classifier_
Initialization - MAG • install-lma{} function (cont’d) <tcl/lib/pmip6.tcl> #install decapsulator set decap_ [new Classifier/Addr/PMIPv6Decapsulator] $decap_ set mask_ 0xffffffff $decap_ set shift_ 0 $decap_ defaulttarget $old_classifier_ lappend $agents_ $decap_ $dmux_ install [Simulator set PMIPv6_TUNNEL_PORT] $decap_ # LL points previous hier_classifier as up-target # we should change this to our classifier if {[info exists ll_(0)] && $ll_(0) != ""} { $ll_(0) up-target $src_classifier_ }
MN Attachment Event (IEEE 802.11) • “new-mn{}” function in MAGAgent is called when AssocRes Ack received <mac/mac-802_11.cc> void Mac802_11::recvACK(Packet *p) { if( HDR_MAC802_11(pktManagement_)->dh_fc.fc_subtype == MAC_Subtype_AssocRes) { if(use_pmip6_ext_) { if(pmip6_agent_) { Tcl& tcl = Tcl::instance(); tcl.evalf(“%s new-mn %d”, pmp6_agent_->name(), n->id()); } }
MN Attachment Event (IEEE 802.16) • “new-mn{}” function in MAGAgent is called when DSA_ACK received <wimax/mac802_16.cc> void Mac802_16::receive() { if(use_pmip6_ext_) { if(pmip6_agent_) { if(frame->type == MAC_DSA_ACK) { Tcl& tcl = Tcl::instance(); tcl.evalf(“%s new-mn %d”, pmp6_agent_->name(), peer->getPeerNode()); } } }
Binding Update Process – MAG(1) • Function flow PMIPv6Agent Mac802_11 Mac802_16 MAGAgent new-mn/TCL command() process_new_mn() -find_bule send_pbu() create_pbu() send()
Binding Update Process – MAG(1) • new-mn{} in MAGAgent::command() • MAGAgent::process_new_mn() <pmip6/pmip6.cc> if(strcmp(argv[1], "new-mn") == 0) { uint32_t id = atoi(argv[2]); process_new_mn(id); <pmip6/pmip6.cc> bule = find_bule(mn_id); if(!bule) { //create new binding update list bule = create_bule(mn_id); bule->lmaa() = lma_addr_; bule->proxy_coa() = addr(); bule->lifetime() = binding_lifetime_; bule->insert_entry(&bul_list_); }
Binding Update Process – MAG(1) • MAGAgent::send_pbu() <pmip6/pmip6.cc> if(!bule->pktPBU_) { //create reusuable PBU packet bule->pktPBU_ = create_pbu(bule->lmaa(), bule->mn_id(), bule->lifetime(), bule->proxy_coa()); } //send copy of PBU packet send(bule->pktPBU_->copy(), 0); //start PBU retransmit timer bule->BULTimer_.resched(1.0);
Binding Update Process - LMA • Function flow PMIPv6Agent LMAAgent recv() process_packet() process_pbu() -find_bce() setup_route() setup-route/TCL -get-pmip6-encap/TCL send_pback() create_pback() send()
Binding Update Process - LMA • PMIPv6Agent::recv() • LMAAgent::process_packet() <pmip6/pmip6.cc> if(ch->ptype() == PT_PBU) { process_pbu(p); }
Binding Update Process - LMA • LMAAgent::process_pbu() <pmip6/pmip6.cc> bce = find_bce(mn_id); if(!bce) { //de-registration if(h->lifetime()==0) { send_pback(p, 0); return; } //mn_id is not owned with this LMA if((mnaddr=find_mn_prefix(mn_id))==-1) { send_pback(p, 1); return; } //create new binding cache bce = create_bce(mn_id); bce->proxy_coa() = iph->saddr(); bce->mn_prefix() = mnaddr; bce->insert_entry(&bcache_list_); } //setup tunneling if(bce->lifetime()>0) setup_route(bce);
Binding Update Process - LMA • LMAAgent::setup_route() • setup-route{} in Agent/PMIPv6/LMA • LMAAgent::process_pbu() • LMAAgent::send_pback() <tcl/lib/pmip6.tcl> #get an encapsulator for tunneling endpoint set encap [$node_ get-pmip6-encap $te] $clsfr_dst install-by-dest $mnaddr $encap <pmip6/pmip6.cc> send_pback(bce, 0); bce->BCacheTimer_.resched((double)bce->lifetime());
Binding Update Process – MAG(2) • Function flow PMIPv6Agent MAGAgent recv() process_packet() process_pback() -find_bule() setup_route() bule_state: BUL_S_SETUP setup-route/TCL -get-pmip6-encap/TCL clear_route() bule_state: BUL_S_DELETE clear-route/TCL