Presentation is loading. Please wait.

Presentation is loading. Please wait.

Proxy Mobile IPv6(PMIPv6) 을 위한 ns-2 코드 및 예제 한국기술교육대학교 한연희 교수 고려대학교 컴퓨터학과 최현영 2010 년 2 월 2 일 ns-2 기초 및 무선 / 이동 네트워크.

Similar presentations


Presentation on theme: "Proxy Mobile IPv6(PMIPv6) 을 위한 ns-2 코드 및 예제 한국기술교육대학교 한연희 교수 고려대학교 컴퓨터학과 최현영 2010 년 2 월 2 일 ns-2 기초 및 무선 / 이동 네트워크."— Presentation transcript:

1 Proxy Mobile IPv6(PMIPv6) 을 위한 ns-2 코드 및 예제 한국기술교육대학교 한연희 교수 (yhhan@kut.ac.kr) 고려대학교 컴퓨터학과 최현영 (neongas@korea.ac.kr) 2010 년 2 월 2 일 ns-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 2

3 3

4 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 4

5 Why Network-based? 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! [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 [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 5

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

7 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) PMIPv6 Features 7

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

9 PMIPv6 over WiBro/ WiMAX Previous MAG TTA 단체표준, “ 와이브로에서의 프록시 모바일 IPv6 적용,” TTAK.KO-10.0284, Dec. 2008 "WiMAX Forum Network Architecture (Stage 3: Detailed Protocols and Procedures) Release 1 Version 1.2.3“, Jul 2008. IP Network Internet E R ACR/MAG L2 Switch BS/RAS PSS HA or LMA AAA/Policy Store ACRACR ACRACR DNS NMS 9

10 LMA PMIPv6 over 3GPP LTE/EPC 10

11 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 가 고려하는 시나리오 Dual Stack Support in PMIPv6 Cellular IP network WLAN IP Network WiBro IP Network RAS LTE BS WLAN AP IPv4 IPv6 Private IPv4 NAT AAA DS-PMIPv6 LMA IPv4 IPv6 IPv4 Application (VoD, IP-Phone…) IPv6 Application (VoD, IP-Phone…) MN DS-PMIPv6 MAG 11

12 DS(Dual Stack)-PMIPv6 PMIPv6’s Dual-Stack Support Dual Stack LMA Only-IPv6 enabled (LMMAv6) Dual Stack MN or IPv4 MN PBU (HoAv6, Proxy CoAv6, HoAv4) HoAv4 and HoAv6 Proxy CoAv6 [Mobility Binding] IPv6 Tunnel (LMAAv6  Proxy CoAv6) IPv4 traffic CNv4  HoAv4 IPv6 traffic CNv6->HoAv6 Dual Stack MAG Only-IPv6 enabled (Proxy CoAv6) Dual Stack LMA Only-IPv4 enabled (LMAAv4) Dual Stack MN or IPv4 MN PBU (HoAv6, Proxy CoAv4, HoAv4) HoAv4 and HoAv6 Proxy CoAv4 [Mobility Binding] IPv4 Tunnel (LMAAv4  Proxy CoAv4) IPv4 traffic CNv4  HoAv4 IPv6 traffic CNv6->HoAv6 Dual Stack MAG Only-IPv4 enabled (Proxy CoAv4) 12

13 DS-PMIPv6 Testbed MN has Dual Stack and both addresses are always enabled SSID: PMIP1 SSID: PMIP2 SSID: PMIP3 MAG1 ra0) 192.168.101.1 3ffe:1:1::1/64 fe80::1 eth0) 3ffe:1::2/64 MAG2 ra0) 192.168.102.1 3ffe:1:2::1/64 fe80::1 eth0) 192.168.1.2 ra0) 10.0.1.1 3ffe:1:3::1/64 fe80::1 eth0) 10.0.0.1 V6 network V4 network 초기 실행 : v6 VoD Client 초기 실행 : v4 VoD Client LMA CN NAT 192.168.1.3 eth0) 192.168.1.1 3ffe:1::1/64 eth1) 192.168.2.1 3ffe:2::1/64 eth0) 192.168.2.2 3ffe:2::2/64 V4/V6 network Private V4 network MAG3 LMA 가 MN 에게 할당할 Prefix Pool 3ffe:1:3:1::/64 ~ 3ffe:1:3:ffff::/64 v4/v6 VoD Server 13

