Está en la página 1de 23

TRNG I HC CNG NGHIP TP.

H CH MINH

2012

KHOA CNG NGH THNG TIN

Mng cn bn
ti 4: Tm hiu Unicast, Broadcast,
Multicast, Anycast
GVHD: Hunh Thi Hc

Nhm 17
Lp DHTH6A
6/1/2012

Mc lc
Li m u .............................................................................................................................. 2
Danh sch thnh vin .............................................................................................................. 4
Unicast ..................................................................................................................................... 5
Cc khi nim c bn........................................................................................................... 5
Cc dng a ch Unicast ...................................................................................................... 5
Broadcast................................................................................................................................. 9
nh ngha ............................................................................................................................ 9
Cch thc hot ng .......................................................................................................... 10
ng dng ca Broadcast .................................................................................................... 10
Multicast................................................................................................................................. 11
Mt s yu cu cn phi thc hin c th p ng c mc ch ca multicast: ........ 11
a ch Multicast ................................................................................................................. 11
Permanent Group ............................................................................................................... 12
SSM (Source Specific Multicast)......................................................................................... 12
Glop ................................................................................................................................... 12
Private Multicast Domain .................................................................................................... 13
Tng quan IP - MAC ........................................................................................................ 13
IGMP .................................................................................................................................. 13
Ti u ha Multicast trn LAN ............................................................................................ 14
nh tuyn Multicast ........................................................................................................... 14
Dense - Mode v Sparse - Mode ........................................................................................ 16
Anycast .................................................................................................................................. 16
Tng quan IPv4 v IPv6 ..................................................................................................... 16
Cu trc IPv6...................................................................................................................... 17
Phn loi a ch IPv6 ......................................................................................................... 17
Khi nim a ch Anycast................................................................................................... 18
Phn tch hot ng Anycast .............................................................................................. 18
TI LIU THAM KHO .......................................................................................................... 22

Nhm 17

Li m u
Th no l Unicast, Broadcast, Multicast v Anycast. C g khc nhau gia
chng, bi thuyt trnh ca nhm 17 s gip cc bn nm c nhng nt c bn ca
bn loi a ch mng ny.
Vi s ra i ca chun giao thc mng TCP/IP th chng ta c mt tm nhn
mi cho giao thc mng, cng chnh t cc khi nim v giao thc v a ch trn tr
nn kh hiu v d nhm ln.
a ch IPv4 nh ngha ba loi a ch: Unicast, Broadcast v Multicast.
a ch IPv6 nh ngha Unicast, Multicast v Anycast. Broadcast khng cn
nh ngha trong IPv6 m chc nng ca n c Multicast m nhn.
C c ci nhn tng quan v IPv4 v IPv6 ta c th tip tc tm hiu su hn
v n mt cch khng nhm ln, t y ta khng cn phi bi ri vi nhng cu hi
nh IPv4 v IPv6 hot ng nh th no?, Chng khc nhau im no?, l
a ch hay l cch thc truyn?. Ch ny s lm sang t nhng iu .
Tht t khi bn tm hiu v Anycast th khng c g khc ngoi s nhm ln ban
u, v bn v tnh c tip cn kin thc v Unicast v Multicast trc . Ci bn
s nhm ln v c dn dt vo con ng lc li chnh l khi nim v cch thc
hot ng ca n, v d nh khi chng ta gn a ch ny cho mt Interface th n y nh
l Unicast khi bn gi d liu, nhng khi ta gn a ch ny cho nhiu Interface th n
ging nh Multicast . Tht rc ri!!! Nhng khi bn c n phn sau th bn s thy
c s khc bit gia Anycast v Multicast.
Cui cng, mt im ch y l t u n gi ta nhn thy rng trong IPv6
sao li khng c a ch Broadcast, v chc nng ca a ch ny bao gm trong
nhm a ch Multicast.
Trong a ch IPv6 khng cn tn ti khi nim a ch Broadcast. Mi chc
nng ca a ch Broadcast trong IPv4 c m nhim thay th bi a ch IPv6
Multicast. a ch Multicast ging a ch Broadcast ch im ch ca gi tin l mt
nhm cc my trong mt mng, song khng phi tt c cc my. Trong khi Broadcast
gi trc tip ti mi host trong mt subnet th Multicast ch gi trc tip cho mt nhm
Nhm 17

