Está en la página 1de 45

Mc lc Danh mc cc ch vit tt Danh mc cc t kho Danh mc cc bng v hnh v Li ni u

1 3 4 6 8 9 10 16

Chng 1 : Cc vn ca a ch IPv4
1. a ch IPv4 2. Cc vn ca IPv4 3. Cc u im m IPv6 cung cp

Chng 2 : Tng quan v a ch IPv6


1. Cu trc v cc loi a ch IPv6
1.1.Cu trc 1.2.Cp pht a ch IPv6 1.3.Cc loi a ch IPv6
1.1.1. a ch unicast 1.1.2. a ch Anycast21 1.1.3. a ch Multicast 1.1.4. Cc dng a ch IPv6 khc

17
17 17 19
19 21 21 22

2. Cu trc trng header ca gi tin IPv6


2.1.Cu trc Header ca gi tin IPv6 2.2.Extension header

23
23 25

3. ICMPv6
3.1.Cu trc 3.2.Mt s loi bn tin ICMP 3.3.Qu trnh phn mnh v xc nh MTU

26
26 27 29

4. Neighbour discoverry
4.1.Cc bn tin ICMP s dng trong neighbour discovery 4.2.Bn tin Router Solicitation 4.3.Mt s chc nng m ND cung cp

31
31 31 31

5. Autoconfiguration
5.1.Stateful v Stateless autoconfiguration 5.2.Router v network renumbering

32
32 35

6. nh tuyn trong IPv6


6.1. Distance vector

35
35
1

6.2. Link state 6.3. RIP v RIPng 6.4. OSPF v OSPFn

7. Security trong IPv6


7.1.Cc mode hot ng 7.2. Hot ng

35 36 36 39 40 40

Danh mc cc ch vit tt
ID : Indentify Digit IP : Internet Protocol VLSM : Variable Length Subnet Mask CIDR : Classless Inter-Domain Routing NAT : Network Address Translation PAT : Port Address Translation RFC : Request For Comment addr : address TLA : Top Level Aggregation NLA : Next Level Aggregation SLA : Site Level Aggregation RES : Reversed TTL : Time To Live ECN : Explicit Congestion Notification ICMP : Internet Control Message Protocol MTU : Maximum Transmission Unit PMTU : Path Maximum Transmission Unit adv : advertisment DHCP : Dynamic Host Configuration Protocol REQ : Request CONFL : Confilct INFO-REQ : Information Request RELAY-FORW : Relay Forward DNS : Domain Name Server LSA : Link State Advertisment RIP : Routing Information Protocol OSPF : Open Shortest Path First DBD : Database Descryption Packet LSR : LinkState Request LSU : LinkState Update LSACK : LinkState Acknowledge DR : Designated Router BDR : Backup Designated Router AH : Authentication Header ESP : Encapsulating Security Payload ND : Neighbour discovery

Danh mc cc t kho
Variable Length Subnet Mask : l phng php chia nh 1 a ch mng ln thnh cc mng nh hn c subnet mask khc nhau Classless Inter-Domain Routing : l phng php gp cc a ch mng nh thnh 1 a ch mng ln duy nht. Request For Comment : l phng thc xy dng cc chun m ca IETF. Trong , bt c ai cng c th ng gp xy dng nn mt chun hon chnh Port Address Translation : l phng thc chuyn i c a ch IP v port do cng mt lc c th cung cp nhiu phin NAT ra ngoi Internet Top Level Aggregation : l nh cung cp cp cao nht. Cc nh cung cp thp hn mun c cp a ch IP cn phi ng k vi nh cung cp ny. khu vc Bc M l NIC (Network Information Center), khu vc Chu u l NCC (Network Coodirnoction Center), Chu -Thi Bnh Dng l APINC. Next Level Aggregation : l cc nh cung cp cp tip theo. VD nh cc ISP (FPT, VDC, ) Site Level Aggregation : cc t chc, s dng Internet, s c th c nhiu site khc nhau, mi site s c 1 gi tr Site Level Aggregation ID khc nhau nh danh cho 1 site Time To Live : mt gi tin khi i trong mng s c gn 1 gi tr TTL. Miln qua 1 Router n s gim gi tr trng ny i 1. Nu TTL = 0, gi tin s b hu. Explicit Congestion Notification : trng thng bo tc nghn Internet Control Message Protocol : giao thc s dng tng 3 dng pht hin li khi gi gi tin Maximum Transmission Unit : dung lng ti a ca gi tin khi truyn trong mng Dynamic Host Configuration Protocol : giao thc dng cu hnh t ng cho c host khi n mi kt ni vo mng Domain Name Server : server ng vai tr dch t tn min sang a ch IP hoc ngc li Link State Advertisment : bn tin qung b dng trong cc giao thc nh tuyn Link State, cc Router s dng thng tin thu thp t LSA xy dng vv update bng nh tuyn Node : tt c cc thit b chy v s dng IPv6. Bao gm c Router v host Router : l mt node c kh nng chuyn tip cc gi tin IPv6 c a ch ch ko phi l a ch ca n. Host : l 1 nde ko c kh nng chun tip cc gi tin IPv6 c a ch ch ko phi l n. Link : bao gm mt hoc nhiu mng con cng ni vo 1 interface ca Router. Authentication header : l header m rng cung cp cc phogn thc xc thc v bo mt d liu cho gi tin IPv6.

Extension Header : l phn header nm gia header ca IPv6 v header ca cc tng trn, cung cp cho IPv6 mt s chc nng mi. Fragmentation : l qu trnh chia nh ph ni dung ca git in IPv6 c thc hin bi node gi nhm tho mn kch thc ti cho php ca 1 link. Neighbour discovery : l qu trnh xc nh cc mi quan h v thu thp thng tin gia cc node l hng xm vi nhau. Network prefix : l phn u, c nh ca a ch IPv6 dng xc nh a ch mng ca 1 a ch IPv6.

Danh mc cc bng v hnh v


Chng 1 : Cc vn ca a ch IPv4
Bng 1.1 : Cc lp a ch IPv4 Bng 1.2 : a ch IP private Hnh 1.1 : a ch IPv4 Hnh 1.2 : VD v a ch broadcast ca 1 mng Hnh 1.3 : VD v s dng CIDR Hnh 1.4 : VD v NAT Hnh 1.5 : Hot ng ca PAT

9 1 0 9 1 0 1 3 1 3 1 4 1 7 2 2 2 4 2 5 1 7 1 7 1 9 2 0 2 0 2 0 2 0 2 1 2 1
6

Chng 2 : Tng

quan v a ch IPv6

Bng 2.1 : Cp pht a ch IPv6 Bng 2.2 : Trng ID scope Bng 2.3 : So snh header ca IPv4 v Ipv6 Bng 2.4 : Cc gi tr ca trng Next header Hnh 2.1 : So snh ko gian a ch IPv4 v IPv6 Hnh 2.2 : 1 s VD vit a ch IPv6 Hnh 2.3 : Cu trc a ch Global unicast Hnh 2.4 : cu trc phn cp ca a ch unicast Hnh 2.5 : Cu trc a ch site local Hnh 2.6 : Gn a ch link local Hnh 2.7 : Cu trc a ch link local Hnh 2.8 : gn ia ch trong 1 link Hnh 2.9 : cu trc a ch anycast dng gn cho 1 subnet

Hnh 2.10 : cu trc a ch multicast Hnh 2.11 : Cu trc a ch IPv4 trong IPv6 Hnh 2.12 : Cu trc gi tin IPv6 Hnh 2.13 : So snh header ca gi tin IPv4 v IPv6 Hnh 2.14 : cu trc gi tin IPv6 v trng extension header Hnh 2.15 : Cu trc bn tin ICMP Hnh 2.16 : cu trc bn tin ICMP des unrechable Hnh 2.17 : Cu trc bn tin ICMP packet too big Hnh 2.18 : Cu trc bn tin ICMP time exceeded Hnh 2.19 : Cu trc bn tin ICMP parameter problem Hnh 2.20: Echo Request Hnh 2.21 : Echo reply Hnh 2.22 : Path MTU discovery Hnh 2.23 : Cu trc bn tin Router Solicitation Hnh 2.24 : Hot ng ca RIP Hnh 2.25 : S chuyn trng thi v trao i cc gi tin gia 2 interface OSPF Hnh 2.26 : hot ng ca DR v BDR Hnh 2.27 : S chuyn trng thi ca 1 interface OSPF Hnh 2.28 : Cu trc AH Hnh 2.29 : Cu trc ESP