14 Test Results with Heavy Traffic (presented at MobiWorld 2008 conference)  Encoding Rate: 2Mbps UDP Throughput of MIPv6UDP Throughput of PMIPv6 Test: MIPv6 vs. PMIPv6 14

15 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 WiMax MAG LMA PBU (HI=1) MAG 3G MN 3GWiBro MAG LMA PBU (HI=1) MAG MN 3GWiBro WiMax3G 다른 인터페이스의 스위치 를 올려서 단순하게 접속만 시도했군 ! 세션이동성은 없고 … Mobile IPTV flow VoIP flow Mobile IPTV flow VoIP flow HTTP flow 15

16 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 MAG LMA PBU (HI=2) MAG LMA PBU (HI=1) MAG MN 3G 새로운 인터페이스로 세션을 이동하고 있네 ? Vertical 핸드오버군 ! MN 3GWiBro VoIP flow Mobile IPTV flow WiMax3GWiMax3G WiBro Mobile IPTV flow VoIP flow New Issues in PMIPv6 (2/3) 16

17 New Issues in PMIPv6 (3/3) 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 CMIPv6 Network-based PMIPv6 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] 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] Next Research Items 이동성 관리 연구주제와 IETF 표준화 진행 상황 [2009 년 12 월 ] 17

18 18

19 Code Overview NS-2 version: 2.29 (NIST-modified) ▫without IEEE 802.21 MIH function Supported MAC: IEEE 802.11, IEEE 802.16 19

20 Code Overview (Major Objects) Agents ▫LMAAgent, MAGAgent Packet Headers ▫PMIPv6, IP6Encap Classifiers ▫PMIPv6Src, PMIPv6Dest Tunneling Objects ▫PMIPv6Encapsulator, PMIPv6Decapsulator 20

21 Code Overview (Block Diagram) Classifier(Routing) MAGAgentEncapDecap Link/MAC Classifier(Routing) LMAAgentEncapDecap Link/MAC From CNTo MN From MN To CN LMAMAG PBU/PBA 21

22 PMIPv6Agent (Agent/PMIPv6) Super class of LMAAgent and MAGAgent Fields Functions NameDescription default_port_ Agent 추가시 사용되는 기본 포트 ( 기본값 : 250) binding_lifetime_ 기본 Binding 시간 ( 기본값 : 500 s) max_retry_count_ 최대 PBU 재전송 시도 회수 ( 기본값 : 5) NameDescription process_packet()Packet dispatcher (PBU/PBA) create_pbu(), create_pback() PBU/PBA packet 생성 22

23 LMAAgent (Agent/PMIPv6/LMA) LMA 기능 수행 Fields Functions NameDescription bcache_list_Binding Cache List hnp_list_Home Network Prefix List (MN 의 MAC+MN 의 IP 주소로 구성 ) NameDescription process_pbu() PBU packet 에 대한 처리 (Bcache 생성, Tunneling 관리 ) setup_route(), clear_route(), setup-route{}, clear-route{} MN 의 주소에 대한 터널링을 설정 / 해제 find_bce(), create_bce() Binding cache 검색 / 생성 send_pback() PBA packet 전송 23

24 MAGAgent (Agent/PMIPv6/MAG) MAG 기능 수행 Fields NameDescription bul_list_Binding Update List lma_addr_ LMA 의 주소 seqno_ PBU/PBA 에 사용되는 sequence 번호 24

