Está en la página 1de 17

Chng II: Tngquanv IPv6

1. Cu trc a ch ca IPv6
1.1 Khng gian ach IPv6 Tnh nng quan trng nht ca IPv6 khi c so snh vi IPv4 chnh l khng gian a ch ln hn.a ch IPv4 s khng bao gi c m rng, do vic nng cp ln IPv6 l iu thit yu nu Internet ngy cng pht trin. IPv6 c tng cng l 128 bit c chia lm 2 phn: 64 bit u c gi l network, 64 bit cn li c gi l host.Phn network dng xc nh subnet, a ch ny c gn bi cc ISP hoc nhng t chc ln nh IANA (Internet Assigned Numbers Authority).Cn phn host l mt a ch ngu nhin da trn 48 bit ca MAC Address. 1.2 C php a ch IPV6 a ch IPv6 c 128 bit, do vic nh c a ch ny rt kh khn. Cho nn vit a ch IPv6, ngi ta chia 128 bit ra thnh 8 nhm, mi nhm chim 2 bytes, gm 4 s c vit di h s 16, v mi nhm c ngn cch nhau bng du hai chm

V d: FEDL:8435:7356:EADC:BA98:2010:3280:ABCD

V IPv6 l mt a ch mi nn chng ta s khng dng ht 128 bits, cng ging nh SIM in thoi vy, nhng u s mi ra c rt nhiu s v do chng ta c quyn la chn. V IPv6 cng vy, v mi ra cho nn s c nhiu s 0 cc bit u. Chng ta c th lc b cc s 0 ny i.V d: a ch: 1088:0000:0000:0000:0008:0800:200C:463A ==>> Bn c th vit 0 thay v phi vit l 0000, vit 8 thay v phi vit 0008, vit 800 thay v phi vit l 0800 V y l a ch c rt gn: 1088:0:0:0:8:800:200C:463A IPv6 cn c mt nguyn tc na l c th nhm cc s 0 li thnh 2 du hai chm "::", a ch trn, bn c th vit li nh sau: 1088::8:800:200C:463A Qua v d, ta s rt ra c 2 nguyn tc: 1. Trong dy a ch IPV6, nu c s 0 ng u c th loi b. V d 0800 s c vit thnh 800, hoc 0008 s c vit thnh 8 2. Trong dy a ch IPv6, nu c cc nhm s 0 lin tip, c th n gin cc nhm ny bng 2 du ::( ch p dng khi dy 0 lin tip nhau) V d 1: FADC:BA98::7654:3210 -> IPv6 c tng cng l 8 nhm, m trn bn thy c 4 nhm, nh vy gia 2 du hai chm, s l 4 nhm s 0. Vy a ch trn c th vit y l:

FADC:BA98:0:0:0:0:7654:3210 V d 2: FADC:BA98:7654:3210:: -> c a ch y l: FADC:BA98:7654:3210:0:0:0:0 V d 3: ::FADC:BA98:7654:3210 -> c a ch y l: 0:0:0:0:FADC:BA98:7654:3210 Gi s c a ch 0:0:0:AB65:8952:0:0:0, by gi yu cu bn n gin ha a ch ny li, c 3 p n la chn:

1. ::AB65:8952:: 2. ::AB65:8952:0:0:0 3. 0:0:0:AB65:8952:: Ch c p n 2 v 3 l ng. Mt nguyn tc na cn phi nh trong IPv6 l bn ch c th s dng 2 du hai chm mt ln vi a ch.Khng c vit nh vy ::AB65:8952::, v nu bn vit nh th s gy nhm ln khi dch ra y . V d: Nu bn vit :: AB65:8952::, th ngi ta c th on a ch y ca n nh th ny 0:0:AB65:8952:0:0:0:0 hoc 0:0:0:0:AB65:8952:0:0 , 1.3 Cpphtach IPv6
Bng cp pht a ch ch ra t l s dng ca cc loi a ch trong khng

gian a ch. Phn chim khng gian a ch ln nht c s dng cho loi a ch Global Unicast dnh cho cc nh cung cp dch v IPv6 provider based ( phn theo nh cung cp ) nhng cng ch chim 1% ca tng khng gian a ch. Tt c cn hn 70% khng gian cn li cha c cp pht, phn ny c th cung cp nhng c hi phong ph cho vic cp pht mi trong tng lai.