2 1 2 2 2 4 2 4 2 5 2 6 2 7 2 8 2 8 2 9 2 9 2 9 3 0 3 1 3 6 3 7 3 8 3 9 4 1 4 1

L ni u

a chi IPv6 c nhm chuyn trch v k thut ca IETF (Internet Engineering Task Force) ca hip hi Internet xut thuc hin trnc c s k tha cu trc v t chc ca IPv4. IPv4 c 32 bits a ch vi kh nng l thuyt c th cung cp 1 khng gian 32 a ch 2 =4.294.967.296 a ch. Cn IPv6 vi 128 bits a ch, di gp 4 ln IPv4, c kh nng cung cp 1 khng gian a ch gp 2 ln. S a ch ny nu ri u trn b mt qu t th mi mt vung c khong 656.570 t t a ch. y l mt khng gian a ch cc ln vi mc ch ko ch cho Internet m cn cho tt c cc mng my tnh, h thng vin thng, h thng iu khin v thm ch cho tng vt dng gia nh. Vi tc pht trin hin nay, ko gian a ch IPv4 cn kit. Vn chuyn i sang IPv6 l tt yu trong tng li. Vic nm bt trc cc k thut truyn i v thc hin cc dch v trn nn IPv6 l vn ht sc cn thit. Trong qu trnh thc tp em tin hnh nghin cu v cc vn kh khn ca IP v4 hin nay v l thuyt tng quan v IPv6.
96

Chng 1 : Cc vn ca a ch IPv4
9

1. a ch IPv4
a ch IP ang c s dng hin ti(IPv4) c 32 bit chia thnh 4 Octet (mi Octet c 8 bit, tng ng 1 byte) cch m u t tri qua phi bt 1 cho n bt 32, cc Octet tch bit nhau bng du chm (.), bao gm c 3 thnh phn chnh.

a ch ca mng ( Net ID ) a ch ca my ( Host ID ). a ch Internet c th biu hin dng bit nh phn:

Hnh 1.1 : a ch IPv4

Cc lp a ch IP

Bng 1.1 : Cc lp a ch IPv4

a ch cho host v a ch mng Ta thc hin php AND a ch IP v Subnet mask ta c a ch mng VD : host A c a ch IP 10.34.23.134 v subnet mask 255.0.0.0
10

Nh vy host A thuc mng c a ch 10.0.0.0 Khi tt c cc host bit l 1 ta c a ch broadcast.

Hnh 1.2 : VD v a ch broadcast ca 1 mng

a ch public v private : khi 1 my c kt ni vo mng public n c gn cho 1 a ch IP v a ch ny ko c trng vi bt c my no trong mng. a ch IP public ny c ng k qua ISP. Vi s pht trin nh hin nay ca mng Internet th a ch IP public ang trn cn kit. Mt trong nhng phng php gii quyt vn trn l s dng a ch private. C 3 di a ch private l :

Bng 1.2 : a ch IP private

2. Cc vn ca IPv4
2.1.Khng gian a ch
Do IPv4 ch dng 32 bits nh a ch nn ko gian a ch IPv4 ch c 2 a ch. Vi s pht trin mnh m ca Internet hin nay, ti nguyn a ch IPv4 gn cn kit. gii quyt vn thiu ht a ch IP, ngi ta s dng rt nhiu phng php nh: Subneting, VLSM, CIDR, NAT. 2.1.1. Subnetting Hy xt n mt a ch IP class B, 139.12.0.0, vi subnet mask l 255.255.0.0 (c th vit l: 139.12.0.0/16, y s 16 c ngha l 16 bits c
11
32

dng cho NetworkID). Mt Network vi a ch th ny c th cha 65,534 nodes hay computers . y l mt con s qu ln, trn mng s c y broadcast traffic. Ga s chng ta chia mng ny ra lm bn Subnet. Cng vic s bao gm ba bc: Xc nh Subnet mask mi Lit k ID ca cc Subnet mi Cho bit IP address range ca cc HostID trong mi Subnet Bc 1: Xc nh Subnet mask mi m cho n 4 trong h thng nh phn (cho 4 Subnet) ta cn 2 bits. Do ci Subnet mask s cn 16 (bits trc y) +2 (bits mi) = 18 bits a ch IP mi s l 139.12.0.0/18 ( con s 18 thay v 16 nh trc y). Con s hosts ti a c trong mi Subnet s l: ((2^14) 2) = 16,382. V tng s cc hosts trong 4 Subnets l: 16382 * 4 = 65,528 hosts. Bc 2: Lit k ID ca cc Subnet mi Trong a ch IP mi (139.12.0.0/18) con s 18 ni n vic ta dng 18 bits, m t bn tri, ca 32 bit IP address biu din a ch IP ca mt Subnet. Subnet mask trong dng nh phn Subnet mask 11111111 11111111 11000000 00000000 255.255.192.0 Nh th NetworkID ca bn Subnets mi c l: Subnet Subnet ID trong dng nh phn Subnet ID 1 10001011.00001100.00000000.0000000 139.12.0.0/18 0 2 10001011.00001100.01000000.0000000 139.12.64.0/18 0 3 10001011.00001100.10000000.0000000 139.12.128.0/18 0 4 10001011.00001100.11000000.0000000 139.12.192.0/18 0 Bc 3: Cho bit IP address range ca cc HostID trong mi Subnet V Subnet ID dng ht 18 bits nn s bits cn li (32-18= 14) c dng cho HostID. Nh ci lut dng cho Host ID l tt c mi bits khng th u l 0 hay 1 Subnet HostID IP address trong dng nh HostID IP address Range phn 1 10001011.00001100.00000000.0000000 139.12.0.1/18 1 -139.12.63.254/18 10001011.00001100.00111111.1111111 0 2 10001011.00001100.01000000.0000000 139.12.64.1/18 1 -139.12.127.254/18

12

10001011.00001100.01111111.1111111 0 10001011.00001100.10000000.0000000 1 10001011.00001100.10111111.1111111 0 10001011.00001100.11000000.0000000 1 10001011.00001100.11111111.1111111 0

139.12.128.1/18 -139.12.191.254/18 139.12.192.0/18 139.12.255.254

2.1.2. Variable Length Subnet Mask(VLSM). VLSM (Variable Length Subnet Masking) c ngha thc hin nhiu hn mt mt n trn cng lp (class) chnh ca mt mng. N cho php s dng a ch IP hiu qu hn cho my (host) v cc mng con (subnet). iu ny l rt cn thit trn mt mng khng c khng gian a ch IP ln VD : Cho trc net 192.168.1.0 /24. Yu cu trin khai 3 network sau: HCM 100 my, Cn Th 50 my, H Ni 50 my Mn 1 bit chia subnet, nh vy gi tr netmask mi l /25 (255.255.255.128). Khi ta c 2 network: Net 0: 192.168.1.0 (khng dng v y l a ch i din cho net0) 192.168.1.1 192.168.1.2 ......... 192.168.1.126 192.168.1.127 (khng dng v y l a ch broadcast ca net0) Net 1: 192.168.1.128 (khng dng v y l a ch i din cho net1) 192.168.1.129 192.168.1.130 ......... 192.168.1.254 192.168.1.255 (khng dng v y l a ch broadcast ca net1) Chn Net0 cho HCM, lc mt my HCM s c IP dng 192.168.1.x (x chy t 1 n 126), netmask: 255.255.255.128. By gi ta chia net1 ra lm 2 bng cch mn thm 1 bit na: /26 (255.255.255.192) Ta s c 2 net mi, mi net c 62 host (64 - 2) net1a:
13