25 MAGAgent (Agent/PMIPv6/MAG) Functions NameDescription new-mn{}, process_new_mn() MN 의 Attachment Event 처리 (BUL 생성, PBU 전송 ) process_pback() PBA packet 처리 (BUL 갱신, Tunneling 관리 ) setup_route(), clear_route(), setup-route{}, clear-route{} MN 의 주소에 대한 터널링을 설정 / 해제 find_bule(), create_bule() Binding Update List 검색 / 생성 send_pbu() PBU packet 전송 set-lmaa{} LMA 주소를 설정 (Tcl 함수 ) 25

26 Packet Headers PMIPv6 (PacketHeader/PMIPv6) ▫PBU/PBA packet 헤더 ▫Packet Type(PT_PBU, PT_PBA) 정의 ▫Fields NameDescription optype_ PBU/PBA packet 구분 A_, H_, P_ 각각 Ack required, Home registration, Proxy registration bit seq_ Sequence 번호 lftm_Binding Lifetime homeaddr_ Home Address (MN 의 IP 주소 ) coaddr_ Proxy-CoA 주소 mn_id_ MN 의 ID status_ 상태코드 26

27 Packet Headers IP6Encap (PacketHeader/IP6Encap) ▫IP-in-IP tunneling 헤더 ▫ 단일 tunneling 만 고려함 ▫Fields NameDescription hdr_Inner IP header ptype_Packet Type 27

28 Classifiers PMIPv6Src (Addr/Classifier/PMIPv6Src) ▫Source address based classifier ▫Packet 의 source IP 주소로 구분함 PMIPv6Dest (Addr/Classifier/PMIPv6Dest) ▫Destination address based classifier ▫ 기존의 classifier 와 동일 28

29 Tunneling Objects PMIPv6Encapsulator ▫Data packet encapsulation ▫Fields PMIPv6Decapsulator (Addr/Classifier/PMIPv6Decapsulator) ▫Data packet decapsulation NameDescription here_ Outer IP 헤더의 source 주소와 port dest_ Outer IP 헤더의 destination 주소와 port defttl_ Encapsulation 된 packet 의 TTL 값 ( 기본값 : 32) 29

30 Node Object New Fields NameDescription pmip6_agent_ Node 에 설치된 PMIPv6 Agent (LMA 또는 MAG) src_classifier_Source address based classifier dst_classifier_Destination address based classifier old_classifier_ 새로운 classifier 를 설치하기 이전의 classifier decap_PMIPv6Decapsulator Encaps_(array) Node 에 연결된 PMIPv6Encapsulator List ( 연결된 MAG 당 1 개의 Encapsulator 가 존재 ) 30

31 Node Object New Functions NameDescription install-lma{} Node 가 LMA 기능을 수행하도록 관련 Object 를 설치함 (LMAAgent, PMIPv6Dest, PMIPv6Decapsulator) install-mag{} Node 가 MAG 기능을 수행하도록 관련 Object 를 설치함 (MAGAgent, PMIPv6Src, PMIPv6Decapsulator) get-pmip6-agent{} pmip6_agent_ 값을 얻음 get-pmip6-encap{} PMIPv6Encapsulator 를 얻음. Tunneling Endpoint 에 대하여 이미 존재하면 배열의 값을 반환, 없으면 생성 후 반환 clear-pmip6-encap{} PMIPv6Encapsulator 를 삭제 31

32 32

33 Overview Initialization (Initial Object Setup) Binding Update Process Data Process MAC MAG Agent LMA Agent MN attached Layer 2 Trigger “new-mn{}” PBU PBA MAGLMA Encap From CN LMA Decap MAG Encap From MN To MN To CN 33

34 Initialization - LMA Setting up LMAAgent, Dest Classifier, and Decapsulator by calling “install-lma{}” function 34

35 Initialization - LMA install-lma{} function (in Node object) #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_ 35

36 Initialization - LMA install-lma{} function (cont’d)  Install Decapsulator #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_ 36

37 Initialization - MAG Setting up MAGAgent, Src Classifier, and Decapsulator by calling “install-mag{}” function 37

38 Initialization - MAG install-mag{} function (in Node object) #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_ 38

