TCP Headers thiab UDP Headers piav qhia

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:

  1. Qhov chaw TCP qhov chaw nres nkoj (2 bytes)
  2. Lo lus zais hauv npav TCP chaw nres nkoj (2 bytes)
  3. Tawm xov tooj (4 bytes)
  4. Kev Lees Txaus (4 bytes)
  5. TCP cov ntaub ntawv offset (4 khoom)
  6. Cov ntaub ntawv khaws tseg (3 seem)
  7. Tswj chij (txog 9 khoom)
  8. Qhov rai loj (2 bytes)
  9. TCP checksum (2 bytes)
  10. Ceev pointer (2 bytes)
  11. 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.

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:

  1. Qhov chaw nres nkoj naj npawb (2 bytes)
  2. Lo lus chaw nres nkoj (2 bytes)
  3. Ntev ntawm cov ntaub ntawv (2 bytes)
  4. UDP checksum (2 bytes)

UDP nkag mus rau hauv nws cov lus taw qhia hauv cov lus teev tseg saum toj no.