Está en la página 1de 52

Tm hiu v Ipv6

GII THIU
Phin ban IPv6 la mt phin ban mi cua Internet. No c xy dng trn c s cua giao thc IPv4 nhm tn dung cac u im va khc phuc han ch cua IPv4. Thay i cua IPv6 chu yu sau: M rng khng gian a ch: IPv6 co ia chi ngun va ich dai 128 bit, khng gian ia chi ln cua IPv6 c tht k d phong u ln cho phep phn b ia chi va mang con t truc xng sng Internet n tng mang con trong mt t chc. Tinh bin i c l trinh nhiu sc thai c cai thin gn thm mt pham vi giai quyt ti nhng ia chi nhiu sc thai. S n gian ho khun dang u muc (Header): Header cua IPv6 c thit k giam chi phi n mc ti thiu. iu nay at c bng cach chuyn cac trng khng quan trong va cac trng la chon sang cac header m rng c t phia sau cua IPv6 header. Khun dang header mi cua IPv6 tao ra s x ly hiu qua hn tai cac ruoter. Tin b h tr cho nhng m rng va nhng tuy chon: Thay i trong cach ma nhng tuy chon u muc IP c ma hoa k ca hiu qua hn y ti it hn nhng gii han v kho khn trn nhng tuy chon mi trong tng lai. Kha nng ghi nhan lung: Mt kha nng mi c thm cho phep s ghi nhan cua nhng goi thuc v ti giao thng chay c bit cho ngi gi nao nhng yu cu c bit iu khin, nh khng mc inh cht lng cua dich vu hoc thi gian thc dich vu. Nhng kha nng chng thc va ring t: Nhng m rng chng thc s toan ven d liu c chi ro cho IPv6.

CHNG 1
Nhng han ch cua IPv4 va c im cua IPv6
1 Nguyn Bo Anh Mng My Tnh V Truyn Thng K48

Tm hiu v Ipv6

1.1 Nhng han ch cua IPv4: - Giao thc tng mang trong b giao thc TCP/IP hin tai ang la IPv4 (Internet- working protocol verision 4). IPv4 cung cp truyn thng host-to-host gia nhng h thng trn Internet. Mc du IPv4 c thit k kha tt, s thng ai thng tin a tin trin t luc khi u IPv4 vao nhng nm 1970, nhng IPv4 co nhng s thiu hut khin cho no khng ng b cho s phat trin nhanh cua Internet, gm nhng th sau: + IPv4 co 2 level cu truc ia chi (netid va hostid) phn nhom vao 5 lp (A, B, C, D va E). S s dung nhng ia chi la khng hiu qua. Vi du nh khi cos mt t chc c cp cho 1 ia chi lp A, 16 triu ia chi t ia chi c phn phi duy nht cho t chc s dung. Nu 1 t chc c cp cho 1 ia chi lp C, mt khac chi co 256 ia chi c phn phi cho t chc, y khng phai la mt s u. Cung vy, nhiu triu ia chi bi lang phi trong nhom D va E. Phng thc phn ia chi nay a dung ht nhng ia chi cua IPv4, va mau chong se khng con ia chi nao con cp cho bt ky mt h thng mi nao mun kt ni vao Internet. Mc du sach lc subnet va supernet a giam bt nhng vn v ia chi, nhng subnet va suprnet a lam cho ng truyn tr ln kho khn hn. + Internet phai thich nghi c vi s chuyn giao audio va video thi gian thc. Loai chuyn giao nay yu cu nhng sach lc tri hoan it nht va s t trc cua tai nguyn khng c cung cp trong thit k. + Internet phai thich nghi c vi s ma hoa va s chng nhn cua d liu cho mt s ng dung. Khng mt s ma hoa va s chng nhn nao c cung cp trong IPv4. - khc phuc thiu sot trn IPv6 c bit n nh la IPng (Internet working Protocol, next generation), c xng va nay la mt chun. 1.2 c im cua IPv6: - Trong IPv6 giao thc Internet c cai tin mt cach rng ln thich nghi c s phat trin khng bit trc c cua Internet. inh dang va dai cua nhng ia chi IP cung c thay i vi nhng goi inh dang. Nhng giao thc lin quan, nh ICMP cung c cai tin. Nhng giao thc khac trong tng mang nh ARP, RARP, IGMP a hoc bi xoa hoc co trong giao thc ICMPv6. Nhng giao thc tim ng nh RIP, OSPF cung c cai tin kha nng thich nghi vi nhng thay i nay. Nhng chuyn gia truyn thng d oan la IPv6 va nhng giao thc lin quan vi no se nhanh chong thay th phin ban IP hin thi. Th h mi cua IP hay IPv6 co nhng u im nh sau: 1.2.1 Khng gian ia chi ln
2 Nguyn Bo Anh Mng My Tnh V Truyn Thng K48

Tm hiu v Ipv6

IPv6 co ia chi ngun va ich dai 128 bit. Mc du 128 bit co th tao hn 3,4*10 38 t hp, khng gian ia chi cua IPv6 c thit k d phong u ln cho phep phn b ia chi va mang con t truc xng sng internet n tng mang con trong mt t chc. Cac ia chi hin ang phn b s dung chi chim mt lng nho va vn con tha rt nhiu ia chi sn sang cho s dung trong tng lai. Vi khng gian ia chi ln nay, cac ky thut bao tn ia chi nh NAT se khng con cn thit na. 1.2.2 ia chi phn cp, ha tng inh tuyn hiu qua Cac ia chi toan cuc cua Ipv6 c thit k tao ra mt ha tng inh tuyn hiu qua, phn cp va co th tng quat hoa da trn s phn cp thng thy cua cac nha cung cp dich vu Internet (ISP) trn thc t. Trn mang Internet da trn IPv6, cac router mang xng sng (backbone) co s muc trong bang inh tuyn nho hn rt nhiu. 1.2.3 Khun dang header n gian hoa - Header cua IPv6 c thit k giam chi phi n mc ti thiu. iu nay at c bng cach chuyn cac trng khng quan trong va cac trng la chon sang cac header m rng c t phia sau cua IPv6 header. Khun dang header mi cua IPv6 tao ra s x ly hiu qua hn tai cac router. 1.2.4 T cu hinh ia chi n gian cho vic cu hinh cac tram, IPv6 h tr ca vic t cu hinh ia chi stateful nh kha nng cu hinh server DHCP va t cu hinh ia chi stateless (khng co server DHCP). Vi t cu hinh ia chi dang stateless, cac tram trong lin kt t ng cu hinh chung vi ia chi IPv6 cua lin kt (ia chi cuc b lin kt) va vi ia chi rut ra t tin t c quang ba bi router cuc b. Thm chi nu khng co router, cac tram trn cung mt lin kt co th t cu hinh chung vi cac ia chi cuc b lin kt va giao tip vi nhau ma khng phai thit lp cu hinh thu cng. 1.2.5 Kha nng xac thc va bao mt an ninh Tich hp sn trong thit k IPv6 giup trin khai d dang am bao s tng tac ln nhau gia cac nut mang. 1.2.6 H tr tt hn v cht lng dich vu QoS Lu thng trn mang c phn thanh cac lung cho phep s ly mc u tin khac nhau tai cac router. 1.2.7 H tr tt hn tinh nng di ng
3 Nguyn Bo Anh Mng My Tnh V Truyn Thng K48

Tm hiu v Ipv6

Kha nng di ng MobileIP tn dung c cac u im cua IPv6 so vi IPv4. 1.2.8 Kha nng m rng Thit k cua IPv6 co d phong cho s phat trin trong tng lai ng thi d dang m rng khi co nhu cu. 1.3 Cu truc ia chi IPv6 1.3.1 ia chi IPv6 Mt ia chi gm co 16 byte, o la 128 bit dai. Kiu ky hiu du 2 chm trong h m 16 ( Hexadecimal Colon Notation): lam cho nhng ia chi tr nn co th oc c nhiu hn, IPv6 trinh by ro trong kiu ky hiu du 2 chm trong h m 16. Trong kiu ky hiu nay, 128 bit c chia thanh 8 phn, mi phn rng 2 byte. 2 byte trong kiu ky hiu h m 16 yu cu 4 ch s trong h m 16 nay. Vi th cho nn ia chi gm co 32 ch s trong h m 16 vi mi 4 ch s mt lai co mt du : (hai chm) (Hinh1)

128 bit= 16 bytes= 32ch s trong h m 16 111111101111101100..111111111111

FDEC : : 7654 3210 ADBF 2922 FFFF Hinh 1: ia chi IP phin ban 6 ( IPv6 Address) *S rut gon: + Mc du la ia chi IP ngay ca khi trong inh dang h s m 16, vn rt dai, nhiu ch s 0 trong mt ia chi. Thi du: 1080:0000:0000:0000:0008:0800:200C:417A Do o c ch nen ia chi c dung biu din d dang hn cac loai ia chi dang nay. Ta khng cn vit cac s 0 u cac nhom, nhng nhng s 0 bn trong thi khng th xoa.

4 Nguyn Bo Anh Mng My Tnh V Truyn Thng K48

Tm hiu v Ipv6
Cha rut gon

1080:0000:0000:0000:0008:0800:200C:417A
a rut gon 1080: 0: 0: 0: 8: 800:200C:417A

Hinh 2 : S rut gon ia chi (Abbreviated Address) Hn na ta co th s dung ky hiu :: chi mt chui cac s 0. Tuy nhin ky hiu trn chi c s dung mt ln trong mt ia chi. ia chi IP co dai c inh, ta co th tinh c s cac bit 0 ma ky hiu o biu din. Ta co th ap dung u hay cui ia chi. Cach vit nay c bit co li khi biu din cac ia chi multicast, loopback hay cac ia chi cha chi inh.

Cha rut gon

1080: 0: 0: 0: 8: 800:200C:417A
a rut gon 1080::8:800:200C:417A

Hinh 3: S rut gon ia chi co s 0 lin tip (Abbreviated Address with consecutive zeros) Vic khi phuc lai s rut gon ia chi la rt n gian: thm s 0 vao cho n khi nhn c ia chi nguyn ban (4 ch s trong 1 phn , 32 ch s trong mt ia chi) IPv6 cho phep giam ln ia chi va c biu din theo ky phap CIDR. Vi du: Biu din mang con co dai tin t 80 bit:

5 Nguyn Bo Anh Mng My Tnh V Truyn Thng K48

Tm hiu v Ipv6
1080:0:0:0:8::/80

