Kev Kuaj Cov Kev Tiv Thaiv Kev Tiv Thaiv (TCP) thiab Tus Neeg Siv Cov Ntawv Teev Npe (UDP) yog ob daim qauv kev siv cov txheej txheem hauv Internet (IP) .
Ob TDP thiab UDP siv cov hau kev ua ib feem ntawm cov lus qhuab qhia cov ntaub ntawv xa mus rau cov kev sib txuas sib txuas network. TCP headers thiab UDP headers txhua tus muaj cov txheej txwv tsis zoo hu ua cov lus teev tseg los ntawm tus qauv kev cai.
TCP Header Hom ntawv
Txhua lub npoo TCP muaj kaum qhov yuav tsum tau ua kom tag nrho yog 20 bytes (160 khoom ) loj. Lawv tuaj yeem xaiv tau nrog cov lus qhia ntxiv txog 40 bytes ntawm qhov loj.
Qhov no yog qhov layout ntawm TCP hau:
- Qhov chaw TCP qhov chaw nres nkoj (2 bytes)
- Lo lus zais hauv npav TCP chaw nres nkoj (2 bytes)
- Tawm xov tooj (4 bytes)
- Kev Lees Txaus (4 bytes)
- TCP cov ntaub ntawv offset (4 khoom)
- Cov ntaub ntawv khaws tseg (3 seem)
- Tswj chij (txog 9 khoom)
- Qhov rai loj (2 bytes)
- TCP checksum (2 bytes)
- Ceev pointer (2 bytes)
- TCP xaiv cov ntaub ntawv (0-40 bytes)
TCP siv lub hau header mus rau hauv cov lus xov xwm nyob rau hauv qhov kev txiav txim teev tseg saum toj no.
- Qhov chaw thiab qhov chaw TCP chaw nres nkoj yog qhov sib txuas lus rau kev xa thiab txais cov khoom siv.
- Cov xa xov xa mus siv cov cim naj npawb cim lub npe ntawm ib pawg lus. Ob tug neeg xa ntawv thiab cov neeg tuaj yeem siv cov cim qhov lees paub los mus sib txuas lus txog cov lus sib lawv liag uas yog nyuam qhuav txais lossis xav kom xa tuaj.
- Cov ntaub ntawv offset teb stores loj tag nrho ntawm tus TCP header nyob rau hauv ntau ntawm plaub bytes. Ib tug header tsis siv thaj tsam ntawm TCP yeem muaj cov ntaub ntawv offset ntawm 5 (sawv cev 20 bytes), thaum lub hau uas siv qhov chaw siab tshaj plaws xaiv teb tau muaj ib cov ntaub ntawv offset ntawm 15 (sawv cev 60 bytes).
- Cov ntaub ntawv khaws tseg hauv TCP headers yeej muaj nuj nqis ntawm xoom. Daim teb no ua rau lub hom phiaj ntawm kev sib tw ntawm tag nrho cov loj sib npaug raws li ntau yam ntawm plaub bytes (tseem ceeb rau kev ua haujlwm ntawm cov ntaub ntawv siv computer).
- TCP siv cov txheej txheem ntawm 6 tus qauv thiab peb cov cai tswj ntxiv (txhua tus me ntsis sawv cev lossis tawm ) los tswj cov ntaub ntawv nquag hauv qee lub sijhawm. Ib tug ntsis chij, piv txwv li, pib TCP kev twb kev txuas pib dua logic. Cov ncauj lus kom ntxaws txog cov hauj lwm no dhau mus tshaj tawm qhov ntawm tsab xov xwm no.
- TCP xaib siv ib tug lej hu ua qhov rai me me kom tswj tau cov ntaub ntawv ntau npaum li cas lawv xa mus rau tus neeg txais khoom ua ntej yuav tsum tau muaj kev lees paub rov qab. Yog tias qhov loj me me tuaj, cov ntaub ntawv xa mus rau lwm lub network yuav tsis tas yuav qeeb, txawm tias qhov loj me me loj tuaj, qhov txuas ntawm qhov txuas tuaj yeem ua rau (tsis siv rau lwm daim ntawv sau npe) lossis tus neeg tuaj yeem xa tsis tau cov ntaub ntawv xa tuaj sai txaus (kuj ua rau kev ua qeeb). Qhov ntsuas algorithms ua rau hauv raws tu qauv dynamically xam qhov loj qhov tseem ceeb thiab siv qhov hauj lwm ntawm TCP cov thawj coj los tswj cov kev hloov ntawm cov xa thiab cov neeg txais khoom.
- Checksum tus nqi hauv ib lub taub hau TCP yog tsim los ntawm tus neeg sawv cev kev xa ntawv raws li txheej txheem kev ua zauv los pab tus neeg txais ntawv tau txais cov lus uas muaj kev puas tsuaj los yog cuam tshuam nrog.
- Qhov chaw pointer sai yog feem ntau teem rau pes tsawg thiab tsis quav ntsej, tab sis nyob nrog nrog ib tus chij tswj, nws yuav siv los ua cov ntaub ntawv offset rau suam npe ntawm cov lus tshaj tawm ua qhov tseem ceeb ua ntej.
- Kev siv ntawm cov ntaub ntawv yeem TCP mus tshaj li qhov ntawm cov tshooj no, tiam sis kuj muaj kev txhawb nqa rau kev lees paub tshwj xeeb thiab qhov rais scaling algorithms.
UDP Header Format
Vim tias UDP muaj peev xwm ntau dua rau hauv kev muaj peev xwm dua TCP, lawv lub hau me me. Ib tug UDP header muaj 8 bytes, muab faib ua plaub yam nram qab no:
- Qhov chaw nres nkoj naj npawb (2 bytes)
- Lo lus chaw nres nkoj (2 bytes)
- Ntev ntawm cov ntaub ntawv (2 bytes)
- UDP checksum (2 bytes)
UDP nkag mus rau hauv nws cov lus taw qhia hauv cov lus teev tseg saum toj no.
- Chaw thiab qhov chaw UDP chaw nres nkoj yog qhov sib txuas lus rau kev xa thiab txais cov khoom siv.
- Lub sijhawm ntev hauv UDP nruab nrab yog tag nrho qhov loj ntawm txhua daim duab nrog rau ob lub hau thiab cov ntaub ntawv. Cov kauj av no yog qhov tseem ceeb ntawm qhov tsawg kawg yog 8 bytes (qhov yuav tsum tau muaj qhov taub loj) rau ntau tshaj 65,000 bytes.
- Zoo ib yam li TCP, UDP checksum pub rau cov neeg tuaj yeem xa cov ntaub ntawv xa mus rau cov khoom puas ntawm cov xov xwm.