Está en la página 1de 97

Modul: K thut mng c bn

I HC THI NGUYN KHOA CNG NGH THNG TIN

TI LIU
K THUT MNG C BN

Bin son: Trn Duy Minh. n v: Phng THTK CNTT&TT.

Thi nguyn, 11/2009.


1

Bin son: Th.s Trn Duy Minh

Email: tdminh.cntt.dhtn@gmail.com

Modul: K thut mng c bn MC LC

Phn 1: TNG QUAN V MNG MY TNH......................................................... 5 Bi 1: KHI NIM MNG MY TNH.................................................................... 5 1. Lch s mng my tnh............................................................................................ 5 2. Cc khi nim c bn .............................................................................................. 5 3. Phn bit cc loi mng........................................................................................... 6 3.1. Phng thc kt ni mng c s dng ch yu trong lin kt mng: ............ 6 C hai phng thc ch yu, l im - im v im - nhiu im..................... 6 3.2. Phn loi mng my tnh theo vng a l: ....................................................... 7 3.3. Phn loi mng my tnh theo topology. ........................................................... 8 3.4. Phn loi mng theo chc nng .......................................................................10 Bi 2: M HNH 7 TNG OSI .................................................................................11 (Open Systems Interconnect) .....................................................................................11 1. Lch s m hnh OSI ..............................................................................................11 2. Khi nim phn tng ..............................................................................................11 3. Chc nng ca cc tng..........................................................................................12 3.1. Tng vt l (Physical)......................................................................................12 3.2. Tng lin kt d liu (Data Link).....................................................................13 3.3 Tng mng (Network) ......................................................................................14 3.4 Tng vn chuyn (Transport)............................................................................16 3.5 Tng phin (Session)........................................................................................17 3.6 Tng trnh din (Presentation) ..........................................................................18 3.7 Tng ng dng (Application) ...........................................................................18 4. Qu trnh ng v m gi d liu...........................................................................19 Bi 3: B GIAO THC TCP/IP................................................................................20 (Transmission Control Protocol/Internet Protocol) .....................................................20 1. Lch s pht trin ca m hnh TCP/IP...................................................................20 2. Chc nng ca cc tng trong TCP/IP....................................................................21 2.1 Tng ng dng (Application Layer) .................................................................21 2.2 Tng vn chuyn (Transport Layer)..................................................................21 2.2.1. Giao thc TCP .........................................................................................22 2.2.2. Giao thc iu khin UDP........................................................................24 2.2.3. Bt tay ba bc ........................................................................................24 2.2.4. Ca s trt .............................................................................................25 2.2.5. Ch s cng (port) ca TCP v UDP ........................................................26 2.3. Tng Internet (Internet Layer) .........................................................................27 2.4. Tng truy nhp mng (Network Access Layer)................................................28 3. Mt s giao thc c bn trong b giao thc TCP/IP ...............................................28 3.1. Kin trc a ch IP (IPv4)...............................................................................28 3.1.1. a ch IP (IPv4):.....................................................................................28 3.1.2. Phng php chuyn i a ch IP. .........................................................30 3.1.3. a ch mng con: ....................................................................................31 3.1.4. Mt n a ch mng con ..........................................................................32 3.1.5. Dng thc ca gi tin IPv4.......................................................................33 3.1.6. S phn mnh v hp nht cc gi IP.......................................................35 3.2. Giao thc lin mng th h mi (IPv6) ............................................................35 3.2.1. Mt s c im mi ca IPv6: ................................................................36
Bin son: Th.s Trn Duy Minh Email: tdminh.cntt.dhtn@gmail.com

Modul: K thut mng c bn

Bi 4: MT S GIAO THC IU KHIN ............................................................38 1. Giao thc ICMP (Internet Control Message Protocol)............................................38 2. Giao thc ARP RARP.........................................................................................38 2.1. Giao thc ARP (Address Resolution Protocol) ................................................38 2.2. Giao thc RARP: ............................................................................................39 3. Chn tuyn (IP routing): ........................................................................................39 Hnh 1.43: Qu trnh chn tuyn ca gi tin trn mngPhn 2: MNG LAN V THIT K MNG LAN ...........................................................................................40 Phn 2: MNG LAN V THIT K MNG LAN...................................................41 Bi 1: KHI NIM C BN V MNG LAN ........................................................41 V MI TRNG TRUYN DN .........................................................................41 1. Kin thc c bn v mng LAN.............................................................................41 2. Cu trc topo ca mng..........................................................................................41 3. Cc loi chun ng truyn..................................................................................41 4. H thng cp dng cho mng LAN ........................................................................42 4.1 Cp ng xon i ...........................................................................................42 4.2. Cp ng trc. .................................................................................................43 4.3. Cp si quang (Fiber - Optic Cable) ................................................................44 Bi 2: CC THIT B MNG C BN ...................................................................47 1. Card giao tip mng (Network Adapter).................................................................47 2. B lp tn hiu (Repeater) ......................................................................................48 3. B tp trung (Hub) .................................................................................................49 4. Cu ni (Bridge) ....................................................................................................51 5. B chuyn mch (Switch) ......................................................................................54 6. B nh tuyn (Router)...........................................................................................57 Bi 3: THIT K MNG LAN .................................................................................62 1. M hnh c bn ......................................................................................................62 1.1. M hnh phn cp (Hierarchical models) .........................................................62 1.2 M hnh an ninh-an ton (Secure models). .......................................................63 2. Cc yu cu thit k ...............................................................................................63 3. Cc bc thit k ...................................................................................................64 Bi 4: KIN THC C BN V MNG LAN KHNG DY................................66 1. Khi qut mng LAN khng dy............................................................................66 2. Kh nng bo mt ca mng khng dy .................................................................68 3. Cu hnh thit b thu pht khng dy......................................................................69 Bi 5: MNG LAN O VIRTUAL LAN ...............................................................70 1. Khi nim chung. ...................................................................................................70 2. To mng LAN o vi b chuyn mch .................................................................70 2.1. To mng LAN o trn mt b chuyn mch ..................................................70 2.2. To mng LAN o vi nhiu b chuyn mch.................................................71 3. Cch xy dng mng LAN o ................................................................................71 4. u im v nhc im ca mng LAN o............................................................72 Phn 3: THI CNG LP T H THNG MNG C BN .................................73 Bi 1. HNG DN KHO ST, LP S .......................................................73 V LM H S H THNG MNG .....................................................................73 1. Gii thiu tin trnh thit k mng LAN .................................................................73 2. Lp s thit k mng .........................................................................................73
Bin son: Th.s Trn Duy Minh Email: tdminh.cntt.dhtn@gmail.com

Modul: K thut mng c bn

2.1. Pht trin s mng tng vt l..................................................................74 2.2. Ni kt tng 2 bng switch ..................................................................................77 2.3. Thit k mng tng 3 ....................................................................................79 2.4. Xc nh v tr t Server.................................................................................80 3. Lp ti liu cho tng 3............................................................................................80 Bi 2: CNG NGH MNG ETHERNET V CHUN CP ..................................82 1. Mng Ethernet........................................................................................................82 2. Cu to cp xon i, cc chun cp ......................................................................83 Chng 4: QUN TR C BN, BO TR, BO DNG.....................................86 H THNG MNG ..................................................................................................86 Bi 1: PHNG PHP X L S C....................................................................86 1. Phng php truyn thng .....................................................................................86 2. Phng php cu trc.............................................................................................87 MT S NG DNG - DCH V INTERNET .......................................................94 1. Dch v truy nhp t xa Telnet (Number port 23)...................................................94 2. Dch v truyn tp (FTP Number port 21)...........................................................94 3. Dch v Gopher......................................................................................................94 4. Dch v WAIS .......................................................................................................94 5. Dch v World Wide Web......................................................................................95 6. Dch v th in t (E-Mail: POP3 110) .............................................................95 7. Dch v DNS (Number port 53) ............................................................................96

Bin son: Th.s Trn Duy Minh

Email: tdminh.cntt.dhtn@gmail.com

Modul: K thut mng c bn

Phn 1: TNG QUAN V MNG MY TNH Bi 1: KHI NIM MNG MY TNH

1. Lch s mng my tnh - Vo gia nhng nm 50, nhng h thng my tnh u tin ra i s dng cc bng n in t nn kch thc rt cng knh v tiu tn nhiu nng lng. Vic nhp d liu vo my tnh c thc hin thng qua cc ba c l v kt qu c a ra my in, iu ny lm mt rt nhiu thi gian v bt tin cho ngi s dng. - n gia nhng nm 60, cng vi s pht trin ca cc ng dng trn my tnh v nhu cu trao i thng tin vi nhau, mt s nh sn xut my tnh nghin cu ch to thnh cng cc thit b truy cp t xa ti cc my tnh ca h, v y chnh l nhng dng s khai ca h thng mng my tnh. - n u nhng nm 70, h thng thit b u cui 3270 ca IBM ra i cho php m rng kh nng tnh ton ca cc trung tm my tnh n cc vng xa. n gia nhng nm 70, IBM gii thiu mt lot cc thit b u cui c thit k ch to cho lnh vc ngn hng, thng mi. Thng qua dy cp mng cc thit b u cui c th truy cp cng mt lc n mt my tnh dng chung. n nm 1977, cng ty Datapoint Corporation tung ra th trng h iu hnh mng ca mnh l Attache Resource Computer Network (Arcnet) cho php lin kt cc my tnh v cc thit b u cui li bng dy cp mng v chnh l h iu hnh mng u tin. 2. Cc khi nim c bn - Mng my tnh l mt tp hp cc my tnh c ni vi nhau bi ng truyn theo mt cu trc no v thng qua cc my tnh trao i thng tin qua li cho nhau. - ng truyn l h thng cc thit b truyn dn c dy hay khng dy dng chuyn cc tn hiu in t t my tnh ny n my tnh khc. Cc tn hiu in t biu th cc gi tr d liu di dng cc xung nh phn (on - off). Tt c cc tn hiu c truyn gia cc my tnh u thuc mt dng sng in t. Ty theo tn s ca sng in t c th dng cc ng truyn vt l khc nhau truyn cc tn hiu. y ng truyn c kt ni c th l dy cp ng trc, cp xon, cp quang, dy in thoi, sng v tuyn ... Cc ng truyn d liu

Bin son: Th.s Trn Duy Minh

Email: tdminh.cntt.dhtn@gmail.com

Modul: K thut mng c bn

to nn cu trc ca mng. Hai khi nim ng truyn v cu trc l nhng c trng c bn ca mng my tnh.

Hnh 1.1: M hnh lin kt cc my tnh trong mng Nhng u im khi kt ni cc my tnh thnh mt mng my tnh: Nhiu ngi c th dng chung mt phn mm tin ch. Trao i thng tin trong mt mng my tnh d dng D liu c qun l tp trung nn an ton hn, trao i gia nhng ngi s dng thun li hn, nhanh chng hn. C th dng chung thit b ngoi vi him, t tin (my in, my v,...). Ngi s dng trao i vi nhau th tn (E-Mail), tin tc d dng. Mt s ngi s dng khng cn phi trang b my tnh t tin (chi ph thp m chc nng li mnh). Mng my tnh cung cp mi trng lm vic t xa (chnh ph in t, hi ngh t xa, elearning..). 3. Phn bit cc loi mng 3.1. Phng thc kt ni mng c s dng ch yu trong lin kt mng: C hai phng thc ch yu, l im - im v im - nhiu im. + Vi phng thc "im - im": cc ng truyn ring bit c thit lp ni cc cp my tnh li vi nhau. Mi my tnh c th truyn v nhn trc tip d liu hoc c th lm trung gian nh lu tr nhng d liu m n nhn c ri sau chuyn tip d liu i cho mt my khc d liu t ti ch. + Vi phng thc "im - nhiu im": tt c cc trm phn chia chung mt ng truyn vt l. D liu c gi i t mt my tnh s c th c tip nhn bi tt c cc my tnh cn li, bi vy cn ch ra i ch ch ca d liu mi my tnh
Bin son: Th.s Trn Duy Minh Email: tdminh.cntt.dhtn@gmail.com

Modul: K thut mng c bn

cn c vo kim tra xem d liu c phi dnh cho mnh khng nu ng th nhn cn nu khng th b qua. 3.2. Phn loi mng my tnh theo vng a l: + GAN (Global Area Network): kt ni my tnh t cc Chu lc khc nhau. Thng thng kt ni ny c thc hin thng qua mng vin thng v v tinh. + WAN (Wide Area Network): Mng din rng, kt ni my tnh trong ni b cc quc gia hay gia cc quc gia trong cng mt Chu lc. Thng thng kt ni ny c thc hin thng qua mng vin thng. Cc WAN c th c kt ni vi nhau thnh GAN hay t n l GAN. + MAN (Metropolitan Area Network): kt ni cc my tnh trong phm vi mt thnh ph. Kt ni ny c thc hin thng qua cc mi trng truyn thng tc cao (50-100 Mbit/s).

Hnh 1.2: M hnh mng th + LAN (Local Area Network): Mng cc b, lin kt cc my tnh trong mt khu vc bn knh hp thng thng khong vi trm mt. Lin kt c thc hin thng qua cc mi trng truyn thng tc cao v d cp ng trc hay cp quang. LAN thng c s dng trong ni b mt c quan/t chc...Cc LAN c th c kt ni vi nhau thnh WAN. + SAN (Storage Area Network): L mt mng ring dng lu tr d liu, n thch hp vi cc h thng cn lu tr d liu d phng, di chuyn file, ti to d liu gia cc h thng.

Bin son: Th.s Trn Duy Minh

Email: tdminh.cntt.dhtn@gmail.com

Modul: K thut mng c bn

Hnh 1.3: M hnh mng SAN + VPN (Virtual Private Network): Mng ring o, l gii php s dng thit b phn cng hoc phn mm lin kt cc mng LAN ti cc c s khc nhau ca mt c quan thnh mt mng LAN ring bng cch s dng Internet lm Backbone.

Hnh 1.4: M hnh mng VPN. 3.3. Phn loi mng my tnh theo topology. + Mng dng hnh sao (Star topology): dng hnh sao, tt c cc trm c ni vo mt thit b trung tm c nhim v nhn tn hiu t cc trm v chuyn tn hiu n trm ch vi phng thc kt ni l phng thc "im - im".

Hnh 1.5: M hnh mng dng hnh sao

Bin son: Th.s Trn Duy Minh

Email: tdminh.cntt.dhtn@gmail.com

Modul: K thut mng c bn

Kt ni tt c cc cp ti mt im trung tm. Nu s dng star m rng kt ni cc Star li vi nhau thng qua HUB hoc SWITCH. Dng ny c th m rng phm vi v mc bao ph ca mng. + Mng hnh tuyn (Bus Topology): Trong dng hnh tuyn, cc my tnh u c ni vo mt ng dy truyn chnh (Bus). ng truyn chnh ny c gii hn hai u bi mt loi u ni c bit gi l Terminator (dng nhn bit l u cui kt thc ng truyn ti y). Mi trm c ni vo Bus qua mt u ni ch T (T_connector) hoc mt b thu pht (Transceiver).

Hnh 1.6: M hnh mng dng Bus - D liu (packet) khi di chuyn ln hoc xung trong dy cp u mang theo i ch theo cch b tr hnh lang cc ng nh hnh v th my ch (host) cng nh tt c cc my tnh khc (workstation) hoc cc nt (node) u c ni v vi nhau trn mt trc ng dy cp chnh chuyn ti tn hiu. - Tt c cc nt u s dng chung ng dy cp chnh ny. Pha hai u dy cp c bt bi mt thit b gi l terminator. - Loi hnh mng ny dng dy cp t nht, d lp t. Tuy vy cng c nhng bt li l s c s n tc khi di chuyn d liu vi lu lng ln v khi c s hng hc on no th rt kh pht hin, mt s ngng trn ng dy sa cha s ngng ton b h thng. + Mng dng vng (Ring Topology): Cc my tnh c lin kt vi nhau thnh mt vng trn theo phng thc "im - im", qua mi mt trm c th nhn v truyn d liu theo vng mt chiu v d liu c truyn theo tng gi mt.

Bin son: Th.s Trn Duy Minh

Email: tdminh.cntt.dhtn@gmail.com

Modul: K thut mng c bn

Hnh 1.7: M hnh mng dng vng Mng dng ny, b tr theo dng xoay vng, ng dy cp c thit k lm thnh mt vng khp kn, tn hiu chy quanh theo mt chiu no . Cc nt truyn tn hiu cho nhau mi thi im ch c mt nt m thi. D liu truyn i phi c km theo a ch c th ca mi trm tip nhn. - Mng dng vng c thun li l c th ni rng ra xa, tng ng dy cn thit t hn so vi hai kiu trn. Nhc im l ng dy phi khp kn, nu b ngt mt ni no th ton b h thng cng b ngng. + Mng dng kt hp: trong thc t tu theo yu cu v mc ch c th ta c th thit k mng kt hp cc dng sao, vng, tuyn tn dng cc im mnh ca mi dng.

Hnh 1.8: M hnh mng dng kt hp Mi host trong mng c ng ni ring ti tt c cc host cn li. Tng kh nng trnh b gin on dch v khi mt my b hng. 3.4. Phn loi mng theo chc nng + Mng Client-Server: mt hay mt s my tnh c thit lp cung cp cc dch v nh File server, Mail server, Web server, Printer server, Cc my tnh c thit lp cung cp cc dch v c gi l Server, cn cc my tnh truy cp v s dng dch v th c gi l Client. + Mng ngang hng Peer-to-Peer: cc my tnh trong mng c th hot ng va nh mt Client va nh mt Server. + Mng kt hp: Cc mng my tnh thng c thit lp theo c hai chc nng Client-Server v Peer-to-Peer.

Bin son: Th.s Trn Duy Minh

Email: tdminh.cntt.dhtn@gmail.com

10

Modul: K thut mng c bn

Bi 2: M HNH 7 TNG OSI (Open Systems Interconnect)