Hinh 4 : ia chi CIDR ( CIDR Address) 1.3.2 Khng gian ia chi Khng gian ia chi co dai ln hn IPv4( 128 bit so vi 32 bit) do o cung cp khng gian ia chi ln hn rt nhiu. Trong khi khng gian ia chi 32 bit cua IPv4 cho phep khoang 4 ti ia chi, khng gian ia chi IPv6 co th co 23 khoang 6.5*10 ia chi trn mi met vung b mt trai t. ia chi IPv6 128 bit c chia thanh cac min phn cp theo trt t trn Internet. No tao ra nhiu mc phn cp va linh hoat trong ia chi hoa va inh tuyn hin khng co trong IPv4. Khng gian ia chi co nhiu muc ich khac nhau. Ngi ta thit k ia chi IP a chia khng gian ia chi thanh 2 phn, vi phn u c goi la kiu tin t. Phn gia tri tin t nay cho bit muc ich cua ia chi. Nhng ma s c thit k sao cho khng co ma s nao ging phn u cua bt ky ma s nao khac. Do o khng co s nhp nhng khi mt ia chi c trao kiu tin t co th d dang xac inh c. Hinh 5 cho chung ta thy dang cua ia chi IPv6: 128 bit Bin Bin

Kiu tin t

Phn cn lai cua ia chi

Hinh 5 : Cu truc ia chi ( Address Structure) Khng gian IPv6 c chia trn c s cac bit u trong ia chi. Trng co dai thay i bao gm cac bit u tin trong ia chi goi la Tin t inh dang ( Format Prefix) FP. C ch phn b ia chi nh sau: Phn b D phong Tin t inh dang 0000 0000 Ty l trong khng gian ia chi 1/256
6 Nguyn Bo Anh Mng My Tnh V Truyn Thng K48

Tm hiu v Ipv6

D phong 0000 0001 1/256 D phong cho ia chi NSAP 0000 001 1/128 D phong cho ia chi IPX 0000 010 1/128 Cha cp phat 0000 011 1/128 Cha cp phat 0000 1 1/32 Cha cp phat 0001 1/16 ia chi da trn vi tri ia ly ( 001 1/8 Hin a loai bo) Cha cp phat 101 1/8 Cha cp phat 110 1/8 Cha cp phat 1110 1/16 Cha cp phat 1111 0 1/32 Cha cp phat 1111 10 1/64 Cha cp phat 1111 110 1/128 Cha cp phat 1111 1110 0 1/512 ia chi lin kt cuc b 1111 1110 10 1/1024 ia chi site cuc b 1111 1110 11 1/1024 ia chi multicast 1111 1111 1/256 Hinh 6 : C ch phn b ia chi

7 Nguyn Bo Anh Mng My Tnh V Truyn Thng K48

Tm hiu v Ipv6

1.3.3 Cp phat ia chi IPv6 1.3.3.1 ia chi unicast trn c s ngi cung cp ia chi trn c s ngi cung cp c s dung chung bi 1 host binh thng nh 1 ia chi unicast. inh dang ia chi c din ta nh sau: 128 bits 8 bits Provider Indentifler 010 Registry Subscriber Indentifler Subnet Indentifler Node Indentifler

3 bits

5 bits

Hinh 7: ia chi trn c s ngi cung cp (Provider-based Address) Nhng trng cho ia chi ngi dung trn c s cung cp nh sau : + Chng thc kiu (Type indentifier): Trng 3 bit nay inh nghia nhng ia chi nh la 1 ia chi trn c s ngi cung cp. + Chng thc ng ky (Registry indentifier) : Trng 5 bit nay trinh bay chi nhanh a ng ky ia chi. Hin thi thi co 3 trung tm ia chi c inh nghia: RIPE- NCC (ma 01000): Tai Chu u. INTERNIC (ma 11000): Tai Bc My. APNIC (ma 10100): Tai Chu a - Thai Binh Dng + Chng thc nha cung cp (Provider indentifier): Trng dai tuy bin nay xac nhn nha cung cp (provider) cho truy cp Internet 16 bit dai la khuyn cao i vi trng nay.
8 Nguyn Bo Anh Mng My Tnh V Truyn Thng K48

Tm hiu v Ipv6

+ Chng thc thu bao (Subscriber indentifier): Khi mt t chc t mua Internet dai han thng qua 1 nha cung cp, no c cp phat 1 the nhn dang ngi t mua (Subscriber indentification). 24 bit dai la khuyn cao i vi trng nay. + Chng thc Subnet (Subnet Identifier): Mi subscriber co th co nhiu subnetwork khac nhau, va mi network co th co nhiu chng thc. Chng thc. Chng thc subnet inh nghia mt network cu th di khu vc cua subscriber. 32 bit dai la khuyn cao i vi trng nay. + Chng thc None (None Identifier): trng cui cung inh nghia nhn dang giao im kt ni ti subnet. dai 8 bit la khuyn cao vi trng nay lam no thich hp vi ia chi link 48 bit (Vt ly) c s dung bi Ethernet. Trong tng lai ia chi link nay co le se ging ia chi vt ly node. Chung ta co th nghi v mt ia chi cung cp trung tm nh 1 ng cp chng thc co mt s tin t. Nh nhng gi thy hinh 8, mi tin t inh nghia mt cp bc cua h thng. Kiu tin t inh nghia kiu, tin t inh nghia 1 cach duy nht v nha cung cp bc ng ky, tin t nha cung cp inh nghia 1 cach duy nht v nha cung cp, tin t subnet inh nghia 1 cach duy nht v subscriber, va tin t subnet inh nghia 1 cach duy nht v subnet.
Subnet Subscriber Provider

Provider Subscriber Subnet Node Indentifier indentifier Indentifier indentifier

Hinh 8 : H thng ia chi (Address Hierarchy) 1.3.3.2 ia chi d tr (Reserved Address): Nhng ia chi ma s dung tin t d tr (0000 0000) se c thao lun mt cach ngn gon tai y. + ia chi khng xac inh (Unspecified Address): y la mt ia chi ma phn khng phai tin t chi cha ch s 0. Noi mt cach khac phn con lai cua
9 Nguyn Bo Anh Mng My Tnh V Truyn Thng K48

Tm hiu v Ipv6

ia chi gm toan zero. ia chi nay c s dung khi host khng hiu c ia chi cua chinh no va gi 1 cu hoi thm tim ia chi cua no. Tuy nhin trong cu hoi thm phai inh nghia 1 ia chi ngun. ia chi khng xac inh co th c s dung cho muc ich nay. Chu y la ia chi khng th c s dung lam ia chi ich. ia chi nay c trinh bay trong hinh sau : 8 bit 00000000 Tt ca toan bit 0 120 bit

Hinh 9 : ia chi khng ro (Unspecified Address) + ia chi vong ngc (Loopback Address): y la mt ia chi c s dung bi 1 host kim tra no ma khng cn vao mang. Trong trng hp nay 1 thng ip c tao ra tng ng dung no gi ti tng chuyn tai va i qua tng mang. Tuy nhin thay vi i n mang vt ly no tr lai tng chuyn tai va i qua tng ng dung. ia chi nay rt hu dung cho vic kim tra nhng goi phn mm chc nng trong tng nay trc khi thm chi ca vic kt ni may tinh vao mang. ia chi c m ta trong hinh di y gm co tin t 0000 0000 va theo sau la 119 bit 0 va 1 bit 1. 8 bit 00000000 120 bit 000000000000.00000000000001

Hinh 10 : ia chi vong ngc ( Loopback Address) + ia chi IPv4: Nhng gi chung ta thy c trong sut qua trinh chuyn i t ia chi IPv4 va IPv6, host co th s dung ia chi IPv4 cua no a c nhung vao ia chi IPv6. Co 2 inh dang ia chi c thit k cho muc ich nay: thich ng ( compatible) va hoa (mapped) + ia chi thch ng ( Compatile Address): La mt ia chi cua 96 bit 0 theo sau 32 bit cua ia chi IPv4. ia chi nay c s dung khi 1 may tinh s dung IPv6 mun gi mt thng ip sang 1 may tinh s dung IPv6. Tuy nhin goi tin phai i qua mt min ma o mang vn s dung IPv4. Ngi gi s
10 Nguyn Bo Anh Mng My Tnh V Truyn Thng K48

Tm hiu v Ipv6

dung ia chi thich ng IPv4 lam cho thun tin vic chuyn goi tin qua min s dung IPv4. Thi du: ia chi IPv4 la 2.13.17.14 (inh dang du chm trong h m 10) c chuyn thanh 0::020D:110E (inh dang du 2 chm trong h m 16). ia chi IPv4 c thm 96 bit 0 tao ra ia chi IPv6 128 bit. 8 bit 00000000 88 bit Tt ca toan bit 0 a. ia chi thich ng ia chi IPv6 0::020D:110E 2.13.17.14 b. Chuyn i ia chi ia chi IPv4 32 bit ia chi IPv4

Hinh 11: ia chi tng ng ( Compatible Address) ia chi nh x (Mapped Address): Gm 80 bit 0 theo sau la 16 bit 1 sau na la 32 bit cua ia chi IPv4. ia chi nay c s dung khi 1 may tinh vn s dung IPv4. Goi tin du lich phn ln qua mang IPv6 nhng sau ht c chuyn ti 1 host s dung IPv4. ia chi IPv4 c thm 16 bit 1 va 80 bit 0 tao ia chi IPv6 128 bit.

11 Nguyn Bo Anh Mng My Tnh V Truyn Thng K48

Tm hiu v Ipv6

8 bit 00000000

72 bit Tt ca bit 0

16 bit Tt ca bit 1

32 bit ia chi IPv4

a.ia chi nh x ia chi IPv6 0::020D:110E 2.13.17.14 b. Chuyn i ia chi Hinh 12: ia chi nh x (Mapped Address) Mt iu thu vi v ia chi thich ng va ia chi hoa la chung c thit k bng mt cach ma khi tinh toan checksum chung ta co th s dung hoc ia chi nhung hoc ia chi y u vi nhng bit 0 hoc bit 1 thm vao la bi cua 16, khng co bt ky mt tac ng nao ln vic tinh toan checksum. ia chi nay quan trong vi nu ia chi cua goi tin c chuyn t IPv6 sang IPv4 bi router, vic tinh toan checksum se khng c thc hin. 1.3.3.3 ia chi cuc b ( Local Address) Nhung ia chi ma s dung tin t d tr (1111 1110) se c thao lun mt cach ngn gon tai y. + ia chi link cuc b ( Link local Address): Nhng ia chi nay c s dung khi 1 mang LAN mun s dung giao thc Internet nhng khng kt ni Internet vi ly do an ninh. Kiu ia chi nay s dung tin t 1111 1110 10. a chi link cuc b c s dung trong mang c lp va khng co anh hng chung nao. Khng ai ngoai mang c lp nay co th gi thng ip n nhng may tinh gia nhp 1 mang s dung nhng ia chi nay. ia chi IPv4

12 Nguyn Bo Anh Mng My Tnh V Truyn Thng K48

Tm hiu v Ipv6

10 bit

70 bit

48 bit

11111111010

Tt ca bit 0

ia chi Node

