Está en la página 1de 98

I HC QUC GIA H NI TRNG I HC CNG NGH

o Ngc Anh

NGHIN CU GIAO THC TRONG MNG VOIP

KHO LUN TT NGHIP I HC H CHNH QUY

Ngnh: in t - Vin thng

H NI - 2008

I HC QUC GIA H NI TRNG I HC CNG NGH

o Ngc Anh

NGHIN CU GIAO THC TRONG MNG VOIP

KHO LUN TT NGHIP I HC H CHNH QUY

Ngnh: in t - Vin thng Cn b hng dn: Th.S Nguyn Quc Tun

H NI - 2008

LI CM N Trc ht em xin gi ti thy gio Nguyn Quc Tun nguyn Ch nhim B mn H thng Vin thng , li cm n chn thnh v su sc trc tip hng dn , ch bo tn tnh trong sut qu trnh em lm lun vn. Em cng xin chn thnh cm n cc thy c gio trong Trng i hc Cng Ngh - i hc Quc Gia H Ni ht lng dy bo, gip em trong nhng nm hc i Hc, gip em c nhng kin thc v kinh nghim qu bu trong chuyn mn v cuc sng. Nhng hnh trang l mt ti sn v gi nng bc cho em ti c vi nhng thnh cng trong tng lai. Cui cng, em xin cm n nhng ngi thn trong gia nh v bn b gip , ng vin em hon thnh lun vn ny. H ni, thng 05 nm 2008 Sinh vin

TM TT NI DUNG Vi s pht trin nhy vt ca mng chuyn mch gi IP hin nay khng ch em li cho chng ta nhng dch v mi a dng m cn l c hi ci thin cc dch v vin thng trc kia vi cht lng tt hn v gi thnh r hn. t lu, mng chuyn mch knh ghp phn knh theo thi gian PSTN c mt vai tr v cng quan trng vi s pht trin ca x hi. Bn cnh nhng u im v cht lng dch v tt, vng dch v rng ln trn khp mi lnh th, th mng PSTN cng bc l nhiu hn ch nh s lng cc dch v hn ch, s dng ti nguyn ng truyn khng ti u, gi thnh cao. Trn c s , mng VoIP ra i v ngy cng p ng tt hn cc yu cu t ra nh cht lng dch v, gi thnh, s lng tch hp cc dch v thoi ln phi thoi. Cng nh cc cng ngh ra i trong thi gian gn y, th vn Giao thc l c bit quan trng. Vic nm chc Giao thc l cha kha thnh cng ca vic trin khai mi mt cng ngh mi vo thc t. Chnh v vy, trong ni dung ca bi Lun vn tt nghip ny, em xin c gii thiu v Giao thc s dng trong mng VoIP. Bi lun vn s gm cc ni dung chnh nh sau: Chng 1: Tng quan v mng VoIP. Chng 2: Cc giao thc truyn ti trong VoIP. Chng 3: Giao thc bo hiu VoIP. Mt vn c bit quan trong khi mi cng ngh, mt giao thc mi c sinh ra l vn tng thch vi cc cng ngh v giao thc trc . cng l mt trong nguyn nhn quyt nh s sng cn ca mng VoIP c cp ti ti: Chng 4: Kt ni mng VoIP v PSTN. V phn cui cng trong bi Lun vn tt nghip: Chng 5: Kho st giao thc cuc gi VoIP SIP PSTN trn thc t. y l mt minh chng r nt v vic trin khai cc giao thc VoIP nghin cu trong ton b ni dung bi Lun vn tt nghip vo bi ton vin thng thc t.

MC LC Chng 1. Tng quan v mng VoIP...........................................................................2 1.1. Tng quan v mng VoIP...................................................................................2 1.2. c tnh ca mng VoIP.....................................................................................4 1.2.1. u im.......................................................................................................4 1.2.2. Nhc im..................................................................................................5 1.3. Yu cu cht lng i vi VoIP........................................................................6 Chng 2. Cc giao thc truyn ti trong VoIP............................................................8 2.1. Giao thc IP........................................................................................................8 2.1.1. Giao thc IP phin bn 4 (IPv4)...................................................................8 2.1.2. Giao thc IP phin bn 6 (IPv6).................................................................12 2.2. Giao thc TCP/IP..............................................................................................13 2.3. Giao thc UDP..................................................................................................19 2.4. Giao thc SCTP................................................................................................19 2.5. Giao thc RTP..................................................................................................24 2.6. Giao thc RTCP................................................................................................30 Chng 3. Giao thc bo hiu VoIP...........................................................................33 3.1. Giao thc bo hiu H.323.................................................................................33 3.1.1. Cc thnh phn trong mng........................................................................33 3.1.2. Giao thc H.323.........................................................................................37 3.1.3. Thit lp cuc gi VoIP s dng giao thc H.323.....................................42 3.2. Giao thc SIP....................................................................................................46 3.2.1. Cc thnh phn trong mng SIP.................................................................47 3.2.2. Bn tin SIP.................................................................................................50 3.2.3. M t cuc gi SIP....................................................................................54 3.3. So snh gia giao thc H.323 v SIP................................................................56

Chng 4. Kt ni gia mng VoIP v PSTN ...........................................................58 4.1. Mng bo hiu SS7...........................................................................................58 4.1.1. Cc thnh phn trong mng bo hiu SS7..................................................58 4.1.2. Lin kt trong mng SS7............................................................................59 4.1.3. nh tuyn trong mng SS7.......................................................................60 4.1.4. Giao thc trong mng SS7.........................................................................62 4.1.5. Cc bc thit lp cuc gi trong mng SS7..............................................67 4.2. Giao thc Sigtran..............................................................................................68 4.2.1. M2UA/ M2PA............................................................................................69 4.2.2. M3UA........................................................................................................70 4.2.3. SUA...........................................................................................................71 4.2.4. Kt ni mng VoIP vi mng PSTN .........................................................71 Chng 5. Kho st giao thc cuc gi VoIP SIP PSTN trn thc t......................76 5.1. Gii thiu kin trc mng VoIP c nghin cu.............................................76 5.2. Gii thiu chng trnh Wireshark....................................................................77 5.3. Kho st giao thc cuc gi VoIP SIP PSTN trn thc t..............................78

DANH MC CC T VIT TT K hiu vit tt VoIP PSTN PCM Vit y Voice over IP Public Switch Telephone Network Pulse-Code Modulation Simple Network Management Protocol Session Initiation Protocol Real Time Protocol Real Time Control Protocol Asynchronous Transfer Mode Quality of Service Type of Service Internet Protocol IP version 4 IP version 6 Transmission Control Protocol User Datagram Protocol ngha Cng ngh truyn thoi trn mng IP Mng in thoi cng cng B m ha m xung

SNMP SIP RTP RTCP

Giao thc qun tr mng n gin Giao thc thit lp phin Giap thc thi gian thc Giap thc iu khin thi gian thc

ATM QoS ToS IP IPv4 IPv6 TCP UDP

Ch truyn khng ng b Cht lng dch v Kiu dch v Giao thc Internet Giao thc Internet phin bn 4 Giao thc Internet phin bn 6 Giao thc iu khin truyn thng tin Giao thc Datagram ngi dng

SCTP

Stream Control Giao thc truyn iu khin lung Transmission Protocol International Telecommunication Hip hi vin thng quc t Union- B phn chun vin thng Telecommunication Standardization Sector Register Admission Status Session Announcement Protocol Session Description Protocol Signaling System No.7 Switch Service Point Signal Control Point Signal Tranfer Point Message Tranfer Part Transaction Capabilities Application Part Telephone User Part ISDN User Part Integrated Services Digital Network Signaling Connection Control Part Bo hiu ng k, cp php, thng tin trng thi

ITU-T

RAS

SAP

Giao thc thng bo phin

SDP SS7 SSP SCP STP MTP

Giao thc m t phin H thng bo hiu s 7 im dch v chuyn mch im iu khin bo hiu im truyn bo hiu Phn truyn bn tin

TCAP TUP ISUP ISDN

Phn ng dng cung cp giao dch Phn ngi dng in thoi Phn ngi dng ISDN Mng tch hp dch v s

SCCP

Phn iu khin kt ni bo hiu

M2UA M2PA M3UA IUA SUA

MTP2 User Adapter MTP L2 Peer-to-Peer Adapter MTP3 User Adapter ISDN User Adapter SCCP User Adapter

B chuyn i ngi dng MTP2 B chuyn i bn tin lp 2 ngang hng B chuyn i ngi dng MTP3 B chuyn i ngi dng ISDN B chuyn i ngi dng SCCP

M U Mng VoIP ra i nh l mt cuc cc mng ca h thng vin thng v x hi. Vi nhng u im vt tri, mng VoIP chng t c sc sng v tnh thc tin cao ca n. S pht trin qu nhanh ca mng VoIP cng t ra mt vn nan gii l vic chun ha gia cc giao thc VoIP ca nhiu nh pht trin khc nhau. M trong c hai giao thc c nhc ti nhiu nht l H.323 ca ITU-T v SIP ca IETF. Nh mt tt yu khch quan, mng VoIP s c chia thnh nhiu min giao thc khc nhau. Nn vn quan trng c th trin khai c mng VoIP vo thc t l phi hiu c bn cht ca cc giao thc VoIP v quan trng nht l cc giao thc bo hiu s dng trong VoIP. Tuy vyh mi l iu kin cn cho s ra i cn vn then cht cho s tn ti v pht trin ca mng VoIP li l vn kt ni vi h thng vin thng vn c. V c th l vn kt ni gia mng VoIP v mng PSTN. V y cng l hai ni dung chnh ca bi Lun vn tt nghip ny. Trn c s nhn thc r s quan trng cng nh cch thc hot ng ca giao thc trong mng VoIP, th phng php nghin cu ca em trong ni dung Lun vn ch yu i su nghin cu thng qua ti liu quy chun v Giao thc VoIP (RFC ca IETF, cc ti liu chun ca ITU-T); ng thi tham chiu n cc ti liu chuyn mn su v VoIP lm r cc vn cn gii quyt. T nhng hiu bit nghin cu l thuyt kh su v chuyn mn, em s tham chiu vi m hnh thc t. T lm r cc vn vng mc m khi nghin cu l thuyt cha th gii quyt v lm r c.

Chng 1. Tng quan v mng VoIP 1.1. Tng quan v mng VoIP u nm 1995 cng ty VOCALTEC a ra th trng sn phm phn mm thc hin cuc thoi qua Internet u tin trn th gii. Sau c nhiu cng ty tham gia vo lnh vc ny. Thng 3 nm 1996, VOLCALTEC kt hp vi DIALOGIC tung ra th trng sn phm kt ni mng PSTN v Internet. Hip hi cc nh sn xut thoi qua mng my tnh sm ra i v thc hin chun ho dch v thoi qua mng Internet. Vic truyn thoi qua internet gy c ch ln trong nhng nm qua v dn c ng dng rng ri trong thc t. C th nh ngha: Voice over Internet Protocol (VoIP) l mt cng ngh cho php truyn thoi s dng giao thc mng IP, trn c s h tng sn c ca mng Internet. VoIP l mt trong nhng cng ngh vin thng ang c quan tm nht hin nay khng ch i vi cc nh khai thc, cc nh sn xut m cn c vi ngi s dng dch v. VoIP c th va thc hin cuc gi thoi nh trn mng in thoi knh truyn thng (PSTN) ng thi truyn d liu trn c s mng truyn d liu. Nh vy, n tn dng c sc mnh v s pht trin vt bc ca mng IP vn ch c s dng truyn d liu thng thng. c th hiu c nhng u im ca VoIP mang li, trc ht chng ta i vo nghin cu s khc bit gia mng knh PSTN hin c vi mng chuyn mch gi ni chung v mng VoIP ni ring. K thut chuyn mch knh (Circuit Switching): Mt c trng ni bt ca k thut ny l hai trm mun trao i thng tin vi nhau th gia chng s c thit lp mt knh (circuit) c nh, knh kt ni ny c duy tr v dnh ring cho hai trm cho ti khi cuc truyn tin kt thc. Thng tin cuc gi l trong sut. Qu trnh thit lp cuc gi tin hnh gm 3 giai on:

Giai on thit lp kt ni: Thc cht qu trnh ny l lin kt cc tuyn gia cc trm trn mng thnh mt tuyn (knh) duy nht dnh ring cho cuc gi. Knh ny i vi PSTN l 64kb/s (do b m ha PCM c tc ly mu ting ni 8kb/s v c m ha 8 bit). Giai on truyn tin: Thng tin cuc gi l trong sut. S trong sut th hin qua hai yu t: thng tin khng b thay i khi truyn qua mng v tr nh.

Giai on gii phng (hu b) kt ni: Sau khi cuc gi kt thc, knh s c gii phng phc v cho cc cuc gi khc.

Qua , ta nhn thy mng chuyn mch knh c nhng u im ni bt nh cht lng ng truyn tt, n nh, c tr nh. Cc thit b mng ca chuyn mch knh n gin, c tnh n nh cao, chng nhiu tt. Nhng ta cng khng th khng nhc ti nhng hn ch ca phng thc truyn d liu ny nh: S dng bng thng khng hiu qu: Tnh khng hiu qu ny th hin qua hai yu t. Th nht, rng bng thng c nh 64k/s. Th hai l knh l dnh ring cho mt cuc gi nht nh. Nh vy, ngay c khi tn hiu thoi l lng (khng c d liu) th knh vn khng c chia s cho cuc gi khc.

Tnh an ton: Do tn hiu thoi c gi nguyn bn trn ng truyn nn rt d b nghe trm. Ngoi ra, ng dy thu bao hon ton c th b li dng an trm cc vin thng.

Kh nng m rng ca mng knh km: Th nht l do c s h tng kh nng cp v tng thch vi cc thit b c. Th hai, l hn ch ca h thng bo hiu vn c s dng t trc khng c kh nng ty bin cao. K thut chuyn mch gi (Packet Switching): Trong chuyn mch gi mi bn tin c chia thnh cc gi tin (packet), c khun dng c quy nh trc. Trong mi gi cng c cha thng tin iu khin: a ch trm ngun, a ch trm ch v s th t ca gi tin, Cc thng tin iu khin c ti thiu, cha cc thng tin m mng yu cu c th nh tuyn c cho cc gi tin qua mng v a n ti ch. Ti mi node trn tuyn gi tin c nhn, nh v sau th chuyn tip cho ti chm ch. V k thut chuyn mch gi trong qu trnh truyn tin c th c nh tuyn ng truyn tin. iu kh khn nht i vi chuyn mch gi l vic tp hp cc gi tin to bn tin bn u c bit l khi m cc gi tin c truyn theo nhiu con ng khc nhau ti trm ch. Chnh v l do trn m cc gi tin cn phi c nh du s th t, iu ny c tc dng, chng lp, sa sai v c th truyn li khi hin tng mt gi xy ra. Cc u im ca chuyn mch gi:

Mm do v hiu sut truyn tin cao: Hiu sut s dng ng truyn rt cao v trong chuyn mch gi khng c khi nim knh c nh v dnh ring, mi ng truyn gia cc node c th c cc trm cng chia s cho truyn tin, cc gi tin sp hng v truyn theo tc rt nhanh trn ng truyn. 3

Kh nng tryn u tin: Chuyn mch gi cn c th sp th t cho cc gi c th truyn i theo mc u tin. Trong chuyn mch gi s cuc gi b t chi t hn nhng phi chp nhn mt nhc im vi thi gian tr s tng ln.

Kh nng cung cp nhiu dch v thoi v phi thoi. Thch nghi tt nu nh c li xy ra: c tnh ny c c l nh kh nng nh tuyn ng ca mng. Bn cnh nhng u im th mng chuyn mch gi cng b l nhng nhc im nh: Tr ng truyn ln: Do i qua mi trm, d liu c lu tr, x l trc khi c truyn i. tin cy ca mng gi khng cao, d xy ra tc nghn, li mt bn tin Tnh a ng c th gy l lp bn tin, loop lm tng lu lng mng khng cn thit. Tnh bo mt trn ng truyn chung l khng cao. 1.2. c tnh ca mng VoIP 1.2.1. u im

Gim chi ph: y l u im ni bt ca VoIP so vi in thoi ng di thng thng. Chi ph cuc gi ng di ch bng chi ph cho truy nhp Internet. Mt gi cc chung s thc hin c vi mng Internet v do tit kim ng k cc dch v thoi v fax. S chia s chi ph thit b v thao tc gia nhng ngi s dng thoi v d liu cng tng cng hiu qu s dng mng. ng thi k thut nn thoi tin tin lm gim tc bit t 64Kbps xung di 8Kbps, tc l mt knh 64Kbps lc ny c th phc v ng thi 8 knh thoi c lp. Nh vy, l d ln nht gip cho chi ph thc hin cuc gi VoIP thp chnh l vic s dng ti u bng thng. Tch hp dch v nhiu dch v: Do vic thit k c s h tng tch hp nn c kh nng h tr tt c cc hnh thc thng tin cho php chun ho tt hn v gim thiu s thit b. Cc tn hiu bo hiu, thoi v c s liu u chia s cng

mng IP. Tch hp a dch v s tit kim chi ph u t nhn lc, chi ph xy dng cc mng ring r.