192.168.1.128 (khng dng v y l a ch i din cho net1a) 192.168.1.129 192.168.1.130 ....... 192.168.1.190 192.168.1.191 (khng dng v y l a ch broadcast ca net1a) net1b: 192.168.1.192 (khng dng v y l a ch i din cho net1b) 192.168.1.193 192.168.1.194 ..... 192.168.1.254 192.168.1.255 (khng dng v y l a ch broadcast ca net1b) Ta chn net1a cho Cn Th v net1b cho H Ni. Nh vy trong Vit nam ti HCM gi tr netmask l /25, cn th v h ni l /26 2.1.3. CIDR CIDR lm gim "gnh nng" cho cc Internet Router (B nh tuyn trong mng Internet) bng cch "gp" cc ng truyn (knh truyn) v cho php mt a ch IP cho th "i din" cho hng ngn a ch ("nt" mng khc) c nhu cu c "phc v" bi cc nh cung cp ng trc Internet (Internet backbone provider). Tt c cc gi tin gi cho cc a ch s c chuyn n cho ISP (v d M l US Sprint hoc MCI). Vo nm 1990, c khong 2000 knh truyn trn mng Internet. Nm nm sau, con s ny tng ti 30.000 knh truyn. Khng c k thut CIDR, cc router trong mng Internet khng th h tr s lng cc "nt" mng Internet lin tc gia tng nhanh chng.

Hnh 1.3 : VD v s dng CIDR

2.1.4. NAT (RFC 1631) L phng php vn dng trng header ca gi tin IP qua a ch ch, a ch ngun hoc c ch, c ngun c thay th bng a ch khc do ngi qun tr thit lp.
14

Hnh 1.4 : VD v NAT

NAT cho php cc thit b hot ng bin gii ca mng dng stub (mng ch c 1 ng sang mng hng xm ca n). 2.1.4.1. Cc loi a ch trong NAT Trong NAT. ta nh ngha 1 s loi a ch sau Inside local addr : l a ch IP gn cho 1 host trong mng, thng l a ch private Inside globe addr : l a ch public c cung cp bi ISP. N i din cho 1 hoc nhiu a ch Inside local Out side local addr : l a ch ca mt host bn ngai mng c bit bi cc host trong mng Outside global addr : l a ch m ISP gn cho 1 host ngoi mng 2.1.4.2. Hot ng ca NAT Khi gi tin t trong mng i ra s chuyn i t a ch local addr sang global addr. Khi gi tin i t ngoi vo,, Router s tham kho bng NAT nh x a ch global thnh a ch local. C 3 loi NAT Static NAT : a ch ca c mng khi i ra ngoi c thay th bi 1 a ch duy nht o Cho php giu thng tin ca mng bn trong vi cc mng bn ngoi, tng thm tnh bo mt o Ch cho php nh x 1-1 gia a ch local v a ch global o Hu dng vi cc a ch ca host phi c truy cp t internet(DNS Server hay Mail Server) Dynamic NAT : a ch c mng khi i ra ngoi c thay th bi 1 a ch trong 1 tp hp cc a ch c gn cho trc. PAT : a ch ca mng khi i ra ngoi c s dng NAT kt hp vi 1 s iu kin (port) o S dng 1 gi tr duy nht source port gn cho gi tr inside global add nhm phn bit cc phin translation o Gi tr source port c m ho bi 16 bits nn n tng s phin NAT l 2 m 16.
15

o Nu gi tr source port c s dng, PAT c gng tm gi tr u tin avai trong khong 0-511, 512-1023, 1024-65535.

Hnh 1.5 : Hot ng ca PAT

2.1.4.3. u v nhc im ca NAT Nh thy trn, s dng NAT c 1 s u v nhc im sau : u im NAT cho php tit kim a ch IP bng ch cho php s dng a ch private trong c mng intranet. NAT tng s tin cy ca kt ni ra ngoi internet. Mun thay i 1 mng cn phi nh a ch li ton b mng. Chi ph s t l thun vi s lng host cn phi cn phi chuyn i sang a ch mi. NAT cho php chin lc onh a ch c vn tn ti v ng thi vn h tr chin lc a ch mi Nhc im NAT lm tng tr : tr trong qu trnh switching. CPU s phi kim tra mi gi tin xc nh n c phi translate gi tin hay ko? V sau thay i IP header thm ch c TCP header. 1 nhc im ln na l khi ta s dng NAT, ta ko c kh nng kim tra ngun gc ca a ch IP trong cc kt ni end-to-end. Rt kh tm ra du vt ca gi tin tri qua nhiu ln thay i a ch qua nhiu ln NAT. NAT khin cho 1 s ng dng s dng a ch IP ko lm vic do n giu a ch IP. Cc ng dng s dng a ch vt l m ko s dng tn min s ko th ti c a ch ch m a ch ny b translate qua NAT. NAT h tr TCP/UDP tuy nhin n ko cho php cc a ch ch hay ngun ca cc ng dng truyn d liu nh HTTP, TFTP, Telnet. Cc ng dng m NAT h tr : ICMP, FTP, NetBIOS over TCP/IP, DNS, Real Audio

2.2.nh tuyn
Cc Router quyt nh ng i ca gi tin. Cc giao thc nh tuyn s s dng cc phng php ng duy tr cc thng tin ny. Tuy nhin cc gi tin c a ch ch trn ng internet backbone phi c nh tuyn qua cc Router nondefault s dng giao thc nh tuyn BGP. Cc Router ny phi duy tr 1 list tt c cc tuyn trn Internet, Routing Information Base(RIB). Mi thnh phn

16

trong RIB l 1 tuyn. Theo s pht trin ca Internet, kch thc ca RIB ngy cng ln v tr nn qua phc tp tnh ton.

2.3.Thit lp cu hnh cho cc thit b phc tp


Tt c cc thit b IPv4 u phi c cu hnh bng tay hoccu hnh theo kiu statefull (DHCP). Vi s pht trin ca Internet hin nay, ngy cng c nhiu thit b s dng a ch IP, chng ta cn phi c 1 c ch cu hnh t ng v n gin hn.

2.4.Vn end-to-end
2 im u cui c th hot ng vi nhau m ko cn bt v ng truyn trung gian. iu ny cho php tng ng dng hot ng 1 cch n gin hn. Tuy nhin do vic s dng cc ko gian a ch private v NAT khin cho IPsec ko th p dng. IPsec l mt thc m bo security tng network. Ngoi ra, ko phi ng dng no cng chy trn NAT. NAT h tr TCP/UDP tuy nhin n ko cho php cc a ch ch hay ngun ca cc ng dng truyn d liu nh HTTP, TFTP, Telnet. Cc ng dng m NAT h tr : ICMP, FTP, NetBIOS over TCP/IP, DNS, Real Audio