Hinh 13 : ia chi link cuc b ( Link local Address) + ia chi site cuc b (Site Local Address): Nhng ia chi nay c s dung nu nh 1 site co mt s mang s dung giao thc Internet nhng khng kt ni Internet vi nhng ly do an ninh. Kiu ia chi nay s dung tin t 1111 1110 11. ia chi site cuc b c s dung trong mang c lp va khng co anh hng chung nao. Khng ai ngoai mang c lp nay co th gi thng ip n may tinh gia nhp mang s dung nhng ia chi nay. 10 bit 38 bit 32 bit 48 bit

11111111010

Tt ca bit 0

ia chi Subnet

ia chi Node

Hinh 14 : ia chi site cuc b ( Site Local Address) 1.3.3.4 ia chi Multicast - ia chi multicast c s dung inh nghia cho mt nhom cac host thay vi chi 1. Tt ca u s dung tin t 1111 1111 trong trng u tin. Trng th hai la c (flag) inh nghia 1 nhom ia chi hoc c inh hoc tam thi. Mt nhom ia chi c inh c inh nghia bi nha cm quyn Internet va co th truy cp bt c luc nao. Mt nhom ia chi tam thi, noi mt cach khac c s dung mt cach tam thi. H thng tham d vao mt hi nghi t xa co th s dung mt nhom tam thi. Trng th 3 inh nghia pham vi hoat ng cua nhom ia chi. Nhiu pham vi a c inh nghia.

13 Nguyn Bo Anh Mng My Tnh V Truyn Thng K48

Tm hiu v Ipv6

8 bit 11111111 C

4 bit

4 bit Pham vi ID nhom

112 bit

0000 Danh trc 0001 Node cuc b 0010 Link cuc b 0101 Site cuc b 1000 T chc cuc b 1110 Chung 1111 Danh ring

Hinh 15 : ia chi Multicast (multicast address) 1.3.4 inh dang goi tin trong IPv6 Goi tin trong IPv6 c thy nh trong hinh di y. Mi goi tin bao gm mt vung header nn tang bt buc theo sau bi payload. Payload gm co 2 phn: nhng vung Header m rng tuy y chon va d liu t tng cao hn. Vung Header nn tang chim gi 40 byte, trong khi o nhng vung Header m rng va d liu t tng cao hn cha n 65535 byte thng tin.

14 Nguyn Bo Anh Mng My Tnh V Truyn Thng K48

Tm hiu v Ipv6

40 byte u muc nn tang

Co th ln n 65535 byte Payload

u muc m rng Goi d liu t tng cao (tuy y la chon) hn

Hinh 16 : inh dang goi tin IPv6 (IPv6 Data Packet Format) 1.3.4.1 Vung nn tang ( Base Header) Vung header nn tang trong hinh 17 cho ta thy no co 8 trng, nhng trng nay m ta nh sau: VER PRI Flow lable Vung Header Gii k tip nhay han

dai Payload Nhng ia chi ngun Nhng ia chi ich Nhng u muc m rng Payload +
Goi d liu t tng cao hn

Hinh 17 : inh dang cua 1 n vi d liu IPv6 ( Format of an IPv6 datagram) + Phin ban (VER- version): Trng 4 bit nay inh nghia s phin ban cua IP. Vi IPv6 gia tri la 6. + Quyn u tin (PRI- priority): Trng 4 bit nay inh nghia s u tin cua nhng goi tin i vi s tc nghen giao thng.
15 Nguyn Bo Anh Mng My Tnh V Truyn Thng K48

Tm hiu v Ipv6

+ Nhan lu lng (Flow label): Nhan lu lng la mt trng 3 byte 24 bit c thit k cung cp s iu khin c bit i vi nhng lu lng c bit cua d liu. + dai Payload (Payload Length): Trng dai Payload 2 byte nay c inh nghia dai tng cng cua n vi d liu IP tr vung Header nn tang. + Vung Header k tip (Next Header): Vung Header k tip la 1 trng 8 bit inh nghia 1 u muc ma theo sau vung Header nn tang trong n vi d liu. Vung header k tip la 1 trong nhng vung m rng tuy y la chon c s dung bi IP hoc vung Header cho 1 giao thc tng cao hn nh UDP hay TCP. Mi vung Header m rng lai co cha trng nay. Bang sau cho chung ta thy nhng gia tri cua vung Header k tip. Ma s 0 2 6 17 43 44 50 51 59 60 Vung Header k tip Tuy chon nhay tng bc mt ICMP TCP UDP Routing ngun S phn ming Payload bao mt ma hoa S chng thc Trng ( Khng vung Header k tip) Tuy chon ich

Gii han nhay ( Hot Limit): Trng gii han nhay 8 bit nay phuc vu cho muc ich tng t trng TTL trong IPv4. ia chi ngun ( Source Address): Trng ia chi ngun la 1 ia chi Internet 16 byte (128 bit) ma xac minh ngun ban gc cua n vi d liu ia chi ich ( Destination Address): Trng ia chi ich la 1 ia chi Internet 16 byte ( 128 bit) ma thng xac minh ich cui cung cua n vi d liu. Tuy nhin nu router ngun c s dung thi trng nay se cha ia chi cua router k tip. + Quyn u tin (Priority): Trng quyn u tin cua goi tin IPv6 inh nghia quyn u tin cua tng goi tin co quan h vi nhng goi tin khac trong cung 1 ngun. Vi du khi 1 trong 2 n vi d liu lin tip phai bi loai bo i vi cht chi, n vi d liu co quyn u tin nho hn se bi loai bo. IPv6 chia giao thng (traffic) lam 2 loai: iu khin tc nghen (congestion- controlled) va iu khin khng tc nghen (nocongestion- controlled).
16 Nguyn Bo Anh Mng My Tnh V Truyn Thng K48

Tm hiu v Ipv6

Giao thng iu khin tc nghen ( congestion- controlled traffic): Nu 1 ngun t iu chinh giao thng chm lai khi co tc nghen, giao thng se gan cho giao thng iu khin tc nghen. Vi du nh giao thc TCP s dung giao thc ca s trt (Sliding window protocol), co th d dang ap ng giao thng. Trong giao thng iu khin tc nghen no c hiu la nhng goi tin co th n chm hoc thm chi mt hoc c nhn ngoai yu cu. D liu iu khin tc nghen c cp phat quyn u tin t 0 n 7 c th hin bang sau: Quyn u tin 0 1 2 3 4 5 6 7 M ta Khng co giao thng cu th D liu nn Giao thng d liu khng c quan tm D tr Giao thng d liu tham d khi li D tr Giao thng tng giao Giao thng iu khin

Co th m ta quyn u tin nh sau: Khng co giao thng cu th ( No specific traffic): quyn u tin 0 c cp phat cho goi tin khi tin trinh khng inh nghia 1 u tin nao. D liu nn (Background data): nhom nay (quyn u tin 1) inh nghia dl iu thng xuyn c nhn nn. S nhn tin tc la 1 vi du. Giao thng d liu khng c quan tm (unattended data tranffic): Nu ngi s dung ang khng i d liu se c nhn, goi tin se c quyn u tin 2. Email thuc nhom nay. Mt ngi s dung gi email cho ngi s dung khac, nhng ngi nhn khng bit email o se n sm. Thm vao email thng c lu tr trc khi c gi i. Giao thng d liu tham d khi ln ( Attended bulk data tranffi): Giao thc ma chuyn phn ln d liu khi ngi s dung ang i nhn d liu (co th tri hoan) c quyn u tin 4. FTP va HTTP thuc nhom nay. Giao thng tng giao (Interactive traffic): Giao thc dang nh TELNET cn s tng giao vi ngi s dung cp s tng giao vi ngi s dung c cp u tin cao th 2 (6) trong nhom. Giao thng iu khin (Control traffic): Giao thng diu khin c quyn u tin cao nht (7) trong loai nay. Giao thc routing nh OSPF va RIP va giao thc quan tri SNMP s dung quyn u tin nay. Giao thng iu khin khng tc nghen ( Noncongestioncontrolled tranffic): Kiu nay gan cho kiu giao thng ma ch i mt s
17 Nguyn Bo Anh Mng My Tnh V Truyn Thng K48

Tm hiu v Ipv6

haon lai nho nht. Loai bo goi tin khng phai la tt. S chuyn giao lai trong hu ht tinh hung la co th hti hanh c. Noi 1 cach khac ngun khng sa lai no thich nghi vi s tc nghen. Audio va video thi gian thc la nhng vi du in hinh cho dang giao thng nay. Quyn u tin t 8 n 15 c cp phat cho giao thng iu khin khng tc nghen. Mc du y khng co bat ky mt s cp phat chun c bit nao cho loai d liu nay, quyn u tin thng c cp phat d vao s lng cau d liu nhn co th bi tac ng bi vic loai bo goi tin. D liu cha it s rm ra (nh audio va video cht lng thp) co th c a 1 quyn u tin cao hn (15). D liu cha nhiu s rm ra (nh video va audio cht lng cao) co th bi a 1 quyn u tin thp hn (8). Quyn u tin 8 . . . 15 M ta D liu vi nhiu s rm ra nht

D liu vi it s rm ra nht

+ Nhan lu lng ( Flow Label): Mt day cac goi tin c gi t 1 ngun ring n ich ring, cn s iu khin c bit t router goi la lu lng cua nhng goi tin. S kt hp cua ia chi ngun va gia tri cua nhan lu lng inh nghia 1 cach duy nht 1 lu lng cua nhng goi tin. i vi router 1 lu lng la 1 day cac goi tin chia se cung c tinh nh la vic di chuyn cung 1 ng, s dung cung mt ngun, co cung kiu an toan vv Mt router ma h tr s iu khin cua nhan lu lng co 1 bang nhan lu lng. Bang nay co 1 muc vao cho mi nhan lu lng hoat ng, mi muc inh nghia 1 dich vu c yu cu bi nhan lu lng tng ng. Khi router nhn c 1 goi tin no tra cu bang nhan lu lng cua no tim muc vao tng ng cho gia tri nhan lu lng c inh nghia trong goi tin. Sau o no cung cp cho goi tin nhng dich vu a cp trong muc vao. Tuy nhin chu y la nhan lu lng t no khng cung cp thng tin cho nhng muc vao cua bang nhan lu lng, thng tin c cung cp bi nhng th khac nh la tuy chon nhay tng bc mt hay nhng giao thc khac. Trong hinh thc n gian nht cua no, 1 nhan lu lng co th c s dung tng tc 1 tin trinh cua 1 goi tin bi 1 router. Khi router nhn c goi tin thay vi xem bang tim ng va i n thut toan tim ng inh nghia ia chi cau bc nhay k tip, no co th d dang c nhin thy trong 1 bang nhan lu lng cho bc nhay k tip.
18 Nguyn Bo Anh Mng My Tnh V Truyn Thng K48

Tm hiu v Ipv6