1. Lch s m hnh OSI + thi k u ca cng ngh ni mng, vic gi v nhn d liu ngang qua mng thng gy nhm ln do cc cng ty ln nh IBM, Honeywell v Digital Equipment Corporation t ra nhng tiu chun ring cho hot ng kt ni my tnh. + Nm 1984, t chc Tiu chun ho Quc t - ISO (International Standard Organization) chnh thc a ra m hnh OSI (Open Systems Interconnection), l tp hp cc c im k thut m t kin trc mng dnh cho vic kt ni cc thit b khng cng chng loi. 2. Khi nim phn tng + T thc t ca qu trnh trao i thng tin gia hai i tng tham gia truyn thng l con ngi ta thy rng qu trnh trao i thng tin c din ra nhiu mc (nhiu tng khc nhau). Tng tri thc: Hai i tng tham gia trao i phi cng mc tri thc (cng cch x l thng tin). Tng trnh din: Cng cch biu din thng tin (Ngn ng). Tng truyn dn: Cng mi trng vt l truyn tin. T ngi ta xy dng m hnh trao i thng tin gia cc my tnh da trn kin trc phn tng v in hnh nht l m hnh OSI. Ngi ta chia qu trnh truyn thng thnh 7 tng v mi tng lm mt nhim v c th trong qu trnh truyn thng.

Hnh 1.9: M hnh 7 tng OSI


Bin son: Th.s Trn Duy Minh Email: tdminh.cntt.dhtn@gmail.com

11

Modul: K thut mng c bn

Gi tin ca giao thc: Gi tin (Packet) c hiu nh l mt n v thng tin dng trong vic lin lc, chuyn giao d liu trong mng my tnh. Nhng thng ip (message) trao i gia cc my tnh trong mng, c to dng thnh cc gi tin my ngun. V nhng gi tin ny khi ch s c kt hp li thnh thng ip ban u. Mt gi tin c th cha ng cc yu cu phc v, cc thng tin iu khin v d liu. 3. Chc nng ca cc tng 3.1. Tng vt l (Physical)

Hnh 1.10: Tng vt l Khi nim: Tng vt l lin quan n vic truyn cc dng bit gia cc my bng knh truyn thng vt l, khng quan tm n ngha v cu trc ca chng. Ngoi ra n cung cp cc chun v in, dy cp, u ni, k thut ni mch in, in p, tc cp truyn dn, giao din ni kt v cc mc ni kt. - Tng vt l (Physical layer) l tng di cng ca m hnh OSI cung cp cc c trng in ca cc tn hiu c dng khi chuyn d liu trn cp t mt my ny n mt my khc ca mng, k thut ni mch in, tc cp truyn dn. - Tng vt l khng qui nh mt ngha no cho cc tn hiu ngoi cc gi tr nh phn 0 v 1. cc tng cao hn ca m hnh OSI ngha ca cc bit c truyn tng vt l s c xc nh. - Khc vi cc tng khc, tng vt l l khng c gi tin ring v do vy khng c phn u (header) cha thng tin iu khin, d liu c truyn i theo dng bit. Mt giao thc tng vt l tn ti gia cc tng vt l quy nh v phng thc truyn (ng b, phi ng b), tc truyn.

Bin son: Th.s Trn Duy Minh

Email: tdminh.cntt.dhtn@gmail.com

12

Modul: K thut mng c bn

- Cc giao thc c xy dng cho tng vt l c phn chia thnh hai loi giao thc s dng phng thc truyn thng d b (asynchronous) v phng thc truyn thng ng b (synchronous). Phng thc truyn d b: khng c mt tn hiu quy nh cho s ng b gia cc bit gia my gi v my nhn, trong qu trnh gi tn hiu my gi s dng cc bit c bit START v STOP c dng tch cc xu bit biu din cc k t trong dng d liu cn truyn i. N cho php mt k t c truyn i bt k lc no m khng cn quan tm n cc tn hiu ng b trc . Phng thc truyn ng b: s dng phng thc truyn cn c ng b gia my gi v my nhn, n chn cc k t c bit nh SYN (Synchronization), EOT (End Of Transmission) hay n gin hn, mt ci "c " (flag) gia cc d liu ca my gi bo hiu cho my nhn bit c d liu ang n hoc n. 3.2. Tng lin kt d liu (Data Link)

Hnh 1.11: Tng lin kt Khi nim: Tng lin kt d liu (data link layer) l tng m ngha c gn cho cc bt c truyn trn mng. Tng lin kt d liu phi quy nh c cc dng thc, kch thc, a ch my gi v nhn ca mi gi tin c gi i. N phi xc nh c ch truy nhp thng tin trn mng v phng tin gi mi gi tin sao cho n c a n cho ngi nhn nh. Cc nhim v chnh ca tng ny l: + Chia thng tin cn gi thnh cc frame, gi cc frame i mt cch tun t v x l cc frame bin nhn (ACK frame) do bn nhn gi v. Cc frame c kch thc

Bin son: Th.s Trn Duy Minh

Email: tdminh.cntt.dhtn@gmail.com

13

Modul: K thut mng c bn

c vi trm byte hoc vi nghn byte, u v cui frame c ghi thm cc nhm bit c bit lm ranh gii cho frame (tng ny nhn ra c ranh gii gia cc frame). + ng truyn vt l lun lun c th gy li nn tng ny phi gii quyt vn ny sinh khi bn tin b hng, b mt hoc b truyn lp. Tng ny cung cp cch pht hin v sa li c bn m bo cho d liu nhn c ging hon ton vi d liu gi i. Nu mt gi tin c li khng sa c, tng lin kt d liu phi ch ra c cch thng bo cho ni gi bit gi tin c li n gi li. + Gi cho bn pht c tc khng gy lt d liu cho bn nhn. Cc giao thc tng lin kt d liu chia lm 2 loi chnh l cc giao thc hng k t v cc giao thc hng bit. Cc giao thc hng k t c xy dng da trn cc k t c bit ca mt b m chun no (nh ASCII hay EBCDIC), trong khi cc giao thc hng bit li dng cc cu trc nh phn (xu bit) xy dng cc phn t ca giao thc (n v d liu, cc th tc.) v khi nhn, d liu s c tip nhn ln lt tng bit mt. 3.3 Tng mng (Network)

Hnh 1.12: Tng mng Khi nim: Tng mng (network layer) nhm n vic kt ni cc mng vi nhau bng cch tm ng (routing) cho cc gi tin t mt mng ny n mt mng khc. N xc nh vic chuyn hng, vch ng cc gi tin trong mng, cc gi ny c th phi i qua nhiu chng trc khi n c ch cui cng. N lun tm cc tuyn truyn thng khng tc nghn a cc gi tin n ch. - Tng mng cung cc cc phng tin truyn cc gi tin qua mng, thm ch qua mt mng ca mng (network of network). Bi vy n cn phi p ng vi nhiu kiu mng v nhiu kiu dch v cung cp bi cc mng khc nhau. hai chc nng ch yu ca tng mng l chn ng (routing) v chuyn tip (relaying). Tng mng l
Bin son: Th.s Trn Duy Minh Email: tdminh.cntt.dhtn@gmail.com

14

Modul: K thut mng c bn

quan trng nht khi lin kt hai loi mng khc nhau nh mng Ethernet vi mng Token Ring khi phi dng mt b tm ng (quy nh bi tng mng) chuyn cc gi tin t mng ny sang mng khc v ngc li. - i vi mt mng chuyn mch gi (packet - switched network) - gm tp hp cc nt chuyn mch gi ni vi nhau bi cc lin kt d liu. Cc gi d liu c truyn t mt h thng m ti mt h thng m khc trn mng phi c chuyn qua mt chui cc nt. Mi nt nhn gi d liu t mt ng vo (incoming link) ri chuyn tip n ti mt ng ra (outgoing link) hng n ch ca d liu. Nh vy mi nt trung gian n phi thc hin cc chc nng chn ng v chuyn tip. Vic chn ng l s la chn mt con ng truyn mt n v d liu (mt gi tin chng hn) t trm ngun ti trm ch ca n. Mt k thut chn ng phi thc hin hai chc nng chnh sau y: Quyt nh chn ng ti u da trn cc thng tin c v mng ti thi im thng qua nhng tiu chun ti u nht nh. Cp nht cc thng tin v mng, tc l thng tin dng cho vic chn ng, trn mng lun c s thay i thng xuyn nn vic cp nht l vic cn thit.

Hnh 1.13: M hnh chuyn vn cc gi tin trong mng chuyn mch gi Ngi ta c hai phng thc p ng cho vic chn ng l phng thc x l tp trung v x l ti ch. Phng thc chn ng x l tp trung: c c trng bi s tn ti ca mt (hoc vi) trung tm iu khin mng, chng thc hin vic lp ra cc bng ng i ti tng thi im cho cc nt v sau gi cc bng chn ng ti tng nt dc theo con ng c chn . Thng tin tng th ca mng cn dng cho vic chn ng ch cn cp nhp v c ct gi ti trung tm iu khin mng.

Bin son: Th.s Trn Duy Minh

Email: tdminh.cntt.dhtn@gmail.com

15

Modul: K thut mng c bn

Phng thc chn ng x l ti ch: c c trng bi vic chn ng c thc hin ti mi nt ca mng. Trong tng thi im, mi nt phi duy tr cc thng tin ca mng v t xy dng bng chn ng cho mnh. Nh vy cc thng tin tng th ca mng cn dng cho vic chn ng cn cp nhp v c ct gi ti mi nt. Thng thng cc thng tin c o lng v s dng cho vic chn ng bao gm: Trng thi ca ng truyn. Thi gian tr khi truyn trn mi ng dn. Mc lu thng trn mi ng. Cc ti nguyn kh dng ca mng. Khi c s thay i trn mng (v d thay i v cu trc ca mng do s c ti mt vi nt, phc hi ca mt nt mng, ni thm mt nt mi... hoc thay i v mc lu thng) cc thng tin trn cn c cp nht vo cc c s d liu v trng thi ca mng. Hin nay khi nhu cu truyn thng a phng tin (tch hp d liu vn bn, ho, hnh nh, m thanh) ngy cng pht trin i hi cc cng ngh truyn dn tc cao nn vic pht trin cc h thng chn ng tc cao ang rt c quan tm. 3.4 Tng vn chuyn (Transport)

Hnh 1.14: Tng chuyn vn Khi nim: C nhim v t chc cc knh trao i thng tin gia cc dch v tng ng ca hai my tnh tham gia truyn thng.

Bin son: Th.s Trn Duy Minh

Email: tdminh.cntt.dhtn@gmail.com

16

Modul: K thut mng c bn

Hnh 1.15: Mt s dch v tng chuyn vn Cc vn ny sinh: Trong mt lc c th c nhiu dch v cng tham gia trao i thng tin vi cc my tnh khc nn tng giao vn phi c nhim v dn knh v phn knh. Gii php t chc dn knh v phn knh tng giao vn l s dng socket. Mi dch v tng trn s tin hnh trao i thng qua cc cng logic gi l cng dch v, s hiu cng cng d liu c ng gi trong qu trnh dn knh. V d: - www: cng 80 - ftp: cng 21 - telnet: cng 23 Cc dch v tng trn chia thnh 2 loi v ng vi mi loi tng giao vn phi t chc truyn tin tng ng vi hai loi : i hi tin cy Chp nhn cc sai st, nhng thi gian truyn tin phi nhanh nht c th c 3.5 Tng phin (Session)

Hnh 1.16: Tng phin

Bin son: Th.s Trn Duy Minh

Email: tdminh.cntt.dhtn@gmail.com

17

Modul: K thut mng c bn

Khi nim: Thit lp, qun l, kt thc cc phin lm vic gia cc ng dng, m bo vic giao dch gia cc ng dng c qun l. 3.6 Tng trnh din (Presentation)

Hnh 1.17: Tng trnh din Khi nim: Trong giao tip gia cc ng dng thng qua mng vi cng mt d liu c th c nhiu cch biu din khc nhau. Thng thng dng biu din dng bi ng dng ngun v dng biu din dng bi ng dng ch c th khc nhau do cc ng dng c chy trn cc h thng hon ton khc nhau (nh h my Intel v h my Motorola). Tng trnh din (Presentation layer) phi chu trch nhim chuyn i d liu gi i trn mng t mt loi biu din ny sang mt loi khc. t c iu n cung cp mt dng biu din chung dng truyn thng v cho php chuyn i t dng biu din cc b sang biu din chung v ngc li. Tng trnh by cng c th c dng k thut m ha xo trn cc d liu trc khi c truyn i v gii m u n bo mt. Ngoi ra tng biu din cng c th dng cc k thut nn sao cho ch cn mt t byte d liu th hin thng tin khi n c truyn trn mng, u nhn, tng trnh by bung tr li c d liu ban u. 3.7 Tng ng dng (Application)

Hnh 1.18: Tng ng dng

Bin son: Th.s Trn Duy Minh

Email: tdminh.cntt.dhtn@gmail.com

18

Modul: K thut mng c bn

Khi nim: Tng ng dng (Application layer) l tng cao nht ca m hnh OSI, n xc nh giao din gia ngi s dng v mi trng OSI v gii quyt cc k thut m cc chng trnh ng dng dng giao tip vi mng. 4. Qu trnh ng v m gi d liu Cng ging nh trong m hnh tham chiu OSI, d liu trc khi gi i phi c ng gi, v khi nhn c d liu qu trnh m gi d liu s c din ra theo hng ngc li. D liu gi t tng ng dng i xung cc tng di ca m hnh OSI, mi tng c nhng nh ngha ring v d liu m n s dng. Ti ni gi, mi tng coi gi tin ca tng trn gi xung l d liu ca n v thm vo gi tin cc thng tin iu khin ca mnh sau chuyn tip xung tng di. Ti ni nhn, qu trnh din ra ngc li, mi tng li tch thng tin iu khin ca mnh ra v chuyn d liu ln tng trn. Hnh di y m t chi tit qu trnh ng gi d liu thng qua 7 tng ca m hnh OSI

Hnh 1.19: Qu trnh ng gi qua cc tng

Vi 5 bc chuyn i ng gi d liu: 1. Xy dng d liu. 2. ng gi d liu ti tng vn chuyn. 3. B xung a ch IP vo header ti tng mng. 4. B xung header v trailer ti tng lin kt d liu. 5. Chuyn thnh cc bit truyn ti tng vt l.

Bin son: Th.s Trn Duy Minh

Email: tdminh.cntt.dhtn@gmail.com

19

Modul: K thut mng c bn

Bi 3: B GIAO THC TCP/IP (Transmission Control Protocol/Internet Protocol)

1. Lch s pht trin ca m hnh TCP/IP Vo cui nhng nm 1960 v u 1970, Trung tm nghin cu cp cao (Advanced Research Projects Agency - ARPA) thuc b quc phng M (Department of Defense - DoD) c giao trch nhim pht trin mng ARPANET bao gm mng ca nhng t chc qun i, cc trng i hc, cc t chc nghin cu v c dng h tr cho nhng d n nghin cu khoa hc v qun i. u nhng nm 1980, mt b giao thc mi c a ra lm giao thc chun cho mng ARPANET v cc mng ca DoD mang tn DARPA Internet protocol suit, thng c gi l b giao thc TCP/IP hay cn gi tt l TCP/IP (Transmission Control Protocol/Internet Protocol). B giao thc ny cng c s dng cho cc h thng s dng Unix. M hnh TCP/IP c bn lp: lp ng dng (Application Layer), lp vn chuyn (transport layer), lp Internet v lp truy nhp mng (network access Layer).

Hnh 1.20: M hnh TCP/IP Giao thc Internet c th c s dng giao tip thng qua bt k h thng tng tc mng no. Chng cng c dng cho c mng LAN v WAN.

Hnh 1.21: ng dng ca m hnh TCP/IP


Bin son: Th.s Trn Duy Minh Email: tdminh.cntt.dhtn@gmail.com

20

Modul: K thut mng c bn

2. Chc nng ca cc tng trong TCP/IP 2.1 Tng ng dng (Application Layer)

Hnh 1.22: Mt s ng dng thuc tng ng dng Tng ng dng ca m hnh TCP/IP kim sot cc giao thc lp cao, cc ch v trnh by, biu din thng tin, m ha, iu khin hi thoi. Ti tng ng dng ca m hnh c cc giao thc h tr cc ng dng sau: FTP (File Transfer Protocol): l dch v truyn file gia cc h thng c h tr FTP. N h tr truyn file nh phn hai chiu v ti cc file ASCII. TFTP (Trivial File Transfer Protocol): l dch v khng to cu ni dng UDP. NFS (Network File System): l mt b giao thc h thng file phn tn cho php truy xut file n cc thit b lu tr xa nh l mt a cng qua mng. SMTP (Simple Mail Transfer Protocol): qun l hot ng truyn mail qua mng my tnh. D liu di dng plaintext. Telnet (Terminal emulation): cung cp kh nng truy nhp t xa vo my tnh khc. SNMP (Simple Network Management Protocol): l giao thc cung cp mt phng php gim st v iu khin cc thit b mng v qun l cc cu hnh, thu thp thng k, hiu sut v bo mt. DNS (Domain Name System): dng thng dch tn ca cc min v cc nt mng c qung b cng khai sang cc a ch IP. 2.2 Tng vn chuyn (Transport Layer) Tng vn chuyn cung cp cc dch v vn chuyn v thit lp cc cu ni gia cc host trong mng. Tng vn chuyn nh ra s kt ni xuyn sut gia cc ng dng ca host. Cc dch v vn chuyn bao gm cc dch v c bn sau:

Bin son: Th.s Trn Duy Minh

Email: tdminh.cntt.dhtn@gmail.com

21

Modul: K thut mng c bn

S phn on d liu ng dng lp trn. Thit lp cc hot ng xuyn sut t im ny n im kia. Vn chuyn cc phn on d liu (data segment) t mt host n mt host khc. iu khin lung c thc hin thng qua ca s trt (Sliding Windows). Tnh tin cy nh vo nh ch s tun t v bo nhn.

Hnh 1.23: Giao thc hot ng ti tng chuyn vn Tng vn chuyn s dng hai giao thc truyn tin l TCP hng kt ni v UDP khng hng kt ni. Ni dung c th tng phn c trnh by chi tit di y.

Hnh 1.24: Qu trnh ng gi s dng TCP/UDP 2.2.1. Giao thc TCP L giao thc hng kt ni, n cung cp mt hot ng truyn tin tin cy. TCP chu trch nhim phn chia d liu gi thnh cc segment ti my gi v lp gp cc segment li ti my ch, trong qu trnh truyn c th truyn li bt c segment no nu my ch cha nhn c. Gi tin TCP c dng sau:
Bin son: Th.s Trn Duy Minh Email: tdminh.cntt.dhtn@gmail.com

22

Modul: K thut mng c bn

Hnh 1.25: Khun dng giao thc TCP Gi tin TCP Source port: S hiu ca cng gi (16 bits) . Destination Port : S hiu ca cng ch(16 bits) Sequence Number: Cha s m bo tun t chnh xc ca d liu n, ging nh s th t (32 bits) Acknowledgment Number (ACK): dng trong cc gi d liu hi p ca my nhn cho my gi, bo hiu my gi bit lng d liu m my nhn nhn c v yu cu gi d liu tip theo (32 bits) Header Length: S lng cc t 32 bit trong header (32 bits) Reserved : Set thnh zero (6 bits) Code Bits: Cc chc nng iu khin nh l thit lp v kt thc mt phin, n ging nh c gm 6 bits. 1. C URG. 2. C ACK dng xc nhn. 3. C PSH (push) yu cu xa vng m. 4. C RST(Reset) ti thit lp. 5. C SYN (Synchronic) ng b. 6. C FIN (finsh) Kt thc, s dng khi mun hy kt ni. Window: ghi kch thc ca s ca my gi bo cho my nhn bit c gi tn hiu tr li th khng c vt qu kch thc ny (16 bits) Checksum: tnh t header v cc trng d liu (16 bits) Urgent: Ch ra im kt thc ca d liu chun (16 bits) Options: Mt ty chn nh ra kch thc ti a hin hnh ca gi TCP. Data: D liu giao thc ca lp trn.

Bin son: Th.s Trn Duy Minh

Email: tdminh.cntt.dhtn@gmail.com

23

Modul: K thut mng c bn

2.2.2. Giao thc iu khin UDP UDP l giao thc khng hng kt ni trong giao thc TCP/IP. UDP l giao thc n gin dng trao i cc datagram ma khng c bo nhn cng nh s m bo gi tin n ch. x l li v truyn li c giao ph cho giao thc mc cao hn. c dng trong trng hp khng cn t cc segment theo th t.

Hnh 1.26: Khun dng giao thc UDP Gi tin UDP Source port: s hiu ca cng gi. Destination port: s hiu ca cng ch. Length: s byte trong header v trng d liu. Data: d liu ca giao thc lp trn. Checksum: c tnh t header v cc trng d liu. 2.2.3. Bt tay ba bc TCP l mt giao thc hng kt ni, khi hai host c nhu cu trao i thng tin, mt knh thng tin c thit lp. Hai host phi ng b cc ch s tun t ban u. _ISNs (initial sequence Numbers). S ng b yu cu mi pha truyn ch s tun t ban u ca mnh v c xc nhn bng mt bo nhn ACK t pha kia.

Hnh 1.27: Qu trnh bt tay 3 bc

Bin son: Th.s Trn Duy Minh

Email: tdminh.cntt.dhtn@gmail.com

24

Modul: K thut mng c bn

1. A -> B: SYN s tun t ban u ca A l X (l s ngu nhin do A sinh ra). ACK l 0. c SYN c thit lp l 1, c ACK l 0. 2. B ->A :ACK s tun t ca A l X+1, s tun t ban u ca B l Y, c SYN l 1, c ACK l 1. B nhn c cc gi tin c s th t l X v yu cu gi tin th X+1. ng thi B thit lp s th t l Y. 3. A - >B: Xc nhn nhn c s tun t ca B l ACK= Y. V yu cu mt phn hi ACK=Y+1. 2.2.4. Ca s trt Cc gi d liu phi c truyn i n ch theo mt th t ging nh khi chng c truyn i c c mt hot ng truyn d liu ch thc theo hng tin cy. Qu trnh truyn tin c th tht bi nu mt gi tin khng n ch. Cc giao thc cho php my gi truyn cng lc nhiu gi tin. S lng gi d liu m my pht c php truyn m cha nhn c bo nhn c gi l kch thc ca s, hay gi l ca s.

Hnh 1.28: C ch ca s trt (KT=1) Gi s trong trng hp kch thc ca s bng 3 tc l thit b ngun c th truyn ba gi n ch mt cch lin tc. Sau thit b ngun phi i bo nhn. Nu ch nhn c ba gi ny, n s gi mt bo nhn n ngun, lc ny ngun li gi tip ba gi. Nu ch khng nhn c n s c thng bo li cho pha ngun.

Bin son: Th.s Trn Duy Minh

Email: tdminh.cntt.dhtn@gmail.com

25

Modul: K thut mng c bn

Hnh 1.29: C ch ca s trt (KT=3) 2.2.5. Ch s cng (port) ca TCP v UDP C hai giao thc TCP v UDP u dng ch s cng (port) chuyn thng tin t tng vn chuyn ln tng ng dng pha trn (qu trnh phn knh) v ng gi d liu c chuyn n t tng ng dng (qu trnh dn knh).

Hnh 1.30: S hiu cng mt s ng dng Da vo s hiu cng c gi km vi gi tin m ti tng vn chuyn s nhn bit c cn chuyn gi tin n ng dng no tng trn.

Hnh 1.31: Qu trnh s dng s hiu cng trn h thng mng

Bin son: Th.s Trn Duy Minh

Email: tdminh.cntt.dhtn@gmail.com

26

Modul: K thut mng c bn

2.3. Tng Internet (Internet Layer) Mc ch ca tng ny l tm ng i tt nht ti ch cho gi tin trong qu trnh truyn trn mng. Giao thc chnh ca tng ny l giao thc IP (Internet Protocol). S dn ng v chuyn mch gi din ra tng ny. Cc giao thc hot ng ti tng ny l: IP (Internet Protocol): cung cp nh tuyn ng i ca gi tin mt cch tt nht, IP khng quan tm n ni dung ca cc gi tin m ch quan tm tm kim ng dn cho cc gi ti ch. ICMP (Internet Control Message Protocol): Cung cp kh nng iu khin v chuyn thng ip. Cc thng ip ca ICMP c km theo gi IP v c s dng gi cc thng ip li v iu khin. Cc kiu thng ip: 1. Destination Unreachable : ch khng thy 2. Time Exceeded : Vt qu thi gian 3. Parameter Problem : Vn v tham s 4. Subnet Mask Request : Yu cu Subnet Mask 5. Redirect : Chuyn hng 6. Echo : Bo hiu 7. Echo Reply : Bo hiu li 8. Time stamp : 9. Timestamp Reply 10. Information Request 11. Information Reply 12. Address Request 13. Address Reply ARP(Address Resolution Protocol): xc nh a ch lp lin kt s hiu (a ch MAC) khi bit trc a ch IP. Khi cha bit a ch MAC, n s gi mt thng ip cho ton mng. RARP (Reverse Address Resolution Protocol): xc nh cc a ch IP khi bit trc a ch MAC.

Bin son: Th.s Trn Duy Minh

Email: tdminh.cntt.dhtn@gmail.com

27

Modul: K thut mng c bn

2.4. Tng truy nhp mng (Network Access Layer) Tng ny nh ra cc th tc giao tip vi phn cng mng v truy nhp mi trng truyn. Cc chc nng ca tng ny bao gm nh x a ch IP sang a ch vt l v gi (encapsulation) cc gi IP thnh cc frame. Cn c vo dng phn cng v giao tip mng, tng truy nhp mng s xc lp kt ni vi ng truyn vt l ca mng. Mt v d v cu hnh tng ny l ci c Card mng. Nu c h tr bi h iu hnh Windows th vic nhn card mng s c t cp nht, nu cha c h tr th phi ci driver ca card mng . 3. Mt s giao thc c bn trong b giao thc TCP/IP - Giao thc lin mng IP (Internet Protocol): Giao thc lin mng IP l mt trong nhng giao thc quan trng nht ca b giao thc TCP/IP. Mc ch ca giao thc lin mng IP l cung cp kh nng kt ni cc mng con thnh lin mng truyn d liu. IP l giao thc cung cp dch v phn pht datagram theo kiu khng lin kt v khng tin cy ngha l khng cn c giai on thit lp lin kt trc khi truyn d liu, khng m bo rng IP datagram s ti ch v khng duy tr bt k thng tin no v nhng datagram gi i. 3.1. Kin trc a ch IP (IPv4) 3.1.1. a ch IP (IPv4): - a ch IP (IPv4) c di 32 bit v c tch thnh 4 vng, mi vng (mi vng 1 byte) thng c biu din di dng thp phn v c cch nhau bi du chm (.). V d: 203.162.7.92. a ch IPv4 c chia thnh 5 lp A, B, C, D, E; trong 3 lp a ch A, B, C c dng cp pht. Cc lp ny c phn bit bi cc bit u tin trong a ch. - Lp A (0): cho php nh danh ti 126 mng vi ti a 16 triu trm trn mi mng. Lp ny thng c dng cho cc mng c s trm cc ln (thng dnh cho cc cng ty cung cp dch v ln ti M) v rt kh c cp.

Hnh 1.32: a ch lp A

Bin son: Th.s Trn Duy Minh

Email: tdminh.cntt.dhtn@gmail.com

28

Modul: K thut mng c bn

- Lp B (10): cho php nh danh ti 16384 mng vi ti a 65534 trm trn mi mng. Lp a ch ny ph hp vi nhiu yu cu nn c cp pht nhiu nn hin nay tr nn khan him.

Hnh 1.36: a ch lp B - Lp C (110): cho php nh danh ti 2 triu mng vi ti a 254 trm trn mi mng. Lp ny c dng cho cc mng c t trm.

Hnh 1.33: a ch lp C - Lp D (1110): dng gi gi tin IP n mt nhm cc trm trn mng (cn c gi l lp a ch multicast)

Hnh 1.34: a ch lp D - Lp E (11110): dng d phng

Hnh 1.35: Khng gian a ch IPV4 - Ngoi ra cn mt s a ch c quy nh dng ring (private address). Cc a ch ny ch c ngha trong mng ca tng t chc nht nh m khng c nh tuyn trn Internet. Vic s dng cc a ch ny khng cn phi xin cp php.

Bin son: Th.s Trn Duy Minh

Email: tdminh.cntt.dhtn@gmail.com

29

Modul: K thut mng c bn

Hnh 1.36: Qu trnh phn gii a ch IPv4 3.1.2. Phng php chuyn i a ch IP. Cc h thn g s H thp phn (c s 10) S dng 10 s :0,1,2,3,4,5,6,7,8,9 H nh phn s dng 2 s:0,1 H thp lc phn: s dng cc ch s: 0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f. H c s 2: 2^7+2 ^6+2^5+2^4+2^3+2^2+2^1+2^0 128+64+32+16+8+4+2+1 + Chuyn i IPv4 t dng nh phn sang thp phn VD: 10110010 = = (1 x 2^7)+(0 x 2^6)+(1 x 2^5)+(1 x 2^4)+(0 x 2^3)+(0 x 2^2)+(1 x 2 ^1)+(0 x 2^0) = 128 + 32 + 16 + 2 = 178 + Chuyn i a ch IPv4 t dng thp phn sang dng nh phn. C1: S dng thut ton chia cho 2 lin tip sau ly phn d ca php chia v vit theo chiu t di ln tng ng cc bt ti v tr th 8 v th 1. VD: 192 Thng D 0 0 0 0 0 0 1 1
Email: tdminh.cntt.dhtn@gmail.com

192 : 2 = 96 96 : 2 = 48 48 : 2 = 24 24 : 2 = 12 12 : 2 = 6 6 :2 =3 3 :2 =1 1 :2 =0
Bin son: Th.s Trn Duy Minh

30

Modul: K thut mng c bn

192 = 11000000 C2: Phng php xt hiu Ly gi tr cn chuyn i xt vi v tr bt th 8 nu thy ln hn th ti v tr s c in bit 1 v ly hiu hai s so vi cc bt tip theo, nu nh hn th ti v tr nhn bit 0. VD: 192 + So snh 192 > 128 Xt hiu: 192 128 = 64 + So snh 64 > 64 Xt hiu: 64 64 = 0 + Ta thy hiu bng 0 do s nh hn cc gi tr ti cc bt cn li do s nhn gi tr 0. 192 = 11000000 V d: Bit 7 = 1 Bit 8 = 1

11001011.10100010.00000111.01011100 203.162.7.92 11001011 27 + 26 + 23 + 21 + 20 = 128 + 64 + 8 +2 + 1 = 203 10100010 27 + 25 +21 = 128 + 32 + 2 = 162 00000111 22 + 21 +20 = 4 + 2 + 1 = 7 01011100 26 + 24 + 23 + 22 = 64 + 16 + 8 + 4 = 92 3.1.3. a ch mng con: - i vi cc a ch lp A, B s trm trong mt mng l qu ln v trong thc t thng khng c mt s lng trm ln nh vy kt ni vo mt mng n l. a ch mng con cho php chia mt mng ln thnh cc mng con nh hn. Ngi qun tr mng c th dng mt s bit u tin ca trng hostid trong a ch IP t a

Bin son: Th.s Trn Duy Minh

Email: tdminh.cntt.dhtn@gmail.com

31

Modul: K thut mng c bn

ch mng con. Chng hn i vi mt a ch thuc lp A, vic chia a ch mng con c th c thc hin nh sau:

Hnh 1.37: Qu trnh chia mng con - Vic chia a ch mng con l hon ton trong sut i vi cc router nm bn ngoi mng, nhng n l khng trong sut i vi cc Router nm bn trong mng.

Hnh 1.38: M hnh mng ca cc mng con 3.1.4. Mt n a ch mng con Bn cnh a ch IP, mt trm cng cn c bit vic nh dng a ch mng con: bao nhiu bit trong trng hostid c dng cho phn a ch mng con (subnetid). Thng tin ny c ch ra trong mt n a ch mng con (subnet mask). Subnet mask cng l mt s 32 bit vi cc bit tng ng vi phn netid v subnetid c dt bng 1 cn cc bit cn li c t bng 0. Nh vy, a ch thc ca mt trm s l hp ca a ch IP v subnet mask. V d vi a ch lp C: 203.162.7.92, trong : 203.162.7 92 a ch mng

a ch IP ca trm

Nu dng 3 bit u ca trng hostid nh subnet subnet mask s l: 11111111.11111111.11111111.11100000 = 255.255.255.224 a ch ca subnet: 11001011.10100010.00000111.01011100 11111111.11111111.11111111.111- - - - ---------------------------------------------------------- AND Logic 11001011.10100010.00000111.010- - - - - = 203.162.7.64
Bin son: Th.s Trn Duy Minh Email: tdminh.cntt.dhtn@gmail.com

32

Modul: K thut mng c bn

(Subnet address) a ch trm: trm th 28 trong Subnet 203.162.7.64 Trong thc t subnet mask thng c vit km vi a ch IP theo dng thu gn sau: 203.162.7.92/27; - Trong 27 chnh l s bit c t gi tr l 1 (gm cc bit thuc a ch mng v cc bit dng cho Subnet). Nh vy y ta c th hiu ngay c vi subnet mask l 27 th tng ng vi 11111111.11111111.11111111.111- - - - 3.1.5. Dng thc ca gi tin IPv4 n v d liu dng trong IP c gi l gi tin (datagram), c khun dng

Hnh 1.39: Khun dng gi tin IPv4 - VER (4 bits): ch version hin hnh ca giao thc IP hin c ci t, Vic c ch s version cho php c cc trao i gia cc h thng s dng version c v h thng s dng version mi. - IHL (Internet header Length) (4 bits): ch di phn u ca gi tin datagram, tnh theo n v t (32 bits). Trng ny bt but phi c v phn u IP c th c di thay i ty . di ti thiu l 5 t (20 bytes), di ti a l 15 t hay l 60 bytes. - Type of service (8 bits): c t cc tham s v dch v nhm thng bo cho mng bit dch v no m gi tin mun c s dng, chng hn u tin, thi hn chm tr, nng sut truyn v tin cy. - Total Length (16 bits): ch di ton b gi tin, k c phn u tnh theo n v byte vi chiu di ti a l 65535 bytes. Hin nay gii hn trn l rt ln nhng trong tng lai vi nhng mng Gigabit th cc gi tin c kch thc ln l cn thit. - Identification (16 bits): cng vi cc tham s khc (nh Source Address v Destination Address) tham s ny dng nh danh duy nht cho mt datagram trong khong thi gian n vn cn trn lin mng.

Bin son: Th.s Trn Duy Minh

Email: tdminh.cntt.dhtn@gmail.com

33

Modul: K thut mng c bn

- Flags (3 bits): lin quan n s phn on (fragment) cc datagram, Cc gi tin khi i trn ng i c th b phn thnh nhiu gi tin nh, trong trng hp b phn on th trng Flags c dng iu khin phn on v ti lp ghp b d liu. Ty theo gi tr ca Flags s c ngha l gi tin s khng phn on, c th phn on hay l gi tin phn on cui cng. Trng Fragment Offset cho bit v tr d liu thuc phn on tng ng vi on bt u ca gi d liu gc. ngha c th ca trng Flags l:

bit 0: reserved - cha s dng, lun ly gi tr 0. bit 1: (DF) = 0 (May Fragment) = 1 (Don't Fragment) bit 2: (MF) = 0 (Last Fragment) = 1 (More Fragments)
- Fragment Offset (13 bits): ch v tr ca on (fragment) trong datagram tnh theo n v 8 bytes, c ngha l phn d liu mi gi tin (tr gi tin cui cng) phi cha mt vng d liu c di l bi s ca 8 bytes. iu ny c ngha l phi nhn gi tr ca Fragment offset vi 8 tnh ra lch byte. - Time to Live (8 bits): qui nh thi gian tn ti (tnh bng giy) ca gi tin trong mng trnh tnh trng mt gi tin b qun trn mng. Thi gian ny c cho bi trm gi v c gim i (thng qui c l 1 n v) khi datagram i qua mi router ca lin mng. Thi lng ny gim xung ti mi router vi mc ch gii hn thi gian tn ti ca cc gi tin v kt thc nhng ln lp li v hn trn mng. - Protocol (8 bits): ch giao thc tng trn k tip s nhn vng d liu trm ch (hin ti thng l TCP hoc UDP c ci t trn IP). V d: TCP c gi tr trng Protocol l 6, UDP c gi tr trng Protocol l 17 - Header Checksum (16 bits): M kim sot li ca header gi tin IP. - Source Address (32 bits): a ch ca my ngun. - Destination Address (32 bits): a ch ca my ch - Options ( di thay i): khai bo cc la chn do ngi gi yu cu (tu theo tng chng trnh). - Padding ( di thay i): Vng m, c dng m bo cho phn header lun kt thc mt mc 32 bits.

Bin son: Th.s Trn Duy Minh

Email: tdminh.cntt.dhtn@gmail.com

34

Modul: K thut mng c bn

- Data ( di thay i): Trn mt mng cc b nh vy, hai trm ch c th lin lc vi nhau nu chng bit a ch vt l ca nhau. Nh vy vn t ra l phi thc hin nh x gia a ch IP (32 bits) v a ch vt l (48 bits) ca mt trm. 3.1.6. S phn mnh v hp nht cc gi IP Phn mnh d liu l mt trong nhng chc nng quan trng ca giao thc IP. Khi tng IP nhn c IP datagram gi i, IP s so snh kch thc ca datagram vi kch thc cc i cho php MTU (Maximum Transfer Unit), v tng d liu qui nh kch thc ln nht ca Frame c th truyn ti c, v s phn mnh nu ln hn. Mt IP datagram b phn mnh s c ghp li bi tng IP ca trm nhn vi cc thng tin t phn header nh identification, flag v fragment offset.

Hnh 1.40: S phn mnh gi tin 3.2. Giao thc lin mng th h mi (IPv6) - Giao thc IPv4 c coi l nn tng cho mng Internet vi nhng tnh cht u vit ca n, tuy nhin vi s bng n v Internet giao thc IPv4 bc l mt s yu im v tnh nng, trong ni bt l: + Thiu ht v tnh nng xc thc, an ninh ca gi tin trn mng. Kh nng m rng hn ch. + Thiu ht khng gian a ch. Vi s pht trin ca mng Internet, khng gian a ch IP c th s dng thc s l rt nh do cc a ch lp A c dnh ch yu cho cc cng ty cung cp dch v ln ti M v rt hn ch trong vic cp pht. Cc a ch lp B nhanh chng b s dng ht do n cung cp s a ch va phi. Hin nay nhiu yu cu ch c p ng bng cc a ch lp C vi s a ch rt hn ch.

Bin son: Th.s Trn Duy Minh

Email: tdminh.cntt.dhtn@gmail.com

35

Modul: K thut mng c bn

+ S gia tng s lng cc ch mc trong bng nh tuyn do c ch nh tuyn khng phn cp dn n yu cu nng cp cc router v nh tuyn khng hiu qu. + Ngy nay, vi cc nhu cu kt ni vo mng Internet ca cc dch v khc nh in thoi di ng, truyn hnh s, i hi giao thc IPv4 cn c cc sa i p ng cc nhu cu mi. - Trc nhng nhu cu trn, giao thc lin mng th h mi IPv6 ra i nhm thay th cho IPv4, nhng cho n nay IPv6 vn ch mi ch yu l ang trong qu trnh th nghim v hon thin. Trong khun kh gio trnh cng cp mt cch tng qut v giao thc lin mng th h mi IPv6. 3.2.1. Mt s c im mi ca IPv6: - Khun dng header mi: Header ca IPv6 c thit k gim chi ph n mc ti thiu. iu ny t c bng cch chuyn cc trng la chn sang cc header m rng c t pha sau ca IPv6 header. Khun dng mi ca IPv6 to ra s x l hiu qu hn ti cc Router. - Header ca IPv4 v IPv6 khng th x l chung. Mt trm hay mt router phi ci t c IPv4 v IPv6 c th x l c c hai khun dng header ny. Header ca IPv6 ch c kch thc gp 2 ln header ca IPv4 mc d khng gian a ch ca IPv6 ln gp 4 ln khng gian a ch IPv4. - Khng gian a ch ln: IPv6 c a ch ngun v ch di 128 bit. Khng gian a ch ca IPv6 c thit k cho php phn b a ch v mng con t trc xng sng Internet n tng mng con trong mt t chc. - Hin ti ch mt lng nh cc a ch hin ang c phn b s dng bi cc trm, vn cn d tha rt nhiu a ch sn sng cho vic s dng trong tng lai. - Hiu qu, phn cp a ch ha v h tng nh tuyn: Cc a ch ton cc ca IPv6 c thit k to ra mt h tng nh tuyn hiu qu, phn cp v c th tng qut ha da trn s phn cp thng thy ca cc nh cung cp dch v (ISP) trn thc t. - H tr cht lng dch v (QoS) tt hn: Cc trng mi trong header ca IPv6 nh ra cch thc x l v nh danh trn mng. Giao thng trn mng c nh danh nh trng gn nhn lung (Flow Label) cho php router c th nhn ra v cung

Bin son: Th.s Trn Duy Minh

Email: tdminh.cntt.dhtn@gmail.com

36

Modul: K thut mng c bn

cp cc x l c bit i vi cc gi tin thuc v mt lung nht nh, mt chun cc gi tin gia ngun v ch. Do giao thng mng c xc nh trong header, cc dch v QoS c th c thc hin ngay c khi phn d liu c m ha theo IPSec. + Kh nng m rng: IPv6 c th d dng m rng thm cc tnh nng mi bng vic thm cc header mi sau header IPv6. - IPv6 s dng a ch c di ln hn IPv4 (128 bit so vi 32 bit) do cung cp khng gian a ch ln hn rt nhiu. Trong khi khng gian a ch 32 bit ca IPv4 cho php khong 4 t a ch, khng gian a ch ca IPv6 c th c khong 3.4x1038 a ch. S lng a ch ny rt ln, h tr khong 6.5x1023 a ch trn mi mt vung b mt tri t. a ch IPv6 128 bit c chia thnh cc min phn cp theo trt t trn Internet. N to ra nhiu mc phn cp v linh hot trong a ch ha v nh tuyn cn ang thiu trong IPv4. - Cc a ch IPv6 di 128 bit, khi vit mi nhm 16 bit c biu din thnh mt s nguyn khng du di dng h 16 v c phn tch bi du hai chm (:) V d: FEDC:BA98:7654:3210:FEDC:BA98:7654:3210 Trn thc t a ch IPv6 thng c nhiu s 0, v d a ch:1080:0000:0000:0000:0008:0800:200C:417A Do c ch nn a ch c dng biu din d dng hn cc loi a ch dng ny. Ta khng cn vit cc s 0 u mi nhm, v d 0 thay cho 0000, 20 thay cho 0020. a ch trong v d trn s tr thnh 1080:0:0:0:8:800:200C:417A. Hn na ta c th s dng k hiu :: ch mt chui s 0. a ch trong v d trn s tr thnh: 1080::8:800:200C:417A. - Do a ch IPv6 c di c nh, ta c th tnh c s cc bit 0 m k hiu biu din. Tin t a ch IPv6 c biu din theo k php CIDR nh IPv4 nh sau: IPv6-address/prefix length trong IPv6-address l bt k kiu biu din no, cn prefix length l di tin t theo bit. V d: biu din mng con c tin t 80 bit: 1080:0:0:0:8::/80. Vi node address: 12AB:0:0:CD30:123:4567:89AB:CDEF, prefix: 12AB:0:0:CD30::/60 c th vit tt thnh 12AB:0:0:CD30:123:4567:89AB:CDEF/60

Bin son: Th.s Trn Duy Minh

Email: tdminh.cntt.dhtn@gmail.com

37

Modul: K thut mng c bn

Bi 4: MT S GIAO THC IU KHIN

1. Giao thc ICMP (Internet Control Message Protocol) - L mt giao thc ca lp IP, c dng trao i cc thng tin iu khin dng s liu, thng bo li v cc thng tin trng thi khc ca TCP/IP. V d: + iu khin dng truyn (Flow Control): khi cc gi d liu n qu nhanh, trm ch hoc mt gateway gia s gi mt thng ip ICMP tr li ni gi, yu cu ni gi tm thi dng vic gi d liu. + Thng bo li: trong trng hp a ch ch l khng ti c th h thng s gi mt thng bo li Destination Unreachable. + nh hng cc tuyn ng: mt gateway s gi mt thng ip ICMP Redirect Router ni vi mt trm l nn dng gateway khc. Thng ip ny c th ch c dng khi m trm ngun trn cng mt mng vi c hai gateway. + Kim tra cc trm xa: mt trm c th gi mt thng ip ICMP Echo i bit c liu mt trm xa c hot ng hay khng. 2. Giao thc ARP RARP 2.1. Giao thc ARP (Address Resolution Protocol) L giao thc gii (tra) a ch t a ch mng xc nh c a ch lin kt d liu (a ch MAC). V d: khi IP gi mt gi d liu cho mt h thng khc trn cng mng vt l Ethernet, IP cn bit a ch Ethernet ca h thng ch tng lin kt d liu xy dng khung. Thng thng, c th xc nh a ch trong bng a ch IP a ch MAC mi h thng. Nu khng, c th s dng ARP lm vic ny. - Trm lm vic gi yu cu ARP (ARP_Request) n my phc v ARP Server, my phc v ARP tm trong bng a ch IP MAC ca mnh v tr li bng ARP_Response cho trm lm vic. - Nu khng, my phc v chuyn tip yu cu nhn c di dng qung b cho tt c cc trm lm vic trong mng. Trm no c trng a ch IP c yu cu s tr li vi a ch MAC ca mnh.

Bin son: Th.s Trn Duy Minh

Email: tdminh.cntt.dhtn@gmail.com

38

Modul: K thut mng c bn

Hnh 1.41: Qu trnh hot ng ca giao thc ARP 2.2. Giao thc RARP: RARP (Reverse Address Resolution Protocol) l giao thc gii ngc (tra ngc) t a ch MAC xc nh IP. Qu trnh ny ngc li vi qu trnh gii thun a ch IP MAC m t trn.

Hnh 1.42: Qu trnh hot ng ca giao thc RARP 3. Chn tuyn (IP routing): - Bn cnh vic cung cp a ch chuyn pht cc gi tin, chn tuyn l mt chc nng quan trng ca lp IP. Ta thy rng lp IP nhn datagram t TCP, UDP, ICMP hoc IGMP gi i hoc nhn datagram t giao tip mng chuyn tip. Lp IP c mt bng nh tuyn truy cp mi khi nhn c mt datagram gi i. Khi mt datagram c nhn t tng kt ni d liu, u tin IP s kim tra xem a ch IP ch l a ch ca chnh n hay mt a ch qung b, nu ng th datagram s c cp pht cho giao thc c ch nh trong protocol ca IP header. Nu datagram khng c gi ti a ch IP ny n s c chuyn tip trong trng hp lp IP c cu hnh ng vai tr nh mt router hoc b hy b trong trng hp ngc li.

Bin son: Th.s Trn Duy Minh

Email: tdminh.cntt.dhtn@gmail.com

39

Modul: K thut mng c bn

IP duy tr mt bng chn tuyn truy nhp mi khi c gi tin cn chuyn tip. Mi mc trong bng chn tuyn gm nhng thng tin sau: + a ch IP ch: l a ch ch cn ti, c th l a ch IP ca mt trm hoc a ch IP ca mt mng ty thuc vo c ca u vo ny. + a ch IP ca router k tip: l a ch ca router c ni trc tip vi mng v ta c th gi datagram ti cho router k tip phn pht. + C: xc nh a ch IP ca router k tip l mt a ch mt trm hay l mt mng, router k tip l mt router thc hay l mt trm kt ni trc tip vo mng. + Giao tip mng: xc nh giao tip mng no m datagram phi gi qua ti ch.

Hnh 1.43: Qu trnh chn tuyn ca gi tin trn mng

Bin son: Th.s Trn Duy Minh

Email: tdminh.cntt.dhtn@gmail.com

40

Modul: K thut mng c bn

Phn 2: MNG LAN V THIT K MNG LAN Bi 1: KHI NIM C BN V MNG LAN V MI TRNG TRUYN DN 1. Kin thc c bn v mng LAN Mng cc b (LAN) l h truyn thng tc cao c thit k kt ni cc my tnh v cc thit b x l d liu khc cng hot ng vi nhau trong mt khu vc a l nh nh mt tng ca to nh, hoc trong mt to nh.... Mt s mng LAN c th kt ni li vi nhau trong mt khu lm vic. Cc mng LAN tr nn thng dng v n cho php nhng ngi s dng dng chung nhng ti nguyn quan trng nh my in mu, a CD-ROM, cc phn mm ng dng v nhng thng tin cn thit khc. Trc khi pht trin cng ngh LAN cc my tnh l c lp vi nhau, b hn ch bi s lng cc chng trnh tin ch, sau khi kt ni mng r rng hiu qu ca chng tng ln gp bi. 2. Cu trc topo ca mng Cu trc tp (network topology) ca LAN l kin trc hnh hc th hin cch b tr cc ng cp, sp xp cc my tnh kt ni thnh mng hon chnh. Hu ht cc mng LAN ngy nay u c thit k hot ng da trn mt cu trc mng nh trc. in hnh v s dng nhiu nht l cc cu trc: dng hnh sao, dng hnh tuyn, dng vng cng vi nhng cu trc kt hp ca chng. 3. Cc loi chun ng truyn Chun Vin cng ngh in v in t (IEEE) Tiu chun IEEE LAN c pht trin da vo u ban IEEE 802. - Tiu chun IEEE 802.3 lin quan ti mng CSMA/CD bao gm c 2 phin bn bng tn c bn v bng tn m rng. - Tiu chun IEEE 802.4 lin quan ti s phng thc truyn th bi trn mng hnh tuyn (Token Bus) - IEEE 802.5 lin quan n truyn th bi trn mng dng vng (Token Ring). Theo chun 802 th tng lin kt d liu chia thnh 2 mc con: mc con iu khin logic LLC (Logical Link Control Sublayer) v mc con iu khin xm nhp mng MAC (Media Access Control Sublayer). Mc con LLC gi vai tr t chc d liu, t chc thng tin truyn v nhn.
Bin son: Th.s Trn Duy Minh Email: tdminh.cntt.dhtn@gmail.com

41

Modul: K thut mng c bn

Mc con MAC ch lm nhim v iu khin vic xm nhp mng. Th tc mc con LLC khng b nh hng khi s dng cc ng truyn dn khc nhau, nh vy m linh hot hn trong khai thc. Chun 802.2 mc con LLC tng ng vi chun HDLC ca ISO hoc X.25 ca CCITT. Chun 802.3 xc nh phng php thm nhp mng tc thi c kh nng pht hin li chng cho thng tin CSMA/CD. Phng php CSMA/CD c a ra t nm 1993 nhm mc ch nng cao hiu qu mng. Theo chun ny cc mc c ghp ni vi nhau thng qua cc b ghp ni. Chun 802.4 thc cht l phng php thm nhp mng theo kiu pht tn hiu thm d token qua cc trm v ng truyn bus. Chun 802.5 dng cho mng dng xoay vng v trn c s dng tn hiu thm d token. Mi trm khi nhn c tn hiu thm d token th tip nhn token v bt u qu trnh truyn thng tin di dng cc khung tn hiu. Cc khung c cu trc tng t nh ca chun 802.4. Phng php xm nhp mng ny quy nh nhiu mc u tin khc nhau cho ton mng v cho mi trm, vic quy nh ny va cho ngi thit k va do ngi s dng t quy nh.

Hnh 2.1: S phn tng hot ng ca chun IEEE 4. H thng cp dng cho mng LAN 4.1 Cp ng xon i - y l loi cp gm hai ng dy dn ng c xon vo nhau nhm lm gim nhiu in t gy ra bi mi trng xung quanh v gia chng vi nhau. Hin

Bin son: Th.s Trn Duy Minh

Email: tdminh.cntt.dhtn@gmail.com

42

Modul: K thut mng c bn

nay c hai loi cp xon l cp c bc kim loi (STP - Shield Twisted Pair) v cp khng bc kim loi (UTP -Unshield Twisted Pair). - Cp c bc kim loi (STP): Lp bc bn ngoi c tc dng chng nhiu in t, c loi c mt i giy xon vo nhau v c loi c nhiu i giy xon vi nhau.

Hnh 2.2: Cu to cp ng xon i Cp khng bc kim loi (UTP): Tnh tng t nh STP nhng km hn v kh nng chng nhiu v suy hao v khng c v bc. STP v UTP c cc loi (Category - Cat) thng dng: - Loi 1 & 2 (Cat 1 & Cat 2): Thng dng cho truyn thoi v nhng ng truyn tc thp (nh hn 4Mb/s). - Loi 3 (Cat 3): tc truyn d liu khong 16 Mb/s , n l chun cho hu ht cc mng in thoi. - Loi 4 (Cat 4): Thch hp cho ng truyn 20Mb/s. - Loi 5 (Cat 5): Thch hp cho ng truyn 100Mb/s. - Loi 6 (Cat 6): Thch hp cho ng truyn 300Mb/s. y l loi cp r, d ci t tuy nhin n d b nh hng ca mi trng. 4.2. Cp ng trc. Cp ng trc c hai ng dy dn v chng c cng mt trc chung, mt dy dn trung tm (thng l dy ng cng) ng dy cn li to thnh ng ng bao xung quanh dy dn trung tm (dy dn ny c th l dy bn kim loi v v n c chc nng chng nhiu nn cn gi l lp bc kim). Gia hai dy dn trn c mt lp cch ly, v bn ngoi cng l lp v plastic bo v cp. Cp ng trc c suy hao t hn so vi cc loi cp ng khc (v d nh cp xon i) do t b nh hng ca mi trng. Cc mng cc b s dng cp ng trc c th c kch thc trong phm vi vi ngn mt. Hai loi cp thng c s dng l cp ng trc mng v cp ng trc dy trong ng knh cp ng trc mng l 0,25 inch, cp ng trc dy l 0,5 inch.
Bin son: Th.s Trn Duy Minh Email: tdminh.cntt.dhtn@gmail.com

43

Modul: K thut mng c bn

Hin nay c cp ng trc sau: + RG -58,50 ohm: dng cho mng Thin Ethernet + RG -59,75 ohm: dng cho truyn hnh cp Cc mng cc b thng s dng cp ng trc c di thng t 2,5 - 10 Mb/s, cp ng trc c suy hao t hn so vi cc loi cp ng khc v n c lp v bc bn ngoi, di thng thng ca mt on cp ni trong mng l 200m, thng s dng cho dng Bus.

Cp ng trc gy Cp ng trc bo

Hnh 2.3: Cu to cp ng trc 4.3. Cp si quang (Fiber - Optic Cable) Cp si quang bao gm mt dy dn trung tm (l mt hoc mt b si thy tinh c th truyn dn tn hiu quang) c bc mt lp v bc c tc dng phn x cc tn hiu tr li gim s mt mt tn hiu. Bn ngoi cng l lp v plastic bo v cp. Nh vy cp si quang khng truyn dn cc tn hiu in m ch truyn cc tn hiu quang (cc tn hiu d liu phi c chuyn i thnh cc tn hiu quang v khi nhn chng s li c chuyn i tr li thnh tn hiu in). Cp quang c ng knh t 8.3 - 100 micron.

Bin son: Th.s Trn Duy Minh

Email: tdminh.cntt.dhtn@gmail.com

44

Modul: K thut mng c bn

SingleMode (n mode):

Hnh 2.4: Cu to cp quang - Do ng knh li si thu tinh c kch thc rt nh nn rt kh khn cho vic u ni, n cn cng ngh c bit vi k thut cao i hi chi ph cao. - Cc thut Di thng ca cp quang c th ln ti hng Gbps v cho php khong cch i cp kh xa do suy hao tn hiu trn cp rt thp. Ngoi ra, v cp si quang khng dng tn hiu in t truyn d liu nn n hon ton khng b nh hng ca nhiu in t v tn hiu truyn khng th b pht hin v thu trm bi cc thit b in t ca ngi khc. Ch tr nhc im kh lp t v gi thnh cn cao, nhn chung cp quang thch hp cho mi mng hin nay v sau ny.

Bin son: Th.s Trn Duy Minh

Email: tdminh.cntt.dhtn@gmail.com

45

Modul: K thut mng c bn

Hnh 2.5: Bng so snh h thng cp truyn dn

Bin son: Th.s Trn Duy Minh

Email: tdminh.cntt.dhtn@gmail.com

46

Modul: K thut mng c bn

Bi 2: CC THIT B MNG C BN

xy dng mng mt h thng mng, ngi ta thng dng cc thit b sau: - Card giao tip mng (NIC- Network Interface Card) - Dy cp mng (Cable) - B khuych i (Repeater) - B tp trung ni kt (HUB) - Cu ni (Brigde) - B chuyn mch (Switch) - B chn ng (Router)

1. Card giao tip mng (Network Adapter) - Thnh phn u tin nn cp ti trong s cc thit b phn cng mng l b iu hp mng (network adapter). Thit b ny cn c bit n vi nhiu tn khc nhau nh network card (card mng), Network Interface Card (card giao din mng), NIC. Tt c u l thut ng chung ca cng mt thit b phn cng. Cng vic ca card mng l gn mt cch vt l my tnh n c th tham gia hot ng truyn thng trong mng . - iu u tin bn cn bit n khi ni v card mng l n phi c ghp ni ph hp vi phng tin truyn t mng (network medium). Network medium chnh l kiu cp dng trn mng. - card mng ghp ni ph hp vi phng tin truyn t mng l mt vn thc s v chng i hi phi p ng c lng ln tiu chun cnh tranh bt buc. Chng hn, trc khi xy dng mt mng v bt u mua card mng, dy cp, bn phi quyt nh xem liu nn dng Ethernet, Ethernet ng trc, Token Ring, Arcnet hay mt tiu chun mng no khc.

Bin son: Th.s Trn Duy Minh

Email: tdminh.cntt.dhtn@gmail.com

47

Modul: K thut mng c bn

Hnh 2.6: Card giao tip mng

2. B lp tn hiu (Repeater) - Repeater l loi thit b phn cng n gin nht trong cc thit b lin kt mng, n c hot ng trong tng vt l ca m hnh OSI. Khi Repeater nhn c mt tn hiu t mt pha ca mng th n s pht tip vo pha kia ca mng.

Hnh 2.7: Phm vi hot ng ca Repeater - Repeater khng c x l tn hiu m n ch loi b cc tn hiu mo, nhiu, khuch i tn hiu b suy hao (v c pht vi khong cch xa) v khi phc li tn hiu ban u. Vic s dng Repeater lm tng thm chiu di ca mng. - Repeater hot ng tng 1 (tng Physical). Hin nay c hai loi Repeater ang c s dng l Repeater in v Repeater in quang. + Repeater in: ni vi ng dy in c hai pha ca n, n nhn tn hiu in t mt pha v pht li v pha kia. Khi mt mng s dng Repeater in ni cc phn ca mng li th c th lm tng khong cch ca mng. + Repeater in quang: lin kt vi mt u cp quang v mt u l cp in, n chuyn mt tn hiu in t cp in ra tn hiu quang pht trn cp quang v

Bin son: Th.s Trn Duy Minh

Email: tdminh.cntt.dhtn@gmail.com

48

Modul: K thut mng c bn

ngc li. Vic s dng Repeater khng thay i ni dung cc tn hin i qua nn n ch c dng ni hai mng c cng giao thc truyn thng.

Hnh 2.8: Qu trnh x l trn Repeater 3. B tp trung (Hub) - Hub l mt trong nhng yu t quan trng nht ca LAN, y l im kt ni dy trung tm ca mng, tt c cc trm trn mng LAN c kt ni thng qua Hub. Hub thng c dng ni mng, thng qua nhng u cm ca n ngi ta lin kt vi cc my tnh di dng hnh sao. Mt Hub thng thng c nhiu cng ni vi ngi s dng gn my tnh v cc thit b ngoi vi. Mi cng h tr mt b kt ni dng cp dy xon 10BASET t mi trm ca mng. - Khi tn hiu c truyn t mt trm ti Hub, n c lp li trn khp cc cng khc ca. - Cc hub thng minh c th nh dng, kim tra, cho php hoc khng cho php bi ngi iu hnh mng t trung tm qun l hub. Nu phn loi theo phn cng th c 3 loi Hub: + Hub n (stand alone hub) + Hub modun (Modular hub) rt ph bin cho cc h thng mng v n c th d dng m rng v lun c chc nng qun l, modular c t 4 n 14 khe cm, c th lp thm cc modun Ethernet 10BASET. + Hub phn tng (Stackable hub) l l tng cho nhng c quan mun u t ti thiu ban u nhng li c k hoch pht trin LAN sau ny. Nu phn loi theo kh nng ta c 2 loi: + Hub b ng (Passive Hub): Hub b ng khng cha cc linh kin in t v cng khng x l cc tn hiu d liu, n c chc nng duy nht l t hp cc tn hiu t mt s on cp mng.
Bin son: Th.s Trn Duy Minh Email: tdminh.cntt.dhtn@gmail.com

49

Modul: K thut mng c bn

+ Hub ch ng (Active Hub): Hub ch ng c cc linh kin in t c th khuych i v x l cc tn hiu in t truyn gia cc thit b ca mng. Qa trnh x l tn hiu c gi l ti sinh tn hiu, n lm cho tn hiu tr nn tt hn, t nhy cm vi li do vy khong cch gia cc thit b c th tng ln. Tuy nhin nhng u im cng ko theo gi thnh ca Hub ch ng cao hn nhiu so vi Hub b ng. V c bn, trong mng Ethernet, hub hot ng nh mt repeater c nhiu cng.

Hnh 2.9: Phm vi hot ng ca b tp trung HUB Cc tham s gii hn khi thit k mng vi Repeater v Hub Cc thit b nh HUB, Repeater lm vic tng vt l khng nhn ra a ch MAC nn mi khi chng nhn c mt tn hiu t mt cng n s pht tin ra tt c cc cng cn li, v vy hnh thnh nn cc vng xung t.

Hnh 2.10: Qu trnh xung t trn HUB hn ch cc min xung t do Hub gy ra, s dng lut 5-4-3. Lut ny quy nh gia hai node bt k trn mng ch c th c ti a 5 on mng, kt ni thng qua 4 Repeater, v ch c 3 trong tng s 5 on mng c my tnh kt ni mng.

Bin son: Th.s Trn Duy Minh

Email: tdminh.cntt.dhtn@gmail.com

50

Modul: K thut mng c bn

Hnh 2.11: S nh lut 5-4-3 4. Cu ni (Bridge) - Bridge l mt thit b c x l dng ni hai mng ging nhau hoc khc nhau, n c th c dng vi cc mng c cc giao thc khc nhau. Cu ni hot ng trn tng lin kt d liu nn khng nh b tip sc phi pht li tt c nhng g n nhn c th cu ni c c cc gi tin ca tng lin kt d liu trong m hnh OSI v x l chng trc khi quyt nh c chuyn i hay khng. - Khi nhn c cc gi tin Bridge chn lc v ch chuyn nhng gi tin m n thy cn thit. iu ny lm cho Bridge tr nn c ch khi ni mt vi mng vi nhau v cho php n hot ng mt cch mm do.

Hnh 2.12: Phm vi hot ng ca Bridge - thc hin c iu ny trong Bridge mi u kt ni c mt bng cc a ch cc trm c kt ni vo pha , khi hot ng cu ni xem xt mi gi tin n nhn c bng cch c a ch ca ni gi v nhn v da trn bng a ch pha nhn c gi tin n quyt nh gi gi tin hay khng v b xung bng a ch. - Khi c a ch ni gi Bridge kim tra xem trong bng a ch ca phn mng nhn c gi tin c a ch hay khng, nu khng c th Bridge t ng b xung bng a ch (c ch c gi l t hc ca cu ni). Khi c a ch ni nhn
Bin son: Th.s Trn Duy Minh Email: tdminh.cntt.dhtn@gmail.com

51

Modul: K thut mng c bn

Bridge kim tra xem trong bng a ch ca phn mng nhn c gi tin c a ch hay khng, nu c th Bridge s cho rng l gi tin ni b thuc phn mng m gi tin n nn khng chuyn gi tin i, nu ngc li th Bridge mi chuyn sang pha bn kia. - y chng ta thy mt trm khng cn thit chuyn thng tin trn ton mng m ch trn phn mng c trm nhn m thi. - nh gi mt Bridge ngi ta a ra hai khi nim: Lc v chuyn vn. Qu trnh x l mi gi tin c gi l qu trnh lc trong tc lc th hin trc tip kh nng hot ng ca Bridge. Tc chuyn vn c th hin s gi tin/giy trong th hin kh nng ca Bridge chuyn cc gi tin t mng ny sang mng khc.

Hnh 2.13: Qu trnh x l thng tin trn Bridge - Hin nay c hai loi Bridge ang c s dng l Bridge vn chuyn v Bridge bin dch. Bridge vn chuyn dng ni hai mng cc b cng s dng mt giao thc truyn thng ca tng lin kt d liu, tuy nhin mi mng c th s dng loi dy ni khc nhau. Bridge vn chuyn khng c kh nng thay i cu trc cc gi tin m n nhn c m ch quan tm ti vic xem xt v chuyn vn gi tin i. - Bridge bin dch dng ni hai mng cc b c giao thc khc nhau n c kh nng chuyn mt gi tin thuc mng ny sang gi tin thuc mng kia trc khi chuyn qua

Bin son: Th.s Trn Duy Minh

Email: tdminh.cntt.dhtn@gmail.com

52

Modul: K thut mng c bn

Hnh 2.14: Hot ng ca Bridge bin dch Ngi ta s dng Bridge trong cc trng hp sau : - M rng mng hin ti khi t ti khong cch ti a do Bridge sau khi s l gi tin pht li gi tin trn phn mng cn li nn tn hiu tt hn b tip sc. - Gim bt tc nghn mng khi c qu nhiu trm bng cch s dng Bridge, khi chng ta chia mng ra thnh nhiu phn bng cc Bridge, cc gi tin trong ni b tng phn mng s khng c php qua phn mng khc. ni cc mng c giao thc khc nhau. Mt vi Bridge cn c kh nng la chn i tng vn chuyn. N c th ch chuyn vn nhng gi tin ca nhng a ch xc nh. - Mt s Bridge c ch to thnh mt b ring bit, ch cn ni dy v bt. Cc Bridge khc ch to nh card chuyn dng cm vo my tnh, khi trn my tnh s s dng phn mm Bridge. Vic kt hp phn mm vi phn cng cho php uyn chuyn hn trong hot ng ca Bridge.

Hnh 2.15: Hot ng c bn trn Bridge

Bin son: Th.s Trn Duy Minh

Email: tdminh.cntt.dhtn@gmail.com

53

Modul: K thut mng c bn

5. B chuyn mch (Switch) - B chuyn mch l s tin ho ca cu ni, nhng c nhiu cng v dng cc mch tch hp nhanh gim tr ca vic chuyn khung d liu.

Hnh 2.16: Phm vi hot ng ca b chuyn mch - Nhim v ca switch l chuyn tip cc khung t nhnh mng ny sang nhnh mng khc mt cch c chn lc da vo a ch MAC ca cc my tnh. lm c iu ny, switch cn phi duy tr trong b nh ca mnh mt bng a ch cc b cha v tr ca tt c cc my tnh trong mng. Mi my tnh s chim mt mc t trong bng a ch. Mi switch c thit k vi mt dung lng b nh gii hn. V nh th, n xc nh kh nng phc v ti a ca mt switch. Chng ta khng th dng switch ni qu nhiu mng li vi nhau. - Switch gia bng a ch MAC ca mi cng v thc hin giao thc Spanning - Tree. Switch cng hot ng tng data link v trong sut vi cc giao thc tng trn. Gii thut Spanning Tree Cu ni trong sut s hot ng sai nu nh trong hnh trng mng xut hin cc vng. Xt v d nh hnh di y:

Hnh 2.12: Qu trnh to vng qun trn cu ni Bridge - Gi s M gi khung F cho N, c hai cu ni B1 v B2 cha c thng tin g v a ch ca N. Khi nhn c khung F, c B1 v B2 u chuyn F sang LAN 2, nh
Bin son: Th.s Trn Duy Minh Email: tdminh.cntt.dhtn@gmail.com

54

Modul: K thut mng c bn

vy trn LAN 2 xut hin 2 khung F1 v F2 l phin bn ca F c sao li bi B1 v B2. Sau F1 n B2 v F2 n B1. Tip tc B1 v B2 li ln lt chuyn F2 v F1 sang LAN1, qu trnh ny s khng dng, dn n hin tng rc trn mng. Ngi ta gi hin tng ny l vng qun trn mng. - khc phc hin tng vng qun, Digital a ra gii thut ni cy, sau ny c chun ha di chun IEEE 802.1d. Mc tiu ca gii thut ny l nhm xc nh ra cc cng to nn vng qun trn mng v chuyn n v trng thi d phng (stand by) hay kha (Blocked), a s mng v dng hnh cy (khng cn cc

vng). Cc cng ny c chuyn sang trng thi hot ng khi cc cng chnh b s c. Gii thut da trn l thuyt v th v yu cu cc vn sau: - Mi cu ni phi c gn mt s hiu nhn dng duy nht. - Mi cng cng c mt s nhn dng duy nht v c gn mt gi. Gii thut tri qua 4 bc sau: + Chn cu ni gc (Root Bridge): n gin cu ni gc l cu ni c s nhn dng nh nht. + Trn cc cu ni cn li, chn cng gc (Root Port): L cng m gi ng i t cu ni hin ti v cu ni gc thng qua n l thp nht so vi cc cng cn li. + Trn mi LAN, chn cu ni c ch nh (Designated BrIDge): Cu ni c ch nh ca mt LAN l cu ni m thng qua n, gi ng i t LAN hin ti v gc l thp nht. Cng ni LAN v cu ni c ch nh c gi l cng c ch nh (Designated Port). + t tt c cc cng gc, cng ch nh trng thi hot ng, cc cng cn li trng thi kha. C ch hot ng: Switch c hai hot ng c bn. - Hot ng th nht c gi l chuyn mch frame d liu. L qu trnh m qua mt frame c tip nhn t u vo v c truyn i trn mt u ra. - Hot ng th hai l h tr hot ng chuyn mch, Switch duy tr cc bng chuyn mch v tm kim. Switch c hai nguyn tc hot ng l:

Bin son: Th.s Trn Duy Minh

Email: tdminh.cntt.dhtn@gmail.com

55

Modul: K thut mng c bn

+ Store and Forward: Nhn data frame th pht tn hiu qua, nu cha nhn th lu li cho n khi , nu data frame li th khng pht. + Cut-Though: Nhn ra a ch MAC pht tn hiu lun, khng cn ch cho frame d liu. B chuyn mch c nh tuyn (Layer 3 switch) Switch L3 c th chy giao thc nh tuyn tng mng, tng 3 ca m hnh 7 tng OSI. Switch L3 c th c cc cng WAN ni cc LAN khong cch xa. Thc cht n c b sung thm tnh nng ca router. Khi nim Collision Domain v Broadcast Domain Collision Domain (Min xung t): Min xung t c nh ngha l vng mng m trong cc khung pht ra c th gy xung t vi nhau. Cng nhiu trm trong cng mt min xung t th s lm tng s xung t v lm gim tc truyn, v th m min xung t cn c th gi l min bng thng (cc trm trong cng min ny s chia s bng thng ca min) mt trong nhng nguyn nhn chnh lm cho hot ng ca mng khng hiu qu. Mi khi mt ng xy ra trn mt mng, tt c cc hot ng truyn dng li trong mt khong thi gian. Khong thi gian ngng tt c hot ng truyn ny thay i v c xc nh bi mt thut ton vn hi (backoff) trong mi thit b mng.

Hnh 2.17: Min xung t Khi s dng HUB, Repeater cn ch n lut 5-4-3-2-1: Nm on mng hnh thnh mi trng truyn ton mng Bn Repeater hay Hub Ba on mng c cha host tham gia truyn thng Hai on mng khng cha host 56

Bin son: Th.s Trn Duy Minh

Email: tdminh.cntt.dhtn@gmail.com

Modul: K thut mng c bn

Mt min xung t ln. 6. B nh tuyn (Router) Router l mt thit b hot ng trn tng mng, n c th tm c ng i tt nht cho cc gi tin qua nhiu kt ni i t trm gi thuc mng u n trm nhn thuc mng cui. Router c th c s dng trong vic ni nhiu mng vi nhau v cho php cc gi tin c th i theo nhiu ng khc nhau ti ch.

Hnh 2.18: S hot ng ca b nh tuyn Cc vn lin quan n vic xy dng mng din rng Vai tr ca b chn ng (Router) trong mng din rng Nguyn tc hot ng ca b chn ng Cc vn lin quan n vic thit k gii thut chn ng Cch thc thit lp mng IP Cc giao thc chn ng ph bin: RIP, OSPF, BGP

Hnh 2.19: Phm vi hot ng ca b nh tuyn

Bin son: Th.s Trn Duy Minh

Email: tdminh.cntt.dhtn@gmail.com

57

Modul: K thut mng c bn

- Mi mt router thng tham gia vo t nht l 2 mng. N c th l mt thit b chuyn dng vi hnh dng ging nh Hub hay switch hoc c th l mt my tnh vi nhiu card mng v mt phn mm ci t gii thut chn ng. Cc u ni kt (cng) ca cc router c gi l cc giao din (Interface). - Khc vi Bridge hot ng trn tng lin kt d liu nn Bridge phi x l mi gi tin trn ng truyn th Router c a ch ring bit v n ch tip nhn v x l cc gi tin gi n n m thi. Khi mt trm mun gi gi tin qua Router th n phi gi gi tin vi a ch trc tip ca Router v khi gi tin n Router th Router mi x l v gi tip. - Khi x l mt gi tin Router phi tm c ng i ca gi tin qua mng. lm c iu Router phi tm c ng i tt nht trong mng da trn cc thng tin n c v mng, thng thng trn mi Router c mt bng ch ng (Routing table). - Da trn d liu v Router gn v cc mng trong lin mng, Router tnh c bng ch ng (Routing table) ti u da trn mt thut ton xc nh trc. Ngi ta phn chia Router thnh hai loi l Router c ph thuc giao thc v Router khng ph thuc vo giao thc da vo phng thc x l cc gi tin khi qua Router. - Router c ph thuc giao thc: Ch thc hin vic tm ng v truyn gi tin t mng ny sang mng khc ch khng chuyn i phng cch ng gi ca gi tin cho nn c hai mng phi dng chung mt giao thc truyn thng. Router khng ph thuc vo giao thc.B Bng chn ng (Routing table) xc nh c ng i n ch cho cc gi tin, cc router duy tr mt Bng chn ng (Routing table) cha ng i n nhng im khc nhau trn ton mng. Hai trng quan trng nht trong bng chn ng ca router l ch n (Destination) v Bc k tip (Next Hop) cn phi chuyn gi tin c th n c ch n.

Bin son: Th.s Trn Duy Minh

Email: tdminh.cntt.dhtn@gmail.com

58

Modul: K thut mng c bn

Hnh 2.20: Qu trnh chn ng ca Router - Thng thng, ch n trong bng chn ng l a ch ca cc mng. Trong khi Next Hop l mt router lng ging ca router ang xt. Hai router c gi l lng ging ca nhau nu tn ti mt ng ni kt vt l gia chng. Thng tin c th chuyn ti bng tng hai gia hai router lng ging. Trong m hnh mng trn, router R1 c hai lng ging l R2 v R3.

Hnh 2.21: Qu trnh gi tin i qua Router Gi s my tnh X gi cho my tnh Y mt gi tin. Con ng i ca gi tin c m t nh sau: V Y nm trn mt mng khc vi X cho nn gi tin s c chuyn n router A. Ti router A: + Tng mng c a ch my nhn xc nh a ch ca mng ch c cha my nhn v k tip s tm trong bng chn ng bit c next hop cn phi gi i l u. Trong trng hp ny l Router B. + Gi tin sau c a xung tng 2 ng vo trong mt khung v a ra hng i ca giao din/cng hng n next hop v ch c chuyn i trn ng truyn vt l. Tin trnh tng t din ra ti router B v C.
Bin son: Th.s Trn Duy Minh Email: tdminh.cntt.dhtn@gmail.com

59

Modul: K thut mng c bn

Ti Router C, khung ca tng 2 s chuyn gi tin n my tnh Y. ngn chn vic mt mt s liu Router cn nhn bit c ng no c th chuyn vn v ngng chuyn vn khi ng b tc. Cc l do s dng Router: + Router c cc phn mm lc u vit hn l Bridge do cc gi tin mun i qua Router cn phi gi trc tip n n nn gim c s lng gi tin qua n. Router thng c s dng trong khi ni cc mng thng qua cc ng dy thu bao t tin do n khng truyn d ln ng truyn. + Router c th dng trong mt lin mng c nhiu vng, mi vng c giao thc ring bit. + Router c th xc nh c ng i an ton v tt nht trong mng nn an ton ca thng tin c m bo hn. Trong mt mng phc hp khi cc gi tin lun chuyn cc ng c th gy nn tnh trng tc nghn ca mng th cc Router c th c ci t cc phng thc nhm trnh c tc nghn.

Hnh 2.22: Qu trnh xy dng bng tm ng Cc phng thc hot ng ca Router: l phng thc m mt Router c th ni vi cc Router khc qua chia s thng tin v mng hin c. Cc chng trnh chy trn Router lun xy dng bng ch ng qua vic trao i cc thng tin vi cc Router khc. - Phng thc vc t khong cch: mi Router lun lun truyn i thng tin v bng ch ng ca mnh trn mng, thng qua cc Router khc s cp nht ln bng ch ng ca mnh. - Phng thc trng thi tnh: Router ch truyn cc thng bo khi c pht hin c s thay i trong mng v ch khi cc Router khc cp nht li bng ch ng, thng tin truyn i khi thng l thng tin v ng truyn.
Bin son: Th.s Trn Duy Minh Email: tdminh.cntt.dhtn@gmail.com

60

Modul: K thut mng c bn

Mt s giao thc hot ng chnh ca Router + RIP(Routing Information Protocol) c pht trin bi Xerox Network system v s dng SPX/IPX v TCP/IP. RIP hot ng theo phng thc vc t khong cch. + NLSP (Netware Link Service Protocol) c pht trin bi Novell dng thay th RIP hot ng theo phc vect khong cch. + OSPF (Open Shortest Path First) l mt phn ca TCP/IP vi phng thc trng thi tnh, trong c xt ti u tin, gi ng truyn, mt truyn thng... + IS-IS (Open System Interconnection Intermediate System to Intermediate System) l mt phn ca TCP/IP vi phng thc trng thi tnh, trong c xt ti u tin, gi ng truyn, mt truyn thng...

Bin son: Th.s Trn Duy Minh

Email: tdminh.cntt.dhtn@gmail.com

61

Modul: K thut mng c bn

Bi 3: THIT K MNG LAN 1. M hnh c bn 1.1. M hnh phn cp (Hierarchical models)

Hnh 2.23: M hnh phn cp

Lp li (Core Layer): y l trc xng sng ca mng(backbone) thng dng cc b chuyn mch c tc cao(high-speed switching), thng c cc c tnh nh tin cy cao, c cng sut d tha, c kh nng t khc phc li, c kh nng thch nghi cao, p ng nhanh, d qun l, c kh nng lc gi, hay lc cc tin trnh ang truyn trong mng. Lp phn tn (Distribution Layer): Lp phn tn l gianh gii gia lp truy nhp v lp li ca mng. lp phn tn thc hin cc chc nng nh m bo gi d liu n tng phn on mng, m bo an ninh-an ton, phn on mng theo nhm cng tc, chia min Broadcast/multicast, nh tuyn gia cc LAN o (VLAN). - Lp phn tn chuyn mi trng truyn dn, nh tuyn gia cc min, to bin gii gia cc min trong nh tuyn tnh v ng, thc hin cc b lc gi (theo a ch, theo s hiu cng,...), thc hin cc c ch m bo cht lng dch v QoS. Lp truy nhp(Access Layer): Lp truy nhp cung cp cc kh nng truy nhp cho ngi dng cc b hay t xa truy nhp vo mng. Thng c thc hin bng cc b chuyn mch (switch) trong mi trng campus, hay cc cng ngh WAN. nh gi m hnh Gi thnh thp D ci t D m rng D c lp li.

Bin son: Th.s Trn Duy Minh

Email: tdminh.cntt.dhtn@gmail.com

62

Modul: K thut mng c bn

1.2 M hnh an ninh-an ton (Secure models).


H thng tng la 3 phn (Three-Part Firewall System), c bit quan trng trong thit k WAN, chng ta s tm hiu trong chng 4. y, ti ch nu mt s kha cnh chung nht cu trc ca m hnh s dng trong thit k mng LAN.

Hnh 2.24: M hnh mng 3 phn

Hnh 2.25: S mng 3 phn lin kt qua Firewall PIX LAN c lp lm vng m gia mng cng tc vi mng bn ngoi (LAN c lp c gi l khu phi qun s hay vng DMZ). Thit b nh tuyn trong c ci t b lc gi c t gia DMZ v mng cng tc. Thit b nh tuyn ngoi c ci t b lc gi c t gia DMZ v mng ngoi. 2. Cc yu cu thit k Cc yu cu thit k ca LAN v mt cu trc cng tng t nh thit k WAN, y chng ti ch nu mc bao gm cc yu cu: Yu cu k thut. Yu cu v hiu nng. Yu cu v ng dng.
Bin son: Th.s Trn Duy Minh Email: tdminh.cntt.dhtn@gmail.com

63

Modul: K thut mng c bn

Yu cu v qun l mng. Yu cu v an ninh - an ton mng. Yu cu rng buc v ti chnh, thi gian thc hin, yu cu v chnh tr ca d n, xc nh ngun nhn lc, xc nh cc ti nguyn c v c th ti s dng. 3. Cc bc thit k + Phn tch yu cu S lng nt mng (rt ln trn 1000 nt, va trn 100 nt v nh di 10nt). Trn c s s lng nt mng, chng ta c phng thc phn cp, chn k thut chuyn mch, v chn thit b chuyn mch. Da vo m hnh phng ban phn on vt l m bo hai yu cu an ninh v m bo cht lng dch v. Da vo m hnh topology la chn cng ngh i cp. D bo cc yu cu m rng. + La chn phn cng (thit b, cp, cng ngh kt ni,...) - Da trn cc phn tch yu cu v kinh ph d kin cho vic trin khai, chng ta s la chn nh cung cp thit b tt nht nh l Cisco, Plannet, 3COM, Intel ... + La chn phn mm La chn h iu hnh Unix (AIX, OSF, HP, Solaris, ...), Linux, Windows da trn yu cu v x l s lng giao dch, p ng thi gian thc, kinh ph, an ninh an ton. La chn cc cng c pht trin phn mm ng dng nh cc phn mm qun tr c s d liu (Oracle, Informix, SQL, Lotusnote, ...), cc phn mm portal nh Websphere. La chn cc phn mm mng nh th in t (Sendmail, PostOffice, Netscape, ...), Web server ( Apache, IIS, ...) La chn cc phn mm m bo an ninh an ton mng nh phn mm tng la (PIX, Checkpoint, Netfilter, ...), phn mm chng virus (VirusWall, NAV, ...), phn mm chng t nhp v phn mm qut l hng an ninh trn mng. + nh gi kh nng Da vo thng tin c xc minh ca cc hng c uy tn trn th gii.

Bin son: Th.s Trn Duy Minh

Email: tdminh.cntt.dhtn@gmail.com

64

Modul: K thut mng c bn

Thc hin th nghim v kim tra trong phng th nghim ca cc chuyn gia. nh gi trn m hnh th nghim. + Tnh ton gi thnh Gi thnh thp m bo cc ch tiu k thut, cc yu cu ca ng dng, tnh kh m ca h thng. + Trin khai pilot. Trin khai quy m nh nhng vn minh ha c ton b cc yu cu v k thut, yu cu v ng dng lm c s cho vic nh gi kh nng v gi thnh ca mng trc khi trin khai trn din rng.

Bin son: Th.s Trn Duy Minh

Email: tdminh.cntt.dhtn@gmail.com

65

Modul: K thut mng c bn

Bi 4: KIN THC C BN V MNG LAN KHNG DY 1. Khi qut mng LAN khng dy. - Thc t cho thy vic cc cng ty s dng v ng dng mng khng dy mang li nhiu li ch, khng ch ci thin kh nng truyn ti d liu m cn gim chi ph trin khai. - Thit b khng dy gip cc cng ty c kh nng truy cp theo thi gian thc vo cc dch v, mang li kh nng phn ng nhanh nhy vi cc thay i ca th trng. Ni mt cch n gin hn, mng khng dy ang thay i cch thc kinh doanh ca cc doanh nghip. - Mng LAN khng dy (Wireless Local Area Network - WLAN) l mt h thng cc thit b c nhm li vi nhau, c kh nng giao tip thng qua sng radio thay v cc ng truyn dn bng dy. - Mng WLAN thc s ang thay th cho mng my tnh c dy, cung cp kh nng x l linh ng hn v t do hn cho cc hot ng kinh doanh. - Ngi dng c th truy nhp vo mng Intranet ca ni b cng ty, hoc mng Internet (WWW) t bt c a im no trong khun vin ca cng ty m khng b rng buc bi cc kt ni vt l. - Mng WLAN c th truyn thng tin v d liu ti cp lnh o v nhn vin trong mt cng ty m khng quan tm ti v tr ngi lm vic. C rt nhiu ngnh cng nghip pht hin ra li th ca mng WLAN, khng ch trong cng vic hng ngy m cn tc ng ti c cn cn doanh thu. Mt s li ch ca mng WLAN bao gm: + Kh nng di ng: Mng WLAN c th cho php ngi dng truy cp thng tin theo thi gian thc t bt c v tr no trong khun vin v phm vi cng ty m khng phi tm kim cc v tr c kt ni mng qua Ethernet, do vy s tng c nng sut lao ng. + tin cy: t s dng cc kt ni c dy cng ng ngha vi vic t pht sinh nhiu vn hn cho ngi dng v qun tr h thng. + Lp t d dng: Mng WLAN khng yu cu qu trnh lp t cp tn km v mt nhiu thi gian.
Bin son: Th.s Trn Duy Minh Email: tdminh.cntt.dhtn@gmail.com

66

Modul: K thut mng c bn

+ Kh nng tu bin: Gi thnh lp t mng WLAN tnh cho tui i sn phm c th thp hn rt nhiu so vi mng c dy, c bit l trong mi trng i hi kh nng di chuyn v sa i thng xuyn. + Tnh quy m: H thng WLAN d cu hnh v ti sp xp ph hp vi quy m cc vn phng v s lng ngi dng. - Vi kin trc mng c dy. Mt im truy cp n c th h tr mt nhm nh ngi dng, v c vng ph sng trong khong chu vi t 10m n hn 100m. im truy cp c th c lp t ti bt c v tr no trong cng ty min l ph sng phi c m bo. - Ngi dng c trang b thit b cm tay hoc my tnh xch tay c th truyn d liu ti im truy cp khi ang trong vng ph sng ca thit b. Thit b khng dy c th giao tip vi h iu hnh mng thng qua cc card iu hp WLAN (thng l card giao din mng NIC) Mng WLAN ang tr nn ph bin trong cc mi trng: + H thng thng tin doanh nghip: Cc nh qun l mng c th di chuyn nhn vin, lp ra cc vn phng tm thi, hoc ci t my in v nhiu thit b khc m khng b nh hng bi chi ph v tnh phc tp ca mng c dy. + Du lch: Khch sn v cc im du lch c th x l thng tin t phng, yu cu dch v hoc thng tin v hnh l ca khch hng. + Gio dc: Sinh vin v ging vin c th lin lc vi nhau t bt c v tr no trong khun vin i hc trao i hoc ti v cc bi ging c sn trn mng. Mng WLAN cn gim thiu nhu cu s dng phng lab. + Thng tin sn phm: Cc nhn vin chu trch nhim v xut kho c th cp nht v trao i cc thng tin quan trng ca sn phm. + Y t: Bc s, y t c th trao i cc thng tin v bnh nhn hoc liu php cha tr Tc ca mng WLAN Tc ca mng WLAN ph thuc vo kiu v cu hnh thit b trong h thng mng. S lng ngi dng, khong cch gia cc thnh phn ca mng, loi h thng mng WLAN c s dng, v hiu qu ca mng c dy u l cc yu t nh hng ti tc tng th ca mng WLAN. - Nhng nhn t trn cn tc ng ti tc ca mng c dy, nhng hu ht cc mng LAN thng mi u chy trong khong t 10 megabit/giy (Mbps) (10BaseT)

Bin son: Th.s Trn Duy Minh

Email: tdminh.cntt.dhtn@gmail.com

67

Modul: K thut mng c bn

ti 100Mbps (100BaseT). Cc thnh phn ca mng WLAN s dng chun tc cao 802.11a c th t tc ti a 54Mbps, gp 5 ln so vi chun 802.11b. - Hu ht cc ng dng di ng hin nay u c thit b cho cu trc WLAN 802.11. Trong s 3 chun bin tu ca 802.11, chun 802.11b hot ng di tn 2,4GHz. Mc d chun ny c s dng rng hn cc chun khng dy khc, nh 802.11g v 802.11a 2. Kh nng bo mt ca mng khng dy - Theo l thuyt, mng khng dy c th cho php mi i tng kt ni (c ch hoc khng c ch ) vi h thng trong vng ph sng. Kh nng ny l nguy c to iu kin cho tin tc thc hin cc bin php nghe ln thng tin (eavesdrop) hoc xm nhp vo h thng ca c quan bn t cc to nh bn cnh. - Tuy vng ph sng ca mng khng dy b hn ch nhng tn hiu ca chng c th thu c t khong cch trn 100m so vi im pht sng. i vi cc c s ln s dng h thng a im truy cp (AP) kt ni mng khng dy vi mng c dy, th mi im AP u cha ng cc nguy c tn cng ca tin tc. - Cc chuyn gia bo mt u nht tr rng bo mt lun l th thch ln nht i vi s pht trin v ln mnh ca mng WLAN, c bit i vi cc doanh nghip v khu vc chnh ph. Chnh v vy, c mt s chun bo mt v cng c an ninh mng c pht trin ngn chn cc kh nng tn cng vo mng WLAN. - Vic tng cng kh nng bo mt mng WLAN vn ang l cuc chin gia cc nh cung cp dch v v tin tc. Song song vi nhn thc v li ch ca mng khng dy, ngi dng cn phi bit cch bo v d liu kinh doanh ca mnh trong mi trng khng dy ang c nhiu s thay i v kh nng bo mt. - Bn cch , ngi dng cng cn phi phi hp vi cc nh cung cp dch v c th to ra cc phng n bo mt hon chnh hn cho mng khng dy. Chi ph cho mng khng dy. Vic trin khai mng WLAN i hi cc doanh nghip phi u t cho thit b phn cng (im truy cp, b iu hp mng WLAN), phn mm, th tc ci t v mt s lng tng i kin thc v cng ngh thng tin. Qu trnh ci t v sa cha s khng phi tn qu nhiu cng sc lao ng v khng dnh dng nhiu ti dy cp truyn d liu. Tng t, qu trnh di chuyn, b sung v sa i i vi mng WLAN cng n gin hn, v do c th gim c gi thnh lao ng.

Bin son: Th.s Trn Duy Minh

Email: tdminh.cntt.dhtn@gmail.com

68

Modul: K thut mng c bn

3. Cu hnh thit b thu pht khng dy Cu hnh Access Point (Linksys). - Trn Access Point, Reset v cu hnh nh sn xut - Vo Start / Run / cmd + S dng lnh C:\ ping 192.168.1.1 (Ty hng sn xut c a ch default IP khc nhau) kim tra xem my tnh kt ni vi Access Point cha?

Hnh 2.26: ng nhp cu hnh

Hnh 2.27: Cc bc cu hnh c bn Access Point

Bin son: Th.s Trn Duy Minh

Email: tdminh.cntt.dhtn@gmail.com

69

Modul: K thut mng c bn

Bi 5: MNG LAN O VIRTUAL LAN 1. Khi nim chung. - Trong phn phn on mng, cu ni v b chuyn mch c th tch mi cng ca chng l mt min xung t ring nhng tt c u thuc cng mt min qung b. Cch duy nht chia tch cc min qung b khc nhau l s dng cc b nh tuyn. - Tuy nhin trong phn ny chng ta ni ti kh nng khc ca cc b chuyn mch hin i, chng c th lc cc khung tin qung b v ch gi chng ti min qung b xc nh. S dng cc b chuyn mch kt hp cc thit b thnh cc vng qung b logic s to ra cc mng LAN o (VLAN).

Hnh 2.28: M hnh mng LAN o 2. To mng LAN o vi b chuyn mch 2.1. To mng LAN o trn mt b chuyn mch - Mi mng LAN o v cc thnh vin ca n c xc nh bi mt nhm cc cng trn b chuyn mch. Mi cng ca b chuyn mch thuc v mt mng LAN o no , do cc thit b gn vi cng ny s thuc v mng LAN o ny. Cc khung tin qung b ch c pht ti cc cng thuc cng mt mng LAN o. - Mt thit b c th chuyn t LAN o sang LAN o khc bng cch kt ni ti cng khc ca b chuyn mch. Mt thit b khi thay i v tr a l vn thuc v LAN o c nu n vn duy tr kt ni ti mt trong cc cng thuc v LAN o ny.

Bin son: Th.s Trn Duy Minh

Email: tdminh.cntt.dhtn@gmail.com

70

Modul: K thut mng c bn

2.2. To mng LAN o vi nhiu b chuyn mch Trong thc t, vic s dng nhiu b chuyn mch xy dng cc mng LAN o c thc hin nhiu hn. - thc hin mng LAN o bng nhiu b chuyn mch, mt s nh danh c bit VLAN ID c gn cho cc khung tin, s ny xc nh mng LAN o m khung tin cn chuyn ti.

Hnh 2.29: To mng LAN o vi nhiu b chuyn mch - Gi s mt my trm A gi khung tin ti my trm B thuc cng LAN o vi mnh (nhng khng cng thuc mt b chuyn mch). B chuyn mch m my A ni trc tip ti s gn thm vo khung tin ch s VLAN ID v chuyn n ti b chuyn mch k tip. - Mi b chuyn mch s s dng VLAN ID nh tuyn khung tin, n s c VLAN ID v chuyn tip khung tin cho b chuyn mch thch hp. - Khi khung tin ti b chuyn mch cui cng, b chuyn mch ny nhn ra ch ti ni trc tip ti mt trong cc cng ca mnh. N s loi b phn u cha ch s VLAN ID ri gi khung ti ng cng. Khung tin khi ti trm ch s c khi phc nguyn dng ban u. 3. Cch xy dng mng LAN o - to ra mng LAN o, cn phi xc nh nhm logic. Nhm cc my tnh (thit b) trong mng LAN o thng c t chc theo hai m hnh: M hnh nhm lm vic. - Theo m hnh ny, cc thnh vin trong mng LAN o l cc my tnh cng thc hin mt chc nng, ngi s dng trong cng mt nhm cng vic. Cc mng LAN o thng c chia theo cc phng ban, v d Phng k ton, phng Bn hng,

Bin son: Th.s Trn Duy Minh

Email: tdminh.cntt.dhtn@gmail.com

71

Modul: K thut mng c bn

Phng nghin cu... Cc ti nguyn khc chung ca mng s thuc v mt hoc nhiu mng LAN o. M hnh dch v. - Theo m hnh ny, cc mng LAN o c phn chia theo loi hnh dch v c th. V d, tt c cc my tnh cn truy nhp ti dch v c th no s l thnh vin ca cng mt mng LAN o. - Cc my tnh c th l thnh vin ca nhiu mng LAN o khc nhau tu thuc vo cc dch v m n cn truy nhp ti. 4. u im v nhc im ca mng LAN o u im: C th to ra mng LAN o, to ra cc nhm lm vic khng ph thuc vo v tr ca thit b, chng hn, nhng ngi thuc cng nhm nghin cu khng cn ngi cng mt phng hay cng mt tng trong to nh m vn l cc thnh vin trong mt mng LAN o. C th d dng di chuyn thit b t mng LAN o ny sang mng LAN o khc. Mng LAN o cho php kim sot kim cc min qung b v kim sot tnh bo mt. u im khc l bng vic s dng cc b chuyn mch thay cho cc b nh tuyn, hiu nng lm vic t c cao hn, gi thnh r hn, kh nng qun tr tt hn. Nhc im: Hin nay, chun chnh thc cho VLAN (U ban IEEE 802.1q ang son tho) cha c ph chun mc d chun ny c h tr bi nhiu nh cung cp. Do cc thit lp v cu hnh VLAN ph thuc vo nh sn xut thit b.

Bin son: Th.s Trn Duy Minh

Email: tdminh.cntt.dhtn@gmail.com

72

Modul: K thut mng c bn

Phn 3: THI CNG LP T H THNG MNG C BN Bi 1. HNG DN KHO ST, LP S V LM H S H THNG MNG 1. Gii thiu tin trnh thit k mng LAN Mt trong nhng bc quan trng nht m bo mt h thng mng nhanh v n nh chnh l khu thit k mng. Nu mt mng khng c thit k k lng, nhiu vn khng lng trc s pht sinh v khi m rng mng c th b mt n nh. Thit k mng bao gm cc tin trnh sau: + Thu thp thng tin v yu cu v mong mun ca ngi s dng mng. + Xc nh cc lung d liu hin ti v trong tng lai, c hng n kh nng pht trin trong tng lai v v tr t cc server. + Xc nh tt c cc thit b thuc cc lp 1,2 v 3 cn thit cho s mng LAN v WAN. + Lm ti liu ci t mng mc vt l v mc lun l. S c nhiu gii php thit k cho cng mt mng. Vic thit k mng cn hng n cc mc tiu sau: + Kh nng vn hnh: Tiu ch u tin l mng phi hot ng. Mng phi p ng c cc yu cu v cng vic ca ngi s dng, phi cung cp kh nng kt ni gia nhng ngi dng vi nhau, gia ngi dng vi ng dng vi mt tc v tin cy chp nhn c. + Kh nng m rng: Mng phi c m rng. Thit k ban u phi c m rng m khng gy ra mt s thay i ln no trong thit k tng th. + Kh nng tng thch: Mng phi c thit k vi mt cp mt lun hng v cc cng ngh mi v phi m bo rng khng ngn cn vic a vo cc cng ngh mi trong tng lai. + C th qun l c: Mng phi c thit k sao cho d dng trong vic theo di v qun tr m bo s vn hnh sun s ca cc tnh nng. 2. Lp s thit k mng Sau khi cc yu cu cho mt mng tng th c thu thp, bc k tip l xy dng s mng (topology) hay m hnh mng cn c thit lp. Vic thit k s mng c chia ra thnh 3 bc: o Thit k s mng tng vt l
Bin son: Th.s Trn Duy Minh Email: tdminh.cntt.dhtn@gmail.com

73

Modul: K thut mng c bn

o Thit k s mng tng lin kt d liu o Thit k s mng tng mng. 2.1. Pht trin s mng tng vt l S i dy l mt trong nhng vn cn phi c xem xt khi thit k mt mng. Cc vn thit k mc ny lin quan n vic chn la loi cp c s dng, s i dy cp phi tha mn cc rng buc v bng thng v khong cch a l ca mng. S mng hnh sao s dng cp xon i CAT 5 thng c dng hin nay. i vi cc mng nh, ch cn mt im tp trung ni kt cho tt c cc my tnh vi iu kin rng khong cch t my tnh n im tp trung ni kt l khng qu 100 mt. Thng thng, trong mt ta nh ngi ta chn ra mt phng c bit lp t cc thit b mng nh Hub, switch, router hay cc bng cm dy (patch panels). Ngi ta gi phng ny l i ni phn phi chnh MDF (Main distribution facility).

Hnh 3.1: Lin kt mng MDF i vi cc mng nh vi ch mt im tp trung ni kt, MDF s bao gm mt hay nhiu cc bng cm dy ni kt cho nm ngang (HCC Horizontal Cross Connect patch panel).

Hnh 3.2: Lin kt cp mng HCC S lng cp chiu ngang (Hirizontal Cable) v kch thc ca HCC patch panel (s lng cng) ph thuc vo s my tnh ni kt vo mng.
Bin son: Th.s Trn Duy Minh Email: tdminh.cntt.dhtn@gmail.com

74

Modul: K thut mng c bn

Khi chiu di t my tnh n im tp trung ni kt ln hn 100 mt, ta phi cn thm nhiu im tp trung ni kt khc. im tp trung ni kt mc th hai c gi l Ni phn phi trung gian (IDF Intermediate Distribution Facility). Dy cp ni IDF v MDF c gi l cp ng (Vertical cabling).

Hnh 3.3: Lin kt gia MDF v IDF - c th ni cc IDF v mt MDF cn s dng thm cc patch panel ni kt cho chiu ng (VCC Vertical Cross Connect Patch Panel). Dy cp ni gia hai VCC patch panel c gi l cp chiu ng (Vertical Cabling). Chng c th l cp xon i nu khong cch gia MDF v IDF khng ln hn 100 mt. Ngc li phi dng cp quang khi khong cch ny ln hn 100 mt. Tc ca cp chiu ng thng l 100 Mbps hoc 1000 Mbps.

Hnh 3.4: Lin kt cp mng VCC Sn phm ca giai on ny l mt b ti liu c t cc thng tin sau: - V tr chnh xc ca cc im tp trung ni kt MDF v IDFs. - Kiu v s lng cp c s dng ni cc IDF v MDF

Bin son: Th.s Trn Duy Minh

Email: tdminh.cntt.dhtn@gmail.com

75

Modul: K thut mng c bn

Hnh 3.5: S phn b cp trong h thng Cc u dy cp phi c nh s v ghi nhn s ni kt gia cc cng trn HCC v VCC patch panel. V d di y ghi nhn v thng tin cc si cp c s dng ti IDF s 1

Hnh 3.6: Thng tin cp s dng trong h thng

Bin son: Th.s Trn Duy Minh

Email: tdminh.cntt.dhtn@gmail.com

76

Modul: K thut mng c bn

2.2. Ni kt tng 2 bng switch


S ng v kch thc vng ng l hai yu t nh hng n hiu nng ca mng. Bng cch s dng cc switch chng ta c th phn nh cc nhnh mng nh c th gim bt c tun sut ng gia cc my tnh v gim c kch thc ca vng ng trong mng.

Hnh 3.7: S lin kt Switch trong h thng Mt u th na i vi cc switch bt i xng l n c h tr mt s cng c thng lng ln dnh cho cc server hoc cc cp chiu dng ni ln cc switch/router mc cao hn.

Hnh 3.8: Lin kt thit b u cui n Switch xc nh kch thc ca vng ng chng ta cn phi xc nh bao nhiu my tnh c ni kt vt l trn tng cng ca switch. Trng hp l tng mi cng ca switch ch c mt my tnh ni vo, khi kch thc ca vng ng l 2 v ch c my gi v my nhn tham gia vo mi cuc giao tip. Trong thc t ta thng dng switch ni cc Hub li vi nhau. Khi mi Hub s to ra mt vng ng v cc my tnh trn mi Hub s chia s nhau bng thng trn Hub. - Thng thng ngi ta s dng Hub tng s lng cc im ni kt vo mng cho my tnh. Tuy nhin cn phi m bo s lng my tnh trong tng vng ng phi nh v m bo bng thng cho tng my tnh mt.
Bin son: Th.s Trn Duy Minh Email: tdminh.cntt.dhtn@gmail.com

77

Modul: K thut mng c bn

Hnh 3.9: S mng s dng HUB, Switch - a s cc Hub hin nay u c h tr mt cng tc cao hn cc cng cn li (gi l up-link port) dng ni kt vi switch tng bng thng chung cho ton mng.

Hnh 3.10: S lin kt cc Switch thng qua cng Uplink Bng thng cn thit cho cc ng dng c m t nh hnh di y:

Hnh 3.11: Nhu cu s dng bng thng trong mng Sau khi thit k xong s mng tng hai, cn thit phi ghi nhn lai thng tin v tc ca cc cng ni kt cp nh hnh di y:

Hnh 3.12: Thng tin cng lin kt v tc


Bin son: Th.s Trn Duy Minh Email: tdminh.cntt.dhtn@gmail.com

78

Modul: K thut mng c bn

2.3. Thit k mng tng 3 - S dng cc thit b ni kt mng tng 3 nh router, cho php phn nhnh mng thnh cc moun tch ri nhau v mt vt l cng nh lun l. Router cng cho php ni kt mng vi mng din rng nh mng Internet chng hn.

Hnh 3.13: M hnh mng lin kt s dng Router - Router cho php hn ch c cc cuc truyn qung b xut pht t mt vng ng ny lan truyn sang cc vng ng khc. Nh tng bng thng trn ton mng. i vi switch, gi tin gi cho mt my tnh m n cha bit s c truyn i ra tt c cc cng n tt c cc nhnh mng khc. - Ngoi ra, router cn c s dng gii quyt cc vn nh: mt s giao thc khng thch hp khi mng c kch thc ln, vn anh ninh mng v vn v nh a ch mng. Tuy nhin s dng router th t tin v kh khn hn trong vic cu hnh nu so vi switch. - Trong v d sau, mng c nhiu nhnh mng vt l, tt c cc thng tin i trao i gia mng Network 1 v mng Network 2 u phi i qua router. Router chia mng thnh hai vng ng ring ri. Mi vng ng c a ch mng v mt n mng con ring.

Hnh 3.14: S lin kt WAN thng qua Router

Bin son: Th.s Trn Duy Minh

Email: tdminh.cntt.dhtn@gmail.com

79

Modul: K thut mng c bn

2.4. Xc nh v tr t Server - Cc server c chia thnh 2 loi: Server cho ton cng ty (Enterprise Server) v server cho nhm lm vic (Workgroup server). - Enterprise server phc v cho tt c ngi s dng trong cng ty, v d nh Mail server, DNS server. Chng thng c t ti MDF. - Workgroup server th ch phc v cho mt s ngi dng v thng c t ti IDF ni gn nhm ngi s dng server ny nht.

Hnh 3.15: Xc nh v tr Server trong mng

3. Lp ti liu cho tng 3 Sau khi xy dng s cp pht a ch, bn cn ghi nhn li chin lc cp pht a ch. Mt s cc ti liu cn tp ra bao gm: - Bng phn b a ch

Hnh 3.16: Bng phn b a ch Bng tm tt v cc mng c phn b, a ch cc giao din ca tng router v bng chn ng ca cc router.

Bin son: Th.s Trn Duy Minh

Email: tdminh.cntt.dhtn@gmail.com

80

Modul: K thut mng c bn

Hnh 3.17: Thng tin v IP trn cc Router

Bin son: Th.s Trn Duy Minh

Email: tdminh.cntt.dhtn@gmail.com

81

Modul: K thut mng c bn

Bi 2: CNG NGH MNG ETHERNET V CHUN CP 1. Mng Ethernet - Thut ng Ethernet dng ch n h mng cc b c xy dng theo chun IEEE 802.3 s dng giao thc CSMA/CD (Carrier Sense Multiple Access with Collision Detection) chia s ng truyn chung. Ethernet c xem nh l k thut mng cc b ch o trn th trng ni kt cc my tnh c nhn li vi nhau (chim khong 85% th trng) bi v giao thc ca n c cc c tnh sau: + D hiu, d ci t, qun tr v bo tr + Cho php chi ph xy dng mng thp + Cung cp nhiu s ni kt mm do trong ci t + m bo thnh cng vic lin ni kt mng v vn hnh ca mng cho d cc thit b c cung cp bi nhiu nh sn xut khc nhau. + Mng Ethernet u tin c pht trin vo nm 1970 bi cng ty Xerox l mt mng th nghim, s dng dy cp ng trc vi tc truyn ti d liu 3 Mbps. Mng s dng giao thc CSMA/CD. - Nm 1983, chun mng IEEE 802.3 c son tho vi ni dung tng t nh chun mng Ethernet phin bn 1.0. n nm 1985 th IEEE 802.3 c chun ha. C th lit k cc chun mng s dng giao thc CSMA/CD nh sau: + Chun mng 802.3 - C tn l mng Ethernet - Tc truyn ti d liu l 10 Mbps - H tr 4 chun vt l l 10Base-5 (cp ng trc bo), 10Base-2 (Cp ng trc gy), 10Base-T (Cp xon i) v 10Base-F (Cp quang). + Chun mng 802.3u - C tn l mng Fast Ethernet - Tc truyn ti d liu l 100 Mbps - H tr 3 chun vt l l 100Base-TX (Cp xon i), 100Base-T4 (Cp xon i) v 100Base-FX (Cp quang). + Chun mng 802.3z - C tn l mng Giga Ethernet - Tc truyn ti d liu l 1 Gbps
Bin son: Th.s Trn Duy Minh Email: tdminh.cntt.dhtn@gmail.com

82

Modul: K thut mng c bn

- H tr 3 chun vt l l 1000Base-LX, 1000Base-SX, 1000Base-CX. 1000Base-LX, 1000Base-SX s dng cp quang. 1000Base-CX s dng dy cp ng bc kim. + Chun mng 802.3ab - C tn l mng Giga Ethernet over UTP - Tc truyn ti d liu l 1 Gbps - H tr chun vt l 1000Base-TX s dng dy cp xon i khng bc kim. 2. Cu to cp xon i, cc chun cp - Cp xon i c 8 si, xon li vi nhau tng i mt to thnh 4 i vi bn mu c trng: Cam (Orange), xanh dng (Blue), xanh l (Green) v nu (Brown). Mt i gm mt si c ph mu hon ton v mt si mu trng c im vo cc m mu tng ng. - c th ni my tnh vo HUB, Switch, mi u ca si cp xon i u phi c bm u ni UTP (UTP Connector). Card mng trong trng hp ny cng phi h tr loi u ni UTP.

Hnh 3.18: ng dng cp UTP trong mng + Tm hiu connector RJ45 - u ni UTP c 8 pin tip xc vi 8 si ca dy cp xon i. Chun 10 BASE-T ch s dng 4 trong 8 si ca cp xon i truyn d liu (Mt cp truyn, mt cp nhn). Bn si cn li khng s dng. Tng ng trn u ni UTP, ch c 4 pin 1,2,3,6 c s dng, cc pin cn li khng dng n.

Hnh 3.19: Cu to u RJ45


Bin son: Th.s Trn Duy Minh Email: tdminh.cntt.dhtn@gmail.com

83

Modul: K thut mng c bn

+ Gii thiu chun 568A, 568B, u dy thng, dy cho. thng nht, EIA v TIA phi hp v a ra 2 chun bm u dy l T568A v T568B. Chun T568A qui nh: Pin 1: White Green / Tx+ Pin 2: Green / Tx Pin 3: White Orange / Rx+ Pin4: Blue Pin5: White Blue Pin 6: Orange / Rx Pin 7: White Brown Pin 8: Brown

Hnh 3.20: Th t i dy theo chun 568A ng dng ca cp thng (Straight cable): - Ni Switch n Router - Ni Switch n PC - Ni Hub n PC Chun T568B qui nh: Pin 1: White Orange / Tx + Pin 2: Orange / Tx Pin 3: White Green / Rx+ Pin4: Blue Pin5: White Blue Pin 6: Green / RxBin son: Th.s Trn Duy Minh Email: tdminh.cntt.dhtn@gmail.com

84

Modul: K thut mng c bn

Pin 7: White Brown Pin 8: Brown

Hnh 3.21: Th t i dy theo chun 568B ng dng ca cp cho (Crossover cable) - Ni Switch n Switch - Ni Switch n Hub - Ni Hub n Hub - Ni Router n Router - Ni PC n PC - Ni Router n PC

Bin son: Th.s Trn Duy Minh

Email: tdminh.cntt.dhtn@gmail.com

85

Modul: K thut mng c bn

Phn 4: QUN TR C BN, BO TR, BO DNG H THNG MNG Bi 1: PHNG PHP X L S C 1. Phng php truyn thng Cch y mt vi nm khi nghin cu v mng TCP/IP, chng ta tip cn theo cc bc n gin sau x l s c gp phi. Phng php tng t nh di y: Nhp ipconfig kim tra a ch IP, mt n mng con v cng mc nh ca bn xem c ng hay khng. Sau ping n a ch 127.0.0.1 xem adapter mng ca bn c ang lm vic hay khng. Ping n a ch IP ca chnh my tnh bn Th ping n a ch IP my tnh khc trn cng mt mng con. Th ping n cng mc nh ca bn (giao din bn cnh ca b nh tuyn dng kt ni mng con n phn cn li ca mng) Th ping n a ch IP ca my tnh trn mng con khc. - y l mt phng php qu cng nhc, v n qu mang tnh phng php v bn c th khng cn s dng n b no ca mnh, ch cn theo cc bc c sn . N cng c phn khng hiu qu v ging nh t ng tha nhn vn rt c kh nng bt u vi my tnh ca chnh bn v c th gn hn (do card mng, cu hnh a ch IP ca my tnh, subnet ni b) so vi cc mng con khc. Nu Loopback Ping tht bi, thng k ca Ping s cho thy s bc (package) nhn c t hn s bc gi i. L do c th l Driver b h hi, ct mng khng chy hay c mt dch v mm no khc can thip (interfere) vi IP. Time-To-Live (TTL) Thi hn sng - Khi mt ni gi mt bc c cha d liu vi TTL n ni no khc, ni nhn s ch dng d liu y trong thi hn TTL ri s hy b. TTL thng thng c gi tr t 1 n 255 giy ng h v uc cha trong 1 byte. - C th Ping IP Address ca Default Gateway kim tra xem n c hot ng tt v xem computer ca bn c th ni chuyn vi n khng. C th tm hiu thm v cc cch dng khc ca lnh Ping bng cch nh ping /?.

Bin son: Th.s Trn Duy Minh

Email: tdminh.cntt.dhtn@gmail.com

86

Modul: K thut mng c bn

2. Phng php cu trc Phng php m chng ti gii thiu x l s c TCP/IP c cu trc xung quanh ba vn chnh sau: * Ch r cc thnh phn gy ra s c. iu ny c ngha l: - My khch: Cc my khch ang gp phi vn kh khn. - My ch: Cc my ch, my in hoc ti nguyn khc (nh Internet) m ngi dng ang gp phi vn kh khn. - Mng gia: Dy ni (nu khng phi l h thng khng dy), cc hub, switch, router, tng la, proxy server v cc c s h tng mng khc nm gia ngi dng v my ch. - Mi trng: Cc trng hp m rng c th nh hng n mng ca bn nh s dao ng v cng sut, vic xy dng bo tr, - Phm vi: Mt hoc nhiu my khch/my ch lin quan. - Khung thi gian: Lin tc, khng lin tc, thnh thong; khi bt u... - Loi vn kt ni: Vt l, mng, truyn ti hoc lp ng dng; s thm nh hoc iu khin truy cp - Cc hng dn: Thng bo li trn my khch; hp thoi ng nhp * Xc nh xem c th p dng cc bc x l no trn i vi vn xy ra. Gm c c th nh sau: - Thm nh mi trng vt l kt ni cho ngi dng, my ch v phn cng c s h tng mng c lin quan. iu c ngha l kim tra cp, bo m rng adapter mng c t ng cch v tm kim cc nguyn nhn khc lm cho kt ni mng hin th trng thi khng kt ni - Thm nh cu hnh TCP/IP ca cc my khch, my ch v phn cng c s h tng mng c lin quan. Trn my khch v my ch th iu ny ngha l a ch IP, subnet mask, gateway mc nh, cc thit lp DNS... Vi phn cng c s h tng mng th in hnh l bng nh tuyn trn cc b nh tuyn v cng Internet. - Thm nh vic nh tuyn kt ni gia my khch v my ch c lin quan. iu ny ngha l s dng lnh ping, pathping, tracert, v cc cng c tng t thm nh kt ni TCP/IP c xuyn sut ti mc mng; packet sniffing kim tra cc session lp truyn ti; s dng nslookup, telnet v cc cng c khc x l vn lp ng dng c lin quan n tn, thm nh quyn
Bin son: Th.s Trn Duy Minh Email: tdminh.cntt.dhtn@gmail.com

87

Modul: K thut mng c bn

Mt s cu lnh h tr kim tra kt ni mng my tnh: Switch /flushdns Cng dng Xa b cache cha tn trong DNS Lm mi li tt c Dynamic Host Configuration Protocol /registerdns (DHCP) leases v ng k li tt c tn DNS. Mt lease l mt hp ng m DHCP cho php mt computer c dng mt IP Address trong thi hn bao lu. /displaydns /release <card> Hin th cache ca DNS resolver Hy b lease v mt IP Address cho mt card. Nu khng ni r tn card no th DHCP hy b mi leases Pht hnh mt lease mi vi IP Address cho mt card. Nu /renew <card> khng ni r tn card no th DHCP pht hnh lease mi cho mi card.

Bin son: Th.s Trn Duy Minh

Email: tdminh.cntt.dhtn@gmail.com

88

Modul: K thut mng c bn

Bi 2: Khc phc h thng mng tt hn Cc vn c bn nht Hu ht cc vn chung nht v mng trong bi ny t gp trong cc kt ni Internet, cc my in v my tnh. Mt kt ni: Thng vn ny c th gii quyt bng cch khi ng li modem, router hay my tnh. Nhng nu vic ny c lp i lp li nhiu ln th vn c th nm vic thit lp router v my tnh ca bn. Th ni rng thi gian gii phng a ch IP (DHCP) ca router (y l thi gian router dnh mt a ch IP cho mt thit b trn mng) ln khong mt tun. Bn c th thc hin vic cu hnh ny thng qua trnh qun l ca router. Nu t kt ni xy ra vi my tnh xch tay (MTXT), kim tra ngun ca card mng. Trong Windows XP, bn vo Network Adapter trong Device Manager, tm card mng, nhn chut phi chn Properties. Di th Power Management, b chn Allow the computer to turn off this device to save power. Pin MTXT c th mau ht hn, nhng bn s c kt ni n nh hn. Khng thy my in: Nu bn quyt nh chia s my in qua cng USB, bn nn m bo my tnh ni vi my in khng b tt. Nu c th, lp my in vo my tnh bn (khng dng MTXT) v bt thng trc (c th tit kim in bng cch tt mn hnh). Trong Windows XP, cng xc nhn "File and Printer Sharing for Microsoft Networks" c ci t trn tt c cc card mng v th vic chuyn gia mng c dy v khng dy khng lm nh hng n chc nng chia s. Trong XP, vo Control

Panel.Network Connections (cho mi card mng) v nhn phi chut ln thit b chn Properties. Nu bn khng thy "File and Printer Sharing for Microsoft Networks" xut hin trong ca s, chn Install thm vo Tt hn ht, ci t theo dng my ch in n qua mng khng phi lo lng v kh nng chia s my in theo dng gn trc tip vo my tnh Chn truy cp tri php thng qua tng la: H thng tng la ca Vista thng minh qun l vic chia s trong mng. Nhng nu nguyn nhn ca vn l do tng la ca Vista, bn th s dng

Bin son: Th.s Trn Duy Minh

Email: tdminh.cntt.dhtn@gmail.com

89

Modul: K thut mng c bn

cng c ca hng th ba. Tnh nng Trusted Zone ca ZoneAlarm cho php cc my tnh trong cng Workgroup c th giao tip c vi nhau. Tng cng bo mt Cch duy nht m bo s an ton cho mng ca bn l ngn chn n vi th gii bn ngoi khng Web, khng e-mail, khng tin ch. Nhng bn cng khng cn phi dng n chin thut ca c quan bo mt NSA (National Security Agency) bo v d liu ca mnh. Sng v tuyn bao ph: Tng la v b cng c bo mt khng c hiu qu trong vic bo v cc gi tin b "nh cp" khi ang truyn trn sng Wi-Fi tn s cho trc. S dng chun m ha mnh nht m thit b Wi-Fi h tr: Theo th t t mnh nht n yu nht l WPA2, WPA v WEP. Tng tc truyn Nu tc Wi-Fi ti xung mt nhiu thi gian, vic sao lu qua mng ca bn c th gp vn , hy th mt s kinh nghim cho vn ny nh sau: Dng kt ni c dy khi c th: Tc mng c dy (l tng nht l Ethernet c dy) thng nhanh, n nh hn sng khng dy. Khng c l do g khin bn phi t a lu tr mng cch xa router, hy cm vo n cng ethernet c sn trn router. Bn c th lm tng t cho my in mng.

Bin son: Th.s Trn Duy Minh

Email: tdminh.cntt.dhtn@gmail.com

90

Modul: K thut mng c bn

Bi 3: MT S LNH H TR TRONG QUN TR MNG

xem chi tit ca TCP/IP configuration nh vo cu lnh ipconfig /all c qua kt qu kim tra xem: - C mt IP Address khng? - C mt Default Gateway khng? - C mt DHCP server khng? Switch /flushdns Cng dng Xa b cache cha tn trong DNS Lm mi li tt c Dynamic Host Configuration Protocol (DHCP) leases v ng k li tt c tn DNS. Mt lease /registerdns l mt hp ng m DHCP cho php mt computer c dng mt IP Address trong thi hn bao lu. /displaydns /release <card> Hin th cache ca DNS resolver Hy b lease v mt IP Address cho mt card. Nu khng ni r tn card no th DHCP hy b mi leases Pht hnh mt lease mi vi IP Address cho mt card. /renew <card> Nu khng ni r tn card no th DHCP pht hnh lease mi cho mi card.

NSLookup - NSLookup l mt cng c tin dng gii quyt nhng kh khn v DNS, chng hn nh host name resolution (tm IP Address ca mt computer) bng cch c nhng records trong DNS database. Ta dng NSLookup bng cch nh nslookup <name> <server>, trong name l host name ca record m bn ang tm, v server l tn ca server m bn mun hi. Nu server khng c cung cp th default server s uc dng - Kt qu trong hnh trn cho bit DNS server khng th tm ra tn host hay IP Address trong authoritative domain.
Bin son: Th.s Trn Duy Minh Email: tdminh.cntt.dhtn@gmail.com

91

Modul: K thut mng c bn

- Khi bn khi ng NSLookup, n hin th host name v IP Address ca DNS server c configured cho h thng a phng, ri hin th mt command prompt cho bn tip tc hi. Mt cu hi c kt qu tt s c dng nh di y:

Tracert Tracert hin th ng i gia ngun (source host) v ch (destination). Ch nh Tracert s hin th ch dn nh sau:

Trong trng hp trace khng i n ch c, th kt qu l mt du hoa th (*) nm nhng ct thng dng hin th thi gian i gip vng, v c hin th s ip Request time out, hay s ip li no khc trong ct bn phi, ni domain name hay IP Address thng c hin th.

Netstat - Cho bit thng tin v giao thc ca my tnh ang hot ng

Bin son: Th.s Trn Duy Minh

Email: tdminh.cntt.dhtn@gmail.com

92

Modul: K thut mng c bn

Bin son: Th.s Trn Duy Minh

Email: tdminh.cntt.dhtn@gmail.com

93

Modul: K thut mng c bn

PHN THAM KHO MT S NG DNG - DCH V INTERNET

1. Dch v truy nhp t xa Telnet (Number port 23) Telnet cho php ngi s dng ng nhp t xa vo h thng t mt thit b u cui no trn mng. Vi Telnet ngi s dng hon ton c th lm vic vi h thng t xa nh th h ang ngi lm vic ngay trc mn hnh ca h thng. Kt ni Telnet l mt kt ni TCP dng truyn d liu vi cc thng tin iu khin. Mt telnet client c xem nh l mt host cc b. Telnet server c xem nh host xa, server ny dng cc phn mm c bit gi l deamon. 2. Dch v truyn tp (FTP Number port 21) - Dch v truyn tp File Tranfer Protocol (FTP) l mt dch v c bn v ph bin cho php chuyn cc tp d liu gia cc my tnh khc nhau trn mng. FTP h tr tt c cc dng tp, trn thc t n khng quan tm ti dng tp cho d l tp vn bn m ASCII hay cc tp d liu dng nh phn. - Vi cu hnh ca my phc v FTP, c th qui nh quyn truy nhp ca ngi s dng vi tng th mc lu tr d liu, tp d liu cng nh gii hn s lng ngi s dng c kh nng cng mt lc c th truy nhp vo cng mt ni lu tr d liu. 3. Dch v Gopher - Trc khi Web ra i Gopher l dch v rt c a chung. Gopher l mt dch v chuyn tp tng t nh FTP, nhng n h tr ngi dng trong vic cung cp thng tin v ti nguyn. Client Gopher hin th mt thc n, ngi dng ch vic la chn ci m mnh cn. - Gopher b gii hn trong kiu cc d liu. N ch hin th d liu di dng m ASCII mc d c th chuyn d liu dng nh phn v hin th n bng mt phn mm khc. 4. Dch v WAIS WAIS (Wide Area Information Serves) l mt dch v tm kim d liu. WAIS thng xuyn bt u vic tm kim d liu ti th mc ca my ch, ni cha ton b

Bin son: Th.s Trn Duy Minh

Email: tdminh.cntt.dhtn@gmail.com

94

Modul: K thut mng c bn

danh mc ca cc my phc v khc. Sau WAIS thc hin tm kim ti my phc v thch hp nht. 5. Dch v World Wide Web World Wide Web (WWW hay Web) l mt dch v tch hp, s dng n gin v c hiu qu nht trn Internet. Web tch hp c FTP, WAIS, Gopher. Trnh duyt Web c th cho php truy nhp vo tt c cc dch v trn. - Ti liu WWW c vit bng ngn ng HTML (HyperText Markup Language) hay cn gi l ngn ng nh du siu vn bn. 6. Dch v th in t (E-Mail: POP3 110) Dch v th in t (hay cn gi l in th) l mt dch v thng dng nht trong mi h thng mng d ln hay nh. Th in t c s dng rng ri nh mt phng tin giao tip hng ngy trn mng nh tnh linh hot v ph bin ca n. T cc trao i th tn thng thng, thng tin qung co, tip th, n nhng cng vn, bo co, hay k c nhng bn hp ng thng mi, chng t, tt c u c trao i qua th in t. Mt h thng in th c chia lm hai phn, MUA (Mail User Agent) v MTA (Message Transfer Agent). MUA thc cht l mt chng trnh lm nhim v tng tc trc tip vi ngi dng cui, gip h nhn thng ip, son tho thng ip, lu cc thng ip v gi thng ip. Nhim v ca MTA l nh tuyn thng ip v x l cc thng ip n t h thng ca ngi dng sao cho n c ch. Dch v SMTP (Number port 25) Cc e-mail server thng tin vi nhau bng cch s dng SMTP truyn v nhn mail. Giao thc SMTP vn chuyn cc thng ip e-mail di dng ASCII bng TCP. Khi mt mail server nhn mt thng ip hng n mt client cc b ca n, n lu thng ip ny vo hp th v ch client ny n ly. C mt vi cch mail client ly th. Cc giao thc m client dng ph bin nht l POP3 v IMAP4.

Bin son: Th.s Trn Duy Minh

Email: tdminh.cntt.dhtn@gmail.com

95

Modul: K thut mng c bn

7. Dch v DNS (Number port 53) DNS (Domain Name System) l mt h c s d liu phn tn dng nh x gia cc tn min v cc a ch IP. DNS a ra mt phng php c bit duy tr v lin kt cc nh x ny trong mt th thng nht. M hnh phn cp tn min hiu r hn v hot ng ca DNS chng ta xt v d v tham kho hnh v di y:

Bin son: Th.s Trn Duy Minh

Email: tdminh.cntt.dhtn@gmail.com

96

Modul: K thut mng c bn

TI LIU THAM KHO [1] Cisco Certification Network Associate - Semester 1 (CCNA1) - Cisco press. [2] Nguyn Thc Hi, Mng my tnh v h thng m, NXB Gio dc, 1997. [3] Nguyn Gia Hiu, Mng my tnh, NXB Thng k, 1999.

Bin son: Th.s Trn Duy Minh

Email: tdminh.cntt.dhtn@gmail.com

97