Theo cu trc bng phn b a ch trn, 1 trong s nhng loi a ch IPv6 quan trng nht l dng a ch Global Unicast, dng a ch ny cho php nh danh 1 giao din trn mng Internet ( mng IPv6 ) c tnh duy nht trn ton cu. ngha loi a ch ny cng ging nh a ch IPv4 nh danh 1 Host trong mng Internet hin nay. Khng gian ca dng a ch Global Unicast l rt ln, qun l v phn b hp l cc nh thit k IPv6 a ra m hnh phn b a ch theo cp cc nh cung cp dch v Internet. Dng a ch ny gm 3 bit tin t 010 theo sau bi 5 thnh phn m mi thnh phn ny c qun l bi cc nh cung cp dch v theo cc cp khc nhau. Ty theo vic phn b a ch cc thnh phn ny c 1 chiu di bin i iu ny 1 ln na cho thy tnh ng trong vic cp pht v qun l IPv6. 3 n bit 010 ID ng k m bit ID nh cung cp o bit ID thu bao p bit ID mng con 125-n-2-m-p bit ID ca giao tip

Hnh 2 Cu trc a ch IPV6 dng Global Unicast Thnh phn u tin l ID ca cc nh cung cp dch v hng u tin Top Level registry. Cng ging nh IPv4, c 3 t chc qun l vic cp pht a ch IPv6. Cc t chc ny cp pht cc gi tr TLA ID u tin. C th nh sau: - Khu vc Bc M l Internet NIC ( network information center ) , t chc ny iu khin bi NSI di 1 hp ng vi U.S National Science Foundation. - Khu vc chu u l NCC ( network coordinoction center ) ca RIPE ( hip hi mng IP chu u ). - Khu vc chu v Thi Bnh Dng l t chc APINC.

- Ngoi ra cn c 1 t chc chung c th cp pht a ch cho cc khu vc khc nhau l IANA. Cc nh cung cp dch v Internet IPv6 phi c 1 provides ID ( nhn dng nh cung cp) t nhng ng k trn.Theo k hoch cp pht a ch Provider ID l 1 s 16 bit, 8 bit tip theo s c cho bng 0 trong giai on u 8 bit ny cha s dng, c dnh cho cc m rng tng lai. Trong cu trc hin ti, nhng im ng k chnh c b xung bi 1 s ln cc im ng k vng hoc quc gia, v d French NIC qun l bi INRIA cho cc mng ca Php. Nhng im ng k ny s khng c nhn dng bng 1 s ng k. Thay vo h s nhn c phm vi nhn dng ca cc nh cung cp t cc c s ng k chnh. Vi cu trc a ch mi ny cho php khch hng ln c th c c cc nh danh ngn hn, v iu s cho h kh nng thm vo cc lp mng mi trong phn tng mng con ca h. Thc t cc khch hng ln cn c th i c chp nhn nh nh cung cp ca chnh h, v ly c ID nh cung cp t cc im ng k m khng phi l thuc vo nh cung cp dch v Internet ISP.

2. Ccloiach IPv6
2.1 ach unicast
Unicast l mt tn mi thay th cho kiu point to point c s dng trong a ch IPV4.s dng nh danh cho mt giao din trn mng. mt packet c a ch ch l dng a ch uniscast s c chuyn ti giao din c nh danh bi a ch , a ch unicast cn gi l a ch n hng.

13bit 001 TLA ID

8 bit RES

24 bit NLA ID

16 bit SLA ID

64 bit Interface ID

001 :cho php bit c a ch c thuc a ch kh nh tuyn ton cu hay khng gip cc thit b nh tuyn c thit b nhanh hn TLA ID :c s dng v 2 mc ch

Th nht : n c ch nh mt khi a ch ln m t cc khi a ch nh hn c to ra cung cp s kt ni cho nhng a ch no kt ni vo internet. Th hai : n c s dng phn bit mt ng router n t u . Res :cha s dng . NLA ID :nh danh nh cung cp dch v cp tip theo TLA SLA ID :nh dng cc site ca khch hng . Interface ID : gip xc nh cc interface ca cc host kt ni trong mt site Phn Loi a Ch Unicast: a)a Ch Global Unicast: c m t trong khuyn ngh RFC 2374. Dng nhn dng cc Interface,cho php kt ni cc Node trong mng Internet IPv6 ton cu.Dng a ch ny h tr cc ISP c nhu cu kt ni ton cu, c xy dng theo kin trc phn cp r rng, c th nh sau: 001 TLA ID 13 bit RES 8 bit NLA ID 24 bit SLA ID 16 bit Interface ID 64 bit