Trong hinh thc rc ri hn cua no 1 nhan lu lng co th c s dung h tr qua trinh chuyn giao audio va video thi gian thc. Audio va video thi gian thc mt cach c bit trong hinh thc ki thut s oi hoi nhng ngun nh bng thng rng, buffer ln, thi gian tin trinh dai vv Mt tin trinh co th t trc ch cho nhng ngun nay trc am bao la d liu thi gian thc se khng bi tam hoan do thiu ngun. S s dung d liu thi gian thc va ch t trc cua nhng ngun oi hoi nhng giao thc khac nh la giao thc thi gian thc ( Real- Time Protocol- RTP) hay giao thc t trc ngun (Resource Reservation Protocol- RRP) trong b sung cua IPv6. cho phep nhng hiu qua s dung cua nhan lu lng 3 iu lut c a ra : Nhan lu lng c cp phat cho 1 goi tin bi 1 host gc. Nhan la mt s bt ki t 1 n 2 24 -1. No se khng s dung lai mt nhan lu lng cho 1 lu lng mi khi lng dang tn tai vn hoat ng. Nu nh 1 host khng h tr nhan lu lng, no se t trng nay la 0. Nu nh 1 router khng h tr nhan lu lng, no n gian se pht l i . Tt ca nhng goi tin thuc cung 1 lu lng co th co cung ngun, cung ich, cung s u tin va cung nhng tuy chon. 1.3.4.2 So sanh gia vung header cua IPv4 va IPv6 Trng dai vung header a bi loai i trong IPv6 vi dai vung header a c x ly trong phin ban nay. Trng kiu dich vu a bi loai i trong IPv6. Trng quyn u tin va nhan lu lng cung kim soat chc nng cua trng kiu dich vu. Trng dai tng cng a bi loai i trong IPv6 va c thay th bng trng dai payload. Nhng Trng chng thc ( identification ), Trng c ( flag ), va nhng Trng offset a bi loai bo t vung header nn tang trong IPv6. Chung c i kem trong vunh header m rng tng ming. Trng TTL c goi la Gii han nhay trong IPv6. Trng giao thc dc thay th bi Trng vung header k tip. Vung header checksum bi loai i vi checksum c cung cp bi giao thc cua tng cao hn no vi th khng cn thit y. Nhng Trng tuy chon trong IPv4 c trang bi nh nhng vung header m rng trong IPv6. 1.3.5 Vung header m rng dai cua vung header c b tri 40 byte. Tuy nhin, em n nhiu chc nng hn cho n vi d liu IP vung header nn tang co th cho theo sau n 6 vung header m rng. Nhiu vung header nay la nhng tuy chon trong IPv4.
19 Nguyn Bo Anh Mng My Tnh V Truyn Thng K48

Tm hiu v Ipv6

VER

PRI

Flow label Vung Header k tip Gii han nhay

dai Payload ia chi ngun ia chi ich

Hinh 18 : inh dang vung header m rng ( Extenion header format ) Sau loai vung header a c inh nghia. Chung la tuy chon nhay tng bc, l trinh ngun, s phn manh, s chng thc, Payload bao mt ma hoa va tuy chon ich (Xem hnh 19).

20 Nguyn Bo Anh Mng My Tnh V Truyn Thng K48

Tm hiu v Ipv6

Tuy chon nhay tng bc Ngun tim ng S phn ming Nhng vung Header m rng S chng thc Bao mt Payload ma hoa Tuy chon ich

Hinh 19 : Nhng loai vung header m rng (Extension header types) 1.3.5.1 Tuy chon nhay tng bc (Hopbyhop option) Tuy chon nhay tng bc c s dung khi ngun cn chuyn thng tin qua tt ca cac router c thm bi n vi d liu. Vi du, khng chng nhng router se phai bi gy ra bi s quan tri, s g ri hay nhng chc nng iu khin nao o.Hay,nu nh dai cua n vi d liu rng hn thng thng la 65,535 byte, nhng router phai co thng tin nay. Hinh 20 cho thy inh dang cua vung header k tip trong mt chui vung header. dai vung header inh nghia s byte trong vung headerbao gm ca trng vung header k tip). Phn con lai cua vung header cha nhng tuy chon khac nhau. Vung header nn tang Vung header k tip dai vung header Nhng tuy chon
Phn con lai cua Payload

Hinh 20 : inh dang vung header tuy chn nhay tng bc (Hop by hop option header format)

21 Nguyn Bo Anh Mng My Tnh V Truyn Thng K48

Tm hiu v Ipv6

Xa hn, chi co 3 tuy chon c inh nghia: Pad1, PadN va jumbo payload (Xem hinh 21). Ma s (8 bit) dai (8 bit) D liu ( dai co th thay i)

Hanh

Kiu

2 bit 1 bit 5 bit Hanh ng : se thc hin nu tuy chon khng c xac nhn 00 Bo qua tuy chon Kiu 01 Loai bo n vi d liu khng co hanh ng nao na 00000 Pal1 10 Loai bo n vi d liu va gi 1 thng ip li 00001 PadN 11 Nh ma 10, nhng nu ich khng phai ia chi munlticast C: (change) gia tri thay i tuy chon 00010 jumbo payload 0 : khng bi thay i trong vn chuyn 1 : Co th bi thay i trong vn chuyn Hinh 21 : inh dang cua nhng tuy chon cua vung header tuy chon nhay tng bc (Format of options in a hopbyhop option header) Pad1: Tuy chon nay dai 1 byte va no c thit k cho nhng muc ich sp nhom. Mt s tuy chon cn phai bt u 1 bit ring bit trong 32 bit (xem m ta jumbo payload). Nu mt tuy chon cua s yu cu nay rt chinh xac la 1 byte, Pad1 se c thm vao lam nn s khac bit. Pad1 khng cha trng dai tuy chon ma con khng ca cha trng d liu tuy chon. No gm co duy nht trng ma tuy chon vi tt ca cac bit c t la 0 ( hanh ng la 00, C la kiu 00000). Pad1 co th c chen vao bt ky ch nao trong vung header tuy chon nhay tng bc.

22 Nguyn Bo Anh Mng My Tnh V Truyn Thng K48

Tm hiu v Ipv6

Ma 00000000 ~ Nhng tuy chon Pad1 ~ a. Pad1 b. S dung lam m Hinh 22 : Pad1 PadN: PadN ging Pad1 v y tng. S khac nhau la PadN c s dung khi 2 hay nhiu bit c cn cho vic sp nhom. Tuy chon nay gm co 1 byte ma tuy chon, 1 byte dai tuy chon, va mt bin s nhng s 0 lam byte m. Gia tri cua ma tuy chon la 1 (hanh ng la 00, C la 0 va kiu la 00001). dai tuy chon cha s byte m. D liu

Ma 00000001 1 byte

dai Tt ca bit 0 1 byte

D liu s byte co th thay i

Hinh 24: Jumbo Payload 1.3.5.2 L trinh ngun (Source Routing) Vung header m rng l trinh ngun kt hp vi y tng cua nhng tuy chon l trinh ngun chinh xac va l trinh ngun khng chinh xac cua IPv4. Vung header l trinh ngun cha mt s nho nht cua 7 trng. Hai trng u tin, vung header k tip va dai vung header, la ung vi vung header m rng nhay tng bc. Trng kiu inh nghia l trinh la chinh xac hoc khng chinh xac. Trng nhng ia chi con lai chi ra s bc nhay cn ti ich. Trng mt na tuyt i/ tng i xac inh s chc chn cua l trinh. Nu mt na la tuyt i, l
23 Nguyn Bo Anh Mng My Tnh V Truyn Thng K48

Tm hiu v Ipv6

trinh phai theo chinh xac nhng gi c chi ra bi ngun. Nu thay vao mt na tng i nhng router khac co th thm vao trong vung header. Vung header nn tang Vung header k dai vung Kiu D tr Mt na tuyt i/ tng i ia chi th nht ia chi th hai ia chi cui cung Phn con lai cua Payload

Nhng ia chi

Hinh 25 : L trinh ngun (Source Routing) ia chi ich trong l trinh ngun khng tun theo s inh nghia trc o cua chung ta (ia chi cui cung trong n vi d liu). Thay vao o no thay i t router sang router. Thi du : Host mun gi ti 1 n vi d liu sang host B s dung 1 l trinh ring: A n R1 n R2 n R3 n B. Chu y la ia chi ich nm trong nhng vung header nn tang. No khng lin tip nh ban mong i. Thay vao o no thay i theo tng router. Nhng ia chi trong vung header m rng cung thay i theo tng router. Ngun: A ich: R1 Con lai: 3 R2 R3 B A B R1
Nguyn Bo Anh Mng My Tnh V Truyn Thng K48

R3

R3

Ngun: A ich: R1 Con lai: 3 R2 R3 B Ngun: A ich: R1 Con lai: 3 R2 R3 B Ngun: A ich: R1 Con lai: 3 R2 R3 B

24

Tm hiu v Ipv6

1.3.5.3 S phn ming ( Fragmentation) Y tng v s phn ming nh trong IPv4. Tuy nhin ni ma s phn ming chim gi khng ging nhau. IPv4 ngun hoc router cn phn ming nu c cua n vi d liu ln hn MTU cua mang vi nhom n ci d liu se c a i. IPv6 chi nhng ngun nguyn thuy mi c phn ming. Mt ngun phai s dung 1 ky thut kham pha quy ao MTU (Path MTU Discovery) tim MTU nho nht c h tr bi bt ky mt mang nao trong quy ao. Ngun sau o phn ming s kham phat nay. Nu ngun khng s dung ky thut kham pha quy ao MTU no co th phn ming n vi d liu thanh nhng ming c 576 byte hoc nho hn. y la c nho nht MTU yu cu cho mi mang kt ni vao Internet. Hinh di y cho ta thy inh dang cua vung header m rng s phn ming:

Vung Header nn tang Vung header k dai tip header ia chi th nht Phn con lai cua Payload Hinh 27 : S phn ming (Fragmentation) 1.3.5.4 S chng thc (Authentication) Vung header m rng s chng thc co mt muc ich kep: no lam cho thng ip gi co gia tri va am bao s nguyn ven cua d liu. u tin cn ngi nhn co th chc chn la t ngi gi tht va khng phai la t 1 ke mao danh. iu cui cung cn kim tra la d liu khng bi thay i trong vn chuyn bi hacker. inh dang cua vung Header m rng s chng thc c trinh bay hinh 28 . Trng chi muc tham gia s bao mt inh nghia thun toan c s dung cho s chng thc. Trng chng thc cha d liu cha nhng d liu tht c sinh ra bi thut toan. vung S phn ming bu p 0 M

25 Nguyn Bo Anh Mng My Tnh V Truyn Thng K48

Tm hiu v Ipv6

Vung Header nn tang Chi muc tham s bao mt S chng thc d liu

Phn con lai cua Payload


Hinh 28 : S chng thc (Authentication) Nhiu thut toan khac nhau co th c s dung cho s chng thc. Hinh 29 phac hoa nhng phng thc tinh toan trng chng thc d liu.

