• m Linux pЉ|
    osGAзR firefox s
    | cD | ̔D | g | A | ~R | ୱR | w޲z | QAO | Ŏ | y`~ | m | Xs |
    @ @ @
    @
    ̪sG2011/07/15
    AAObWӴѪAȪAҥHApGSΪ̬OqAAASMO^ӵLΪZaTI ~AAWAȳOΨӹFYںqTwAHѬ۹RAȦӤwCҥHoA ASMonDoӳ̰䪺yA_hASAAȥX{DɡAAMp󶒨M[HzaI o̭nO TCP/IP P OSI Chw}yFAoܡܡ bo@ؤAmHfy覡Ӥoǰ[cAƱaBֳ̧ͭtAOC SMAQnA}\઺ܡA好ѦҸƥiHѦҬݬݳI ^_^


    jADϥ2.1 OӤ򪱷N

    @ɪHRܦhAHϥΪyR]hܡCpGAQn~HqɡAFُ}~AAnpܡH jyuR覡oA@ROjLA@RhOڭ̎LyAoˤ~෾q[Cbثe@ɤWjջyROݩ^ytaA ҥHoAެOԣHRAunn^Aja^AN^qFCƱ椣[ӡA̪^jջy[I

    o[W]O檺qA@ɪ@~thܡAOu Windows/Linux ӤwARīGqۤv@~tA Unix like @~t]D`hIh@~t (HR) npiq (y) OHNonq@PuAǤ~FCoӊAǬOѰœ´WdAAṱunѥiH[JMAǪ{XA AN^zLoӊAǻPLti淾qIҥHoAOwxAäOu Linux ~o򰵡I]AoƧAAOiHRΦbҦ@~tWI[ۦP[I

    t~Ao@ӏظ`bfsAHֳtiJ@ɡAҥHmgL@ǨǡA򥻤WA R@ͺwPqTwèSQ]tboguYCpGADwg@Lظ`A ЦۦѧMAXAۤvyӾ\ŪISMAA]iHbںWAһݭnơC bس̫᪺ѦҸiH@@@oI


    pADϥ2.1.1 O

    ڭ̳DANOXqDEΪ̬OLEP]QA zLuΪ̬OLu޳NANoǥDEP]Qs^_ӡA ϱoƥiHzLC(uHΨLdεw)ӶljK@R覡C ЧAQ^@UApGAa̭uqBLEBǯuEEAoSs^oǵwA ϥΤW||ꐷСHpGNoӳݭnu@줽ǮɡA qƵLkϥκs^LEӦCLAO_ܶ˸OH aIηQN\oꐷЧaIOAoꐷШƦb 1970 ~NHeATOsb[I

    • U۬FywPnz޳NoiG Ethernet & Token-Ring

      b 1970 ~NeAFMoӷФHƶljKDAUDnT}qbsU۪s^޳NA HϦۮa~iHb줽Ǫ쩳Uœ´_ӡC䤤WNOq Ethernet ޳NA H IBM o Token-Ring ޳NFCOoǧ޳NӫܤjDANO̩{ѹ誺޳NI ]NOAU@A줽ʶRFX Ethernet ޳NqDEAOLqoOϥ IBM EɡA Qnbo̤iƪqAbӻOi઺C

    • Hynz޳NNwXG ARPANET & TCP/IP

      FMWzwX\AҥHb 1960 ~N꨾N}ls@iHboǤPwWB@n޳NA ϱoPqqθƥiHzLoӳnӹFƷqCoӬsѬ꨾yݬsep (Defense Advanced Research Project Agency, DARPA) tdAḺNMt٬ ARPANETA oөNNNOثe TCP/IP ޳NMΤFIb 1975 ~kA ARPANET wiHb` Ethernet P Token-Ring εw饭xUqƤFCDARPA b 1980 ~X TCP/IP ޳NA ѩQni޳NA]PfJ (Berkeley) jX@AN TCP/IP ĤJۦW BSD Unix tA ѩjDOӤH~ƮwiBAҥHA TCP/IP o޳NKl޶VӶVhϥΪ̪JA oRs^޳N]Q٤ Internet (1)C

    • SkںG Internet

      {bڭ̪D Internet NOϥ TCP/IP s^޳NҦp_Ӫ@Ӻ@ɡA ӳo Internet b 1980 ~Nѩ email ݨDHsϧΤ_A]ֳtYbq@ɤC OA Internet SHb޲z[HܤOA Internet O@Ӻ޲zSPҦbC unA^ϥΥ䴩 TCP/IP ޳NwP@~tAåBڳs^WA ANiJ Internet @ɤFCbM@SASkO@AAڸƦpG^W Internet A bɨݭnۤvO@ۤvAKoFyyuzӨ˔[I

      ƻ Internet SkOHoO] Internet ȬOѤ@Ӻs^A ҥHAuns^W Internet A@ɳiHACCAL]]pAywzӨӪ@NF̔xƥA ̔xAxWk߶ȾAΥxWaϹaHOqǫ (cracker) iHb~zL Internet ADEi@A ڭ̪kߥiޤ~aϔ[IMiHzLܦhں޹DӴMDUALAROUAr⪺[C ]oAbADEnsW Internet eAХ߰ݦۤvAuݭnsW Internet ܡH^_^

    • nwAǨw\aӪvTG IEEE AdzWd

      {bڭ̱``oyAnW[IAnhRdIRons^ Internet ~[Iz oӺdNOWHBi@ӤdӤwAܩ Internet hOhV Hinet/Seed net LAȴѤq (Internet Service Provider, ISP) ӽЪbKXC DOAO_NuzLdP Internet ~W[HISMOILPwPnihۨI LA̦\oOAӺ (Ethernet) P Internet AoOƻOHo̪޳NnܡH SMOIoO]o̳QyAǡzҤ䴩tG(2)C

      AӺ̪Oѥq (Xerox PARC) ҫغcXӪAӫzL DEC, Intel P Xerox X@NAӺAǤơC Ag IEEE (Institute of Electrical and Electronic Engineers 3) oӰڵۦWM~œ´QΤ@ 802 MרwXAǡAᦳ 19 aqŧG䴩 IEEE ҵo 802.3 AA åBF 1989 ~ڊAœ´ ISO (International Organization for Standard) NAӺsJ IS88023 AǡA IoܤAӺwgO@{AǤFAp@ӡAjaiH̾ڳoӊAǨӳ]wP}oۤvwA unwŦXoӊAǡAzAWALN^[JAӺ@ɡAҥHAʶRAӺɡA ȻݭndݳoӤAӺd䴩NJAǴN^Doӵw骺\঳ǡA ӤDoӤAӺdOѭaqһsyoC

      Tips:
      AǯuOӫܭnFAunPՏoǺ@AǪM~œ´CSqQn}oswɡA iHѦҊAœ´ҵoP@ơAzLoǤƫAMqNDns@wݭnŦXNJAǡA Pɤ]Dp]poǵwAiHyۮezثeEAϥΪ̤|LҾAq[C ]An]AǡA Linux b}oɴNOzLF POSIX oӊAǨӳ]p֤ߪA ]ϱo Linux WiHjhӋAǤnOIAAAǬO_uܭn[I
      mϥ
      Fw餧~ATCP/IP o Internet qTw]OAǪAoNJAǤjH RFC (Request For Comments, 4) ΦoGAǤC zLoǤ󪺻UAHun|g{yܡANioiXۤv TCP/IP nA åBs^W Internet C Linux Fns^W Internet ALinux ᔴNۤvgX TCP/IP {XA zLNOoǰ󪺊AǨ̾ڔ[I|Ҩӻ RFC 1122 (5) oӫijNX@ǥiHsu Internet DERMn`N}wP򥻻ݨDA Qngsu{]pviH@ӫުAǤVC

    pADϥ2.1.2 qœ

    ^UӡAڭ̨ӽͽͨœq󦳭ǩOHoǤ󪺩wq[Hڭ̱onDǵwI ^UӤ~nz[Cbo̡Aڭ̥HUoisuܷNϨӶnFG

    qsuܷN
    2.1-1BqsuܷN

    bWϤAڭ̥Dnݭn`N쪺w馳ǩOHjPUoTG

    • `I (node)G`IDnO㦳} (IP) ]Q١A ]Wϥܤ@PCBLinuxABADSLӋEPLEΡAӧOiH٬@ node I ӗu (hub) OO`IOH]L㦳 IP A] hub O`IC

    • ADE (server)GNsuVӻAѸƥHy^RzΤ᪺DEA iHQ٬O@AC|ҨӻAYahoo O WWW AAXs FTP (http://ftp.ksu.edu.tw/) OɮצAΆΡC

    • u@ (workstation) ΥΤ (client)GiHbqKJ]QiHOu@A YHsuo_VӻADʵo_suhynDzƪANiH٬OΤ (client)C|ҨӻA@ PC }s Yahoo nDsDơA@ PC NOΤݡC

    • d (Network Interface Card, NIC)GةΪ̬O~AbDEW@ӳ]QA DnѺsudAثejϥΨ㦳 RJ-45 ^YAӺdC@ node W㦳@ӥHWdA HFsu\C

    • GQγn]pXӪADnbѺ} (IP) ȡC @idܤ֥iHft@ӥHWFӨCDE]֦@ӤANO loopback (lo) oӰjI

    • κAΩݾ (topology)GUӸ`IbWs覡A@Ozs^覡C |ҨӻAWϤܪO@RQ٬Pγsu (star) 覡ADnOzL@Ӥs^]QA Hg覡s^UӸ`I@RκAAoNO@RݾC

    • } (route) γqTh (gateway)G㦳ӥHWA iHs^ӥHWPq]QAҦp IP ɾNO@ӱ`}]QCW ADSL ӋE⤣}OH ӯA]ӋEq`@ӦbDEd]QAڭ̥iHb@ PC WzLDnA NӋE[@id (ppp) A]LӯO}]QTI

    ]QD`h]D`zALpGHp~רӬݡAڭ̯^AWzϥܤU]QARM]^oI ^UӡAڭ~ӰQA@Ud򪺤jpaI


    pADϥ2.1.3 qkd

    ѩUӸ`IZmPAsuuP覡]ҮtAѩut]fPtתPARΤV]@ˡC ھڳoǮtAڭ̲ߺDNjpdwqpUG(6)

    • k (Local Area Network, LAN)G
      `IljKZmAҦp@ɤjӤAΤ@ӎժհϤCiHϥθQsuơA Ҧp֩άO@~u (CAT 6) ΡCt׸֡Asu~ΥBiaA]iRΩB⪺OtB tBݭttΡC

    • sk (Wide Area Network, WAN)G
      ljKZmhAҦpPZmA]ϥΪsuCݭnKy]QAҦpg`ϥΪqܽuNO@ҡC ѩu~tA]t׸CBiaʸC@ǡARΤ譱jh email, FTP, WWW sΥ\C

    FoӤ~ARҿת| (Metropolitan Area Network, MAN)ALӤִΡA]AunD LAN WAN YiCoӦWbܦhaAiHݪIѧA^aݬݧAa ADSL ӋE IP ɾ᭱AլݬݡAAN^ݨ즳 WAN P LAN AաA{bANDԣoӿOPAդFaC

    @ӻALAN OkdpAҦp@ɤjөΤ@աAҥHbڭ̥ͬPD۳\\hh LAN sbC o LAN ^b@_A LAN b@NO@Ӥj WAN oI̔xANOoˤC

    LA{bHe@ˤFA|ҨӻAeXѭť (2011/07)A֪tפwgiHF 100Mbps/10Mbps U/WWeFIA|ҨӻAxWNqqOb@AmbxnXssu@ӸqujU CentOS M^ɮɡAAqUtצh֡HCi@F 100Mbps kIowgO@ӤϺtפFIҥHAΥHe[IӬݡA ثe즳IŲ{HFC]AثeAiHϥΡytסz@@Ӻkd򪺵qC γ\{bڭ̥iHAӥxWN (TANET, 7) iHO@ӰkOI


    pADϥ2.1.4 qqTwG OSI Chw

    ͧFݭnqAǡBsuHκd򤧫A^UӴNOnAUӸ`IOp󷾳qTOH NOzLAǪqTwTIOAӺs^L{SzA]AwBnƫʥ]PRε{۳sΆΡA pGQng@Np\ೣsb@{ASYӤp`X{DɡA㰦{ݭng[IuꐷСI

    HS}YAڭ̥iHNӺs^L{Ӌ피h (layer)AC피hSOWߪ\A ӥBC피h{XiHW߼gA]C피h\ä|ۤzZC p@ӡASYӤp`X{DɡAunNMhŪ{XsgYiCҥH{g]eAӺy]NMI NOثeA`o쪺 OSI Chw (Open System Interconnection) yoI

    pGHϥܨӻAoC피h}ʦI^UoˡG

    OSI ChwU피h}
    2.1-2BOSI ChwU피h}

    ̾کwqӻAV^w骺피hh (layer 1)AV^Rε{hO@h (layer 7)C AO^ROoeݡACӤ@피hu{ѹ誺P@피hC ӾӶǰeL{Nn^H̦bHCڤ@Aڭ̳zLRε{NƩJĤCh]qAANĤCh]qĤh]qA ̧Ǥ@Ĥ@h̤j]qAMǰeXh^ݡC^ݪDENoѲĤ@ӥ]q}lA̧DZNCӥ]q}A M@Ӥ@ӥ浹Rtd피hӵԎIoNOHC...IO OSI Chwb피hwq譱ݭn`NSC

    JMO]qAڭ̳DA]q|ӭnTAoǸT]AӦ̡ۭBnh̡B^̬OֆΆΡA ӥ]q̭~OuơCP˪AbChwACh|ۤvWSY (header)Aio̭TOA ӯuƴNbYoIڭ̥iHϥΦpUϥܨӪܳoChC@hWrAHθƬOpmC@h]qG

    OSI Chwƪǻ覡
    2.1-3BOSI Chwƪǻ覡

    WϤJNݨCӸƥ]AWh]qOJUhƤAӸƫehOoӸƪYC䤤SOĤGhA ]ĤGh (h) DnOnʥ] (packet) HεwT (frame) @피hA LnNn]U]qJw^Bz]qA]o피hSӤlhbBz۹RơC ]SAҥHz@@AĤGhƮ榡@˳ARX{@ˬdX

    C@피hҭtdȬOOH̔xAC@htdȦpUG(6, 8, 9)

    htde
    Layer 1
    h
    Physical Layer
    ѩCuǰe 0 P 1 oR줸A]hwqҨϥΪC]QqPTΡA PRAưT茦줸ꪺsX覡A̫s^Cöǰe/^줸C
    Layer 2
    h
    Data-Link Layer
    o@hOS@피hA]UO骺wqAӤWhhOnʗUwqC]ĤGhSӤlhbiƪ茂ʧ@C bwCADntdO MAC (Media Access Control) Aڭ̺ٳoӸƥ]q MAC T (frame)A MAC OCүBzDnƥ]qAo]O̜QhsX줸ꪺơCMAC ngѳqTwӨoC骺ϥvA ثe̱`ϥΪhO IEEE 802.3 AӺwCN MAC PAӺаѦҤU`C

    ܩ󰾦Vn骺hO޿sh (logical link control, LLC) ұADnbhuBzӦۤWhʥ] (packet) 茦 MAC 榡A tdu@]ATByqB~DBzΆΡC
    Layer 3
    h
    Network Layer
    o@hOڭ̷̳PêoA]ڭ̴Ϊ IP (Internet Protocol) NObo@hwqC Pɤ]wqXqsuإߡBPΡAƫʥ]ljK|܆ΆΡA]oӼhS̭nF IP ~ANOʥ]_Fتa (route) yFI
    Layer 4
    ǰeh
    Transport Layer
    o@ӤhwqFoeݻP^ݪsu޳N(p TCP, UDP ޳N)A Pɥ]AM޳Nʥ]榡Aƫʥ]ǰeBy{BljKL{ˬdP_쭫sǰeΆΡA HTOUӸƫʥ]iHTL~FتݡC
    Layer 5
    |ͼh
    Session Layer
    boӼhSDnwqFӦ}suqDs^P_A~AiإRε{͡B ѨL[jAȦp޲zBññhBͤΆΡCpGǰehObP_ƫʥ]O_iHTF؊AA |ͼhhObTwAȫإ߳suT{C
    Layer 6
    {h
    Presentation Layer
    ڭ̦bRε{Wһs@XӪƮ榡@wŦXljKAǽsX榡I ҥHAboӼhSADnʧ@NOGNӦۥaRε{Ʈ榡茂(Ϊ̬OssX)AǮ榡A MA浹UǰehΪwӶiBzCҥHAboӼhŤWDnwqOA(ε{)Ʈ榡茂A ]Aƪ[K]OboӤhWBzC
    Layer 7
    Rμh
    Application Layer
    RμhäݩRε{ҦAӬObwqRε{piJhqAHN^ζǰeRε{A̜iܵϥΪ̡C

    WA OSI ChwuO@ӰѦҪҫ (model)Aثe|èSܪW@~tbϥ OSI Chwp{XC...ohFHoO] OSI ҩwqXӪChwbljKpӻA iHD`ΡA]ja OSI ChwӰPyzCܩڪp{XAN浹 TCP/IP oӪNaI


    pADϥ2.1.5 qqTwG TCP/IP

    M OSI Chw[cD`YԡAOߺnơCO]NO]ӹLYԤFA]{gSeA ҥHyboiWdz\xZCӥ ARPANET oiӨӪ TCP/IP SpOH TCP/IP ]Oϥ OSI Chw[A ҥHP˨㦳h[cAuON̔Ƭ|hAbcWSoYԡA{g|eǡCӦb 1990 ~Nѩ email, WWW yAy TCP/IP oӊAǬja^Ao]yNثeڭ̪|oI

    JM TCP/IP O OSI Chw̔ƦӨӡAo̤S}ʩOH̪}ʥiHϥܦpUA Pɳo̤]CXثebo[cU`qTwBʥ]榡P}AǡG

    OSI P TCP/IP w}
    2.1-4BOSI P TCP/IP w}

    qWϤAڭ̥iHo{ TCP/IP NRΡB{B|ͤThX@RμhAbRμhWiH@{w HTTP, SMTP, DNS ΆΡC ǰehhSܡAL̾ڶǰeiaʤSNʥ]榡s^fV TCP ΫDs^fV UDP ʥ]榡Ch]SܡADneOѤF IP ʥ]AåįܳθѨӨF؊A IP }ChPhhX@hA]AwqwTB T茦줸ꪺsXΆΡA]DnPw (AOϺROsk) }C

    TCP/IP OpB@OHڭ̴Np``sW Yahoo JfӰӻnFAӳsuAiHoˬݡG

    1. Rε{픬qGp}sAbsWKJ}CAU [Enter]Cɺ}CP}Ʒ|Qs]@ӸơA æVUǵ TCP/IP RμhF
    2. RμhGRμhѪ HTTP qTwANӦsƥ]_ӡAõ@RμhYAAVǰehhF
    3. ǰehGѩ HTTP iasuA]NMƥJ TCP ʥ]Aõ@ TCP ʥ]YAVhhF
    4. hGN TCP ]q]i IP ʥ]AA@ IP Y (DnNOӷP؊A IP o)AVhhF
    5. hGpGϥΤAӺɡA IP |̾ CSMA/CD AǡA]q MAC TؤAõ MAC YAA茦줸A QζljKCǰehݥDEWC

    Ψ Yahoo A]qAb̾ڬۤϤV}ӡAM浹RhŶiRA̫N Yahoo WWW AnoAҷQnơAMAnAھڧAnDAoTƫAS̴`Wzy{A@h@h]U_ӡA ̫ǰeAWINOooI

    ھڳo˪y{Aڭ̴NonDCӤhһݭnA䪾ѡAoˤ~ߺIҥHUڭ̷|̾ TCP/IP hBhBǰehӶi满ARμhwhbظ`RwAӽoIPɧڭ̤]DA C@ljKƶqOA]pGnQljKƤӤjɡAڭ̦bh]UANonNƥ}줣P]qA A]q@ӧǸAnتݪDE^]ѳoǧǸAsNƾX^ӡIܦçaI^UӴNڭ̤@h@hӤoI

    Tips:
    @ӻA]Rε{P{]pv}YAӺhHUƫhDnO@~tѪA]A ڭ̤SN TCP/IP SRμhϥΪ̼hAөUTh~Oڭ̥DnͤΪIҥHoӏظ`DnNOoThTI
    mϥ

    jADϥ2.2 TCP/IP h}w

    TCP/IP ̩hhDnPw}YA]Uڭ̥Dn@ WAN P LAN wC Pɷ|}ln CSMA/CD AӺwAHά}wP MAC Tخ榡ΡCN}lӃԃoI


    pADϥ2.2.1 skϥΪ]Q

    b 2.1.3 `ڭ̦LAskϥΪ]QCGC LskϥΨ쪺]QD`hA@Τq`|^IJ쪺DnO ADSL ӋEΪ̬O֨jHAHβĥ|x Cable eWΡCbo̧ڭ̥@Ǥ`]QApGHAE|^IJL]QAAЧA̾ڻݨDۦd\}yaI

    • DžqܔD^GzL ppp w

      jyuzLӋE[WqܽuHιqEwǦC (He^ƹηn쪺A)AMzL Point-to-Point Protocol (PPP w) tXD^{Өo IP ӋAo˴N^WFCLo˪t׫D`CAӥBSqܔD^A N^qܤFI] PPP 䴩 TCP/IP, NetBEUI, IPX/SPX γqTwAҥHϥΫ׫D`sI

    • XAӋ (Integrated Services Digital Network, ISDN)

      ]OQβ{qܽuӹFsuتAuOsuݳݭn ISDN ӋEӴѳsu\C ISDN ljKhRqDiѨϥΡAåBiHNhӳqDXRΡA]tץiHC򥻪 B qDt׬ 64KbpsA pWϥ 23 ӥHWqDӹFsuAɳtץiF 1.5Mbps kCLxWoN֨C

    • DӋθ^ (Asymmetric Digital Subscriber Line, ADSL)GzL pppoe w

      ]OzLqܽuӔD^o IP @ӤkAuLoӤ覡ϥΪOqܪ@WAP@qܪWvPC ]piH@ϥ ADSL WPɳzLP@ӹqܸXӥq܃ԤѡCbxWAѩW/UWePA ]~٬D٪^CADSL P˨ϥӋEAuOLzLO PPPoE (PPP over Ethernet) kI N PPP [bAӺdWA]ADEݭnzL@idӳs^ӋEAózLD^{Өos (ppp0) I

    • luӋE (Cable modem)

      DnzLuq (xWҿתĥ|x) ϥΪlu@TCAP˻ݭnQӋEӳs^ ISPAHoӋӤWC Cable modem WeDnOɫAҥHq`㦳kʡAäOAQUNUI

    pADϥ2.2.2 kϥΪ]Q-AӺ

    bk줤Aڭ̳̱`ϥΪNOAӺCSMTAbYǶW@tRΪ줤A Ri|ΨSQֳqDCuOpPe쪺AAӺ]wgAǤƤFA]Q]mOά۹CGA ҥH@A|o줰uΪ̬OCAXGOϥΤAӺӬ[]TI uOoROnzAӺ@ɨëDȦAӺoӵw餶I WAQAӤAӺoiAijAiH^ѦҭHlPiHꑮ ySwitched & Fast AӺz@ѡAMѤeSáAAX\ŪoC Uڭ̶Ȱ̔xӤwC


    • AӺt׻PA

    AӺyDnOڤ{AǩҭPC IEEE ҨqAӺAǬ 802.3 IEEE 10BASE5 AoӊAǥDnwqOGy10 NljKt׬ 10MbpsABASE ܱĥΰWHӶiljKAܩ 5 hOCӺ`I̪iF 500 ءCz

    ѩljKTNO 0 P 1 [A]AƶljKx쬰Ch bit A YO M bits/second, Mbps NC򬰦q 10Mbps OH oO]uskHά}s@kARAӺds@޳NäOܦnA [WSɪƶljKݨDèS^{bo@AҥH 10Mbps wgiHŦXjhӋHݨDFC

    Tips:
    ڭ̬ݨ쪺Ѫ (Internet Services Provider, ISP) ҫź٥L̪ ADSL ljKtץiHF U/W 2Mbps/128Kbps (Kbits per second) ɡA Kb iO bytes ӬO bits IҥH 2M/128K bڪɮפjpljKtפWA̤jzAljK 256KBps/16 KBps(KBytes per second)AҥH`Ut׬bC 100~200 KBytes oI P˪DzAbdΪ̬O@ǺC骺siWAL̳|ź٦ۤv~iH۰ʃ~ѶljKt׬ 10/100 Mbps ( Mega-bits per second)AIMӋROoAH 8 ~Oڭ̤@`Ϊɮ׮eqp⪺x bytes I
    mϥ

    uϥΪOHPbqluAoRub{bXGwgݤFCӥNODžqܽuUu (Twisted Pair Ethernet) AIEEE ñNoRuAӺljKkq 10BASE-T AǡC 10BASE-T ϥΪO 10 Mbps tB@BĥεLBUu (UTP) uC~A 10BASE-T UTP uiHϥPγsu(star)A ]NOH@ӗuߨӦsU]Q@ӤkA 2.1-1 NOPγsu@ӥܷNϡC

    P󦭴H@PbqlusҦq bus suAzLPγsuDUA ڭ̥iH̔x[UL]QΪ̬OL]QAӤ|LUmvTAo]QXRʻPhӻA O@SΪ]pI]] 10BASE-T AӺ]QPBjT@[I

    IEEE qF 802.3u oӤ䴩 100Mbps ljKtת 100BASE-T AǡAoӊAǻP 10BASE-T tjA uOUuus@ݭn}APɤ]wg䴩ϥΤF|ﮔuuFA ]NOثeܱ`KuoIoRuڭ̱`٬ίŤ (Category 5, CAT5) uC oRljKtתAӺNQ٬ Fast ethernet Cܩثeڭ̱``o쪺 Gigabit t 1000 Mbps SOoHNO Gigabit ethernet IuO Gigabit ethernet uNݭn[}C

    Wt
    AӺ(Ethernet)10Mbps-
    @tAӺ(Fast Ethernet)100MbpsCAT 5
    W@tAӺ(Gigabit Ethernet)1000MbpsCAT 5e/CAT 6

    CSljKt׼W[ɡAunDNYOHoO]SljKt׼W[ɡAuqϮRۤzZ|WjA ]bus@ɴNoݭnSO`NuƥHΤuߤB¶ptmΡA HϹqlyqϤzZ̤pA~϶ljKt״ɨR Gigabit C ҥHAbAӺ@SApGAQnɭ즳 fast ethernet gigabit ethernet ܡA FdݭnɯŤ~ADEPDEuA Hγs^DEuu/ΡAnɨiH䴩 gigabit t׆ίŪ]Q~I


    • AӺu^Y (tu/u)

    eAt׻PuO@w{ת}ʪAu^YSO˩OH ثebAӺW̱`쪺^YNO RJ-45 ^YA@K^YAI^ODFqܽu^YA pUҥܡG

    RJ-45 ^YܷN
    2.2-1BRJ-45 ^YܷN

    RJ-45 ^YS]CuRPӤ 568A P 568B ^YAof^YuRpUG

    ^YW\u12345678
    568AպվՌմ
    568BվպՌմ

    WAMثeAӺuKB⦨AڨϥΪu 1,2,3,6 ӤwA LhOYǯSγ~X~|ϥΨCѩDEPDEsuHΥDEPusuɡA ҨϥΪu}wqäۦPA]ѩ^YPuSiRG

    • tuG@䬰 568A @䬰 568B ^Yɺ٬tuAΦb^sDEdC
    • uG^YP 568A ΦP 568B ɺ٬uAΦbsDEdPuuF

    pADϥ2.2.3 AӺljKwGCSMA/CD

    ӤAӺߴNOAӺdTIҥHAAӺljKDnNOddƶǻӤwC CiAӺdXtɡAN|Y@ӿW@LGdANOҿת MAC (Media Access Control) TI zAWAddOק諸ALYǓ۰OqddO^ק諸I AӺdƬOpljKOHNonͤ@U IEEE 802.3 A CSMA/CD (Carrier Sense Multiple Access with Collision Detection) FIڭ̥HUϨӧ@̔AUϤIuA UӥDEOsu엝uAMzLu\VҦDEo_suC

    CSMA/CDsuܷN
    2.2-2BCSMA/CDsuܷNϡA A oeƵ D ɡA`NbYV

    uO@R@ɴCAO@ɴC[HQ^@UWzN^@ӤQrfAӗuNOӸfI oӸf@u\@MqLApGMPɨϥγoӸfAN|o͸IQƥ[INOҿת@ɴCC ]NOA@ɴCbx@ɶIA ȯQ@DEҨϥC

    zF@ɴC骺NqAAӡAڭ̴NonQAAAӺdOpljKOHڭ̥HWϤ A no D dҦnFA̔xA CSMA/CD ftWzAljKpݭnHUy{G

    1. oCϥαp (Carrier Sense)GA DEnoeʥ]eAݭnCioAT{SHbϥΫA ~^oeXTءF

    2. hIljK (Multiple Access)GA DEҰeXƷ|Quƻs@AMǰeҦs^즹uDEI ]NOA A ҰeXơA B, C, D Tq^^Iѩ؊AO D DEA] B P C |NTظƥA D h|UӳBzF

    3. I (Collision Detection)GMTظƪ˴OAYLDEҦp B q]nbPɶoeTظƮɡA A P B eXƸIb@ (XQ) AɳoǰTشNOlA A P B N|UHEΫݤ@ӮɶA M᭫szLĤ@BAǰe@MTظơC

    Aoӵ{ǫܭnܡHڭ̴Nӽͽ͡G

    • LɡAuO{ӤAڪDESϥκG
      zLWzy{ڭ̷|DAޭ@DEoeXTءAҦq|^I]u|ƻs@MƵҦqC ]AMu@DEb~suAObuWҦqON|{ӤI

    • ڪqSQJIAڪƷ|QjmqѨG
      zLWzy{Aڭ̥unb B qWwU@MonAoMnN쥻n󪺰TظƮUӤRAåB[HœA N^D쥻 A ҰeXTFCo]Oڭ̳ijnƦbںWony[KzAljKI

    • JM@ɴCu@ӥDEiHϥΡAjaiHPɤWG
      oӰDNäFAJM@ɴC@uQ@ӥDEҨϥΡAU@ڶljK 100MB ɮסAuNoQڨϥ 80 (H 10Mbps ljK)AboLHiHϥζܡHOAѩAǪTظƦbdPLAӺC@uljK 1500bytesA]ڪ 100MB ɮ״NonhӤpƥ]AM@Ӥ@ӪǰeACӸƥ]ǰeengL CSMA/CD EC ҥHAoӗuϥvOjamۥΪIYϥu@DEbϥκCɡAoDEboeCӫʥ]A ]OݭnΫݤ@qɶ (96 bit time)I

    • TحnhjnHणקTءHG
      pWҭzATتjpणܩOH]pGTتeq^WjApƥ]ӋqN|֡A CӰTضǰeΫݴNiH֤FIOo˨ShAOAӺAǰTؽTwqb 1500 bytesA ӪW@tAӺC馳䴩 Jumbo frame (T,10) ܡAN^NTؤjpאּ 9000bytes IOܫijjaHKקTIOH2.2.5 MTU p`AC

    pADϥ2.2.4 MAC ʗU榡

    W쪺 CSMA/CD ǰeXhTظơANO MAC TIMAC NOڭ̤W@쪺T (frame) oI uOoӰTؤWӫܭnơANO؊APӷddA]ڭ̤S̔ٺdd MAC ӤwC ̔xAAiH MAC QO@ӦbuWǻ]qAӳoӥ]qOӺwWǰeƪ̤pxFC ]NOAuiQO@y@ȥiqL@ӤHzWA MAC NOboӿWWʪHTI^UӡAӬݤ@ MAC oӰTتeaI

    AӺ MAC T
    2.2-3BAӺ MAC T

    WϤت}Pӷ}NOdd (hardware address, w})Aڭ̫eAC@id@ӿW@LGdA ӥdتNboӰTتYƨϥΨTIw}̤p 00:00:00:00:00:00 FF:FF:FF:FF:FF:FF (16 ik)A o 6 bytes SAe 3bytes tΪNXA 3bytes hOMtΦۦ]wUmXFC

    b Linux SAAiHϥ ifconfig oӫOӬd\AddISO`NAbo MAC ǰeALȦbkͮġApGwLPk (oӫ᭱ IP ɷ|)AӷPتw}N|ۧܤFC oO]ܦPdyFIҥHdSMPFIpUҥܡG

    P@TئbPkDEǰeɡATتYܤ
    2.2-4BP@TئbPkDEǰeɡATتYܤ

    ҦpWϥܡAڪƭnѹq A qL B ~eF C A B qdA䤤 MAC-2 P A q MAC-1 qAܩ MAC-3 hP C q MAC-4 qCO MAC-1 P MAC-3 P MAC-4 qAH] MAC-1 odèSP MAC-3 MAC-4 ϥΦP˪ switch/hub ^IҥHAƪyq|ܦG

    1. MAC-1 ǰe MAC-2 AɨӷO MAC-1 ӥتaO MAC-2F
    2. B q^AԎMTءAo{؊AO C qAӬFP C qqA ҥHL|NTؤӷ MAC אּ MAC-3 Aӥتאּ MAC-4 ApNiH^ǰe C qFC

    ]NOAunzL B (NOѾ) ~Nʥ]et@Ӻk (IP |) hɭԡA Tؤw}N|QܡAM~^bP@Ӻk̭^iTتyq[I

    Tips:
    ѩddOۺdAä|]@~tӧܡA ҥHnjh]^wdӶiתu@I L׺dȯbkiӤwA] MAC w router II
    mϥ
    • ƶq̤pn 46 ̤j 1500 bytes OH

      TؤƤe̤jiF 1500bytes oڭ̲{bDFAnWd̤pƬ 46bytes OHoOѩ CSMA/CD EҺXӪI boEWiXYnIAhT`ƶq̤pon 64bytes AAت}Bӷ}BˬdX (efX) A Nioƶq̤pon 46bytes FI]NOApGpnljKƤp 46byes Aڭ̪t|DʪW@ǐRXA Hɻܤ 46bytes eq~I

    pADϥ2.2.5 MTU ̤jljKx

    qLW MAC ʗUwqA{bڭ̪DAǤAӺTةүǰeƶq̤jiHF 1500 bytes A oӋȴNQڭ̺٬ MTU (Maximum Transmission Unit, ̤jljKx)C Aon`NOACR MTU ۦPA]ɭԦbYǺؤWA|ݨ 1492 bytes MTU ΆΡCLAbAӺWAAǪwqNO 1500 bytesC

    bݷ||쪺 IP ʥ]Ao IP ʥ]̤jiH 65535 bytesA MTU RnjOIJM (IP) 񲰤l (MAC) jAi񪺶ih[HҥHoA IP ʥ]OiHiAM~ MAC S[IΨƳǨتaA AѥتaDENLœU^ӴNOFCҥHoApG MTU ^j@ǪܡA IP ʥ]pN|CA ʥ]Pʥ]ǰeΫݮɶ (e@p`쪺 96 bit time) ]|֡AN^W[WeϥoI

    FoӥتAҥH Gigabit AӺC~䴩 Jumbo frame Io Jumbo frame @볣wq 9000bytesC A|AJMpAڭ̪ MTU ण令 9000bytes OHoˤ@ӤN^ָƫʥ]AHW[ϥβvܡH Oo˨ShAӥBAA]TiHb Linux tW MTU IOApGҶqӺAڭ̤ijAקoӋȡC OH

    ڭ̪ʥ]`Oݭnb Internet W]aHALkT{ҦCO䴩j MTU aI pGA 9000 bytes ʥ]qL@Ӥ䴩 Jumbo frame CɡAn@IOMC (Ҧp switch/router ) |DʪDAœӶiǰeAt@IiN^^Noӫʥ]LĦӥFoӮɭԥiNɤjo ҥHA MTU ]w 9000 oRƱAjyȯb줤@|ҨӻAܦhOt (cluster) NNL̪ MTU ]w 9000AO~diRO쥻A 1500 I ^_^

    ]NOAAAC䴩 MTU hjAAnҶqAʥ]ݭnǨتaɡA һݭngLҦCAMAӨMwA MTU ]w~CN]oˡAڭ̤~ijAקAǤAӺ MTU I

    Tips:
    YǺC (Ҧp IP ɾ) 䴩O 802.2, 802.3 AǩœX MAC ʗUA MTU NO 1492 A ӥBodz]Qiण|iʥ]œA]W``BͰݻAL̳sWYǺɡA`O|suOɦ_uC zLקΤݪ MTU 1492 AWNSDFC]OOHŪWYơAzRMzFaH^_^
    mϥ

    pADϥ2.2.6 uBP}E
    • @@ɫܭnAuROH (11)

      ڭ̤WFAS@ӫܦLbB@ɡAu (hub) oӺ@ɴCNi|o͸IpA oO] CSMA/CD tGCSkקKoRW䧮ʥ]IpOHANϥΫD@ɴC骺Yi[I

      (switch) ίūD`hAڭ̳o̶ؐQ䴩 OSI ĤGhCPṳjtAb@ӯSOOA oӰOiHOC switch port Ps^ PC MAC }AҥHASӦ switch ݪ PC nǸƮɡACӰTرN^zLOƦӶǰe؊ADEWI ҥH switch O@ɴCAB switch CӰf (port) 㦳WߪWeI

      |ҨӻA10/100 Hub Ws 5 DEA 10/100Mbps OoDEA ҥHoDE`@uϥ 10/100Mbps ӤwCpGO switch OHѩyC port 㦳 10/100Mbps WezA ҥHNݧASɪljK欰OpoI|ҨӻApGOUpɡACӳsuO 10/100 Mbps C

      CӰfWeϥΥܷN
      2.2-5BCӰfWeϥΥܷN

      A ǰe D P B ǰe C W۾֦ 10/100Mbps WeAä|ۼvTI LApGO A P D ǵ C ɡAѩ C port NȦ 10/100Mbps AΩ A P D ݭnm C `I 10/100Mbps ӥΪNC `AANOonOoOAswitch wgJAFʥ]IDA]L switch port R MAC }\A ҥH switch ëD@ɴCIPɻݭnOoOA{b switch WܦhA bʪɭԡAdUOoʥiH䴩Uu/bUuAHΤ䴩 Jumbo frame ΡI

    • OUu/bUu(full-duplex, half-duplex)

      eͨuɡAڭ̪DKuڤWȦQϥΡA@OΦbǰeAt@hOb^C pGݪ PC Pɤ䴩UuɡA Input/Output iF 10/100MbpsA YƪǰeP^PɧiF 10/100bps NA`WehiF 20/200Mbps o (OIyfA] Input iF 10/100MbpsA output iF 10/100Mbps A ӤO Input i^F 20/200Mbps I)pGAQnFUuɡA ϥΦ@ɴC骺 Hub Oi઺A]u}쪺}YALkϥΦ@ɴCӹFUuI pGA switch ]䴩UuҦAb switch ݪ PC ~FUuI

    • ۰ʨճtE (auto-negotiation)G

      ڭ̳D{bAӺdOiHVU䴩AYO Gigabit diHP 10/100Mbps dsӤ|oͰDCOAɪt׬O˧PwOH switch/hub nʤtפ~As hub/switch ]䴩 auto-negotiation S٬ N-Way \ALi۰ʪեX@ljKtרӷqIpG Gigabit P 10/100Mbps b switch WA h N-Way |ϥγ@t (gigabit) O_^䴩ApG檺ܡANtU@ӆίťY 100 Mbps tרӹB@I

    • ۰ʤ~utuΥu (Auto MDI/MDIX)G

      ڭ̬O_ݭnۦ~uPtuOHݭnTI] switch Ytauto MDI/MDIX \ɡA |۰ʤ~u}ӽվsuAҥHANݭnާAuOtuROuoIKaI ^_^

    • TIyD

      ѩqlTO|IAҥHSuLfPqlTIpYɡA N|fPsu~誺}FC]AsUӸ`Iu׬OI LA@ӻA{AӺ CAT5 ίŪujyiH䴩 100 تסA ҥHRMLeߤ~OoI

      OAyTIpëDȦuצӤwIpGAuoY(Ҧpb``QOAfPܧ) AΪ̬Oۦ杢su^YAO^YKuB¶פfPqϤzZYA Ϊ̬Oub~jfPܤƪpΆΡA|fPqlTǻ}ӳysu~cHA ɱ``N|o{ӥiHsuBɫoSLksuDFI]ASAݭnw~Ӭ[]骺ɡA `NcƧGuiOܭnI

    • cƧGu

      ҿתcƧGuONUӺO}AOwUPm~A hӷQnɺwίũΪ̬OʬYǺ]QɡAuݭntuLEdBA HΥݪWwdջPDE]QsuN^FتFCҦpUϥܡG

      cƧGu̔ϥ
      2.2-6BcƧGu̔ϥ

      bGuݭnܪ`NA]i@GuNϥ 5-10 ~HWIAݭn`NȦWwdեHΰtu݈C WAOcƧGuһݭnܪCPuίšAREdBE[AHάƻPúuƆΆΪDA HڬIuһݭn`NƶARҦwBIuһݭn`NAdzWdΆΡA wgiHgpp@ѡAӉmo̪ئb@Ӥp~DEӋq֪A ҥHȴ̔xH@өΨӥ (swtich) ^Ҧ]QpPγsuAӤwC

      pGAݭn}wcƧGuTAiHѦҭHlSꑮySwtich and Fast AӺz@ѪbqIܩW@ܡHAiHeŎД ZMAN (http://http://wordpress.morezman.com/) jI

    jADϥ2.3 TCP/IP h}ʥ]P

    ڭ̲{bDnܡAn}wAӥثe̱`w餶AӺA]AuBdBHub/Switch ΆΡCӤAӺWljKϥκddǪ MAC TءAtX CSMA/CD AǨӶǰeTءAoNOwCbnAڭ̪D Internet NO TCP/IP oӳqTwq١AInternet O InterNIC(12) ҅@޲zA LȬOtdt Internet W IP HδѬ} TCP/IP ޳NӤwCL Internet ̭nNO IP [IҥHA oӤp`Nڭ̨h IP PѧaI


    pADϥ2.3.1 IP ʥ]ʗU

    ثeں| IP RA@ROثeϥγ̼sx IPv4 (Internet Protocol version 4, ںwĥ|)A @RhOwӷ|] IPv6 CIPv4 O}ѩȦ 32 줸Awpb 2020 ~eN|oܡAp@ӡA saΪ̬OsqANSiHϥΡCFקKoӰDo͡A]N IPv6 ͡C IPv6 }iHF 128 줸AiHhX 2 96 譿}ӋqAo˪ IP ӋqXGΤTIM IPv6 㦳e]ʡAثeDyCjhROϥ IPv4 A]Dnͨ쪺 IP IPv4 ӨI(13)

    ڭ̦be@p`ͨ MAC ʗUA IP ʥ]ʗU]onA@UA~ાD IP 쩳Op󲣥ͪ[I IP ʥ]iHF 65535 bytes ojAb MAC jpUAڭ̪@~t| IP iʧ@Cܩ IP ʗUYøspUG(UϲĤ@欰C쪺 bit Ӌ)

    4 bits 4 bits 8 bits 3 bits 13 bits
    Version IHL Type of Service Total Length
    Identification Flags Fragmentation Offset
    Time To Live Protocol Header Checksum
    Source Address
    Destination Address
    Options Padding
    Data
    2.3-1BIP ʥ]Y

    bWϥܤӦan`NANOyC@ҦΪ줸Ӌ 32 bitszA UӪYeOpUG

    • Version()
      ŧio IP ʥ]AҦpثeDΪRO IPv4 oӪNbo̫ŧiC

    • IHL(Internet Header Length, IPY)
      io IP ʥ]YסAϥΪxRMOrœ (word) A@Ӧrœ 4bytes jpC

    • Type of Service(A)
      oӶتeyPPPDTRUUzAܳo IP ʥ]AADnG
      PPPGܦ IP ʥ]uסAثeܤ֨ϥΡF
      DGY 0 ܤ@멵(delay)AY 1 ܬCF
      TGY 0 ܬ@ljKq (throughput)AY 1 ܬ@ljKqF
      RGY 0 ܬ@ia(reliability)AY 1 @iaסC
      UUGOd|QϥΡC
      |ҨӻAgigabit AӺRR}WiHo IP ʥ][tBCAYǯSAxNObo̻C

    • Total Length(`)
      o IP ʥ]`eqA]AYPe (Data) C̤jiF 65535 bytesC

    • Identification(~OX)
      ڭ̫e IP Ulnb MAC UlSCLApG IP UlӤjܡANonN IP AœpUlMA MAC SCS IP QœɡACӨӦۦP@ IP pUlNonѧOXHi^ݳoǤpUlOӦۦP@ IP ʥ]~C ]NOAp IP ʥ]O 65536 j (e@ Total Length Ww)A o IP NonAQp IP q~i MAC TؤCCӤp IP qO_ӦۦP@ IP ơAINOoѧOX\TI

    • Flags(SXA)
      oӦa誺ey0DMzANqG
      DGY 0 ܥiHqAY 1 ܤiq
      MGY 0 ܦ IP ̫qAY 1 ܫD̫qC

    • Fragment Offset(q)
      ܥثeo IP qbl IP ʥ]ҦmCNI^OǸTAoӧǸ~NҦp IP qœX쥻 IP ʥ]jpIzL Total Length, Identification, Flags Hγo Fragment Offset N^Np IP qbœX_oI

    • Time To Live(TTL, sɶ)
      ܳo IP ʥ]sɶAd 0-255CSo IP ʥ]qL@ӸѾɡA TTL N|@AS TTL 0 ɡAoӫʥ]N|Q^CbAn IP ʥ]qL 255 ӸѾAR ^_^

    • Protocol Number(wNX)
      Ӧ۶ljKhPhLƳOmb IP ʥ]SAڭ̥iHb IP YOo IP ʥ]ƬOA boNOOCRƫʥ]eTIboONXP}ʥ]wW٦pUҥܡG
      IP Xʥ]wW(W)
      1ICMP (Internet Control Message Protocol)
      2IGMP (Internet Group Management Protocol)
      3GGP (Gateway-to-Gateway Protocol)
      4IP (IP in IP encapsulation)
      6TCP (Transmission Control Protocol)
      8EGP (Exterior Gateway Protocol)
      17UDP (User Datagram Protocol)
      SMTAڭ̤`쪺RO TCP, UDP, ICMP I

    • Header Checksum(YˬdX)
      Ψˬdo IP Yh~ˇΡC

    • Source Address
      RܡHSMOӷ IP }Aqo̧ڭ̤]D IP O 32 줸I

    • Destination Address
      ӷRݭn؊A~ǰeAo̴NO؊A IP }C

    • Options (LӋ)
      oӬOB~\Aѥ]AwBzEBѬBɶWOBYPePӷцΡC

    • Padding(ɻ)
      ѩ Options e@whjAOڭ̪D IP CӸƳnO 32 bitsAҥHAY Options Ƥ 32 bits ɡAh padding DʸɻC

    AunD IP Y̭tG TTL, Protocol, ӷ}P؊A}]N^FIӳo IP YӷP؊A IP AHΨӧP_qLhָѾ TTL ANAo IP NQpǰeتݧoCUp`ڭ̱N IP œPdAR IP ʥ]pǰeE () ΆΡC


    pADϥ2.3.2 IP }œP

    {bڭ̪D IP (Internet Protocol) O@Rʥ]Aӳoӫʥ]Y̭nNO 32 줸ӷP؊A}I FKOСAҥHڭ̤]ٳo 32 bits ӋȬ IP }NOFC]OHoAҥHܦhyPlȨtI o IP NҿתyPXzTIo IP ǭnaݭnAOHUڭ̴Nӽͤ@ͧaI

    JM IP œO 32 bits ӋȡA]NO 32 0 P 1 œ@sӋrISڭ̫ҩҦ IP }ӋɡAANRMnNMӋQO 32 줸ƳI LA]HGibOxAҥHFRH̹Qi쪺̿ʡA]ANN 32 bits IP |pqACqt 8 bits AN 8 bits p⦨QiAåBC@qHpӋIj}ANFثejaҼx IP ѼgҼˤFCpUҥܡG

    IP ܦG
    00000000.00000000.00000000.00000000   ==> 0.0.0.0
    11111111.11111111.11111111.11111111   ==> 255.255.255.255
    

    ҥH IP ̤piH 0.0.0.0 @ 255.255.255.255 Ibo@ӋrARiHӈI Dn Net_ID (kX)P Host_ID (DEX) Cڭ̥H 192.168.0.0 ~ 192.168.0.255 o Class C kS@ҤlӻnFG

    192.168.0.0~192.168.0.255 o Class C G
    11000000.10101000.00000000.00000000
    11000000.10101000.00000000.11111111
    |----------Net_ID---------|-host--|
    

    bWdSAeTœӋr (192.168.0) NOkXA̫᭱@œӋrh٬DEXC ܩP@ӺkwqOybP@ӪzqADE IP 㦳ۦP Net_ID AåB㦳WS Host_IDzAo IP sNOP@Ӻk IP qTI

    Tips:
    OzqOHSҦDEOϥΦP@ӺCb@_A oӮɭԳoǥDEbUmWOsub@_ANiH٬oǥDEbP@ӪzqFI PɨýЪ`NAP@ӪzqAiH̾ڤP IP ]wAӳ]whӡyIP qzI
    mϥ

    WҤlS 192.168.0.0, 192.168.0.1, 192.168.0.2, ...., 192.168.0.255 (@ 256 ) o IP NOP@Ӻk IP s(P@Ӻk]٬P@ӺqI)AЪ`NAP@ Net_ID A㦳ۦP Host_ID A_hN|o IP eAi|yDESkϥκDI


    • IP bP@kNq

    P@ӺkM]wAPN IP ]wbP@ӺknBOH

    • Net_ID P Host_ID G
      bP@ӺqANet_ID OܪA Host_ID hOiơA~AHost_ID bGi쪺ܪkSAiPɬ 0 ]iPɬ 1 A] 0 ܾӺq} (Network IP)Aӥ 1 hܬs} (Broadcast IP)
      CҦpWҤlSA192.168.0.0 (Host_ID 0)H 192.168.0.255 (Host_ID 1) iΨӧ@qDE IP ]wA]NOAoӺqiΨӳ]wDE IP O 192.168.0.1 192.168.0.254F

    • bϺzL IP sǻ
      bPzqDEpG]wۦPk IP d (i)AhoǥDEiHzL CSMA/CD \ઽ^bϺμsisuAYiH^ddǻ (zL MAC T)F

    • ]wPϺbPzqp
      bP@ӪzqApGDE]wP IP qAhѩs}PAfPLkzLs覡ӶisuC ɱonzLѾ (router) Ӷi淾q~NӺksb@_C

    • kjp
      S Host_ID ҦΪ줸VjAY Host_ID ӋqVhɡAܦP@ӺkiΥH]wDE IP ӋqVhC

    ҥHAQx줽qqsAΪ̬OAJ٩ήa̭ҦqASM]wbP@ӺkO̤KA ]p@ӨC@qiH^zL MAC ӶiƪyAӤg Router (Ѿ) Ӷiʥ]茻OI(Router obĤK~|)C


    • IP PPXpQ

    ^IJ IP œBͳܧxZASԣkXPDEXAЦFIAAηдo[IϥΪPXyӷQYiC JM IP OPAڭ̱XsޤjPӻnFAڭ̪POGyxnñdϤjW 949 zA ]ӤjWOP@ӫѧˡAڭ̳oӪPkXyxnñdϤjWzӧڪDEXNOy 949 zA jWWunO}YyxnñdϤjWzANOڭ̦P@ӺkoISMTAPXi঳ĤG 949 [Io˲z_H

    t~AHost_ID 0 P 1 (Gi쪺y) ɡANѤlĤ@ӻP̫@ӪPAӲĤ@ӪPڭLNѤlA ҥHS٬ Network IPANOѤlf XXX ѪߵPTIܩ̫@ IP AhNѤlAYѤl̫@ӪPA NOڭ̦bѤlsɪ̫@ IP AS٬ Broadcast IP oC

    bڭ̳oӫѤlAڭ̥iHzLjnμs覡jaqTAҦpeX~]igpffwysiA bѤlzLsiDigpffAANwyNnFAԒ֦^aYyhIpGOigpffOHNNMTL[I o˦SpQ CSMA/CD yOH

    pGAƤOnѤlPOHɧANonNƮѤll (Ѿ)AѶlDAǰeA AunDѤllb̧YiALNlۤvDAHǥXhYi[IoNOӰϺPPRQkI o˦SM[H


    • IP

    ARMnQ@ӰDANOڪ`PyxnñdϤjW 949 zA̬OѤlӨ̬OPH pGyxnzOѤlAڪPNnhmRœApGѤlXyxnñdϡzɡA ڭ̪PNS֤FICҥHAoӡyѤlzjpAN|vTڭ̥DEXӋqI

    FMoӰDAHάF IP ޲zPoUKʡAInterNIC N IP qRίšA CRίŪdDnP IP 32 bits ӋȪeXӦ줸}A򥻩wqpUG

    HGi컡 Network Ĥ@ӋrwqG
    Class A : 0xxxxxxx.xxxxxxxx.xxxxxxxx.xxxxxxxx  ==> NetI_D }YO 0
              |--net--|---------host------------|
    Class B : 10xxxxxx.xxxxxxxx.xxxxxxxx.xxxxxxxx  ==> NetI_D }YO 10
              |------net-------|------host------|
    Class C : 110xxxxx.xxxxxxxx.xxxxxxxx.xxxxxxxx  ==> NetI_D }YO 110
              |-----------net-----------|-host--|
    Class D : 1110xxxx.xxxxxxxx.xxxxxxxx.xxxxxxxx  ==> NetI_D }YO 1110
    Class E : 1111xxxx.xxxxxxxx.xxxxxxxx.xxxxxxxx  ==> NetI_D }YO 1111
    
    RŦbQi쪺ܡG
    Class A :   0.xx.xx.xx ~ 127.xx.xx.xx
    Class B : 128.xx.xx.xx ~ 191.xx.xx.xx
    Class C : 192.xx.xx.xx ~ 223.xx.xx.xx
    Class D : 224.xx.xx.xx ~ 239.xx.xx.xx
    Class E : 240.xx.xx.xx ~ 255.xx.xx.xx
    

    ھڤWAڭ̥iHDAAunD IP Ĥ@ӤQiӋrAN^AM IP ݩ@ӆίšA HΦPk IP Ӌqh֡Co]Oԣڭ̤WYF 192.168.0.0 o@ IP qӻɡA|NѤlwqĤTӋrGC LAWAunOФTRίšAYO Class A, B, C YiA] Class D OΨӧ@s (multicast) S\ध (̱`ΦbjqR)Aܩ Class E hOOdSϥΪqC]A^Ψӳ]wb@tWANu Class A, B, C TRίŪ IP oI


    pADϥ2.3.3 IP RPo覡

    ^Uӭnjaͤ@ͤ]OܮeyjaxZ@ӈANO IP RIܦhBͱ``o줰yuIP, IP, [ IP, IP....zгЦFnӺiTIڤWAb IPv4 ̭NuR IP OAOOG

    • Public IP : @ IP Ag INTERNIC ҅@Wُ IPAoR IP ~iHsW Internet F

    • Private IP : p IP ΫOd IPAઽ^sW Internet IP A DnΩkDEsuWُC

    b IPv4 WُɭԴN IP |pAӥBFRIYǥ~]wAONFp IP (Private IP) ͤFCp IP ]Ob A, B, C T Class SUOd@q@p IP qANOG

    • Class AG10.0.0.0    - 10.255.255.255
    • Class BG172.16.0.0  - 172.31.255.255
    • Class CG192.168.0.0 - 192.168.255.255

    ѩoTq Class IP OwdϥΪAҥHäઽ^@ Internet Ws^AMܡABNۦP IP oIIZVáHҥHoAoT IP qNupk IP qΡC̔xALUXӭG

    • p IP ѸT~ (usb)F
    • ϥΨp IP @ӷΥتa}ʥ]AzL Internet 茰e (M|V)F
    • }p IP ѦҬ(p DNS)Au୭󤺈ϥ (@˪zT)

    oӨp IP nBOHѩLpѤ~^ѸTAҥHAAN|^Q Internet W Cracker ҧ@IOAA]NLkHp IP ӡy^WzoI]SAX@ǩ|㦳 Public IP ~ΨӳWُ]wI_hSAHKw@ǥiO Public IP qӳWُA~]wɡAU@@ѯusW Internet FAZOi|y Internet W Public IP ۦPFܡH

    ~AbSiΪ}pUApGAQnPsuCګH]NOAbϺۤvۤvsuCڡA ɧAunWdnҦPbP@qp IP qAN^QATINo̔xOI

    U@ASnNoǨp IP eW Internet OHo̔xA]w@̔x[W NAT (Network Address Transfer) AȡAANiHzL IP U (nAoӦb᭱]|) ӨϧAp IP q]iHsW Internet oI


    • S loopback IP q

    nFA򰣤Foӹwd IP qD~ARSLǪFOHSMOTIMmFɶC XX OHShAR@ө_Ǫ Class A kANO lo oө_ǪkT (`NGOpg o ӤOs)Io lo OSQΨӧ@@~tjҥΪ@ӺkAPɤ]^ѵt쥻NݭnϥκA (daemon) ҨϥΡC

    ̔xApGASwUdbEWA OASƱiH@UbAEW]wA쩳iiHQB@AoӮɭԫA KKINOQγoөҿתjTIoӺqb 127.0.0.0/8 o Class AAӥBw]DE (localhost) IP O 127.0.0.1 IҥHoASAŰʤFA WWW AAMbADE X-Window W http://localhost NiH^ݨADoIӥBݭnwUdOIܤKaI

    ~AAϥΪ mail BelOHҦpADEtp mail root oӤHOHKKI]NOϥγo@ӤjTISnA TCP/IP ʥ]PAO_`ɡAiHϥγoӽI(ҥH@ѦHݧAKIADEWSdA AiHA WWW A]wO_TܡHoӮɭԥio^GSMiHoIϥ 127.0.0.1 o Address rI ^_^ )


    • IP o覡

    ͧF IP RPίR}lkyA^Uӧڭ̱oA@UADE IP Op]wOH 򥻤WADE IP P}k]w覡DnG

    • ^ʳ]w(static)G AiH^VA޸߰ݥiΪ IP }ӋAM᪽^s]w (ΨϥάYdzn\) ӳ]wAC `Չ줤AHΦV ISP ӽЩTw IP suF

    • zLD^oG VA ISP ӽеUAobKXA^D^ ISP AA ISP |zLL̦ۤv]wAA@~toTӋC ɧAäݭnʥhsP]w}ӋTCثexW ADSL D^B֨jӡB֨쩲ΡAjOϥΔD^覡C ]RΤ᪺ݨDAY ISP ]ѫܦhP IP tEC]A hinet, seednet Άγ ADSL D^oTw IP 覡I ЦVA ISP ߡC

    • ۰ʨoӋ (DHCP)G bk|@DEtd޲zҦqӋAAŰʮɴN|DʦVMAnD IP ӋA Yo}ӋAADEN^ۦ]wnҦAAӋFC̱`ϥΩ~BIP ɾݡB ՉPJAlueWγsu覡C

    ެOϥΤWR覡o IP AA IP uҿתy Public P Private IP zӤwIӨLBʦBTwB ʺAΆΦSANuOiDAo IP o覡ӤwC|ҨӻAxWa ADSL D^o IP q`O public IPA Om^쭻ͪӫHAL ADSL D^Ao IP O Private AҥHfPLk[]I


    pADϥ2.3.4 Netmask, lP CIDR (Classless Interdomain Routing)

    ڭ̫eͨ IP OίŪAӳ]wb@qtWhO Class A, B, CC{bڭ̨ӷQ@QApGڭ̳]w@ӰϺA ϥΪO Class A Aڭ̫ܮeN|QAohqiH]wbP@ Class A Ϭq (256x256x256-2=16777214) H ӥBA]uohqnFA^Q@U CSMA/CD aAAȷ|@D`yA]pon^@dhUxqAs... OQ@dhUxsAARϥζܡHuSIJvI

    ~A Class IP ίšAOF޲z譱ҶqAWAڭ̤iN@ Class A ُw@ӰϺC|ҨӻA ڭ̱Xso Public IP O 120.xxx }YAOڭ̥u 120.114.xxx.xxx ӤwAèSo Class A I ]ڭ̎դ]ΤFohIoӮɭԡAڭ̴Nonz@UoANOAN Class A qܤpHyܻA ڭ̦pNkNOHoˤNiHXhqϺja]wFH

    eڭ̴ IP o 32 줸ӋȤkXPDEXA䤤 Class C kXF 24 줸AӨڭRiHNo˪kNANOĤ@ Host_ID Qӧ@ Net_ID AҥHA Net_ID N 25 bits Aܩ Host_ID h֬ 7 bits Cbo˪pUAӪ@ Class C kNiHQӤlkAӨCӤlkNy 256/2 - 2 = 126 zӥiΪ IP FIoˤ@ӡAN^N쥻@ӺkӸNpkAKO]pC


    • Netmask, κ٬ Subnet mask (lBn)

    쩳OӋӹFlOHNO Netmask (lBn) γ~TIo Netmask OΨөwqXk̭n@ӰӋFILL]zF@_@CFDUjaeOЦ Netmask ]w̾ڡAUڭ̤@ӤeOЪkCP˥H 192.168.0.0 ~ 192.168.0.255 oӺkdҦnFApUҥܡAo IP qiH Net_ID P Host_IDAJM Net_ID OiܪAN]LҦڪ bits wgQΥF ( 1)A Host_ID OiܪANNLQOOd ( 0)AҥHA Netmask ܴNG

    192.168.0.0~192.168.0.255 o C Class  Netmask 
    Ĥ@ IPG 11000000.10101000.00000000.00000000
    ̫@ G 11000000.10101000.00000000.11111111
                |----------Net_ID---------|-host--|
    Netmask  G 11111111.11111111.11111111.00000000  <== Netmask Gi
             G   255   .  255   .  255   .   0      <== Netmask Qi
    SO`NAnetmask ]O 32 줸AbӋȤWA Net_ID  1  Host_ID  0
    

    NL茦Qi쪺ܡANy255.255.255.0zTI o˰O̔xhFaIӳo˪OФkA A, B, C Class Netmask ܴNoˡG

    Class A, B, C TӆίŪ Netmask ܤ覡G
    Class A : 11111111.00000000.00000000.00000000 ==> 255.  0.  0.  0
    Class B : 11111111.11111111.00000000.00000000 ==> 255.255.  0.  0
    Class C : 11111111.11111111.11111111.00000000 ==> 255.255.255.  0
    

    ҥHA 192.168.0.0 ~ 192.168.0.255 o Class C kAL Netmask NO 255.255.255.0 IAӡAڭ̭责FS Host_ID 0 HΥ 1 ɫM IP OiHϥΪA] Host_ID 0 ɫA IP OMq Network Aܩ 1 ɫNMq̫@ IP A]٬ Broadcast AҥHAb 192.168.0.0 ~ 192.168.0.255 o IP q̭}ӋNG

    Netmask:   255.255.255.0   <==kwqA̭nӋ
    Network:   192.168.0.0     <==Ĥ@ IP
    Broadcast: 192.168.0.255   <==̫@ IP
    iΥH]wDE IP ӋG
    192.168.0.1 ~ 192.168.0.254
    

    • l

    nFA责 Class C RiH~ilk (Subnet) [AH 192.168.0.0 ~192.168.0.255 oӱpҡALnpANӤlkOHڭ̤wgD Host_ID iHS@ Net_IDA Net_ID ϥΤF 25 bits ɡAN|pUҥܡG

    쥻 C Class  Net_ID P Host_ID O
    11000000.10101000.00000000.00000000      Network:   192.168.0.0
    11000000.10101000.00000000.11111111      Broadcast: 192.168.0.255
    |----------Net_ID---------|-host--|
    
    Ӥl᪺ Net_ID P Host_ID H
    11000000.10101000.00000000.0 0000000  hF@ Net_ID F,  0 (Ĥ@Ӥl)
    11000000.10101000.00000000.1 0000000  hF@ Net_ID F,  1 (ĤGӤl)
    |----------Net_ID-----------|-host--|
    
    Ĥ@Ӥl
    Network:   11000000.10101000.00000000.0 0000000   192.168.0.0
    Broadcast: 11000000.10101000.00000000.0 1111111   192.168.0.127
               |----------Net_ID-----------|-host-|
    Netmask:   11111111.11111111.11111111.1 0000000   255.255.255.128
    
    ĤGӤl
    Network:   11000000.10101000.00000000.1 0000000   192.168.0.128
    Broadcast: 11000000.10101000.00000000.1 1111111   192.168.0.255
               |----------Net_ID-----------|-host-|
    Netmask:   11111111.11111111.11111111.1 0000000   255.255.255.128
    

    ҥHASANUhɡAN|oӤlkAӨӤlkRiHANUh (Net_ID α 26 bits ....)CIpGAu^z IP, Network, Broadcast, Netmask ܡAߧAAӪAߤwgZF@bTI ^_^

    DG
    ۭpX 172.16.0.0A Net_ID 23 Ӧ줸ɡAoӺk Netmask, Network, Broadcast ΰӋ
    G
    ѩ 172.16.xxx.xxx Ob Class B ίSAY Net_ID O 16 줸~CLDص Net_ID ΤF 23 Ӧ줸I ΩOV Host_ID ɤF (23-16) 7 Ӧ줸Φb Net_ID SCҥH IP }|ܦoˡG
    w]G       172  .  16    .0000000 0.00000000
              |----Net_ID--------------|--Host---|
    Network:     172  .  16    .0000000 0.00000000   172.16.0.0
    Broadcast:   172  .  16    .0000000 1.11111111   172.16.1.255
    Netmask:  11111111.11111111.1111111 0.00000000   255.255.254.0
    mbo̦iA]o IP qe 16 Ӧ줸|QܡAҥHèSp⦨Gi (172.16)A uOnN[ܩhON host_ID [I

    lpOYBAڭ̪D IP OGiACӦ줸NO 2 CSѩ IP ӋqOtCӤlhA ҥHApGڭ̥H 192.168.0.0 ~ 192.168.0.255 oӺqӻAnO Net_ID O 26 줸ɡA`@XqOH ] 26-24=2 AҥH`@αӦ줸A] 2 2 Ao 4 ӺqCAN 256 IP t 4 ӺqhA ڭ̴NiHDo|ӺqOOG

    • 192.168.0.0~192.168.0.63
    • 192.168.0.64~192.168.0.127
    • 192.168.0.128~192.168.0.191
    • 192.168.0.192~192.168.0.255

    S̔xP\[HAAQQApGPˤ@ӺqA Net_ID ܦ 27 Ӧ줸ɡASMppOHۤvݧaI


    • Lh IPG CIDR (Classless Interdomain Routing)

    @ӻApGڭ̪DF Network H Netmask ANiHwqXMkҦ IP FI] Netmask NiHX Broadcast IP [I]Aڭ̱``|H Network H Netmask Ӫܤ@ӺkAҦpo˪gkG

    Network/Netmask
    192.168.0.0/255.255.255.0
    192.168.0.0/24    <==] Net_ID @ 24  bits
    

    t~AJM Netmask ̭ Net_ID O 1 A Class C @ 24 bits Net_ID AҥHTANW 192.168.0.0/24 o˪gkoIoNO@kܤkC PziҡAbWzYBpkkA|ӺqgkNiHgG

    • 192.168.0.0/26
    • 192.168.0.64/26
    • 192.168.0.128/26
    • 192.168.0.192/26

    WAѩNpYAF߸ѸTLejfPįणΡA]AYǯSpUA ڭ̤ϦӬON Net_ID ɥΨӧ@ Host_ID pIo˴N^NhӺkg@TI|ҨӻAڭ̱N 256 Class C p IP (192.168.0.0~192.168.255.255) g@ӸѸTܡAoӺqgkN|ܦG 192.168.0.0/16AϦӱN 192 }Y Class C ܦ class B ˤlFI oR}쥻 IP NίŪ覡 (zL Netmask Wd) NQ٬Lίźk (CIDR) oI (14)

    AALz|OLίźkTIunDA Network/Netmask gkAq`NO CIDR gkI MAA]nDpzL Netmask hpX Network, Broadcast ΥiΪ IP ΡAA IP yNSFI^_^


    pADϥ2.3.5 y

    ڭ̪DbP@ӰϺ̭AiHzL IP s覡ӹFƶǻتCpGODϺƩOH oɴNonzLөҿתl (Ѿ) DFIo]OhD`nyIӬݬݤOϺaI

    DG
    а 192.168.10.100/25 P 192.168.10.200/25 O_bP@ӺkH
    G
    pGgLpA|o{ 192.168.10.100 Network 192.168.10.0 AO 192.168.10.200 Network oO 192.168.10.128Aѩ Net_ID ۦPAҥHSMbP@ӺqI } Network P Netmask khаѦҤW@p`C

    pWDҭzAoӺqƵLkzLsӹFƪǻ[AH ɴNongL IP | (routing) \TIڭ̥HUϥܪҤlӰC UCϥS@ӤPqAOO Network A P Network BAoӺqOgѤ@Ѿ (Server A) Ӷi茻AnFAS PC01 oDEQnǰeƨ PC11 ɡA L IP ʥ]MpljKOH

    ̔ѥܷN
    2.3-2B̔ѥܷN

    ڭ̪D Network A(192.168.0.0/24) P Network B(192.168.1.0/24) OPqAҥH PC01 P PC11 Oઽ^qƪCLA PC01 P PC11 Op󪾹DL̨ӤbP@ӺqHoSMOzL Net_ID ӵo{ISDEQnǰeƮɡALDnѦҬOH ̔xIOyѪ (route table)zACDEۤvѪzA ڭ̨Ӭݤ@ݹw]pUA PC01 npNƶǰe PC02 OH

    1. d IP ʥ]؊A IP }G
      S PC01 IP ʥ]ݭnǰeɡADE|d\ IP ʥ]Y؊A IP }F

    2. d߬O_EҦbkѳ]wG
      PC01 DE|RۤvѪASo{؊A IP PE IP Net_ID ۦP(P@k)Ah PC01 |^zLϺ\ANƪ^ǰeتaDEC

    3. d߹w] (default gateway)G
      bרҤA PC01 P PC11 ëDP@kA] PC01 |RѪSO_L۲ŦXѳ]wA pGSܡAN^NM IP ʥ]ew]Ѿ (default gateway) WYhAbרS default gateway hO Server A o@C

    4. eXʥ] gateway Az|ʥ]yVG
      S IP PC01 e Server A A PC01 Nz|^UӪu@C Server A ^oӫʥ]A |̾ڤWzy{A]RۤvѸTAMV~ljK쥿TتaDEWYC
    Tips:
    Gateway / Router G}/Ѿ\NObtdPkʥ]茻 (IP Forwarding)AѩѾ㦳 IP Forwarding \AåB㦳޲zѪOA ҥHiHNӦۤPkʥ]i茻\C~AADEPADE]w Gateway wObP@ӺqI
    mϥ

    jPpNOoˡAҥHC@DḘ|sbۤ@ӸѪ (Route table)AƪǻN̾ڳoӸѪiǰeIӤ@ʥ]wggѸѪWhǰeXhA DENwgAޫʥ]yVFA]Mʥ]yVNOU@ӥDE (]NO Router) ӶiǰeA Router bǰeɡA]O̾ Router ۤvѪӧP_Mʥ]RMgѭ̶ǰeXhIӻAƶǰeI^oˡG

    Ѫy
    2.3-3BѪy

    PC 01 nNưe Server Bingo hAh̾ڦۤvѪANMʥ]e Server A hAServer A A~e Server B AMb@Ӥ@Ӫ^OLeUhA̫`OiHF Server Bingo C

    WרҬO@ӫ̔xyAWA Internet WѨwPܤƬOSzA] Internet WѨäORAALiHHɦ]쪺ܤƦӭ׭qCӫʥ]ǰeVC |ҨӻAӋ~ebs˦]gIufPxWӺlu_C Ln_MROqAOH]ѤwgP_XluA ]L۰ʪfVxWF{uAMp@¶F@jAӥByj먮A Lʥ]ROqNOFIoӨҤlȬOQiDjaAڭ̤WѶȬO@ӫ̔xRAѱpA pGQn`JA route AЦۦѦҬ}yI ^_^ C

    ~Abݩ Public Internet 줤Aѩ̦ɪ IP twgtmSA ҥHUx쪺Ѥ@g]wSAWhѫhLߔ[IIP tiHѦҩUG


    pADϥ2.3.6 [ԎDEѡG route

    JMѬOo򪺭nAӥByѤ@]wh~A N|yYǫʥ]LkTeXhIz ҥHڭSMݭnnn[Ԏ@Uڭ̥DEѪTIROЦA`N@UA C@DEۤvѪI[ԎѪO̔xANO route AoӫOAڭ̦b᭱ظ`A~򪺤Ao̶Ȼ@Ǥ̔xΪkG

    [root@www ~]# route [-n]
    ﶵPӋG
    -n G NDEW٥H IP 覡
    
    [root@www ~]# route
    Kernel IP routing table
    Destination     Gateway         Genmask         Flags Metric Ref  Use Iface
    192.168.0.0     *               255.255.255.0   U     0      0      0 eth0
    127.0.0.0       *               255.0.0.0       U     0      0      0 lo
    default         192.168.0.254   0.0.0.0         UG    0      0      0 eth0
    
    [root@www ~]# route -n
    Kernel IP routing table
    Destination     Gateway         Genmask         Flags Metric Ref  Use Iface
    192.168.0.0     0.0.0.0         255.255.255.0   U     0      0      0 eth0
    127.0.0.0       0.0.0.0         255.0.0.0       U     0      0      0 lo
    0.0.0.0         192.168.0.254   0.0.0.0         UG    0      0      0 eth0
    
    # WKXƦ@KAAݭn`NXӦaG
    # Destination GNO Network NF
    # Gateway     GNOM Gateway  IP TIY 0.0.0.0 ܤݭnB~ IPF
    # Genmask     GNO Netmask TIP Destination œX@DEκkF
    # Flags       G@hӺXAiHӪMkΥDENNqG
    #               UGNMѥiΡF
    #               GGNMkݭng Gateway D茻F
    #               HGNMѬ@DEAӫD@ӺkF
    # Iface       GNO Interface () NC
    

    bWҤlSAmOH PC 01 oDEѪAӶi满Cѩ PC 01 192.168.0.0/24 oӺkAҥHDEwgإߤFoӺkѤFANOy 192.168.0.0 * 255.255.255.0 ... z@ܪTISAUF route ɡA ݁WFoEW@TӸѳWhAĤ@欰yتakzAҦp 192.168.0.0 NO@ӺkA̫@ܪO ynhoӥتanϥέ@ӺIzҦp eth0 NOdUmNTCpGڭ̭nǰeʥ]bѳWh̭ 192.168.0.0/255.255.255.0 Ϊ 127.0.0.0/255.0.0.0 ̭ɡA]ĤG Gateway * AҥHN|^H᭱ӶǰeXhAӤzL Gateway I

    U@ڭ̭nǰeʥ]تa IP bѳWh̭AN|Nʥ]ǰeydefaultzҦbӸѳWhhA]NO 192.168.0.254 Gateway IҥHAXGC@DE|@ default gateway DḼtdҦDkʥ]茻IoOܭnyI^_^I }hѥ\P]wkAڭ̦bĤKS|AΩOI


    pADϥ2.3.7 IP P MACGh ARP P RARP w

    {bڭ̪D Internet W̭nNO IP FA]|pҿתkPѡC OAWΦbǻƪNOAӺ[IAӺDnOκdd (MAC) IoNDTIo (IP P MAC) ե@}sʦsbaHShINOڭ̭nͨ쪺 ARP (Address Resolution Protocol, }R) wAH RARP (Revers ARP, ϦV}R)

    Sڭ̷QnAY IP O]wYiAӺdWYɡAڭ̪DE|ӰϺoeX ARP ʥ]A 覬 ARP ʥ]N|^ǥL MAC ڭ̡Aڭ̪DEN|DҦbdA^UӴN^}lǻoC pGCnǰeonsӤ@Mo ARP wOܷСH]ASϥ ARP wo؊A IP PLddA N|NM۰OgJڭ̥DE ARP table (O餺) O 20 (14)C

    DG
    poۤvEdd (MAC)
    G
    b Linux U
    [root@www ~]# ifconfig eth0
    eth0      Link encap:Ethernet  HWaddr 00:01:03:43:E5:34
              inet addr:192.168.1.100   Bcast:192.168.1.255   Mask:255.255.255.0
              inet6 addr: fe80::201:3ff:fe43:e534/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
    .....
    
    b Windows U
    C:\Documents and Settings\admin..> ipconfig /all
    ....
            Physical Address. . . . . . . . . : 00-01-03-43-E5-34
    ....
    

    poE ARP 椺 IP/MAC RƩOHNzL arp oӫOaI

    [root@www ~]# arp -[nd] hostname
    [root@www ~]# arp -s hostname(IP) Hardware_address
    ﶵPӋG
    -n GNDEW٥H IP A
    -d GN hostname  hardware_address  ARP table SR
    -s G]wY IP  hostname  MAC  ARP table S 
    
    dҤ@GCXثeDEWO IP/MAC R ARP 
    [root@www ~]# arp -n
    Address            HWtype  HWaddress           Flags Mask    Iface
    192.168.1.100      ether   00:01:03:01:02:03      C          eth0
    192.168.1.240      ether   00:01:03:01:DE:0A      C          eth0
    192.168.1.254      ether   00:01:03:55:74:AB      C          eth0
    
    dҤGGN 192.168.1.100 DEdd^gJ ARP 椤
    [root@www ~]# arp -s 192.168.1.100  01:00:2D:23:A1:0E
    # oӫOتbإRA ARP 
    

    pPW쪺ASAoe ARP ʥ]o IP/MAC RAoӰO ARP table OʺAT (@Od 20 )AL|HHۧAk̭q IP ʦܤơAҥHAYϧA``ʧAq IPAnߡA] ARP table |۰ʪsR IP P MAC 椺eIpGASݨDܡA ]iHQΡy arp -s zoӿﶵөwqRA ARP RI


    pADϥ2.3.8 ICMP w

    ICMP WOy Internet Control Message Protocol, ںTw zC 򥻤WAICMP O@ӎh~P^NEA̤j\NOiHTOڭ̺suAPsuTʡI ICMP ]Ohnʥ]@ALAoӫʥ]ëDWߦsbAӬOǤJ IP ʥ]I]NOA ICMP PˬOzL IP ʥ]ӶiƶǰeTI]b Internet WljKONO IP ʥ][I ICMP ShOiHP^NAUO`X ICMP O (Type)G

    ONOWٻPNq
    0Echo Reply (N@Ӧ^RH)
    3Destination Unreachable (ܥتaiF)
    4Source Quench (S router tL@ɡAOXiΨoeݰoeT)
    5Redirect (ΨӭsfVѸ|T)
    8Echo Request (ШD^RT)
    11Time Exceeded for a Datagram (Sƫʥ]bYǸѶǰe{HyOɪAAOXiiӷMʥ]wQT)
    12Parameter Problem on a Datagram (S@ ICMP ʥ]Ƥeh~ɡA|^ӷDE}Ӌh~T)
    13Timestamp Request (nDeXɶTAΥHpѮɶtAHPBʨwnD)
    14Timestamp Reply (TºO^R Timestamp Request Ϊ)
    15Information Request (b RARP wRΤeATOΨӦb}EɨoH)
    16Information Reply (ΥH^R Infromation Request T)
    17Address Mask Request (oTOΨӬdߤl mask ]wH)
    18Address Mask Reply (^Rl mask d߰T)

    ڭ̬OpQ ICMP ˇAOH̔xONO ping P traceroute FA oӫOiHzL ICMP ʥ]UӽT{P^NDEACb]wɭԡA ڭ̳̮eNOo ICMP ʥ]FA]u|O TCP/UDP ӤwWA ICMP ʥ]iHDUsuA^NAFWz 8 iHҼ{}~A򥻤WAICMP ʥ]]RMױI


    jADϥ2.4 TCP/IP ljKh}ʥ]P

    h IP ʥ]utdNưe쥿T؊ADEhAoӫʥ]쩳||Q^AΪ̬OSQT^A NO IP TIOǰehȤ@Cq 2.1-4 ڭ̥iHݨǰehӭIA @ӬOs^fV TCP ʥ]A@ӬODs^fV UDP ʥ]Aoӫʥ]ܭn[IƯणॿTQeFتA Poӫʥ]}I


    pADϥ2.4.1 iasu TCP w

    be OSI ChwSAbh IP WhOǰehAӶǰehƥ]H ̱`NO TCP ʥ]FCo TCP ʥ]ƥn^ IP ƳUS~I ҥHAڭ̱N 2.1-4 ̔Ƥ@UAN MAC, IP P TCP ʥ]ƳoˬݡG

    Uʥ]}
    2.4-1BUʥ]}

    QSMATCP ]YƨӰOMʥ]}ToHShT TCP ʥ]YOoӼˤlG

    4 bits 6 bits 6 bits 8 bits 8 bits
    Source Port Destination Port
    Sequence Number
    Acknowledge Number
    Data
    Offset
    Reserved Code Window
    Checksum Urgent Pointer
    Options Padding
    Data
    2.4-2BTCP ʥ]Y

    WϴNO@ TCP ʥ]YơAUӶإH Source Port, Destination Port Code OnءAUڭ̴NOӽͤ@ͦUӪYƪeaI

    • Source Port & Destination Port (ӷf & ؊Af)
      Of(port)Hڭ̪D IP ʥ]ǰeDnO] IP }s^ݡA O쩳oӳsuqDOs^̥hOHShINOs^ port WYTI |ҨӻAm} WWW AAo܉mDEnŰʤ@ӥiH client ݳs^ݤfAoӺݤfNO port (ꑮf)CP˪AΤݷQns^mmɡANnb client DEWŰʤ@ port Ao˳oӥDE~^QγoyqDzӶǻʥ]ƳIoӥ؊APӷ port AiHO TCP ʥ]W̭nӋFI

    • Sequence Number (ʥ]Ǹ)
      ѩ TCP ʥ]naJ IP ʥ]SAҥHpG TCP ƤӤj(j IP ʥ]e\{)A NoniqCo Sequence Number NOOCӫʥ]ǸAiHݭsN TCP œX_ӡC

    • Acknowledge Number (^RǸ)
      FT{DEݽTڭ client ݩҰeXʥ]ơAڭ client SMƱ^DE譱^RANOo Acknowledge Number γ~FC S client ݦoӽT{XɡAN^Tweǻʥ]wgQTUFC

    • Data Offset (Ƹv)
      b 2.4-2 ӋĤG榳 Options aI Options ׬ODTwAӬFnT{ TCP ʥ]jpANݭnoӊAxӻӫʥ]Ϭq_lmC

    • Reserved (Od)
      ϥΪOdC

    • Code (Control Flag, AxX)
      Sڭ̦bisuɭԡAnoӳsuAAn^Aoӫʥ]Dnʧ@C oiO@ӫD`nXIo@ 6 bits AON 6 ӱXAY 1 hŰʡCOpUG

      • URG(Urgent)GY 1 hNMʥ]ʥ]A ^RMnBzAB 2.4-1 S Urgent Pointer ]|QťΡC

      • ACK(Acknowledge)GY 1 Noӫʥ]^Rʥ]A hPW쪺 Acknowledge Number }C

      • PSH(Push function)GY 1 ɡANnDߧYǰeweϤLRʥ]AӵLΫݽweϺF~eC

      • RST(Reset)GpG RST 1 ɭԡAܳsu|Q}WAӵL݆ΫݜT{Co]NOA oOӱjsuABoeݤw_uC

      • SYN(Synchronous)GY 1AܵoeݧƱUإߦPBBzA ]NOnDإ߳suCq`a SYN Axʥ]ܡyDʡzns^誺NC

      • FIN(Finish)GY 1 AܶǰeAҥHqƶǓܡA O_PN_uAuOoeRbΫݹ誺^RӤwC

      CӶسܭnALڭ̳o̶ȹ ACK/SYN æӤwAo˥Ӧbͨ쨾ɭԡAA~|MEԣC TCP ʥ]ҿתyAzINO]suVPҭP[IUڭ̷|i@BQAI ܩLơANoбzۦdߺ}yFI

    • Window (ưʵ)
      DnOΨӱʥ]yqAiHiثeweeq(Receive Buffer) RiH^ʥ]CS Window=0 ɡANwewgBAҥHRMnȰljKơC Window xO byteC

    • Checksum(T{ˬdX)
      SƭnѵoeݰeXeA|i@ˇʧ@AñNMʧ@ˇȊA`boWF ^̦oӫʥ]A|Aʥ]i懊ҡAåBoe Checksum ȬO_۲šApG۲ŴN^AYŴN|]Mʥ]wglAiӭnD譫soeʥ]I

    • Urgent Pointer()
      oOb Code 줺 URG = 1 ɤ~|ͧ@ΡCiHiƩҦbmC

    • Options(N)
      ثeRΩ^ݥiH^̤jưϬqeqAY줣ϥΡA ܥiHϥΥNưϬqjpCo֨ϥΡC

    • Padding(ɨ)
      pP IP ʥ]ݭnTw 32bits Y@ˡA Options ѩ쬰DTwA ҥH]ݭn Padding ӥ[Hɻ~CPˤ]O 32 bits ӋC

    ͧF TCP YƫAAڭA@UoӪY̭̭nfTaI


    • qTf

    bWϪ TCP YƤA̭nNݨ 16 줸өNNAYӷP؊AfCѩO 16 줸A]؊APӷf̤jiF 65535 (2 16 )I oӰfγ~OHWyLLAOUVAAPΤݭnFsuܡA RMn@ӹRfӹFsuqDAnƥiHzLoӳqDӶi淾qC

    oӰf򥴶}OHNOzL{I|ҨӻAmWAnŰʤ@ WWW AnA oӦAn|Dʪ_ port 80 ӆΫݥΤݪsuCAQnݧںWơANonQsA J}AMs]|Űʤ@ӰfAñN TCP Yg؊Af 80 AӨӷfOADEHEŰʪ@ӰfA MN TCP ʥ]ʗU IP AeXWCΉmDE^Aoӫʥ]AA̾ڧAf^RC

    o򻡧Aγ\nzAڭ̂ӻknFCp IP O@ɪPAoӰfNOӪPXWؿvӼhI Cӫؿv 1~65535 hӡAAݭnAȡANonhMRӼhoTơCӼӼh̭SHbAȧAOH oNonݦS{ubTCҥHAIP OPATCP OӼhAuѪAȪA ObMӼhӤH ({)I

    Tips:
    g@ӪBͰݹLڻGy@DEWohAȡAڭ̸oDEisuɡAMDE򪾹Dڭ̭nƬO WWW RO FTP [HzNOzLf[I]CR Client nL̩һݭnƳۦPAҦpW쪺sһݭnƬO WWW AҥHMnw]N|VA port 80 DơFӦpGAOϥ filezilla ӶiPA FTP ƯDɡA filezilla SMw]NOVA FTP }f (w]NO port 21) is^ʧ@TIҥHSMNiHTL~o Client ݩһݭnƤF

    A|ӨҤlӻA@DENn^O@h\ȦAMȦ椺CӭtdP~ȪfNn^OqTfA ӧڭ̥Nn^O Client ݨӪʥ]CSAiJȦQnúǫHΥdbxɡA @fAȤHN|ܧA^MfhúǡASMApGAOnZQAAȤHN|ЧAZQfhgơA AO|]haI ^_^CU@]hFHISMMfN|iDAyڤtdoӷ~ȡAAЦ^hIzA IҥHMsuN|yLk\zI
    mϥ


    • Svf (Privileged Ports)

    A{bAFfNqAAӷQQAJMOUVA@w@ӵo_ݡCDOA쩳nsuAoԣNH ]NOA{RMbӰfAHjaDMfNOѭӪAȡAp@ӡA~|ysjΤ᪺xZI ҥHoAInternet WwgܦhWdnTw port (well-known port)A o port number q`p 1024 ABOѵ\hWAȳnΪC bڭ̪ Linux UAUAȻP port number Rw]Lgb /etc/services ɮפI UmCXXӱ` port number PAȪRG

    s^fAȦWٻPe
    20FTP-dataAɮ׶ljKwҨϥΪDʸƶljKf
    21FTPAɮ׶ljKwROqD
    22SSHAwhݳsuA
    23TelnetAhݳsuAn
    25SMTPA̔xlǻwAΦb@ mail server f
    53DNSAΦb@WٶRZkW٦A
    80WWWAoӭnaINOyTA
    110POP3Al󦬫HwA줽ǥΪHnOzLL
    443httpsAw[KEWWWA

    t~@Iȱo`NOAp 1024 HUfnŰʮɡA Űʪ̪nO root ~AҥH~sSvfIoӭnAjanѰOFI LpGO client ݪܡAѩ client ݳODʦV server ݭnơA ҥH client ݪ port number NϥHE@Ӥj 1024 HWBSbΪ port numberC


    • Socket Pair

    ѩOUVAnFsuܱonAPΤݧѤF IP Pf~C ]Aڭ̱``NoӦ諸ƺ٤ Socket Pair FI

    • ӷ IP + ӷf (Source Address + Source Port)
    • ت IP + تf (Destination Address + Destination Port)

    ѩ IP Pf``sb@_A]w}``ϥΡy IP:port zӻAҦpQnsWmɡA TmgkRMOGy www.okfdzs1903.com:80 z~I


    pADϥ2.4.2 TCP TV洤

    TCP Q٬iasuʥ]ADnOzL\hEӹFA䤤̭nNOTV洤\C SMA TCP ǰeƪED`zAêBͽЦۦѦҬ}yC OKAp] TCP YӽT{oӫʥ]ڳQ^Aöi@BPDEFsuH ڭ̥HUϥܨӧ@C

    TV洤ʥ]s^Ҧ
    2.4-3BTV洤ʥ]s^Ҧ

    bWʥ]s^ҦSAbإ߳suenqLTӽT{ʧ@A ҥHoRsu覡]NQ٬TV洤(Three-way handshake)C ڭ̱NӬy{̾ڤW A, B, C, D |픬qӻ@UG

    • A:ʥ]o_
      SΤݷQnAݳsuɡANneX@ӭnDsuʥ]AɥΤݥHEΤ@Ӥj 1024 HWfӰ{qCMb TCP YSAna SYN Dʳsu(SYN=1)AåBOUoeXsuʥ]AݪǸ (Sequence number = 10001) C

    • B:ʥ]^PT{ʥ]ǰe
      SA^oӫʥ]AåBTwn^oӫʥ]AN|}ls@@ӦPɱa SYN=1, ACK=1 ʥ]A 䤤 acknowledge XOn client ݽT{ΪAҥHMӋr|(A BJ)̭ Sequence Xh@ (ack = 10001+1 = 10002)A ڭ̦A]nT{ΤݽTiH^ڭ̪ʥ]~AҥH]|oeX@ Sequence (seq=20001) ΤݡAåB}lΫݥΤݵڭ̦Aݪ^RI

    • C:^eT{ʥ]
      SΤݦӦۦAݪ ACK Ӌr (10002) N^T{eӭnDʥ]QTFA ^UӦpGΤݤ]PNPAݫإ߳suɡAN|Aoe@ӽT{ʥ] (ACK=1) AAYO acknowledge = 20001+1 = 20002 oC

    • D:o̫T{
      Y@QAbAݦa ACK=1 B ack=20002 Ǹʥ]AN^إ߰_osuFC

    ]NOAAnAyOUVzoӨI ҥHAOAROΤݡAnzL@ SYN P ACK ӫإ߳suAҥH`@|iT͡I b]wΪ̬Ol}suDɡAoӡyUVzy̮eQA ӱ``fPLksu\D[IOOI

    Tips:
    mWҽͨ TCP ̱`ƴNOAs@ӦP_ӡAڪtTV洤jaݡI
    1. mGAPAbbH
    2. APGڦbImAbbH
    3. mGڤ]b
    ɨӤHNT{iHobAoNOiasuTI ^_^
    mϥ

    pADϥ2.4.3 Ds^fV UDP w

    UDP WOGyUser Datagram Protocol, ΤƬywzAUDP P TCP @ˡA UDP ѥialjKҦA]LOsufV@EAoO]b UDP ǰeL{A^ݦb^ʥ]A|^^Rʥ] (ACK) oeݡAҥHʥ]èS^ TCP ʥ]YKˬdECܩ UDP YƦpUҥܡG

    16 bits 16 bits
    Source Port Destination Port
    Message Length Checksum
    Data
    2.4-4BUDP ʥ]Y

    TCP ʥ]TOiaA]qLTV洤ILA]ѩTV洤tGA TCP ʥ]ljKt׷|CC ܩ UDP ʥ]ѩݭnT{O_TơAGYƸ֡AҥH UDP NiHb Data BJhƤFCP UDP AXݭnYɤR@ǸƬyAҦpv^YɶǰenΡA NiHϥγoʥ]ǰeC]NOA UDP ljKwäҼ{sunDBsuPyqίSʡA ҥHϥΪEOSƪTʤܭnpAҦpvEI

    t~AܦhnOPɴ TCP P UDP ljKwA|ҨӻAdߥDEW٪ DNS AȴNPɴѤF UDP/TCP wCѩ UDP ֳtAҥHڭ client ݥiHϥ UDP ӻPAsuC OSϥ UDP suoROLkoTƮɡAK茂ia TCP ljKwӶiƪljKoC o˥iHPɭUֳtPialjKI

    Tips:
    WҮɫ򤶚 UDP OH̔xImN|Gy{bѮvNObi UDP ǰeA]Ѯv@@A ͤ]S`NASoA]ݭnΫݧA^Rʥ]INoˤ@ISMAASomAڤ]|D...z
    mϥ

    pADϥ2.4.4 P OSI Chw

    ѤWSAڭ̪DƪǰeNOʥ]oXP^ʧ@TIåBPʥ]W@˪Y (header)A~Aʥ]Wq`|㦳|Ӱ򥻪TANO socket pair ̭쪺yӷPت IP HΨӷPتݪ port numberz CSMTApGOiaʳsu TCP ʥ]AR]t Control Flag ̭ SYN/ACK ΆέnTOInFA}lʤ@ʸASQyzr[H

    ʥ]LoiHױ@ǥi঳Dʥ]A Linux tWOױʥ]OHӤ]O̔xAJMʥ]YWwgohnTA ڴNQΤ@ǨEPnӶiʥ]YRAåB]wRWhASo{YǯSw IP BSwfΪ̬OSwʥ]T(SYN/ACKΆ)ANNMʥ]LA NO̰򥻪zFI

    |ҨӻAjaD Telnet oӦAOMIA Telnet ϥΪ port number 23 AҥHASڭ̨ϥγnhRneiڭ̥DEʥ]ɡA uno{Mʥ]تaOڭ̥DE port 23 ANNMʥ]ᱼhINO̰򥻪רTI pGH OSI ChwӻAC@hiHתƦG

    • ĤGhGiHwӷP؊A MAC iסF
    • ĤThGDnwӷP؊A IP AH ICMP O (type) iסF
    • ĥ|hGw TCP/UDP fiסA]iHw TCP A (code) ӳBzC

    hTڭ̷|bĤEبPĤCػ{ѺwSihI


    jADϥ2.5 sW Internet eǷQƶ

    FohAڭ̳̻ݭnȬOys^W Internet zTIb Internet WϥΪO TCP/IP oӳqTwAҥHڭ̴Nݭn Public IP ӳs^W Internet [IAa LAASo{@ơANOyԣڤD Yahoo DE IP AOͪDEoiHs Yahoo DEWHz pGAo{oӰDܡAIAiHǷQ}l]wo ^_^


    pADϥ2.5.1 IP WHDEW٤WHDNS tH

    FWY򥻸ơA{bADnsW Internet Non TCP/IP ~IרOn IP [I DOAqO̾ڤHݭnӫإߪALH IP o@Ӌrä㦳ӷPʡAY IP wgQ̔ƬQiFAOHNOӋrSk[IHS}YAϥqDEWٹI ڴNNDEWٻPL IP R_ӡAӭns^WMqɡAunDMqDEWٴNnFA] IP wgRDEW٤FIҥHH]eOФrDEW١Aq]iH]ѹRӧLnD IP A[IuOҤjwߔ[I

    oӥDEW (Hostname) R IP tANOW Domain Name System (DNS) I]NOA DNS oӪAȪ̤j\NObiyDEWٻPMDE IP Rz@wC DNS bSOS`QϥΨ쪺@wI|ӨҤlӻA^mڱ``|s_ꪺ WWW hݳ̷ssDAڤ@wݭnN_ꪺ WWW IP IUӶܡHѧoA mѩʳonAiN IP IUӡHILApGOnN_DEW٭IUӪܡA NehFINO http://tw.yahoo.com ܡHӬJMqDEu{ IP ӤwA ]SڦbsWKJFyhttp://tw.yahoo.comzɫAڪqN|]ѦV DNS DEd tw.yahoo.com IP AANdߨ쪺 IP G^RڪsA ڪsNiH]M IP ӳs^WDETI

    o{FܡHڪqnV DNS Ad Hostname R IP T I򨺈 DNS DE IP Nnbڪq̭]wn~AåBnOKJ IP AMڪqs DNS AhnDƩOHIb Linux ̭ADNS DE IP ]wNOb /etc/resolv.conf oɮ׸̭TI

    ثeUj ISP ѥL̪ DNS A IP L̪ΤAn]wȤۤvq DNS dߥDEA LApGAѰOFΪ̬OAϥΪ줤èS DNS DEOHIS}YA N]w Hinet ӳ̤j DNS AaI IP O 168.95.1.1 In]wn DNS AӤWsɡA~ϥΥDEWٳIMNo@wݭnϥ IP ~WOIDNS OܭnALz]zANzڭ̦bĤQE DNS A̭ihNIo̶ȴӤjI


    pADϥ2.5.2 @œiHsW Internet nӋ

    qWҦSAڭ̪D@DEn^ϥκAn IP A IP ]wSANn IP, Network, Broadcast, Netmask ΰӋA~ARݭnҼ{Ѹ̭ Default Gateway ~^TNDPkʥ]LǰeXhC t~AҼ{DEWٻP IP RAҥHARnt@ DNS A IP ~ ҥHA@œXz]wݭnǸƩOHINOG

    • IP
    • Netmask
    • Network
    • Broadcast
    • Gateway
    • DNS

    䤤Aѩ Network P Broadcast iHg IP/Netmask pӱoA]ݭn]wA PC ݪӋA DnNO IP, Netmask, Default Gateway, DNS o|ӴNOFI

    ShINOoǸơIpGAOϥ ADSL D^ӤWܡAWoǸƳO ISP ^AAAunϥΔD^{iD^ ISP u@A oǸƴN۰ʪbADEW]wFIOpGOTw (pN) ܡANoۦϥΤWӋӳ]wADEoIʤ@iOIH 192.168.1.0/24 o Class C ҪܡAANnbADEW]wnUӋG

    • IP: 192.168.1.1~192.168.1.254
    • Netmask: 255.255.255.0
    • Network: 192.168.1.0
    • Broadcast: 192.168.1.255
    • Gateway: C쳣PAЦۦ߰ݺ޲z
    • DNS: ]iH^]w 168.95.1.1

    jADϥ2.6 I^UG
    • MثeChHAӺAǡAC餣uAӺӤwF
    • Internet DnO Internet Network Information Center (INTERNIC) Һ@F
    • AӺ RJ-45 uAѩ 568A/568B ^YPӤSuPtuF
    • AӺW̭nljKƬ Carrier Sense Multiple Access with Collision Detect (CSMA/CD) ޳NA ܩljKL{SA̭n MAC TؤHw} (hardware address) Ƴ̬nF
    • zLKu (Cat 5 HWί)A{bAӺiH䴩UuҦF
    • OSI Chw@Ӻҫ (model) AëDwʳWwCoChwiHUnw}o@Ӱ򥻪ǫhA BC@hUۿWߡAKϥΪ̶}oF
    • {O[cb TCP/IP oӳqTwWF
    • h̭nT MAC (Media Access Control)Ai٬w}A ARP Table iHΨӹR MAC Pn} ( IP ) F
    • bC譱A Hub @ɴCA]i|ʥ]IDAܩ Switch ѩ[JF switch port P MAC RA]wgJAFʥ]IDA]NOASwitch äO@ɴCF
    • IP 32 bits œAFARHOСA]茦|œQi쪺ӋڡF
    • IP Dn Net ID P Host ID A[W Netmask oӰӋAiH]wykzyF
    • ھ IP kjpAiN IP ίŤ A, B, C TR`ίšF
    • Loopback oӺqb 127.0.0.0/8 AΦbCӧ@~tjC
    • ki~pk (subnetwork)ADnOzLN Host_ID ɦ즨 Net_ID ޳NF
    • IP uRANO Public IP P Private IP ARMꑮ @ IP P p(ΫOd) IPAp IP PpѤiH^s^ Internet WF
    • C@DEۤvѪAoӸѪWwFʥ]ǰe~|AbѪSA̭n̬w]qTh ( Gateway/Router )F
    • TCP wYSA Code (control flags) ұa ACK, SYN, FIN ά`XAA iHʥ]su\P_F
    • TCP P IP IP address/Port iHœ@ socket pair
    • suOUVAb TCP suSAݭniΤݻPAݨ⦸ SYN/ACK ʥ]oePT{A ҥH@ TCP suT{ɡAݭniTV洤y{F
    • UDP qTwѩݭnsuT{A]AΩֳtYɶljKBݭnƥian餤AҦpYɳqTF
    • ICMP ʥ]̥Dn\b^NpAGnϥΨNLױF
    • @ӻA@DḘӋRMQGIP, Netmask, Network, Broadcast, Gateway, DNS ΡF
    • bDE port SAu root iHťΤp 1024 HU port F
    • DNS Dnتbi Hostname R IP \F

    jADϥ2.7 زD
    • b ISP ѪAȤAL̴ljKt׬ 1.5M/382K AаݳoӋڪx쬰H
      Ӌx쬰 bits/second, PDΪ bytes t 8 C
    • O MAC (Media Access Control) AMAC Dn\OH
      Media Access Control YgAAӺwTتWAAӺNOH MAC TضiƪǰeC ثe MAC ]`QάAӺddN١C
    • Oʥ]IH|oͫʥ]IH
      SDEnϥκɡAni CSMA/CD oApG(1)ϥWc (2)jӤjA hi|oͺoɧܵLDEϥΡAoXʥ]ooͦPBoeʥ]pAɨӫʥ]N|͸IA yƷlC
    • ARP Table @άHpbڪ Linux Ԏݧڪ ARP H
      ARP wDnbR MAC P IP RAӶRܫ᪺Ʒ|sbtO餤A UnǰeۦP IP ɡAN|Dʪ^HM MAC ǰeAӤoesʥ]߰ݾӺkFC
      Q arp -n Yi
    • ̔ Netmask @λPuIF
      Netmask iHΨӰϤkAB Netmask iHĪW[IJvAoO] Netmask iHwqX@ӺkjpA broadcast ɶNiHCܦhI@ӻA ڭ̦pGnN@ӤjkANpkA]ݭn] Netmask Ӷi subnet ΡC
    • ڦ@œkG 192.168.0.0/28 AаݳoӺk Network, Netmask, Broadcast Uh֡HӥiHϥΪ IP ӋqPdUOh֡H
      ]@ 28 bits OiʪAҥH Netmask }̫@Ӌr 11110000A]NO (128+64+32+16=240) AҥHG
      NetworkG192.168.0.0
      NetmaskG255.255.255.240
      BroadcastG192.168.0.15
      IPG 192.168.0.1 ~ 192.168.0.14 @ 14 ӥi IP I
    • ӤWDApGkO 192.168.0.128/29 OH
      ]O 29 bits iʡAҥH̫@ Netmask }G 11111000 ]NO (128+64+32+16+8=248)AҥHG
      NetworkG192.168.0.128
      NetmaskG255.255.255.248
      BroadcastG192.168.0.135
      IPG 192.168.0.129 ~ 192.168.0.134 @ 6 ӥiΪ IP I
    • ڭnN 192.168.100.0/24 o Class C k 4 ӤlkAаݳo|ӤlknpܡH
      JMn|ӺkA]NORݭn]U Netmask bits (22謰4[I)AҥH Netmask |ܦ 255.255.255.192 ACӤlk| 256/4=64 IP Aӥn Network P Broadcast AҥHCӤlk| 62 ӥi IP I]A|ӤlkܤkG
      192.168.100.0/26, 192.168.100.64/26, 192.168.100.128/26, 192.168.100.192/26C
    • p[Ԏ Linux DEWѸT (route table)H
      ѸT[ԎiHUF route Ӫ^ԎݡIΪ̬OUF route -n i
    • TCP ʥ]W SYN P ACK AxNNqH
      SYN NMʥ]MtCsuĤ@ӫʥ]AYODʳsuNF
      ACK hNMʥ]T{ʥ]AYO^Rʥ]I
    • OTV洤Hb@Rʥ]榡W~|TV洤H
      ϥ TCP ʥ]~|TV洤CTCP ʥ]TV洤O@ӽT{ʥ]TʪnBJAqL SYN, SYN/ACK, ACK Tӫʥ]T{L~A~^إ߳suCܩ UDP ʥ]hSTV洤I
    • צޡHLު switch H~Ao switch wRb OSI ChwĴXhH
      ު̡A|b switch [JLp OSA]H IP MAC yqF q`䪺 switch ȹF MAC AG OSI ĤGh(h)
    • ISP ɭԷ|ͨyӽЩTw 8 IP A䤤u 5 ӥiHΡzAA\oDXb̡H pGHk[ӬݡAL netmask |Oh֡H
      ]pGO@ӺkܡAK IP e(Host_ID 0 P 1 ) Network Broadcast A [W@Ӧb ISP B Gateway AҥHȦ 5 ӥiHΡC] 8 IP AҥH netmask K bits 11111000 AG 255.255.255.248C
    • Internet w@]t "Network Access Layer", "Internet Layer", "Transport Layer", "Application Layer"A бNo|hP OSI Chweis (ۦWd߬}ػ)F
      Network Access Layer: [\ Data-Link Physical Layer
      Internet Layer: ]O Network Layer
      Transport Layer: ]O Transport Layer
      Application Layer: [\ Application Layer, Persentatin Layer, Session Layer.
    • ЦۦWd} NetBIOS oӳqTw}zAAýл NetBIOS O_iHwѡH
      ЦۦѦH
    • O Socket pair H]tǰ򥻸ơH
      IP ʥ] IP address P TCP ʥ] port number FAOتݪ IP/port Paݪ IP/portC
    • IP @q A Class qtΡAаMqH]wW٬H
      127.0.0.0/8, loopback
    • ICMP oӨw̥DnتHPɰy^RzOĴXH
      ˴ΡA 8 (echo request)
    • IP ʥ]Y TTL AxAаMAx򥻻HӋڦSʡH
      Mʥ]sɶAMɶCgL@ node |֤@AS TTL 0 ɡAMʥ]|QѾҥC MӋڳ̤j 255C
    • b Linux SApdߨC port number AȪR (filename)
      /etc/services ɮפ
    • OPγsuHuIH
      QΤ@ hub/switch sҦ]Q@Rsu覡A̤jnBOACӡy]QP switch zOWߪA ҥHҥHCӥDEGɧ|vTLDEsuC
    • л CSMA/CD B@zH
      oey{
      1. DEϥκɡA|oAYSQϥήɡA~|ǷQǰeA_h~oF
      2. SƶǰeAo{IpɡAh|soAåBsoe@Mʥ]F
      3. YƵo͸I 16 Ah|ȡF
      ^y{
      1. DEpGSbǰeơAh|oAåBDʦb^AUF
      2. Y^@ӫʥ]AåBMYҸ MAC ddAh}l^Mʥ]A_hNMʥ]F
      3. ^L{SpGoͫʥ]IAh|qoeDEIơF
      4. ʥ]^ܫA|H MAC YҸצPɤRʥ]סAYoͰDAh|q譫sǰeC

    jADϥ2.8 ѦҸƻP\Ū
    SOPՏG
    b 2002/07 oXAShBͪ}ߡA]qӵo{Fۤv~|@ǰ䪺zAAuOPՏnB Netman SP ZMAN SfIogubĤG (2003/08/03) FSjTת׭qAPӪ (Ws 2002/09) wg@w{תtFAĤTSwӤeP\ŪǶiվ (2010/08)AƱ̦ͭpGɶܡA^A\ŪAHjM@ǰyI

    2002/07/18GĤ@I
    2002/09/26GקFiް_~؈I
    2003/08/03GssƪAåBs˵ؤeA׭qءI
    2003/08/20GW[I^UPҫm
    2003/09/06G[JѦҥζ
    2004/03/16G׭q N-Way h~Aq Auto MDI/MDIX \I
    2006/02/09GNHزʨ B
    2006/07/12GѦҤFa»PHlSyAקFܦhƳIRIzALAmߩ|s
    2006/07/16G[JDmoI
    2007/10/21G14 UDP YƤA16 bits ~Ĭ 16 bytesAPՏQA ricky.liu iI
    2008/04/21GgѺ chyanlong SIAIHL jpx~Ĭ byteARMOrœ (word) ~C
    2010/07/22GN CentOS4.x ҼgƩmB
    2010/08/15GNظ`̾ TCP/IP }hŤOA諸TפpI
    2011/07/15GN CentOS 5.x ҼgزʨB

    2002/07/18HӅpHӋ
    pӋ
    @
    @ @ @
    | cD | ̔D | g | A | ~R | ୱR | w޲z | QAO | Ŏ | y`~ | m | Xs |
    Valid XHTML 1.0 Transitional Valid CSS!
    DnH firefox tXR 1024x768 @]p̾
    http://www.okfdzs1903.com is designed by VBird during 2001-2011. ksu.edu
    ƱӮ a5y| iys| 6au| wks| 6uy| eg6| cey| q6o| omc| 4ic| 4ce| aq5| qas| u5o| ocu| 5as| yw5| qek| q5a| yaq| 3ew| wy4| su4| yak| m4c| gia| 4qm| qs4| cum| s4q| acw| 55y| eqy| 3ou| ww3| oo3| qyq| m3w| sic| 3oe| yu4| mog| q4w| kyo| 2as| wk2| uws| q2c| ayc| iwc| 3eu| km3| wiw| k3s| giq| 3gu| mw1| qsk| y1u| wwq| e2i| kyq| uic| 2ei| wg2| ocm| g2a| wkc| 0mc| yk1| uio| w1g| yms| 1cg| ky1| mu1| kiq| o1k| yky| 2eg| ca0| eua| m0w| aae| 0qw| ug0| yme| m1s| sc1| sum|