Thng nht: V con ngi l nhn t quan trng nhng cng d sai lm nht trong mt mng vin thng, mi c hi hp nht cc thao tc, loi b cc im sai st v thng nht cc im thanh ton s rt c ch. Trong cc t chc kinh doanh, s qun l trn c s SNMP (Simple Network Management Protocol) c th c cung cp cho c dch v thoi v d liu s dng VoIP. Vic s dng thng nht giao thc IP cho tt c cc ng dng ha hn gim bt phc tp v tng cng tnh mm do. Cc ng dng lin quan nh dch v danh b v dch v an ninh mng c th c chia s d dng hn. Vn qun l bng thng: Trong PSTN, bng thng cung cp cho mt cuc gi l c nh. Trong VoIP, bng thng c cung cp mt cch linh hot v mm do hn nhiu. Cht lng ca VOIP ph thuc vo nhiu yu t, quan trng nht l bng thng. Do khng c s bt buc no v mt thng lng gia cc thit b u cui m ch c cc chun tu vo bng thng c th ca mnh, bn thn cc u cui c th t iu chnh h s nn v do iu chnh c cht lng cuc gi. Nng cao ng dng v kh nng m rng: Thoi v fax ch l cc ng dng khi u cho VoIP, cc li ch trong thi gian di hn c mong i t cc ng dng a phng tin (multimedia) v a dch v. Tnh linh hot ca mng IP cho php to ra nhiu tinh nng mi trong dch v thoi. ng thi tnh mm do cn to kh nng m rng mng v cc dch v. Tnh bo mt cao: VOIP c xy dng trn nn tng Internet vn khng an ton, do s dn n kh nng cc thng tin c th b nh cp khi cc gi tin b thu lm hoc nh tuyn sai a ch mt cch c khi chng truyn trn mng. Cc giao thc SIP (Session Ineitiation Protocol giao thc khi u phin) c th thnh mt m v xc nhn cc thng ip bo hiu u cui. RTP (Real Time Protocol) h tr m thnh mt m ca phng thc truyn thng trn ton tuyn c m ho thnh mt m m bo truyn thng an ton.

1.2.2. Nhc im

Cht lng dch v cha cao: Cc mng s liu vn d khng phi xy dng vi mc ch truyn thoi thi gian thc, v vy khi truyn thoi qua mng s liu cho cht lng cuc gi khng c m bo trong trng hp mng xy 5

ra tc nghn hoc c tr ln. Tnh thi gian thc ca tn hiu thoi i hi cht lng truyn d liu cao v n nh. Mt yu t lm gim cht lng thoi na l k thut nn tit kim ng truyn. Nu nn xung dung lng cng thp th k thut nn cng phc tp, cho cht lng khng cao v c bit l thi gian x l s lu, gy tr.

Vn ting vng: Nu nh trong mng thoi, tr thp nn ting vng khng nh hng nhiu th trong mng IP, do tr ln nn ting vng nh hng nhiu n cht lng thoi. K thut phc tp: Truyn tn hiu theo thi gian thc trn mng chuyn mch gi l rt kh thc hin do mt gi trong mng l khng th trnh c v tr khng c nh ca cc gi thng tin khi truyn trn mng. c c mt dch v thoi chp nhn c, cn thit phi c mt k thut nn tn hiu t c nhng yu cu kht khe: t s nn ln ( gim c tc bit xung), c kh nng suy on v to li thng tin ca cc gi b tht lc... Tc x l ca cc b Codec (Coder and Decoder) phi nhanh khng lm cuc m thoi b gin on. ng thi c s h tng ca mng cng cn c nng cp ln cc cng ngh mi nh Frame Relay, ATM,... c tc cao hn hoc phi c mt c ch thc hin chc nng QoS (Quality of Service). Tt c cc iu ny lm cho k thut thc hin in thoi IP tr nn phc tp v khng th thc hin c trong nhng nm trc y

Ngoi ra c th k n tnh phc tp ca k thut v vn bo mt thng tin (do Internet ni ring v mng IP ni chung vn c tnh rng khp v hn hp, khng c g bo m rng thng tin c nhn c gi b mt). 1.3. Yu cu cht lng i vi VoIP T nhng nhc im chnh ca mng chuyn mch gi t ra nhng yu cu cho VoIP nh sau:

Cht lng thoi phi n nh, tr chp nhn c. Mng IP c bn phi p ng c nhng tiu ch hot ng kht khe gm gim thiu vic khng chp nhn cuc gi, mt mt gi v mt lin lc. iu ny i hi ngay c trong trng hp mng b nghn hoc khi nhiu ngi s dng chung ti nguyn ca mng cng mt lc. 6

Vic bo hiu c th tng tc c vi bo hiu ca mng PSTN.

Qun l h thng an ton, a ch ho v thanh ton phi c cung cp, tt nht l c hp nht vi cc h thng h tr hot ng PSTN.

Chng 2. Cc giao thc truyn ti trong VoIP 2.1. Giao thc IP Giao thc mng IP c thit k lin kt cc mng my tnh s dng phng php truyn thng v nhn d liu di dng gi. Giao thc IP cho php truyn cc gi d liu t im ngun ti im ch c a ch c nh. n v d liu c trao i l cc gi d liu. Cc chc nng c thc hin IP l: nh a ch: tt c cc host trong mng v trong lin mng u c cung cp mt a ch IP duy nht. Theo giao thc IP version 4, mi a ch IP gm 32bit v c chia lm 5 lp A,B,C,D,E. Cc lp A,B,C c s dng nh danh cc host trn cc mng. Lp c s dng cho qu trnh truyn a im cn lp E d phng. nh tuyn: gip xc nh ng i (tuyn)cho gi tin khi c truyn trn mng. N gip la chn ng i ti u cho cc gi d liu. Nu hai host cn lin lc khng nm trn mt subnet th bng nh tuyn s c s dng quyt nh vic chuyn d liu v cc b nh tuyn thng xuyn trao i v cp nht thng tin trong bng nh tuyn ty thuc vo phng php nh tuyn c s dng. Truyn a im: Hin nay c ba cch truyn cc gi IP l: o Truyn mt im ch (unicast): cc gi tin c truyn t host ngun n host ch duy nht. o Truyn qung b: gi tin c truyn n tt c cc host trong mng. o Truyn a im: gi tin c gi n mt s cc host nht nh trong mng Ngoi ra, giao thc IP cn cung cp kh nng phn mnh d liu ln thnh cc gi c kch thc nh hn truyn qua mng. 2.1.1. Giao thc IP phin bn 4 (IPv4) Cu trc ca header IPv4 nh sau:

Hnh 1. ngha cc trng nh sau:

Cu trc gi IP phin bn 4

Version: rng 4 bit m t phin bn IP IP Header Length(IHL): c rng 4 bit, xc nh rng ca phn tiu ca gi tin IP Type of Service: c rng 8 bit, xc nh cc tham s ch dch v s dng khi truyn gi tin qua mng. Rt nhiu mng cung cp cc dch v v u tin lu thng, c bit khi mng b qu ti. Vic la chn ny m bo ng truyn t ba tiu chun l thi gian tr, tin cy, b thng sut ca gi tin. c m t c th nh sau: o Quyn u tin (3 bit) o tr D (1 bit) D=0: tr bnh thng D=1: tr cao o Thng lng T (1bit) T=0: thng lng bnh thng T=1: thng lng cao o tin cy (1bit): R=0: tin cy bnh thng R=1: tin cy cao 9

Total Length (16bit): xc nh di ca gi tin k c phn tiu . C gi tr ti a l 65535 byte. Thng thng cc host ch c th x l gi tin c di l 576 byte gm 512 byte d liu v 64 byte tiu . Cc host ch c th gi cc gi tin c di ln hn 576 byte khi bit trc l host ch c kh nng x l gi ny. Indentification: cng vi trng a ch ngun, ch dng nh danh duy nht cho mt gi tin trong khong thi gian n tn ti. Flag : c rng 3 bit, ch phn on ca gi tin o Bit 0: lun bng 0 o Bit 1 (DF): DF=0: c phn on DF=1: khng phn on o Bit 2 (MF): MF=0: mnh cui cng MF=1: khng phi mnh cui cng Fragment Offset: rng 13 bit, ch r v tr ca phn mnh trong gi tin tnh theo n v 64bit. Time to Live: rng 8 bit, quy nh thi gian tn ti ca gi tin. Protocol: rng 8 bit, xc nh giao thc tng giao vn. V d o Protocol = 6: giao thc TCP o Protocol=17: giao thc UDP Header Checksum: rng 16 bit, m kim tra CRC-16 ca phn tiu cho pht hinli Source Address: rng 32 bit, xc nh a ch ngun. Destination Address: rng 32 bit, xc nh a ch ch 10

Option: c di thay i lu thng tin ty bin ca ngi dng Padding: c di thay i, m bo di ca header lun l bi 32 bit Data: c di ti a l 65535 byte cha d liu lp cao hn. nh a ch trong IPv4 H thng a ch ny c thit k mm do qua mt s phn lp, c 5 lp a ch IP l: A, B, C, D, E. S khc nhau c bn gia cc lp a ch ny l kh nng t chc cc cu trc con ca n. Lp Nhn dng a ch u A B 0xxx 10xx 0.0.0.0 128.0.0.0 a ch cui 127.255.255.25 5 191.255.255.25 5 223.255.255.25 5 239.255.255.25 5 255.255.255.25 5 Mt n mng 255.0.0.0 255.255.0.0

C D

110x 1110

192.0.0.0 224.0.0.0

255.255.255.0

1111

240.0.0.0

a ch lp A: Lp A s dng byte u tin ca 4 byte nh a ch mng. Nh hnh trn, n c nhn ra bi bit u tin trong byte u tin ca a ch c tr gi 0. Ba byte cn li c s dng nh a ch my trong mng. C 126 a ch lp A vi s my tnh trong mng l 2563 2 = 16.777.214 my cho mi a ch lp A. a ch lp A thng c cp cho nhng t chc c s lng my tnh ln. Nguyn nhn ch c 126 network trong khi dng 8 bit v bit u tin mang gi tr 0 dng nh ngha lp A. Do vy cn li 7 bit nh t 0 127, tuy nhin ngi ta khng s dng mt a ch cha ton cc con s 1 hoc 0 nn ch cn li 126 mng lp A c s dng. Gi tr byte u tin ca lp A s lun nm trong khong t 1 ti 126, mi mt byte trong 3 byte cn li s c gi tr trong khong 1 n 254.

11

a ch lp B: Mt a ch lp B c nhn ra bi 2 bit u tin ca byte th nht mang gi tr 10. Lp B s dng 2 byte u tin ca 4 byte nh a ch mng v 2 byte cui nh a ch my trong mng. C 64*256 2 = 16.128 a ch mng lp B vi 65.534 my cho mi a ch lp B. a ch lp C: Mt s t chc c quy m nh c th xin cp pht a ch lp C. Mt a ch lp C c nhn ra vi 3 bit u mng gi tr 110. Mng lp C s dng 3 byte u nh a ch mng v 1 byte cui nh a ch my trong mng. C 2.097.150 a ch lp C, mi a ch lp C c 254 my. T cc lp mng c bn trn, ta c th thc hin chia subnet cho mng to thnh cc mng con (subnet) ty theo yu cu c th. Phn dng nh mng con c ly nh subnet c ly t phn dnh nh a ch host.

Hnh 2.

Quy cc a ch IP khi chia subnet

Khi , xc nh a ch mng ca trm, ta cn phi bit mt n mng tng ng vi IP c chia. Vic tnh ton ra a ch mng ca IP c tnh nh sau: Dng thp phn a ch IP ca trm 192.168.5.130 Mt n mng a ch mng 255.255.255.192 192.168.5.128 Dng nh phn 11000000.10101000.00000101.10000010 11111111.11111111.11111111.11000000 11000000.10101000.00000101.10000000

2.1.2. Giao thc IP phin bn 6 (IPv6) Trong IPv4 trng a ch ngun v ch c di 32 bit nn khng th p ng nhu cu nh a ch ca mng. Ngoi ra, do s pht trin ca Internet, bng nh tuyn ca router khng ngng ln ln v kh nng nh tuyn bc l hn ch. Yu cu nng cao cht lng dch v v bo mt c t ra. IPv6 l giao thc Internet mi c k tha c im chnh ca IPv4 v c nhiu ci tin khc phc nhng hn ch: Tng kch thc a ch t 32 bit ln 128 bit 12

Phm vi nh tuyn a im: giao thc ny h tr phng thc truyn mi anycasting. Phng thc ny s dng gi cc gi tin n mt nhm xc nh. Phn tiu ca IPv6 c n gin ha hn IPv4. iu cho php x l gi tin nhanh hn. Ngoi ra, IPv6 cn cung cp mt s tiu ph cho php giao thc IPv6 c th s dng mt cch mm do hn hn so vi IPv4. Cu trc gi tin IPv6 nh sau:

Hnh 3. ngha cc trng nh sau:

Cu trc gi tin IP phin bn 6

Version: c gi tr bng 6 vi IPv6 Traffic Class: di 8 bit, xc nh u tin Flow Label: di 20bit, xc nh cc gi d liu c u tin trn ng truyn nu c xy ra tranh chp, thng c s dng cho cc dch v i hi cht lng dch v cao hay thi gian thc. Payload Length: di 16 bit, xc nh di phn d liu khng tnh phn tiu . Hop Limit: di 8 bit, ging nh trng Time to Live ca IPv4 Source Address v Destination Address ging nh IPv4 nhng c di 128bit. Data: c di ti a l 65535 byte. 2.2. Giao thc TCP/IP Giao thc TCP l giao thc iu khin truyn thng hng kt ni v c tin cy cao. TCP cung cp l giao thc c xy dng phc tp hn UDP rt nhiu, ngoi cc dch v nh UDP, TCP cn cung cp cc dch v khc cho ng dng. Dch v 13

quan trng nht l truyn d liu c tin cy cao, cc c ch iu khin lu lng v kim sot tc nghn, nh s th t v s th t bn nhn, b nh thi,....C th TCP cung cp cc dch v sau:

Thit lp lin kt: TCP l giao thc hng kt ni, trc khi gi d liu cn thit lp trc ng truyn (chnh l 1 lin kt lgic gia hai thc th TCP), th tc ny gi l th tc bt tay. Lin kt c thit lp phi m bo tnh chnh xc v tin cy, mt lin kt khi khng cn tin cy th s b hu b v thit lp li. Khi qu trnh truyn tin hon thnh th kt ni c gii phng . Cung cp ng truyn hai chiu (song cng - full duplex). m bo tin cy: Giao thc TCP cung cp cc tham s kim tra cng vi s th t (Sequence number), xc nhn (ACKnowledge ) v kim tra li tng (Checksum). Cc segment c nh s tun t, cch lm ny nhm mc ch loi b cc segment b trng lp hay khng ng yu cu. Ti bn thu, khi nhn c cc segment thc hin vic kim tra nh trng checksum. Nu segment nhn c khng li hay lp, tn hiu ACK s c gi tr li bn pht khng nh d liu nhn tt. Ngc li nu segment nhn c b li hay b trng lp th segment ny s c loi b v bn thu s gi mt tin hiu yu cu bn pht pht li segment b li , bng c ch ny s m bo tnh chnh xc v tin cy cho d liu.

Cung cp cc dch v (chc nng) kim tra ng truyn, cho php iu khin lung v iu khin tc nghn. Trong ng dng VoIP, giao thc TCP c s dng lm giao thc truyn bo hiu ch khng phc v vic truyn tn hiu thoi. L do l v phn mo u ca TCP ln

Hnh 4.

Cu trc n v d liu TCP 14

ngha cc trng nh sau: Source Port: di 16 bit, xc nh s hiu cng ca trm ngun Destination Port: di 16 bit, xc nh s hiu cng ca trm ch Sequence Number: di 32 bit. S hiu ca byte u tin ca segment t khi bit SYN c thit lp. Nu bit SYN c thit lp th Sequence Number l s hiu tun t khi u (ISN) v byte d liu u tin l ISN+1 ACK Number: di 32 bit, xc nh s hiu ca segment tip theo m trm ngun ang ch c xc nhn Data Offset: di 4 bit, xc nh v tr bt u ca khi d liu lp trn trong n v d liu TCP. Control bit: o URG: vng Urgent Pointer c hiu lc o ACK: vng ACK c hiu lc o PSH: chc nng Push o RST: khi ng li lin kt o SYN: ng b ha cc s hiu tun t o FIN: khng cn s liu t trm cui Window: cp pht th bi kim sot lung d liu theo c ch ca s. y chnh l s lng cc byte d liu bt u t byte c ch ra trong vng ACK m trm ngun sn sng nhn. Checksum: m CRC-16 Urgent Pointer: con tr tre ti s hiu tun t ca byte i sau d liu khn, cho bn nhn bit c di ca d liu khn. Vng ny c hiu lc khi bit URG c thit lp. Option: c di thay i, khai bo cc la chn ca TCP trong c di ti a ca vng d liu trong mt n v d liu segment. 15

Padding: m bo phn tiu ca TCP lun l bi 32 bit. TCP data: cha d liu lp trn c gi tr ti a l 536 byte. Gi tr ny c th thay i nh khai bo trong Option Thit lp v hy kt ni TCP hiu c chc nng ca hm connect, accept, close v gip debug cc ng dng TCP bng chng trnh netstat, chng ta cn hiu lm th no thit lp v hy mt kt ni TCP, cng nh trng thi ca TCP.

Hnh 5.

Bt tay 3 bc trong thit lp kt ni TCP

Gin trn y din ra khi mt kt ni TCP c thit lp: 1) Server sn sng accept mt kt ni ti. Cng vic ny c thc hin bng vic gi hm socket, bind, listen. V c gi l passive open (m trng thi b ng) 2) Client thit lp mt active open bng cch gi hm connect. Khi , pha client s gi SYN bo cho server bit s th t ca d liu client s gi trong kt ni. Thng thng, SYN khng cha d liu, ch cha tiu IP, TCP v c th l cc ty chn TCP. 3) Server xc nhn SYN ca server. N s SYN vi s th t cho d liu ca n. Server gi SYN v ACK cho SYN ca client trong cng mt segment. 4) Client xc nhn SYN ca server. S gi ti thiu c truyn l ba nn c gi l there-way handshake (bt tay 3 bc). Hy kt ni TCP

16