3. Cc u im m IPv6 cung cp
Nh ni trn, IPv4 c kh nhiu nhc im, trong quan trng nht l vic khng gian a ch IPv4 ang cn kit. iu ny dn n tt yu phi ra i mt th h a ch mi gii quyt c nhng nhc im ca IPv4, l IPv6. Th h a ch IPv6 ko nhng gii quyt c nhng vn ca IPv4 m cn cung cp thm 1 s u im : Khng gian a ch ln Kh nng m rng v nh tuyn H tr end to end d dng hn Ko c phi phn mnh, ko cn trng header checksum. Security : do IPv6 h tr IPsec, n lm cho cc node IPv6 tr nn an ton hn(thc ra IPsec c th hot ng c vi c IPv4 v v6. Autoconfiguration : IPv4 cung cp 2 c ch config 1 node. Cu hnh tnh th ko cho php thay i theo thi gian, trong khi cu hnh ng cho php mt node request thng tin cu hnh v thng tin c th thay i theo tng phin. Cu hnh ng trong IPv4 lin quan n stateful autoconfiguration bi v thnh thong cc thng tin cu hnh cn c lu li(a ch MAC). IPv6 thm vo 1 c im na l stateless autoconfiguration cho php kt ni vo mng m ko cn contact vi server. Mobility : cho php h tr cc node mobile IP Hot ng : trng IPv4 header lm thay i kch thc ca gi tin IP v thng b b i ko tnh n. Do cc Router thng chuyn hng hac t

17

chi cc gi khi n busy. y chnh l l do ta ko trin khai IPsec trn nn IPv4. Cc Router IPv6 hot ng khc gia trn cch x l khc i vi a ch IP v cc tuyn Cost : gim gia thnh v cng tc qun l, tng an ninh, hot ng tt hn, cn t tin hn ng k a ch IP. Cc chi ph ny s cn bng chi ph cho vic chuyn t IPv4 sang IPv6.

Chng 2 : Tng quan v a ch IPv6


1. Cu trc v cc loi a ch IPv6
1.1.Cu trc
a ch IPv6 c chiu di 128 bits, nn vn nh a ch l ht sc kh khn.

Hnh 2.1 : So snh ko gian a ch IPv4 v IPv6

Ngi ta quy c vit 128 bits thnh 8 nhm, mi nhm 2 bytes mi byte biu din bng 2 s h 16, mi nhm ngn cch nhau bi du :

Hnh 2.2 : 1 s VD vit a ch IPv6

Quy tc rt gn : Trong 1 a ch, 1 nhm lin tip cc s 0 c th thay th bng ::. Quy tc rt gn ny ch c php s dng 1 ln vi 1 a ch
18

Ngoi ra, cn c th vit cc a ch theo cc tin t (prefix), l cc bit cao ca a ch IPv6, iu ny c li cho vic nh tuyn VD : FEDC:BA98:7600::/40

1.2.Cp pht a ch IPv6


Cp pht Unassigned Unassigned Cc a ch NSAP Unassigned Unassigned Unassigned Cc a ch Global Unicast Unassigned Unassigned Unassigned Unassigned Unassigned Unassigned Unassigned Unassigned Unassigned Unassigned a ch Link-Local Unicast a ch Site-Local Unicast a ch Multicast Cc bit u 0000 0000 0000 0001 0000 001 0000 01 0000 1 0001 001 010 011 100 101 110 1110 1111 0 1111 10 1111 110 1111 1110 0 1111 1110 10 1111 1110 11 1111 1111 T l vi ton b khng gian 1/256 1/256 1/128 1/64 1/32 1/16 1/8 1/8 1/8 1/8 1/8 1/8 1/16 1/32 1/64 1/128 1/512 1/1024 1/1024 1/256

Bng 2.1 : Cp pht a ch IPv6

Ta c th thy, mi ch c 15% khng gian a ch c s dng trong giai on ny, cn li 85% c d tr cho tng lai. C 2 c ch cp pht l : A. Cp pht theo nh cung cp a ch IP s c cc trng ID ca cc nh cung cp TLA ID : nh danh nh cung cp cao nht trong h thng cc nh cung cp dch v NLA ID : nh danh nh cung cp tip theo SLA ID : nh danh cc site ca khch hng cui Cc TLA l cc nh cung cp cao nht. Cc NLA l cc ISP cn phi xin cp gi tr NLA ID ca mnh thng qua cc TLA. C 1 s phog php xin cp gi tr NLA ID nh sau : Xin cp qua 6bone community : y l mng th nghim IPv6 trn ton cu. Khi tho mn 1 s k ISP s c cp pht IP
19

Xin cp qua RIP Gi lp a ch IPv4 vo IPv6 : phng php ny thun li cho vic th nghim IPv6 trn nn IPv4. 32 bits cui s l a ch IPv4, cn TLA ID c dng 2002::/16 Vi 1 end-user-site sau khi xin a ch s c cp pht a ch v cc TLA ID, NLA ID ri gn gi tr SLA ID nh danh cc site trong t chc. Tuy nhin, vi phng php ny s ko ti u vi cc t chc ln tri trn mt khu vc a l rng vi nhiu chi nhnh m mt s trong cc chi nhnh li s dng dch v ca cc nh cung cp khc nhau. B. Cp pht gia trn v tr a l : Cc a ch c cp pht gia trn khu vc a l v cc nh cung cp ch cn duy tr cc tuyn bn ngoi lin kt vi cc tuyn ca h. Tuy nhin, cc nh cung cp ko thch phng php ny bi n lm phc tp ho thm qu trnh qun l a ch. Do s pht trin ca cng ngh cc kh khn trong vic cp pht a ch theo nh cung cp c gii quyt. Vic cp pht a ch theo v tr a l ch cn oc pht trin nhm cho nhng mc ch automatic v dynamic configuration bao gm c vic t ng nh li a ch ton mng khi ISP thay i.

1.3.Cc loi a ch IPv6


1.3.1. a ch unicast : c s dng phn bit cc host n l trn mt mng. Bao gm 3 loi a ch : Global : c dng nh dng cc giao din, cho php thc hin kt ni cc host trong mng IPv6 ton cu. N ging nh a ch IPv4 nh danh 1 host trong mng Internet hin nay. Link local : nhn dng ng kt ni ni b, ko c a vo nh tuyn. Site local : nhn dng trong phm vi ni b, c th c nhiu nhm.
1.3.1.1.

Global unicast

Hnh 2.3 : Cu trc a ch Global unicast

FP=001 : nh dng prefix vi a ch global unicast TLA ID : nh danh nh cung cp cao nht trong h thng cc nh cung cp dch v RES : cha s dng NLA ID : nh danh nh cung cp tip theo

20

SLA ID : nh danh cc site ca khch hng cui Interface ID : c nh danh theo chun EUI-64. Tu thuc vo chun cc giao tip khc nhau m c a ch interface khc nhau

Nh vy a ch global unicast c thit k phn cp : 48 bits public topology 16 bits site topology 64 bits giao din

Hnh 2.4 : cu trc phn cp ca iach unicast

1.3.1.2. Local unicast a ch local unicast li c chia lm 2 loi : Link local : c s dng t a ch cho cc kt ni n Site local : c dng t a ch cho cc interface trong 1 site A. Site local Cu trc a ch site local unicast

Hnh 2.5 : Cu trc a ch site local

Quy tc nh tuyn Router ko th chuyn cc gi tin c a ch ngun hay ch l a ch site local unicast ra ngoi mng Cc a ch site local ko th chn ng trn ton b internet. Chng ch c th dng chuyn i gia 2 chng trn cng 1 site
B. Link local

21

Hnh 2.6 : Gn a ch link local

Cu trc a ch link local

Hnh 2.7 : Cu trc a ch link local

a ch link local ko tham gia nh tuyn

Hnh 2.8 : gn ia ch trong 1 link

1.3.2. a ch Anycast

c gn cho 1 nhm cc giao din v cc gi tin c gi n a ch anycast s c chuyn n giao din gn nht c a ch ny. V mt cu trc, a ch anycast ko phn bit vi da ch unicast, khi a ch unicast c gn cho nhiu giao din n s tr thnh anycast Mc ch ca a ch anycast l h tr nhng t chc c cu trc mng phn cp. Khi a ch anycast c gn cho cc Router m cc Router ny c chia thnh cc vng. Khi 1 packet n Router cao nht n s c chuyn n ng thi cc Router trong on Hn ch ca a ch anycast Ko c s dng l a ch ngun ca 1 gi tin IPv6 Ko c gn cho 1 host IPv6, ch gn cho Router a ch anycast c bit dng gn cho 1 subnet

22

Hnh 2.9 : cu trc a ch anycast dng gn cho 1 subnet

a ch ny c s dng cho nhng giao din cn giao tip ng thi vi 1 tp cc Router trn mng
1.3.3. a ch Multicast c dng gn cho 1 tp cc giao din. Mt gi tin c a ch ch l multicast s c gi n tt c cc giao din c a ch multicast ny Cu trc a ch multicast

Hnh 2.10 : cu trc a ch multicast

ngha cc trng : 8 bit u tin ca a ch 11111111 : nh ngha cho a ch multicast.

bit tip theo ca a ch multicast l cc bit c (flag) 3 bt u ko dng n. Bit c th t c bit n nh mt bit nt m. Nhim v ca n l biu th xem a ch l mt a ch tm thi hay thng xuyn. Nu a ch l a ch thng xuyn th bit ny s c gn bng 0 cn ngc li n s c gn bng 1. 4 bits tip theo l ID scope : dung gii hn phm vi nhm a ch multicast

Bng 2.2 : Trng ID scope

23

112 bit cn li c s dng cho nhm ID. Kch thc ca nhm ID cho php cc a ch multicast dng ht 1/256 phn khng gian a ch ca IPv6.
1.3.4. Cc dng a ch IPv6 khc

Ngoi 3 dng a ch trn, IPv6 cn quy nh 1 s loi a ch c bit khc : a ch ko xc nh ::/128 : a ch ny ko c gn cho interface no. Host khi mi khi to c th s dng a ch ny nh a ch ngun ca n trc khi n c a ch.

a ch loopback 0:0:0:0:0:0:0:1 : mt node c th s dng a ch ny gi gi tin IP cho chnh n. N ko c s dng nh a ch ngun

a ch IPv4 trong IPv6

Hnh 2.11 : Cu trc a ch IPv4 trong IPv6

32 bit thp s l a ch IPv4, 96 bits cao gn bng 0

2. Cu trc gi tin IPv6


Cu trc gi tin IPv6 c dng nh sau :

Hnh 2.12 : Cu trc gi tin IPv6

Header ca gi tin IPv6 bao gm 8 trng (40bytes) so vi IPv4 c 12 trng v di 20 bytes (nu ko c trng option) hoc 60 bytes (nu c trng option). Do cu trc ca trng header ca IPv6 n gin hn nn vic x l thng tin s nhanh hn. Header n gin hn l do s thay i ca 1 s phng thc hot ng Header c cng kch thc nn b trng header length Qu trnh fragmentation ch do source node thc hin nn cc Router ko tham gia vo qu trnh fragmentation trng fragmentation ko cn thit Tuy nhin qu trnh ny ko nh hng n s tin cy ca qu trnh truyn gi tin Extension header : IPv6 extenssion header l mt c ch m bng cch nhng thng tin ca lp internet c m ho trong nhng header ring bit c th c trong header ca IPv6 v cc header ca cc lp trn ca cng 1 gi tin

2.1.Cu trc Header ca gi tin IPv6


24

Hnh 2.13 : So snh header ca gi tin IPv4 v IPv6

Cc trng trong header ca gi tin IPv4 Version : u l 4 bits c IPv6 v v4. Trng ny phi c c 2 version IPv6 c th cng tn ti vi IPv4 Header length : ko c IPv6 do header ca cc gi tin IPv6 c cng kch thc, IPv4 cn trng ny do kch thc header ca n c th thay i do c thm trng option Type of service/Differentiated Services : trng DS c s dng c IPv4 v v6 bao gm 6 bits ch ra cch m gi tin c x l Router m bo QoS Datagram length : tr thnh trng payload length IPv6. IPv4 trng DL ch ra chiu di ca ton b gi d liu k c header, R c th tnh chiu di payload bng cch tr chiu di Datagram cho chiu di Header. IPv6 th do chiu di header xc nh nn ch cn trng PL Datagram Identification : dng xc ch datagram ny l do gi no fragment ra. Do IPv6 ko cho php cc node trung gian fragment gi tin nn trng ny ko cn Flags : c s dng cho php fragment Fragment Offset : c s dng cho php fragment TTL : Protocol : ch n giao thc lp cao

Cc trng trong header ca gi tin IPv6 Version : Differentiated Services : 6 bit, 2 bit dng cho tng lai, cn 4 bit ch priority ECN(Explicit Congestion Notification) : 2 bits Flow Label : 20 bits dng xc nh gi tin thuc cng 1 lung. Do mt node c th l ngun ca nhiu ngun, gi tr FL v ch ngun xc ch duy nht 1 lung Payload length : 16 bits cha 1 s nguyn ch ra chiu di trng payload bng bytes bao gm c trng IPv6 extension header Next header : ch ra giao thc no wocj dng x l gi tin. Hop limit : 8 bits. Mi ln 1 node forward gi tin n s gim gi tr ca trng ny i 1. Nu trng ny = 0, gi tin s b hu. Sadd, Dadd

25

hn s dng d liu c ng gi vo gi tin IPv4. L trng Next header trong IPv6 ch ra Header checksum : Source add, Destiantion add : IP option : ko c IPv6
Bng 2.3 : So snh header ca IPv4 v Ipv6

2.2.Extension header
Mi loi ca exension header c nh ngha bi 8 bits trng Next header ca header trc

Hnh 2.14 : cu trc gi tin IPv6 v trng extension header

Cc gi tr ca trng next header Next header type Hop-by-hop Options IPv6 Routing Fragment Authentication Value 00 41 43 44 51

to ng hm IPv6

26

Destination Options 60 Encapsulating Security Payload 50 No next header 59

Ko c header tip theo header ny

Bng 2.4 : Cc gi tr ca trng Next header

Cc loi extession header : Hop-by-hop : mt s gi tin IPv6 c yu cu ch do node ngun v node ch x l, cn li hu ht th u cn t nht 1 Router trung gian x l. Header hop-by-hop c s dng khi 1 trong s cc option cn phi c x l bi mi node trn ng t ngun n ch Routing : cho php node gi 1 gi tin n 1 hoc nhiu Router cc Router x l v nh tuyn n ch Fragment : mc d IPv6 ko cho php cc Router trung gian fragment gi tin, cng vic ny l ca cc node ngun v ch. Tuy nhin khi node ngun thy rng n cn phi gi gi qua wongf truyn c MTU nh hn kch thc gi th cc node trung gian c php fragment gi tin v gi tin c thm trng fragment Authentication : khi s dng phng php xc thc c an ton cao header ny c s dng Destination : gii hn ch nhng node ch no mi x l nhng option m gi tin mang theo. Encapsulating Security Payload : khi ta s dung jphng php m ho c an ton cao Cc extension header c sp xp theo 1 th t nht nh sau header chnh m bo tt c cc thng tin optional c x l bi node ch cng nh cc node trung gian trong khi cng thi gian cho php cc node x l gi tin theo thng tin optional. VD : hop-by-hop c t ngay sau header chnh v n phi c x l bi tt c cc node trung gian Destination c t di cng v cc node trung gian ko nht thit phi x l option ny Th t cc extension header c khuyn co a ra trong RFC 2460 IPv6 header Hop-by-hop Destination option Routing header Fragment header Authentication header Encapsulation Security Payload header Destiantion option header Upper layer header

27

Hop-by-hop option v Destination Option Header c th cha 1 hoc nhiu option. Ko ging cc IPv6 extenssion header khc chi thc hin 1 chc nng, 2 header kia l cc header ti to v ch c phn bit bng cch n hot ng Hop-by-hop : cha cc option c x l ti mi node Destination : cha cc option ch c x l ti node ch

3. ICMPv6
L giao thc s dng bn tin ICMPv6 thng bo li hoc thu ht cc p ng t 1 node ly thng tin cn thit. Cc ng dng nh : ping, trace route, Path MTU Discovery, Neighbour discovery gia trn ICMPv6. Bn tin ICMP c ng gi trong gi tin IP v c xc ch bi trng next header = 58

3.1.Cu trc

Hnh 2.15 : Cu trc bn tin ICMP

ngha cc trng Type : 8 bit , ch ra loi bn tin ICMPv6, (0-127) : l bn tin error mess, (128-255) l bn tin thng bo Code : 8 bits ph thuc vo trng type Checksum : 16 bits Mess body : cha d liu

3.2.Mt s loi bn tin ICMP


Bn tin ICMP wocj to ra khi c 1 s li : router ko th gi c gi tin, node ko th khi phc wcj gi tin b li, .Ch rng khi 1 link ang tc nghn node ko bao gi gi bn tin ICMP thng bo tc nghn bi iu ny ch lm mi th thm t hn. Mt s phng thc khc tng cao hn s c dng gii quyt vn ny. 3.2.1. Destination unreachable : c gi cho node ngun khi R nhn c gi tin m n ko th gi i u c. Cu trc bn tin

28

Hnh 2.16 : cu trc bn tin ICMP des unrechable

Cc gi tr c th c ca trng code 0 : ko c tuyn ch : R ko c tuyn ch tng ng vi a ch ch ca gi tin. Bn tin ny ch c gi vi nhng R ko c default route 1 : communication with administratively prohibited : bn tin ny wocj gi bi firewall khi 1 loi traffic b cm wocj gi ti 1 host bn trong firewall 2 : cha c gn 3 : addr unreachable : 4 : port unreachable : c to bi node ch khi cc tng trn ko bt s l gi tin ny th no

3.2.2. Packet too big : c gi cho node ngun khi Router nhn c gi tin ln hn gi tr MTU ca link Cu trc bn tin

Hnh 2.17 : Cu trc bn tin ICMP packet too big

3.2.3. Time exceeded : C 2 loi Khi gi tin chy trong mng trong khong thi gian qu lu m ko n ch

29

Gi tin vt qu c thi gian phn mnh v ghp mnh qu lu Cu trc bn tin

Hnh 2.18 : Cu trc bn tin ICMP time exceeded

Cc gi tin qu lu trong mng s b loi b khi gi tr vt qu gi tr hop limit. R s xo cc gi tin c gi tr trng hop limit = 0 hoc 1 v gi bn tin ICMP v cho node ngun 1 : hop limit vwotj qu gii hn 0 : qu time out m ko gi c Bn tin ny c dng cho chc nng trace route u tin 1 bn tin c gi n ch vi hop limit =1, R u tin nhn c s gi li bn tin time exceeded v node ngun s bt R u tin trn ng truyn. Ngun li gi bn tin th 2 vi hop limit = 2 v R thu 2 s gi li bn tin time exceeded C th cho n khi gi tin n c ch v node ngun s c thng tin v tt c cc R trung gian 3.2.4. Parameter problem : c gi cho node ngun khi c vn vi 1 vi phn ca gi tin IPv6 hoc trng extension header khin cho Router ko th x l v phi xo gi tin. Cu trc bn tin

Hnh 2.19 : Cu trc bn tin ICMP parameter problem

3.2.5. ICMPv6 Echo Funtion : echo request v echo reply

30

Echo request : c gi ti tt c cc a ch valid IPv6 c th thm gi tr Echo req ident, seq num v mt s d liu. Gi tr ident v seq phn bit cc gi tr reply khc nhau. Data l gi tr optional Khi 1 node nhn bn tin req n phi gi li bn tin Echo reply vi cc gi tr ident, seq, v data ging nh bn tin Echo request Cu trc

Hnh 2.20: Echo Request

Hnh 2.21 : Echo reply

2 bn tin ny l thnh phn ca lnh Ping

3.3.Qu trnh phn mnh v xc nh MTU


3.3.1. Qu trnh phn mnh Qu trnh phn mnh trong IPv6 ch c cho php gia node ngun v ch, iu ny lm n gin trng header v gim cc thng tin overhead cho nh tuyn. Cc node IPv6 c th c php phn mnh nu cn thit s dng trng fragmentation tuy nhin cc Router trung gian hoc cc node khc ko c php phn mnh gi tin ln hn MTU IPv4 cho php phn mnh nu gi tin cha phn mnh mt qu nhiu thi gian n ch. Cc Router trung gian thc hin vic phn mnh c th thay i header ca gi tin n node ch c th ti hp cc mnh li thnh gi tin hon chnh. S dng phn mnh cho php cc node hot ng trong cc mi trng mng khc nhau hot ng vi nhau tt hn. Node ngun ko cn bt v node ch cng nh thng tin v ng truyn n ch. iu ny lm gim thng tin m node ngun cn phi lu tr v mng v cho php kh nng m rng cao. Tuy nhin, phn mnh lm thm cc header, overhead, v lm Router tn CPU x l. C 2 cch hn ch phn mnh l : Cch 1( c s dng IPv4) : path MTU discovery : Router s gi 1 gi tin c kch thc bng MTU ca link u tin n ch nu gi tin n link no m n b phn mnh, Router phn mnh s gi li bn tin ICMP ch ra MTU ca link l bao nhiu. Qu trnh c tip din cho n khi R xc nh c link path MTU Cch 2 : l hn ch n mc ti thiu kch thc gi tin tt c cc link u c th chp nhn c
31

3.3.2. IPv6 path MTU discovery IPv6 s dng c 2 cch hn ch phn mnh trn MTU cho IPv6 c nh ngha RFC 2460 l 1280 bytes Tuy nhin IPv6 khuyn co nn s dng c ch MTU discovery s dng bit dont fragment trong trng flag fragment cc R trung gian gi li bn tin ICMP error bo gi tin qu ln

Hnh 2.22 : Path MTU discovery

4. Neighbour discovery
Cc node IPv6 trong cng 1 link s dng ND khm ph s tn ti ca nhau, a ch tng 3 ca nhau, tm Router v duy tr thng tin v ng i xy dng neighbour. Nh vy cc giao thc lin quan nh ARP ko cn cn thit na

4.1.Cc bn tin ICMP s dng trong neighbour discovery


ND s dng 1 s loi bn tin ICMP sau thc hin cc chc nng ca mnh : Router solicitation : khi 1 inter bt u hot ng, host s gi Router solicitation yu cu Router gi li Router Adv Router Adv : R s thng bo s tn ti ca n v cc thng s theo chu k hoc khi nhn c bn tin R Solic Neighbour Solicitation : c gi bi node xc nh a ch link layer ca neighbour hoc kt xem neighbour c reachable hay ko? Neighbour adv : tr li li bn tin neighbour solic

32

Redirect : c s dng bi Router ch cho host first hop tt hn n ch. 4.2. Bn tin Router Solicitation : Cho php 1 node yu cu R gi R adv ngay lp tc. Bng cch ny 1 node c th ghi nh a ch IP v a ch tng 2 ca Router. Router solicitation c gi multicast ti tt c cc Router trong bt c phm vi no ca gii hn a ch ch IPv6. Tt c cc Router trong phm vi ny phi tr li li vi bn tin Router adv. Bnh thng Router s gi bn tin qung b ny trong 1 chu k nht nh v n gi ti tt c cc node c a ch multicast. Tuy nhin khi p ng yu cu ca host n ch gi li cho host gi bn tin Router Solicitation. 4.2.1. Cu trc bn tin Router Solicitation :

Hnh 2.23 : Cu trc bn tin Router Solicitation

4.3.Mt s chc nng m ND cung cp


IPv4 s dng ARP nh x a ch IP vi a ch tng 2, nhng c 1 s hn ch. ND trong IPv6 cng c chc nng ny tuy nhin n cn cung cp 1 s chc nng phc tp khc Router discovery : cung cp c ch xc ch local router Prefix discovery : Parameter discovery : c ch xc nh cc thng s ca local link network, MTU, hop limit, Addr autoconfiguration : Addr resolution : xc nh a ch lp 2 ca 1 host neighbour m ch bt a ch IP ca n. Nexthop detemination : khi mun gi 1 gi tin i, host phi xc ch a chi gi. Quyt nh ny gia trn a ch ch ca gi tin v host cn phi quyt ch gi gi tin n thng ch nu trong cng 1 local link hay gi n router nu ko trong cng 1 local link. Neighbour unreachable detection : ht cn c ch cho php xc nh neighbour ca n c reachable ko? Nu l router th default route ng c s dng Duplicate addr detection : xc nh a ch ny c s dng cha? Redirect : Link-layer addr change : 1 node khi pht hin a ch lp 2 ca n thay i c th gi multicast update thng tin thay i ny. Inbound load balancing : 1 node c nhiu a ch lp 2 trn cng 1 inter c th chia ti trn cc inter .
33

Load balancing : Anycast addr : Anycast addr c dng xc nh 1 trong 1 tp hp cc node cung cp nhng dch v tng ng nhau. Cc node trong 1 local link c th c config nhn ra cng 1 a ch anycast. ND x l a ch anycast bng cch cc node nhn cc bn tin Neigh adv Proxy adv :

5. IPv6 autoconfiguration
Stateful autoconfiguration : DHCPv6 c pht trin t BOOTP. DHCP cho php host config bng DHCP server. Server s lu nhng thng tin v a ch IP, a ch link layer ca tt c cc node s dng dv ny trnh c 2 node s dng cng 1 a ch IP Stateless autoconfiguration : cho php node IPv6 c th t config m ko cn server Router v network renumbering : vic s dng a ch local cho php mt mng c th chuyn t nh cung cp ny sang nh cung cp khc. Cc a ch site local cho php ch tuyn trong mng trong khi nh tuyn ngoi mng s c thc hin bng cch config li router gateway.

5.1.Stateful v Stateless autoconfiguration :


DHCP server c th cung cp a ch theo 3 cch : Automatic : DHCP server s gn a ch IP 1 cch lu di cho host Dynamic : DHCP s cp pht a ch cho host trong 1 khong thi gian nht nh Manual : ngi qun tr s cp pht a ch IP cho host v DHCP ch c dng vn chuyn a ch ny n host Trong c 3 trng hp, u i hi server phi lu gi thng tin v a ch cp pht. Stateless autoconfiguration li ko i hi Server phi lu gi thng tin v a ch cp pht v cho php 1 node c th t config mt cch c lp. 2 phng php ny c th hp tc vi nhau thng qua giao thc ND 5.1.1. DHCPv6 Cc bn tin : c ng gi s dng UDP. Client ban u cha c a ch IP hoc cha c DHCP cp pht a ch IP s gi yu cu n n i ch multicast ginh ring cho DHCP server : Tt c cc DHCP agent v server : FF02::1:2 Tt c cc DHCP server : FF05::1:3 Tip theo client s tip tc gi gi tin yu cu cp pht a ch multicast mc d c a ch unicast c th s dng DHCP relay agent gi gi tin t client n 1 DHCP server xa. iu ny s hiu qu hn so vi vic client gi unicast trc tip n server.

34

Cc loi bn tin DHCPv6 SOLICIT : client gi bn tin ny xc ch DHCP server ADV : server gi li bn tin ny tr li bn tin SOLICIT ch ra rng n ang cung cp dch v DHCP REQ : client gi bn tin ny yu cu cc thng tin CONFL : client gi bn tin ny n cc server avai thng bo rng a ch n c cp pht xung t vi a ch trong link m n lin kt RENEW : client gi bn tin ny n server cp pht a ch cho n gia han a ch ny REBIND : client gi bn tin ny n xin gia hn a ch ng thi xin thm 1 s thng s, bn tin ny oc gi sau khi bn tin RENEW ko c tr li. REPLY : cha cc thng tin config tr li cc bn tin SOLICIT, REQ, RENEW, REBIND, RELEASE : client gi bn tin ny ti server cp pht a ch ny cho n thng bo ko s dng a ch ny na DECLINE : client gi bn tin ny ti 1 server ch ra rng a ch ny c s dng trogn link RECONFIG : server gi bn tin ny cho client ni rng server mi c thng tin update mi v client phi gi bn tin RENEW hoc REQ nhn thng tin update INFO-REQ : client gi bn tin ny ti server yu cu cc thng s config, m ko c a ch IP RELAY-FORW : relay agent gi bn tin ny chuyn tip bn tin ti server hoc ti mt agent khc RELAY-REPLY : Server gi bn tin tr li n relay agent chuyn n relay agent khc hoc client Qu trnh trao i client/server s dng 2 bn tin : bn tin REQ ca client v REPLY ca server. Client ko cn cp pht a ch IP m m cn 1 s thng tin config khc nh : a ch cc DNS server. Client s bn tin DHCP REQ ti a ch multicast ca tt c cc DHCP relay agent v server. Server s gi li bn tin tr li. Client yu cu gia hn a ch IP. Client gi bn tin RENEW v server gi li bn tin thi gian m client c th tip tc s dng a ch ny Cp pht a ch IP : thng thng qu tnh ny cn 4 bn tin tuy nhin c th thc thin qu trnh ny trong 2 bn tin khi server c thng tin cp pht cho client ny lu trong c s d liu. Qu trnh trao i s dng 4 bn tin : theo th t sau SOLICIT-ADV-REQREPLY
35

5.1.2. Stateless Autoconfiguration : Gia trn EUI-64 cho php xc nh 1 cch duy nht 1 node trong 1 local link. Nu 1 node s dng a chi link local c ngha l tt c cc node c th x l gi tin gi n hoc c gi t 1 a ch link local unicast. Tuy nhin gi tin ny ko c gi ra ngoi link. S dng ND cho php cc node ring bit c th thu thp thng tin router v cc server trong link. Mt phn cu giao thc ny cho php xc nh network prefix. Do , cc nod c th khm ph tt c thng tin n cn m ko cn dng DHCP Qu trnh t config bao gm cc bc sau : T to 1 link local addr cho node Kim tra tnh duy nht ca a ch trong link : s dng ND gi gi tin ti a ch m node va to, nu c host s dung a ch ny ri n s tr li li v qu trnh auto config kt thc, node phi c config bng tay Quyt nh xem thng tin no c th t config, thng tin no cn phi yu cu Mc ch ca stateless autoconfiguration : Hn ch vic config bng tay trc cho cc kt ni : cc node c th ko cn phi config trc khi n c kt ni vo link. Ta gi s rng mi inter c th to ra 1 s duy nht cho mi inter(n gin nht chnh l a ch link layer ca n) Hn ch cc Stateful server/router trong nhng mng nh : trong mng nh vic s dng DHCP l ko cn thit Hn ch cc statefull server trong cc mng ln : trong mng ln to cc a ch site local v global addr host phi xc nh prefix xc nh mng m n kt ni vo. Router nh k gi R adv c kit k tp hp cc prefix s dng trong mng Lm qu trnh site renumbering d dng hn : Kim sot qu trnh cp pht a ch: ngi qun tr cn phi ch r khi no dng statefull khi no dng stateless hoc khi no dng c 2. R adv c bit flag ch ra c ch no oc dng

5.2.Router v network renumbering

6. nh tuyn trong IPv6


V c bn nh tuyn trong IPv6 ko khc nhiu so vi nh tuyn trong IPv4. N cng c chia thnh 2 loi Interior v Exterior Cc giao thc Interior c s dng bn trong mt min c kt ni ti internet

36

Cc giao thc Exterior c s dng trn mng backbone vi cc min c kt ni vo do vy c ch ca n phc tp hn nhiu so vi Interior routing protocol Cc giao thc nh tuyn hot ng gia trn cc thut ton nh tuyn.C 2 thut ton nh tuyn c bn nht l distance vector v link state
6.1. Distance vector :

Thng tin nh tuyn bao gm : hng khong cch gia cc node Hot ng Ban u, mi Router thu thp thng tin nh tuyn v cc mng kt ni trc tip vo n. nh k, cc Router s gi bn copy ca bng nh tuyn cho cc router hng xm. Sau khi nhn c thng tin nh tuyn t hng xm, cc Router chy thut ton nh tuyn to bng nh tuyn. Ri li theo chu k gi bng nh tuyn ca mnh cho cc Router hng xm.
6.2. Link state

Thng tin nnh tuyn bao gm Link Trng thi ca link Hot ng : Cc gi LSA c trao i gia cc Router Cc Router gia trn thng tin thu c t cc LSA xy dng nn topology ca mng vi chnh n l gc. Cc Router chy thut ton SPF tm ra ng ngn nht c interface tng ng ti ch Cc Router a thng tin v ng ngn nht v interface tng ng vo bng nh tuyn Khi 1 Router pht hin ra thay i ca mng. n s gi thng tin update di dng cc gi LSA n cc Router neighbour vi n. C th tt c cc Router u nhn c thng tin update. Sau , database ca cc Router s c update v chy thut ton SPF xy dng li bng nh tuyn
6.3. RIP v RIPng

L giao thc thuc loi distance vector

37

Hnh 2.24 : Hot ng ca RIP

Mt s c im ca RIP S dng metric l hop count Maximum hop count = 15 Chu k gi thng tin nh tuyn l 30s C 2 version RIPv1 v RIPv2 . Trong RIPv2 c 1 s ci tin so vi RIPv1: o C kh nng mang thm 1 s thng tin nh tuyn o Cung cp thm kh nng xc thc o H tr subnet mask RIP s dng maximum hop count =15 chng loop. Ngoi ra, cc phng php khc nh Split horizon, holddown timer c th c cu hnh km theo tng kh nng hot ng ca mng RIPng : da trn Rip trn IPv4, s dng gi tin IPv6 chuyn gi tin.
6.4. OSPF v OSPFng

L giao thc nh tuyn theo kiu Link State 6.4.1. Cc loi gi tin trong OSPF trao i thng tin trong OSPF, cc Router s dng cc loi bn tin sau : Hello : thit lp v duy tr thng tin adjacency vi cc neighbour DBD(Database Description Packet) : m t tm tt ni dung c s d liu link state ca 1 Router OSPF LSR (Link state request) : yu cu 1 phn no ca bng c s d liu link state ca Router LSU (Link State Update) : gi cc LSA n cc router neighbour LSACK (LSA acknowledge) : xc nhn nhn gi LSA 6.4.2. Cc trng thi ca 1 OSPF interface Mt interface trong 1 mng s dng OSPF c th trong 1 trong nhng trng thi sau :
38

Down State : ko trao i thng tin Init State : OSPF router gi gi Hello theo chu k 10s thit lp quan h vi cc Router neighbour. Khi 1 interface nhn c gi tin Hello u tin, n bc vo trng thi Init State chun b thit lp quan h vi Router neighbour. C 2 kiu quan h l : Two way v Adjacency Two way State : Khi Router A nhn c gi tin Hello t 1 neighbour RB n gi li gi tin Hello v a thng tin ca RB vo gi tin hello . RB nhn c gi tin hello c tn mnh trong v thit lp quan h Two way vi RA. trng thi ny cc Router ko trao i thng tin nh tuyn. ExStart State : trng thi ny, 2 router trao i gi tin DBD Exchange State : Router so snh thng tin m n nhn c t gi DBD vi thng tin m n c sn. Nu thng tin m n nhn oc cha c trong thng tin ca n c sn, Router s yu cu ton b thng tin t neighbour. Nu thng tin n nhn oc ko c thng tin mi, 2 Router chuyn sang trng thi Full Adjacency. Loading State : Router s dng gi LSR yu cu thng tin. Khi 1 Router nhn oc gi LSR n s gi li gi LSU cha thng tin LSA. Gi LSU c xc nhn nhn bng gi LSACK. Sau 2 Router tr Full Adjacency Full Adjacency :

Hnh 2.25 : S chuyn trng thi v trao i cc gi tin gia 2 interface OSPF

6.4.3. Hot ng Bc 1 : Thit lp router adjacency : Cc Router gi gi hello qung co gi tr Router ID ca mnh cho cc Router khc. Khi n nhn li gi Hello t cc Router khc, nu n thy ID ca mnh trong gi tin Hello, 2 Router s bc vo trng thi Two way.

39

Bc 2 : Bnh bu DR v BDR (nu cn thit, ch trong mi trng multiaccess) DR(Designated Router), BDR (Backup Designated Router) Trong mi trng multiaccess, c rt nhiu Router cng kt ni vo 1 mng. Nu mi Router u thit lp quan h Full Adjacency vi tt c Router cn li trao i thng tin link state th s c qu nhiu thng tin nh tuyn trao i trong mng, lng ph bng thng. Do , ta s thit lp mt Router l DR, c quan h Full Adjacency vi tt c cc Router cn li. 1 Router s gi thng tin link sate n cho DR. Sau , DR s gi thng tin link state cho ny cho cc Router cn li. BDR ng vai tr d tr s thay th cho DR khi DR c vn .

Hnh 2.26 : hot ng ca DR v BDR

Trong qu trnh bnh bu DR, Router c gi tr Router ID cao nht s tr thnh DR, Router c gi tr cao th 2 s tr thnh BDR. Bc 3 : Khm ph cc tuyn : cc Router s trao i gi tin DBD, LSR, LSU, LSACK v thit lp quan h full adjacency Bc 4 : La chn ng ngn nht : sau khi c y thng tin link state, cc Router chy thut ton SPF tm ra ng ngn nht v interface tng ng ri a vo bng nh tuyn Bc 5 : Duy tr thng tin nh tuyn : OSPF nh k gi gi tin hello cc nh thay i trong mng. Khi c thay i trong mng Roter pht hin thay i s gi gi tin LSU cha thng tin thay i n DR v BDR. DR s gi thng tin ny n cc Router cn li trong mng.

40

Hnh 2.27 : S chuyn trng thi ca 1 interface OSPF

6.4.4. OSPFng : OSPFng c nhng im khc so vi OSPF trong IPv4 Cu trc gi tin OSPF c thay i ko cn ph thuc vo i ch IP Bn tin LSA mi c nh ngha mang a chi IP v prefix OSPF chy trn cc link ch ko phi tre mi subnet, mi link c th cha nhiu subnet Ko cn cung cp c ch xc thc m da vo IPsec thc hin c ch xc thc

7. Security trong IPv6


IPsec Giao thc IPsec c lm vic ti tng Network Layer layer 3 ca m hnh OSI. Cung cp cc chc nng bo mt cho IPv6. iu ny to ra tnh mm do cho IPsec hn cc giao thc bo mt hot ng tng trn IPsec cung cp 3 phng thc bo mt sau cc giao thc cung cp mt m (cryptographic protocols) nhm bo mt gi tin (packet) trong qu trnh truyn phng thc xc thc thit lp cc thng s m ho nhm t c cc mc ch bo mt Authentication : xc nh c ngun gc ca d liu Integrity : m bo d liu ko b thay i trong qu trnh truyn Confidentiality : m bo d liu ko b c hc s dng bi ngi khc trong qu trnh truyn
41

IPsec c thit k cho c IPv4 v IPv6. N ko c s dng trong IPv4 do 1 s l do nu trn(IPv4 s dng NAT, ) tuy nhin li tch hp hon ho vi IPv6 do s dng cc extension header. IPsec cung cp cc dch v bo mt M ho qu trnh truyn thng tin m bo tnh nguyn ven ca d liu Phi c xc thc gia cc giao tip Chng qu trnh replay trong cc phin bo mt.

7.1.Cc mode hot ng


IPsec c 2 mode hot ng l Transport mode: trong Transport mode, ch nhng d liu bn giao tip cc gi tin c m ho v/hoc xc thc. Trong qu trnh routing, c IP header u khng b chnh sa hay m ho; tuy nhin khi authentication header c s dng, a ch IP khng th bit c, bi cc thng tin b hash (bm). Transport v application layers thng c bo mt bi hm bm (hash), v chng khng th chnh sa (v d nh port number). Transport mode s dng trong tnh hung giao tip host-to-host. Tunnel mode : trong tunnel mode, ton b gi IP (bao gm c data v header) s c m ho v xc thc. N phi c ng gi li trong mt dng IP packet khc trong qu trnh routing ca router. Tunnel mode c s dng trong giao tip network-to-network (hay gia cc routers vi nhau), hoc host-to-network v host-to-host trn internet.
7.2. Hot ng

IPsec cung cp tnh bo mt cho 2 phin bn IP nh s sng 2 header : IP Authentication Header gip m bo tnh ton vn v cung cp xc thc. IP Encapsulating Security Payload cung cp bo mt, v l option bn c th la chn c tnh nng authentication v Integrity m bo tnh ton vn d liu. 7.2.1. Authentication Header (AH) AH c s dng trong cc kt ni khng c tnh m bo d liu. Hn na n l la chn nhm chng li cc tn cng replay attack bng cch s dng cng ngh tn cng sliding windows v discarding older packets. AH bo v qu trnh truyn d liu khi s dng IP. Trong IPv4, IP header c bao gm TOS, Flags, Fragment Offset, TTL, v Header Checksum. AH thc hin trc tip trong phn u tin ca gi tin IP. di y l m hnh ca AH header.

42

Hnh 2.28 : Cu trc AH

7.2.2. Encapsulating Security Payload (ESP) Giao thc ESP cung cp xc thc, ton vn, m bo tnh bo mt cho gi tin. ESP cng h tr tnh nng cu hnh s dng trong tnh hung ch cn bo m ho v ch cn cho authentication, nhng s dng m ho m khng yu cu xc thc khng m bo tnh bo mt. Khng nh AH, header ca gi tin IP, bao gm cc option khc. ESP thc hin trn top IP s dng giao thc IP v mang s hiu 50 v AH mang s hiu 51.

Hnh 2.29 : Cu trc ESP

43

Kt lun
Nh vy ta thy c vai tr quan trng ca a ch IP vi cc h thng mng hin nay. Vi s cn kit ca khng gian a ch IPv4, vic chuyn sang a ch IPv6 l tt yu. Do , trc tin, ta phi nm c nhng kin thc c bn v a ch IPv6, c trnh by trong bo co ny. T , c th i vo trin khai cc dch v nh web, mail, DNS trn nn IPv6 cng nh chuyn a ch IPv4 sang IPv6. Bo co thc tp ca em cn cnhiu thiu st. Rt mong cc thy c gp sa cha. Em xin chn thnh cm n cc thy c gip em hon thnh bo co thc tp ny.

44

Ti liu tham kho


1. Undersatanding IPv6 by Microsoft
2. Deploying IPv6 Networks By Ciprian Popoviciu, Eric Levy-Abegnoli, Patrick Grossetete

3. http://hocit.com/forum/ - ln cui truy cp 10.16am 27/01/2008 4. http://www.ipv6.org/ - ln cui truy cp 10.16am 27/01/2008

45