Khoa bao mt 128 bit

n vi d liu IP vi nhng trng s thay i va s chng thc c t la 0


Khoa bao mt 128 bit

Thut toan s chng thc

S chng thc d liu 128 bit


26 Nguyn Bo Anh Mng My Tnh V Truyn Thng K48

Tm hiu v Ipv6

Hinh 29 : S tinh toan cua s chng thc d liu (Calculation Of Authentication Data) Ngi gi i qua khoa bao mt 128 bit, toan b n vi d liu IP va khoa bao mt 128 bit ln na n thut toan. Nhng trng nay trong n vi d liu vi nhng gia tri co thay i trong qua trinh vn chuyn (Vi du nh bc nhay) se c t la 0. n vi d liu qua c thut toan se cha vung header s chng thc, vi trng s chng thc d liu c t la 0. Thut toan tao ra s chng thc d liu vi nhng th a c a vao trong vung header m rng trc khi ti qua trinh vn chuyn n vi d liu. Nhng chc nng ngi nhn trong 1 phng phap tng t. No nhn mang i khoa bao mt va nhn ly n vi d liu ( ln na vi nhng trng thay i c t la 0) va i qua chung n thut toan s chng thc. Nu kt qua ging s chng thc d liu, n vi d liu c chng thc nu khng chung se bi loai. 1.3.5.5 Payload bao mt ma hoa (Encrypted Secutity Payload - ESP) Payload bo mt ma hoa la phn m rng ma cung cp mt cach tin nhim va bao v chng lai s nghe len. Hinh 30 trinh bay s inh dang. Trng chi muc tham s bao mt 32 bit inh nghia kiu ma hoa / khng ma hoa c s dung.

Vung Header nn tang Chi muc tham s bao mt


D liu ma hoa

Hinh 30 : Payload bao mt ma hoa Trng khac cha nhng d liu ang ma hoa vi bt ky nhng tham s thm nao c cn bi thut toan. S ma hoa co th c trang bi trong 2 cach : Mode vn chuyn (Transport Mode): Trong mode vn chuyn mt TCP hay n vi d liu ngi s dung UDP la cai u tin c ma hoa va c goi vao trong 1 goi IPv6. S ma hoa trong mode vn chuyn c s dung a s ma hoa d liu t host sang host.
27 Nguyn Bo Anh Mng My Tnh V Truyn Thng K48

Tm hiu v Ipv6

Vung header nn tang va nhng vung header khac Chi muc D liu th S ma hoa D kiu ma hoa

Hinh 31 : S ma hoa mode vn chuyn (Transport Mode Encryption)


Mode tunnel (Tunnel Mode): Trong mode tunnel toan b d liu IP vi

nhng vung Header nn tang cua no va nhng vung Header m rng c ma hoa va goi vao trong 1 goi IP mi s dung vung Header m rng Paylaod bao mt ma hoa. Noi cach khac chung ta co 2 vung Header nn tang: 1 a ma hoa, 1 cha ma hoa. Tuy chon ich (Destination Option): Tuy chon ich c s dung khi ngun chi cn chuyn thng tin n ich. Nhng router khng ngay lp tc trao quyn truy cp cho nhng thng tin nay. inh dang cua tuy chon ich tng t nh tuy chon nhay tng bc. Xa hn chi co Pad1 va PadN c inh nghia. So sanh gia IPv4 va IPv6: Chung ta hay thc hin mt s s so sanh gia nhng vung Header m rng cua IPv4 va IPv6: Tuy chon khng hoat ng (no-operetion) va kt thuc tuy chon ( end- of - option) trong IPv4 c thay bng Pad1 va PadN trong IPv6. Tuy chon ban ghi tim ng khng c trang bi trong IPv6 vi no khng c s dung. Tuy chon ten thi gian (timestamp) khng c trang bi vi no khng c s dung. Tuy chon ngun tim ng (source route) c goi la vung Header m rng tuy chon ngun tim ng trong IPv6.
1.3.5.6 28 Nguyn Bo Anh Mng My Tnh V Truyn Thng K48

Tm hiu v Ipv6

Nhng trng s phn ming (fragmentation) trong khu vc vung Header nen tang cua IPv4 c chuyn n vung Header m rng tuy chon s phn ming cua IPv6. Vung Header s chng thc la mi trong IPv6. Vung Header m rng Payload bao mt ma hoa la mi trong IPv6.

29 Nguyn Bo Anh Mng My Tnh V Truyn Thng K48

Tm hiu v Ipv6

CHNG 2 : S chuyn tip t IPv4 ti IPv6


2.1.t vn : - Giao thc IPv6 co nhiu u im vt tri so vi IPv4, ap ng c nhu cu phat trin cua mang Internet hin tai va trong tng lai. Do o, giao thc IPv6 se thay th IPv4. Tuy nhin, khng th chuyn i toan b cac nut mang IPv4 hin nay sang IPv6 trong mt thi gian ngn. Hn na, nhiu ng dung mang hin taicha h tr IPv6. Theo d bao cua t chc ISOC, IPv6 se thay th IPv4 vao khoang 2020- 2030. Vi vy, cn co mt qua trinh chuyn i gia hai giao thc tranh hin tng tng t nh s c Y2K. Cac c ch chuyn i (Transition mechanism) phai am bao kha nng tng tac gia cac tram, cac ng dung IPv4 hin co vi cac tram va ng dung IPv6. Ngoai ra, cac c ch cung cho phep chuyn tip cac lung thng tin IPv6 trn ha tng inh tuyn hin co. Trong giai oan chuyn i, iu quan trong la phai am bao s hoat ng binh thng cua mang IPv4 hin tai. Yu cu i vi cac c ch chuyn i: + Vic th nhim IPv6 khng anh hng n cac mang IPv4 hin ang hoat ng. + Kt ni va cac dich vu IPv4 tip tuc hoat ng binh thng. + Hiu nng hoat ng cua mang IPv4 khng bi anh hng. Giao thc IPv6 chi tac ng n cac mang th nghim. + Qua trinh chuyn i din ra tng bc. Khng nht thit phai chuyn i toan b cac nut mang sang giao thc mi. - Cac c ch chuyn i c phn thanh 2 nhom vi hai chc nng khac nhau: + Kt ni cac mang va cac nut mang IPv6 qua ha tng inh tuyn IPv4 hin co. Cac c ch nay bao gm: ng hm (tunnel), 6to4, 6over4. + Kt ni cac nut mang IPv4 vi cac nut mang IPv6. Cac c ch nay bao gm: SIIT, NAT- PT, ALG, DSTM, BIS, BIA, SOCK64. - Mi c ch u co u, nhc im va pham vi ap dung khac nhau. Tuy tng thi im trong giai oan chuyn i, mc s dung cua cac c ch chuyn i se khac nhau. + Giai oan u: Giao thc IPv4 chim u th. Cac mang IPv6 kt ni vi nhau trn nn ha tng IPv4 hin co thng qua cac ng hm IPv6 qua IPv4. + Giai oan gia: Giao thc IPv4 va IPv6 c trin khai v pham vi ngang nhau trn mang. Cac mang IPv6 kt ni vi nhau qua ha tng inh tuyn
30 Nguyn Bo Anh Mng My Tnh V Truyn Thng K48

Tm hiu v Ipv6

IPv6. Cac mang IPv4 kt ni vi cac mang IPv6 s dung cac phng phap chuyn i ia chi giao thc nh NAT- PT, ALG +Giai oan cui: Giao thc IPv6 chim u th. Cac mang IPv4 con lai kt ni vi nhau trn ha tng inh tuyn IPv6 thng qua cac ng hm IPv4 qua IPv6 khi chuyn hoan toan sang IPv6. 2.2. Cac phng thc chuyn i: 2.2.1. Chng hai giao thc (Dual Stack) - y la c ch n gian nht cho phep nut mang ng thi h tr ca hai giao thc IPv6 va IPv4. Co c kha nng trn do mt tram Dual Stack caI t ca hai giao thc, IPv4 va IPv6. Tram Dual Stack se giao tip bng giao thc IPv4 vi cac tram IPv4 va bng giao thc IPv6 vi cac tram IPv6. Application

TCP

UDP

Ipv4

Ipv6

Data link (Ethernet) Hinh 48. Chng hai giao thc - Do hoat ng vi ca hai giao thc, nut mang kiu nay cn it nht mt ia chi IPv4 va mt ia chi IPv6. ia chi IPv4 co th c cu hinh trc tip hoc thng qua c ch DHCP. ia chi IPv6 c cu hinh trc tip hoc thng qua kh nng t cu hinh ia chi. - Nut mang h tr cac ng dung vi ca hai giao thc. Chng trinh tra cu tn min co th tra cu ng thi ca cac truy vn kiu A ln kiu AAAA(A6). Nu kt qua tra v la ban ghi kiu A, ng dung se s dung giao thc IPv4. Nu kt qua tra v la ban ghi AAAA(A6), ng dung se s dung giao thc IPv6. Nu ca hai kt qua tra v, chng trinh se la chon tra v cho ng dung mt trong hai kiu ia chi hoc ca hai.
31 Nguyn Bo Anh Mng My Tnh V Truyn Thng K48

Tm hiu v Ipv6

- u im: + y la c ch c ban nht nut mang co th hoat ng ng thi vi ca hai giao th do o, no c h tr trn nhiu nn tang khac nhau nh FreeBSD, Linux, Windows va Solaris. + Cho phep duy tri cac kt ni bng ca hai giao thc IPv4 va IPv6. Nhc im: + Kha nng m rng kem vi phaI s dung ia chi IPv4. 2.2.2. ng hm IPv6 qua IPv4 (Tunnel) - ng hm cho phep kt ni cac nut mang IPv6 qua ha tng inh tuyn IPv4 hin co. Cac tram va cac router IPv6 thc hin bng cach ong cac goi tin IPv6 bn rong goi tin IPv4.Co 4 cach thc hin ng hm: + ng hm t router dn router. + ng hm t tram n router. + ng hm t tram n tram + ng hm t router n tram.

host

Ipv4

host

Hinh 49. ng hm Ipv6 qua Ipv4 - Cac cach thc hin ng hm khac nhau vi tri cua ng hm trong tuyn ng gia hai nut mang. Trong hai cach u, goi tin c inh ng hm ti mt router trung gian sau o, router nay se chuyn tip goi tin n ich. Vi hai cach sau, goi tin c inh ng hm thng ti ia chi ich. - thc hin ng hm, hai im u ng hm phai la cac nut mang h tr ca hai giao thc. Khi cn chuyn tip mt goi tin IPv6, im u ng hm se ong goi goi tin trong mt goi tin IPv4 bng cac thm phn m u header IPv4 phu hp.

32 Nguyn Bo Anh Mng My Tnh V Truyn Thng K48

Tm hiu v Ipv6

- Khi goi tin IPv4 n im cui ng hm, goi tin IPv6 se c tach ra x ly tuy theo kiu ng hm.
IPv6 header Data

Goi tin ban u:


IPv4 header IPv6 header Data

Goi tin ng hm:


IPv6 header Data

Goi tin ra klhoi ng hm - Co hai loai ng hm chinh la ng hm co cu hinh va ng hm t ng. 2.2.2.1. ng hm co cu hinh (Configured tunnel) - c im cua ng hm co cu hinh la ia chi im cui ng hm khng c xac inh t ng ma da trn nhng thng tin cu hinh trc tai im u ng hm.

33 Nguyn Bo Anh Mng My Tnh V Truyn Thng K48

Tm hiu v Ipv6
3ff:b00:a:1::1 11 192.168.1. 1 192.168.2. 1 3ffe:b00:a:: 3::2

IPv 66

IPv4

IPv 4

IPv6 IPv6 Header Data header Src=3ffe:b00:a:1:: 1 Dst=3ffe:b00:a:3:: 2

IPv4 IPv6 Header header

IPv6 data

IPv6 Header

IPv6 data

Src=192.168.1.1 Dst=192.168.2.1

Hinh 50: ng hm co cu hinh. 2.2.2.2 ng hm t ng (Automatic tunnel) - c im cua ng hm t ng la ia chi im cui ng hm c xac inh mt cach t ng. ng hm c tao ra mt cach t ng va cung t ng mt i. M hinh u tin la dung ia chi IPv6 co khun dang c bit: ia chi IPv6 tng thich IPv4 ma hoa thng tin v ia chi IPv4 trong ia chi IPv6.
96 bit 32 bit

0:0:0:0:0:0:

IPv4 ADDR

Hinh 51: ia chi IPv6 tng thich ia chi IPv4 - Tai im u ng hm, nut mang ong goi se tach phn ia chi IPv4 lam ia chi im cui ng hm ong goi goi tin. u im: + ng hm t ng n gian, cho phep hai nut mang IPv6 d dang kt ni vi nhau qua kt ni IPv4 hin co ma khng cn cac cu hinh c bit.
34 Nguyn Bo Anh Mng My Tnh V Truyn Thng K48

Tm hiu v Ipv6

Nhc im: + Han ch v khng gian ia chi do phu thuc vao khng gian ia chi IPv4. + Nguy c bi tn cng pha hoai bi cac tin tc. - Do ia chi cui ng hm c xac inh hoan toan t ng va goi tin ng hm se c gi n ia chi IPv4 o. Nu khng co c ch kim tra c bit, gia s co mt goi tin c gii den router cua mang (203.162.7.0) vi ia chi IPv6 ich ::203.162.7.255. ia chi IPv4: 203.162.7.255 la ia chi broadcast cua mang do o, cac goi tin ng hm se c gi ti moi tram trong mang. - Do o, cac ng hm t ng thng c han ch s dung. Sau nay ngi ta xut mt s phng phap cai tin nh 6over, 6to4 2.2.3 6over4 C ch cho phep cac tram IPv6 c lp trn cac lin kt vt ly khng co cac router IPv6 hoat ng da trn cac goi tin multicast IPv4 nh mt lin kt cuc b ao. C ch nay con goi la mang Ethernet ao. h tr cac c ch Phat hin lang ging va t cu hinh ia chi stateless, mt s cac ia chi co pham vi quan tri c s dung. Cac nhom multicas gia lp mt tng lin kt Ethernet. Do o, c ch phat hin lang ging (ND) gia cac tram IPv6 vi cac tram 6over4 ging nh trong tng Ethernet thng thng. Cach tip cn nay tao ra lin kt IPv6 tht trn mt mang LAN ao. im khac bit la cac tram 6over4 vao cung mt min IPv4 multicast thay vi mt mang chia se ng truyn.

IPv6

IPv6 over IPv4

IPv4

Hinh 52. 6over4 - Vic anh xa ia chi IPv6 sang ia chi tng lin kt c thc hin ging
35 Nguyn Bo Anh Mng My Tnh V Truyn Thng K48

Tm hiu v Ipv6

giao thc ND. Trong trng hp nay, tuy chon ia chi tng lin kt ngun/ich s dung IPv4 lam tng lin kt. Do o, toan b mang IPv4 c coi nh mt tng lin kt chia se ng truyn thng qua vic s dung cac ia chi multicast sau y: +ia chi multicast tt ca cac nut mang (239.X.0.1): ia chi quan tri nay c dung n moi nut mang trong min IPv4 h tr c ch nay. + ia chi multicast tt ca cac rouuter (239.X.0.2): ia chi quan tri nay c dung n moi router trong min IPv4 h tr c ch nay. + ia chi multicast solicited-node (239.X.C.D): ia chi quan tri nay c dung xac inh ia chi nut lang ging (C va D la hai byte thp trong ia chi IPv4). - Trong t ca cac ia chi nay, X chi inh danh cuc b lin kt (thng bng 192). - S dung tng IPv4 lam tng lin kt loai bo ca han ch cua tng vt ly i vi k hoach chuyn i. Cac tram co th trai trn nhiu min va thm chi cach nhiu bc so vi router IPv6. - Cac tram 6over4 nhn cu hinh (ia chi lin kt cuc b va tin t, ia chi IPv4 cua router h tr IPv6) s dung giao thc ND trn cac ia chi multicast IPv4. - Sau o cac goi d liu IPv6 c gi trong cac goi d liu IPv4 vi kiu giao thc 41. Chinh cac tram se thc hin ng hm. - u im: + Cac tram IPv6 khng oi hoi co ia chi tng thich hay ng hm cu hinh. Chinh cac tram se thc hin ng hm. Kin truc c s bao gm mt router vi kt ni IPv6 va h tr 6over4, mt mang co kha nng multicast kt ni cac tram va router. Trong mi trng o, cac tram 6over4 co th kt ni vi cac tram IPv6 khac. + Co tinh m rng nh IPv6 trn hu ht cac phng tin truyn. - Nhc im: + Suy giam MTU cua goi tin dn n giam thng lng. + Trong qua trinh chuyn i, cac router phai quang ba it nht hai tin t IPv6, mt cho lin kt LAN thc s va mt cho min 6over4. Ngoai ra, dai tin t phai la 128 phn bit hai loai tin t cung co kieu FE80::/64. 2.2.4 6to4 - 6to4 v ban cht la mt c ch ng hm t ng cho phep kt ni cac mang IPv6 vi nhau thng qua ha tng IPv4 ngn cach. C ch nay c cai t tai cac router bin cua mang. Cac router nay phai co ia chi IPv4 toan cuc co th inh tuyn c trn mang Internet.
36 Nguyn Bo Anh Mng My Tnh V Truyn Thng K48

Tm hiu v Ipv6

ia chi IPv6 s dung trong cac mang 6to4 co cu truc c bit va c cp phat ring mt lp ia chi co tin t FP=001 va gia tri trng TLA=0x0002 tao thanh tin t ia chi 2002::/16. Mi mang se co tin t ia chi mang hinh thanh bng cac kt hp 16 bit tin t chung vi 3 bit ia chi IPv4 cua router tng ng. Tin t nay co ln 48 bit va co th biu din di dang 2002:V4ADDR::/48.

6 to 4 router
Ipv6 networ k Ipv4

6 to 4 router
Ipv6 networ k

192.168.99.1

192.168.30.1 Network Preix: 2002: c0a8:6301::/48

Network Preix: 2002: c0a8:6301::/48

Hinh 53 : 6 to 4 Khun dang cua mt ia chi 6to4 nh sau: FP TLA IPv4ADDR SLAID Interface ID

37 Nguyn Bo Anh Mng My Tnh V Truyn Thng K48

Tm hiu v Ipv6

Hinh 54.. Khun dang ia chi 6to4 C ch hoat ng:

Ipv4 IPv6 networ k

IPv6 networ k

Ipv6

Ipv4

IPv6

IPv6

Type: native IPv6 Dst:2002:c0a8:1e01::1

Type: IPv6 in IPv4 Dst:192.168.30.1

2002:c0a8:1e01::1 192.168.30.1

Hinh 55 : C ch hoat ng 6 to 4 - Khi co mt goi tin IPv6 vi ia chi ich co dang 2002::/16 c gi n mt router 6to4, router 6to4 tach ia chi IPv4 (ia chi Ipv4 va tach c chinh la ia chi IPv4 cua 6to4 router ich), boc goi tin IPv6 trong goi tin IPv4 vi ia chi ich la ia chi IPv4 va tach c. Sau o, cac goi tin se c chuyn tip trn ha tng IPv4. Khi router 6to4 ich nhn c goi tin, goi tin IPv6 se c tach ra va chuyn n nut mang IPv6 ich. - u im: + Cac nut mang khng bt buc phai dung ia chi IPv6 kiu tng thich IPv4 nh ng hm t ng. + Khng cn nhiu cu hinh c bit nh ng hm co cu hinh. + Khng bi anh hng bi cac h thng tng la cua mang, chi cn routercua mang co ia chi IPv4 toan cuc co th inh tuyn. - Nhc im: + Chi thc hin vi mt lp ia chi mang c bit. + Co nguy c bi tn cng theo kiu cua ng hm t ng nu phn ia chi IPv4ADDR trong ia chi ich cua goi tin 6to4 la ia chi broadcast hay multicast. - Trin khai: + 6to4 c h tr trn nhiu h iu hanh nh Linux, Windows 2000. + Linux: radvd co th cu hinh quang ba tin t ia chi 6to4. + Windows 2000: chng trinh 6to4cfg dung cu hinh mang 6to4.
38 Nguyn Bo Anh Mng My Tnh V Truyn Thng K48

Tm hiu v Ipv6

2.2.5. Mi gii ng hm (Tunnel Broker) - Hin nay, mang IPv6 s dung rt nhiu ng hm trn ha tng IPv4. Tunnel Broker c a ra giam nhe chi phi cu hinh va duy tri cac ng hm nay. - C ch nay s dung mt tp cac server chuyn dung goi la Tunnel Broker cu hinh va duy tri cac ng hm. Chung co th xem nh cac ISP IPv6 ao cho cac ngi dung a kt ni vao Internet IPv4. C ch nay phu hp cho cac tram (hoc site) IPv6 nho c lp mun kt ni d dang vao mang IPv6. - Cu truc cua TUnnel broker bao gm: + Mt server tunnel broker. + Mt DNS server. + Mt s cac server ng hm.

39 Nguyn Bo Anh Mng My Tnh V Truyn Thng K48

Tm hiu v Ipv6

IPv6 IPv4 host IPv4 network

IPv4 network

IPv6 network

Hinh 56: Mi trng ng hm - Cach thc thc hin: + Cac khach hang cua dich vu Tunnel broker la cac nut mang IPv6 stack kep (host hoc router) a kt ni vao Internet IPv4. Trc khi thit lp ng hm, cn co s trao i thng tin gia Tunnel broker vi khach hang nh xac thc, quan ly va thng tin tai khoan. + Khach hang kt ni ti tunnel broker ng ki va kich hoat cac ng hm. Tunnel broker co th chia se tai cac im cui ng hm trn cac server ng hm. No cung co th ng ki tn va ia chi IPv4 cua u ng hm phia ho, tn ng ki trong DNS va o la mt tram hay mt router. + Tunnel broker chon mt server ng hm lam im cui ng hm thc s. No chon tin t cp phat cho khach hang (t 0 n 128) va c inh thi gian tn tai cua ng hm. + Tunnel broker ng ki ia chi IPv6 cp cho cac im cui ng hm trong DNS. + Tunnel broker cu hinh ng hm phia server va thng bao cac thng tin lin quan cho khach hang. - Sau o, khach hang co th kt ni vao mang IPv6 thng qua c ch ng hm nh binh thng. - u im: + Quan ly tp trung cac ng hm phia server, giam bt chi phi. + Co th s dung cac ISP ao trn IPv6.
40 Nguyn Bo Anh Mng My Tnh V Truyn Thng K48

Tm hiu v Ipv6

- Cac Tunnel Broker trn mang Internet: + Freenet6 www.freenet6.net + Hurriane Electric www.ipv6tb.he.net 2.2.6 Dich ia chi- Dich giao thc (SIIT va NAT- PT) - Dich ia chi va dich giao thc c phat trin trn c s c ch NAT trong IPv4 nhm cho phep cac nut mang IPv4 va IPv6 kt ni vi nhau. C ch nay hoat ng trn c s chuyn i cac khac bit gia cac goi tin IPv4 va IPv6. - Khac bit v ia chi: Dich ia chi IPv4- IPv6. - Khac bit v phn m u header: Dich giao thc thay i header goi tin. Thit bi NAT- PT c cai t tai bin gii gia mang IPv4 vi Ipv6. C ch nay khng oi hoi cac cu hinh dc bit tai cac may tram va cac s chuyn i goi tin tai thit bi NAT- PT hoan toan trong sut vi ngi dung. - Mi thit bi NAT- PT duy tri mt tp cac ia chi IPv4 dung e anh xa cac yu cu vi ia chi IPv6. - NAT- PT co th m rng thanh NAPT- PT cho phep s dung mt ia chi - IPv4 cho nhiu phin lam vic khac nhau. NAT- PT cung nh NAT cung nh IPv4 khng co kha nng hoat ng vi cac goi tin co cha ia chi trong phn tai tin. Do o, NAT- PT thng i kem vi c ch Ca khu tng ng dung ALG. C ch nay cho phep x xy cac goi tin ng vi tng dich vu nht inh nh DNS hay FTP, ... - u im: + Quan tri tp trung tai thit bi NAT- PT. + Co th trin khai nhiu thi bi NAT- PT tng hiu nng hoat ng. - Nhc im: + Tao ln mt im gy li loan single poin of failure tai thit bi NAT- PT. - Cac trin khai cua NAT- PT: NAT- PT a c th nghim trn cac h iu hanh mang nh: + Linux, Free BSD, Microsoft Windows 2000. + Ngoai ra, no cung la mt phn cua h iu hanh Cisco IOS IPv6 ban beta vi hai phin ban da trn IOS v11.3 va IOS v12.0. Cac trin khai nay co cho nhiu loai router khac nhau.

IPv4 Interne t

IPv4

41 Nguyn Bo Anh Mng My Tnh V Truyn Thng K48

Tm hiu v Ipv6

Hinh 57: NAT- PT - SIIT (Stateless IP/ICMP Translation Algorithm) la mt chun cua IETF (RFC2765) m ta b dich IPv6/IPv4 khng lu trang thai (Stateless). - Tng t c ch NAT- PT ngoai tr no khng cp phat ng ia chi IPv4 cho cac tram IPv6. Chc nng chuyn i thc hin gia header IPv6 va IPv4. SIIT khng bao gm cac tuy chon IPv4 va header m rng trong IPv6. SIIT cung thc hin chuyn i cac thng ip iu khin ICMP gia hai giao thc. - i vi qua trinh chuyn i IPv4 sang IPv6, mt ia chi IPv4 tam thi c gan cho nut mang IPv6. - Cac goi tin n thit bi SIIT se c chuyn i header va ia chi t IPv4 sang cac ia chi IPv4-dich (IPv4- translated) va IPv4- anh xa (IPv4- mapped). Mt iac hi IPv4-dich tng ng vi mt nuts mang IPv6 con ia chi IPv4- anh xa tng ng mt nut mang IPv4. i vi chiu ngc lai, cac ia chi nay se c chuyn i ngc lai thanh ia chi IPv4. - Do qua trinh chuyn i khng lu trang thai, co th tn tai nhiu b chuyn i gia hai mang IPv4 va IPv6. Khng co s rang buc mi phin truyn phai i qua mt thit bi duy nht nh trong NAT- PT. 2.2.7. Mt s c ch khac 2.2.7.1 BIS (Bump Into the Stack ) - BIS la s kt hp cua hai c ch NAT- PT va DNS- ALG nhng c cai t ngay tai cac nut mang IPv6. Qua o, cac ng dung trn cac tram IPv4 co th kt ni vi cac tram IPv6. - u im: + H tr nhanh chong va n gian cac ng dung IPv4 co th kt ni vi cac nut mang IPv6 khac. + Cai t ngay trn tng tram nn khng phu thuc vao mt thit bi trung gian nh NAT- PT. - Nhc im: + Khng h tr kha nng t cu hinh. + Cn cai t va cu hinh ring re trn tng nut mang: card mang, cu hinh IP, NAT. Cac thng s cu hinh nay cn c thc hin lai mi khi co s thay i v topo va ia chi mang. + V lu dai va vi cac mang co kich thc ln, hoat ng khng hiu qua va chi phi quan tri cao. - Trin khai: +Phn mm Tlnet6 h tr BIS han ch vi mt s card mang ho 3Com, NE2000 di dang driver cho card mang do cng ty Hitachi cung cp. Chng trinh hoat ng vi Win9x va NT cho phep kt ni vi cac tram IPv6.
42 Nguyn Bo Anh Mng My Tnh V Truyn Thng K48

Tm hiu v Ipv6

+Sau7 khi cai t phn driver cua card mang, cn cu hinh cac anh xa ia chi IPv6- IPv4 trc khi co th thc hin kt ni thng qua chng trinh NAT MAnager. 2.2.7.2 BIA (Bump Into the API) Phng phap nay ap dung cho cac dual- stack host (cac host h tr ca IPv4 va IPv6), cho phep cac host IPv6 khac vi cac ng dung IPv4 hin co. Muc ich cua phng phap cung ging nh c ch Bump-in-the-stack (BIS) nhng no a ra c ch dich gia cac API IPv4 va IPv6. DO vy, qua trinh n gian khng cn dich header goi tin IP va khng phu thuc vao cac giao thc tng di va trinh iu khin cua giao din mang. Host Translatorr( BIA) (API) IP v6 network IPv6 hative host

IPv4 Applications

IPv6 hative host

Hinh 58: BIA - Phng phap BIA khng su dung c trong cac host chi h tr IPv4 nh phng phap BIS. No chi c s dung trn cac host IPv6/Ipv4 nhng co mt s trinh ng dung IPv4 khng the hoc kho chuyn i sang h tr IPv6. - Do BIA hoat ng tai mc API socket nn ta co th s dung cac giao thc an ninh tai tng mang (IPsec). BIA hin nay chi ap dung c cho cac trao i kiu Unicast, cha ap dung c cho kiu Multicast. Cac tinh nng mi cua socket IPv6 khng th s dung. - Phng thc hoat ng:

43 Nguyn Bo Anh Mng My Tnh V Truyn Thng K48

Tm hiu v Ipv6

+ Phng phap BIA chen thm mt b dich API vao gia module socket API va module TCP/IP trn dual-stack host va dich cac ham API socket IPv4 thanh cac ham API socket IPv6 va ngc lai. ap dung phng phap nay, host h tr ca TCP(UDP)/IPv4 va TCP(UDP)/IPv6. + Khi mt ng dung IPv4 giao tip vi mt host IPv6 khac, b dich API phat hin cac ham APG socket ma ng dung s dung va goi tng ng cac ham API socket IPv6 giao tip vi host IPv6 va ngc lai. + Qua trinh chuyn i IPv6 sang mt tp cac ia chi IPv4 c thc hin trong module anh xa tn (name resolver). - Kin truc cua dual-stack host s dung BIA. - Module BIA gm 3 phn: + Module tra cu tn (Name resolver): ap ng cac yu cau tra cu tn min cua cac ng dung IPv4. Khi mt ng dung gii mt truy vn cac ban ghi kiu A ti name server, module nay se nhn truy vn nay, phn tich va tao ra truy vn tng ng vi tn may o cho ca cac ban ghi kiu A va AAAA ri gii cho name server.

IPv4 Applications

Socket API (IPv4 , IPv6) API Translator


Name Resolver Address Mapper Function Mapper

TCP(UDP)/IPv4

TCP(UDP)/IPv6

Hinh 3- 13. Kin truc cua dual- stack host s dung BIA

44 Nguyn Bo Anh Mng My Tnh V Truyn Thng K48

Tm hiu v Ipv6

Nu tra li t name server chi co ban ghi kiu AAAA, module nay se yu cu module anh xa ia chi gan mt ia chi IPv4 tng ng vi ia chi IPv6 nay ri tao ra mt tra li kiu A cha ia chi IPv4 tra v cho ng dung + Module anh xa ia chi (Address mapper). Duy tri mt bang cac cp ia chi IPv4 va IPv6. Cac ia chi IPv4 c gan t mt tp cac ia chi nay va cp nht thm mt muc trong bang. Qua trinh cp nht xay ra trong hai trng hp: Khi module anh xa tn chi nhn c tra li v ban ghi kiu AAAA va khng co muc nao trong bang cha ia chi IPv6 tng ng. Khi module anh xa ham nhn c mt li goi ham API socket t d liu thu nhn ma khng co muc nao trong bang tng ng vi ia chi IPv6 ngun. + Module anh xa ham (Function mapper): Chuyn i cac ham API socket IPv4 thanh cac ham API socket IPv6 va ngc lai. - Cac vn lin quan + Chuyn i API socket. Cac ham API socket IPv4 c chuyn i tng ng sang cac ham API socket IPv6. Qua trinh nay chuyn i ca cac ia chi IP nhung trong cac giao thc tng ng dung (FTP, DNS,...). S tng thich gia cac ham API socket la khng hoan toan do cac ham API socket IPv6 co nhiu tinh nng hn. Cac ham API socket c chuyn i: bind() connect() sendmsg() sendto() accept() rrecvfrom() recvmsg() getpeername() getockname() getocketopt() setocketopt() recv()
45 Nguyn Bo Anh Mng My Tnh V Truyn Thng K48