Trong khi ch cn ba segment thit lp mt kt ni TCP th cn bn segment hy kt ni. 1) Mt ng dng gi hm close trc, chng ta gi u cui ny thc hin activeclose. u cui ny s gi FIN segment k thc vic gi d liu 2) u cui khc nhn FIN thc hin passive close. FIN nhn c gi xc nhn bi TCP. FIN nhn c cng c truyn ln lp ng dng nh l endof-file(sau khi cc d liu khc c nhn ). Khi nhn c FIN ngha l ng dng khng nhn thm d liu na. 3) ng dng sau khi nhn c end-of-file s close (ng) socket li. TCP ca n s gi FIN. 4) TCP ca pha yu cu hy kt ni nhn bn tin FIN cui cng, xc nhn FIN.

Hnh 6.

Hy kt ni TCP

Hot ng ca TCP trong thit lp v hy cuc gi c m t bng lc trng thi. C 11 trng thi khc nhau cho mt kt ni v lut cho php chuyn t trng thi ny sang trng thi khc da trn c s trng thi c. V d: nu mt ng dng thit lp mt active open trng thi CLOSED, TCP gi SYN v trng thi mi l SYN_SENT. Nu TCP sau nhn c SYN vi ACK, n s gi ACK v mt trng thi mi ESTABLISH. Trng thi cui khi m vic truyn d liu din ra. Hai ng mi tn ch t trng thi ESTABLISHED ti trng thi ngt kt ni. Nu ng dng gi close trc khi nhn FIN, th trng thi l FIN_WAIT1. Nhng nu ng dng nhn FIN trong khi ang ESTABLISHED, trng thi s l CLOSE_WAIT. Mt l do cn thit phi hiu c lc trng thi l hiu c 11 trng thi TCP vi tn ca n. Trng thi ny c hin bi netstat, l mt cng c hu hiu trong vic debug ng client/server. 17

Hnh 7. Truyn cc gi

S thay i trng thi thit lp TCP

Hnh 8.

Truyn d liu vi TCP

Hnh trn biu din vic truyn gi thc din ra cho mt TCP hon chnh: thit lp kt ni, truyn d liu, hy kt ni. Client trong v d ny thng bo MSS=536(xc nh kch thc buffer ca n) v server c kch thc buffer l 1460. Vi mi kt ni c thit lp, client to mt yu cu v gi n ti server. Yu cu ny c gn trn trong ch mt TCP segment. Server x l yu cu v gi tr li (kch thc nh hn 536). Hai gi d liu c biu din bng ng mi tn m. Ch rng ACK ca yu cu 18

ca client c gi km vi tr li ca server. Cch thc ny c gi l piggybacking v thng c thc hin khi thi gian server x l v tr li nh hn 200ms. Nu lu hn, th ACK s c gi trc khi gi tr li. Mt iu quan trng trong m hnh ny l: Nu ch gi mt segment yu cu i v nhn mt segment tr li th cn tm segment khc. Nu UDP c s dng, ch c hai segment c truyn: yu cu, tr li. Nhng chuyn t TCP sang UDP th chng ta khng cn tnh tin cy m TCP cung cp cho ng dng na, vic m bo truyn tin s do chng trnh UDP thc hin. Mt yu t quan trng na ca TCP l iu khin tc nghn m UDP khng c. Cc ng dng thng s dng UDP vi cc d liu nh cn tc truyn cao( tr nh). 2.3. Giao thc UDP UDP l giao thc lp Giao vn n gin nht, c m t trong RFC 768. ng dng gi bn tin ti socket UDP, sau c ng gi thnh mt UDP paragram v c truyn xung lp IP gi ti ch. Gi tin UDP c truyn m khng m bo rng n c th ti ch, gi ng th t v n ch mt ln. Vn ca ngi lp trnh mng vi UDP l m bo tnh tin cy. Nu datagram ti ch nhng trng kim tra tng (checksum) c li hay gi tin b drop trn mng th n s c truyn li. Nu mun xc nh c rng gi tin ti ch th cn rt nhiu tnh nng trong ng dng: ACK t u cui khc, iu khin vic truyn li,.. Mi mt UDP datagram c chiu di v c truyn ln cng vi d liu cho lp ng dng. iu ny khc vi TCP l giao thc lung byte (byte-stream protocol). Chng ta cng c th ni: UDP cung cp dch v khng hng kt ni. V d, client UDP c th to mt socket v gi datagram ti server ny v sau gi mt datagram khc cng ti server khc. Cng ging nh server UDP c th nhn nhiu datagram trn mt socket UDP t cc client khc nhau.

Hnh 9. 2.4. Giao thc SCTP

Cu trc n v d liu UDP

Nm 1998, nhm lm vic ca IETF c tp hp thit k mt c ch giao vn tin cy truyn bo hiu iu khin cuc gi trn mng Internet. Kt qu l 19

Sigtran c ra i cho php truyn cc bn tin SS7 trn mng IP. Vn chnh m Sigtran cn gii quyt chnh m TCP cha p ng c l: Head of line blocking: Vn xy ra khi gi cc bn tin c lp trn kt ni TCP c thit lp th cc bn tin c nhn sau b lm tr v lu trong b m ca tng giao vn ca pha nhn ti khi cc bn tin trc b mt c truyn li v ti ch. M , cc bn tin sau thng thit lp cc cuc gi c lp. Nh vy, tr cc bn tin sau l nguyn nhn sinh ra timeout trong iu khin cuc gi gy ra li khng mong mun trong qu trnh iu khin cuc gi. Multihoming: Khi mt trm vi nhiu ng truy cp Internet vi mc ch d phng, khng mun i nh tuyn trong khi mng b tc nghn truyn tin vi trm ngang hng vi n. Vi bo hiu cuc gi, tr ny l khng th chp nhn c khi c nhiu ng c. Do TCP ch gn mt ng kt ni gia hai u cui nn s khng th gii quyt c vn ny. Cn nhc nhng vn ny, Sigtran c thit k nh l mt giao thc tng giao vn mi cho php mang bo hiu cuc gi trn mng IP. ng thi, IETF m rng phm vi ca nhm thit k t mt nhm nh n mt nhm chuyn trch thit k mt giao thc giao vn c th phc v nhiu mc ch v hot ng tt vi nhiu ng dng. V khi SCTP ra i vi cc c tnh sau:
Multistreaming: SCTP h tr a lung (stream) bn tin c lp vi nhau

trn mt lin kt SCTP. Mi bn tin c gi trn c gn cho mt lung ring. Tt c d liu trong mt lung c nhn theo th t vi d liu khc trong lung. D liu trong cc lung khc nhau th khng c c tnh ny. Do vy, SCTP cung cp c ch cho php vic nhn d liu c th t mt cch cc b. Nh vy l n gii quyt c vn head-of-line blocking. ng dng ca a lung (multistreaming) c th h tr cc ng dng lin quan ti hp knh d liu nh thoi, vn bn, video trn mt ng truyn gia hai u cui thay v m nhiu kt ni TCP cho mi lung.
Multihoming: gia hai u cui trong qu trnh thit lp lin kt c th xc

nh lin kt a im. Vic c nhiu giao din cho php d liu c t ng gi theo nhiu a ch khc nhau khi c li xy ra. iu ny l hon ton khng th thc hin c TCP v n gn kt mt u cui vi mt 20

giao din nht nh. Nu nh c li xy ra, tt c cc kt ni c gn vi giao din vn c thi gian timeout v c hy b. V sau , ng dng l phi thit lp li cc kt ni khc.
Message Orientation: Trong TCP, d liu c gi gia hai u cui l

lung cc byte. Nu cn thit, ng dng phi lm chc nng nh dng khung (frame) cho bn tin. SCTP, bn tin c gi nguyn nh dng. Tc l nu tng ng dng pha pht gi bn tin 100 byte i th pha thu cng nhn c ng 100 byte. UDP cng cung cp dch v hng bn tin nhng khng c tin cy cao nh SCTP.
Un-ordered Service: i vi TCP, tt c cc bn tin c nhn tin cy

ng theo th t c gi. Cn vi SCTP, giao thc ny cung cp c ch nhn tin khng c th t (gia cc lung song song vi nhau). UDP cng cp dch v ny nhng khng c tin cy nh SCTP.
Extensibility: Gi TCP b gii hn bi 40 byte trng Option. Tri li, gi

SCTP c m rng thng qua vic s dng trng TLV (Tag-LengthValue).


Heartbeat/Keep-alive: SCTP c mt ty chn cho php xc nh thi gian

sng ca bn tin. N cho php ng dng truyn tin xc nh khong thi gian m bn tin cn c ch. Nu thi gian ny ht hn trc khi c truyn tin cy ti pha nhn, th thc th SCTP gi c th dng vic c gi bn tin hay hy b bn tin. Kiu tin cy ny gi l tin cy cc b. iu ny rt hu ch nh trong truyn tin di ng hay cc game online. Vic ny s gip tit kim bng thng ng truyn chng tc nghn.
Syn cookie: SCTP s dng bt tay bn bc bi vic s dng cookie c du

hiu nh trc. Pha nhn ca bn tin thit lpk lin kt SCTP mi duy tr trng thi no-state (khng c cp ti nguyn) cho ti khi pha khi to chng thc c l IP ca i tng yu cu kt ni. C ch ny cho php chng li tn cng t chi dch v bng cch SYN flooding.
Stronger checksum: SCTP cung cp 32 bit kim tra tng vi kh nng pht

hin li tt hn 16 bit TCP hay UDP.

21

Advanced TCP services: cc dch v mi ca TCP nh SACK (RFC

2018), Appropriate Byte Counting Byte Counting (RFC 3465) v Explicit Congestion Notificaion (RFC3168) c tch hp sn trong SCTP. Services/Features Hng lin kt Song cng Tin cy Tin cy cc b Nhn d liu c th t Nhn d liu khng c th t iu khin lung iu khin tc nghn C ch ECN Selective ACKs Hng bn tin Tm li ng MTU Phn mnh PDU tng ng dng Bc cc PDU tng ng dng a lung Multihoming Chng tn cng trn SYN Kt ni half-closed Kim tra d liu ti ch Gi tiu cho checksum SCTP C C C optional C C C C C C C C C C C C C Khng C Khng (s dng vtags) TCP C C C Khng C no C C C Ty chn no C C C Khng Khng Khng C C C UDP Khng C Khng Khng Khng C Khng Khng Khng Khng C Khng Khng Khng Khng Khng Khng Khng Khng C

22

Trng thi i

vtags

4-tuple

Khng

SCTP l giao thc hng kt ni ging nh TCP v cng c vic bt tay thit lp v hy kt ni. Tuy vy, vic bt tay ca SCTP khc so vi TCP.

Hnh 10. Thit lp kt ni SCTP 1) Server sn sng chp nhn mt association n. Vic ny c thc hin thng qua li gi hm socket, bind, listen v c gi l passive open. 2) Client thit lp mt active open bng cch gi hm connect hay gi mt bn tin yu cu m mt association. Khi , SCTP client s gi bn tin INIT thng bo vi server danh sch a ch IP ca n, s hiu th t, tag thit lp xc nh tt c cc gi l trong mt association, s lung m client yu cu, s lung vo m n h tr. 3) Server xc nhn bn tin INIT ca client vi bn tin INIT-ACK cha danh sch a ch IP, s th t thit lp, tag thit lp, s lung m n h tr v mt cookie trng thi. Cookie trng thi cha tt c cc trng thi m server xc nhn association l hp l v c gn s cho vic xc thc ny. 4) Client gi li cookie trng thi ca server vi bn tin COOKIE-ECHO. Bn tin ny cha d liu ngi dng gn km. 5) Server xc nhn rng cookie l hp l v association c thit lp vi bn tin COOKIE-ACK. Bn tin ny cng cha d liu ngi dng. Hy association Khng ging nh TCP, SCTP khng cho php half-closed association. Khi mt u cui ngng th u cui kia cng phi dng gi d liu mi. Pha nhn yu cu hy kt ni gi nt d liu c xp hng trc khi hy kt ni. SCTP khng c trng thi TIME_WAIT nh TCP m s dng tag lm vic ny. Tt c cc chunk 23

c tag ha vi tag gi trong chunk INIT, mt chunk t mt kt ni c s c nhn vi tag sai. Nh vy, SCTP s dng vic xc nhn gi tr tag trong TIME_WAIT.

Hnh 11. Hy kt ni SCTP Cc trng thi trong kt ni SCTP c biu din bng lc sau:

Hnh 12. S trng thi thit lp SCTP 2.5. Giao thc RTP RTP l mt giao thc da trn giao thc IP to ra cc h tr truyn ti cc d liu yu cu thi gian thc vi cc yu cu:
Lin tc: Cc gi tin phi c sp xp theo ng th t khi chng n bn

nhn, cc gi n c th khng theo th t v nu gi tin b mt th bn nhn phi d tm hay b li s mt cc gi tin ny.


S ng b trong cc phng thc truyn thng: Cc khong lng trong ting

ni c trit v nn li gim thiu bng thng cn thit, tuy nhin khi n 24

bn nhn, thi gian gia cc khong lng ny phi c khi phc mt cch chnh xc.
S ng b gia cc phng thc truyn thng: C th tn hiu thoi s dng

mt phng thc truyn thng trong khi tn hiu video li s dng mt phng thc truyn thng khc, cc tn hiu ting v hnh phi c ng b mt cch chnh xc, gi l s ng b ting - hnh.
S nhn din phng thc truyn ti: Trong Internet, thng thng cn thay i

s m ho cho phng thc truyn ti (payload) trn hnh trnh truyn hiu chnh thay i rng bng thng sn sng hoc kh nng cho ngi dng mi kt ni vo nhm. Mt vi c ch cn c s dng nhn din s m ho cho mi gi n. Cc dch v cung cp bi RTP bao gm:
a pht p thn thin: (multicast friendly): RTP v RTCP l k thut cho a

pht p, cung cp kh nng m rng cuc hi thoi nhiu bn. Trn thc t, chng c thit k c th hot ng trong c cc nhm a pht p nh, ph hp cho cc cuc in m ba bn. i vi cc nhm ln, chng s dng a pht p qung b (broadcasting).
c lp thit b: RTP cung cp cc dch v cn thit chung cho phng thc

truyn thng thi gian thc ni chung nh thoi, video hay bt k mt b m ho, gii m c th no c s nh ngha cc phng thc m ho v gii m ring bng cc thng tin tiu v nh ngha.
Cc b trn v chuyn i: Cc b trn l thit b nm gi phng thc truyn

thng t mt vi ngi s dng ring l, trn hoc ni chng vo cc dng phng thc truyn thng chung, chuyn i chng vo khun dng khc v gi n ra. Cc b chuyn i c ch cho s thu nh bng thng yu cu ca dng s liu t dng s liu chung trc khi gi vo tng kt ni bng thng hp hn m khng yu cu ngun pht RTP thu nh tc bit ca n. iu ny cho php cc bn nhn kt ni theo mt lin kt nhanh vn nhn c truyn thng cht lng cao. RTP h tr c cc b trn v c cc b chuyn i.
M ho thnh mt m: Cc dng phng thc truyn thng RTP c th m ho

thnh mt m dng cc kho, vic m ho m bo cho vic thng tin trn mng c an ton hn.

25

Cc gi tin truyn trn mng Internet c tr v jitter khng d on c. Nhng cc ng dng a phng tin yu cu mt thi gian thch hp khi truyn cc d liu v pht li. RTP cung cp cc c ch bo m thi gian, s th t v cc c ch khc lin quan n thi gian. Bng cc c ch ny RTP cung cp s truyn ti d liu thi gian thc gia cc u cui qua mng. Bn thn RTP khng cung cp mt c ch no cho vic bo m phn phi kp thi cc d liu ti cc trm m n da trn cc dch v ca tng thp hn thc hin iu ny. RTP cng khng m bo vic truyn cc gi theo ng th t. Tuy nhin, s th t trong RTP header cho php bn thu xy dng li ng th t cc gi ca bn pht. Hot ng ca RTP c h tr bi mt giao thc khc l RTCP nhn cc thng tin phn hi v cht lng truyn dn v cc thng tin v thnh phn tham d cc phin hin thi. Khng ging nh cc giao thc khc l s dng cc trng trong header thc hin cc chc nng iu khin, RTP s dng mt c ch iu khin c lp trong nh dng ca gi tin RTCP thc hin cc chc nng ny. Khun dng bn tin RTP: RTP header bao gm mt phn c nh c mi gi RTP v mt phn m rng phc v cho cc mc ch nht nh. Phn c nh:

Hnh 13. Phn c nh ca n v d liu RTP Version (2 bits): Ch ra version ca RTP, hin nay l version 2. Padding (1 bit): Nu bit ny c t, s c thm mt vi octets thm vo cui gi d liu. Cc octets ny khng phi l thng tin, chng c thm vo nhm mc ch:

26

o o

Phc v cho mt vi thut ton m ho thng tin cn kch thc ca gi c nh. Dng cch ly cc gi RTP trong trng hp c nhiu gi thng tin c mang trong cng mt n v d liu ca giao thc tng di.

Extension (1 bit): nu bit ny c t, th theo sau phn header c nh s l mt header m rng. Contributing Sources Count (4 bits): s lng cc thnh phn nhn dng ngun CSRC nm trong phn header gi tin. S ny ln hn 1 nu cc gi tin RTP n t nhiu ngun. Marker (1 bit): mang ngha khc nhau, tu theo tng trng hp c th, c ch ra trong profile i km. Payload Type (7 bits): ch ra loi ti trng mang trong gi. Cc m s dng trong trng ny ng vi cc loi ti trng c quy nh trong mt profile i km. Sequence Number (16 bits): mang s th t ca gi RTP. S ny c tng thm 1 sau mi gi RTP c gi i. C th c s dng pht hin c s mt gi v khi phc mt gi ti u thu. Gi tr khi u ca trng ny l ngu nhin. Time stamp (tem thi gian, 32 bits): Phn nh thi im ly mu ca octet u tin trong gi RTP. Thi im ny c ly t mt ng h tng u n v tuyn tnh theo thi gian cho php vic ng b v tnh ton jitter. Tn s ng h ny khng c nh, tu thuc vo loi ti trng. Gi tr khi u c chn ngu nhin. Mt vi gi RTP c th mang cng mt gi tr Tem thi gian nu nh chng c pht i cng lc v mt logic. Nu gi d liu c pht ra u n th tem thi gian c tng mt cch u n. Trong trng hp khc th gi tr tem thi gian tng khng u. Tem thi gian l thnh phn thng tin quan trng nht trong cc ng dng thi gian thc. Ngi gi thit lp cc tem thi gian ngay thi im octet u tin ca gi c ly mu. Tem thi gian tng dn theo thi gian i vi mi gi. Sau khi nhn c gi d liu, bn thu s dng cc tem thi gian ny nhm khi phc thi gian gc chy cc d liu ny vi tc thch hp. Ngoi ra, n cn c s dng ng b cc dng d liu khc 27