xc nh cc host, cc host ny li c th thuc cc subnet khc nhau. Host c th la


chn c tham gia vo mt nhm Multicast c th no hay khng (thng c thc
hin vi th tc qun l nhm internet - Internet Group Management Protocol), trong
khi vi Broadcast, mi host l thnh vin ca nhm Broadcast bt k n c mun
hay khng.
Nhm 17

Nhm 17

Danh sch thnh vin


1.
2.
3.
4.

Hunh Tn Ba
Trn Quc i
Nguyn Quc Hng
Phm Xun Ph

Nhm 17

Unicast
Cc khi nim c bn
a ch Unicast c s dng phn bit cc host n l trn mt mng.
Unicast l cc nhm a ch IP thuc cc lp
A, B, C m trong qu trnh truyn v nhn
d liu ch xy ra gia hai im a ch
ngun v a ch ch.
Mt a ch Unicast cho php thit b gi d
liu n mt ni nhn duy nht.
Ch cho pht tn hiu t mt my n mt
my.
Mt host s nhn tt c cc d liu truyn t mt host no .

Cc dng a ch Unicast
1. a ch c bit (Special Address - SA)
0:0:0:0:0:0:0:0:0 vit gn :: l dng a ch khng xc nh, c s dng
xc nhn rng hin ti node khng c a ch, khng bao gi a ch ny c gn
cho giao din hoc s dng lm a ch ch.
0:0:0:0:0:0:0:1 hay ::1 a ch xc nh giao din loopback, tng ng vi
a ch 127.0.0.1 ca IPv4. Cc gi tin c a ch ch ::1 khng c gi trn
ng link hay forward i bi router. Phm vi ca a ch ny l phm vi node.
2. a ch Link Local (Link Local Adress - LLA)
S dng bi cc node khi giao tip vi cc node ln cn (Neighbor Node).
Phm vi ca dng a ch Unicast ny l trn mt ng kt ni (phm vi link).
LLA lun c cu hnh mt cch t ng.
Cu trc LLA
LLA bt u bi 10 bit prefix l FE80::/10, tip theo l 54 bit 0, 64 bit cn li l
phn nh danh giao din (interface ID).
LLA bt u bi 10 bit prefix l FE80::/10, tip theo l 54 bit 0, 64 bit cn li l
phn nh danh giao din (interface ID).

Nhm 17

3. a ch Site Local (Site Local Adress - SLA)


Phm vi s dng: trong mt mng, tng ng vi dy IPv4 private
(10.0.0.0/8, 172.16.0.0/12 v 192.168.0.0/16).
Router khng forward gi tin c a ch site-local ra khi phm v mng.
C th dng trng lp bi nhiu t chc.
Cu trc SLA
Lun bt u bng 10 bit prefix FEC0::/10, tip theo l 38 bit 0 v 16 bit subnet,
64 bit cui cng l bit nh danh giao din.
Hin t chc IETF loi b SLA, trong tng lai s thay th bng a ch
Unique Local Unicast ang c son tho.

Unique Local Unicast Address - ULUA

Phm vi s dng ca a ch ny l ton cu


Thay th cho a ch site-local
Cu trc ULUA
Lun bt u bng 8 bit prefix FD00::/8, tip theo l 40 bit Global ID v 16
bit subnet, 64 bit cui cng l bit nh danh giao din.

4. a ch Unicast nh danh ton cu (Global Unicast Address - GUA)


Tng ng a ch IPv4 public, c phm vi ton cu.
T chc quc t IANA m nhim vic phn b v cp pht.
Tnh duy nht ca a ch ny l phm vi ton mng Internet IPv6.
Cu trc GUA
IPv6 ton cu ang s dng a ch thuc vng 2000::/3. Khng gian a ch

Nhm 17

c phn cp nh hn cho tng mc ch s dng c th.