39 Initialization - MAG install-lma{} function (cont’d) #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_ } 39

40 MN Attachment Event (IEEE 802.11) “new-mn{}” function in MAGAgent is called when AssocRes Ack received 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()); } 40

41 MN Attachment Event (IEEE 802.16) “new-mn{}” function in MAGAgent is called when DSA_ACK received 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()); } 41

42 Binding Update Process – MAG(1) Function flow MAGAgent Mac802_11 Mac802_16 new-mn/TCL process_new_mn() -find_bule command() send_pbu() PMIPv6Agent create_pbu() send() 42

43 Binding Update Process – MAG(1) new-mn{} in MAGAgent::command() MAGAgent::process_new_mn() if(strcmp(argv[1], "new-mn") == 0) { uint32_t id = atoi(argv[2]); process_new_mn(id); 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_); } 43

44 Binding Update Process – MAG(1) MAGAgent::send_pbu() 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); 44

45 Binding Update Process - LMA Function flow LMAAgentPMIPv6Agent process_packet() setup_route() process_pbu() -find_bce() setup-route/TCL -get-pmip6-encap/TCL send_pback() recv() create_pback() send() 45

46 Binding Update Process - LMA PMIPv6Agent::recv() LMAAgent::process_packet() if(ch->ptype() == PT_PBU) { process_pbu(p); } 46

47 Binding Update Process - LMA LMAAgent::process_pbu() 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); 47

48 Binding Update Process - LMA LMAAgent::setup_route() setup-route{} in Agent/PMIPv6/LMA LMAAgent::process_pbu() LMAAgent::send_pback() #get an encapsulator for tunneling endpoint set encap [$node_ get-pmip6-encap $te] $clsfr_dst install-by-dest $mnaddr $encap send_pback(bce, 0); bce->BCacheTimer_.resched((double)bce->lifetime()); 48

49 Binding Update Process - LMA 49

50 Binding Update Process – MAG(2) Function flow MAGAgentPMIPv6Agent process_packet() setup_route() process_pback() -find_bule() setup-route/TCL -get-pmip6-encap/TCL recv() clear_route() clear-route/TCL bule_state: BUL_S_SETUP bule_state: BUL_S_DELETE 50