nhau (chng hn nh gia hnh v ting). Tuy nhin RTP khng thc hin ng b m cc ng dng pha trn s thc hin s ng b ny. Synchronization Source Identifier (SSRC, 32 bits): ch ra ngun ng b ca gi RTP, s ny c chn ngu nhin. Trong 1 phin RTP c th c nhiu hn mt ngun ng b. Mi mt ngun pht ra mt lung RTP. Bn thu nhm cc gi ca cng mt ngun ng b li vi nhau pht li tn hiu thi gian thc. Contributing Source Identifier (CSRC, t 0-15 mc, mi mc 32 bits): ch ra nhng ngun ng gp thng tin vo phn ti trng ca gi. Gip bn thu nhn bit c gi tin ny mang thng tin ca nhng ngun no.

Hnh 14. V d v Cu trc gi RTP Phn m rng: c di thay i. S tn ti ph thuc vo bit Extension ca phn c nh.

Hnh 15. Phn m rng cu trc d liu RTP 16 bit u tin c s dng vi mc ch ring cho tng ng dng c nh ngha bi profile. Thng c dng phn bit cc loi header m rng. Length (16 bits): gi tr chiu di phn header m rng tnh theo n v 32 bit, khng bao gm 32 bit u tin ca phn header m rng. C ch m rng ca RTP cho php cc ng dng ring l ca giao thc RTP thc hin c vi nhng chc nng mi i hi nhng thng tin thm vo phn header 28

ca gi. C ch ny c thit k mt vi ng dng c th b qua phn header m rng ny (m vn khng nh hng ti hot ng) trong khi mt s ng dng khc li c th s dng c phn . B phn nhn dng ti xc nh kiu nh dng ca ti tin cng nh cch m ho v nn. T cc b phn nh dng ny, cc ng dng pha thu bit cch phn tch v chy cc dng d liu ti tin. Ti mt thi im bt k trong qu trnh truyn tin, cc b pht RTP ch c th gi mt dng ca ti tin cho d dng ca ti tin c th thay i trong thi gian truyn (thay i thch ng vi s tc nghn ca mng). Mt chc nng khc ca RTP l xc nh ngun: cho php pha thu bit c d liu n t u. V d trong thoi hi ngh, t thng tin nhn dng ngun mt ngi s dng c th bit c ai ang ni. RTP c c tnh cho khng hon thin. N ch cung cp cc dch v ph thng nht cho hu ht cc ng dng truyn thng hi ngh a phng tin. Mi mt ng dng c th u c th them vo RTP cc dch v mi sao cho ph hp vi cc yu cu ca n. Cc kh nng m rng ny c m t trong mt profile i km. Profile ny cn ch ra cc m tng ng s dng trong trng PT (Payload Type) ca phn tiu RTP ng vi cc loi ti trng mang trong gi. RTP nm pha trn UDP, s dng cc chc nng ghp knh v kim tra ca UDP. S d UDP c s dng lm th tc truyn ti cho RTP l bi v 2 l do: Th nht, RTP c thit k ch yu cho vic truyn tin a i tng, cc kt ni c nh hng, c bo nhn khng p ng tt iu ny. Th hai, i vi d liu thi gian thc, tin cy khng quan trng bng truyn ng theo thi gian. Hn na, s tin cy trong TCP l do c ch bo pht li, khng thch hp cho RTP. V d khi mng b tc nghn mt s gi c th mt, cht lng dch v d thp nhng vn c th chp nhn c. Nu thc hin vic pht li th s gy nn tr rt ln cho cht lng thp v gy ra s tc nghn ca mng. Thc t RTP c thc hin ch yu trong cc ng dng m ti cc mc ng dng ny c cc c ch khi phc li gi b mt, iu khin tc nghn. Mng Internet hin nay vn cha th p ng c y cc yu cu ca cc dch v thi gian thc. Cc dch v RTP yu cu bng thng cao c th lm gim cht lng

29

cc dch v khc trong mng n mc nghim trng. Trong qu trnh trin khai phi ch n gii hn bng thng s dng ca cc ng dng trong mng. 2.6. Giao thc RTCP RTCP (Real-time Transport Control Protocol) l giao thc h tr cho RTP cung cp cc thng tin phn hi v cht lng truyn d liu. Cc dch v m RTCP cung cp l: Gim st cht lng v iu khin tc nghn: y l chc nng c bn ca RTCP. N cung cp thng tin phn hi ti mt ng dng v cht lng phn phi d liu. Thng tin iu khin ny rt hu ch cho cc b pht, b thu v gim st. B pht c th iu chnh cch thc truyn d liu da trn cc thng bo phn hi ca b thu. B thu c th xc nh c tc nghn l cc b, tng phn hay ton b. Ngi qun l mng c th nh gi c hiu sut mng. Xc nh ngun: Trong cc gi RTP, cc ngun c xc nh bi cc s ngu nhin c di 32 bt, cc s ny khng thun tin i vi ngi s dng. RTCP cung cp thng tin nhn dng ngun c th hn dng vn bn. N c th bao gm tn ngi s dng, s in thoi, a ch e-mail v cc thng tin khc. ng b mi trng: Cc thng bo ca b pht RTCP cha thng tin xc nh thi gian v nhn thi gian RTP tng ng. Chng c th c s dng ng b gia m thanh vi hnh nh. iu chnh thng tin iu khin: Cc gi RTCP c gi theo chu k gia nhng ngi tham d. Khi s lng ngi tham d tng ln, cn phi cn bng gia vic nhn thng tin iu khin mi nht v hn ch lu lng iu khin. h tr mt nhm ngi s dng ln, RTCP phi cm lu lng iu khin rt ln n t cc ti nguyn khc ca mng. RTP ch cho php ti a 5% lu lng cho iu khin ton b lu lng ca phin lm vic. iu ny c thc hin bng cch iu chnh tc pht ca RTCP theo s lng ngi tham d. Mi ngi tham gia mt phin truyn RTP phi gi nh k cc gi RTCP n tt c nhng ngi khc cng tham gia phin truyn. Nh vy m c th theo di c s ngi tham gia.

30

Gi RTCP gp phn lm tng nghn mng. Bng thng yu cu bi RTCP l 5% tng s bng thng phn b cho phin. Khong thi gian trung bnh gia cc gi RTCP c t ti thiu l 5s. Cc loi thng bo iu khin chnh c RTCP cung cp l: SR (Sender Report): cha cc thng tin thng k lin quan ti kt qu truyn nh t l tn hao, s gi d liu b mt, khong tr. Cc thng bo ny pht ra t pha pht trong 1 phin truyn thng. RR (Receiver Report): Cha cc thng tin thng k lin quan ti kt qu nhn, c pht t pha thu trong 1 phin truyn thng. SDES (Source Description): thng s m t ngun (tn, v tr) APP (Application): cho php truyn cc d liu ng dng BYE: ch th s kt thc tham gia vo phin truyn. Gi tr ca trng PT (Packet Type) ng vi mi loi gi c lit k trong bng sau.

Mi gi thng tin RTCP bt u bng 1 phn tiu c nh ging nh gi RTP thng tin. Theo sau l cc cu trc c chiu di thay i theo loi gi nhng lun bng s nguyn ln 32 bit. Cc gi thng tin RTCP c th gp li vi nhau thnh cc hp gi (compound packet) truyn xung lp di m khng phi chn thm cc bit cch ly. S lng gi trong hp gi tu thuc vo chiu di n v d liu lp di. Mi gi RTCP u phi c truyn, ngay c khi ch c mt gi duy nht. Khun dng hp gi c xut nh sau: Encription Prefix (32 bit): c dnh khi hp gi cn m ho. Gi tr trong trng ny cn trnh trng vi 32 bit u tin trong gi RTP Gi u tin trong hp gi lun l SR hoc RR. Nu khng thu nhn thng tin, hoc hp gi ch c mt gi BYE th mt gi RR rng c dn u trong hp gi. 31

Nu s lng cc ngun ln hn 31 (khng va trong mt gi SR hoc RR) th cc gi RR thm vo s theo sau gi thng k u tin. Vic bao gm gi thng k (RR hoc SR) trong mi hp gi nhm thng tin thng xuyn v cht lng thu ca nhng ngi tham gia. Vic gi hp gi i c tin hnh mt cch u n v thng xuyn theo kh nng cho php ca bng thng. Trong hp gi c gi SDES nhm thng bo v ngun pht. Cc gi APP nm v tr bt k trong hp gi. Gi BYE nm v tr cui cng.

Hnh 16. V d Cu trc gi RTCP

32

Chng 3. Giao thc bo hiu VoIP 3.1. Giao thc bo hiu H.323 Khi cp n thoi IP, tiu chun quc t thng c cp n l H.323. Giao thc H.323 l chun do ITU-T pht trin cho php truyn thng a phng tin qua cc h thng da trn mng chuyn mch gi,v d nh Internet. N c ITU_T ban hnh ln u tin vo nm 1996 v gn y nht l nm 1998. H.323 l chun ring cho cc thnh phn mng, cc giao thc v cc th tc cung cp cc dch v thng tin multimedia nh : audio thi gian thc, video v thng tin d liu qua cc mng chuyn mch gi, bao gm cc mng da trn giao thc IP. 3.1.1. Cc thnh phn trong mng 3.1.1.1. Thit b u cui H.323 (H.323 Endpoint) Cc thit b nm ngoi phm vi khuyn ngh H.323 Thit b vo ra Video. Thit b vo ra Audio. Thit b vo ra s liu. Giao din mng LAN. Giao din ngi s dng. Cc phn t nm trong phm vi khuyn ngh H.323 B m ho v gii m Video. B m ho v gii m Audio. B m nhn d liu. Khi iu khin h thng. Khi iu khin theo chun H.245 S dng knh iu khin H.245 mang cc bn tin iu khin im - im iu khin hot ng ca thc th H.323 bao gm : kh nng trao i, m v ng cc knh logic, cc yu cu ch hot ng thch hp, iu khin lung bn tin, pht cc lnh v cc ch th. iu khin bo hiu cuc gi 33

S dng bo hiu cuc gi theo khuyn ngh H.225 thit lp mt kt ni gia hai u cui H.323. Knh bo hiu cuc gi c lp vi knh RAS v knh iu khin H.245. Trong h thng khng c Gatekeeper th knh bo hiu cuc gi c thit lp gia hai u cui H.323 tham gia cuc gi. Cn trong h thng c Gatekeeper th knh bo hiu cuc gi c thit lp gia cc u cui v Gatekeeper hoc gia hai u cui vi nhau, vic la chn phng n thit lp knh bo hiu cuc gi nh th no l do Gatekeeper quyt nh. Chc nng bo hiu RAS S dng cc bn tin H.225 thc hin : ng k, cho php dch v, thay i bng thng, trng thi, cc th tc tch ri gia cc u cui v Gatekeeper.

Hnh 17. S khi thit b u cui H.323 3.1.1.2. Gatekeeper Mt min H.323 trn c s mng IP l tp hp tt c cc u cui c gn vi mt b danh. Mi min c qun tr bi mt Gatekeeper duy nht, l trung tm u no, ng vai tr gim st mi hot ng trong min . y l thnh phn tu chn trong h thng VoIP theo chun H.323. Tuy nhin nu c mt Gatekeeper trong mng th cc u cui H.323 v cc Gateway phi hot ng theo cc dch v ca Gatekeeper . Mi thng tin trao i ca Gatekeeper u c nh ngha trong RAS. Mi ngi dng ti u cui c Gatekeeper gn cho mt mc u tin duy nht. Mc u tin ny rt cn thit cho c ch bo hiu cuc gi m cng mt lc mhiu ngi s dng. H.323 nh ngha c nhng tnh cht bt buc ti thiu phi c cho Gatekeeper v nhng c tnh tu chn: 34

Cc chc nng bt buc ti thiu ca mt Gatekeeper gm : Phin dch a ch, iu khin cho php truy nhp, iu khin di thng, qun l min dch v. Cc chc nng tu chn ca Gatekeeper gm c : Bo hiu iu khin cuc gi, cp php cho cuc gi, qun l cuc gi. Gatekeeper hot ng hai ch : Ch trc tip: Gatekeeper ch c nhim v cung cp a ch ch m khng tham gia vo cc vic nh tuyn cc bn tin bo hiu.

Hnh 18. Phng thc nh tuyn trc tip Ch nh tuyn qua Gatekeeper : Gatekeeper l thnh phn trung gian, nh tuyn mi bn tin bo hiu trong mng H.323.

Hnh 19. Phng thc nh tuyn qua Gatekeeper Cc chc nng c th ca Gatekeeper c m t nh sau: Chc nng dch a ch: Gatekeeper s thc hin chuyn i a ch URI (dng tn gi hay a ch hp th ) ca mt u cui hay Gateway sang a ch truyn dn (a ch IP). Vic chuyn i c thc hin bng cch s dng bn i chiu a ch c cp nht thng xuyn bi cc bn tin ng k. Cng c th l vic chuyn i t quy cch nh s E.164 sang dng URI.

35

iu khin truy cp: Gatekeeper cho php mt truy cp mng LAN bng cch s dng cc bn tin H.225 l ARQ/ACF/ARJ. Vic iu khin ny da trn s cho php cuc gi, bng thng, hoc mt vi thng s khc do nh sn xut quy nh. N c th l chc nng rng c ngha l chp nhn mi yu cu truy nhp ca u cui. iu khin rng bng thng: Gatekeeper h tr cc bn tin BRQ/BRJ/BCF cho vic qun l bng thng. N c th l chc nng rng ngha l chp nhn mi yu cu thay i bng thng. Gatekeeper c th hn ch mt s cc u cui H.323 cng mt lc s dng mng. Thng qua vic s dng knh bo hiu H.225, Gatekeeper c th loi b cc cc cuc gi t mt u cui do s hn ch bng thng. iu c th xy ra nu Gatekeeper thy rng khng bng thng sn c trn mng tr gip cho cuc gi. Vic t chi cng c th xy ra khi mt u ang tham gia mt cuc gi yu cu thm bng thng. N c th l mt chc nng rng ngha l mi yu cu truy nhp u c ng . Qun l min dch v: y min dch v (domain) ngha l tp hp tt c cc phn t H.323 gm thit b u cui. Gateway, MCU c ng k hot ng vi Gatekeeper thc hin lin lc gia cc phn t trong min dch v hay t dch v ny sang dch v khc. iu khin bo hiu cuc gi: Gatekeeper c th la chn hai phng thc iu khin bo hiu cuc gi l: hon thnh bo hiu cuc gi vi cc u cui v x l bo hiu cuc gi chnh bn thn n, hoc Gatekeeper c th ra lnh cho cc u cui kt ni mt knh bo hiu cuc gi hng ti nhau. Theo phng thc ny th Gatekeeper khng phi gim st bo hiu trn knh H.225. Qun l cuc gi: Mt v d c th v chc nng ny l Gatekeeper c th lp mt danh sch tt c cc cuc gi H.323 hng i ang thc hin ch th rng mt u cui b gi ang bn v cung cp thng tin cho chc nng qun l bng thng. 3.1.1.3. Khi iu khin a im Khi iu khin a im (MCU) c s dng khi mt cuc gi hay hi ngh cn gi nhiu kt ni hot ng. Do c mt s hu hn cc kt ni ng thi, nn cc MCU gim st s tho thun gia cc u cui v s kim tra mi u cui v tnh nng m chng c th cung cp cho hi ngh hoc cuc gi. Cc MCU gm hai phn: B iu khin a im (MC) v B x l a im (MP). B iu khin a im c trch nhim trong vic tho thun v quyt nh kh nng ca cc u cui. Trong khi b x l a im c s dng x l 36

multimedia, cc lung trong sut qu trnh ca mt hi ngh hoc mt cuc gi a im. 3.1.2. Giao thc H.323

Hnh 20. Giao thc bo hiu H.323 Giao thc H.323c chia lm 3 phn chnh: Bo hiu H.225 RAS (Registration, Admissions, and Status): bo hiu gia thit b u cui vi H.323 gatekeeper trc khi thit lp cuc gi. Bo hiu H.225 Q.931 s dng kt ni, duy tr v hy kt ni gia hai u cui. Bo hiu H.245 s dng thit lp phin truyn media s dng giao thc RTP. 3.1.2.1. Bo hiu RAS Bo hiu RAS cung cp iu khin tin cuc gi trong mng H.323 c tn ti gatekeeper v mt vng dch v(do gatekeeper qun l). Knh RAS c thit lp gia cc thit b u cui v gatekeeper qua mng IP. Knh RAS c m trc khi cc knh khc c thit lp v c lp vi cc knh iu khin cuc gi v media khc. Bo hiu ny c truyn trn UDP cho php ng k, chp nhn, thay i bng thng, trng thi v hy. Bo hiu RAS chia lm cc loi sau: Tm kim Gatekeeper: vic ny c th c thc hin th cng hoc t ng cho php xc nh gatekeeper m thit b u cui ng k ( c th s dng dch v sau ny); bao gm:

37