Tm hiu v Ipv6

send()

Bang 3- 1. Cac ham API socket c chuyn i Cac cu truc va ham API c ban AF_ INET sockaddr_in gethostbyname() gethosbyaddr() inet_ntoa()/inet_addr() INADDR_ANY AF- INET6 sockaddr_in6 getaddrinfo() getnameinfo() inet_pton()/inet_ntop() in6addr_any

Bang 3- 2. Cac cu truc va ham API c ban - Cac thng ip ICMPv4 c chuyn thanh ICMPv6 va ngc lai ging trong phong phap SIIT. + Tp cac ia chi IPv4 va bang anh xa ia chi. tranh hin tng dung ht tp ia chi IPv4 dn n khng th tip tuc ap ng cac yu cu trao i vi bn ngoai, BIA a ra cac c ch loai bo cac muc tn tai lu nht trong bang s dung trong cac yu cau mi. + Cac ia chi IPv4 ni b. tranh ung v ia chi, BIA s dung cac ia chi khng c cp phat (0.0.0.0 n 0.0.0.255). + Vn khng phu hp gia kt qua DNS (AAAA) vi phin ban ng dung (v4). - Nu server ng dung cha h tr IPv6 nhng chay trn mt may co h tr IPv6 va co tn di kiu ban ghi AAAA trong DNS, ng dung client co th khng kt ni c vi server do co s khng phu hp gia ban ghi kt qua DNS (AAAA) vi phin ban ng dung server (IPv4). - Mt trong cac giai phap la th tt ca cac ia chi trong DNS va khng kt thuc ngay sau ln th u tin. iu nay co th ng dung bi s m rng module tra cu tn va b dich API trong BIA. BIA thc hin lp cng vic tim kim cac ia chi hoat ng s dung bi cac ng dung khac bn ngoai cac ia chi tra v t name server. 2.2.7.3. C ch chuyn i hai giao thc (DSTM)
46 Nguyn Bo Anh Mng My Tnh V Truyn Thng K48

Tm hiu v Ipv6

- C ch nay cho phep kt ni cac nut mang stack kp (IPv6/IPv4) trn mt mang IPv6 vi cac nut mang IPv4 xa. DSTM khng ap dung c cho cac nut mang chi h tr IPv6. - DSTM cp mt ia chi IPv4 toan cuc tam thi cho nut mang IPv6 va s dung ng hm IPv4-in-IPv6 truyn goi tin IPv4 trn mang IPv6. - y la c ch hai chiu, qua trinh truyn thng co th bt u t nut mang IPv6 hoc nut mang IPv4. - Cach thc hoat ng: + DSTM c cai t trn tt ca cac nut mang trong mang IPv6 va router bin gii gia hai min IPv6 va IPv4. No cung s dung DHCPv6. Do vy, DSTM cn mt server DHCPv6 va cac client tai mi nut mang.

DHCP

Border router(Y)IPv4 IPv6

IPv4 only node (Z) Dual stack node (X) DNS

Bang 3- 3. C ch chuyn i hai giao thc (DSTM) - Chc nng cac b phn nh sau: + DHCPv6 Server: Cp ia chi IPv4 tam thi cho cac nut mang mun giao tip vi nut mang IPv4 xa. No cung duy tri s anh xa gia ia chi IPv4 va IPv6. h tr DSTM, DHCPv6 phai h tr mt tuy chon mi cho phep nut
47 Nguyn Bo Anh Mng My Tnh V Truyn Thng K48

Tm hiu v Ipv6

mang IPv6 nhn ia chi IPv4 tam thi va thng bao cho phia client bit ia chi IPv6 cua cui ng hm. + DSTM daemon: S dung DHCPv6 client trn nut mang yu cu ia chi IPv4 toan cuc mi khi khi tao truyn thng. + Giao din ng hm ng (DTI): y la mt giao din IPv4 ao trongnut stack kep cho phep truyn cac goi tin IPv4 mt cach trong sut trn mang IPv6. Cac goi tin chuyn n giao din nay c boc trong goi tin IPv6 va c gii thng qua giao din IPv6 n router bin mang. + Router bin mang: y la mt router stack kep kt ni min IPv4 vi IPv6. y la ni kt thuc ng hm 4 trong 6. Router cung lu cac anh xa gia ia chi IPv6 vi ia chi IPv4 tam thi. - u im: + Trong sut i vi mang, chi cn duy tri inh tuyn IPv6 trn mang, giam chi phi quan tri mang. + Trong sut i vi ng dung, cho phep cac ng dung chi cho IPv4 hoat ng binh thng trn nut mang IPv4/IPv6. + Khc phuc s thiu hut ia chi IPv4 bng cach s dung DHCPv6. - Nhc im: + oi hoi nhiu c ch c bit. + S dung cac ia chi IPv4 toan cuc. - Trin khai: +Hin mi chi co trn h iu hanh Free BSD.

48 Nguyn Bo Anh Mng My Tnh V Truyn Thng K48

Tm hiu v Ipv6

CHNG 3
Th nghim va cai t IPv6 trn windows XP va windows server 2003

Yu cu ca bi lab nh sau: 1) Ci t IPv6 trn cc clients v Routers sau thc hin cc lnh Ping gia cc Subnets bng a ch IPv6 Link Local Address. (Link-Local Ping). 2) To nh tuyn tnh (static routing) bng IPv6. Bt u: Ci t ipv6 trn my Xp v 2k3: vo Run: CMD ri g lnh netsh int ipv6 install
49 Nguyn Bo Anh Mng My Tnh V Truyn Thng K48

M phng bi lab

Tm hiu v Ipv6

Phn I. Bc 1: Ci t ipv6 trn cc my tnh. - i vi clients chay WinXP, CMD ri g cu- i vi clients chay WinXP, ci ipv6 bn vo Run lnh ipv6 install hoc dng cu lnh netsh interface ipv6 install . - i vi cc my chy Win2k3 ng chc nng lm Router, ci t ipv6 CMD g lnh netsh interface ipv6 installbn vo Run - Sau khi hon tt bc 1 my tnh ca bn h tr ipv6 ri, v mc nh trn mi my tnh s c sn mt a ch ipv6 gi l Link-Local Address c dng Fe80::X:Y:Z%N (v d fe80::215:ff:fe43:1dd2%6). %6 ni l interface 6. (trn mi my tnh th c th c s interface khc nhau) Bc 2: Link-Local Ping Ping c mt Node dng Link-Local Addresses v xem cc neighbors c to ta lm nhu sau: - Trn Router1, bn dng cu lnh netsh interface ipv6 show address xem a ch Link-Local address ca SubNet1 m Router1 kt ni vi. - Trn Client1, dng cu lnh netsh interface ipv6 show address xem LinkLocal address m Client1 kt ni vi SubNet1. - Trn Client1, dng cu lnh Ping ti a ch Link-Local Address ca Router1 trn SubNet1. (V d Ping FE80::2AA:FF:FE9D:10C5%3). Nh l xem trn Client1 xem interface bao nhiu th dng % l by nhiu, v d interface 7 th dng %7. - Trn Client1 dng cu lnh netsh interface ipv6 show neighbor xem ton b lng ging ca Client1 ( y neighbor ca Client1 l Router1) - Trn Client1 mun xem cc ipv6 routes th dng cu lnh netsh inter ipv6 show routes. - V mun xem destination cache tren Client1 bn dng netsh inter ipv6 show destinationcache Phn II: To nh tuyt tnh (static routing) cho ipv6 trong Win2k3 ( bin Win2k3 thnh Router)
50 Nguyn Bo Anh Mng My Tnh V Truyn Thng K48

Tm hiu v Ipv6

to c nh tuyn tnh ta lm nh sau: Trn Router1: Dng cu lnh netsh inter ipv6 show address xem a ch Link-local address v s interface (interface index number) m Router1 kt ni vi cc SubNet. y CiscoBP t interface ca SubNet1 l Subnet1InterfaceIndex v SubNet2 l Subnet2InterfaceIndex. Sau khi bit c tn v a ch ca cc interfaces ta tin hnh cu hnh static routing. - cu hnh static routing, trn Router1 ta dng cc cu lnh sau: + netsh interface ipv6 set interface Subnet1InterfaceIndex forwarding=enabled advertise=enabled + netsh interface ipv6 set interface Subnet2InterfaceIndex forwarding=enabled advertise=enabled + netsh interface ipv6 add route FEC0:0:0:1::/64 Subnet1InterfaceIndex publish=yes + netsh interface ipv6 add route FEC0:0:0:2::/64 Subnet2InterfaceIndex publish=yes + netsh interface ipv6 add route ::/0 Subnet2InterfaceIndex/ROUTER2AddressOnSubnet2 publish=yes Trn Router2: Dng cu lnh netsh interface ipv6 show address xem c a ch Link-Local Addresses v s interface index ca Subnet2 v Subnet3 interfaces. - Trn Router2, mt s cu lnh dng cho static routing nh sau: + netsh interface ipv6 set interface Subnet2InterfaceIndex forwarding=enabled advertise=enabled + netsh interface ipv6 set interface Subnet3InterfaceIndex forwarding=enabled advertise=enabled + netsh interface ipv6 add route FEC0:0:0:2::/64 Subnet2InterfaceIndex publish=yes + netsh interface ipv6 add route FEC0:0:0:3::/64 Subnet3InterfaceIndex publish=yes + netsh interface ipv6 add route ::/0 Subnet2InterfaceIndex/ROUTER1AddressOnSubnet2 publish=yes - Trn Client1, dng cu lnh netsh interface ipv6 show address xem a ch ipv6 mi trn LAN interface da vo Site-Local prefix ca FeC0:0:0:1::/64 - Trn Client1, dng cu lnh netsh interface ipv6 show routes xem cc routes mi ca FEC0:0:0:1::/64, FEC0:0:0:2::/64, and ::/0. - Trn Client2, dng cu lnh netsh interface ipv6 show address xem a
51 Nguyn Bo Anh Mng My Tnh V Truyn Thng K48

Tm hiu v Ipv6

ch ipv6 mi trn LAN interface da vo Site-Local prefix ca FeC0:0:0:3::/64 - Trn Client2, dng cu lnh netsh interface ipv6 show routes xem cc routes mi ca FEC0:0:0:2::/64, FEC0:0:0:3::/64, and ::/0. - Trn Cliet1, dng cu lnh Ping kim tra kt ni: ping CLIENT2SiteLocalAddress - Trn Router1, dng mt s cu lnh shows nh sau: + netsh interface ipv6 show neighbors >>> xem ton b neighbors Cache ca Router1, y l Client1 v Router2. + netsh interface ipv6 show destinationcache >>> xem ton b destination cache ca Router1, y l Client1 v Router 2.

52 Nguyn Bo Anh Mng My Tnh V Truyn Thng K48