Mô hình OSI - TCP.IP

  • View
    149

  • Download
    0

Embed Size (px)

DESCRIPTION

Mohinh OSI

Transcript

NI DUNG BI GING1. M hnh OSI Gii thiu m hnh OSI Chc nng ca mi tng trong m hnh OSI C ch x l gi tin trong m hnh OSI2. TCP/IP M hnh TCP/IP IP (IP private IP public Phn lp IP Subnet mask Chia Subnet Default Gateway Supernetting CIDR/VLSM) ARP RARP ICMP TCP UDP MTU RFCs

I. M hnh OSI7Application Tng ng dngData

6Presentation Tng trnh byData

5Session Tng phinData

4Transport Tng vn chuynSegment

3NetworkTng mngPacket

2Data LinkTng lin ktFrame

1PhysicalTng vt lBit

A- M hnh 7 lp OSI ( Open System Interconnection ) M hnh 7 lp OSI l m hnh tham chiu*M hnh tham chiu c ngha n khng phi l mt m hnh c th no. Cc nh thit k mng s da vo bit cng vic thit k ca mnh ang nm u tin cho vic thc hin v sa li. M hnh OSI c chia thnh 7 tng (lp) vi chc nng phn bit Hai tng ng mc khi lin kt vi nhau s s dng giao thc chung.Giao thc c kh nng nh tuyn & giao thc khng c kh nng nh tuyn Giao thc c khn nng nh tuyn: l giao thc cho php i qua cc thit b mng nh Router xy dng mng c quy m ln (v d: TCP/IP; SPX/IPX) Giao thc khng c kh nng nh tuyn: ngc lai, giao thc ny khng cho php qua cc thit b mng nh Router.(v d: NETBEUI)B- Nhim v ca cc tng trong m hnh OSI:1. Layer 7: Application Application l tng trn cng giao tip trc tip vi cc tin trnh ng dng (l tng gn vi ngi dng nht) N cung cp cc phng tin cho ngi dng truy nhp thng tin v d liu thng qua cc chng trnh ng dng. Tng ny l giao din chnh ngi dng tng tc vi cc chng trnh ng dng v qua giao tip vi mng N cn lm nhim v gi cc yu cu xung cho tng trnh by Presentation Cc ng dng: Telnet, FTP, HTTP, SMTP, POP3vv2. Layer 6: Presentation Tng chu trch nhim nh dng, m ha, nn & gii nn d liu ( ngha l nh dng d liu t lp 7 a xung ri gi i, m bo sao cho bn nhn c th hiu, c c d liu bn gi ) Mt s nh dng ca d liu lp 6: GIF, MP3vv V d: my tnh Linux c th giao tip vi my tnh Windowstng trnh by fai nh dng d liu sao cho ph hp vi h iu hnh Mt s giao thc s dng trong lp 6 Presentstion:AFP Appletalk Filing ProtocolLLP Lightweight Presentation Protocol 3. Layer 5: Session Chu trch nhim thit lp, duy tr v kt thc cc phin kt ni Tng ny cn h tr hot ng song cng (duplex), bn song cng (half-duplex), n cng (Single) v thit lp cc qui trnh nh du im hon thnh (checkpointing) nhm gip vic phc hi truyn thng nhanh hn khi c li xy ra, v im hon thnh c nh du. Ngoi ra c th tr hon (adjournment), kt thc (termination) v khi ng li (restart) phin. M hnh OSI u nhim cho tng ny trch nhim "ngt mch nh nhng" (graceful close) cc phin (mt tnh cht ca giao thc kim sot giao vn TCP) v trch nhim kim tra v phc hi phin, y l phn thng khng c dng n trong b giao thc TCP/IP Mt s giao thc s dng trong lp 5 session: ASP AppleTalk Session ProtocolZIP Zone Information ProtocolSSH Secure Shell4. Layer 4: Transport Tng vn chuyn xc nh a ch trn mng, cch thc chuyn giao gi tin trn c s trc tip 2 u mt. m bo truyn d liu tin cy gia hai ngi dng u cui (end to end) m bo truyn n nh v chnh xc. Phn on cc khi d liu thnh nhng gi nh (gi l Segment). nh s cc gi tin (segment) bn nhn c th ghp chnh xc, theo di cc gi tin v truyn li cc gi khi b tht bi, bo m chng chuyn theo ng thc t. Ti thit lp d liu ti my nhn Tng vn chuyn cn thc hin chc nng iu khin lung (thng qua cc address port phn bit, xc nh ng dng trao i) & iu khin li. Cc giao thc ph bin y : TCP, UDP, SPXi. Cc dch v kt ni tng vn chuyn Xp thc t cc phn on Kim sot li Kim sot lungii. K thut chuyn ti ti tng ny nh hng kt ni (Connection Oriented)- L kiu kt ni c th sa li v iu khin dngV d:H thng in thoi l kt ni c nh hng, v n i hi ngi u bn kia fai nhc my ln mi bt u truyn tin)- Giao thc c nh hng kt ni: ngha l trc khi truyn, hai tng ng mc thit lp mt lin kt logic v cc gi tin s c trao i thng qua lin kt ny. Vic c lin kt logic gip nng cao an ton trong truyn d liu.V d: TCP (trong b giao thc TCP/IP) SPX (trong b giao thc SPX/IPX)+ TCP (trong b giao thc TCP/IP) l mt giao thc c lin kt, ngha l cn thit lp mt lin kt logic gia cc cp thc th TCP trc khi chng trao i d liu vi nhau. TCP cung cp kh nng truyn d liu mt cch an ton gi cc my trm trong h thng cc mng. N cung cp thm cc chc nng nhm kim tra tnh chnh xc ca d liu khi n v bao gm c vic gi li d liu khi c li xy ra. TCP cung cp cc tnh nng chnh sau:+ Thit lp, duy tr v kt thc kt ni gia hai qu trnh+ Phn pht gi tin ng tin cy+ nh s th t (sequencing) cc gi d liu nhm truyn d liu tin cy+ Cho php iu khin li+ Cung cp kh nng a kt ni vi cc qu trnh khc nhau gia trm ngun & trm ch thng qua vic s dng cc cng+ Truyn d liu s dng c ch full-duplex

Phi kt ni (Connectionless)- L kiu kt ni n l, khng tham gia vo qu trnh sa li, iu khin liV d: Ta c th gi 1 l th cho 1 ngi m ngi ny khng bit, v ta cg khng bit th c gi n c pha ngi nhn hay khng- Giao thc phi kt ni: Trc khi truyn, d liu khng thit lp lin kt logic v mi gi tin c truyn c lp vi gi tin trc hoc sau n.c im ca n:+ Khng kim sot ng truyn+ D liu khng m bo n ni nhn+ D liu thng dng datagramsV d: UDP trong b giao thc TCP/IP

Bt tay ba bc (Three way handshake)- Trc khi gi hay nhn th cc my/ cc bn fai tha thun vi nhau vic kt ni nh th no. Kim sot dng (Flow control)- K thut kim tra cc gi tin b li, mt trn ng truyn. Xc thc ng truyn (Acknowledgement)- Khi my gi truyn thng tin cho my nhn, n s ch thng bo phn hi li t my nhn xem gi tin c ti hay khng ri mi gi tip

Tha thun trc khi truyn (Windowing)- K thut ny tng t nh Acknowledgment nhng c thm nhng ci tin (nh tha thun kch thc c th ca 1 gi tin trc khi gi)5. Layer 3: Network Tng ny chu trnh nhim p ng cc yu cu dch v ttng vn chuyn (Transport)v a ra nhng yu cu dch v i vitng lin kt d liu (Data Link). Tng c nhim v xc nh vic chuyn hng, vch ng i cc gi tin trong mng (chc nng nh tuyn) cc gi tin ny c th fai tri qua nhiu bc mi ti c ch cui cng. Lp 3 (Network Layer) s nh ra a ch logic cho cc thit b trn mng, quy nh cc nguyn tc s dng cho IP logic ny. Tng mng cung cp cc chc nng v qui trnh cho vic truyn cc chui d liu c di a dng, t mt ngun ti mt ch, thng qua mt hoc nhiu mng, trong khi vn duy tr cht lng dch v (quality of service) m tng vn chuyn (Transport) yu cu. Cc thit b nh tuyn (router) hot ng ti tng ny gi d liu ra khp mng m rng, lm cho lin mng tr nn kh thi (cn c thit b chuyn mch switch layer 3 cn gi l chuyn mch IP). Mt s giao thc thng hay s dng trong lp 3 Network : IP, IPX, vv Layer-3 S dng bn qu trnh c bn: Addressing nh a ch Encapsulation ng gi bn tin Routing nh tuyn Decapsulation Gii ng gi tin Ch : Layer-3: Network --- IP, IPv4 chi tit phn sau6. Layer 2: Data Link Frame d liu ca tng Layer 3: Data Link

HeaderPacket (Data)Trainler

Frame StartAddressingTypeQuality ControlDataError DetectionFrame Stop

Header+ M t bt u v kt thc mt Frame+ ng b nh thi gia bn gi v bn nhn+ M t a ch (ngun/ch) Traniler+ C trng FCS iu khin li Tng c nhim v h tr tng trn, iu khin truy cp & c ch pht hin li (v thng tin iu khin lun thay i khi i qua cc mi trng khc nhau) Ngoi ra tng cn c nhim v xc nh, nh a ch vt l (hay cn gi l a ch MAC). Thng cc a ch MAC ny c m ha cng vo trong cc th mng network card khi chng c sn xut. a ra cc phng thc iu khin truy cp mi trng nh: + C ch sa li v iu khin lung; + Cc dng thc chung ca gi tin, ng gi v phn pht gi tinvv Theo tiu chun IEEE 802.2 tng lin kt d liu (Data Link) c chia ra thnh 2 tng con: (Hay ni cch khc MAC & LLC cu thnh ln phin bn IEEE ca tng 2 Lin kt d liu)

+ Tng LLC (Logical Link Control - iu khin Lin kt logic)+ Tng MAC (Media Access Control - iu khin Truy nhp ng truyn) Tng con LLC (Logical Link Control iu khin lin kt lgic) LLC l tng con pha trn catng lin kt d liu (Data Link)ca m hnh OSI.Tng con LLCtrng vi nhiu mi trng truyn vt l khc nhau (chng hn Ethernet, token ring, WLAN). Nhim v: ng frame d liu Nhn bit giao thc lp mng Tng con LLC ch yu quan tm n:- Ghp knh (multiplexing) cc giao thc c truyn qua tng MAC (khi truyn) v phn knh (demultiplexing) chng (khi nhn).- Theo yu cu, cung cp chc nng iu khin lu lng v pht hin cc gi tin b b (drop) v truyn li nu c yu cu.- Giao thc dng trong cc mng IEEE 802 v trong mt s mng khng theo chun IEEE 802 chng hn nh FDDI.- Mt s giao thc khng thuc chun IEEE 802 cng c th c coi l c chia thnh cc tng con MAC v LLC. V d, HDLC c t cc chc nng ca c MAC (phn khung (framing) cho cc gi tin) v LLC (ghp knh giao thc, iu khin lu lng, pht hin v truyn li cc gi tin b b), mt s giao thc chng hn nh Cisco HDLC c th s dng kiu phn khung kiu HDLC (HDLC-like packet framing) v giao thc LLC ca ring ca mnh. Tng con MAC trong tng lin kt d liu L tng con giao thc truyn d liu mtphncatng lin kt d liu (Data Link)trong m hnh 7 tng OSI. N cung cp cc c ch nh a ch v iu khin truy nhp knh (channel access), cc c ch ny cho php cc trm cui (terminal) hoc cc nt mng lin lc vi nhau trong mt mng, in hnh l mng LAN hoc MAN. Giao thc MAC khng cn thit trong lin lc im-ti-im song cng (full-duplex). Tng con MAC hot ng vi vai tr mt giao din gia tng con iu khin lin kt logic LLC v tng vt l (Physical)ca mng. Tng MAC cung cp mt c ch nh a ch c gi l a ch vt l. MAC Media access control thng c dng nh l mt t ng ngha vi giao thc a truy nhp (multiple access protocol), do tng con MAC cung cp giao thc v cc c ch iu khin cn thit cho mt phng php truy nhp knh nht nh (channel access method). Vic ny cho php nhiu trm kt ni ti cng mt mi trng vt l dng chung mi trng .+ V d v cc mi trng vt l dng chung l bus network, ring network, hub network, mng khng dy v cc lin kt im-ti-im bn song cng (half-duplex). Cc v d v cc phng thc a truy nhp kiu gi tin (packet mode) dnh cho cc mng ni dy a chng (multi-drop):- CSMA/CD (dng trong Ethernet v IEEE 802.3),- Token ring (IEEE 802.4)- Token passing (dng trong FDDI). Cc v d v cc phng thc a truy nhp c th c s dng trong cc mng khng dy dng sng radio gi d liu theo gi tin:- CSMA/CA- Slotted ALOHA- Dynamic TDMA- Reservation ALOHA (R-ALOHA).- CDMA- OFDMA a ch MAC

I/G: Individual/GroupU/L: Universal/Local Cc a ch MAC c chiu di 6bytes(48bit), thng bao gm 3 loi: + Unicast: Bit I/G l bit c trng s ln nht trong octet c trng s ln nht c gn bng 0. + Broadcast: L mt a ch tng trng cho tt c cc thit b trong mng LAN segment mt thI im. a ch ny c dng 0xFFFF