Hnh 4 Cu trc a ch UNICAST. Trong : - 001: nh dng Prefix i vi loi a ch Global Unicast. - TLA ID: (Top Level Aggregation Identification) nh danh cc nh cung cp dch v cp cao nht trong h thng cc nh cung cp dch v. - RES : Cha s dng. - NLA ID: (Next Level Aggregation Identification) nh danh nh cung cp dch v bc 2 (sau TLA). - SLA ID: (Site Level Aggregaton Identification) nh dng cc Site ca khch hng. - Interface ID: Gip xc nh cc Interface ca cc Host kt ni trong mt Site. Nh vy loi a ch Global Unicast c thit k phn cp, cu trc ca n c chia thnh 3 phn: - 48 bit Public Topology. - 16 bit Site Topology. - 64 bit gip xc nh Interface. Trong mi phn c th c chia thnh nhng cp con nh sau:

Hnh 5: Kh nng phn cp ca a ch Global-Unicast Theo cch phn cp ny, TLA ID c th phn bit 2^13 = 8192 cc TLA khc nhau. c mt TLA ID, phi yu cu qua cc t chc quc t. i vi mt ISP (V d nh VDC) trong m hnh phn cp ny c vai tr l mt NLA v NLA ID ca VDC phi c cp thng qua t chc TLA qun l NLA ca VDC. Hin nay c mt s phng thc xin cp NLA ID nh sau: - Xin cp thng qua 6BONE Community: khi TLA ID ca t chc ny l 3ffe::/16. 6BONE l mt mng th nghim IPv6 trn ton cu. Cc ISP sau khi tha mn mt s yu cu ca t chc ny s c cp pht NLA ID theo yu cu ca ISP ny. - Xin cp thng qua International Regional Internet Registry (RIP).

- Gi lp a ch IPv6 t IPv4: phng php ny thun tin cho vic kt ni IPv6 t a ch IPv4. a ch Global Unicast trong trng hp ny TLA ID c Prefix 2002::/16; 32 bit cui cng chnh l a ch IPv4 ca Host.i vi mi t chc TLA, sau khi c TLA ID c th cp pht n cc t chc cp di. Vi mi TLA cho php tip tc phn cp, cp pht cho 2^24 cc t chc cp di khc nhau. i vi cu trc NLA ID cng c phn ra thnh cc phn nh, s dng n bit trong s 24 bit NLA lm nh danh cho t chc . 24-n bit cn li cng c th phn cp tip hoc cp cho cc Host trong mng. Trong mi NLA, SLA ID cng c th phn cp theo quy tc tng t nh NLA ID cung cp cho nhiu Site khch hng s dng. Mt Site thuc phm vi mt NLA khi c yu cu cp a ch s nhn c thng tin v TLA ID, NLA ID, SLA ID nh danh Site trong t chc v xc nh Subnet trong cc mng con. Phn cn li trong cu trc a ch Global Unicast l ch s Interface ID, c m t theo chun EUI-64. Ty vo cc loi Interface khc nhau s c Interface ID khc nhau.

b)a Ch Local-Unicast:
Nhiu h thng mng cc b hin nay s dng giao thc TCP/IP, cc h thng ny cn c gi l mng Intranet. IPv4 dnh ring mt khong a ch ring cho cc h thng mng ny (V d khong a ch 192.168.0.0 ). i vi IPv6 c hai loi a ch Unicast h tr cc lin kt cc b trong cng mt mng, l a ch Link-local v a ch Site-local. -a ch Site-local Unicast dng lin kt cc Node trong cng mt Site m khng xung t vi cc a ch Global. Cc gi tin mang loi a ch ny trong IP Header, Router s khng chuyn ra mng ngoi.

Hnh 8 Cu Trc Local -Unicast a ch Site-local Unicast lun bt u bi Prefix FEC0::/48 theo sau l 16 bit Subnet ID, ngi dng c th dng 16 bit ny phn cp h thng mng ca mnh. Cui cng l 64 bit Interface ID dng phn bit cc Host trong mt Subnet. Quy tc nh tuyn i vi dng a ch Site-local: -Router khng th chuyn cc gi tin c a ch ngun hoc ch l a ch Site-local Unicast ra ngoi mng . -Cc a ch Site-local khng th c nh tuyn trn Internet. Phm vi ca chng ch trong mt Site, ch dng trao i d liu gia cc Host trong Site . -a ch Link-local Unicast: dng cc Node l neighbor giao tip vi nhau trn cng mt lin kt.