Nu mt a ch IPv6, c bt u bi 2000::/3, chng ta bit l vng a ch
nh tuyn ton cu.
Hin ti IANA cp pht vng 2001::/16 cho hot ng internet IPv6 ton cu.
(http://www.iana.org/assignments/ipv6-unicast-address-assignments/ipv6-unicastaddress-assignments.xml)

Phn cp nh tuyn IPv6 Unicast ton cu


Phn c nh: 3 bit u tin 001 xc nh dng a ch Global Unicast.
Phn nh tuyn ton cu: 45 bit tip theo, cc t chc s phn cp qun l vng
a ch ny, phn cp chuyn giao li cho cc t chc khc.
Kch thc nh nht trong nh tuyn ra ngoi phm vi mt site l prefix /48.
Kch thc a ch nh nht c phn b cho mt ISP l /32v nu khch hng
ca ISP cn nhiu hn mt subnet khi t chc s nhn c prefix l /48.

Nhm 17

Phn cp v qun l a ch IPv6


Vng nh tuyn trong site: bao gm 16 bit, cc t chc c th t qun l, phn
b, cp pht v t chc nh tuyn bn trong mng ca mnh. Vi 16 bit, c th to
nn 65,536 mng con (subnet) hoc nhiu cp nh tuyn phn cp hiu qu s
dng trong mng ca t chc.
5. a ch tng thch (Compatibility Address - CA)
a ch ny nhm mc ch h tr vic chuyn i t a ch IPv4 sang IPv6,
bao gm:
S dng trong cng ngh bin dch gia a ch IPv4-IPv6.
S dng trong cng ngh chuyn i ng hm - tunnel s dng h tng
sn c ca mng IPv4 kt ni cc mng IPv6 bng cch bc gi tin IPv6 vo
trong gi tin nh a ch IPv4 truyn i trn mng IPv4.
C ba loi a ch CA:
1. a ch tng thch IPv4-Compatible Address (IPv4-CA)
2. a ch nh x IPv4-Mapped Address (IPv4-MA)
3. a ch 6to4
Cu trc a ch tng thch IPv4 - Compatible Address (IPv4-CA)
a ch IPv4-CA c to t 32 bit a ch IPv4 v c biu din nh sau:
0:0:0:0:0:0:w.x.y.z hoc ::w.x.y.z trong w.x.y.z l a ch IPv4
V d: 0:0:0:0:0:0:0:192.168.1.2
Dng a ch ny s dng cho cng ngh tunnel t ng.
Hin ti nhu cu kt ni tunnel t ng ny khng cn na, do vy a ch
ny cng b trong giai on pht trin tip theo ca IPv6.
Cu trc a ch nh x IPv4 - Mapped Address (IPv4-MA)

a ch IPv4-MA c to t 32 bit a ch IPv4 v c biu din nh sau:


0:0:0:0:0:0:FFFF:w.x.y.z hoc ::w.x.y.z trong w.x.y.z l a ch IPv4.
V d: 0:0:0:0:0:0:FFFF:192.168.1.2
Dng a ch ny s dng biu din mt node thun IPv4 thnh node IPv6
v c s dng trong cng ngh bin dch a ch IPv4-IPv6, v d cng
ngh NAT-PT.
a ch ny khng bao gi c dng lm a ch ngun hay a ch ch ca
mt gi tin IPv6.
Nhm 17

a ch 6to4
IANA cp pht mt prefix a ch dnh ring 2002::/16 trong vng a ch
unicast ton cu (3 bit u 001) s dng cho cng ngh chuyn i giao
tip IPv4-IPv6 c tn gi l cng ngh 6to4.
a ch 6to4 c hnh thnh bng cch gn prefix 2002::/16 vi 32 bit a
ch IPv4 (dng hexa) to nn prefix a ch /48.
a ch 6to4 c biu din di dng 2002:WWXX:YYZZ::/48, trong
WWXX:YYZZ l phn a ch IPv4 public di dng Hexa.
a ch 6to4 c s dng trong giao tip gia 2 node chy ng thi c 2
th tc IPv4 v IPv6 trn h tng nh tuyn IPv4.

Broadcast
nh ngha
Truyn d liu t mt my n tt c cc my trong cng mt mng con (ch c
th truyn d liu trong cng mt subnet).
a ch qung b trc tip (directed broadcast address) l a ch IP m trong
tt c cc bit trong trng Host ID u l 1.

a ch qung b cc b (local broadcast address) l a ch IP m trong tt c


cc bits trong Network ID v Host ID u l 1.

Nhm 17

a ch qung b cc b s b chn bi Router

Tuy nhin trong mt s trng hp nh vic s dng DHCP Server, Router s


c cu hnh cho php cc gi tin Broadcast di chuyn t subnet ny sang subnet
kia mt cch d dng.
Cch thc hot ng
DHCP Server s dng dch v lng nghe yu cu xin cp pht a ch IP c
gi t my trm. Sau khi nhn yu cu, DHCP Server s chn ra mt a ch IP trong
dy a ch ca mnh v gi v cho my trm. ng thi, DHCP Server cng gi n
my trm cc thng tin lin quan n a ch IP nh subnet mask, a ch IP ca cc
DNS Server
ng dng ca Broadcast
Trong LAN, giao thc ARP: Khi mt thit b mun gi cng mt bn tin ti tt
c cc my thit b khc.
Trong mng (Layer 3): Thit b (Router) mun truyn cng mt bn tin ti tt c
cc my tnh trong mt mng logic.

Nhm 17

10

Multicast

Mt s yu cu cn phi thc hin c th p ng c mc ch ca multicast:


Phi c mt di a ch dnh ring cho hot ng Multicast.
Cc host mun nhn lu lng Multicast no th phi c ci ng dng cho
Multicast .
Cc host phi c mt c ch bo hiu cho router gn nht (cng subnet) l n
mun nhn lu lng Multicast hoc khng mun nhn lu lng ny na.
Phi c cc giao thc nh tuyn Multicast phn b thng tin Multicast mt
cch ti u qua mt mng nh tuyn.
Phi c c ch tng quan a ch IP MAC dnh ring cho cc a ch
Multicast trong Ethernet LAN.
Phi c c ch ti u vic phn b d liu Multicast trn Ethernet LAN.
Di a ch dnh ring cho Multicast: 244.0.0.0 n 239.255.255.255 (Lp D)
IGMP Internet Group Management Protocol: Version 1, Version 2, Version 3.
OUI dnh ring cho Multicast 01-00-5e
CGMP, IGMP snooping, RGMP.
nh tuyn Multicast: PIM DM, PIM 5M, DVMRP, MOSPF.
a ch Multicast
a ch Multicast i din cho ng dng Multicast v cn c gi l a ch
nhm Multicast.
Loi a ch ny khng bao gi c gn cho mt thit b c th v khng bao
gi c php l a ch ngun trong cc gi tin.
IANA Internet Assigned Numbers Authority quy nh di IP lp D c s
Nhm 17

11

dng cho k thut Multicast 244.0.0.0 n 239.255.255.255 (4 Bit u lun l


1110).
Cc di Multicast:
1. Permanent Multicast group 224.0.0.0 n 224.0.1.255 (Local Multicast
224.0.0.0 n 224.0.0.255 v rutted 224.0.1.0 n 224.0.1.255)
2. SSM (Source Specific Multicast) 232.0.0.0 - 232.255.255.255
3. GLOP (233.0.0.0 n 233.255.255.255)
4. Private Multicast domain (239.0.0.0 n 239.255.255.255).
Permanent Group

SSM (Source Specific Multicast)


Di a ch 232.0.0.0 n 232.255.255.255.
S dng kt hp vi IGMPv3 cho php 1 host c th chn ngun pht Multicast.
SSM gip cho nh tuyn multicast hiu qu hn, cho php host chn source tt
hn v gim thiu c tn cng DoS.
Glop
Di a ch t: 233.0.0.0 n 233.255.255.255.
c s dng bi 1 t chc c s ASN to ra 256 a ch Multicast global
cua AS y.
nh dng: 233.A.B.0 n 233.A.B.255 trong A, B l s ASN.
VD: vi ASN = 5663 (0001011000011111) th A= 22 v B = 31 => di a ch
Multicast cho AS ny l 233.22.31.0 n 233.22.31.255.

Nhm 17

12

Private Multicast Domain


Cn gi l di Adminnistratively scope.
Di a ch 239.0.0.0 n 239.255.255.255.
IANA s khng gn di ny cho bt k ng dng no
c s dng ni b trong multicast domain ca doanh nghip.
Tng quan IP - MAC
nh dng chun ca IEEE:
01-00-5e + bit 0 +23 bit cui ca a ch IP multicast.
Vi cc map ny, c mi a ch MAC Multicast s tng ng vi 32 a ch IP
Multicast.

IGMP
IGMP Internet Group Management Protocol c thit k thc hin vic
truyn thng gia mt router v cc host kt ni trc tip vi n.
IGMP c host s dng bo hiu vi router multicast rng n mun nhn
lu lng multicast ca 1 nhm no hoc mun ngng nhn lu lng ny.
C ba version IGMP : version 1, version 2 v 3.
Thng ip IGMP c gi trong IP datagram vi protocol ID = 2, TTL (Time
to live) = 1 (Ch i trong ni b mng LAN).

Nhm 17

13

Ti u ha Multicast trn LAN

Cisco Group Management Protocol (CGMP).


IGMP Snooping.
Router Port Group Mangagement Protocol (RGMP).
nh tuyn Multicast
1. Cc giao thc nh tuyn Dense - Mode
Cc giao thc nh tuyn Dense - Mode gi thit rng ng dng multicast
ph bin khp mi subnet u c t nht mt host mun nhn lu lng multicast
ca nhm.
Cc giao thc nh tuyn Dense - Mode: PIM - DM, DVMRP, MOSPF.
Dense Mode

Nhm 17

14

Kim tra RPF


RPF - Reverse Path Forwarding.
Kim tra bng nh tuyn Unicast cho source - IP ca gi tin Multicast.
Nu router cho source IP ch ra outgoing port chnh l port nhn c gi
Multicast => forward gi ra cc cng cn li. Nu khng phi, khng replicate
v forward gi ny.

2. Pruning

3. Sparse - Mode
Nu cc user Multicast ch tn ti trn mt vi subnet, cch thc lm vic
kiu Dense - Mode s gy lng ph bng thng ng truyn v ti nguyn ca
Nhm 17

15

cc router.
Trong trng hp ny, ta s dng nh tuyn Multicast kiu Sparse Mode.

Dense - Mode v Sparse - Mode


im khc bit c bn gia Dense - Mode v Sparse - Mode l cch ng x mc
nh.
Mc nh cc router chy giao thc Dense - Mode s forward lu lng khi n
tt c cc cng tr khi cc con router di gi thng ip khi n khng mun nhn
na.
Sparse - Mode th ngc li, ai mun nhn th bo ln n s gi cho.

Anycast
Tng quan IPv4 v IPv6
IPv4 c chun ha k t RFC 791 pht hnh nm 1981. IPv4 dng 32bit
biu din a ch IP. S dng 32 bit ny, ta c th nh c khong 4.3 t a ch khc
nhau. Nhng ch khong hn 10 nm sau khi ra i, vo na u thp k 90, nguy c
thiu a ch IP xut hin ti 1 s nc nh Trung Quc, n , .... Cc nh pht
trin triu tp nhiu hi ngh, nhiu phng n xut hin nh: CIDR, NAT, ...
song, vi s pht trin cc k tc , 4.3 t a ch kia khng t a ch cho nhng

Nhm 17

16

PC, di ng, cc thit b in t khc, ... ni trc tip ti Internet.


gii quyt vn th IPv6 ra i. Vi 128 bit ln hn IPv4 gp 4 ln,
bn c th nh c khong 340 t t t t a ch. y l khng gian a ch cc ln
khng ch dnh ring cho Internet m cn cho tt c cc mng my tnh, h thng vin
thng, h thng iu khin v thm ch l vt dng gia nh. C bao gi mt ngy no
, bn cha tt my lnh nh, ni cm in nh cha bt, bn c mong mun l d
bn c bt c ni u vn c th kt ni v ra lnh cho nhng thit b t xa.
Trong tng lai khng xa, chc chn s lm c iu , mi mt vt dng gia
nh s mang mt a ch IPv6.
Cu trc IPv6
Tnh nng quan trng nht ca IPv6 khi c so snh vi IPv4 chnh l khng
gian a ch ln hn. a ch IPv4 s khng bao gi c m rng, do vic nng cp
ln

IPv6

iu

thit

yu

nu

Internet

ngy

cng

pht

trin.

IPv6 c tng cng l 128 bit c chia lm 2 phn: 64 bit u c gi l


network, 64 bit cn li c gi l host. Phn network dng xc nh subnet, a ch
ny c gn bi cc ISP hoc nhng t chc ln nh IANA (Internet Assigned
Numbers Authority). Cn phn host l mt a ch ngu nhin da trn 48 bit ca MAC
Address.
a ch IPv6 c 128 bit, do vic nh c a ch ny rt kh khn. Cho nn
vit a ch IPv6, ngi ta chia 128 bit ra thnh 8 nhm, mi nhm chim 2 bytes,
gm 4 s c vit di h s 16, v mi nhm c ngn cch nhau bng du hai
chm.
Phn loi a ch IPv6
IPv6 gm cc loi chnh sau y:
Unicast Address: Unicast Address dng xc nh mt Interface trong
phm vi cc Unicast Address. Gi tin (Packet) c ch n l Unicast
Address s

thng qua Routing chuyn n 1 Interface duy nht.

Anycast Address: Anycast Address dng xc nh nhiu Interfaces.


Tuy vy, Packet c ch n l Anycast Address s thng qua Routing
Nhm 17

17

chuyn n mt Interface trong s cc Interface c cng Anycast Address,


thng thng l Interface gn nht. Ch gn nht y c xc nh
thng qua giao thc nh tuyn ang s dng.
Multicast Address: Multicast Address dng xc nh nhiu Interfaces.
Packet c ch n l Multicast Address s thng qua Routing chuyn
n tt c cc Interfaces c cng Multicast Address.
Khi nim a ch Anycast
Anycast l mt mng li a ch v phng php nh tuyn trong gi tin t
mt ngi gi n c chuyn n cc nt topo gn nht trong mt nhm ngi nhn
tim nng xc nh bi cc a ch cng mt im n.
Anycast Address: Anycast Address dng xc nh nhiu Interfaces. Tuy vy,
Packet c ch n l Anycast Address s thng qua Routing chuyn n mt
Interface trong s cc Interface c cng Anycast Address, thng thng l Interface gn
nht. Ch gn nht y c xc nh thng qua giao thc nh tuyn ang s
dng.
n gin l Anycast gi ti mt thnh vin gn nht trong 1 nhm.

Phn tch hot ng Anycast


C ch hot ng
Trn mng Internet, anycast c thc hin bng vic s dng giao thc
nh tuyn ton cu BGP ng thi qung b ng b mt di a ch IP ch
t nhiu im khc nhau trn Internet. Do vy trong trng ch ca gi tin trn

Nhm 17

18

mng th di a ch anycast ny s c nh tuyn ti im gn nht trn mng


theo thut ton la chn ng i trong giao thc nh tuyn mng. Cc host trn
mng c cu hnh cng mt a ch Anycast.

ng dng cho h thng DNS


Phng thc truyn thng anycast thng c s dng trong cc ng
dng c th trn mng, trong ng dng DNS c s dng anycast vi cc u
im vt tri nh:
Cc client, server v Router khng cn cc phn mm c bit.
Khng nh hng xu ti h thng mng hin ti, ch cn tn dng c h
h tng sn c.
Cn bng ti
Tng linh ng
Ci tin v tr
C ch phn tn, gim nguy c DoS.
S kt ni n gin bao gm 02 server instance A & B c a ch IP l
10.0.0.1.

Nhm 17

19

Thc hin truy vn tn min t client truy cp website

Router1 kim tra bng nh tuyn, c 02 ng i n my ch 10.0.0.1

Thc t Router nhn nhn nh l 01 instance ca a ch 10.0.0.1, Router chn


ng i ngn nht n ch theo nguyn tc nh tuyn Unicast thng thng,
trong trng hp ny s i qua Router 2 n instance A

Trn thc t, c nhiu router kt ni do ty tng client v tr no trn mng


s chn ng i khc nhau ti instance gn nht vi client thng qua nh

Nhm 17

20

tuyn, c th n A hoc B.

Nhm 17

21

TI LIU THAM KHO


[1] Trang ch Cisco
[2] Bch khoa ton th m http://wikipedia.org
[3] Website http://thegioimang.vn
[4] Website http://vnnic.vn

[5] Ngc Vn An, NXB Gio dc Vit Nam, Mng my tnh, 2011

Nhm 17

22