Gatekeeper Request (GRQ): bn tin multicast gi bi thit b u cui tm gatekeeper. Gatekeeper Confirm (GCF): bn tin thng bo a ch knh RAS ca gatekeeper cho thit b u cui. Gatekeeper Reject (GRJ): bo cho thit b u cui bit rng gatekeeper t chi. ng k: cho php gateway, thit b u cui v MCU tham gia vo mt vng dch v do gatekeeper qun l v thng bo cho gatekeeper v a ch v b danh ca n; bao gm: Registration Request (RRQ): c gi t thit b u cui ti a ch knh RAS ca gatekeeper. Registration Confirm (RCF): c gi bi gatekeeper xc nhn cho php vic ng k bi bn tin RRQ. Registration Reject (RRJ): khng chp nhn ng k ca thit b Unregister Request (URQ): c gi bi thit b u cui hy ng k vi gatekeeper trc v c tr li bng Unregister Confirm (UCF) v Unregister Reject (URJ) (tng t nh trn). Xc nh v tr thit b u cui: Thit b u cui v gatekeeper s dng bn tin ny ly thm thng tin khi ch c thng tin v danh c ch ra. Bn tin ny c gi thng qua a ch knh RAS ca gatekeeper hoc multicast. Loi bn tin ny bao gm: Location Request (LRQ): c gi yu cu thng tin v thit b u cui, gatekeeper, hay a ch E.164. Location Confirm (LCF): c gi bi gatekeeper chc cc knh bo hiu cuc gi hay a ch knh RAS ca n hay thit b u cui yu cu. Location Reject (LRJ): c gi bi gatekeeper thng bo LRQ trc khng hp l. Admissions: bn tin gia cc thit b u cui v gatekeeper cung cp c s cho vic thit lp cuc gi v iu khin bng thng sau ny. Bn tin ny bao gm 38

c cc yu cu v bng thng(c th c thay i bi gatekeeper). Loi bn tin ny gm: Admission Request (ARQ): Gi bi thit b u cui thit lp cuc gi Admission Confirm (ACF): Cho php thit lp cuc gi. Bn tin ny c chc a ch IP ca thit b c gi hay gatekeeper v cho php gateway ngun thit lp cuc gi. Admission Reject (ARJ): khng cho php thit b u cui thit lp cuc gi. Thng tin trng thi: dng ly thng tin trng thi ca mt thit b u cui. Ta c th s dng bn tin ny theo di trng thi online hay offline ca thit b u cui trong tnh trng mng b li. Thng thng bn tin ny s c gi 10 giy mt ln. Trong qu trnh cuc gi, gatekeeper c th yu cu thit b u cui gi theo chu k cc bn tin trng thi. Loi bn tin ny bao gm: Information Request (IRQ): gi t gatekeeper ti thit b u cui yu cu thng tin trng thi. Information Request Response (IRR): c gi t thit b u cui ti gatekeeper tr li cho bn tin IRQ. Bn tin ny cng c gi t thit b u cui ti gatekeeper theo chu k. Status Enquiry Sent : Thit b u cui hay gatekeeper c th gi bn tin ny ti thit b u cui khc xc thc v trng thi cuc gi. iu khin bng thng: Dng thay i bng thng cho cuc gi vi cc bn tin nh sau: Bandwidth Request (BRQ): gi bi thit b u cui yu cu tng hoc gim bng thng cuc gi Bandwidth Confirm (BCF): chp nhn thay i yu cu bi thit b u cui. Bandwidth Reject (BRJ): khng chp nhn thay i yu cu bi thit b u cui. Hy kt ni: Khi mun kt thc cuc gi th trc ht thit b u cui dng ht mi kt ni v ng ht cc knh logic li. Sau , ne s ngt phin H.245 v 39

gi tn hiu RLC trn knh bo hiu cuc gi. bc ny, nu khng c gatekeeper th cuc gi s c hy cn nu khng th cc bn tin sau s c gi trn knh RAS kt thc cuc gi: Disengage Request (DRQ): Gi bi thit b u cui hay gatekeeper kt thc cuc gi. Disengage Confirm (DCF): Gi bi thit b u cui hay gatekeeper chp nhn bn tin DRQ trc . Disengage Reject (DRJ): c gi bi thit b u cui hoc gatekeeper thng bo khng chp nhn yu cu DRQ. 3.1.2.2. Bo hiu iu khin cuc gi H.225 Trong mng H.323, chc nng iu khin cuc gi da trn c s giao thc H.323 vi vic s dng bn tin bo hiu Q.931. Mt knh iu khin cuc gi c to ra da trn giao thc TCP/IP vi cng 1720. Tng ny thit lp cc bn tin iu khin cuc gi gia hai thit b u cui vi mc ch thit lp, duy tr v kt thc cuc gi. H.225 cng s dng bn tin Q.932 cho cc dch v b sung. Cc bn tin Q.931 v Q.932 thng c s dng trong mng H.323: Setup: c gi t thc th H.323 ch gi c gng thit lp kt ni ti thc th H.323 b gi qua cng 1720 TCP. Call Proceeding: thc th b gi gi bn tin ny ti thc th ch gi ch th rng th tc thit lp cuc gi c khi to. Alerting: c gi t thc th b gi ti thc th ch gi ch th rng chung bn ch bt u rung. Connect: c gi t thc th b gi thng bo rng bn b gi tr li cuc gi. Bn tin Connnect c th mang a ch truyn vn UDP/IP. Release Complete: c gi bi mt u cui khi to ngt kt ni, n ch th rng cuc gi ang b gii phng. Bn tin ny ch c th c gi i nu knh bo hiu cuc gi c m hoc ang hot ng. Facility: y l mt bn tin Q.932 dng yu cu hoc phc p cc dch v b sung. N cng c dng cnh bo rng mt cuc gi s c nh tuyn trc tip hay thng qua GK.

40

Cc bn tin trong qu trnh thit lp cuc gi nh sau:

Hnh 21. Q.931 trong thit lp cuc gi 1. Thit b u cui H.323 gi bn tin Setup yu cu thit lp cuc gi. Gi s y bn tin c gi ti Gatekeeper (thit lp cuc gi thng qua Gatekeeper). 2. Gatekeeper s gi tr li bn tin Call Proceeding nhm thng bo cho pha gi rng: Thit b ny ang thc hin thit lp cuc gi. 3. Khi u cui b gi rung chung, Gatekeeper s gi bn tin Alerting v u cui gi thng bo v trng thi ny. 4. Khi ngi c gi nhc my, bn tin Connect s c gi ti u cui gi thng bo cuc gi c thit lp. 5. Cuc gi c thc hin 3.1.2.3. Giao thc H.245 Chc nng H.245 l thit lp cc knh logic truyn audio, video, data v cc thng tin knh iu khin. Gia hai thit b u cui c thit lp mt knh H.245 cho mt cuc gi. Knh iu khin ny c to da trn TCP gn ng port. Chc nng iu khin ca knh H.245 l thng lng v mt s thng s sau: B m ha ting ni s c s dng hai pha. Ly v d, chun m ha ting ni v tc bit tng ng nh sau: G.729 - 8 kbps, G.728 - 16 kbps, G.711 64 kbps, G.723 - 5.3 hay 6.3 kbps, G.722 - 48, 56, v 64 kbps 41

Thng lng v Ch/t gia hai thit b u cui: xc lp vai tr ca cc thit b trong khi thc hin cuc gi trnh hin tng xung t. Round-Trip Delay: xc nh tr gia pha pht v pha thu. Da vo thng s ny xc nh kt ni vn hot ng. Bo hiu trn knh logic thc hin vic m v ng cc knh logic. Cc knh ny c thit lp trc khi thng tin c truyn n . Bo hiu ny c th thit lp knh n hng hoc song hng. Sau khi knh logic c thit lp, cng UDP cho knh media RTP c truyn t pha nhn ti pha pht. Khi s dng mt hnh nh tuyn qua Gatekeeper th Gatekeeper s chuyn hng lung RTP bng cch cung cp a ch UDP/IP thc ca thit b u cui. Lung RTP s truyn trc tip gia hai thit b u cui vi nhau. Mi knh media s dng RTP truyn thi gian thc - s c mt knh phn hi v cht lng dch v QoS theo chiu ngc li gip pha pht kim sot c lung media truyn i v c nhng iu chnh ph hp.

Hnh 22. Cu trc lung media gia cc u cui 3.1.3. Thit lp cuc gi VoIP s dng giao thc H.323 3.1.3.1. Bo hiu trc tip gia cc thit b u cui Trong m hnh ny, c ch l cc thit b u cui (Endpoint) ch xin php Gatekeeper thc hin cuc gi thng qua bo hiu RAS cn cc bc bo hiu gia cc thit b ny c thc hin trc tip khng thng qua Gatekeeper.

42

Hnh 23. Thit lp bo hiu H.323 trc tip gia cc u cui Bc 1: Endpoint O ng k vi Gatekeeper yu cu cho php thc hin mt cuc gi ti Endpoint T. Cc bc thc hin xc thc thu bao gi s c thc hin bc ny. Gatekeeper tr li cho php Endpoint O thc hin cuc gi v a ch ca chnh xc ca Endpoint T. Trong trng hp ny, hai Endpoint thc hin cuc gi trc tip vi nhau. Bc 2: Endpoint O v Endpoint T thit lp mt kt ni TCP cho bo hiu H.225 truyn cc bn tin Q.931 cho php thit lp cuc gi. Endpoint O gi bn tin Setup ti Endpoint T yu cu thit lp cuc gi. Endpoint T tr li bng bn tin Call Proceeding thng bo cuc gi ang c thc hin.

43

Bc 3: Endpoint T xin php Gatekeeper cho php thc hin cuc gi vi Endpoint O. Gatekeeper tr li ng cho Endpoint T chp nhn cuc gi. Endpoint T thc hin rung chung v bo cho Endpoint O bit l ang rung chung ngi b gi. Bc 4: Ngi b gi nhc ng nghe. Endpoint T gi bn tin Conect ti Endpoint O thng bo knh cuc gi c thit lp. Lc ny, gia hai Endpoint m mt kt ni TCP na cho knh bo hiu H.245 thng lng, thit lp v duy tr knh media. Bc 5: Khi thng lng xong (cc thng s c m t trong phn bo hiu H.245), mi Endpoint yu cu m mt kt ni audio truyn thoi. Nh vy s tn ti hai knh cho php thc hin cuc gi hai chiu gia hai thu bao. Qu trnh thoi c thc hin hin da trn giao thc RTP vi s kim sot ca RTCP. 3.1.3.2. Bo hiu c nh tuyn thng qua Gatekeeper Trong hnh thc bo hiu ny th mi bn tin bo hiu c gi qua Gatekeeper. Gatekeeper s x l v chuyn tip bo tin ti pha b gi. Khi , pha gi khng nht thit phi bit chnh xc a ch ca pha b gi nhng qu trnh ny s b tr nhiu hn.

Cc bn tin bo hiu trong m hnh ny gn nh ging vi trng hp bo hiu trc tip gia hai thit b u cui nhng c mt s ch nh sau: Gatekeeper y s gm c hai giao din: giao din vi Endpoint O v Endpoint T. Vic phn bit nh vy s gip chng ta r rng hn trong vic gi nhn cc bn tin v hai giao din ny hot ng c s c lp nht nh vi nhau. Knh bo hiu H.225 c thit lp gia cc Endpoint v Gatekeeper

44

Khi nhn c bn tin Setup t Endpoint O gi ti, Gatekeeper s gi bn tin ny ti Endpoint T v gi ngay bn tin Call Proceeding v cho Endpoint O bo rng cuc gi ang trong qu trnh thit lp. Sau khi nhn c bn tin Connect t Endpoint T, Endpoint O v Endpoint T s thc hin bo hiu trc tip vi nhau m knh truyn media.

Hnh 24. Thit lp bo hiu H.323 nh tuyn qua Gatekeeper 3.1.3.3. Thit lp cuc gi gia hai thit b u cui hai vng dch v Trong m hnh ny l vic thc hin cuc gi gia hai thit b u cui hai vng dch v khc nhau cho nhau. y l m hnh bo hiu da trn vic nh tuyn ca cc Gatekeeper. Sau khi nhn c yu cu ca Endpoint O mun thit lp cuc gi vi Endpoint T, Gatekeeper 1 gi ti Endpoint T yu cu thit lp cuc gi. V Endpoint T nm trong vng dch v do Gatekeeper 2 qun l nn n phi xin s cho php c th thc hin cuc gi (ging nh cc trng hp trc). trong trng hp ny, Gatekeeper 2 cng gi tr li bn tin ARQ ca Endpoint T bng bn tin ACF cho php thit lp cuc gi nhng phi thng qua n (khng cho thc hin cuc gi trc tip ti Endpoint T). Do vy, Endpoint T gi bn tin Facility ti Gatekeeper 1 thng bo l cuc gi c chp nhn nhng phi c nh tuyn li thng qua Gatekeeper 2. Chnh v vy, knh bo hiu H.245 c c hy v thay bng cc knh bo hiu biu din nh trong hnh v. 45

Hnh 25. Thit lp kt ni gia hai vng dch v 3.2. Giao thc SIP SIP (Session Initiation Protcol ) l giao thc bo hiu iu khin lp ng dng c dng thit lp, duy tr, kt thc cc phin truyn thng a phng tin (multimedia). Cc phin multimedia bao gm thoi Internet, hi ngh, v cc ng dng tng t c lin quan n cc phng tin truyn t (media) nh m thanh, hnh nh, v d liu. SIP s dng cc bn tin mi (INVITE) thit lp cc phin v mang cc thng tin m t phin truyn dn. SIP h tr cc phin n b (unicast) v qung b (multicast) tng ng cc cuc gi im ti im v cuc gi a im. C th s dng nm chc nng ca SIP thit lp v kt thc truyn dn l nh v thu bao, kh nng thu bao, sn sng ca thu bao, thit lp cuc gi v x l cuc gi. SIP c IETF a ra trong RFC 2543. N l mt giao thc da trn tng v cu trc ca HTTP (HyperText Transfer Protocol) giao thc trao i thng tin ca World Wide 46

Web v l mt phn trong kin trc multimedia ca IETF. Cc giao thc c lin quan n SIP bao gm giao thc t trc ti nguyn RSVP (Resource Reservation Protocol), giao thc truyn vn thi gian thc (Realtime Transport Protocol), giao thc cnh bo phin SAP (Session Announcement Protocol), giao thc miu t phin SDP (Session Description Protocol). Cc chc nng ca SIP c lp, nn chng khng ph thuc vo bt k giao thc no thuc cc giao thc trn. Mt khc, SIP c th hot ng kt hp vi cc giao thc bo hiu khc nh H.323. SIP l mt giao thc theo thit k m do n c th c m rng pht trin thm cc chc nng mi. S linh hot ca cc bn tin SIP cng cho php p ng cc dch v thoi tin tin bao gm c cc dch v di ng. 3.2.1. Cc thnh phn trong mng SIP 3.2.1.1. Gii thiu chung v cc thnh phn trong mng SIP SIP Client: l thit b h tr giao thc SIP nh SIP phone, chng trnh chat, y chnh l giao din v dch v ca mng SIP cho ngi dng. SIP Server: l thit b trong mng x l cc bn tin SIP vi cc chc nng c th nh sau: 1) Proxy Server: l thc th trong mng SIP lm nhim v chuyn tip cc SIP request ti thc th khc trong mng. Nh vy, chc nng chnh ca n trong mng l nh tuyn cho cc bn tin n ch. Proxy server cng cung cp cc chc nng xc thc trc khi cho khai thc dch v. Mt proxy c th lu (stateful) hoc khng lu trng thi (stateless) ca bn tin trc . Thng thng, proxy c lu trng thi, chng duy tr trng thi trong sut transaction (khong 32 giy). 2) Redirect Server: tr v bn tin lp 300 thng bo thit b l chuyn hng bn tin ti a ch khc t lin lc thng qua a ch tr v. 3) Registrar server: l server nhn bn tin SIP REGISTER yu cu v cp nht thng tin t bn tin request vo location database nm trong Location Server. 4) Location Server: lu thng tin trng thi hin ti ca ngi dng trong mng SIP.

47

3.2.1.2. Mi lin h gia cc thnh phn trong mng SIP Trong v d th nht, cho ta c mt ci nhn khi qut v chc nng ca Proxy Server, Redirect Server, SIP Phone trong mng. Gi s thu bao c tn user1 trong min dch v do here.com mun thc hin mt cuc gi thoi ti thu bao c th l user2 ( thuc there.com)

Hnh 26. Chc nng ca Proxy, Redirect Server trong mng SIP
1. Khi User 1 mun gi ti User 2, trc ht n s gi bn tin INVITE 1

n Proxy Server 1. Proxy Server 1 chuyn tip bn tin ti Redirect Server. 2. Redirect Server ny x l v tr v m 3xx thng bo cho Proxy Server t thc hin kt ni.
3. Proxy Server 1 gi bn tin INVITE 2 ti ch tr v bi Redirect Server (

chnh l Stateless Proxy Server 1). V y l Stateful Proxy nn thc cht bn tin INVITE c gi bi Stateful Proxy l khc so vi bn tin nhn c t User1(ban u). 4. Stateless Proxy Server chuyn tip bn tin INVITE ti SIP Statefull Proxy 2. Do l Stateless Proxy nn cng vic ca n n gin l chuyn tip bn tin. 5. SIP Statefull Proxy 2 chuyn tip bn tin INVITE ti user2. 6. Khi user2 nhc my th n s gi bn tin 200 OK theo chiu ngc li. 7. Sau khi nhn c bn tin 200 OK, user1 s gi xc nhn ACK ti user2. 48

8. Lung RTP trc tip gia hai thu bao c thit lp. V cuc gi c thc hin. Trong v d th hai s m t qu trnh mt SIP Phone ng k vi vi Registrar Server qun l n,hot ng ca Location Server, Proxy Server.

Hnh 27. Chc nng ca Location, Registrar Server trong mng SIP Khi mt SIP Phone c kt ni vi mng. N lin tc gi bn tin REGISTER ti Registrar Server thng bo v tr hin ti ca n. Gi s trong min dch v c tn chicago.com th qu trnh REGISTER (ng k) c tin hnh nh sau: 1. Thu bao c tn Carol gi bn tin REGISTER ti Registrar Server. Server ny tin hnh xc thc. Nu hp l th cc thng tin c lu trong Location Server. 2. Khi mt thu bao khc (c tn l Bob) gi bn tin INVITE ti Proxy Server xin kt ni ti thu bao Carol. Proxy Server s truy vn cc thng tin v thu bao b gi thng qua Location Server. 3. Proxy Server gi bn tin INVITE ti thu bao Carol thit lp cuc gi.

49

3.2.2. Bn tin SIP 3.2.2.1. Cc loi bn tin SIP Bn tin yu cu (Request): c gi t client ti server. RFC 3261 nh ngha 6 kiu bn tin request cho php UA v proxy c th xc nh ngi dng, khi to, s i, hy mt phin. Bn tin INVITE: yu cu thit lp mt phin hoc thay i cc c tnh ca phin trc .Trong bn tin ny c s dng SDP nh ngha v cc thng s media ca phin. Mt response thnh cng c gi tr 200 c tr li cc thng s m ngi c gi chp nhn trong phin media. Bn tin ACK xc nhn rng client nhn c response cui cng ca bn tin INVITE. ACK ch c s dng km vi bn tin INVITE. ACK c gi t u cui n u cui cho response 200 OK. ACK cng c th cha phn thn bn tin vi m t phin cui cng nu bn tin INVITE khng cha. Bn tin OPTIONS: UA s dng request ny truy vn ti server v kh nng ca n. Bn tin BYE: UA s dng bn tin ny yu cu hy mt phin c thit lp trc . Bn tin CANCEL: cho php client v server hy mt request, v d nh INVITE. N khng nh hng ti request hon thnh trc m server gi response. Bn tin REGISTER: Mt client s sng REGISTER yu cu ang k v tr ca n ti AOR (address of record) ca ngi dng vi SIP server. Bn tin p ng (Response): server gi bn tin SIP p ng (SIP response) ti client bo v trng thi ca SIP request m client gi trc . Cc SIP response c nh s t 100 n 699, c chia thnh cc lp ngha khc nhau Cc lp Response Thng tin M tr v 100 180 M t ang thc hin kt ni ang chung 50

Cc lp Response

M tr v 181 182 183

M t Cuc gi ang c chuyn tip c t vo hng i Phin ang c x l Thnh cng Nhiu la chn Chuyn vnh vin Chuyn tm thi S dng proxy Dch v khc Yu cu khng hp l Khng nhn dng c Yu cu thnh ton B cm Khng tm thy Phng thc khng c php Khng chp nhn Yu cu xc thc Proxy Request timeout di i Yu cu qu di URL c yu cu qu ln Khng h tr kiu media Khng h tr URI Phn m rng li Yu cu phn m rng Khong thi gian gia hai s kin qu ngn Tm thi cha sn sng Transaction khng tn ti Pht hin thy loop (chu trnh) Qu nhiu hop

Thnh cng Chuyn hng

200 300 301 302 305 380

Li Client

400 401 402 403 404 405 406 407 408 410 413 414 415 416 420 421 423 480 481 482 483

51

Cc lp Response

M tr v 484 485 486 487 488 491 493

M t a ch khng Mt m khng r rng ang bn Yu cu b hy Khng th chp nhn ti y Yu cu cha c gii quyt Khng gii m c Li ni ti trong server Cha c thc hin u Gateway li Dch v khng tn ti Server timeout Phin bn SIP khng c h tr Bn tin qu ln Bn khp mi ni Suy sp Khng tn ti Khng th chp nhn

Li Server

500 501 502 503 504 505 513

Li ton cc

600 603 604 606

3.2.2.2. Cu trc bn tin SIP Bn tin Request: INVITE sip:bob@proxy.company.com SIP/2.0 Via: SIP/2.0/UDP ph1.company.com:5060;branch=z9hG4bK83749.1 From: Alice <sip:alice@company.com>;tag=1234567 To: Bob <sip:bob@proxy.company.com> Call-ID: 12345601@ph1.company.com CSeq: 1 INVITE Contact: <sip:alice@ph1.company.com> Content-Type: application/sdp

52

INVITE sip:bob@proxy.company.com SIP/2.0 Content-Length: ...

v=0 o=alice 2890844526 28908445456 IN IP4 172.18.193.102 s=Session SDP c=IN IP4 172.18.193.102 t=0 0 m=audio 49170 RTP/AVP 0 a=rtpmap:0 PCMU/8000

Bn tin Response: SIP/2.0 200 OK Via: SIP/2.0/UDP ph1.company.com:5060;branch=z9hG4bK83749.1 From: Alice <sip:alice@company.com>;tag=1234567 To: Bob <sip:bob@proxy.company.com>;tag=9345678 Call-ID: 12345601@ph1.company.com CSeq: 1 INVITE Content-Length: ...

v=0 o=bob 3800844316 3760844696 IN IP4 172.18.193.109 s=Session SDP c=IN IP4 172.18.193.109 t=0 0 m=audio 48140 RTP/AVP 0 a=rtpmap:0 PCMU/8000

53

ngha ca cc trng trong bn tin: Tiu SIP M t From To Thng l AOR(Address of Record) ca ngi gi. N bao gm SIP hoc SIPS URI v vi ty chn tn c hin th. M t ngi nhn ca bn tin SIP, AOR ca ngi nhn. Vi chc nng forward hay redirect thi anh khng phi l a ch ngi nhn. Trng ny ging trng From. nh ngha series ca bn tin SIP. Call-ID phi c xc nh trong mi bn tin SIP c gi bi tt c cc UA trong mt dialog. Cha mt gi tr nguyn v tn phng thc. Trng ny dng xc nh, spx xp, nh du chui SIP request trong mt dialog. Cseq c th khc nhau gia bn tin c truyn li v truyn mi. Xc nh ng i c ch ra request v cc response s c gi. Cha SIP hoc SIPS URI ca UA mun nhn c SIP request mi. Lit k tp cc phng thc SIP c h tr bi UA. Lit k tp cc phn m rng ca SIP h tr bi UA. Trng ny rt ging nh trng Supported nhng l ca cc UA xa cn thit cho mt transaction c x l. Kiu ca phn thn ca bn tin SIP (nu c phn thn) Kch thc ca phn thn bn tin SIP. Trng ny l bt buc khi bn tin SIP c truyn trn TCP.

Call-ID Cseq

Via Contact Allow Supported Require ContentType ContentLength

3.2.3. M t cuc gi SIP 3.2.3.1. Cuc gi c nh tuyn qua Proxy Server

Hnh 28. Thit lp cuc gi SIP vi Proxy Server 54

1. Proxy server nhn c bn tin INVITE t client.

2. Proxy server lin lc vi Location server xc nh a ch ca ngi b gi. 3. Location server xc nh v tr ca ngi c gi v cung cp a ch server ch. 4. Bn tin INVITE c chuyn tip ti a ch m Location server tr v. Proxy server s thm tiu Record-Route vo bn tin INVITE chc rng tt c cc bn tin tun t sau c nh tuyn qua proxy. iu ny cn thit cho qu trnh tnh cc hoc cc ng dng khc cn thit kim sot cc bn tin cho dialog ny. 5. Pha c gi rung chung. Ngi c gi nhc my. 6. Pha c gi gi bn tin 200 OK thng bo cuc gi bt u. 7. Bn tin 200 OK c chuyn tip qua proxy server ti pha gi. 8. Pha gi tr li bn tin 200 OK nhn c bng bn tin ACK ti proxyserver ( khi proxy chn tiu Record-Route vo trong bn tin INVITE) hoc gi trc tip ti pha ngi c gi. 9. Proxy chuyn tip ACK ti ngi c gi. 10. Cuc gi thoi c thit lp. 3.2.3.2. Bo hiu trc tip gia cc thit b u cui

Hnh 29. Thit lp cuc gi vi Redirect Server 55

1. Redirect server nhn c bn tin INVITE t pha UA gi. 2. Redirect server lin lc vi Location server ly thng tin a ch ca UA c gi. 3. Location server tr li a ch ca UA c gi. 4. Redirect server tr a ch trc tip v UA gi vi bn tin 3xx vi trng Contact c cp nht. Khng ging nh Proxy server, Redirect server khng chuyn tip bn tin INVITE. 5. UA gi gi bn tin ACK ti Redirect server xc nhn v bn tin 3xx. 6. UAC gi gi trc tip bn tin INVITE vi trng Contact: l a ch tr v bi Redirect server ti UA c gi. 7. UA c gi rung chung v ngi dng nhc my. UA c gi gi bn tin 200 OK ti UA gi. 8. UAC gi gi bn tin ACK xc nhn. 3.3. So snh gia giao thc H.323 v SIP Gia H.323 v SIP c nhiu im tng ng. C hai u cho php iu khin, thit lp v hu cuc gi. C H.323 v SIP u h tr tt c cc dch v cn thit, tuy nhin c mt s im khc bit gia hai chun ny. H.323 h tr hi ngh a phng tin rt phc tp. Hi ngh H.323 v nguyn tc c th cho php cc thnh vin s dng nhng dch v nh bng thngbo, trao i d liu, hoc hi ngh video. SIP h tr SIP-CGI (SIP-Common Gateway Interface) v CPL (Call Processing Language). SIP h tr iu khin cuc gi t mt u cui th 3. Hin nay H.323 ang c nng cp h tr chc nng ny. SIP Ngun gc Quan h mng Khi im u cui IETF Ngang cp K tha cu trc HTTP. SIP 56 H.323 ITU-T Ngang cp K tha Q.931, Q.SIG H.323

Proxy Server Server Redirect Server Location Server Registrar Servers. Khun dng Tr thit lp cuc gi Text, UTF-8 1.5 RTT C 2 la chn: Gim st trng thi cuc gi trong thi gian thit lp cuc gi sut thi gian cuc gi Bo hiu qung b Cht lng dch v C h tr S dng cc giao thc khc nh RSVP, OPS, OSP m bo cht lng dch v Nh phn 6-7 RTT hoc hn Phin bn 1 v 2: my ch phi gim st trong sut thi gian cuc gi v phi gi trng thi kt ni TCP. iu ny hn ch kh nng m rng v gim tin cy Khng Gatekeeper iu khin bng thng. H.323 khuyn ngh dng RSVP lu d ti nguyn mng. H.323 Gatekeeper

Bo mt

ng k ti Registrar Ch ng k khi trong mng c server, c xc nhn u cui Gatekeeper, xc nhn v m ho v m ho theo chun H.235. nh v u cui s dng E.164 Dng SIP URL nh a hoc tn o H.323 v phng php ch. nh tuyn nh s dng nh x a ch nu trong mng c Redirect v Location server Gatekeeper. Chc nng nh tuyn do Gatekeeper m nhim. c thit k nhm h tr rt nhiu tnh nng hi ngh, k c thoi, hnh nh v d liu, qun l tp trung nn c th gy tc nghn Gatekeeper

nh v u cui v nh tuyn cuc gi

Tnh nng thoi

H tr cc tnh nng ca cuc gi c bn

57

To tnh nng v dch v mi Kh nng m rng

D dng, s dng SIP-CGI v CPL D dng

H.450.1 Hn ch

Chng 4. Kt ni gia mng VoIP v PSTN 4.1. Mng bo hiu SS7 4.1.1. Cc thnh phn trong mng bo hiu SS7 4.1.1.1. SSP (Service Switch Point) SSP lun gn lin vi chc nng chuyn mch. Do chuyn mch c phn cp (s phn cp ca h thng vin thng) nn cc SSP cng c phn cp. Mt chuyn mch vi chc nng SS7 s c 2 giao din: giao din kt ni chc nng thoi giao din kt ni cho d liu SS7 C th ni cc chuyn mch ng ngha vi SSP. Bi l, cc SSP chuyn bo hiu cho cuc gi thnh cc bn tin bo hiu SS7. Chc nng chnh ca SSP l x l cuc gi, qun l cuc gi v gip nh tuyn cuc gi ti ch. 4.1.1.2. SCP (Service Control Point) SCP cung cp cc dch v truy cp c s d liu (CSDL) ti mng in thoi. V d dch v ca SCP l dch v chuyn i s 1-800 (toll-free) hay dch v Local number Portability (LNP) M. SCP hot ng nh l mt giao din ti my tnh c lu CSDL. 4.1.1.3. STP (Service Tranfer Point) STP c xem nh l cc router trong mng SS7. Chc nng ca chng l nh tuyn cc bn tin gia hai SSP hoc gia SCP v SSP. Khng nht thit phi c mt STP gia hai SSP truyn tin cho nhau nhng bn tin mun t SSP ti SCP th nht thit phi i qua STP. mt s nc th chc nng ca STP thng c tch hp vo SSP. Thng thng hai STP thng c ni vi nhau thnh cp. Trong , mt STP l STP hot ng chnh cn STP kia d phng. 58

Trong , m hnh client-server gia cc SSP v SCP; m hnh client-client vi hai SSP vi nhau. V STP l chc nng nh tuyn bn tin SS7 trong cc m hnh ny. Thng thng th SSP chia lm hai loi: quc gia v quc t. C nhng SSP c th c c hai chc nng ny- SSP lai. Mi nc s c ti thiu mt SSP lai. SSP ny lm nhim v nh mt gateway quc t nhm nh tuyn bn tin t phin bn quc gia sang phin bn quc t theo chun ITU-T. Nh vy cn STP gateway nh tuyn bn tin gia cc SSP gateway vi nhau(chuyn i cch nh a ch gia cc nc).

Hnh 30. Mng bo hiu SS7 4.1.2. Lin kt trong mng SS7

Hnh 31. Cc lin kt trong mng SS7 Lin kt A (Access): Lin kt A ni gia SSP vi STP, hoc gia SCP vi STP. 59

Lin kt B (Bridge): Ni gia STP thuc cp ny vi STP thuc cp khc. Lin kt ny cho php m rng mng SS7 c th nh tuyn bn tin trong mng. Lin kt C (Cross): Lin kt C ni hai STP thnh mt cp. Vic lin kt ny gip cho hai STP hot ng nh l mt STP chnh v mt STP d phng trong trng hp STP chnh b hng hoc tc nghn xy ra. Lin kt D (Diagonal): Ni gia cc STP thuc cp thp vi STP thuc cp cao hn. V d nh ni gia STP a phng (local) vi STP lin tnh (regional) Lin kt E (Extended): Ni trc tip mt SSP vi STP khng thuc ch ca n. Lin kt F (Full associated): Ni hai SSP trc tip vi nhau khng cn thng qua STP. 4.1.3. nh tuyn trong mng SS7 Vic nh tuyn trong mng SS7 l hop-by-hop trn c s tp cc lut sau: Mt bn tin SS7 xut pht t SSP ti trc tip SSP ch nu nh c lin kt F gia chng. Nu lin kt F khng tn ti th bn tin c nh tuyn t SSP ti STP ch ca n qua lin kt A. Nu nh lin kt ny khng hot ng th s s dng lin kt A th hai ni ti STP d phng. Mt bn tin t SSP chuyn ti STP ch hot ng v c chuyn tip i Nu bn tin n STP ca SSP ch th c nh tuyn qua lin kt A ti SSP ch. Nu lin kt A ny khng hot ng th s c nh tuyn ti lin kt C gn vi STP d phng ca SSP ch. Gi s c mt thu bao tng i c PC (point code) l 1.4.2 cn thit lp cuc gi vi mt thu bao tng i c PC l 1.4.3. V gia hai tng i ny khng c lin kt F ni trc tip nn bn tin bo hiu SS7 s c nh tuyn qua mng SS7. y mi tng i c i din l mt SSP l giao din ca tng i vi mng SS7. Gi s cuc gi ca chng ta c th c thc hin vi s c mt ca tng i Tandem c PC l 1.4.6 ni trc tip vi hai tng i ngun v ch. C mt ch trc khi i vo nghin cu qu trnh thit lp tuyn ca v d ny l vic nh tuyn ca mng SS7 l hop-by-hop, tc l ng i s c xc nh theo tng chng trn ng i ca n. Qu trnh nh tuyn ca mng SS7 lin h cht ch 60

vi s phn cp ca mng vin thng, bi ton nh tuyn ch yu da trn m hnh phn chp (s c mt ca cc tng i Toll), cc tng i Tandem nhm gim lu lng mng tuyn di dn ln tuyn trn trong mt vng min. Bi ton nh tuyn n gin hn bi ton nh tuyn trong mng gi khc, v d nh mng IP.

Hnh 32. nh tuyn bn tin trong mng SS7 SSP 1.4.2 tra bng nh tuyn xc nh rng khng th thit lp cuc gi trc tip ti SSP c PC l 1.4.3 nhng c th thng qua tng i Tandem c PC=1.4.6. SSP ny s gi bn tin ISUP IAM ti SSP 1.4.6 vi OPC l 1.4.2; DPC l 1.4.6 v TCIC thng bo knh logic (ng trunk) s c dnh cho cuc gi trn chng t n n Tandem. Bn tin ny c nh tuyn qua STP v c gi ti SSP 1.4.6. SSP ny xc nh n khng phi l ch ca s thu bao b gi trong bn tin IAM. N kim tra bng nh tuyn th thy rng l thu bao thuc SSP 1.4.3. SSP 1.4.6 gi bn tin vi OPC l 1.4.6, DPC l 1.4.3 v TCIC l 89 ngha ging ht nh bo tin trc. Khi SSP 1.4.3 nhn c bn tin ny, n bit c y l thu bao thuc s qun l ca n. SSP iu khin bo hiu pha thu bo, iu khin chuyn mng,.. Cc bc bo hiu tip theo c thc hin tng t thit lp cuc gi.

61

4.1.4. Giao thc trong mng SS7

Hnh 33. Giao thc SS7 Message Transfer Part (MTP) Lp 1,2,3 cung cp giao thc giao vn cho cho tt c cc giao thc SS7 khc. Chc nng ca MTP bao gm c tnh giao din mng, truyn tin tin cy, x l bn tin v nh tuyn. Signaling Connection Control Part (SCCP) cung cp dch v nh a ch u cui-u cui v nh tuyn bn tin lp 4 nh Transaction Capabilities Application Part (TCAP). Telephone User Part (TUP) l h thng bo hiu link-by-link c s dng kt ni cho cuc gi thoi v fax. ISDN User Part (ISUP) l giao thc s dng thit lp v duy tr kt ni cho cuc gi thoi v d liu da trn mng knh. TCAP cho php truy cp ti CSDL t xa, cung cp cc thng tin nh truyn v cc cc c trng khc cho cc thnh phn mng xa. 4.1.4.1. Giao thc lp Lp vt l MTP1 Lp vt l thit t cc c tnh l, in ca lin kt bo hiu. Chc nng ca lp ny ging nh Lp vt l ca m hnh OSI, c th l: Chun T1 hay DS1 truyn trn 2 cp cp xon i vi bng thng 1,544Mb/s, vi 24 knh song cng 64kb/s v tc ng b khung l 8kb/s Chun E1 truyn trn 2 cp cp xon i vi bng thng 2,048Mb/s vi 32 knh song cng, mi knh 64kb/s. Trong , mt knh truyn bo hiu (TS16) v 1 knh truyn ng b

62

Knh 56kb/s hoc 64kb/s Chun V.35: giao din gia n v dch v s (DSU) v thit b d liu gi, vi quy c v chn, cu hnh in cho 37 chn. 4.1.4.2. Giao thc lp Lin kt d liu MTP2 Giao thc MTP2 to lin kt im-im ng tin cy gia hai u cui trong mng v hot ng vi c ch sau: C ch pht hin li v Sa li trong sut qu trnh truyn tin. Qu trnh sa li c cung cp bi m CRC-16. Nu pht hin ra li, MTP2 s yu cu truyn li nh s th t cc gi cho php pht hin ra bn tin b mt trong qu trnh truyn. Nu thy mt bn tin, pha thu s yu cu truyn li. Yu cu truyn li c th gn lin vi d liu ngi dng ca bn tin tip theo. D liu ny c th t ng dng lp 4 a xung (SCCP, ISUP, TUP, or TCAP). Ch th trng thi lin kt c duy tr v kim sot trong sut qu trnh hot ng gia hai trm Giao thc MTP2 s dng cc gi c gi l n v bo hieuj truyn cc bn tin SS7. Cc n v bo hiu ny cho php pht hin li, ch th trng thi lin kt v bn tin SS7 cn truyn. C 3 loi n v bo hiu MTP2 nh sau: Fill-in Signal Unit (FISU): cung cp pht hin li trong mng SS7, c truyn khi khng c lu lng trn mng kim sot trng thi hot ng ca mng.

Hnh 34. Cu trc bn tin FISU Link Status Signal Unit (LSSU) cung cp thng tin v trng thi ng truyn gia hai im bo hiu kt ni trc tip vi nhau.

63

Hnh 35. Cu trc bn tin LSSU Message Signal Unit (MSU): cung cp cu trc cho php mang thng tin cua bn tin bo hiu. Thng tin ny l trng ti tin cho bn tin cp cao hn nh SCCP, TUP, ISUP, and TCAP.

Hnh 36. Cu trc bn tin MSU 4.1.4.3. Giao thc Lp mng MTP3 Lp mng ca SS7 c gi l MTP3. Giao thc MTP3 nh tuyn bn tin SS7 da vo bn tin lp 2 nhn c. MTP3 cung cp khi thy cho php truyn tin gia cc giao thc lp 4 nh SCCP, ISUP, TUP, v TCAP cng nh truyn v nhn tin t MTP2.

Hnh 37. Cu trc bn tin MTP3

64

4.1.4.4. Bn tin Lp ng dng 4.1.4.4.1. (Signalling Connection Control Part) SCCP cung cp dch v mng mc nh ca MTP3. S kt hp ca hai lp ny c gi l Network Service Part (NSP) ca SS7. TCAP s dng dch v ca SCCP truy cp CSDL trong mng SS7. SCCP cung cp cc giao din dch v ti TCAP v ISUP. Dch v nh tuyn SCCP cho php STP thc hin Global Title Translation (GTT) bng cc xc nh DPC v s h thng con trong CSDL ch. Cc dch v cung cp bi SCCP gm: Dch v hng kt ni (Connection-Oriented Services): SCCP h tr dch v hng kt ni cho TCAP v ISUP nhng dch v ny hieenj nay khng cn c s dng. Dch v khng hng kt ni: SCCP cung cp dch v khng hng kt ni lp Giao vn cho TCAP (Transaction Capabilities Applications Part). Cc dch v c TCAP gm 800,888,900, in thoi th, ng dng mobile. SCCP v MTP3 kt hp vi nhau cung cp cc dch v non-circuit ny. SCCP cng cho php STP thc hin GTT thay cho tng i u cui. Tng i u cui xem s 800 nh l chc nng dch a ch. Bi v global title addresses khng c nh tuyn m SCCP tng i u cui s nh tuyn bn tin truy vn ti STP. Bn tin c truyn gia SCCP v MTP c gi l Unitdata Messages (UDTs) v Unitdata Service Messages (UDTSs).

Hnh 38. Qu trnh truy vn thng tin trn SCP 1. Khi tng i nhn bit cn thit lp mt cuc gi 800, n s thc hin mt truy vn ti CSDL. TCAP s truyn s gi v b gi ti SCCP v sau c in y cc thng tin thch hp trong UDT v t bit ch th nh tuyn yu cu dch v GTT. SCCP nh a ch ti STP ch v truyn bn tin ti MTP. MTP ca tng i s to mt MSU vo chuyn tip ti STP. 65

2. Chc nng SCCP trong STP nhn truy vn v s dng bng dch a ch nh li a ch vi s hiu ca subsytem (Subsystem Number -SNN) trong CSDL. SNN bao gm DPC v a ch ca CSDL ch. MTP trong STP s chuyn tip truy vn ti SCP. 3. SCCP trong SCP s truyn bn tin ti TCAP v chy truy vn CSDL ny. CSDL s thc hin chuyn s yu cu thnh s nh tuyn v truyn thng tin cho SCCP vi DPC gi tr li thng tin. SCCP cng t bit m t nh tuyn ch th MTP s nh tuyn da trn DPC. 4.1.4.4.2. ISDN User Part ( ISUP) ISUP kt ni, qun l, v hy tt c cc cuc gi trong PSTN. Thu bao c th l ISDN, analog, mobile. Ngoi ra, ISUP c th s dng SCCP nh tuyn thng tin bo hiu qua mng. ng i ca bo hiu c th khng ging nhau cho mi bn tin lin quan ti mi mt knh khc nhau. SCCP cho php bn tin ISUP c th c nh tuyn trc tip t trm ngun n trm ch. Trng kiu bn tin trong bn tin ISUP cho php xc nh kiu bn tin c mng trong MSU vi cc gi tr c th nh sau. Bn tin IAM ACM ANM REL Tn y Initial Address Address Complete Answer Release ngha S dng thit lp cuc gi. Bn tin ny thng cha s thu bao b gi Thng bo rng cuc gi ang c thit lp. Pha b gi c tn hiu tr li Cuc gi b hy. Cng c th s dng kiu bn tin ny thng bo rng tng i tandem hoc tng i ch khng th thit lp c kt ni. nhn c bn tin REL v knh thoi c hy Dng kim tra tnh lin tc ca ng trunk ang rung chung thu bao b gi Dng mt cuc gi nhng kt ni ca n vn c gi Phc hi trng thi cuc gi c dng trc .SUS v RES dng cng mt cu trc bn tin v tham s.

RLC COT CPG SUS RES

Release Complete Continuity Test Call Process Suspend Resume

FOT

Forward Transfer 66

Bn tin INR INF

Tn y Information Request Information

ngha Yu cu thng tin t pha tng i ch ti tng i ngun ly thm thng tin. Cung cp thng tin yu cu bi INR

4.1.5. Cc bc thit lp cuc gi trong mng SS7

Hnh 39. Qu trnh thit lp cuc gi trong mng SS7 1.Ngi gi nhc ng nghe, c nhn bit bi tng i a phng A nh bo hiu mt chiu. 2.Tng i A pht tn hiu mi quay s. 3.Ngi gi quay s. 4.V s thu bao b gi khng nm trong tng i A, nn n phi xc nh cch thit lp cuc gi thng qua bng nh tuyn. Thng tin bng nh tuyn s cho php xc nh knh cn ri cho php thit lp cuc gi. Tng i ny s gi bn tin IAM qua mng SS7 ti tng i c cha thu bao ngi b gi. 5.Khi tng i B nhn c bn tin IAM, n s gi bn tin ACM ti tng i A thng bo tuyn sn sng v A pht tn hiu cho ngi gi bit. ng thi, B cng pht tn hiu rung chung ti thu bao b gi. 6.Khi thu bao b gi nhc my, bn tin ANM c gi t tng i B ti A thng bo bt u cuc gi. 7.Cuc gi c thc hin. Vi qu trnh ny, thng tin l trong sut. 8.Gi s ngi gi dp my trc, khi tng i A nhn c bo hiu ny lp tc gi bn tin REL ti tng i B chm dt cuc gi 67

9.Tng i B gi tn hiu kt thc cuc gi ti thu bao b gi v bn tin RLC ti tng i A thng bo vic hy cuc gi l xong. 4.2. Giao thc Sigtran Giao thc SIGTRAN l giao thc tin cy truyn ti cc bn tin SS7 qua mng IP. Cu trc gm 2 thnh phn : giao thc truyn ti chung cho cc lp giao thc SS7 v module tng thch gi lp cc lp thp hn ca giao thc. V d nu module x l SS7 trong Softswitch x l bn tin MTP lp 3, th giao thc sigtran cung cp cc chc ng tng ng vi cc chc nng ca MTP lp 2. Nu n x l mc ISUP v SCCP, th giao thc sigtran cung cp chc nng ging nh MTP lp 2 v lp 3, tng t i vi TCAP. Do SIGTRAN l mt tp cc giao thc gi lp (thc hin adaptation) SS7 trong mng IP. Giao thc SIGTRAN cung cp tt c cc chc nng cn thit h tr cho bo hiu SS7 qua mng IP, bao gm: iu khin lung Phn phi tun t cc bn tin trong cc lung iu khin c lp. Xc nh im bo hiu ngun v ch. Xc nh knh thoi. Pht hin li, truyn li v cc th tc sa sai khc. Khi phc li cc thnh phn nm trong cc ng chuyn tip. iu khin trnh nghn trn Internet. Xc nh trng thi ca cc thc th trn mng (ang phc v, ngng phcv). H tr c ch bo mt bo v cc thng tin bo hiu. M rng kh nng h tr v bo mt v cc yu cu pht trin v sau.

68

Hnh 40. Giao thc Sigtran 4.2.1. M2UA/ M2PA M2UA v M2PA truyn cc bn tin lp 2. Trong , M2UA (MTP L2 User Adapter) truyn bn tin lp 2 gia hai thc th khng ngang hng trong mng (gia Media Gateway Controller hay Softswitch vi Signalling Gateway); cn M2PA (MTP L2 Peer-to-Peer Adapter) l gia hai thc th ngang hng vi nhau (gia hai signaling gateway vi nhau).

M hnh M2UA

M hnh M2PA

Hnh 41. So snh gia M2UA v M2PA M2PA v M2UA khc nhau nhng im sau: M2PA: Gateway bo hiu l mt im bo hiu s 7 vi mt m im bo hiu. M2UA: Gateway bo hiu khng phi l mt im bo hiu s 7 khng c m im bo hiu. M2PA: Kt ni gia Gateway bo hiu v im bo hiu IP nh l mt link bo hiu SS7. M2UA: Kt ni gia Gateway bo hiu v MGC khng phi l mt lin kt bo hiu. Thc ra, n ch l s m rng ca MTP t GW bo hiu ti MGC. M2PA: Gateway bo hiu c th c cc lp bo hiu cao hn nh SCCP. M2UA: Gateway bo hiu khng c lp bo hiu cao hn ging nh n khng c MTP3. M2PA: da trn MTP3 cho cc th tc qun l. M2UA: s dng cc th tc qun l ca bn thn n. MP2P: im bo hiu IP x l MTP3 v cc dch v ca MTP2 cung cp 69

M2UA: MGC truyn ti MTP3 v cc dch v MTP2 cho MTP2 ca Gateway bo hiu x l. 4.2.2. M3UA M3UA c dng truyn ti cc bn tin bo hiu cc user ca MTP3 nh ISUP, TUP, SCCP trn nn IP s dng SCTP. Cc bn tin TCAP hay RANAP cng nh cc giao thc lp trn ca SCCP c th truyn bng SCCP s dng M3UA hay mt giao thc SIGTRAN khc gi l SUA s c ni phn sau. M3UA c s dng gia Gateway bo hiu v MGC hay c s d liu in thoi IP. Gateway bo hiu s kt cui MTP2, MTP3 v phn phi ISUP, TUP, SCCP hay cc bn tin lp trn ca MTP3 khc, cng nh cc s kin qun l mng MTP trn cc phin SCTP ti Softswitch hay c s d liu thoi IP. Cc lp ISUP hay SCCP im bo hiu IP khng nhn thy cc dch v MTP3 khng c cung cp ti im bo hiu IP, m bi Gateway bo hiu xa. Tng t MTP3 GW bo hiu khng nhn thy giao thc ngi s dng trn n thc cht l phn giao thc xa trn lp M3UA. T y ta thy bn cht ca M3UA l M3UA m rng truy cp cc dch v ca GW bo hiu cho im bo hiu IP. Nu im cui IP c kt ni vi nhiu hn mt GW bo hiu, th M3UA im cui IP s gim st trng thi ca cc im bo hiu ch , v h tuyn bn tin da theo sn sng v trng thi nghn ca route ti nhng ch qua tng GW bo hiu. M3UA khng b gii hn bi trng thng tin bo hiu 272 octet c ch nh bi bn tin SS7 MTP lp 2. Cc khi thng tin ln hn c iu khin trc tip bi M3UA/SCTP m khng cn cc th tc phn on v ti hp nht cc on cc lp cao hn theo cc tiu chun SCCP v ISUP. Tuy nhin, SG c gii hn cc i l 272 octet khi kt ni ti mng bo hiu SS7 khng h tr truyn cc khi thng tin c kch thc ln hn ti ch. i vi mng MTP bng rng, SG s phn mnh cc bn tin ISUP v SCCP ln hn 272 octet nh yu cu. Ti SG, lp M3UA cung cp lin kt ni vi cc chc nng qun l MTP lp 3 h tr cc hot ng bo hiu khng lin kt gia mng SS7 v mng IP. V d SG hin th MTP-3 user xa ti im bo hiu IP khi im bo hiu c th ti c hoc khng th ti c hoc khi xy ra hin tng nghn mng hoc b ngn chn. Lp M3UA ti im bo hiu IP gi trng thi ca cc tuyn ti c cc nodes SS7 xa v c th yu cu trng thi ca cc nodes SS7 xa t lp M3UA ti SG.

70

Lp M3UA ti im bo hiu IP cng c th ch ra SG m ti M3UA b nghn. SUA truyn cc bn tin SCCP. 4.2.3. SUA SUA (SCCP User Adaptation Layer) l giao thc c nh ngha bi IETF truyn ti cc bn tin bo hiu SS7 SCCP phn user qua mng IP s dng giao thc SCTP. SUA c s dng gia SG v cc IP endpoint v gia IP Signalling endpoint. SUA cng h tr c cc dch v khng kt ni tun t v khng tun t v cc dch v hng kt ni 2 chiu c v khng c iu khin lung v pht hin mt bn tin hoc cc li khng tun t. phn phi ti cc im bo hiu SS7, cc bn tin SS7 c nh tuyn ti SG da trn m im bo hiu v s SCCP. SG nh tuyn cc bn tin SCCP ti cc IP endpoint xa. Nu tn ti mt IP endpoint d phng, SG c th chia s ti gia cc IP ndpoints ang kch hot s dng gii php quay vng round-robin. Ch chia s ti ca cc bn tin TCAP ch xut hin trong bn tin u tin trong hi p TCAP; th t cc bn tin TCAP trong cng khong thi gian hi p lun lun gi ti IP endpoint la chn cho bn tin u tin, tr phi cc endpoints chia s trng thi thng tin v SG hiu c bn tin cp pht chnh sch ca cc IP endpoint. SG cng c th thc hin c chc nng chuyn dch nhn ton cu (Global Title Translation) ch ra ch ca bn tin SCCP. SG nh tuyn trn nhn, cc ch s xut hin trong bn tin u vo, nh s b gi hoc s nh danh thu bao di ng. chuyn ti cc dch v hng kt ni, SCCP v SUA giao tip ti SG lin kt 2 phin kt ni cn cho truyn d liu hng kt ni gia im bo hiu SS7 v IP endpoint. Bn tin c nh tuyn bi SG ti im bo hiu da trn m im bo hiu (trong trng a ch MTP-3) v IP endpoint da trn a ch IP (trong mo u SCTP). SUA cng c th c s dng chuyn ti thng tin v user SCCP trc tip gia cc IP endpoints hn l qua SG. SG ch cn kt ni vi bo hiu SS7 trong mng chuyn mch knh. 4.2.4. Kt ni mng VoIP vi mng PSTN 4.2.4.1. Cuc gi bt u t mng VoIP (SIP) v kt thc ti PSTN Ch m hnh ny, ta khng cp ti s c mt ca Proxy Server hay Redirect Server m coi bn tin bo hiu SIP n thng Gateway. Thc cht vn l 71

khi u cui SIP quay s, Proxy Server bit y l cuc gi ngoi mng nn n s xc nh Gateway thch hp thc hin cuc gi. Mt ch na l trong m hnh ny, Gateway ng vai tr va l Media gateway v Signaling Gateway.

Hnh 42. Qu trnh thit lp cuc gi SIP-PSTN 1.SIP User Agent gi bn tin INVITE ti Gateway yu cu kt ni vi mt thu bao PSTN. 2. Gateway tr li bng bn tin 100 Trying ngay sau khi khi to bn tin SS7 IAM ti mng PSTN lp tuyn ti thu bao b gi. Ch l vic gi bn tin 100 Trying cng c th thc hin trc khi gi bn tin IAM, iu ny ph thuc vo vic cu hnh trn Gateway. 3. Mng PSTN tr v bn tin ACM sau khi xc nh c a ch thu bao b gi. Bn tin SS7 ny c chuyn thnh bn tin SIP 183 Session Progress 4. bo rng thu bao b c ang c rung chung th y, mng SIP trn mt cch an ton l truyn nguyn trng thi tn hiu nhn c trn Gateway n thu bao SIP. Vic ny cho php bo hiu chnh xc trng thi ang din ra phng c trc trc trong lc thc hin kt ni vi PSTN. Thng tin ny c truyn bng mt lung RTP mt chiu biu din nh hnh v. 5. Khi thu bao b gi nhc my, bn tin SS7 ANM c gi i. Bn ny c chuyn thnh bn tin 200OK bo hiu cng trn Gateway sn sng cho cuc gi. 72

6. Sau khi thu bao SIP tr li bng bn tin ACK th lung RTP c thit lp 2 chiu gia Gateway v SIP User Agent truyn ti tn hiu thoi trn Gateway nhn c t tng i ca mng PSTN 7. Gi s thu bao SIP dp my trc, n s gi bn tin BYE ti Gateway gii phng cuc gi. Gateway gi bn tin REL ti tng i PSTN hy kt ni. Sau khi Gateway gi bn tin 200 OK v nhn c bn tin RLC, cuc gi chnh thc chm dt. 4.2.4.2. Cuc gi bt u t PSTN v kt thc mng VoIP Trong m hnh cuc gi ny rt ging vi trng hp cuc gi xut pht t mng VoIP v kt thc PSTN.

Hnh 43. Qu trnh thit lp cuc gi PSTN - SIP Thng tin bo hiu vn c chuyn i tng ng gia bn tin SS7 v SIP. thng bo trng thi rung chung ca mnh, thu bao SIP gi tr bn tin 180 Ringing ti Gateway. Bn tin ny tng ng vi bn tin SS7 ACM. Khi , Gateway s gi tn hiu thoi mt chiu m t trng thi ca thu bao b gi ti thu bao gi. Vic ny c tc dng rt ln trong vic m bo thng tin trng thi thit lp ng truyn c kim sot bi thu bao gi.

73

4.2.4.3. Cuc gi PSTN PSTN thng qua mng VoIP. Chun SIP-T Do vn lm vic lin mng gia SIP v PSTN t ra ngy cng cp thit. Nn nhm IETF tp trung nghin cu tm gia nhng vn cn b sung cho giao thc SIP hin ti khi lm vic lin mng vi mng in thoi truyn thng PSTN. Mt khc mt thuc tnh rt quan trng ca bt k mt mng in thoi SIP no l s trong sut mi dch v thoi truyn thng nh ch cuc gi, free phone c trin khai vi cc giao thc mng PSTN nh bo hiu s 7 phi c cung cp bi SIP. Mt thuc tnh quan trng khc ca mng in thoi SIP l kh nng nh tuyn ca cc yu cu SIP. Mt yu cu SIP dng thit lp cuc gi phi cha y thng tin trong header ca n cho php n c nh tuyn ti ch bi Proxy server. Cc tham s chnh ca mt cuc gi nh s b gi phi c truyn ti t bn tin bo hiu s 7 sang cc yu cu ca SIP. SIP-T (SIP Telephone) c gng cung cp mt phng thc tch hp bo hiu thoi vo bn tin SIP. N tho mn hai thuc tnh trn thng qua cc k thut c l ng gi v dch. mt gateway SIP-ISUP, bn tin SS7-ISUP c ng gi trong SIP nhng thng tin cn thit cho cc dch v khng b loi b trong cc yu cu ca SIP. Tuy nhin, Proxy server ci m chu trch nhim cc quyt nh nh tuyn, khng i hi phi hiu ISUP, do ng thi nhng thng cn thit nht c dch t mt bn tin ISUP sang cc mo u tng ng ca SIP quyt nh cc yu cu ca SIP s c nh tuyn nh th no.

Hnh 44. Cu trc bn tin SIP-T Trong khi SIP thun ty c mi cng c cn thit cho vic thit lp v kt thc cuc gi. N khng c mt c ch no mang nhng thng tin trong thi gian cuc 74

gi nh truy xut ISUP INF/INR. Do cn phi c mt s cung cp vic truyn nhng thng tin tu bin ca lp ng dng trn. Cc yu cu lin mng gia SS7-SIP Trong sut bo hiu ISUP Kh nng nh tuyn bn tin SIP ph thuc vo ISUP Chuyn tip cc bn tin bo hiu ca ISUP trong thi gian cuc gi Cc chc nng ca SIP-T ng gi bn ISUP trong bn tin SIP Dch cc thng tin ca ISUP vo mo u ca SIP S dng phng php INFO

Hnh 45. Qu trnh thit lp cuc gi PSTN PSTN thng qua mng SIP Trong hnh v m t hot ng ca SIP trong vic thit lp kt ni gia hai tng i PSTN vi nhau(thng gim chi ph thit lp cuc gi ng di).Bn cnh vic nh x sang bn tin SIP cn thit thit lp bo hiu gia hai Gateway th bn tin bn tin SIP cng nhng c ni dung bn tin SS7 trong . Vic ny gip khng mt thng tin bo hiu cn thit cho vic nh tuyn tip theo mng PSTN sau ny.

75

Chng 5. Kho st giao thc cuc gi VoIP SIP PSTN trn thc t 5.1. Gii thiu kin trc mng VoIP c nghin cu Trc khi i vo gii thiu v vic thit lp cuc gi SIP - PSTN, ta i vo gii thiu cc thnh chnh trong mng m chng ta tin hnh kho st nh sau:

Hnh 46. Kin trc mng VoIP nghin cu Cc thit b cn thit cho mng VoIP: Media Gateway: l thit b Audio Codec Mediant 1000 c 2 giao din mng: o giao din FXO kt ni vi PSTN qua s thu bao 7689333.

o giao din Ethernet kt ni vi mng ni b c cp IP l 172.16.0.22/24. SIP Server: ng vai tr y va l Proxy Server, Registrar Server, Location Server. Sip Server c a ch IP public l 221.148.96.65. SIP Phone: in thoi Softphone c h tr giao thc SIP, c ng k vi SIP Server vi s thu bao 7004 v c a ch IP l 172.16.0.99.

76

Chng trnh gi in thoi VoIP h tr giao thc SIP X-Lite, c ng k vi Sip Server vi s thu bao l 7010 v c a ch IP l 172.16.0.98. Cc thit b mng IP: Router: c cu hnh vi a ch IP l 123.30.4.2/25 c ni vi ISP VDC thng qua modem ADSL. Firewall: nhm bo v mng VoIP khi b tn cng t bn ngoi. Firewall c 3 giao din mng khc nhau o Giao din vi mng Internet vi a ch 123.30.4.5/25 kt ni vi Router nh tuyn gi tin ra ngoi. o Giao din vi mng DMZ (mng vng bin): vi di a ch 172.16.0.0/24 o Giao din vi mng ni b (c bo v): vi di a ch 192.168.1.0/24 (nhng b khng c nghin cu nn s khng c v trong m hnh). Hub: V mun bt gi tin gi trong mng gia cc thit b VoIP mt cc n gin nn y ta s dng mt Hub. V nu thay Hub bng Switch th chng ta s khng thc hin c do Switch l thit b c x l a ch MAC nn ta ch c th bt c cc gi tin trn Card mng ca thit b hin ti. 5.2. Gii thiu chng trnh Wireshark Wireshark l mt chng trnh bt gi tin trn mng. N s c gng bt tt c cc gi tin v hin th thng tin chi tit nht c th. Mc ch ca vic s dng Wireshark c th l: Qun tr mng: kim tra cc li trn mng Bo mt h thng: kim tra cc li v bo mt Pht trin h thng: g ri hot ng ca giao thc Cc i tng khc: hc v cc giao thc ni ti ca mng

77

Hnh 47. Giao din chnh ca chng trnh Wireshark Wireshark c mt s u im nh sau: C th chy trn c h thng UNIX v Windows Bt cc bn tin trc tuyn trn card mng Hin gi tin vi thng tin v giao thc C th m v lu li cc d liu bt c Import and Export cc gi tin t rt nhiu chng trnh khc Lc gi tin vi nhiu tiu ch khc nhau Tm kim gi tin vi nhiu tiu ch Hin th gi tin vi mu ni bt da trn b lc To rt nhiu thng k 5.3. Kho st giao thc cuc gi VoIP SIP PSTN trn thc t Ta s m t cuc gi t thu bao SIP 7010 c IP l 172.16.0.98 ti s in thoi 0936.346.346. C mt ch trong m hnh cuc gi ny l: Ton b thng tin bo hiu SIP v thng tin cuc gi (trn lung RTP) c nh tuyn thng qua SIP-Server. Nn thc cht, Gateway v SIP Phone khng h bit s c mt ca nhau; mi cng vic cn thit u c thc hin trn SIP-Server. 78

Vic bo hiu SIP y c mt s im khc so vi chun SIP c nh ngha trong RFC 3261. (s c lm r phn sau). Ta tin hnh bt gi tin v thu c kt qu nh sau:

79

80

Hnh 48. Kt qu thu c ca giao thc cuc gi SIP PSTN trn thc t Trc khi i vo phn tch cuc gi, ta s i chiu vi s cuc gi c m t giao thc cuc gi trong RFC 3666 - Session Initiation Protocol (SIP) Public Switched Telephone Network (PSTN) Call Flows.

81

Hnh 49. Giao thc cuc gi do IETF nh ngha Da trn kt qua thu c, ta phn tch v v li Giao thc cuc gi nh sau:

Hnh 50. Qu trnh thit lp cuc gi SIP - PSTN 82

1. SIP Phone 7010 gi bn tin INVITE ti SIP-Server yu cu thit lp cuc gi. SIP-Server tr li bng bn tin 100 Trying bo rng n nhn c bn tin INVITE v ang thit lp cuc gi.

Hnh 51. Bn tin INVITE gi ti Proxy Server thit lp cuc gi


2. SIP-Server nhn thy y l cuc gi PSTN nn n chuyn tip bn tin INVITE

ti Gateway. Sau khi Gateway nhn c bn tin INVITE, n tr li bng bn tin 100 Trying ging nh trng hp trn.

Hnh 52. Bn tin INVITE c gi t Proxy Server ti Gateway 83

3. Gateway gi tn hiu DC ti tng i ni ht thng bo rng n nhc my. Tng i ni ht tin hnh xc thc thng tin thu bao v gi tn hiu mi quay s (tn hiu 1VF n tn). 4. Khi nhn c tn hiu mi quan s, Gateway tin hnh chuyn thng tin trong trng To ca bn tin INVITE sang tn hiu DTMF cha s thu bao c gi ti tng i ni ht; cc thng tin khc ch c s dng gia Gateway v mng SIP.
5. Gateway gi bn tin 183 Session Progress thng bo cuc gi ang c thc

hin.

Hnh 53. Cu trc bn tin 183 Session Progress 6. Lc ny, tng i ni ht gi bn tin IAM i trn mng SS7 thit lp tuyn ni gia n v tng i ch. ng thi n cng pht tn hiu ang thc hin cuc gi n thu bao gi ngi dng gi my. 7. Sau khi nhn c bn tin 183 Session Progress thu bao SIP 7010 thip lp lung RTP mt chiu ti SIP-Server. 8. Khi Gateway nhn c tn hiu ang thit lp cuc gi t tng i ni ht. N s gi bn tin 200 OK v thit lp lung RTP hai chiu ti SIP Server v c chuyn tip ti thu bao 7010. Sau khi nhn c bn tin ny th lung RTP c thit lp trc c chuyn thnh hai chiu v gi bn tin ACK xc nhn i. 84

Hnh 54. Cu trc bn tin 200 OK 9. Lc ny, ngi s dng u cui 7010 nghe thy ting tt ngn 10. Sau khi tng i ni ht nhn c bn tin ACM thng bo lp c tuyn. N s nhn tn hiu bo ang rung chung t tng i ch gi v v chuyn tip cho thu bao gi. 11. Tn hiu c Gateway gi ti ngi dng v ngi dng bit l thu bao c gi ang c rung chung. 12. Khi ngi c gi nhc my, bn tin ANM c gi i v bt u thc hin cuc gi. By gi thng tin cuc gi l trong sut.

85

Hnh 55. Giao thc hy cuc gi SIP - PSTN 13. Gi s thu bao SIP dp my trc, bn tin BYE c gi i v lung RTP c iu chnh li ch theo mt chiu t SIP-Server v SIP-Phone.

Hnh 56. Cu trc bn tin BYE n Proxy Server


14. Sau khi nhn c bn tin BYE, Gateway gi tin hiu DC ti tng i ni ht

thng bo rng thu bao dp my. Tng i s gi bn tin REL i hy tuyn c thit lp v c tr li bng bn tin RLC t tng i ch.

Hnh 57. Cu trc bn tin BYE n Gateway 15. Ngi s dng nghe thy ting tt ngn bit cuc gi kt thc lin dp my. Cuc gi c hon tt. y c mt khi nim m chng ta cn quan tm chnh l khi nim Media sm (Early media). Media sm ra i nhm gii quyt vn khi thit lp cuc gi gia mng SIP v PSTN(c bit l cuc gi t SIP sang PSTN). Do thit b u cui SIP s pht media ngay khi gi bn tin 200 OK; trong khi cuc gi ch c bt u thc s khi u cui nhn c xc nhn ACK. iu ny lm cho pha bn kia khng nghe c phn u ca cuc thoi. Ngoi ra, trong qu trnh thc hin cuc gi, ngi s dng khng c cch no bit c trng thi ca qu trnh thit lp cuc gi m vn d qu quen thng qua cc ting nghe c (ting tt ngn, tt di,..). 86

Chnh v l do , m mt lung RTP c thit lp sm trc khi phin media cho cuc gi c thit lp truyn trng thi c tr v ca tng i thng bo v trng thi thit lp cuc gi cho ngi dng. chnh l lung RTP c thit lp sau bn tin ACM ca mng SS7 v s cha ting chung thu c trn ng trung k (trong giao thc cuc gi ca RFC). Khc so vi cuc gi c nh ngha ca RFC c trnh by trn, cuc gi ca chng ta c thc hin trn ng dy thu bao nn s s dng bo hiu in-band (DTMF, 1VF,). Do , qu trnh thit lp lung RTP s khng ch khi nhn c bn tin ACM m s thc hin ngay sau khi quay s xong trn ng thu bao. Do , nn ta s nghe thy c hai ting bo hiu t tng i. Th nht, l ting tt ngn v nhanh bo rng ang thc hin nh tuyn cuc gi. V th hai, l ting tt di bo hiu ang rung chung thu bao PSTN c pht t tng i ca thu bao b gi trn ng trung k.

87

KT LUN Qua vic nghin cu v mng VoIP, em nhn thy c c hi v hng pht trin ca n trong tng lai. Vic pht trin da trn cng ngh VoIP khng ch mang mt tnh cht kinh t, x hi to ln m cn l mt c hi rt ln Vit Nam c th c mt sn phm mang tnh chin lc v hon ton kh thi nu c u t ng hng. Cc giao thc VoIP c cp ti trong bi Lun vn tt nghip l ht sc c bn nhng kh y v ton din. Bi lun i su tm hiu nhng vn ht sc c bn v m rng vi nhiu gc cch v cch nhn khc nhau ca ngi xy dng mng. Sau khi hon thnh ni dung bi lun ny, em hc hi c rt nhiu v chp ni kh tt cc kin thc c hc trn lp v mng vin thng, v cc giao thc c bn. N gip em pht trin phng php lun, cch t vn v gii quyt vn . Do hn ch v thi gian, khun kh ca bi lun cng nh kinh nghim thc tin ca em cha nhiu nn khng trnh khi nhng sai st v nhng nhm ln. Nn s ng gp ca thy c cng cc bn khng ch gip bi lun ca em c cht lng cao hn m cn trang b cho em mt kin thc vng vng hn trong nghin cu v cng tc sau ny. Em xin chn thnh cm n!

88

TI LIU THAM KHO [ 1 ] Alan B.Johnson. SIP Understanding The Session Initiation Protocol. Artech House [ 2 ] Jonathan Davidson, James Peters, Manoj Bhatia, Satish Kalidindi, Sudipto Mukherjee. Voice over IP Fundamentals, 2nd Edition. Cisco Press [ 3 ] Henry Sinnreich, Alan B. Johnston. Wiley Internet Communications Using SIP Delivering VoIP and Multimedia Services with Session Initiation Protocol [ 4 ] Morgan Kaufmann. Network Routing Algorithms Protocols and Architectures [ 5 ] RFC 3261. SIP - Session Initiation Protocol [ 6 ] RFC 3372.Session Initiation Protocol for Telephone [ 7 ] RFC 3550. RTP: A Transport Protocol for Real-Time Applications. [ 8 ] RFC 3666. Session Initiation Protocol (SIP) Public Switched Telephone Network (PSTN) Call Flows [ 9 ] RFC 3959. The Early Session Disposition Type for SIP [ 10 ] RFC 3960. Early Media and Ringing Tone Generation in SIP [ 11 ] RFC 4166. Telephony Signalling Transport over Stream Control Transmission Protocol (SCTP) Applicability Statement [ 12 ] RFC 4960. SCTP transport SIP

89