Hnh 9 Cu Trc Link-Local Unicast. a ch Link-local Unicast lun bt u bi Prefix FE80::/64, kt thc l 64 bit Interface ID dng phn bit cc Host trong mt Subnet (nh m t phn trn). Nhng a ch ny ch c nh ngha trong phm vi kt ni Point-to-point. Quy tc nh tuyn i vi loi a ch ny cng ging nh i vi Site-local Unicast, Router khng th chuyn bt k gi tin no c a ch ngun hoc

ch l a ch Link-local.Mt Interface c th c gn nhiu loi a ch khc nhau.

c) a Ch Unicast Theo Chun IPX. 7 0000 010 121 Cha nh ngha

Hnh 10 a Ch Unicast Theo Chun IPX a ch unicast theo chun IPX cha c xc nh v cn trong giai on nghin cu.

2.2 ach Anycast


a ch Anycast c gn cho mt nhm interface thng thng l nhng node khc nhau nhng gi tin c a ch ch l nhng a ch anycast s c gi n node gn nht mang a ch ny. Trong IPV6 Anycast khng c cu trc c bit, cc a ch Anycast chim mt phn trong khng gian a ch Unicast .Do v mt cu trc a ch Anycast khng th phn bit vi a ch Unicast, khi a ch Unicast c gn nhiu hn mt interface ,n tr thnh a ch Anycast.

Hnh 11: Cu Trc a Ch Anycast Trong cu trc ca bt k a ch Anycast no cng c mt Prefix P di nht xc nh vng m a ch Anycast gn cho cc interface.Theocu trc

ny Prefix P cho php thc hin qui tc nh tuyn i vi a ch Anycast nh sau : Trong bng nh tuyn trn router ca h thng thnh nhng mc ring bit vi nhau i vi giao tip bn ngoi mng khai bo trn router ch gm mt mc l phn Prefix P . C th hiu phn Prefix ny i din cho mt subnet ca mng bn trong . Trong mt vi trng hp c bit ton b phn Prefix ca a ch Anycast l mt tp hp cc gi tr 0 . Khi cc interface c gn cho a ch Anycast ny khng nm trong mt vng v trn bng nh tuyn Global phi khai bo ring r cho tng interface qua c ch nh tuyn cho a ch Anycast nh trn ta thy mc ch thit k ca loi a ch Anycast h tr nhng cu trc mng phn cp. Trong a ch Anycast gn cho router. Cc router ny c chia thnh cc vng hay on mng khi mt gi tin n router cp cao nht trong h thng ,n c chuyn ng thi n cc router trong tng cng mt on s dng Anycast c mt s hn ch sau : -a ch IPV6 Anycast khng c lm a ch ngun ca cc gi tin IPv6 -Mt a ch Anycast khng c php gn cho mt host IPv6 do n ch gn cho router IPv6.

2.3 ach Multicast


a Multicast cng dng nhn dng mt tp hp cc Node. Nhng khc vi a ch Anycast, mt gi tin khi chuyn n a ch Multicast s c chuyn n tt c cc Node mang a ch Multicast ny.

Hnh 12 Cu Trc a Ch Multicast - a ch Multicast lun bt u bi mt Prefix 8 bit 1111 1111. - Flag c cu trc: +3 bit th t cao c d tr v c xc lp gi tr 0. +T = 0 m ch a ch Multicast Well-known, a ch ny c phn b bi Global Internet Numbering Authority. V c phn b c nh. +T = 1 m ch a ch Multicast transient. a ch ny khng c phn b c nh. - Scope c m ha 4 bit, c dng m ha gii hn phm vi (scope) ca nhm a ch Multicast. Gi tr cc trng ny gm: 0 dnh 1 Node-local 2 Link-local 3 Cha phn b 4 Cha phn b 5 Site-local 6 Cha phn b 7 Cha phn b 8 Organization-local 9 Cha phn b A Cha phn b B Cha phn b C Cha phn b D Cha phn b