51 Binding Update Process – MAG(2) PMIPv6Agent::recv() MAGAgent::process_packet() MAGAgent::process_pback() bule = find_bule(h->mn_id()); switch(bule->get_state()) { case BUL_S_SETUP: setup_route(bule); 51

52 Binding Update Process – MAG(2) MAGAgent::setup_route() setup-route{} in Agent/PMIPv6/MAG set decap_ [$node_ set decap_] if {[$node_ info class] == "MobileNode/MIPBS" || [$node_ info class] =="Node/MobileNode" } { #if mobile node, target is adhoc routing agent set target [$node_ set ragent_] } else { #if wired link, target is direct link to the destination node set target [[$ns link $node_ [$ns get-node-by-addr $mnaddr]] head] } $decap_ install $mnaddr $target set clsfr_src [$node_ set src_classifier_] set encap [$node_ get-pmip6-encap $te] $clsfr_src install-by-src $mnaddr $encap 52

53 Binding Update Process – MAG(2) 53

54 Data Process LMA  MAG MAG  LMA PMIPv6Encapsulator PMIPv6Dest recv() classify() recv() target_->recv() PMIPv6Decapsulator recv() find() link->recv() PMIPv6Encapsulator PMIPv6Src recv() classify() recv() target_->recv() PMIPv6Decapsulator recv() find() link->recv() 54

55 Data Process PMIPv6Src::classify() int PMIPv6Src::classify(Packet *p) { hdr_ip* iph = hdr_ip::access(p); //classify by source IP address return mshift(iph->saddr()); } 55

56 Data Process PMIPv6Encapsulator::recv() //put original (outer) header to the encap (inner) header enh->hdr_ = *hdr; enh->ptype_ = ch->ptype(); //fill original (outer) header with tunnel addresses hdr->saddr() = here_.addr_; hdr->sport() = here_.port_; hdr->daddr() = dest_.addr_; hdr->dport() = dest_.port_; hdr->ttl() = defttl_; //increase packet size ch->size() += IPv6_HEADER_SIZE; target_->recv(p, h); 56

57 Data Process PMIPv6Decapsulator::recv() //swap outer header and inner header tmph = *hdr; *hdr = enh->hdr_; enh->hdr_ = tmph; //find target link NsObject* link = find(p); ch->size() -= IPv6_HEADER_SIZE; link->recv(p,h); 57

58 58

59 Simulation Topology 50m/s 100Mbps, 100ms 100Mbps, 10ms CN(2.0.0) LMA (1.0.0) Router (0.0.0) MAG1 (3.0.0) MAG2 (4.0.0) 100Mbps, 10ms 59

60 Wireless Configuration (IEEE 802.11) # Parameter for wireless nodes set opt(chan)Channel/WirelessChannel ;# channel type set opt(prop) Propagation/TwoRayGround ;# radio-propagation model set opt(netif) Phy/WirelessPhy ;# network interface type set opt(mac) Mac/802_11 ;# MAC type set opt(ifq) Queue/DropTail/PriQueue ;# interface queue type set opt(ll) LL ;# link layer type set opt(ant) Antenna/OmniAntenna ;# antenna model set opt(ifqlen) 50 ;# max packet in ifq set opt(adhocRouting) DSDV ;# routing protocol Mac/802_11 set basicRate_ 1Mb Mac/802_11 set dataRate_ 11Mb Mac/802_11 set RTSThreshold_ 30000 #define coverage area for base station: 20m coverage Phy/WirelessPhy set Pt_ 0.025 Phy/WirelessPhy set RXThresh_ 2.025e-12 Phy/WirelessPhy set CSThresh_ [expr 0.9*[Phy/WirelessPhy set RXThresh_]] 60

61 LMA Setup set lma [$ns node 1.0.0] #attach Agent/PMIPv6/LMA to the LMA set lma_pm [$lma install-lma] #PMIPv6 agent must be installed before connecting link(duplex-link) $ns duplex-link $lma $router 100Mb $opt(dfLinkDelay) DropTail 61

62 MAG Setup set mag1 [$ns node 3.0.0] #NIST settings set mag1_mac [$mag1 getMac 0] set mag1_addr [$mag1_mac id] $mag1_mac bss_id $mag1_addr $mag1_mac set-channel 1 $mag1_mac enable-beacon #install PMIPv6/MAG agent to the MAG1 set mag1_pm [$mag1 install-mag] set lmaa [$lma node-addr] $mag1_pm set-lmaa [AddrParams addr2id $lmaa] #setup 802.11 MAC to support MN ATTACH Event $mag1_mac set use_pmip6_ext_ 1 $mag1_mac pmip6-agent $mag1_pm $ns duplex-link $mag1 $router 100Mb $opt(dfLinkDelay) DropTail 62

63 MN Setup # creation of the mobile nodes $ns node-config -wiredRouting OFF \ -macTrace ON Mac/802_11 set dataRate_ 11Mb set mn [$ns node 1.0.1] $mn random-motion 0 $mn base-station [AddrParams addr2id [$mag1 node-addr]] $mn set X_ 100.0 $mn set Y_ 500.0 $mn set Z_ 0.0 set mn_mac [$mn set mac_(0)] [$mn set mac_(0)] set-channel 1 [$mn set netif_(0)] setTechno 802.11 $lma_pm register-mn-addr [$mn_mac id] [AddrParams addr2id [$mn node-addr]] 63

64 #Traffic setup set agent [new $opt(agentType)] $agent set class_ 2 $ns attach-agent $cn $agent set traffic [new $opt(trafficType)] $traffic attach-agent $agent if { $opt(trafficType) == "Application/Traffic/CBR" } { $traffic set packetSize_ $opt(cbrPacketSize) $traffic set interval_ $opt(cbrInterval) } set sink [new $opt(sinkType)] $ns attach-agent $mn $sink $ns connect $agent $sink Traffic Setup set opt(agentType) Agent/UDP set opt(sinkType) Agent/LossMonitor set opt(trafficType) Application/Traffic/CBR #if traffic is CBR set opt(cbrInterval) 0.01 set opt(cbrPacketSize) 1000 64

65 Simulation Scenario Simulation time: 20 seconds CBR starts at 0.5 second, and ends at 19.5 seconds MN moves towards MAG2 with 50m/s speed $ns at 0.0 "record" $ns at 0.5 "$traffic start" $ns at 19.5 "$traffic stop" $ns at 1.0 "$mn setdest 600.00 500.00 50.00" $ns at 20 "finish" 65

66 Trace Analysis (PBU/PBA exchange) s 9.361996775 _5_ MAC --- 0 ACK 38 [0 1 0 0] s 9.362301812 _4_ AGT --- 94 pbu 68 [0 0 0 0] ------- [16777216:250 4194304:250 32 0] + 9.362302 4 0 pbu 68 ------- 0 4.0.0.250 1.0.0.250 -1 94 - 9.362302 4 0 pbu 68 ------- 0 4.0.0.250 1.0.0.250 -1 94 r 9.362301812 _4_ MAC --- 0 ACK 38 [0 1 0 0] r 9.363307 4 0 pbu 68 ------- 0 4.0.0.250 1.0.0.250 -1 94 + 9.363307 0 1 pbu 68 ------- 0 4.0.0.250 1.0.0.250 -1 94 - 9.363307 0 1 pbu 68 ------- 0 4.0.0.250 1.0.0.250 -1 94 r 9.364313 0 1 pbu 68 ------- 0 4.0.0.250 1.0.0.250 -1 94 + 9.364313 1 0 pba 68 ------- 0 1.0.0.250 4.0.0.250 -1 95 - 9.364313 1 0 pba 68 ------- 0 1.0.0.250 4.0.0.250 -1 95 r 9.365318 1 0 pba 68 ------- 0 1.0.0.250 4.0.0.250 -1 95 + 9.365318 0 4 pba 68 ------- 0 1.0.0.250 4.0.0.250 -1 95 - 9.365318 0 4 pba 68 ------- 0 1.0.0.250 4.0.0.250 -1 95 r 9.366324 0 4 pba 68 ------- 0 1.0.0.250 4.0.0.250 -1 95 r 9.366323572 _4_ AGT --- 95 pba 68 [0 0 0 0] ------- [4194304:250 16777216:250 30 0] + 9.4 2 1 cbr 1000 ------- 2 2.0.0.0 1.0.1.0 89 96 - 9.4 2 1 cbr 1000 ------- 2 2.0.0.0 1.0.1.0 89 96 4.0.0.250  1.0.0.250 (MAG2) (LMA) PMIPv6 Agent Port: 250 66

67 Trace Analysis (Tunneling) Before Handover (CN  LMA  MAG1  MN ) + 8.6 2 1 cbr 1000 ------- 2 2.0.0.0 1.0.1.0 81 86 - 8.6 2 1 cbr 1000 ------- 2 2.0.0.0 1.0.1.0 81 86 r 8.600597572 _5_ MAC --- 0 BCN 64 [20a ffffffff 0 0] r 8.61008 2 1 cbr 1000 ------- 2 2.0.0.0 1.0.1.0 81 86 + 8.61008 1 0 cbr 1040 ------- 2 1.0.0.1 3.0.0.1 81 86 - 8.61008 1 0 cbr 1040 ------- 2 1.0.0.1 3.0.0.1 81 86 r 8.611163 1 0 cbr 1040 ------- 2 1.0.0.1 3.0.0.1 81 86 + 8.611163 0 3 cbr 1040 ------- 2 1.0.0.1 3.0.0.1 81 86 - 8.611163 0 3 cbr 1040 ------- 2 1.0.0.1 3.0.0.1 81 86 r 8.612246 0 3 cbr 1040 ------- 2 1.0.0.1 3.0.0.1 81 86 s 8.612381400 _3_ MAC --- 86 cbr 1060 [13a 2 0 800] ------- [8388608:0 4194305:0 29 4194305] [81] 0 0 r 8.613328470 _5_ MAC --- 86 cbr 1000 [13a 2 0 800] ------- [8388608:0 4194305:0 29 4194305] [81] 1 0 s 8.613338470 _5_ MAC --- 0 ACK 38 [0 0 0 0] r 8.613353470 _5_ AGT --- 86 cbr 1000 [13a 2 0 800] ------- [8388608:0 4194305:0 29 4194305] [81] 1 0 r 8.613644086 _3_ MAC --- 0 ACK 38 [0 0 0 0] 2.0.0.0  1.0.1.0 (CN) (MN) Packet size: 1000 bytes 1.0.0.1  3.0.0.1 (LMA) (MAG1) Packet size: 1040 bytes Tunnel Port: 1 67

68 Trace Analysis (Tunneling) After Handover ( CN  LMA  MAG2  MN ) r 10.356151077 _5_ MAC --- 0 BCN 64 [20a ffffffff 1 0] + 10.4 2 1 cbr 1000 ------- 2 2.0.0.0 1.0.1.0 99 106 - 10.4 2 1 cbr 1000 ------- 2 2.0.0.0 1.0.1.0 99 106 s 10.400083958 _3_ MAC --- 0 BCN 64 [20a ffffffff 0 0] r 10.41008 2 1 cbr 1000 ------- 2 2.0.0.0 1.0.1.0 99 106 + 10.41008 1 0 cbr 1040 ------- 2 1.0.0.1 4.0.0.1 99 106 - 10.41008 1 0 cbr 1040 ------- 2 1.0.0.1 4.0.0.1 99 106 r 10.411163 1 0 cbr 1040 ------- 2 1.0.0.1 4.0.0.1 99 106 + 10.411163 0 4 cbr 1040 ------- 2 1.0.0.1 4.0.0.1 99 106 - 10.411163 0 4 cbr 1040 ------- 2 1.0.0.1 4.0.0.1 99 106 r 10.412246 0 4 cbr 1040 ------- 2 1.0.0.1 4.0.0.1 99 106 s 10.412541400 _4_ MAC --- 106 cbr 1060 [13a 2 1 800] ------- [8388608:0 4194305:0 29 4194305] [99] 0 0 r 10.413487859 _5_ MAC --- 106 cbr 1000 [13a 2 1 800] ------- [8388608:0 4194305:0 29 4194305] [99] 1 0 s 10.413497859 _5_ MAC --- 0 ACK 38 [0 1 0 0] r 10.413512859 _5_ AGT --- 106 cbr 1000 [13a 2 1 800] ------- [8388608:0 4194305:0 29 4194305] [99] 1 0 2.0.0.0  1.0.1.0 (CN) (MN) Packet size: 1000 bytes 1.0.0.1  4.0.0.1 (LMA) (MAG2) Packet size: 1040 bytes Tunnel Port: 1 68

69 Result (IEEE 802.11, Packet Sequence) 69

70 Result (IEEE 802.11, Throughput) 70

71 Result (IEEE 802.16, Packet Sequence) 71

72 Result (IEEE 802.16, Throughput) 72

73 References NIST add-on ▫http://www.antd.nist.gov/seamlessandsecure/http://www.antd.nist.gov/seamlessandsecure/ PMIPv6 for NS-2 ▫http://commani.net/pmip6nshttp://commani.net/pmip6ns 73


Download ppt "Proxy Mobile IPv6(PMIPv6) 을 위한 ns-2 코드 및 예제 한국기술교육대학교 한연희 교수 고려대학교 컴퓨터학과 최현영 2010 년 2 월 2 일 ns-2 기초 및 무선 / 이동 네트워크."

Similar presentations


Ads by Google