E Global F Cha phn b Group ID gip nhn dng nhm Multicast trong phm vi mt Scope. a ch Multicast cp pht c nh hon ton c lp vi gi tr c xc lp trong trng Scope. V d mt nhm NTP Server c cp group ID 101(hex). Ta c: - FF01:0:0:0:0:0:0:101 : Tt c cc NTP trn cng Node vi Node gi. - FF02:0:0:0:0:0:0:101 : Tt c cc NTP trn cng Link vi Node gi. - FF05:0:0:0:0:0:0:101 : Tt c cc NTP trn cng Site vi Node gi. - FF0E:0:0:0:0:0:0:101 : Tt c cc NTP trn Internet. a ch Multicast cp pht khng c nh ch c ngha trong phm vi mt Scope. V d mt a ch Multicast FF15:0:0:0:0:0:0:101 c th c dng trong nhiu Site m khng xung t ln nhau. a ch Multicast khng c lm a ch ngun trong cc gi tin lu thng trn mng. Nhng a ch Multicast c nh ngha trc: - Nhng a ch Multicast Well-known c nh ngha trc: FF0x::/16 trong x c gi tr [0 n F]. Nhng a ch ny c gi li, khng cp cho cc Multicast group. - a ch Multicast ca tt c cc Node: FF01::1 v FF02::1. - a ch Multicast ca tt c cc Router:FF01::2, FF02::2, FF05::2. * Scope 1 (Node-local), Scope 2 (Link-local), Scope 5 (Site-local). - a ch Solicited-Node Multicast FF02:0:0:0:0:1:FFxx:xxxx trong x c gi tr t [0 n F]. Thng thng cc bit ny c ly t 24 low-order bit ca a ch (Unicast hoc Anycast).

2.4 Ccdngach IPv6 khc 2.4.1 a Ch Khng Xc nh


a ch 0:0:0:0:0:0:0:0 c gi l a ch khng xc nh. a ch ny khng c gn mt giao in no. Mt host khi khi to c th s ng a ch ny nh l mt a ch ngun ca n trc khi bit n a ch tht ca n.

2.4.2 a Ch Loopback

a ch loopback c dng 0:0:0:0:0:0:0:1. Mt nude c th s dng a ch ny gi gi tin cho chnh n.

3Phn tch gi tin Ipv6

Hnh 15 Cu Trc Gi Tin IPV6


-Version: 4 bits. IPv6 s version -Traffic Class: 8 bits. Gi tr phn phi u tin trn ng truyn internet Nu 1 ngun t iu chnh giao thng chm li khi c tc nghn, giao thng s gn cho giao thng iu khin tc nghn. V d nh giao thc TCP s dng giao thc ca s trt (Sliding window protocol), c th d dng p ng giao thng. Trong giao thng iu khin tc nghn n c hiu l nhng gi tin c th n chm hoc thm ch mt hoc c nhn ngoi yu cu. D liu iu khin tc nghn c cp pht quyn u tin t 0 n 7

c th hin bng sau:

Hnh 16 Quyn u Tin Trong Gi Tin IPV6


-Flow Label: 20 bits c ch nh s dng router x l khi i t ngun ti ch ca gi tin -Payload Length: 16 bits unsigned. Xc nh di ca d liu gi tin -Next Header:8 bits. Vng Header k tip l 1 trng 8 bt nh ngha 1 u mc m theo sau vng Header nn tng trong n v d liu. Vng header k tip l 1 trong nhng vng m rng tu la chn c s dng bi IP hoc vng Header cho 1 giao thc tng cao hn nh UDP hay TCP. Mi vng Header m rng li c cha trng ny. Bng sau cho chng ta thy nhng gi tr ca vng Header k tip:

Hnh 17 Vng Header K Tip Trong Gi Tin IPV6

-Hop Limit: 8 bits i vi mi router l khi chuyn tip cc gi d liu gii hn hop l decremented bi 1.khi c trng hp t ti s 0 th gi tin b loi b. -Source address: 16 bytes. xc minh ngun gc gi tin -Destination address:16 bytes. thng xc minh ch cui cng ca n v d liu. Tuy nhin nu router ngun c s dng th trng ny s cha a ch ca router k tip.. C th gi tin trong IPv6 c thy nh trong Hnh 1.16 di y. Mi gi tin bao gm mt vng header nn tng bt buc theo sau bi payload. Payload gm c 2 phn: nhng vng Header m rng tu chn v d liu t tng cao hn. Vng Header nn tng chim gi 40 byte, trong khi nhng vng Header m rng v d liu t tng cao hn cha n 65535 byte thng tin.

Hnh 18 Payload Trong Gi Tin IPV6

4. Skhcbit IPv4 v IPv6


S khc nhau ng k nht gia IPv4 v IPv6 l chiu di ca a ch ngun v a ch ca chng: