@mhg/blog
Version:
1 lines • 227 kB
HTML
<!DOCTYPE html><html lang="zh-Hans"><head hexo-theme="https://github.com/volantis-x/hexo-theme-volantis/#6.0.3"><meta name="generator" content="Hexo 8.1.2"><meta name="Volantis" content="6.0.3"><meta charset="utf-8"><meta name="robots" content="index,follow,max-image-preview:large"><link rel="canonical" href="https://blog.mhuig.top/notes/datacom/6"><meta http-equiv="x-dns-prefetch-control" content="on"><link rel="dns-prefetch" href="https://static.mhuig.top"><link rel="preconnect" href="https://static.mhuig.top" crossorigin=""><meta name="renderer" content="webkit"><meta name="force-rendering" content="webkit"><meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1"><meta name="HandheldFriendly" content="True"><meta name="mobile-web-app-capable" content="yes"><meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=5"><meta content="black-translucent" name="apple-mobile-web-app-status-bar-style"><meta content="telephone=no" name="format-detection"><script>function registerServiceWorker(e){"localhost"!=window.location.hostname&&"serviceWorker"in navigator&&navigator.serviceWorker.register(`${e}`).then((function(e){"localhost"==window.location.hostname&&(e.onupdatefound=function(){var r=e.installing;r.onstatechange=function(){switch(r.state){case"installed":navigator.serviceWorker.controller?console.log("Updated Service Worker."):console.log("Service Worker Sucess!");break;case"redundant":console.log("The installing service worker became redundant.")}}})})).catch((function(e){console.error("Error during service worker registration:",e),"undefined"==typeof swinstallretry&&(swinstallretry=1,registerServiceWorker("/jquery.js"))}))}registerServiceWorker("/jquery.js")</script><link rel="apple-touch-icon" sizes="180x180" href="/lib/favicon/apple-touch-icon.png"><link rel="icon" type="image/png" sizes="32x32" href="/lib/favicon/favicon-32x32.png"><link rel="icon" type="image/png" sizes="192x192" href="/lib/favicon/android-chrome-192x192.png"><link rel="icon" type="image/png" sizes="144x144" href="/lib/favicon/android-chrome-144x144.png"><link rel="icon" type="image/png" sizes="16x16" href="/lib/favicon/favicon-16x16.png"><link rel="manifest" href="/lib/favicon/site.webmanifest"><link rel="mask-icon" href="/lib/favicon/safari-pinned-tab.svg" color="#5bbad5"><meta name="apple-mobile-web-app-title" content="MHuiG Magicland"><meta name="apple-mobile-web-app-status-bar-style" content="black"><meta name="application-name" content="MHuiG Magicland"><meta name="msapplication-TileColor" content="#87ceeb"><meta name="msapplication-TileImage" content="/lib/favicon/mstile-144x144.png"><meta name="theme-color" content="#87ceeb" media="(prefers-color-scheme: light)"><meta name="theme-color" content="#21232f" media="(prefers-color-scheme: dark)"><link href="/opensearch.xml" rel="search" title="MHuiG Magicland" type="application/opensearchdescription+xml"><link rel="sitemap" type="application/xml" title="MHuiG Blog Site Map" href="https://blog.mhuig.top/sitemap.xml"><link rel="author" href="https://mhuig.top"><meta name="author" content="MHuiG"><meta name="creator" content="MHuiG"><link rel="archives" href="https://blog.mhuig.top/archives/"><link rel="preload" href="/css/style.css" as="style"><link rel="preload" href="https://static.mhuig.top/npm/volantis-static@0.0.1660614606622/media/fonts/VarelaRound/VarelaRound-Regular.ttf" as="font" type="font/ttf" crossorigin="anonymous"><link rel="preload" href="https://static.mhuig.top/npm/volantis-static@0.0.1660614606622/media/fonts/VarelaRound/VarelaRound-Regular.ttf" as="font" type="font/ttf" crossorigin="anonymous"><link rel="alternate" href="/atom.xml" title="Magicland" type="application/atom+xml"><link rel="alternate" href="/rss2.xml" title="Magicland" type="application/rss+xml"><title>数据通信网络: IP编址 - Magicland</title><meta name="keywords" content="Web,计算机网络, 数据通信网络,IPv4地址结构,子网划分技术,VLSM/CIDR应用,MHuiG, @MHuiG, Blog, 博客, Magicland, 魔法世界"><meta desc="" name="description" content="本文详解IPv4编址体系,32bit地址含网络位与主机位,通过子网掩码区分(1标识网络位)。涵盖A/B/C类有类地址分类、私有地址范围(如10.0.0.0/8)及特殊地址(0.0.0.0、广播地址)。解析IP报文头部字段(TTL生存周期、Protocol协议类型),提供VLSM子网划分(借位计算子网数与可用地址)及CIDR汇总方法,附网络/广播地址计算实例与公式(可用地址=2^h-2,h为主机位)。 - MHuiG - Magicland"><meta property="og:type" content="website"><meta property="og:title" content="Magicland"><meta property="og:url" content="https://blog.mhuig.top/notes/datacom/6"><meta property="og:site_name" content="Magicland"><meta property="og:description" content="本文详解IPv4编址体系,32bit地址含网络位与主机位,通过子网掩码区分(1标识网络位)。涵盖A/B/C类有类地址分类、私有地址范围(如10.0.0.0/8)及特殊地址(0.0.0.0、广播地址)。解析IP报文头部字段(TTL生存周期、Protocol协议类型),提供VLSM子网划分(借位计算子网数与可用地址)及CIDR汇总方法,附网络/广播地址计算实例与公式(可用地址=2^h-2,h为主机位)"><meta property="og:locale"><meta property="og:image" content="https://blog.mhuig.top/lib/favicon/android-chrome-192x192.png"><meta property="article:published_time" content="2023-12-06T01:30:00.000Z"><meta property="article:modified_time" content="2025-11-20T10:18:00.000Z"><meta property="article:author" content="MHuiG"><meta property="article:tag" content="IPv4地址结构"><meta property="article:tag" content="VLSM/CIDR应用"><meta property="article:tag" content="子网划分技术"><meta property="article:tag" content="数据通信网络"><meta name="twitter:card" content="summary"><meta name="twitter:image" content="https://blog.mhuig.top/lib/favicon/android-chrome-192x192.png"><meta name="twitter:creator" content="@iMHuiG"><meta name="twitter:site" content="@iMHuiG"><style>#safearea{display:none}.post-story+.post-story{content-visibility:auto;contain-intrinsic-size:10px 500px}:root{--color-site-body:#87ceeb;--color-site-bg:#87ceeb;--color-site-inner:#555;--color-site-footer:#666;--color-card:#fff;--color-text:#444;--color-block:#f6f6f6;--color-inlinecode:#d56d28;--color-codeblock:#fff7ea;--color-h1:#3a3a3a;--color-h2:#3a3a3a;--color-h3:#333;--color-h4:#444;--color-h5:#555;--color-h6:#666;--color-p:#444;--color-list:#666;--color-list-hl:#1a78c2;--color-meta:#888;--color-read-bkg:#e0d8c8;--color-read-post:#f8f1e2;--color-copyright-bkg:#f5f5f5}*{box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;outline:0;margin:0;padding:0}::-webkit-scrollbar{height:4px;width:4px}::-webkit-scrollbar-track-piece{background:0 0}::-webkit-scrollbar-thumb{background:#2196f3;cursor:pointer;border-radius:2px;-webkit-border-radius:2px}::-webkit-scrollbar-thumb:hover{background:#ff5722}html{color:var(--color-text);width:100%;height:100%;font-family:"Varela Round","PingFang SC","Microsoft YaHei",Helvetica,Arial,Menlo,Monaco,monospace,sans-serif;font-size:16px}html>::-webkit-scrollbar{height:4px;width:4px}html>::-webkit-scrollbar-track-piece{background:0 0}html>::-webkit-scrollbar-thumb{background:#2196f3;cursor:pointer;border-radius:2px;-webkit-border-radius:2px}html>::-webkit-scrollbar-thumb:hover{background:#ff5722}body{background-color:var(--color-site-body);text-rendering:optimizelegibility;-webkit-tap-highlight-color:transparent;line-height:1.6;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}body.modal-active{overflow:hidden}@media screen and (max-width:680px){body.modal-active{position:fixed;top:0;right:0;bottom:0;left:0}}a{color:#2196f3;cursor:pointer;text-decoration:none;transition:all .28s ease;-webkit-transition:all .28s ease;-khtml-transition:all 0.28s ease;-moz-transition:all .28s ease;-o-transition:all .28s ease;-ms-transition:all .28s ease}a:hover{color:#ff5722}a:active,a:hover{outline:0}ol,ul{padding-left:0}ol li,ul li{list-style:none}header{display:-webkit-box;display:-moz-box;display:block}img{border:0;background:0 0;max-width:100%}svg:not(:root){overflow:hidden}hr{-moz-box-sizing:content-box;box-sizing:content-box;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;height:0;border:0;border-radius:1px;-webkit-border-radius:1px;border-bottom:1px solid rgba(68,68,68,.1)}button,input{color:inherit;font:inherit;margin:0}button{overflow:visible;text-transform:none;-webkit-appearance:button;cursor:pointer}@supports (backdrop-filter:blur(20px)){.blur{background:rgba(255,255,255,.9)!important;backdrop-filter:saturate(200%) blur(20px)}}.shadow{box-shadow:0 1px 2px 0 rgba(0,0,0,.1);-webkit-box-shadow:0 1px 2px 0 rgba(0,0,0,.1)}.shadow.floatable{transition:all .28s ease;-webkit-transition:all .28s ease;-khtml-transition:all 0.28s ease;-moz-transition:all .28s ease;-o-transition:all .28s ease;-ms-transition:all .28s ease}.shadow.floatable:hover{box-shadow:0 2px 4px 0 rgba(0,0,0,.1),0 4px 8px 0 rgba(0,0,0,.1),0 8px 16px 0 rgba(0,0,0,.1);-webkit-box-shadow:0 2px 4px 0 rgba(0,0,0,.1),0 4px 8px 0 rgba(0,0,0,.1),0 8px 16px 0 rgba(0,0,0,.1)}#l_cover{min-height:64px}.cover-wrapper{top:0;left:0;max-width:100%;height:100vh;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;display:flex;flex-wrap:nowrap;-webkit-flex-wrap:nowrap;-khtml-flex-wrap:nowrap;-moz-flex-wrap:nowrap;-o-flex-wrap:nowrap;-ms-flex-wrap:nowrap;-webkit-box-direction:normal;-moz-box-direction:normal;-webkit-box-orient:vertical;-moz-box-orient:vertical;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;align-items:center;align-self:center;align-content:center;color:var(--color-site-inner);padding:0 16px;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;position:relative;overflow:hidden;margin-bottom:-100px}.cover-wrapper .cover-bg{position:absolute;width:100%;height:100%;background-position:center;background-size:cover;-webkit-background-size:cover;-moz-background-size:cover}.cover-wrapper .cover-bg.lazyload:not(.loaded){opacity:0;-webkit-opacity:0;-moz-opacity:0}.cover-wrapper .cover-bg.lazyload.loaded{animation-delay:0s;animation-duration:.5s;animation-fill-mode:forwards;animation-timing-function:ease-out;animation-name:fadeIn}@-moz-keyframes fadeIn{0%{opacity:0;-webkit-opacity:0;-moz-opacity:0;filter:blur(12px);transform:scale(1.02);-webkit-transform:scale(1.02);-khtml-transform:scale(1.02);-moz-transform:scale(1.02);-o-transform:scale(1.02);-ms-transform:scale(1.02)}100%{opacity:1;-webkit-opacity:1;-moz-opacity:1}}@-webkit-keyframes fadeIn{0%{opacity:0;-webkit-opacity:0;-moz-opacity:0;filter:blur(12px);transform:scale(1.02);-webkit-transform:scale(1.02);-khtml-transform:scale(1.02);-moz-transform:scale(1.02);-o-transform:scale(1.02);-ms-transform:scale(1.02)}100%{opacity:1;-webkit-opacity:1;-moz-opacity:1}}@-o-keyframes fadeIn{0%{opacity:0;-webkit-opacity:0;-moz-opacity:0;filter:blur(12px);transform:scale(1.02);-webkit-transform:scale(1.02);-khtml-transform:scale(1.02);-moz-transform:scale(1.02);-o-transform:scale(1.02);-ms-transform:scale(1.02)}100%{opacity:1;-webkit-opacity:1;-moz-opacity:1}}@keyframes fadeIn{0%{opacity:0;-webkit-opacity:0;-moz-opacity:0;filter:blur(12px);transform:scale(1.02);-webkit-transform:scale(1.02);-khtml-transform:scale(1.02);-moz-transform:scale(1.02);-o-transform:scale(1.02);-ms-transform:scale(1.02)}100%{opacity:1;-webkit-opacity:1;-moz-opacity:1}}.cover-wrapper .cover-body{z-index:1;position:relative;width:100%;height:100%}.cover-wrapper#full{height:calc(100vh + 100px);padding-bottom:100px}.cover-wrapper#half{max-height:640px;min-height:400px;height:calc(36vh - 64px + 200px)}.cover-wrapper #scroll-down{width:100%;height:64px;position:absolute;bottom:100px;text-align:center;cursor:pointer}.cover-wrapper #scroll-down .scroll-down-effects{color:#fff;font-size:24px;line-height:64px;position:absolute;width:24px;left:calc(50% - 12px);text-shadow:0 1px 2px rgba(0,0,0,.1);animation:scroll-down-effect 1.5s infinite;-webkit-animation:scroll-down-effect 1.5s infinite;-khtml-animation:scroll-down-effect 1.5s infinite;-moz-animation:scroll-down-effect 1.5s infinite;-o-animation:scroll-down-effect 1.5s infinite;-ms-animation:scroll-down-effect 1.5s infinite}@-moz-keyframes scroll-down-effect{0%{top:0;opacity:1;-webkit-opacity:1;-moz-opacity:1}50%{top:-16px;opacity:.4;-webkit-opacity:0.4;-moz-opacity:0.4}100%{top:0;opacity:1;-webkit-opacity:1;-moz-opacity:1}}@-webkit-keyframes scroll-down-effect{0%{top:0;opacity:1;-webkit-opacity:1;-moz-opacity:1}50%{top:-16px;opacity:.4;-webkit-opacity:0.4;-moz-opacity:0.4}100%{top:0;opacity:1;-webkit-opacity:1;-moz-opacity:1}}@-o-keyframes scroll-down-effect{0%{top:0;opacity:1;-webkit-opacity:1;-moz-opacity:1}50%{top:-16px;opacity:.4;-webkit-opacity:0.4;-moz-opacity:0.4}100%{top:0;opacity:1;-webkit-opacity:1;-moz-opacity:1}}@keyframes scroll-down-effect{0%{top:0;opacity:1;-webkit-opacity:1;-moz-opacity:1}50%{top:-16px;opacity:.4;-webkit-opacity:0.4;-moz-opacity:0.4}100%{top:0;opacity:1;-webkit-opacity:1;-moz-opacity:1}}.cover-wrapper .cover-body{margin-top:64px;margin-bottom:100px}.cover-wrapper .cover-body,.cover-wrapper .cover-body .bottom,.cover-wrapper .cover-body .top{display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;display:flex;-webkit-box-direction:normal;-moz-box-direction:normal;-webkit-box-orient:vertical;-moz-box-orient:vertical;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;align-items:center;justify-content:center;-webkit-justify-content:center;-khtml-justify-content:center;-moz-justify-content:center;-o-justify-content:center;-ms-justify-content:center;max-width:100%}.cover-wrapper .cover-body .bottom{margin-top:32px}.cover-wrapper .cover-body .title{font-family:"Varela Round","PingFang SC","Microsoft YaHei",Helvetica,Arial,Helvetica,monospace;font-size:3.125rem;line-height:1.2;text-shadow:0 1px 2px rgba(0,0,0,.1)}.cover-wrapper .cover-body .subtitle{font-size:20px}.cover-wrapper .cover-body .logo{max-height:120px;max-width:calc(100% - 4 * 16px)}@media screen and (min-height:1024px){.cover-wrapper .cover-body .title{font-size:3rem}.cover-wrapper .cover-body .subtitle{font-size:1.05rem}.cover-wrapper .cover-body .logo{max-height:150px}}.cover-wrapper .cover-body .m_search{position:relative;max-width:calc(100% - 16px);width:320px;vertical-align:middle}.cover-wrapper .cover-body .m_search .form{position:relative;display:-webkit-box;display:-moz-box;display:block;width:100%}.cover-wrapper .cover-body .m_search .icon,.cover-wrapper .cover-body .m_search .input{transition:all .28s ease;-webkit-transition:all .28s ease;-khtml-transition:all 0.28s ease;-moz-transition:all .28s ease;-o-transition:all .28s ease;-ms-transition:all .28s ease}.cover-wrapper .cover-body .m_search .icon{position:absolute;display:-webkit-box;display:-moz-box;display:block;line-height:2.5rem;width:32px;top:0;left:5px;color:rgba(68,68,68,.75)}.cover-wrapper .cover-body .m_search .input{display:-webkit-box;display:-moz-box;display:block;height:2.5rem;width:100%;box-shadow:none;-webkit-box-shadow:none;box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;font-size:.875rem;-webkit-appearance:none;padding-left:36px;border-radius:1.4rem;-webkit-border-radius:1.4rem;background:rgba(255,255,255,.6);backdrop-filter:blur(10px);border:none;color:var(--color-text)}@media screen and (max-width:500px){.cover-wrapper .cover-body .m_search .input{padding-left:36px}}.cover-wrapper .cover-body .m_search .input:hover{background:rgba(255,255,255,.8)}.cover-wrapper .cover-body .m_search .input:focus{background:#fff}.cover-wrapper .list-h{display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;display:flex;-webkit-box-direction:normal;-moz-box-direction:normal;-webkit-box-orient:horizontal;-moz-box-orient:horizontal;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;flex-wrap:wrap;-webkit-flex-wrap:wrap;-khtml-flex-wrap:wrap;-moz-flex-wrap:wrap;-o-flex-wrap:wrap;-ms-flex-wrap:wrap;align-items:stretch;border-radius:4px;-webkit-border-radius:4px;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.cover-wrapper .list-h a{-webkit-box-flex:1;-moz-box-flex:1;-webkit-flex:1 0;-ms-flex:1 0;flex:1 0;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;display:flex;font-weight:600}.cover-wrapper .list-h a img{display:-webkit-box;display:-moz-box;display:block;border-radius:2px;-webkit-border-radius:2px;margin:4px;min-width:40px;max-width:44px}@media screen and (max-width:768px){.cover-wrapper .list-h a img{min-width:36px;max-width:40px}}@media screen and (max-width:500px){.cover-wrapper .list-h a img{margin:2px 4px;min-width:32px;max-width:36px}}@media screen and (max-width:375px){.cover-wrapper .list-h a img{min-width:28px;max-width:32px}}.cover-wrapper{max-width:100%}.cover-wrapper.search .bottom .menu{margin-top:16px}.cover-wrapper.search .bottom .menu .list-h a{white-space:nowrap;-webkit-box-direction:normal;-moz-box-direction:normal;-webkit-box-orient:horizontal;-moz-box-orient:horizontal;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;align-items:baseline;padding:2px;margin:4px;color:var(--color-site-inner);opacity:.75;-webkit-opacity:0.75;-moz-opacity:0.75;text-shadow:0 1px 2px rgba(0,0,0,.05);border-bottom:2px solid transparent}.cover-wrapper.search .bottom .menu .list-h a i{margin-right:4px}.cover-wrapper.search .bottom .menu .list-h a p{font-size:.9375rem}.cover-wrapper.search .bottom .menu .list-h a.active,.cover-wrapper.search .bottom .menu .list-h a:active,.cover-wrapper.search .bottom .menu .list-h a:hover{opacity:1;-webkit-opacity:1;-moz-opacity:1;border-bottom:2px solid var(--color-site-inner)}.cover-wrapper.dock .menu,.cover-wrapper.featured .menu,.cover-wrapper.focus .menu{border-radius:6px;-webkit-border-radius:6px}.cover-wrapper.dock .menu .list-h a,.cover-wrapper.featured .menu .list-h a,.cover-wrapper.focus .menu .list-h a{-webkit-box-direction:normal;-moz-box-direction:normal;-webkit-box-orient:vertical;-moz-box-orient:vertical;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;align-items:center;padding:12px;line-height:24px;border-radius:4px;-webkit-border-radius:4px;border-bottom:none;text-align:center;align-content:flex-end;color:rgba(68,68,68,.7);font-size:1.5rem}@media screen and (max-width:500px){.cover-wrapper.dock .menu .list-h a,.cover-wrapper.featured .menu .list-h a,.cover-wrapper.focus .menu .list-h a{padding:12px 8px}}.cover-wrapper.dock .menu .list-h a i,.cover-wrapper.featured .menu .list-h a i,.cover-wrapper.focus .menu .list-h a i{margin:8px}.cover-wrapper.dock .menu .list-h a p,.cover-wrapper.featured .menu .list-h a p,.cover-wrapper.focus .menu .list-h a p{font-size:.875rem}.cover-wrapper.dock .menu .list-h a.active,.cover-wrapper.featured .menu .list-h a.active,.cover-wrapper.focus .menu .list-h a.active{background:var(--color-card);backdrop-filter:none}.cover-wrapper.dock .menu .list-h a.active i,.cover-wrapper.dock .menu .list-h a.active i+p,.cover-wrapper.featured .menu .list-h a.active i,.cover-wrapper.featured .menu .list-h a.active i+p,.cover-wrapper.focus .menu .list-h a.active i,.cover-wrapper.focus .menu .list-h a.active i+p{color:#2196f3}.cover-wrapper.dock .menu .list-h a.active img+p,.cover-wrapper.featured .menu .list-h a.active img+p,.cover-wrapper.focus .menu .list-h a.active img+p{color:var(--color-text)}.cover-wrapper.dock .menu .list-h a:hover,.cover-wrapper.featured .menu .list-h a:hover,.cover-wrapper.focus .menu .list-h a:hover{background:var(--color-card)}.cover-wrapper.featured .menu .list-h{margin:-2px}.cover-wrapper.featured .menu .list-h a{margin:2px;background:rgba(255,255,255,.5)}@supports (backdrop-filter:blur(20px)){.cover-wrapper.featured .menu .list-h a{background:rgba(255,255,255,.5);backdrop-filter:saturate(200%) blur(20px)}}@media (prefers-color-scheme:dark){:root{--color-mode:'dark'}:root:not([color-scheme]){--color-site-body:#121212;--color-read-bkg:#21232f;--color-read-post:#252d38;--color-site-bg:#21232f;--color-site-inner:#efefef;--color-site-footer:#666;--color-card:#252d38;--color-text:rgba(238,238,238,0.871);--color-block:rgba(68,68,68,0.65);--color-codeblock:#444;--color-inlinecode:#d56d28;--color-h1:rgba(255,255,255,0.871);--color-h2:rgba(255,255,255,0.871);--color-h3:rgba(255,255,255,0.6);--color-h4:rgba(255,255,255,0.6);--color-h5:rgba(255,255,255,0.6);--color-h6:rgba(255,255,255,0.6);--color-p:rgba(217,217,217,0.871);--color-list:rgba(217,217,217,0.871);--color-list-hl:#4dabf5;--color-meta:rgba(191,191,191,0.871);--color-link:rgba(191,191,191,0.871);--color-copyright-bkg:#21252b}:root:not([color-scheme]) img{filter:brightness(70%)!important}:root:not([color-scheme]) .blur{background:rgba(33,35,47,.9)!important}:root:not([color-scheme]) .white-box.blur{background:rgba(37,45,56,.9)!important}:root:not([color-scheme]) .nav-main .u-search-input{background:var(--color-card)!important}:root:not([color-scheme]) #l_main .article .prev-next>a{background:var(--color-block)!important}:root:not([color-scheme]) #l_main .article .prev-next>a:hover{background:var(--color-site-bg)!important}:root:not([color-scheme]) .article blockquote{background:var(--color-block)!important}:root:not([color-scheme]) .article-title a{color:var(--color-h1)!important}:root:not([color-scheme]) details>summary{color:var(--color-p)!important;background:var(--color-site-bg)!important}:root:not([color-scheme]) details{border:1px solid var(--color-site-bg)!important;background:var(--color-site-bg)!important}:root:not([color-scheme]) #u-search .modal,:root:not([color-scheme]) #u-search .modal-body,:root:not([color-scheme]) #u-search .modal-header{background:var(--color-card)!important}:root:not([color-scheme]) #u-search .modal-body .modal-results .result:hover{background:var(--color-block)!important}:root:not([color-scheme]) .u-search-input:hover{background:var(--color-block)!important}:root:not([color-scheme]) .u-search-input:focus{background:var(--color-site-body)!important}}[color-scheme=dark]{--color-site-body:#121212;--color-read-bkg:#21232f;--color-read-post:#252d38;--color-site-bg:#21232f;--color-site-inner:#efefef;--color-site-footer:#666;--color-card:#252d38;--color-text:rgba(238,238,238,0.871);--color-block:rgba(68,68,68,0.65);--color-codeblock:#444;--color-inlinecode:#d56d28;--color-h1:rgba(255,255,255,0.871);--color-h2:rgba(255,255,255,0.871);--color-h3:rgba(255,255,255,0.6);--color-h4:rgba(255,255,255,0.6);--color-h5:rgba(255,255,255,0.6);--color-h6:rgba(255,255,255,0.6);--color-p:rgba(217,217,217,0.871);--color-list:rgba(217,217,217,0.871);--color-list-hl:#4dabf5;--color-meta:rgba(191,191,191,0.871);--color-link:rgba(191,191,191,0.871);--color-copyright-bkg:#21252b}[color-scheme=dark] img{filter:brightness(70%)!important}[color-scheme=dark] .blur{background:rgba(33,35,47,.9)!important}[color-scheme=dark] .white-box.blur{background:rgba(37,45,56,.9)!important}[color-scheme=dark] .nav-main .u-search-input{background:var(--color-card)!important}[color-scheme=dark] #l_main .article .prev-next>a{background:var(--color-block)!important}[color-scheme=dark] #l_main .article .prev-next>a:hover{background:var(--color-site-bg)!important}[color-scheme=dark] .article blockquote{background:var(--color-block)!important}[color-scheme=dark] .article-title a{color:var(--color-h1)!important}[color-scheme=dark] details>summary{color:var(--color-p)!important;background:var(--color-site-bg)!important}[color-scheme=dark] details{border:1px solid var(--color-site-bg)!important;background:var(--color-site-bg)!important}[color-scheme=dark] #u-search .modal,[color-scheme=dark] #u-search .modal-body,[color-scheme=dark] #u-search .modal-header{background:var(--color-card)!important}[color-scheme=dark] #u-search .modal-body .modal-results .result:hover{background:var(--color-block)!important}[color-scheme=dark] .u-search-input:hover{background:var(--color-block)!important}[color-scheme=dark] .u-search-input:focus{background:var(--color-site-body)!important}@media screen and (max-width:500px){[color-scheme=dark] .l_header .m_search{background:var(--color-site-bg)!important}}@font-face{font-family:'Varela Round';src:url("https://static.mhuig.top/npm/volantis-static@0.0.1660614606622/media/fonts/VarelaRound/VarelaRound-Regular.ttf");font-weight:'normal';font-style:'normal';font-display:swap}@font-face{font-family:'Varela Round';src:url("https://static.mhuig.top/npm/volantis-static@0.0.1660614606622/media/fonts/VarelaRound/VarelaRound-Regular.ttf");font-weight:'normal';font-style:'normal';font-display:swap}.l_header{position:fixed;z-index:1000;top:0;width:100%;height:64px;background:var(--color-card);box-shadow:0 1px 2px 0 rgba(0,0,0,.1);-webkit-box-shadow:0 1px 2px 0 rgba(0,0,0,.1)}.l_header.auto{transition:opacity .4s ease;-webkit-transition:opacity .4s ease;-khtml-transition:opacity 0.4s ease;-moz-transition:opacity .4s ease;-o-transition:opacity .4s ease;-ms-transition:opacity .4s ease;visibility:hidden}.l_header.auto.show{opacity:1!important;-webkit-opacity:1!important;-moz-opacity:1!important;visibility:visible}.l_header .container{margin-left:16px;margin-right:16px}.l_header #wrapper{height:100%;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.l_header #wrapper .nav-main,.l_header #wrapper .nav-sub{display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;display:flex;flex-wrap:nowrap;-webkit-flex-wrap:nowrap;-khtml-flex-wrap:nowrap;-moz-flex-wrap:nowrap;-o-flex-wrap:nowrap;-ms-flex-wrap:nowrap;justify-content:space-between;-webkit-justify-content:space-between;-khtml-justify-content:space-between;-moz-justify-content:space-between;-o-justify-content:space-between;-ms-justify-content:space-between;align-items:center}.l_header #wrapper .nav-main{transition:all .28s ease;-webkit-transition:all .28s ease;-khtml-transition:all 0.28s ease;-moz-transition:all .28s ease;-o-transition:all .28s ease;-ms-transition:all .28s ease}.l_header #wrapper.sub .nav-main{transform:translateY(-64px);-webkit-transform:translateY(-64px);-khtml-transform:translateY(-64px);-moz-transform:translateY(-64px);-o-transform:translateY(-64px);-ms-transform:translateY(-64px)}.l_header #wrapper .nav-sub{transition:all .28s ease;-webkit-transition:all .28s ease;-khtml-transition:all 0.28s ease;-moz-transition:all .28s ease;-o-transition:all .28s ease;-ms-transition:all .28s ease;opacity:0;-webkit-opacity:0;-moz-opacity:0;height:64px;width:calc(100% - 2 * 16px);position:absolute}.l_header #wrapper .nav-sub ::-webkit-scrollbar{display:-webkit-box;display:-moz-box;display:none}@media screen and (min-width:2048px){.l_header #wrapper .nav-sub{max-width:55vw;margin:auto}}.l_header #wrapper.sub .nav-sub{opacity:1;-webkit-opacity:1;-moz-opacity:1}.l_header #wrapper .title{position:relative;color:var(--color-text);padding-left:24px;max-height:64px}.l_header #wrapper .nav-main .title{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex-shrink:0;line-height:64px;padding:0 24px;font-size:1.25rem;font-family:"Varela Round","PingFang SC","Microsoft YaHei",Helvetica,Arial,Helvetica,monospace}.l_header #wrapper .nav-main .title img{height:64px}.l_header .nav-sub{max-width:1080px;margin:auto}.l_header .nav-sub .title{font-weight:700;font-family:"Varela Round","PingFang SC","Microsoft YaHei",Helvetica,Arial,Menlo,Monaco,monospace,sans-serif;line-height:1.2;max-height:64px;white-space:normal;flex-shrink:1}.l_header .switcher{display:-webkit-box;display:-moz-box;display:none;line-height:64px;align-items:center}.l_header .switcher .s-toc{display:-webkit-box;display:-moz-box;display:none}@media screen and (max-width:768px){.l_header .switcher .s-toc{display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;display:flex}}.l_header .switcher>li{height:48px;transition:all .28s ease;-webkit-transition:all .28s ease;-khtml-transition:all 0.28s ease;-moz-transition:all .28s ease;-o-transition:all .28s ease;-ms-transition:all .28s ease;margin:2px}@media screen and (max-width:500px){.l_header .switcher>li{margin:0 1px;height:48px}}.l_header .switcher>li>a{display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;display:flex;justify-content:center;-webkit-justify-content:center;-khtml-justify-content:center;-moz-justify-content:center;-o-justify-content:center;-ms-justify-content:center;align-items:center;width:48px;height:48px;padding:.85em 1.1em;border-radius:100px;-webkit-border-radius:100px;border:none;transition:all .28s ease;-webkit-transition:all .28s ease;-khtml-transition:all 0.28s ease;-moz-transition:all .28s ease;-o-transition:all .28s ease;-ms-transition:all .28s ease;color:#2196f3}.l_header .switcher>li>a:hover{border:none}.l_header .switcher>li>a.active,.l_header .switcher>li>a:active{border:none;background:var(--color-site-bg)}@media screen and (max-width:500px){.l_header .switcher>li>a{width:36px;height:48px}}.l_header .nav-sub .switcher{display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;display:flex}.l_header .m_search{display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;display:flex;height:64px;width:240px;transition:all .28s ease;-webkit-transition:all .28s ease;-khtml-transition:all 0.28s ease;-moz-transition:all .28s ease;-o-transition:all .28s ease;-ms-transition:all .28s ease}@media screen and (max-width:1024px){.l_header .m_search{width:44px;min-width:44px}.l_header .m_search input::placeholder{opacity:0;-webkit-opacity:0;-moz-opacity:0}.l_header .m_search:hover{width:240px}.l_header .m_search:hover input::placeholder{opacity:1;-webkit-opacity:1;-moz-opacity:1}}@media screen and (min-width:500px){.l_header .m_search:hover .input{width:100%}.l_header .m_search:hover .input::placeholder{opacity:1;-webkit-opacity:1;-moz-opacity:1}}@media screen and (max-width:500px){.l_header .m_search{min-width:0}.l_header .m_search input::placeholder{opacity:1;-webkit-opacity:1;-moz-opacity:1}}.l_header .m_search .form{position:relative;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;display:flex;width:100%;align-items:center}.l_header .m_search .icon{position:absolute;width:36px;left:5px;color:var(--color-meta)}@media screen and (max-width:500px){.l_header .m_search .icon{display:-webkit-box;display:-moz-box;display:none}}.l_header .m_search .input{display:-webkit-box;display:-moz-box;display:block;padding-top:8px;padding-bottom:8px;line-height:1.3;width:100%;color:var(--color-text);background:#fafafa;box-shadow:none;-webkit-box-shadow:none;box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;padding-left:40px;font-size:.875rem;border-radius:8px;-webkit-border-radius:8px;border:none;transition:all .28s ease;-webkit-transition:all .28s ease;-khtml-transition:all 0.28s ease;-moz-transition:all .28s ease;-o-transition:all .28s ease;-ms-transition:all .28s ease}@media screen and (min-width:500px){.l_header .m_search .input:focus{box-shadow:0 4px 8px 0 rgba(0,0,0,.1);-webkit-box-shadow:0 4px 8px 0 rgba(0,0,0,.1)}}@media screen and (max-width:500px){.l_header .m_search .input{background:var(--color-block);padding-left:8px;border:none}.l_header .m_search .input:focus,.l_header .m_search .input:hover{border:none}}@media (max-width:500px){.l_header .m_search{left:0;width:0;overflow:hidden;position:absolute;background:#fff;transition:all .28s ease;-webkit-transition:all .28s ease;-khtml-transition:all 0.28s ease;-moz-transition:all .28s ease;-o-transition:all .28s ease;-ms-transition:all .28s ease}.l_header .m_search .input{border-radius:32px;-webkit-border-radius:32px;margin-left:16px;padding-left:16px}.l_header.z_search-open .m_search{width:100%}.l_header.z_search-open .m_search .input{width:calc(100% - 120px)}}ul.m-pc>li>a{color:inherit;border-bottom:2px solid transparent}ul.m-pc>li>a.active,ul.m-pc>li>a:active{border-bottom:2px solid #2196f3}ul.list-v li:hover>ul.list-v,ul.m-pc li:hover>ul.list-v{display:-webkit-box;display:-moz-box;display:block}ul.nav-list-h{display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;display:flex;align-items:stretch}ul.nav-list-h>li{position:relative;justify-content:center;-webkit-justify-content:center;-khtml-justify-content:center;-moz-justify-content:center;-o-justify-content:center;-ms-justify-content:center;height:100%;line-height:2.4;border-radius:4px;-webkit-border-radius:4px}ul.nav-list-h>li>a{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:600}ul.list-v{z-index:1;display:-webkit-box;display:-moz-box;display:none;position:absolute;background:var(--color-card);box-shadow:0 2px 4px 0 rgba(0,0,0,.08),0 4px 8px 0 rgba(0,0,0,.08),0 8px 16px 0 rgba(0,0,0,.08);-webkit-box-shadow:0 2px 4px 0 rgba(0,0,0,.08),0 4px 8px 0 rgba(0,0,0,.08),0 8px 16px 0 rgba(0,0,0,.08);margin-top:-6px;border-radius:4px;-webkit-border-radius:4px;padding:8px 0}ul.list-v.show{display:-webkit-box;display:-moz-box;display:block}ul.list-v hr{margin-top:8px;margin-bottom:8px}ul.list-v>li{white-space:nowrap;word-break:keep-all}ul.list-v>li.header{font-size:.78125rem;font-weight:700;line-height:2em;color:var(--color-meta);margin:8px 16px 4px}ul.list-v>li.header i{margin-right:8px}ul.list-v>li ul{margin-left:0;display:-webkit-box;display:-moz-box;display:none;margin-top:-40px}ul.list-v .aplayer-container{min-height:64px;padding:6px 16px}ul.list-v>li>a{transition:all .28s ease;-webkit-transition:all .28s ease;-khtml-transition:all 0.28s ease;-moz-transition:all .28s ease;-o-transition:all .28s ease;-ms-transition:all .28s ease;display:-webkit-box;display:-moz-box;display:block;color:var(--color-list);font-size:.875rem;font-weight:700;line-height:36px;padding:0 20px 0 16px;text-overflow:ellipsis;margin:0 4px;border-radius:4px;-webkit-border-radius:4px}@media screen and (max-width:1024px){ul.list-v>li>a{line-height:40px}}ul.list-v>li>a>i{margin-right:8px}ul.list-v>li>a.active,ul.list-v>li>a:active{color:var(--color-list-hl)}ul.list-v>li>a:hover{color:var(--color-list-hl);background:var(--color-site-bg)}.l_header .menu>ul>li>a{display:-webkit-box;display:-moz-box;display:block;padding:0 8px}.l_header .menu>ul>li>a>i{margin-right:4px}.l_header ul.nav-list-h>li{color:var(--color-list);line-height:64px}.l_header ul.nav-list-h>li>a{max-height:64px;overflow:hidden;color:inherit}.l_header ul.nav-list-h>li>a.active,.l_header ul.nav-list-h>li>a:active{color:#2196f3}.l_header ul.nav-list-h>li:hover>a{color:var(--color-list-hl)}.l_header ul.nav-list-h>li i.music{animation:rotate-effect 1.5s linear infinite;-webkit-animation:rotate-effect 1.5s linear infinite;-khtml-animation:rotate-effect 1.5s linear infinite;-moz-animation:rotate-effect 1.5s linear infinite;-o-animation:rotate-effect 1.5s linear infinite;-ms-animation:rotate-effect 1.5s linear infinite}@-moz-keyframes rotate-effect{0%{transform:rotate(0);-webkit-transform:rotate(0);-khtml-transform:rotate(0);-moz-transform:rotate(0);-o-transform:rotate(0);-ms-transform:rotate(0)}25%{transform:rotate(90deg);-webkit-transform:rotate(90deg);-khtml-transform:rotate(90deg);-moz-transform:rotate(90deg);-o-transform:rotate(90deg);-ms-transform:rotate(90deg)}50%{transform:rotate(180deg);-webkit-transform:rotate(180deg);-khtml-transform:rotate(180deg);-moz-transform:rotate(180deg);-o-transform:rotate(180deg);-ms-transform:rotate(180deg)}75%{transform:rotate(270deg);-webkit-transform:rotate(270deg);-khtml-transform:rotate(270deg);-moz-transform:rotate(270deg);-o-transform:rotate(270deg);-ms-transform:rotate(270deg)}100%{transform:rotate(360deg);-webkit-transform:rotate(360deg);-khtml-transform:rotate(360deg);-moz-transform:rotate(360deg);-o-transform:rotate(360deg);-ms-transform:rotate(360deg)}}@-webkit-keyframes rotate-effect{0%{transform:rotate(0);-webkit-transform:rotate(0);-khtml-transform:rotate(0);-moz-transform:rotate(0);-o-transform:rotate(0);-ms-transform:rotate(0)}25%{transform:rotate(90deg);-webkit-transform:rotate(90deg);-khtml-transform:rotate(90deg);-moz-transform:rotate(90deg);-o-transform:rotate(90deg);-ms-transform:rotate(90deg)}50%{transform:rotate(180deg);-webkit-transform:rotate(180deg);-khtml-transform:rotate(180deg);-moz-transform:rotate(180deg);-o-transform:rotate(180deg);-ms-transform:rotate(180deg)}75%{transform:rotate(270deg);-webkit-transform:rotate(270deg);-khtml-transform:rotate(270deg);-moz-transform:rotate(270deg);-o-transform:rotate(270deg);-ms-transform:rotate(270deg)}100%{transform:rotate(360deg);-webkit-transform:rotate(360deg);-khtml-transform:rotate(360deg);-moz-transform:rotate(360deg);-o-transform:rotate(360deg);-ms-transform:rotate(360deg)}}@-o-keyframes rotate-effect{0%{transform:rotate(0);-webkit-transform:rotate(0);-khtml-transform:rotate(0);-moz-transform:rotate(0);-o-transform:rotate(0);-ms-transform:rotate(0)}25%{transform:rotate(90deg);-webkit-transform:rotate(90deg);-khtml-transform:rotate(90deg);-moz-transform:rotate(90deg);-o-transform:rotate(90deg);-ms-transform:rotate(90deg)}50%{transform:rotate(180deg);-webkit-transform:rotate(180deg);-khtml-transform:rotate(180deg);-moz-transform:rotate(180deg);-o-transform:rotate(180deg);-ms-transform:rotate(180deg)}75%{transform:rotate(270deg);-webkit-transform:rotate(270deg);-khtml-transform:rotate(270deg);-moz-transform:rotate(270deg);-o-transform:rotate(270deg);-ms-transform:rotate(270deg)}100%{transform:rotate(360deg);-webkit-transform:rotate(360deg);-khtml-transform:rotate(360deg);-moz-transform:rotate(360deg);-o-transform:rotate(360deg);-ms-transform:rotate(360deg)}}@keyframes rotate-effect{0%{transform:rotate(0);-webkit-transform:rotate(0);-khtml-transform:rotate(0);-moz-transform:rotate(0);-o-transform:rotate(0);-ms-transform:rotate(0)}25%{transform:rotate(90deg);-webkit-transform:rotate(90deg);-khtml-transform:rotate(90deg);-moz-transform:rotate(90deg);-o-transform:rotate(90deg);-ms-transform:rotate(90deg)}50%{transform:rotate(180deg);-webkit-transform:rotate(180deg);-khtml-transform:rotate(180deg);-moz-transform:rotate(180deg);-o-transform:rotate(180deg);-ms-transform:rotate(180deg)}75%{transform:rotate(270deg);-webkit-transform:rotate(270deg);-khtml-transform:rotate(270deg);-moz-transform:rotate(270deg);-o-transform:rotate(270deg);-ms-transform:rotate(270deg)}100%{transform:rotate(360deg);-webkit-transform:rotate(360deg);-khtml-transform:rotate(360deg);-moz-transform:rotate(360deg);-o-transform:rotate(360deg);-ms-transform:rotate(360deg)}}.menu-phone li ul.list-v{right:calc(100% - .5 * 16px)}.menu-phone li ul.list-v ul{right:calc(100% - .5 * 16px)}#wrapper{max-width:1080px;margin:auto}@media screen and (min-width:2048px){#wrapper{max-width:55vw}}#wrapper .menu{-webkit-box-flex:1;-moz-box-flex:1;-webkit-flex:1 1;-ms-flex:1 1;flex:1 1;margin:0 16px 0 0}#wrapper .menu .list-v ul{left:calc(100% - .5 * 16px)}.menu-phone{display:-webkit-box;display:-moz-box;display:none;margin-top:16px;right:8px;transition:all .28s ease;-webkit-transition:all .28s ease;-khtml-transition:all 0.28s ease;-moz-transition:all .28s ease;-o-transition:all .28s ease;-ms-transition:all .28s ease}.menu-phone ul{right:calc(100% - .5 * 16px)}@media screen and (max-width:500px){.menu-phone{display:-webkit-box;display:-moz-box;display:block}}.l_header{max-width:65vw;left:calc((100% - 65vw) * .5);border-bottom-left-radius:8px;border-bottom-right-radius:8px}@media screen and (max-width:2048px){.l_header{max-width:1112px;left:calc((100% - 1112px) * .5)}}@media screen and (max-width:1112px){.l_header{left:0;border-radius:0;-webkit-border-radius:0;max-width:100%}}@media screen and (max-width:500px){.l_header .container{margin-left:0;margin-right:0}.l_header #wrapper .nav-main .title{padding-left:16px;padding-right:16px}.l_header #wrapper .nav-sub{width:100%}.l_header #wrapper .nav-sub .title{overflow-y:scroll;margin-top:2px;padding:8px 16px}.l_header #wrapper .switcher{display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;display:flex;margin-right:8px}.l_header .menu{display:-webkit-box;display:-moz-box;display:none}}@media screen and (max-width:500px){.list-v li{max-width:270px}}#u-search{display:-webkit-box;display:-moz-box;display:none;position:fixed;top:0;left:0;width:100%;height:100%;padding:60px 20px;z-index:1001}@media screen and (max-width:680px){#u-search{padding:0}}@media screen and (prefers-color-scheme:dark) and (max-width:500px){.l_header .m_search{background:var(--color-site-bg)!important}}.cover-wrapper .cover-body .subtitle{font-size:.875rem}.fa-brands.color-github,.fa-duotone.color-github,.fa-light.color-github,.fa-regular.color-github,.fa-solid.color-github,.fa-thin.color-github,.fa.color-github,.fad.color-github,.fal.color-github,.far.color-github,.fas.color-github,.iziToast>.iziToast-body .iziToast-icon.color-github{color:#000}.fa-brands.color-friends,.fa-duotone.color-friends,.fa-light.color-friends,.fa-regular.color-friends,.fa-solid.color-friends,.fa-thin.color-friends,.fa.color-friends,.fad.color-friends,.fal.color-friends,.far.color-friends,.fas.color-friends,.iziToast>.iziToast-body .iziToast-icon.color-friends{color:#d31ee9}.fa-brands.color-about,.fa-duotone.color-about,.fa-light.color-about,.fa-regular.color-about,.fa-solid.color-about,.fa-thin.color-about,.fa.color-about,.fad.color-about,.fal.color-about,.far.color-about,.fas.color-about,.iziToast>.iziToast-body .iziToast-icon.color-about{color:#0095ff}.fa-brands.color-travellings,.fa-duotone.color-travellings,.fa-light.color-travellings,.fa-regular.color-travellings,.fa-solid.color-travellings,.fa-thin.color-travellings,.fa.color-travellings,.fad.color-travellings,.fal.color-travellings,.far.color-travellings,.fas.color-travellings,.iziToast>.iziToast-body .iziToast-icon.color-travellings{color:#734ae6}mjx-container{padding:0 0!important}mjx-container:not([display=true]){padding:4px 2px 4px 6px!important}mjx-container[jax=SVG]{direction:ltr}mjx-container[jax=SVG]>svg{overflow:visible}mjx-container[jax=SVG][display=true]{display:-webkit-box;display:-moz-box;display:block;text-align:center;margin:1em 0}mjx-container[jax=SVG][justify=left]{text-align:left}mjx-container[jax=SVG][justify=right]{text-align:right}g[data-mml-node=merror]>g{fill:#f00;stroke:#f00}g[data-mml-node=merror]>rect[data-background]{fill:#ff0;stroke:none}g[data-mml-node=mtable]>line[data-line]{stroke-width:70px;fill:none}g[data-mml-node=mtable]>rect[data-frame]{stroke-width:70px;fill:none}g[data-mml-node=mtable]>.mjx-dashed{stroke-dasharray:140}g[data-mml-node=mtable]>.mjx-dotted{stroke-linecap:round;stroke-dasharray:0,140}g[data-mml-node=mtable]>svg{overflow:visible}[jax=SVG] mjx-tool{display:-webkit-box;display:-moz-box;display:inline-block;position:relative;width:0;height:0}[jax=SVG] mjx-tool>mjx-tip{position:absolute;top:0;left:0}mjx-tool>mjx-tip{display:-webkit-box;display:-moz-box;display:inline-block;padding:.2em;border:1px solid #888;font-size:70%;background-color:#f8f8f8;color:#000;box-shadow:2px 2px 5px #aaa;-webkit-box-shadow:2px 2px 5px #aaa}g[data-mml-node=maction][data-toggle]{cursor:pointer}mjx-status{display:-webkit-box;display:-moz-box;display:block;position:fixed;left:1em;bottom:1em;min-width:25%;padding:.2em .4em;border:1px solid #888;font-size:90%;background-color:#f8f8f8;color:#000}foreignObject[data-mjx-xml]{font-family:initial;line-height:normal;overflow:visible}.MathJax path{stroke-width:3}mjx-container[display=true]{overflow:auto hidden}mjx-container[display=true]+br{display:-webkit-box;display:-moz-box;display:none}</style><link rel="stylesheet" href="/css/style.css" media="print" onload='this.media="all",this.onload=null'><noscript><link rel="stylesheet" href="/css/style.css"></noscript><script>let userColorScheme=localStorage.getItem("color-scheme");userColorScheme&&document.documentElement.setAttribute("color-scheme",userColorScheme)</script><script>window.MSInputMethodContext&&document.documentMode&&document.write('<style>html{overflow-x: hidden !important;overflow-y: hidden !important;}.kill-ie{text-align:center;height: 100%;margin-top: 15%;margin-bottom: 5500%;}.kill-t{font-size: 2rem;}.kill-c{font-size: 1.2rem;}#l_header,#l_body{display: none;}</style><div class="kill-ie"><span class="kill-t"><b>抱歉,您的浏览器无法访问本站</b></span><br/><span class="kill-c">微软已经于2016年终止了对 Internet Explorer (IE) 10 及更早版本的支持,<br/>继续使用存在极大的安全隐患,请使用当代主流的浏览器进行访问。</span><br/><a target="_blank" rel="noopener" href="https://blogs.windows.com/windowsexperience/2021/05/19/the-future-of-internet-explorer-on-windows-10-is-in-microsoft-edge/"><strong>了解详情 ></strong></a></div>')</script><noscript><style>html{overflow-x:hidden!important;overflow-y:hidden!important}.kill-noscript{text-align:center;height:100%;margin-top:15%;margin-bottom:5500%}.kill-t{font-size:2rem}.kill-c{font-size:1.2rem}#l_body,#l_header{display:none}</style><div class="kill-noscript"> <span class="kill-t"><b>抱歉,您的浏览器无法访问本站</b></span><br> <span class="kill-c">本页面需要浏览器支持(启用)JavaScript</span><br> <a target="_blank" rel="external nofollow noopener noreferrer" href="https://www.baidu.com/s?wd=启用JavaScript"><strong>了解详情 ></strong></a></div></noscript><script>function volantisEventListener(e,t,n){this.type=e,this.f=t,this.ele=n}function volantisDom(e){return e||(e=document.createElement("div")),this.ele=e,this.ele.find=e=>{let t=this.ele.querySelector(e);if(t)return new volantisDom(t)},this.ele.hasClass=e=>this.ele.className.match(new RegExp("(\\s|^)"+e+"(\\s|$)")),this.ele.addClass=e=>(this.ele.classList.add(e),this.ele),this.ele.removeClass=e=>(this.ele.classList.remove(e),this.ele),this.ele.toggleClass=e=>(this.ele.hasClass(e)?this.ele.removeClass(e):this.ele.addClass(e),this.ele),this.ele.on=(e,t,n=1)=>(this.ele.addEventListener(e,t,!1),n&&volantis.EventListener.list.push(new volantisEventListener(e,t,this.ele)),this.ele),this.ele.click=(e,t)=>(this.ele.on("click",e,t),this.ele),this.ele.scroll=(e,t)=>(this.ele.on("scroll",e,t),this.ele),this.ele.html=e=>(this.ele.innerHTML=e,this.ele),this.ele.hide=e=>(this.ele.style.display="none",this.ele),this.ele.show=e=>(this.ele.style.display="block",this.ele),this.ele}function RunItem(){function e(e,t){this.name=t||volantis.getFunctionHash(e),this.run=()=>{try{e()}catch(e){console.log(e)}}}this.list=[],this.start=()=>{for(var e=0;e<this.list.length;e++)this.list[e].run()},this.push=(t,n,o=!0)=>{if("function"!=typeof t)return;let l=t;o&&(l=()=>{volantis.requestAnimationFrame(t)}),n=n||volantis.getFunctionHash(t);const i=this.list.findIndex((e=>e.name===n));-1===i?this.list.push(new e(l,n)):this.list[i]=new e(l,n)},this.remove=e=>{for(let t=0;t<this.list.length;t++){this.list[t].name==e&&this.list.splice(t,1)}}}function errorImgAvatar(e){e.src="https://static.mhuig.top/npm/volantis-static@0.0.1660614606622/media/placeholder/avatar/round/3442075.svg",e.onerror=null}function errorImgCover(e){e.src="https://static.mhuig.top/npm/volantis-static@0.0.1660614606622/media/placeholder/cover/76b86c0226ffd.svg",e.onerror=null}!function(){const e=new WeakMap,t=new Proxy({},{get(n,o){const l=e.get(t);return l?.[o]},set(n,o,l){e.has(t)||e.set(t,Object.create(null));return e.get(t)[o]=l,!0},deleteProperty(n,o){const l=e.get(t);return!(!l||!Object.prototype.hasOwnProperty.call(l,o))&&(delete l[o],0===Object.keys(l).length&&e.delete(t),!0)},ownKeys(n){const o=e.get(t);return o?Object.keys(o):[]},getOwnPropertyDescriptor(n,o){const l=e.get(t);if(l&&Object.prototype.hasOwnProperty.call(l,o))return{value:l[o],writable:!0,enumerable:!0,configurable:!0}}});Object.defineProperty(window,"volantis",{value:t,writable:!0,configurable:!0,enumerable:!0})}(),volantis.debug="false",volantis.dom={},volantis.simpleTextHash=e=>{let t=5381;for(let n=0;n<e.length;n++)t=(t<<5)+t+e.charCodeAt(n),t&=t;return t.toString(16).padStart(8,"0")},volantis.getFunctionHash=e=>{const t=e.toString();return volantis.simpleTextHash(t)},volantis.EventListener={},volantis.EventListener.list=[],volantis.EventListener.remove=()=>{volantis.EventListener.list.forEach((function(e){e.ele.removeEventListener(e.type,e.f,!1)})),volantis.EventListener.list=[]},volantis.dom.$=e=>e?new volantisDom(e):null,volantis.pjax={},volantis.pjax.method={complete:new RunItem,error:new RunItem,send:new RunItem},volantis.pjax=Object.assign(volantis.pjax,{push:volantis.pjax.method.complete.push,error:volantis.pjax.method.error.push,send:volantis.pjax.method.send.push}),volantis.rightmenu={},volantis.rightmenu.method={handle:new RunItem},volantis.rightmenu=Object.assign(volantis.rightmenu,{handle:volantis.rightmenu.method.handle.push}),volantis.dark={},volantis.dark.method={toggle:new RunItem},volantis.dark=Object.assign(volantis.dark,{push:volantis.dark.method.toggle.push}),volantis.js=(e,t)=>new Promise((n=>{setTimeout((function(){var o=document.getElementsByTagName("head")[0]||document.documentElement,l=document.createElement("script");if(l.setAttribute("type","text/javascript"),t)if(JSON.stringify(t))for(let e in t)"onload"==e?l[e]=()=>{t[e](),n()}:(l[e]=t[e],l.onload=n);else l.onload=()=>{t(),n()};else l.onload=n;l.setAttribute("src",e),o.appendChild(l)}))})),volantis.css=e=>new Promise((t=>{setTimeout((function(){var n=document.createElement("link");n.rel="stylesheet",n.href=e,n.onload=t,document.getElementsByTagName("head")[0].appendChild(n)}))})),volantis.import={jQuery:()=>"undefined"==typeof jQuery?volantis.js("https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.min.js"):new Promise((e=>{e()}))},volantis.throttle=(e,t=200)=>{let n=0;return function(...o){const l=Date.now();l-n>=t&&(e.apply(this,o),n=l)}},volantis.debounce=(e,t=200)=>{let n=null;return function(){n&&clearTimeout(n),n=setTimeout((()=>{e.apply(this,arguments),n=null}),t)}},volantis.requestAnimationFrame=e=>(window.requestAnimationFrame||(window.requestAnimationFrame=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(e){return window.setTimeout(e,1e3/60)}),window.requestAnimationFrame(e)),volantis.layoutHelper=(e,t,n)=>{function o(e,t,n){volantis.tempDiv=document.createElement("div"),volantis.tempDiv.innerHTML=t;let o=document.querySelector("#layoutHelper-"+e);o&&(n&&(o.innerHTML=""),o.append(volantis.tempDiv))}n=Object.assign({clean:!1,pjax:!0},n),o(e,t,n.clean),n.pjax&&volantis.pjax.push((()=>{o(e,t,n.clean)}),"layoutHelper-"+e)},volantis.scroll={engine:new RunItem,unengine:new RunItem},volantis.scroll=Object.assign(volantis.scroll,{push:volantis.scroll.engine.push}),volantis.scroll.getScrollTop=()=>{let e;return window.pageYOffset?e=window.pageYOffset:document.compatMode&&"BackCompat"!=document.compatMode?e=document.documentElement.scrollTop:document.body&&(e=document.body.scrollTop),e},volantis.scroll.scrollHeight=function(){return Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)},volantis.scroll.offsetHeight=function(){return Math.min(document.body.offsetHeight,document.documentElement.offsetHeight,document.body.clientHeight,document.documentElement.clientHeight)},volantis.scroll.progress=function(){return volantis.scroll.getScrollTop()/(volantis.scroll.scrollHeight()-volantis.scroll.offsetHeight())},volantis.scroll.handleScrollEvents=()=>{volantis.scroll.lastScrollTop=volantis.scroll.getScrollTop(),volantis.requestAnimationFrame((function e(){const t=volantis.scroll.getScrollTop();volantis.scroll.lastScrollTop!==t?(volantis.scroll.del=t-volantis.scroll.lastScrollTop,volantis.scroll.lastScrollTop=t,volantis.scroll.unengine.list=[],volantis.scroll.engine.start()):volantis.scroll.unengine.start(),volantis.requestAnimationFrame(e)}))},volantis.scroll.handleScrollEvents(),volantis.scroll.ele=null,volantis.scroll.to=(e,t={})=>{e&&(volantis.scroll.ele=e,opt={top:e.getBoundingClientRect().top+document.documentElement.scrollTop,behavior:"smooth"},"top"in t&&(opt.top=t.top),"behavior"in t&&(opt.behavior=t.behavior),"addTop"in t&&(opt.top+=t.addTop),"observerDic"in t||(t.observerDic=100),window.scrollTo(opt),t.observer&&setTimeout((()=>{volantis.scroll.ele==e&&volantis.scroll.unengine.push((()=>{let n=e.getBoundingClientRect().top;n>=-t.observerDic&&n<=t.observerDic||volantis.scroll.to(e,t),volantis.scroll.unengine.remove("unengineObserver")}),"unengineObserver")}),1e3))},volantis.cleanContentVisibility=()=>{document.querySelector(".post-story")&&(console.log("cleanContentVisibility"),document.querySelectorAll(".post-story").forEach((e=>{e.classList.remove("post-story")})))};const nativeSetTimeout=window.setTimeout,nativeSetInterval=window.setInterval,nativeClearTimeout=window.clearTimeout,nativeClearInterval=window.clearInterval;volantis.activeTimeout=[],volantis.activeInterval=[],window.setTimeout=function(e,t,...n){const o=nativeSetTimeout((function(...t){try{return e.apply(this,t)}finally{const e=volantis.activeTimeout.indexOf(o);-1!==e&&volantis.activeTimeout.splice(e,1)}}),t,...n);return volantis.activeTimeout.push(o),o},window.setInterval=function(e,t,...n){const o=nativeSetInterval(e,t,...n);return volantis.activeInterval.push(o),o},window.clearTimeout=function(e){nativeClearTimeout(e);const t=volantis.activeTimeout.indexOf(e);-1!==t&&volantis.activeTimeout.splice(t,1)},window.clearInterval=function(e){nativeClearInterval(e);const t=volantis.activeInterval.indexOf(e);-1!==t&&volantis.activeInterval.splice(t,1)},volantis.getActiveInterval=function(){return[...volantis.activeInterval]},volantis.getActiveTimeout=function(){return[...volantis.activeTimeout]},volantis.clearAllTimers=function(){volantis.getActiveInterval().forEach((function(e){clearInterval(e)})),volantis.getActiveTimeout().forEach((function(e){clearTimeout(e)}))},volantis.pjax.send(volantis.clearAllTimers,"clearAllTimers")</script><script>volantis.GLOBAL_CONFIG={root:"/",debug:!1,default:{avatar:"https://static.mhuig.top/npm/volantis-static@0.0.1660614606622/media/placeholder/avatar/round/3442075.svg",link:"https://static.mhuig.top/npm/volantis-static@0.0.1660614606622/media/placeholder/link/8f277b4ee0ecd.svg",cover:"https://static.mhuig.top/npm/volantis-static@0.0.1660614606622/media/placeholder/cover/76b86c0226ffd.svg",image:"https://static.mhuig.top/npm/volantis-static@0.0.1660614606622/media/placeholder/image/2659360.svg"},lastupdate:new Date(1779510804521),cdn:{izitoast_css:"https://cdn.bootcdn.net/ajax/libs/izitoast/1.4.0/css/iziToast.min.css",izitoast_js:"https://cdn.bootcdn.net/ajax/libs/izitoast/1.4.0/js/iziToast.min.js",fancybox_css:"https://cdn.bootcdn.net/ajax/libs/fancyapps-ui/4.0.31/fancybox.min.css",fancybox_js:"https://cdn.bootcdn.net/ajax/libs/fancyapps-ui/4.0.31/fancybox.umd.min.js"},sidebar:{for_page:["blogger","navigation","webinfo"],for_post:["toc"],webinfo:{lastupd:{enable:!1,friendlyShow:!0},runtime:{data:"2019/08/19",unit:"天"}}},plugins:{message:{enable:!1,icon:{default:"fa-solid fa-info-circle light-blue",quection:"fa-solid fa-question-circle light-blue"},time:{default:5e3,quection:2e4},position:"topRight",transitionIn:"bounceInLeft",transitionOut:"fadeOutRight",titleColor:"var(--color-text)",messageColor:"var(--color-text)",backgroundColor:"var(--color-card)",zindex:2147483647,copyright:{enable:!0,title:"知识共享许可协议",message:"请遵守 CC BY-NC-SA 4.0 协议。",icon:"far fa-copyright light-blue"},aplayer:{enable:!0,play:"fa-solid fa-play",pause:"fa-solid fa-pause"},rightmenu:{enable:!0,notice:!0}},aplayer:{id:1480000098,enable:!0}},search:{dataPath:("/".endsWith("/")?"/":"//")+"content.json"},languages:{search:{hits_empty:"找不到您查询的内容:${query}",hits_stats:"找到 ${hits} 条结果,用时 ${time} 毫秒"}}}</script><script type="application/ld+json">[{"@context":"http://schema.org","@type":"Organization","name":"MHuiG Magicland","url":"https://blog.mhuig.top/","logo":{"@type":"ImageObject","url":"/lib/favicon/android-chrome-192x192.png","width":192,"height":192}},{"@context":"http://schema.org","@type":"Person","name":"MHuiG","image":{"@type":"ImageObject","url":"/lib/favicon/android-chrome-192x192.png"},"url":"https://blog.mhuig.top/","sameAs":["https://github.com/MHuiG","https://twitter.com/iMHuiG","https://t.me/MHuiG","https://keybase.io/MHuiG"],"description":"「Be Yourself, Make a Difference.」"},{"@context":"http://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"item":{"@id":"https://blog.mhuig.top/","name":"Magicland"}},{"@type":"ListItem","position":2,"item":{"@id":"https://blog.mhuig.top/categories/Web/","name":"Web"}},{"@type":"ListItem","position":2,"item":{"@id":"https://blog.mhuig.top/categories/Web/计算机网络/","name":"计算机网络"}},{"@type":"ListItem","position":3,"item":{"@id":"https://blog.mhuig.top/notes/datacom/6.html","name":"IP编址"}}]},{"@context":"http://schema.org","@type":"WebSite","name":"MHuiG Magicland","url":"https://blog.mhuig.top/","keywords":"MHuiG, @MHuiG, Blog, 博客, Magicland, 魔法世界","description":"宠辱不惊,看庭前花开花落;去留无意,望天上云卷云舒。「Be Yourself, Make a Difference.」 - Magic Island","author":{"@type":"Person","name":"MHuiG","image":{"@type":"ImageObject","url":"/lib/favicon/android-chrome-192x192.png"},"url":"https://blog.mhuig.top/","description":"「Be Yourself, Make a Difference.」"},"publisher":{"@type":"Organization","name":"MHuiG Magicland","url":"https://blog.mhuig.top/","logo":{"@type":"ImageObject","url":"/lib/favicon/android-chrome-192x192.png","width":192,"height":192}},"potentialAction":{"@type":"SearchAction","name":"Coco | The Cat of MHuiG","target":{"@type":"EntryPoint","urlTemplate":"https://blog.mhuig.top/havefun/Coco/?s={search_term_string}"},"query-input":"required name=search_term_string"}},{"@context":"http://schema.org","@type":"BlogPosting","headline":"IP编址","description":"本文详解IPv4编址体系,32bit地址含网络位与主机位,通过子网掩码区分(1标识网络位)。涵盖A/B/C类有类地址分类、私有地址范围(如10.0.0.0/8)及特殊地址(0.0.0.0、广播地址)。解析IP报文头部字段(TTL生存周期、Protocol协议类型),提供VLSM子网划分(借位计算子网数与可用地址)及CIDR汇总方法,附网络/广播地址计算实例与公式(可用地址=2^h-2,h为主机位)。","inLanguage":"zh-Hans","mainEntityOfPage":{"@type":"WebPage","@id":"https://blog.mhuig.top/notes/datacom/6"},"author":{"@type":"Person","name":"MHuiG","image":{"@type":"ImageObject","url":"/lib/favicon/android-chrome-192x192.png"},"url":"https://blog.mhuig.top/"},"publisher":{"@type":"Organization","name":"MHuiG Magicland","logo":{"@type":"ImageObject","url":"/lib/favicon/android-chrome-192x192.png","width":192,"height":192}},"url":"https://blog.mhuig.top/notes/datacom/6","wordCount":0,"datePublished":"2023-12-06T01:30:00.000Z","dateModified":"2025-11-20T10:18:00.000Z","articleSection":"Web","keywords":"数据通信网络,IPv4地址结构,子网划分技术,VLSM/CIDR应用","image":{"@type":"ImageObject","url":"/lib/favicon/android-chrome-192x192.png","width":192,"height":192}}]</script></head><body itemscope="" itemtype="http://schema.org/WebPage"><pjax></pjax><header itemscope="" itemtype="http://schema.org/WPHeader" id="l_header" class="l_header auto shadow floatable blur show" style="opacity:0"><div class="container"><div id="wrapper"><div class="nav-sub"><p class="title"></p><ul class="switcher nav-list-h m-phone" id="pjax-header-nav-list"><li><a id="s-comment" class="fa-solid fa-comments fa-fw" target="_self" title="comment"></a></li><li><a id="s-toc" class="s-toc fa-solid fa-list fa-fw" target="_self" title="toc"></a></li></ul></div><div class="nav-main"> <a class="title flat-box" target="_self" href="/">MHuiG</a><div class="menu navigation"><ul class="nav-list-h m-pc"><li><a class="menuitem flat-box faa-parent animated-hover" title="索引"><i class="fa-duotone fa-list-alt fa-fw"></i> 索引</a><ul class="list-v"><li><a class="menuitem flat-box faa-parent animated-hover" href="/notes/" title="便签" active-action="action-notes"><i class="fa-duotone fa-books fa-fw"></i> 便签</a></li><li><a class="menuitem flat-box faa-parent animated-hover" href="/categories/" title="分类" active-action="action-categories"><i class="fa-duotone fa-folder-open fa-fw"></i> 分类</a></li><li><a class="menuitem flat-box faa-parent animated-hover" href="/tags/" title="标签" active-action="action-tags"><i class="fa-duotone fa-tags fa-fw"></i> 标签</a></li><li><a class="menuitem flat-box faa-parent animated-hover" href="/archives/" title="归档" active-action="action-archives"><i class="fa-duotone fa-archive fa-fw"></i> 归档</a></li></ul></li><li><a class="menuitem flat-box faa-parent animated-hover" href="/pages/friends/" title="友链" active-action="action-pagesfriends"><i class="fa-duotone fa-link fa-fw"></i> 友链</a><ul class="list-v"><li><a class="menuitem flat-box faa-parent animated-hover" href="https://www.travellings.cn/go-by-clouds.html" title="Travelling" target="_blank" active-action="action-https:wwwtravellingscngo-by-cloudshtml" rel="external nofollow noopener noreferrer"><i class="fa-duotone fa-subway fa-fw"></i> Travelling</a></li></ul></li><li><a class="menuitem flat-box faa-parent animated-hover" href="/pages/about/" title="关于" active-action="action-pagesabout"><i class="fa-duotone fa-user-tie fa-fw"></i> 关于</a><ul class="list-v"><li><a class="menuitem flat-box faa-parent animated-hover" href="/pages/time-machine/" title="时光机" active-action="action-pagestime-machine"><i class="fa-duotone fa-clock fa-fw"></i> 时光机</a></li><li><a class="menuitem flat-box faa-parent animated-hover" target="_blank" rel="noopener" href="https://mhuig.top/privacy-policy/" title="隐私政策" active-action="action-https:mhuigtopprivacy-policy"><i class="fa-duotone fa-user-secret fa-fw"></i> 隐私政策</a></li></ul></li><li><a class="menuitem flat-box faa-parent animated-hover" title="更多"><i class="fa-duotone fa-fan fa-spin fa-fw"></i> 更多</a><ul class="list-v"><li><a class="menuitem flat-box faa-parent animated-hover" href="/pages/beer/" title="Sponsor" active-action="action-pagesbeer"><i class="fa-duotone fa-heart-square fa-fw"></i> Sponsor</a></li><hr><li><a class="menuitem flat-box faa-parent animated-hover" title="博客管理"><i class="fa-duotone fa-user-shield fa-fw"></i> 博客管理</a><ul class="list-v"><li><a class="menuitem flat-box header toggle-mode-btn"><i class="fa-duotone fa-bat fa-fw"></i> 暗黑模式</a></li><li></li><li><a class="menuitem flat-box faa-parent animated-hover" href="/pages/rss/" title="RSS订阅" active-action="action-pagesrss"><i class="fa-duotone fa-rss fa-fw"></i> RSS订阅</a></li><li><a class="menuitem flat-box faa-parent animated-hover" href="/sitemap.xml" title="站点地图" active-action="action-sitemapxml"><i class="fa-duotone fa-sitemap fa-fw"></i> 站点地图</a></li><li><a class="menuitem flat-box faa-parent animated-hover" target="_blank" rel="external nofollow noopener noreferrer" href="https://mhuig.instatus.com/" title="Monitors" active-action="action-https:mhuiginstatuscom"><i class="fa-duotone fa-telescope fa-fw"></i> Monitors</a></li><li><a class="menuitem flat-box faa-parent animated-hover" target="_blank" rel="external nofollow noopener noreferrer" href="https://ssl.mhuig.top/" title="SSL Status" active-action="action-https:sslmhuigtop"><i class="fa-brands fa-expeditedssl fa-fw"></i> SSL Status</a></li></ul></li><hr><li><a class="menuitem flat-box faa-parent animated-hover" title="工具箱"><i class="fa-duotone fa-tools fa-fw"></i> 工具箱</a><ul class="list-v"><li><a class="menuitem flat-box faa-parent animated-hover" target="_blank" rel="external nofollow noopener noreferrer" href="https://rssbox.mhuig.top/" title="RSS Box" active-action="action-https:rssboxmhuigtop"><i class="fa-duotone fa-conveyor-belt-boxes fa-fw"></i> RSS Box</a></li><li><a class="menuitem flat-box faa-parent animated-hover" href="/havefun/Coco/" title="My Cat" active-action="action-havefunCoco"><i class="fa-duotone fa-cat fa-fw"></i> My Cat</a></li><li><a class="menuitem flat-box"><i class="fa-duotone fa-compact-disc fa-spin fa-fw music"></i> Music</a><ul class="list-v"><li><div class="aplayer-container"><div class="aplayer-local"></div></div></li></ul></li><li></li><li><a class="menuitem flat-box faa-parent animated-hover" href="/pages/talk/" title="碎言碎语" active-action="action-pagestalk"><i class="fa-duotone fa-comments fa-fw"></i> 碎言碎语</a></li></ul></li><hr><li><a class="menuitem flat-box faa-parent animated-hover" target="_blank" rel="external nofollow noopener noreferrer" href="https://github.com/MHuiG" title="GitHub" active-action="action-https:githubcomMHuiG"><i class="fa-brands fa-github fa-fw"></i> GitHub</a></li></ul></li></ul></div><div class="m_search"><form name="searchform" class="form u-search-form"><i class="icon fa-solid fa-search fa-fw"></i> <input type="text" class="input u-search-input" placeholder="Search..."></form></div><ul class="switcher nav-list-h m-phone"><li><a class="s-search fa-solid fa-search fa-fw" target="_self" title="search"></a></li><li><a class="s-menu fa-solid fa-bars fa-fw" target="_self" title="menu"></a><ul class="menu-phone list-v navigation white-box"><li><a class="menuitem flat-box faa-parent animated-hover" title="索引"><i class="fa-duotone fa-list-alt fa-fw"></i> 索引</a><ul class="list-v"><li><a class="menuitem flat-box faa-parent animated-hover" href="/notes/" title="便签" active-action="action-notes"><i class="fa-duotone fa-books fa-fw"></i> 便签</a></li><li><a class="menuitem flat-box faa-parent animated-hover" href="/categories/" title="分类" active-action="action-categories"><i class="fa-duotone fa-folder-open fa-fw"></i> 分类</a></li><li><a class="menuitem flat-box faa-parent animated-hover" href="/tags/" title="标签" active-action="action-tags"><i class="fa-duotone fa-tags fa-fw"></i> 标签</a></li><li><a class="menuitem flat-box faa-parent animated-hover" href="/archives/" title="归档" active-action="action-archives"><i class="fa-duotone fa-archive fa-fw"></i> 归档</a></li></ul></li><li><a class="menuitem flat-box faa-parent animated-hover" href="/pages/friends/" title="友链" active-action="action-pagesfriends"><i class="fa-duotone fa-link fa-fw"></i> 友链</a><ul class="list-v"><li><a class="menuitem flat-box faa-parent animated-hover" href="https://www.travellings.cn/go-by-clouds.html" title="Travelling" target="_blank" active-action="action-https:wwwtravellingscngo-by-cloudshtml" rel="external nofollow noopener noreferrer"><i class="fa-duotone fa-subway fa-fw"></i> Travelling</a></li></ul></li><li><a class="menuitem flat-box faa-parent animated-hover" href="/pages/about/" title="关于" active-action="action-pagesabout"><i class="fa-duotone fa-user-tie fa-fw"></i> 关于</a><ul class="list-v"><li><a class="menuitem flat-box faa-parent animated-hover" href="/pages/time-machine/" title="时光机" active-action="action-pagestime-machine"><i class="fa-duotone fa-clock fa-fw"></i> 时光机</a></li><li><a class="menuitem flat-box faa-parent animated-hover" target="_blank" rel="noopener" href="https://mhuig.top/privacy-policy/" title="隐私政策" active-action="action-https:mhuigtopprivacy-policy"><i class="fa-duotone fa-user-secret fa-fw"></i> 隐私政策</a></li></ul></li><li><a class="menuitem flat-box faa-parent animated-hover" title="更多"><i class="fa-duotone fa-fan fa-spin fa-fw"></i> 更多</a><ul class="list-v"><li><a class="menuitem flat-box faa-parent animated-hover" href="/pages/beer/" title="Sponsor" active-action="action-pagesbeer"><i class="fa-duotone fa-heart-square fa-fw"></i> Sponsor</a></li><hr><li><a class="menuitem flat-box faa-parent animated-hover" title="博客管理"><i class="fa-duotone fa-user-shield fa-fw"></i> 博客管理</a><ul class="list-v"><li><a class="menuitem flat-box header toggle-mode-btn"><i class="fa-duotone fa-bat fa-fw"></i> 暗黑模式</a></li><li></li><li><a class="menuitem flat-box faa-parent animated-hover" href="/pages/rss/" title="RSS订阅" active-action="action-pagesrss"><i class="fa-duotone fa-rss fa-fw"></i> RSS订阅</a></li><li><a class="menuitem flat-box faa-parent animated-hover" href="/sitemap.xml" title="站点地图" active-action="action-sitemapxml"><i class="fa-duotone fa-sitemap fa-fw"></i> 站点地图</a></li><li><a class="menuitem flat-box faa-parent animated-hover" target="_blank" rel="external nofollow noopener noreferrer" href="https://mhuig.instatus.com/" title="Monitors" active-action="action-https:mhuiginstatuscom"><i class="fa-duotone fa-telescope fa-fw"></i> Monitors</a></li><li><a class="menuitem flat-box faa-parent animated-hover" target="_blank" rel="external nofollow noopener noreferrer" href="https://ssl.mhuig.top/" title="SSL Status" active-action="action-https:sslmhuigtop"><i class="fa-brands fa-expeditedssl fa-fw"></i> SSL Status</a></li></ul></li><hr><li><a class="menuitem flat-box faa-parent animated-hover" title="工具箱"><i class="fa-duotone fa-tools fa-fw"></i> 工具箱</a><ul class="list-v"><li><a class="menuitem flat-box faa-parent animated-hover" target="_blank" rel="external nofollow noopener noreferrer" href="https://rssbox.mhuig.top/" title="RSS Box" active-action="action-https:rssboxmhuigtop"><i class="fa-duotone fa-conveyor-belt-boxes fa-fw"></i> RSS Box</a></li><li><a class="menuitem flat-box faa-parent animated-hover" href="/havefun/Coco/" title="My Cat" active-action="action-havefunCoco"><i class="fa-duotone fa-cat fa-fw"></i> My Cat</a></li><li><a class="menuitem flat-box faa-parent animated-hover" href="/pages/talk/" title="碎言碎语" active-action="action-pagestalk"><i class="fa-duotone fa-comments fa-fw"></i> 碎言碎语</a></li></ul></li><hr><li><a class="menuitem flat-box faa-parent animated-hover" target="_blank" rel="external nofollow noopener noreferrer" href="https://github.com/MHuiG" title="GitHub" active-action="action-https:githubcomMHuiG"><i class="fa-brands fa-github fa-fw"></i> GitHub</a></li></ul></li></ul></li></ul></div></div></div></header><div id="l_body"><div id="l_cover"><div id="none" class="cover-wrapper docs featured" style="display:none"><div class="cover-bg lazyload placeholder" data-bg=""></div><div class="cover-body"><div class="top"><p class="title">Magicland</p><p class="subtitle">「看庭前花开花落,望天上云卷云舒」</p></div><div class="bottom"><div class="menu navigation"><div class="list-h"><a target="_blank" rel="external nofollow noopener noreferrer" href="https://github.com/MHuiG" active-action="action-https:githubcomMHuiG"><i class="fa-brands fa-github color-github fa-fw"></i><p>Github</p></a><a href="/pages/friends/" active-action="action-pagesfriends"><i class="fa-duotone fa-link color-friends fa-fw"></i><p>友链</p></a><a href="/pages/about/" active-action="action-pagesabout"><i class="fa-duotone fa-user-tie color-about fa-fw"></i><p>关于</p></a><a href="https://www.travellings.cn/go-by-clouds.html" target="_blank" active-action="action-https:wwwtravellingscngo-by-cloudshtml" rel="external nofollow noopener noreferrer"><i class="fa-duotone fa-subway color-travellings fa-fw"></i><p>Travelling</p></a></div></div></div></div><div id="scroll-down" style="display:none"><i class="fa fa-chevron-down scroll-down-effects"></i></div></div></div><div id="safearea"><div class="body-wrapper"><div id="l_main" class=""><article itemscope="" itemtype="http://schema.org/Article" class="article post white-box reveal md shadow floatable blur article-type-docs" id="docs" itemprop="blogPost"><link itemprop="mainEntityOfPage" href="https://blog.mhuig.top/notes/datacom/6"><span hidden="" itemprop="publisher" itemscope="" itemtype="http://schema.org/Organization"><meta itemprop="name" content="Magicland"></span><span hidden="" itemprop="post" itemscope="" itemtype="http://schema.org/CreativeWork"><meta itemprop="name" content="IP编址"><meta itemprop="description" content="本文详解IPv4编址体系,32bit地址含网络位与主机位,通过子网掩码区分(1标识网络位)。涵盖A/B/C类有类地址分类、私有地址范围(如10.0.0.0/8)及特殊地址(0.0.0.0、广播地址)。解析IP报文头部字段(TTL生存周期、Protocol协议类型),提供VLSM子网划分(借位计算子网数与可用地址)及CIDR汇总方法,附网络/广播地址计算实例与公式(可用地址=2^h-2,h为主机位)。"></span><span hidden=""><meta itemprop="image" content="/lib/favicon/android-chrome-192x192.png"></span><div class="article-meta" id="top"><span hidden="" itemprop="name headline"></span></div><div id="layoutHelper-page-plugins"></div><div id="post-body" itemprop="articleBody"><p> <span class="p logo center large">IP 编址</span></p><br><h1 hidden="">IP 编址</h1><div class="story post-story"><h2 id="IP"><a href="#IP" class="headerlink" title="IP"></a>IP</h2><p><code>IP</code>: 网际协议, 网络层协议, 用来为网络中设备分配逻辑地址.</p><p>网络层的逻辑地址就是 IP 地址, IP 地址是可以更改的, 当设备在不同网络中, 根据所处网络的不同发生变化, 在同一个网络内必须保证唯一性. 设备有了 IP 地址后, 就可以在网络中进行通信.</p></div><div class="story post-story"><h2 id="IP报文头部"><a href="#IP报文头部" class="headerlink" title="IP报文头部"></a>IP 报文头部</h2><p><a target="_blank" rel="external nofollow noopener noreferrer" href="/go.html?u=aHR0cHM6Ly93d3cucmZjLWVkaXRvci5vcmcvcmZjL3JmYzc5MS50eHQ">RFC 791</a></p><figure class="highlight plaintext"><table><tbody><tr><td class="code"><pre><span class="line">0 1 2 3 </span><br><span class="line">0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 </span><br><span class="line">+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+</span><br><span class="line">|Version| IHL |Type of Service| Total Length |</span><br><span class="line">+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+</span><br><span class="line">| Identification |Flags| Fragment Offset |</span><br><span class="line">+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+</span><br><span class="line">| Time to Live | Protocol | Header Checksum |</span><br><span class="line">+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+</span><br><span class="line">| Source Address |</span><br><span class="line">+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+</span><br><span class="line">| Destination Address |</span><br><span class="line">+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+</span><br><span class="line">| Options | Padding |</span><br><span class="line">+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+</span><br><span class="line"></span><br><span class="line"> Example Internet Datagram Header</span><br></pre></td></tr></tbody></table></figure><p><img src="https://static.mhuig.top/npm/mhgoos@0.0.1701856320515/image-20231206174344057.png" class="lazyload" data-srcset="https://static.mhuig.top/npm/mhgoos@0.0.1701856320515/image-20231206174344057.png" srcset="data:image/gif;base64,R0lGODlhAQABAIAAAP///////yH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" alt="IP报文头部"></p><h3 id="基本信息行"><a href="#基本信息行" class="headerlink" title="基本信息行"></a>基本信息行</h3><p><code>Version</code>: 版本, <code>4bit</code>, 用来标明当前 IP 协议的版本, 如果当前报文在 IPv4 时, 则该字段的值为 <code>4(0b0100)</code></p><p><code>IHL</code>: IP 头部长度, <code>4bit</code>, 范围 <code>20-60</code> 字节, 每个单位代表 <code>4</code> 字节</p><p><mjx-container class="MathJax" jax="SVG" overflow="overflow"><svg style="vertical-align:-.566ex" xmlns="http://www.w3.org/2000/svg" width="6.627ex" height="2.262ex" role="img" focusable="false" viewBox="0 -750 2929 1000"><g stroke="currentColor" fill="currentColor" stroke-width="0" transform="scale(1,-1)"><g data-mml-node="math" data-latex="0b1111=15"><g data-mml-node="mn" data-latex="0"><path data-c="30" d="M249-22C390-22 460 92 460 320 460 473 428 575 365 625 330 652 291 666 250 666 109 666 39 551 39 320 39 136 88-22 249-22M361 524C368 489 371 425 371 332 371 240 367 172 360 128 347 48 310 8 249 8 226 8 203 17 182 34 155 57 139 104 132 176 129 201 128 253 128 332 128 419 131 480 136 513 145 568 163 603 191 618 213 630 232 636 249 636 314 636 350 583 361 524Z"></path></g><g data-mml-node="mi" data-latex="b" transform="translate(500,0)"><path data-c="1D44F" d="M281 445C245 445 209 428 174 394L243 679C241 688 238 694 226 694 193 694 120 685 107 684 92 682 84 675 84 660 84 650 93 645 112 645 131 645 157 646 157 632 157 628 152 608 143 571L63 249C52 207 47 173 47 148 47 62 93-11 175-11 240-11 297 22 347 89 392 151 415 216 415 283 415 370 364 445 281 445M279 415C318 415 337 385 337 326 337 299 331 263 319 218 297 133 268 75 233 44 213 27 194 19 175 19 134 19 114 51 114 115 114 137 119 170 129 214L151 304C154 319 159 330 165 338 204 389 242 415 279 415Z"></path></g><g data-mml-node="mn" data-latex="111" transform="translate(929,0)"><path data-c="31" d="M269 666C228 624 168 603 89 603L89 564C141 564 184 572 217 588L217 82C217 64 213 52 204 47 195 42 170 39 130 39L95 39 95 0C120 2 174 3 257 3 340 3 394 2 419 0L419 39 384 39C343 39 318 42 310 47 302 52 297 64 297 82L297 636C297 660 295 666 269 666Z"></path><path data-c="31" d="M269 666C228 624 168 603 89 603L89 564C141 564 184 572 217 588L217 82C217 64 213 52 204 47 195 42 170 39 130 39L95 39 95 0C120 2 174 3 257 3 340 3 394 2 419 0L419 39 384 39C343 39 318 42 310 47 302 52 297 64 297 82L297 636C297 660 295 666 269 666Z" transform="translate(500,0)"></path><path data-c="31" d="M269 666C228 624 168 603 89 603L89 564C141 564 184 572 217 588L217 82C217 64 213 52 204 47 195 42 170 39 130 39L95 39 95 0C120 2 174 3 257 3 340 3 394 2 419 0L419 39 384 39C343 39 318 42 310 47 302 52 297 64 297 82L297 636C297 660 295 666 269 666Z" transform="translate(1000,0)"></path><path data-c="31" d="M269 666C228 624 168 603 89 603L89 564C141 564 184 572 217 588L217 82C217 64 213 52 204 47 195 42 170 39 130 39L95 39 95 0C120 2 174 3 257 3 340 3 394 2 419 0L419 39 384 39C343 39 318 42 310 47 302 52 297 64 297 82L297 636C297 660 295 666 269 666Z" transform="translate(1500,0)"></path></g></g></g></svg><mjx-break size="4"></mjx-break><svg style="vertical-align:-.566ex" xmlns="http://www.w3.org/2000/svg" width="4.651ex" height="2.262ex" role="img" focusable="false" viewBox="0 -750 2055.8 1000"><g stroke="currentColor" fill="currentColor" stroke-width="0" transform="scale(1,-1)"><g data-mml-node="math" data-latex="0b1111=15"><g data-mml-node="mo" data-latex="="><path data-c="3D" d="M698 367 80 367C64 367 56 359 56 344 56 329 64 321 80 321L698 321C714 321 722 329 722 344 722 356 711 367 698 367M698 179 80 179C64 179 56 171 56 156 56 141 64 133 80 133L698 133C714 133 722 141 722 156 722 169 711 179 698 179Z"></path></g><g data-mml-node="mn" data-latex="5" transform="translate(1055.8,0)"><path data-c="31" d="M269 666C228 624 168 603 89 603L89 564C141 564 184 572 217 588L217 82C217 64 213 52 204 47 195 42 170 39 130 39L95 39 95 0C120 2 174 3 257 3 340 3 394 2 419 0L419 39 384 39C343 39 318 42 310 47 302 52 297 64 297 82L297 636C297 660 295 666 269 666Z"></path><path data-c="35" d="M118 315C123 315 129 319 134 326 164 371 205 393 257 393 292 393 319 373 337 332 348 305 354 264 354 209 354 146 346 102 331 76 306 35 272 14 229 14 162 14 109 62 91 114 94 113 96 114 100 114 130 114 155 137 155 167 155 198 130 219 100 219 65 219 50 200 50 163 50 63 131-22 231-22 292-22 344 0 386 44 428 88 449 141 449 202 449 260 432 310 398 353 361 400 315 423 259 423 212 423 171 408 138 378L138 556C165 548 191 544 218 544 264 544 304 555 338 578 369 597 390 616 402 634 408 642 411 648 411 651 411 661 406 666 396 666 341 645 294 634 256 634 211 634 168 643 127 662 122 664 118 665 114 665 105 665 100 656 100 637L100 345C100 324 100 315 118 315Z" transform="translate(500,0)"></path></g></g></g></svg></mjx-container> ,<mjx-container class="MathJax" jax="SVG" overflow="overflow"><svg style="vertical-align:-.566ex" xmlns="http://www.w3.org/2000/svg" width="2.262ex" height="2.262ex" role="img" focusable="false" viewBox="0 -750 1000 1000"><g stroke="currentColor" fill="currentColor" stroke-width="0" transform="scale(1,-1)"><g data-mml-node="math" data-latex="15\times4"><g data-mml-node="mn" data-latex="5"><path data-c="31" d="M269 666C228 624 168 603 89 603L89 564C141 564 184 572 217 588L217 82C217 64 213 52 204 47 195 42 170 39 130 39L95 39 95 0C120 2 174 3 257 3 340 3 394 2 419 0L419 39 384 39C343 39 318 42 310 47 302 52 297 64 297 82L297 636C297 660 295 666 269 666Z"></path><path data-c="35" d="M118 315C123 315 129 319 134 326 164 371 205 393 257 393 292 393 319 373 337 332 348 305 354 264 354 209 354 146 346 102 331 76 306 35 272 14 229 14 162 14 109 62 91 114 94 113 96 114 100 114 130 114 155 137 155 167 155 198 130 219 100 219 65 219 50 200 50 163 50 63 131-22 231-22 292-22 344 0 386 44 428 88 449 141 449 202 449 260 432 310 398 353 361 400 315 423 259 423 212 423 171 408 138 378L138 556C165 548 191 544 218 544 264 544 304 555 338 578 369 597 390 616 402 634 408 642 411 648 411 651 411 661 406 666 396 666 341 645 294 634 256 634 211 634 168 643 127 662 122 664 118 665 114 665 105 665 100 656 100 637L100 345C100 324 100 315 118 315Z" transform="translate(500,0)"></path></g></g></g></svg><mjx-break size="3"></mjx-break><svg style="vertical-align:-.566ex" xmlns="http://www.w3.org/2000/svg" width="3.394ex" height="2.262ex" role="img" focusable="false" viewBox="0 -750 1500.2 1000"><g stroke="currentColor" fill="currentColor" stroke-width="0" transform="scale(1,-1)"><g data-mml-node="math" data-latex="15\times4"><g data-mml-node="mo" data-latex="\times"><path data-c="D7" d="M630 32C630 39 628 44 623 49L422 250 623 451C628 456 630 461 630 468 630 481 620 491 607 491 600 491 595 489 590 484L389 283 188 484C183 489 178 491 171 491 158 491 148 481 148 468 148 461 150 456 155 451L356 250 155 49C150 44 148 39 148 32 148 19 158 9 171 9 178 9 183 11 188 16L389 217 590 16C595 11 600 9 607 9 620 9 630 19 630 32Z"></path></g><g data-mml-node="mn" data-latex="4" transform="translate(1000.2,0)"><path data-c="34" d="M353 677C344 677 336 672 330 663L28 199 28 163 289 163 289 81C289 63 285 51 278 46 271 41 252 39 219 39L194 39 194 0C223 2 269 3 331 3 393 3 439 2 468 0L468 39 443 39C410 39 391 41 384 46 377 51 373 63 373 81L373 163 471 163 471 202 373 202 373 660C373 670 366 677 353 677M295 553 295 202 67 202Z"></path></g></g></g></svg></mjx-container> 字节<mjx-container class="MathJax" jax="SVG" overflow="overflow"><svg style="vertical-align:-.05ex" xmlns="http://www.w3.org/2000/svg" width="4.651ex" height="1.557ex" role="img" focusable="false" viewBox="0 -666 2055.8 688"><g stroke="currentColor" fill="currentColor" stroke-width="0" transform="scale(1,-1)"><g data-mml-node="math" data-latex="=60"><g data-mml-node="mo" data-latex="="><path data-c="3D" d="M698 367 80 367C64 367 56 359 56 344 56 329 64 321 80 321L698 321C714 321 722 329 722 344 722 356 711 367 698 367M698 179 80 179C64 179 56 171 56 156 56 141 64 133 80 133L698 133C714 133 722 141 722 156 722 169 711 179 698 179Z"></path></g><g data-mml-node="mn" data-latex="0" transform="translate(1055.8,0)"><path data-c="36" d="M383 504C416 504 432 521 432 555 432 627 378 666 304 666 221 666 155 627 106 548 63 480 42 403 42 316 42 189 65 100 112 47 152 1 198-22 251-22 312-22 362 1 401 47 438 91 457 144 457 205 457 266 439 318 403 361 365 407 316 431 257 431 205 431 165 402 138 346L138 352C138 465 166 561 226 605 252 624 279 633 306 633 342 633 368 623 385 602 351 602 334 583 334 553 334 525 355 504 383 504M344 340C355 317 361 272 361 206 361 141 356 98 345 76 325 35 294 14 251 14 222 14 200 24 184 44 171 60 162 74 158 85 146 116 140 163 140 227 140 255 144 282 151 308 164 355 201 399 256 399 295 399 325 379 344 340Z"></path><path data-c="30" d="M249-22C390-22 460 92 460 320 460 473 428 575 365 625 330 652 291 666 250 666 109 666 39 551 39 320 39 136 88-22 249-22M361 524C368 489 371 425 371 332 371 240 367 172 360 128 347 48 310 8 249 8 226 8 203 17 182 34 155 57 139 104 132 176 129 201 128 253 128 332 128 419 131 480 136 513 145 568 163 603 191 618 213 630 232 636 249 636 314 636 350 583 361 524Z" transform="translate(500,0)"></path></g></g></g></svg></mjx-container> 字节</p><p><mjx-container class="MathJax" jax="SVG" overflow="overflow"><svg style="vertical-align:-.566ex" xmlns="http://www.w3.org/2000/svg" width="6.627ex" height="2.262ex" role="img" focusable="false" viewBox="0 -750 2929 1000"><g stroke="currentColor" fill="currentColor" stroke-width="0" transform="scale(1,-1)"><g data-mml-node="math" data-latex="0b0101=5"><g data-mml-node="mn" data-latex="0"><path data-c="30" d="M249-22C390-22 460 92 460 320 460 473 428 575 365 625 330 652 291 666 250 666 109 666 39 551 39 320 39 136 88-22 249-22M361 524C368 489 371 425 371 332 371 240 367 172 360 128 347 48 310 8 249 8 226 8 203 17 182 34 155 57 139 104 132 176 129 201 128 253 128 332 128 419 131 480 136 513 145 568 163 603 191 618 213 630 232 636 249 636 314 636 350 583 361 524Z"></path></g><g data-mml-node="mi" data-latex="b" transform="translate(500,0)"><path data-c="1D44F" d="M281 445C245 445 209 428 174 394L243 679C241 688 238 694 226 694 193 694 120 685 107 684 92 682 84 675 84 660 84 650 93 645 112 645 131 645 157 646 157 632 157 628 152 608 143 571L63 249C52 207 47 173 47 148 47 62 93-11 175-11 240-11 297 22 347 89 392 151 415 216 415 283 415 370 364 445 281 445M279 415C318 415 337 385 337 326 337 299 331 263 319 218 297 133 268 75 233 44 213 27 194 19 175 19 134 19 114 51 114 115 114 137 119 170 129 214L151 304C154 319 159 330 165 338 204 389 242 415 279 415Z"></path></g><g data-mml-node="mn" data-latex="101" transform="translate(929,0)"><path data-c="30" d="M249-22C390-22 460 92 460 320 460 473 428 575 365 625 330 652 291 666 250 666 109 666 39 551 39 320 39 136 88-22 249-22M361 524C368 489 371 425 371 332 371 240 367 172 360 128 347 48 310 8 249 8 226 8 203 17 182 34 155 57 139 104 132 176 129 201 128 253 128 332 128 419 131 480 136 513 145 568 163 603 191 618 213 630 232 636 249 636 314 636 350 583 361 524Z"></path><path data-c="31" d="M269 666C228 624 168 603 89 603L89 564C141 564 184 572 217 588L217 82C217 64 213 52 204 47 195 42 170 39 130 39L95 39 95 0C120 2 174 3 257 3 340 3 394 2 419 0L419 39 384 39C343 39 318 42 310 47 302 52 297 64 297 82L297 636C297 660 295 666 269 666Z" transform="translate(500,0)"></path><path data-c="30" d="M249-22C390-22 460 92 460 320 460 473 428 575 365 625 330 652 291 666 250 666 109 666 39 551 39 320 39 136 88-22 249-22M361 524C368 489 371 425 371 332 371 240 367 172 360 128 347 48 310 8 249 8 226 8 203 17 182 34 155 57 139 104 132 176 129 201 128 253 128 332 128 419 131 480 136 513 145 568 163 603 191 618 213 630 232 636 249 636 314 636 350 583 361 524Z" transform="translate(1000,0)"></path><path data-c="31" d="M269 666C228 624 168 603 89 603L89 564C141 564 184 572 217 588L217 82C217 64 213 52 204 47 195 42 170 39 130 39L95 39 95 0C120 2 174 3 257 3 340 3 394 2 419 0L419 39 384 39C343 39 318 42 310 47 302 52 297 64 297 82L297 636C297 660 295 666 269 666Z" transform="translate(1500,0)"></path></g></g></g></svg><mjx-break size="4"></mjx-break><svg style="vertical-align:-.566ex" xmlns="http://www.w3.org/2000/svg" width="3.52ex" height="2.262ex" role="img" focusable="false" viewBox="0 -750 1555.8 1000"><g stroke="currentColor" fill="currentColor" stroke-width="0" transform="scale(1,-1)"><g data-mml-node="math" data-latex="0b0101=5"><g data-mml-node="mo" data-latex="="><path data-c="3D" d="M698 367 80 367C64 367 56 359 56 344 56 329 64 321 80 321L698 321C714 321 722 329 722 344 722 356 711 367 698 367M698 179 80 179C64 179 56 171 56 156 56 141 64 133 80 133L698 133C714 133 722 141 722 156 722 169 711 179 698 179Z"></path></g><g data-mml-node="mn" data-latex="5" transform="translate(1055.8,0)"><path data-c="35" d="M118 315C123 315 129 319 134 326 164 371 205 393 257 393 292 393 319 373 337 332 348 305 354 264 354 209 354 146 346 102 331 76 306 35 272 14 229 14 162 14 109 62 91 114 94 113 96 114 100 114 130 114 155 137 155 167 155 198 130 219 100 219 65 219 50 200 50 163 50 63 131-22 231-22 292-22 344 0 386 44 428 88 449 141 449 202 449 260 432 310 398 353 361 400 315 423 259 423 212 423 171 408 138 378L138 556C165 548 191 544 218 544 264 544 304 555 338 578 369 597 390 616 402 634 408 642 411 648 411 651 411 661 406 666 396 666 341 645 294 634 256 634 211 634 168 643 127 662 122 664 118 665 114 665 105 665 100 656 100 637L100 345C100 324 100 315 118 315Z"></path></g></g></g></svg></mjx-container> ,<mjx-container class="MathJax" jax="SVG" overflow="overflow"><svg style="vertical-align:-.566ex" xmlns="http://www.w3.org/2000/svg" width="1.131ex" height="2.262ex" role="img" focusable="false" viewBox="0 -750 500 1000"><g stroke="currentColor" fill="currentColor" stroke-width="0" transform="scale(1,-1)"><g data-mml-node="math" data-latex="5\times4"><g data-mml-node="mn" data-latex="5"><path data-c="35" d="M118 315C123 315 129 319 134 326 164 371 205 393 257 393 292 393 319 373 337 332 348 305 354 264 354 209 354 146 346 102 331 76 306 35 272 14 229 14 162 14 109 62 91 114 94 113 96 114 100 114 130 114 155 137 155 167 155 198 130 219 100 219 65 219 50 200 50 163 50 63 131-22 231-22 292-22 344 0 386 44 428 88 449 141 449 202 449 260 432 310 398 353 361 400 315 423 259 423 212 423 171 408 138 378L138 556C165 548 191 544 218 544 264 544 304 555 338 578 369 597 390 616 402 634 408 642 411 648 411 651 411 661 406 666 396 666 341 645 294 634 256 634 211 634 168 643 127 662 122 664 118 665 114 665 105 665 100 656 100 637L100 345C100 324 100 315 118 315Z"></path></g></g></g></svg><mjx-break size="3"></mjx-break><svg style="vertical-align:-.566ex" xmlns="http://www.w3.org/2000/svg" width="3.394ex" height="2.262ex" role="img" focusable="false" viewBox="0 -750 1500.2 1000"><g stroke="currentColor" fill="currentColor" stroke-width="0" transform="scale(1,-1)"><g data-mml-node="math" data-latex="5\times4"><g data-mml-node="mo" data-latex="\times"><path data-c="D7" d="M630 32C630 39 628 44 623 49L422 250 623 451C628 456 630 461 630 468 630 481 620 491 607 491 600 491 595 489 590 484L389 283 188 484C183 489 178 491 171 491 158 491 148 481 148 468 148 461 150 456 155 451L356 250 155 49C150 44 148 39 148 32 148 19 158 9 171 9 178 9 183 11 188 16L389 217 590 16C595 11 600 9 607 9 620 9 630 19 630 32Z"></path></g><g data-mml-node="mn" data-latex="4" transform="translate(1000.2,0)"><path data-c="34" d="M353 677C344 677 336 672 330 663L28 199 28 163 289 163 289 81C289 63 285 51 278 46 271 41 252 39 219 39L194 39 194 0C223 2 269 3 331 3 393 3 439 2 468 0L468 39 443 39C410 39 391 41 384 46 377 51 373 63 373 81L373 163 471 163 471 202 373 202 373 660C373 670 366 677 353 677M295 553 295 202 67 202Z"></path></g></g></g></svg></mjx-container> 字节<mjx-container class="MathJax" jax="SVG" overflow="overflow"><svg style="vertical-align:-.05ex" xmlns="http://www.w3.org/2000/svg" width="4.651ex" height="1.557ex" role="img" focusable="false" viewBox="0 -666 2055.8 688"><g stroke="currentColor" fill="currentColor" stroke-width="0" transform="scale(1,-1)"><g data-mml-node="math" data-latex="=20"><g data-mml-node="mo" data-latex="="><path data-c="3D" d="M698 367 80 367C64 367 56 359 56 344 56 329 64 321 80 321L698 321C714 321 722 329 722 344 722 356 711 367 698 367M698 179 80 179C64 179 56 171 56 156 56 141 64 133 80 133L698 133C714 133 722 141 722 156 722 169 711 179 698 179Z"></path></g><g data-mml-node="mn" data-latex="0" transform="translate(1055.8,0)"><path data-c="32" d="M237 666C186 666 143 648 106 612 69 576 50 534 50 483 50 449 75 424 106 424 136 424 161 450 161 480 161 513 137 536 105 536 102 536 100 536 98 535 117 584 161 627 224 627 306 627 352 556 352 470 352 403 318 331 250 255L62 43C49 28 50 29 50 0L421 0 450 180 417 180C409 129 402 100 396 91 391 86 361 84 306 84L139 84 236 179C304 243 390 312 419 365 439 400 449 435 449 470 449 588 357 666 237 666Z"></path><path data-c="30" d="M249-22C390-22 460 92 460 320 460 473 428 575 365 625 330 652 291 666 250 666 109 666 39 551 39 320 39 136 88-22 249-22M361 524C368 489 371 425 371 332 371 240 367 172 360 128 347 48 310 8 249 8 226 8 203 17 182 34 155 57 139 104 132 176 129 201 128 253 128 332 128 419 131 480 136 513 145 568 163 603 191 618 213 630 232 636 249 636 314 636 350 583 361 524Z" transform="translate(500,0)"></path></g></g></g></svg></mjx-container> 字节</p><p>字节长度取值一定是四的倍数.</p><p><code>DS/TOS</code>: 差分服务域, 服务类别, <code>8bit</code>, 让特定的数据拥有更高的优先级.</p><p><code>Total length</code>: 数据包总长度, <code>16bit</code>, 用于标识 IP 报文头部加数据载荷的长度, 最大 <code>65535</code> 字节.</p><h3 id="分片行"><a href="#分片行" class="headerlink" title="分片行"></a>分片行</h3><p>[<code>MTU</code>: 最大传输单元, 用于限制报文不被分片的最大字节, 默认情况下 <code>MTU</code> 值为 <code>1500</code> 字节.]</p><p><code>ID</code>: 标识, <code>16bit</code>, 用于顺序 IP 报文, 同一个报文得到的分片信息中的 ID 相同.</p><p><code>Flages</code>: 标志位, <code>3bit</code>.</p><ul><li>最高位被保留, 固定为 <code>0</code>.</li><li>中间位为 <code>DF</code> 位: 如果置位为 <code>1</code>, 则表示该报文不能被分片.</li><li>最低位称为 <code>more</code> 位: 如果置位 <code>1</code>, 则表示后续还有分片报文.</li></ul><p>如果报文大于 MTU 值并且 DF 置位, 直接丢弃.</p><p><code>Offset</code>: <code>13bit</code>, 片偏移, 用于标识分片包在原始报文的位置.</p><p>片偏移指出: 较长的分组在分片后,某片在原分组中的相对位置。也就是说,相对于用户数据字段的起点,该片从何处开始。片偏移以 8 个字节为偏移单位。这就是说,每个分片的长度一定是 8 字节 (64 位) 的整数倍.</p><p>【例】一数据报的总长度为 3820 字节,其数据部分为 3800 字节长 (使用固定自部),需要分片为长度不超过 1420 字节的数据报片。因固定首部长度为 20 字节,因此每个数据报片的数据部分长度不能超过 1400 字节。于是分为 3 个数据报片,具数据部分的长度分别为 1400 ,1400 和 1000 字节。原始数据报首部被复制为各数据报片的首部,但必须修以有关字段的值。下面给出分片后得出的结果 (请注意片偏移的数值)。</p><table><thead><tr><th>数据报</th><th>总长度</th><th>标识</th><th>MF</th><th>DF</th><th>片偏移</th></tr></thead><tbody><tr><td>原始数据报</td><td>3820</td><td>12345</td><td>0</td><td>0</td><td>0(0/8=0)</td></tr><tr><td>数据报片 1</td><td>1420</td><td>12345</td><td>1</td><td>0</td><td>0(0/8=0)</td></tr><tr><td>数据报片 2</td><td>1420</td><td>12345</td><td>1</td><td>0</td><td>175(1400/8=175)</td></tr><tr><td>数据报片 3</td><td>1020</td><td>12345</td><td>0</td><td>0</td><td>350(2800/8=350)</td></tr></tbody></table><p>现在假定数据报片 2 经过某个网络时还需要再进行分片,即划分为数据报片 2-1 (携带数据 800 字节) 和数据报片 2-2 (携带数据 600 字节)。那么这两个数据报片的总长度、标识、MF、DF 和片偏移分别为: 820,12345,1,0,175; 620,12345,1,0,275。</p><h3 id="功能行"><a href="#功能行" class="headerlink" title="功能行"></a>功能行</h3><p><code>TTL</code>: 生存周期, <code>8bit</code>, 用来在 IP 报文转发过程中, 打破环路对网络的影响, 最大值 <code>255</code>, 会在数据包经过一次第三层转发时减 <code>1</code>. 当值为 <code>0</code> 时数据包被丢弃.</p><p><code>Protocol</code>: <code>8bit</code>, 用于标明网络层处理完 IP 报文后, 需要交给上层的某个协议继续处理.</p><ul><li><code>1</code>: <code>ICMP</code></li><li><code>6</code>: <code>TCP</code></li><li><code>17</code>: <code>UDP</code></li></ul><p><code>Header Checksum</code>: <code>16bit</code>, 首部校验和, 检测 IP 首部是否发生错误.</p><h3 id="地址行"><a href="#地址行" class="headerlink" title="地址行"></a>地址行</h3><p><code>SIP</code>: 源 IP 地址, <code>32bit</code>, 表明当前数据包从哪出发.</p><p><code>DIP</code>: 目的 IP 地址, <code>32bit</code>, 表明当前数据包去往何处.</p><h3 id="可选项"><a href="#可选项" class="headerlink" title="可选项"></a>可选项</h3><p><code>Options</code>: 可选项, 可变长度, 最大 <code>40</code> 字节. 军事或研究方向, 支持松散源路由, 严格源路由等等.</p></div><div class="story post-story"><h2 id="IP地址"><a href="#IP地址" class="headerlink" title="IP地址"></a>IP 地址</h2><p>IP 地址: 用来标识网络中的一个节点或网络设备的接口, 总长度 <code>32bit</code>, 约 42.9 亿 (<mjx-container class="MathJax" jax="SVG" overflow="overflow"><svg style="vertical-align:0" xmlns="http://www.w3.org/2000/svg" width="2.919ex" height="1.887ex" role="img" focusable="false" viewBox="0 -833.9 1290.1 833.9"><g stroke="currentColor" fill="currentColor" stroke-width="0" transform="scale(1,-1)"><g data-mml-node="math" data-latex="2^{32}"><g data-mml-node="msup" data-latex="2^{32}"><g data-mml-node="mn" data-latex="2"><path data-c="32" d="M237 666C186 666 143 648 106 612 69 576 50 534 50 483 50 449 75 424 106 424 136 424 161 450 161 480 161 513 137 536 105 536 102 536 100 536 98 535 117 584 161 627 224 627 306 627 352 556 352 470 352 403 318 331 250 255L62 43C49 28 50 29 50 0L421 0 450 180 417 180C409 129 402 100 396 91 391 86 361 84 306 84L139 84 236 179C304 243 390 312 419 365 439 400 449 435 449 470 449 588 357 666 237 666Z"></path></g><g data-mml-node="TeXAtom" transform="translate(533,363) scale(0.707)" data-latex="{2}" data-mjx-texclass="ORD"><g data-mml-node="mn" data-latex="2"><path data-c="33" d="M303 353C369 378 431 441 431 526 431 569 410 604 369 631 333 654 292 666 246 666 201 666 162 654 127 631 88 605 68 571 68 528 68 495 90 472 122 472 154 472 176 495 176 527 176 560 157 578 119 580 145 615 186 633 242 633 302 633 332 598 332 527 332 485 324 450 309 421 282 373 245 364 183 364 171 362 165 357 165 348 165 333 172 333 192 333L235 333C310 333 348 280 348 173 348 88 317 14 241 14 176 14 128 36 99 80 134 79 160 105 160 139 160 173 135 198 101 198 62 198 42 178 42 137 42 88 64 49 108 18 147-9 193-22 244-22 301-22 350-3 393 34 436 71 457 117 457 173 457 267 383 332 303 353Z"></path><path data-c="32" d="M237 666C186 666 143 648 106 612 69 576 50 534 50 483 50 449 75 424 106 424 136 424 161 450 161 480 161 513 137 536 105 536 102 536 100 536 98 535 117 584 161 627 224 627 306 627 352 556 352 470 352 403 318 331 250 255L62 43C49 28 50 29 50 0L421 0 450 180 417 180C409 129 402 100 396 91 391 86 361 84 306 84L139 84 236 179C304 243 390 312 419 365 439 400 449 435 449 470 449 588 357 666 237 666Z" transform="translate(500,0)"></path></g></g></g></g></g></svg></mjx-container>), 每个 IP 地址都由网络位和主机位组成.</p><p>网络位: 用来标明当前设备的网络位置.</p><p>主机位: 用来标明当前主机在当前网络中的位置.</p><p>网络掩码: 32bit, 由连续的 1 和 0 构成, 其中 1 标记的是网络位, 0 标记的是主机位.</p><p>网络地址: 当主机位全都为 0 时, 表示当前网络信息.</p><p>广播地址: 当主机位全都为 1 时, 表示当前网络范围内的广播地址.</p><p>可用地址: 可分配给网络中的节点或网络设备接口的地址.</p><p>一个网络内的可用 IP 地址<mjx-container class="MathJax" jax="SVG" overflow="overflow"><svg style="vertical-align:-.566ex" xmlns="http://www.w3.org/2000/svg" width="4.629ex" height="2.497ex" role="img" focusable="false" viewBox="0 -853.7 2046.1 1103.7"><g stroke="currentColor" fill="currentColor" stroke-width="0" transform="scale(1,-1)"><g data-mml-node="math" data-latex="=2^h-2"><g data-mml-node="mo" data-latex="="><path data-c="3D" d="M698 367 80 367C64 367 56 359 56 344 56 329 64 321 80 321L698 321C714 321 722 329 722 344 722 356 711 367 698 367M698 179 80 179C64 179 56 171 56 156 56 141 64 133 80 133L698 133C714 133 722 141 722 156 722 169 711 179 698 179Z"></path></g><g data-mml-node="msup" data-latex="2^h" transform="translate(1055.8,0)"><g data-mml-node="mn" data-latex="2"><path data-c="32" d="M237 666C186 666 143 648 106 612 69 576 50 534 50 483 50 449 75 424 106 424 136 424 161 450 161 480 161 513 137 536 105 536 102 536 100 536 98 535 117 584 161 627 224 627 306 627 352 556 352 470 352 403 318 331 250 255L62 43C49 28 50 29 50 0L421 0 450 180 417 180C409 129 402 100 396 91 391 86 361 84 306 84L139 84 236 179C304 243 390 312 419 365 439 400 449 435 449 470 449 588 357 666 237 666Z"></path></g><g data-mml-node="mi" transform="translate(533,363) scale(0.707)" data-latex="h"><path data-c="210E" d="M512 138C489 59 457 19 415 19 402 19 395 28 395 47 395 62 401 85 413 116 453 223 473 296 473 335 473 406 427 445 356 445 303 445 257 423 218 380L291 679C289 688 287 694 274 694 241 694 168 685 155 684 140 682 132 675 132 660 132 650 141 645 159 645 180 645 203 646 205 632L59 43C56 32 55 25 55 21 55 0 66-11 87-11 107-11 121-1 128 18L168 182C180 231 189 268 196 293 199 300 207 314 220 334 256 388 300 415 353 415 386 415 402 393 402 350 402 309 382 236 342 130 333 107 329 89 329 74 329 26 365-11 413-11 457-11 492 14 517 65 536 105 546 132 546 145 546 154 541 159 530 159 527 159 512 150 512 138Z"></path></g></g></g></g></svg><mjx-break size="3"></mjx-break><svg style="vertical-align:-.566ex" xmlns="http://www.w3.org/2000/svg" width="3.394ex" height="2.262ex" role="img" focusable="false" viewBox="0 -750 1500.2 1000"><g stroke="currentColor" fill="currentColor" stroke-width="0" transform="scale(1,-1)"><g data-mml-node="math" data-latex="=2^h-2"><g data-mml-node="mo" data-latex="-"><path data-c="2212" d="M698 270 80 270C64 270 56 263 56 250 56 237 64 230 80 230L698 230C714 230 722 237 722 250 722 262 710 270 698 270Z"></path></g><g data-mml-node="mn" data-latex="2" transform="translate(1000.2,0)"><path data-c="32" d="M237 666C186 666 143 648 106 612 69 576 50 534 50 483 50 449 75 424 106 424 136 424 161 450 161 480 161 513 137 536 105 536 102 536 100 536 98 535 117 584 161 627 224 627 306 627 352 556 352 470 352 403 318 331 250 255L62 43C49 28 50 29 50 0L421 0 450 180 417 180C409 129 402 100 396 91 391 86 361 84 306 84L139 84 236 179C304 243 390 312 419 365 439 400 449 435 449 470 449 588 357 666 237 666Z"></path></g></g></g></svg></mjx-container> ,<mjx-container class="MathJax" jax="SVG" overflow="overflow"><svg style="vertical-align:-.025ex" xmlns="http://www.w3.org/2000/svg" width="1.303ex" height="1.595ex" role="img" focusable="false" viewBox="0 -694 576 705"><g stroke="currentColor" fill="currentColor" stroke-width="0" transform="scale(1,-1)"><g data-mml-node="math" data-latex="h"><g data-mml-node="mi" data-latex="h"><path data-c="210E" d="M512 138C489 59 457 19 415 19 402 19 395 28 395 47 395 62 401 85 413 116 453 223 473 296 473 335 473 406 427 445 356 445 303 445 257 423 218 380L291 679C289 688 287 694 274 694 241 694 168 685 155 684 140 682 132 675 132 660 132 650 141 645 159 645 180 645 203 646 205 632L59 43C56 32 55 25 55 21 55 0 66-11 87-11 107-11 121-1 128 18L168 182C180 231 189 268 196 293 199 300 207 314 220 334 256 388 300 415 353 415 386 415 402 393 402 350 402 309 382 236 342 130 333 107 329 89 329 74 329 26 365-11 413-11 457-11 492 14 517 65 536 105 546 132 546 145 546 154 541 159 530 159 527 159 512 150 512 138Z"></path></g></g></g></svg></mjx-container>表示主机位的位数.</p><p>网络地址和广播地址不能直接被节点或网络设备所使用.</p><h3 id="IP地址分类"><a href="#IP地址分类" class="headerlink" title="IP地址分类"></a>IP 地址分类</h3><h4 id="有类IP地址"><a href="#有类IP地址" class="headerlink" title="有类IP地址"></a>有类 IP 地址</h4><p><code>A</code>: 第一个 bit 为 <code>0</code>, 并且掩码长度为 <code>8</code>.</p><p><code>(0.0.0.0-127.255.255.255)</code></p><p><code>B</code>: 前两个 bit 为 <code>10</code>, 并且掩码长度为 <code>16</code>.</p><p><code>(128.0.0.0-191.255.255.255)</code></p><p><code>C</code>: 前三个 bit 为 <code>110</code>, 并且掩码长度为 <code>24</code>.</p><p><code>(192.0.0.0-223.255.255.255)</code></p><p><code>D</code>: 前四个 bit 为 <code>1110</code>, 组播地址.</p><p><code>(224.0.0.0-239.255.255.255)</code></p><p><code>E</code>: 前四个 bit 为 <code>1111</code>.</p><p><code>(240.0.0.0-255.255.255.255)</code></p><h4 id="按照使用范围分类"><a href="#按照使用范围分类" class="headerlink" title="按照使用范围分类"></a>按照使用范围分类</h4><p>公有地址: 可以在公网范围内使用的地址.</p><p>私有地址: 可以在局域网中使用, 在不同的局域网中可以重复使用, 不能够被公网转发.</p><p>私有地址范围:</p><p><code>A</code>: <code>10.0.0.0-10.255.255.255</code> ; <code>10.0.0.0/8</code></p><p><code>B</code>: <code>172.16.0.0-172.31.255.255</code> ; <code>172.16.0.0/12</code></p><p><code>C</code>: <code>192.168.0.0-192.168.255.255</code> ; <code>192.168.0.0/16</code></p><p>IPv6 私有地址范围:</p><p><code>fc00::/7</code> (ULAs,Unique Local Addresses)</p><h3 id="特殊地址"><a href="#特殊地址" class="headerlink" title="特殊地址"></a>特殊地址</h3><p>这类 IP 地址不能够给设备使用, 并且全部具有特定意义.</p><p><code>0.0.0.0</code>: 当设备初次进入网络时, 会使用该地址. 特定场景下可以代表所有地址.</p><p><code>255.255.255.255</code>: 全网广播地址, 可以向广播域内所有设备发送数据.</p><p><code>127.0.0.0-127.255.255.255</code>: 本地环回测试地址, 检查本地网卡驱动是否正常.</p></div><div class="story post-story"><h2 id="进制转换"><a href="#进制转换" class="headerlink" title="进制转换"></a>进制转换</h2><h3 id="十进制转二进制"><a href="#十进制转二进制" class="headerlink" title="十进制转二进制"></a>十进制转二进制</h3><p>短除法 倒着写:</p><figure class="highlight plaintext"><table><tbody><tr><td class="code"><pre><span class="line">2|192 0</span><br><span class="line"> ----</span><br><span class="line"> 2|96 0</span><br><span class="line"> ---</span><br><span class="line"> 2|48 0</span><br><span class="line"> ---</span><br><span class="line"> 2|24 0</span><br><span class="line"> ---</span><br><span class="line"> 2|12 0</span><br><span class="line"> ---</span><br><span class="line"> 2|6 0</span><br><span class="line"> ---</span><br><span class="line"> 2|3 1</span><br><span class="line"> --</span><br><span class="line"> 1</span><br><span class="line"></span><br><span class="line">2|168 0</span><br><span class="line"> ----</span><br><span class="line"> 2|84 0</span><br><span class="line"> ---</span><br><span class="line"> 2|42 0</span><br><span class="line"> ---</span><br><span class="line"> 2|21 1</span><br><span class="line"> ---</span><br><span class="line"> 2|10 0</span><br><span class="line"> ---</span><br><span class="line"> 2|5 1</span><br><span class="line"> ---</span><br><span class="line"> 2|2 0</span><br><span class="line"> --</span><br><span class="line"> 1</span><br></pre></td></tr></tbody></table></figure><p>权重减法:</p><figure class="highlight plaintext"><table><tbody><tr><td class="code"><pre><span class="line">192-128=64</span><br><span class="line">64-64=0</span><br><span class="line">1100 0000</span><br><span class="line"></span><br><span class="line">168-128=40</span><br><span class="line">40-32=8</span><br><span class="line">8-8=0</span><br><span class="line">1010 1000</span><br></pre></td></tr></tbody></table></figure><h3 id="二进制转十进制"><a href="#二进制转十进制" class="headerlink" title="二进制转十进制"></a>二进制转十进制</h3><p><mjx-container class="MathJax" jax="SVG" overflow="overflow"><svg style="vertical-align:-.05ex" xmlns="http://www.w3.org/2000/svg" width="6.627ex" height="1.62ex" role="img" focusable="false" viewBox="0 -694 2929 716"><g stroke="currentColor" fill="currentColor" stroke-width="0" transform="scale(1,-1)"><g data-mml-node="math" data-latex="0b1100"><g data-mml-node="mn" data-latex="0"><path data-c="30" d="M249-22C390-22 460 92 460 320 460 473 428 575 365 625 330 652 291 666 250 666 109 666 39 551 39 320 39 136 88-22 249-22M361 524C368 489 371 425 371 332 371 240 367 172 360 128 347 48 310 8 249 8 226 8 203 17 182 34 155 57 139 104 132 176 129 201 128 253 128 332 128 419 131 480 136 513 145 568 163 603 191 618 213 630 232 636 249 636 314 636 350 583 361 524Z"></path></g><g data-mml-node="mi" data-latex="b" transform="translate(500,0)"><path data-c="1D44F" d="M281 445C245 445 209 428 174 394L243 679C241 688 238 694 226 694 193 694 120 685 107 684 92 682 84 675 84 660 84 650 93 645 112 645 131 645 157 646 157 632 157 628 152 608 143 571L63 249C52 207 47 173 47 148 47 62 93-11 175-11 240-11 297 22 347 89 392 151 415 216 415 283 415 370 364 445 281 445M279 415C318 415 337 385 337 326 337 299 331 263 319 218 297 133 268 75 233 44 213 27 194 19 175 19 134 19 114 51 114 115 114 137 119 170 129 214L151 304C154 319 159 330 165 338 204 389 242 415 279 415Z"></path></g><g data-mml-node="mn" data-latex="100" transform="translate(929,0)"><path data-c="31" d="M269 666C228 624 168 603 89 603L89 564C141 564 184 572 217 588L217 82C217 64 213 52 204 47 195 42 170 39 130 39L95 39 95 0C120 2 174 3 257 3 340 3 394 2 419 0L419 39 384 39C343 39 318 42 310 47 302 52 297 64 297 82L297 636C297 660 295 666 269 666Z"></path><path data-c="31" d="M269 666C228 624 168 603 89 603L89 564C141 564 184 572 217 588L217 82C217 64 213 52 204 47 195 42 170 39 130 39L95 39 95 0C120 2 174 3 257 3 340 3 394 2 419 0L419 39 384 39C343 39 318 42 310 47 302 52 297 64 297 82L297 636C297 660 295 666 269 666Z" transform="translate(500,0)"></path><path data-c="30" d="M249-22C390-22 460 92 460 320 460 473 428 575 365 625 330 652 291 666 250 666 109 666 39 551 39 320 39 136 88-22 249-22M361 524C368 489 371 425 371 332 371 240 367 172 360 128 347 48 310 8 249 8 226 8 203 17 182 34 155 57 139 104 132 176 129 201 128 253 128 332 128 419 131 480 136 513 145 568 163 603 191 618 213 630 232 636 249 636 314 636 350 583 361 524Z" transform="translate(1000,0)"></path><path data-c="30" d="M249-22C390-22 460 92 460 320 460 473 428 575 365 625 330 652 291 666 250 666 109 666 39 551 39 320 39 136 88-22 249-22M361 524C368 489 371 425 371 332 371 240 367 172 360 128 347 48 310 8 249 8 226 8 203 17 182 34 155 57 139 104 132 176 129 201 128 253 128 332 128 419 131 480 136 513 145 568 163 603 191 618 213 630 232 636 249 636 314 636 350 583 361 524Z" transform="translate(1500,0)"></path></g></g></g></svg></mjx-container><mjx-container class="MathJax" jax="SVG" overflow="overflow"><svg style="vertical-align:-.05ex" xmlns="http://www.w3.org/2000/svg" width="4.525ex" height="1.557ex" role="img" focusable="false" viewBox="0 -666 2000 688"><g stroke="currentColor" fill="currentColor" stroke-width="0" transform="scale(1,-1)"><g data-mml-node="math" data-latex="0000"><g data-mml-node="mn" data-latex="0000"><path data-c="30" d="M249-22C390-22 460 92 460 320 460 473 428 575 365 625 330 652 291 666 250 666 109 666 39 551 39 320 39 136 88-22 249-22M361 524C368 489 371 425 371 332 371 240 367 172 360 128 347 48 310 8 249 8 226 8 203 17 182 34 155 57 139 104 132 176 129 201 128 253 128 332 128 419 131 480 136 513 145 568 163 603 191 618 213 630 232 636 249 636 314 636 350 583 361 524Z"></path><path data-c="30" d="M249-22C390-22 460 92 460 320 460 473 428 575 365 625 330 652 291 666 250 666 109 666 39 551 39 320 39 136 88-22 249-22M361 524C368 489 371 425 371 332 371 240 367 172 360 128 347 48 310 8 249 8 226 8 203 17 182 34 155 57 139 104 132 176 129 201 128 253 128 332 128 419 131 480 136 513 145 568 163 603 191 618 213 630 232 636 249 636 314 636 350 583 361 524Z" transform="translate(500,0)"></path><path data-c="30" d="M249-22C390-22 460 92 460 320 460 473 428 575 365 625 330 652 291 666 250 666 109 666 39 551 39 320 39 136 88-22 249-22M361 524C368 489 371 425 371 332 371 240 367 172 360 128 347 48 310 8 249 8 226 8 203 17 182 34 155 57 139 104 132 176 129 201 128 253 128 332 128 419 131 480 136 513 145 568 163 603 191 618 213 630 232 636 249 636 314 636 350 583 361 524Z" transform="translate(1000,0)"></path><path data-c="30" d="M249-22C390-22 460 92 460 320 460 473 428 575 365 625 330 652 291 666 250 666 109 666 39 551 39 320 39 136 88-22 249-22M361 524C368 489 371 425 371 332 371 240 367 172 360 128 347 48 310 8 249 8 226 8 203 17 182 34 155 57 139 104 132 176 129 201 128 253 128 332 128 419 131 480 136 513 145 568 163 603 191 618 213 630 232 636 249 636 314 636 350 583 361 524Z" transform="translate(1500,0)"></path></g></g></g></svg></mjx-container><mjx-container class="MathJax" jax="SVG" overflow="overflow"><svg style="vertical-align:-.566ex" xmlns="http://www.w3.org/2000/svg" width="4.508ex" height="2.468ex" role="img" focusable="false" viewBox="0 -841 1992.3 1091"><g stroke="currentColor" fill="currentColor" stroke-width="0" transform="scale(1,-1)"><g data-mml-node="math" data-latex="= 2^7+2^6=192"><g data-mml-node="mo" data-latex="="><path data-c="3D" d="M698 367 80 367C64 367 56 359 56 344 56 329 64 321 80 321L698 321C714 321 722 329 722 344 722 356 711 367 698 367M698 179 80 179C64 179 56 171 56 156 56 141 64 133 80 133L698 133C714 133 722 141 722 156 722 169 711 179 698 179Z"></path></g><g data-mml-node="msup" data-latex="2^7" transform="translate(1055.8,0)"><g data-mml-node="mn" data-latex="2"><path data-c="32" d="M237 666C186 666 143 648 106 612 69 576 50 534 50 483 50 449 75 424 106 424 136 424 161 450 161 480 161 513 137 536 105 536 102 536 100 536 98 535 117 584 161 627 224 627 306 627 352 556 352 470 352 403 318 331 250 255L62 43C49 28 50 29 50 0L421 0 450 180 417 180C409 129 402 100 396 91 391 86 361 84 306 84L139 84 236 179C304 243 390 312 419 365 439 400 449 435 449 470 449 588 357 666 237 666Z"></path></g><g data-mml-node="mn" transform="translate(533,363) scale(0.707)" data-latex="7"><path data-c="37" d="M475 604C482 613 485 626 485 644L243 644C174 644 135 648 128 657 125 660 122 667 120 676L89 676 55 464 88 464C98 520 106 550 112 555 115 558 146 560 205 560L401 560 295 410C214 295 174 171 174 36 174-3 190-22 223-22 256-22 272-3 272 36L272 87C272 239 296 349 343 416Z"></path></g></g></g></g></svg><mjx-break size="3"></mjx-break><svg style="vertical-align:-.566ex" xmlns="http://www.w3.org/2000/svg" width="4.382ex" height="2.452ex" role="img" focusable="false" viewBox="0 -833.9 1936.8 1083.9"><g stroke="currentColor" fill="currentColor" stroke-width="0" transform="scale(1,-1)"><g data-mml-node="math" data-latex="= 2^7+2^6=192"><g data-mml-node="mo" data-latex="+"><path data-c="2B" d="M698 274 413 274 413 559C413 575 405 583 389 583 373 583 365 575 365 559L365 274 80 274C64 274 56 266 56 250 56 234 64 226 80 226L365 226 365-59C365-75 373-83 389-83 405-83 413-75 413-59L413 226 698 226C714 226 722 234 722 250 722 263 711 274 698 274Z"></path></g><g data-mml-node="msup" data-latex="2^6" transform="translate(1000.2,0)"><g data-mml-node="mn" data-latex="2"><path data-c="32" d="M237 666C186 666 143 648 106 612 69 576 50 534 50 483 50 449 75 424 106 424 136 424 161 450 161 480 161 513 137 536 105 536 102 536 100 536 98 535 117 584 161 627 224 627 306 627 352 556 352 470 352 403 318 331 250 255L62 43C49 28 50 29 50 0L421 0 450 180 417 180C409 129 402 100 396 91 391 86 361 84 306 84L139 84 236 179C304 243 390 312 419 365 439 400 449 435 449 470 449 588 357 666 237 666Z"></path></g><g data-mml-node="mn" transform="translate(533,363) scale(0.707)" data-latex="6"><path data-c="36" d="M383 504C416 504 432 521 432 555 432 627 378 666 304 666 221 666 155 627 106 548 63 480 42 403 42 316 42 189 65 100 112 47 152 1 198-22 251-22 312-22 362 1 401 47 438 91 457 144 457 205 457 266 439 318 403 361 365 407 316 431 257 431 205 431 165 402 138 346L138 352C138 465 166 561 226 605 252 624 279 633 306 633 342 633 368 623 385 602 351 602 334 583 334 553 334 525 355 504 383 504M344 340C355 317 361 272 361 206 361 141 356 98 345 76 325 35 294 14 251 14 222 14 200 24 184 44 171 60 162 74 158 85 146 116 140 163 140 227 140 255 144 282 151 308 164 355 201 399 256 399 295 399 325 379 344 340Z"></path></g></g></g></g></svg><mjx-break size="4"></mjx-break><svg style="vertical-align:-.566ex" xmlns="http://www.w3.org/2000/svg" width="5.782ex" height="2.262ex" role="img" focusable="false" viewBox="0 -750 2555.8 1000"><g stroke="currentColor" fill="currentColor" stroke-width="0" transform="scale(1,-1)"><g data-mml-node="math" data-latex="= 2^7+2^6=192"><g data-mml-node="mo" data-latex="="><path data-c="3D" d="M698 367 80 367C64 367 56 359 56 344 56 329 64 321 80 321L698 321C714 321 722 329 722 344 722 356 711 367 698 367M698 179 80 179C64 179 56 171 56 156 56 141 64 133 80 133L698 133C714 133 722 141 722 156 722 169 711 179 698 179Z"></path></g><g data-mml-node="mn" data-latex="92" transform="translate(1055.8,0)"><path data-c="31" d="M269 666C228 624 168 603 89 603L89 564C141 564 184 572 217 588L217 82C217 64 213 52 204 47 195 42 170 39 130 39L95 39 95 0C120 2 174 3 257 3 340 3 394 2 419 0L419 39 384 39C343 39 318 42 310 47 302 52 297 64 297 82L297 636C297 660 295 666 269 666Z"></path><path data-c="39" d="M116 140C83 140 67 123 67 89 67 14 128-22 207-22 287-22 351 18 398 99 437 166 457 243 457 329 457 456 434 546 388 599 349 644 304 666 253 666 194 666 145 645 106 602 63 557 42 503 42 440 42 379 60 327 96 284 134 238 183 215 242 215 294 215 334 243 361 299L361 286C361 177 342 103 303 63 272 30 239 14 206 14 166 14 137 23 118 42 149 42 165 60 165 91 165 119 144 140 116 140M243 246C204 246 175 266 155 306 144 329 138 374 138 439 138 504 145 548 158 573 180 613 212 633 253 633 294 633 324 608 343 558 354 531 361 485 361 420 361 333 322 246 243 246Z" transform="translate(500,0)"></path><path data-c="32" d="M237 666C186 666 143 648 106 612 69 576 50 534 50 483 50 449 75 424 106 424 136 424 161 450 161 480 161 513 137 536 105 536 102 536 100 536 98 535 117 584 161 627 224 627 306 627 352 556 352 470 352 403 318 331 250 255L62 43C49 28 50 29 50 0L421 0 450 180 417 180C409 129 402 100 396 91 391 86 361 84 306 84L139 84 236 179C304 243 390 312 419 365 439 400 449 435 449 470 449 588 357 666 237 666Z" transform="translate(1000,0)"></path></g></g></g></svg></mjx-container></p><p><mjx-container class="MathJax" jax="SVG" overflow="overflow"><svg style="vertical-align:-.05ex" xmlns="http://www.w3.org/2000/svg" width="6.627ex" height="1.62ex" role="img" focusable="false" viewBox="0 -694 2929 716"><g stroke="currentColor" fill="currentColor" stroke-width="0" transform="scale(1,-1)"><g data-mml-node="math" data-latex="0b1010"><g data-mml-node="mn" data-latex="0"><path data-c="30" d="M249-22C390-22 460 92 460 320 460 473 428 575 365 625 330 652 291 666 250 666 109 666 39 551 39 320 39 136 88-22 249-22M361 524C368 489 371 425 371 332 371 240 367 172 360 128 347 48 310 8 249 8 226 8 203 17 182 34 155 57 139 104 132 176 129 201 128 253 128 332 128 419 131 480 136 513 145 568 163 603 191 618 213 630 232 636 249 636 314 636 350 583 361 524Z"></path></g><g data-mml-node="mi" data-latex="b" transform="translate(500,0)"><path data-c="1D44F" d="M281 445C245 445 209 428 174 394L243 679C241 688 238 694 226 694 193 694 120 685 107 684 92 682 84 675 84 660 84 650 93 645 112 645 131 645 157 646 157 632 157 628 152 608 143 571L63 249C52 207 47 173 47 148 47 62 93-11 175-11 240-11 297 22 347 89 392 151 415 216 415 283 415 370 364 445 281 445M279 415C318 415 337 385 337 326 337 299 331 263 319 218 297 133 268 75 233 44 213 27 194 19 175 19 134 19 114 51 114 115 114 137 119 170 129 214L151 304C154 319 159 330 165 338 204 389 242 415 279 415Z"></path></g><g data-mml-node="mn" data-latex="010" transform="translate(929,0)"><path data-c="31" d="M269 666C228 624 168 603 89 603L89 564C141 564 184 572 217 588L217 82C217 64 213 52 204 47 195 42 170 39 130 39L95 39 95 0C120 2 174 3 257 3 340 3 394 2 419 0L419 39 384 39C343 39 318 42 310 47 302 52 297 64 297 82L297 636C297 660 295 666 269 666Z"></path><path data-c="30" d="M249-22C390-22 460 92 460 320 460 473 428 575 365 625 330 652 291 666 250 666 109 666 39 551 39 320 39 136 88-22 249-22M361 524C368 489 371 425 371 332 371 240 367 172 360 128 347 48 310 8 249 8 226 8 203 17 182 34 155 57 139 104 132 176 129 201 128 253 128 332 128 419 131 480 136 513 145 568 163 603 191 618 213 630 232 636 249 636 314 636 350 583 361 524Z" transform="translate(500,0)"></path><path data-c="31" d="M269 666C228 624 168 603 89 603L89 564C141 564 184 572 217 588L217 82C217 64 213 52 204 47 195 42 170 39 130 39L95 39 95 0C120 2 174 3 257 3 340 3 394 2 419 0L419 39 384 39C343 39 318 42 310 47 302 52 297 64 297 82L297 636C297 660 295 666 269 666Z" transform="translate(1000,0)"></path><path data-c="30" d="M249-22C390-22 460 92 460 320 460 473 428 575 365 625 330 652 291 666 250 666 109 666 39 551 39 320 39 136 88-22 249-22M361 524C368 489 371 425 371 332 371 240 367 172 360 128 347 48 310 8 249 8 226 8 203 17 182 34 155 57 139 104 132 176 129 201 128 253 128 332 128 419 131 480 136 513 145 568 163 603 191 618 213 630 232 636 249 636 314 636 350 583 361 524Z" transform="translate(1500,0)"></path></g></g></g></svg></mjx-container><mjx-container class="MathJax" jax="SVG" overflow="overflow"><svg style="vertical-align:-.05ex" xmlns="http://www.w3.org/2000/svg" width="4.525ex" height="1.557ex" role="img" focusable="false" viewBox="0 -666 2000 688"><g stroke="currentColor" fill="currentColor" stroke-width="0" transform="scale(1,-1)"><g data-mml-node="math" data-latex="1000"><g data-mml-node="mn" data-latex="1000"><path data-c="31" d="M269 666C228 624 168 603 89 603L89 564C141 564 184 572 217 588L217 82C217 64 213 52 204 47 195 42 170 39 130 39L95 39 95 0C120 2 174 3 257 3 340 3 394 2 419 0L419 39 384 39C343 39 318 42 310 47 302 52 297 64 297 82L297 636C297 660 295 666 269 666Z"></path><path data-c="30" d="M249-22C390-22 460 92 460 320 460 473 428 575 365 625 330 652 291 666 250 666 109 666 39 551 39 320 39 136 88-22 249-22M361 524C368 489 371 425 371 332 371 240 367 172 360 128 347 48 310 8 249 8 226 8 203 17 182 34 155 57 139 104 132 176 129 201 128 253 128 332 128 419 131 480 136 513 145 568 163 603 191 618 213 630 232 636 249 636 314 636 350 583 361 524Z" transform="translate(500,0)"></path><path data-c="30" d="M249-22C390-22 460 92 460 320 460 473 428 575 365 625 330 652 291 666 250 666 109 666 39 551 39 320 39 136 88-22 249-22M361 524C368 489 371 425 371 332 371 240 367 172 360 128 347 48 310 8 249 8 226 8 203 17 182 34 155 57 139 104 132 176 129 201 128 253 128 332 128 419 131 480 136 513 145 568 163 603 191 618 213 630 232 636 249 636 314 636 350 583 361 524Z" transform="translate(1000,0)"></path><path data-c="30" d="M249-22C390-22 460 92 460 320 460 473 428 575 365 625 330 652 291 666 250 666 109 666 39 551 39 320 39 136 88-22 249-22M361 524C368 489 371 425 371 332 371 240 367 172 360 128 347 48 310 8 249 8 226 8 203 17 182 34 155 57 139 104 132 176 129 201 128 253 128 332 128 419 131 480 136 513 145 568 163 603 191 618 213 630 232 636 249 636 314 636 350 583 361 524Z" transform="translate(1500,0)"></path></g></g></g></svg></mjx-container><mjx-container class="MathJax" jax="SVG" overflow="overflow"><svg style="vertical-align:-.566ex" xmlns="http://www.w3.org/2000/svg" width="4.508ex" height="2.468ex" role="img" focusable="false" viewBox="0 -841 1992.3 1091"><g stroke="currentColor" fill="currentColor" stroke-width="0" transform="scale(1,-1)"><g data-mml-node="math" data-latex="= 2^7+2^5+2^3=168"><g data-mml-node="mo" data-latex="="><path data-c="3D" d="M698 367 80 367C64 367 56 359 56 344 56 329 64 321 80 321L698 321C714 321 722 329 722 344 722 356 711 367 698 367M698 179 80 179C64 179 56 171 56 156 56 141 64 133 80 133L698 133C714 133 722 141 722 156 722 169 711 179 698 179Z"></path></g><g data-mml-node="msup" data-latex="2^7" transform="translate(1055.8,0)"><g data-mml-node="mn" data-latex="2"><path data-c="32" d="M237 666C186 666 143 648 106 612 69 576 50 534 50 483 50 449 75 424 106 424 136 424 161 450 161 480 161 513 137 536 105 536 102 536 100 536 98 535 117 584 161 627 224 627 306 627 352 556 352 470 352 403 318 331 250 255L62 43C49 28 50 29 50 0L421 0 450 180 417 180C409 129 402 100 396 91 391 86 361 84 306 84L139 84 236 179C304 243 390 312 419 365 439 400 449 435 449 470 449 588 357 666 237 666Z"></path></g><g data-mml-node="mn" transform="translate(533,363) scale(0.707)" data-latex="7"><path data-c="37" d="M475 604C482 613 485 626 485 644L243 644C174 644 135 648 128 657 125 660 122 667 120 676L89 676 55 464 88 464C98 520 106 550 112 555 115 558 146 560 205 560L401 560 295 410C214 295 174 171 174 36 174-3 190-22 223-22 256-22 272-3 272 36L272 87C272 239 296 349 343 416Z"></path></g></g></g></g></svg><mjx-break size="3"></mjx-break><svg style="vertical-align:-.566ex" xmlns="http://www.w3.org/2000/svg" width="4.382ex" height="2.452ex" role="img" focusable="false" viewBox="0 -833.9 1936.8 1083.9"><g stroke="currentColor" fill="currentColor" stroke-width="0" transform="scale(1,-1)"><g data-mml-node="math" data-latex="= 2^7+2^5+2^3=168"><g data-mml-node="mo" data-latex="+"><path data-c="2B" d="M698 274 413 274 413 559C413 575 405 583 389 583 373 583 365 575 365 559L365 274 80 274C64 274 56 266 56 250 56 234 64 226 80 226L365 226 365-59C365-75 373-83 389-83 405-83 413-75 413-59L413 226 698 226C714 226 722 234 722 250 722 263 711 274 698 274Z"></path></g><g data-mml-node="msup" data-latex="2^5" transform="translate(1000.2,0)"><g data-mml-node="mn" data-latex="2"><path data-c="32" d="M237 666C186 666 143 648 106 612 69 576 50 534 50 483 50 449 75 424 106 424 136 424 161 450 161 480 161 513 137 536 105 536 102 536 100 536 98 535 117 584 161 627 224 627 306 627 352 556 352 470 352 403 318 331 250 255L62 43C49 28 50 29 50 0L421 0 450 180 417 180C409 129 402 100 396 91 391 86 361 84 306 84L139 84 236 179C304 243 390 312 419 365 439 400 449 435 449 470 449 588 357 666 237 666Z"></path></g><g data-mml-node="mn" transform="translate(533,363) scale(0.707)" data-latex="5"><path data-c="35" d="M118 315C123 315 129 319 134 326 164 371 205 393 257 393 292 393 319 373 337 332 348 305 354 264 354 209 354 146 346 102 331 76 306 35 272 14 229 14 162 14 109 62 91 114 94 113 96 114 100 114 130 114 155 137 155 167 155 198 130 219 100 219 65 219 50 200 50 163 50 63 131-22 231-22 292-22 344 0 386 44 428 88 449 141 449 202 449 260 432 310 398 353 361 400 315 423 259 423 212 423 171 408 138 378L138 556C165 548 191 544 218 544 264 544 304 555 338 578 369 597 390 616 402 634 408 642 411 648 411 651 411 661 406 666 396 666 341 645 294 634 256 634 211 634 168 643 127 662 122 664 118 665 114 665 105 665 100 656 100 637L100 345C100 324 100 315 118 315Z"></path></g></g></g></g></svg><mjx-break size="3"></mjx-break><svg style="vertical-align:-.566ex" xmlns="http://www.w3.org/2000/svg" width="4.382ex" height="2.452ex" role="img" focusable="false" viewBox="0 -833.9 1936.8 1083.9"><g stroke="currentColor" fill="currentColor" stroke-width="0" transform="scale(1,-1)"><g data-mml-node="math" data-latex="= 2^7+2^5+2^3=168"><g data-mml-node="mo" data-latex="+"><path data-c="2B" d="M698 274 413 274 413 559C413 575 405 583 389 583 373 583 365 575 365 559L365 274 80 274C64 274 56 266 56 250 56 234 64 226 80 226L365 226 365-59C365-75 373-83 389-83 405-83 413-75 413-59L413 226 698 226C714 226 722 234 722 250 722 263 711 274 698 274Z"></path></g><g data-mml-node="msup" data-latex="2^3" transform="translate(1000.2,0)"><g data-mml-node="mn" data-latex="2"><path data-c="32" d="M237 666C186 666 143 648 106 612 69 576 50 534 50 483 50 449 75 424 106 424 136 424 161 450 161 480 161 513 137 536 105 536 102 536 100 536 98 535 117 584 161 627 224 627 306 627 352 556 352 470 352 403 318 331 250 255L62 43C49 28 50 29 50 0L421 0 450 180 417 180C409 129 402 100 396 91 391 86 361 84 306 84L139 84 236 179C304 243 390 312 419 365 439 400 449 435 449 470 449 588 357 666 237 666Z"></path></g><g data-mml-node="mn" transform="translate(533,363) scale(0.707)" data-latex="3"><path data-c="33" d="M303 353C369 378 431 441 431 526 431 569 410 604 369 631 333 654 292 666 246 666 201 666 162 654 127 631 88 605 68 571 68 528 68 495 90 472 122 472 154 472 176 495 176 527 176 560 157 578 119 580 145 615 186 633 242 633 302 633 332 598 332 527 332 485 324 450 309 421 282 373 245 364 183 364 171 362 165 357 165 348 165 333 172 333 192 333L235 333C310 333 348 280 348 173 348 88 317 14 241 14 176 14 128 36 99 80 134 79 160 105 160 139 160 173 135 198 101 198 62 198 42 178 42 137 42 88 64 49 108 18 147-9 193-22 244-22 301-22 350-3 393 34 436 71 457 117 457 173 457 267 383 332 303 353Z"></path></g></g></g></g></svg><mjx-break size="4"></mjx-break><svg style="vertical-align:-.566ex" xmlns="http://www.w3.org/2000/svg" width="5.782ex" height="2.262ex" role="img" focusable="false" viewBox="0 -750 2555.8 1000"><g stroke="currentColor" fill="currentColor" stroke-width="0" transform="scale(1,-1)"><g data-mml-node="math" data-latex="= 2^7+2^5+2^3=168"><g data-mml-node="mo" data-latex="="><path data-c="3D" d="M698 367 80 367C64 367 56 359 56 344 56 329 64 321 80 321L698 321C714 321 722 329 722 344 722 356 711 367 698 367M698 179 80 179C64 179 56 171 56 156 56 141 64 133 80 133L698 133C714 133 722 141 722 156 722 169 711 179 698 179Z"></path></g><g data-mml-node="mn" data-latex="68" transform="translate(1055.8,0)"><path data-c="31" d="M269 666C228 624 168 603 89 603L89 564C141 564 184 572 217 588L217 82C217 64 213 52 204 47 195 42 170 39 130 39L95 39 95 0C120 2 174 3 257 3 340 3 394 2 419 0L419 39 384 39C343 39 318 42 310 47 302 52 297 64 297 82L297 636C297 660 295 666 269 666Z"></path><path data-c="36" d="M383 504C416 504 432 521 432 555 432 627 378 666 304 666 221 666 155 627 106 548 63 480 42 403 42 316 42 189 65 100 112 47 152 1 198-22 251-22 312-22 362 1 401 47 438 91 457 144 457 205 457 266 439 318 403 361 365 407 316 431 257 431 205 431 165 402 138 346L138 352C138 465 166 561 226 605 252 624 279 633 306 633 342 633 368 623 385 602 351 602 334 583 334 553 334 525 355 504 383 504M344 340C355 317 361 272 361 206 361 141 356 98 345 76 325 35 294 14 251 14 222 14 200 24 184 44 171 60 162 74 158 85 146 116 140 163 140 227 140 255 144 282 151 308 164 355 201 399 256 399 295 399 325 379 344 340Z" transform="translate(500,0)"></path><path data-c="38" d="M250 666C201 666 158 650 122 618 86 586 68 546 68 497 68 456 83 419 113 386 120 378 142 361 179 335 88 288 42 227 42 153 42 100 64 57 107 24 147-7 194-22 249-22 305-22 354-4 395 32 436 68 457 115 457 170 457 216 441 257 408 294 396 307 365 330 316 361 393 402 431 454 431 515 431 606 344 666 250 666M379 515C379 463 348 418 286 381L167 459C136 479 120 505 120 536 120 596 185 633 249 633 318 633 379 584 379 515M250 14C168 14 99 73 99 153 99 220 136 274 210 315L328 240C376 209 400 174 400 134 400 62 325 14 250 14Z" transform="translate(1000,0)"></path></g></g></g></svg></mjx-container></p><table><thead><tr><th><mjx-container class="MathJax" jax="SVG" overflow="overflow"><svg style="vertical-align:0" xmlns="http://www.w3.org/2000/svg" width="2.119ex" height="1.887ex" role="img" focusable="false" viewBox="0 -833.9 936.6 833.9"><g stroke="currentColor" fill="currentColor" stroke-width="0" transform="scale(1,-1)"><g data-mml-node="math" data-latex="2^8"><g data-mml-node="msup" data-latex="2^8 "><g data-mml-node="mn" data-latex="2"><path data-c="32" d="M237 666C186 666 143 648 106 612 69 576 50 534 50 483 50 449 75 424 106 424 136 424 161 450 161 480 161 513 137 536 105 536 102 536 100 536 98 535 117 584 161 627 224 627 306 627 352 556 352 470 352 403 318 331 250 255L62 43C49 28 50 29 50 0L421 0 450 180 417 180C409 129 402 100 396 91 391 86 361 84 306 84L139 84 236 179C304 243 390 312 419 365 439 400 449 435 449 470 449 588 357 666 237 666Z"></path></g><g data-mml-node="mn" transform="translate(533,363) scale(0.707)" data-latex="8"><path data-c="38" d="M250 666C201 666 158 650 122 618 86 586 68 546 68 497 68 456 83 419 113 386 120 378 142 361 179 335 88 288 42 227 42 153 42 100 64 57 107 24 147-7 194-22 249-22 305-22 354-4 395 32 436 68 457 115 457 170 457 216 441 257 408 294 396 307 365 330 316 361 393 402 431 454 431 515 431 606 344 666 250 666M379 515C379 463 348 418 286 381L167 459C136 479 120 505 120 536 120 596 185 633 249 633 318 633 379 584 379 515M250 14C168 14 99 73 99 153 99 220 136 274 210 315L328 240C376 209 400 174 400 134 400 62 325 14 250 14Z"></path></g></g></g></g></svg></mjx-container></th><th><mjx-container class="MathJax" jax="SVG" overflow="overflow"><svg style="vertical-align:0" xmlns="http://www.w3.org/2000/svg" width="2.119ex" height="1.903ex" role="img" focusable="false" viewBox="0 -841 936.6 841"><g stroke="currentColor" fill="currentColor" stroke-width="0" transform="scale(1,-1)"><g data-mml-node="math" data-latex="2^7"><g data-mml-node="msup" data-latex="2^7 "><g data-mml-node="mn" data-latex="2"><path data-c="32" d="M237 666C186 666 143 648 106 612 69 576 50 534 50 483 50 449 75 424 106 424 136 424 161 450 161 480 161 513 137 536 105 536 102 536 100 536 98 535 117 584 161 627 224 627 306 627 352 556 352 470 352 403 318 331 250 255L62 43C49 28 50 29 50 0L421 0 450 180 417 180C409 129 402 100 396 91 391 86 361 84 306 84L139 84 236 179C304 243 390 312 419 365 439 400 449 435 449 470 449 588 357 666 237 666Z"></path></g><g data-mml-node="mn" transform="translate(533,363) scale(0.707)" data-latex="7"><path data-c="37" d="M475 604C482 613 485 626 485 644L243 644C174 644 135 648 128 657 125 660 122 667 120 676L89 676 55 464 88 464C98 520 106 550 112 555 115 558 146 560 205 560L401 560 295 410C214 295 174 171 174 36 174-3 190-22 223-22 256-22 272-3 272 36L272 87C272 239 296 349 343 416Z"></path></g></g></g></g></svg></mjx-container></th><th><mjx-container class="MathJax" jax="SVG" overflow="overflow"><svg style="vertical-align:0" xmlns="http://www.w3.org/2000/svg" width="2.119ex" height="1.887ex" role="img" focusable="false" viewBox="0 -833.9 936.6 833.9"><g stroke="currentColor" fill="currentColor" stroke-width="0" transform="scale(1,-1)"><g data-mml-node="math" data-latex="2^6"><g data-mml-node="msup" data-latex="2^6 "><g data-mml-node="mn" data-latex="2"><path data-c="32" d="M237 666C186 666 143 648 106 612 69 576 50 534 50 483 50 449 75 424 106 424 136 424 161 450 161 480 161 513 137 536 105 536 102 536 100 536 98 535 117 584 161 627 224 627 306 627 352 556 352 470 352 403 318 331 250 255L62 43C49 28 50 29 50 0L421 0 450 180 417 180C409 129 402 100 396 91 391 86 361 84 306 84L139 84 236 179C304 243 390 312 419 365 439 400 449 435 449 470 449 588 357 666 237 666Z"></path></g><g data-mml-node="mn" transform="translate(533,363) scale(0.707)" data-latex="6"><path data-c="36" d="M383 504C416 504 432 521 432 555 432 627 378 666 304 666 221 666 155 627 106 548 63 480 42 403 42 316 42 189 65 100 112 47 152 1 198-22 251-22 312-22 362 1 401 47 438 91 457 144 457 205 457 266 439 318 403 361 365 407 316 431 257 431 205 431 165 402 138 346L138 352C138 465 166 561 226 605 252 624 279 633 306 633 342 633 368 623 385 602 351 602 334 583 334 553 334 525 355 504 383 504M344 340C355 317 361 272 361 206 361 141 356 98 345 76 325 35 294 14 251 14 222 14 200 24 184 44 171 60 162 74 158 85 146 116 140 163 140 227 140 255 144 282 151 308 164 355 201 399 256 399 295 399 325 379 344 340Z"></path></g></g></g></g></svg></mjx-container></th><th><mjx-container class="MathJax" jax="SVG" overflow="overflow"><svg style="vertical-align:0" xmlns="http://www.w3.org/2000/svg" width="2.119ex" height="1.887ex" role="img" focusable="false" viewBox="0 -833.9 936.6 833.9"><g stroke="currentColor" fill="currentColor" stroke-width="0" transform="scale(1,-1)"><g data-mml-node="math" data-latex="2^5"><g data-mml-node="msup" data-latex="2^5 "><g data-mml-node="mn" data-latex="2"><path data-c="32" d="M237 666C186 666 143 648 106 612 69 576 50 534 50 483 50 449 75 424 106 424 136 424 161 450 161 480 161 513 137 536 105 536 102 536 100 536 98 535 117 584 161 627 224 627 306 627 352 556 352 470 352 403 318 331 250 255L62 43C49 28 50 29 50 0L421 0 450 180 417 180C409 129 402 100 396 91 391 86 361 84 306 84L139 84 236 179C304 243 390 312 419 365 439 400 449 435 449 470 449 588 357 666 237 666Z"></path></g><g data-mml-node="mn" transform="translate(533,363) scale(0.707)" data-latex="5"><path data-c="35" d="M118 315C123 315 129 319 134 326 164 371 205 393 257 393 292 393 319 373 337 332 348 305 354 264 354 209 354 146 346 102 331 76 306 35 272 14 229 14 162 14 109 62 91 114 94 113 96 114 100 114 130 114 155 137 155 167 155 198 130 219 100 219 65 219 50 200 50 163 50 63 131-22 231-22 292-22 344 0 386 44 428 88 449 141 449 202 449 260 432 310 398 353 361 400 315 423 259 423 212 423 171 408 138 378L138 556C165 548 191 544 218 544 264 544 304 555 338 578 369 597 390 616 402 634 408 642 411 648 411 651 411 661 406 666 396 666 341 645 294 634 256 634 211 634 168 643 127 662 122 664 118 665 114 665 105 665 100 656 100 637L100 345C100 324 100 315 118 315Z"></path></g></g></g></g></svg></mjx-container></th><th><mjx-container class="MathJax" jax="SVG" overflow="overflow"><svg style="vertical-align:0" xmlns="http://www.w3.org/2000/svg" width="2.119ex" height="1.904ex" role="img" focusable="false" viewBox="0 -841.7 936.6 841.7"><g stroke="currentColor" fill="currentColor" stroke-width="0" transform="scale(1,-1)"><g data-mml-node="math" data-latex="2^4"><g data-mml-node="msup" data-latex="2^4 "><g data-mml-node="mn" data-latex="2"><path data-c="32" d="M237 666C186 666 143 648 106 612 69 576 50 534 50 483 50 449 75 424 106 424 136 424 161 450 161 480 161 513 137 536 105 536 102 536 100 536 98 535 117 584 161 627 224 627 306 627 352 556 352 470 352 403 318 331 250 255L62 43C49 28 50 29 50 0L421 0 450 180 417 180C409 129 402 100 396 91 391 86 361 84 306 84L139 84 236 179C304 243 390 312 419 365 439 400 449 435 449 470 449 588 357 666 237 666Z"></path></g><g data-mml-node="mn" transform="translate(533,363) scale(0.707)" data-latex="4"><path data-c="34" d="M353 677C344 677 336 672 330 663L28 199 28 163 289 163 289 81C289 63 285 51 278 46 271 41 252 39 219 39L194 39 194 0C223 2 269 3 331 3 393 3 439 2 468 0L468 39 443 39C410 39 391 41 384 46 377 51 373 63 373 81L373 163 471 163 471 202 373 202 373 660C373 670 366 677 353 677M295 553 295 202 67 202Z"></path></g></g></g></g></svg></mjx-container></th><th><mjx-container class="MathJax" jax="SVG" overflow="overflow"><svg style="vertical-align:0" xmlns="http://www.w3.org/2000/svg" width="2.119ex" height="1.887ex" role="img" focusable="false" viewBox="0 -833.9 936.6 833.9"><g stroke="currentColor" fill="currentColor" stroke-width="0" transform="scale(1,-1)"><g data-mml-node="math" data-latex="2^3"><g data-mml-node="msup" data-latex="2^3 "><g data-mml-node="mn" data-latex="2"><path data-c="32" d="M237 666C186 666 143 648 106 612 69 576 50 534 50 483 50 449 75 424 106 424 136 424 161 450 161 480 161 513 137 536 105 536 102 536 100 536 98 535 117 584 161 627 224 627 306 627 352 556 352 470 352 403 318 331 250 255L62 43C49 28 50 29 50 0L421 0 450 180 417 180C409 129 402 100 396 91 391 86 361 84 306 84L139 84 236 179C304 243 390 312 419 365 439 400 449 435 449 470 449 588 357 666 237 666Z"></path></g><g data-mml-node="mn" transform="translate(533,363) scale(0.707)" data-latex="3"><path data-c="33" d="M303 353C369 378 431 441 431 526 431 569 410 604 369 631 333 654 292 666 246 666 201 666 162 654 127 631 88 605 68 571 68 528 68 495 90 472 122 472 154 472 176 495 176 527 176 560 157 578 119 580 145 615 186 633 242 633 302 633 332 598 332 527 332 485 324 450 309 421 282 373 245 364 183 364 171 362 165 357 165 348 165 333 172 333 192 333L235 333C310 333 348 280 348 173 348 88 317 14 241 14 176 14 128 36 99 80 134 79 160 105 160 139 160 173 135 198 101 198 62 198 42 178 42 137 42 88 64 49 108 18 147-9 193-22 244-22 301-22 350-3 393 34 436 71 457 117 457 173 457 267 383 332 303 353Z"></path></g></g></g></g></svg></mjx-container></th><th><mjx-container class="MathJax" jax="SVG" overflow="overflow"><svg style="vertical-align:0" xmlns="http://www.w3.org/2000/svg" width="2.119ex" height="1.887ex" role="img" focusable="false" viewBox="0 -833.9 936.6 833.9"><g stroke="currentColor" fill="currentColor" stroke-width="0" transform="scale(1,-1)"><g data-mml-node="math" data-latex="2^2"><g data-mml-node="msup" data-latex="2^2 "><g data-mml-node="mn" data-latex="2"><path data-c="32" d="M237 666C186 666 143 648 106 612 69 576 50 534 50 483 50 449 75 424 106 424 136 424 161 450 161 480 161 513 137 536 105 536 102 536 100 536 98 535 117 584 161 627 224 627 306 627 352 556 352 470 352 403 318 331 250 255L62 43C49 28 50 29 50 0L421 0 450 180 417 180C409 129 402 100 396 91 391 86 361 84 306 84L139 84 236 179C304 243 390 312 419 365 439 400 449 435 449 470 449 588 357 666 237 666Z"></path></g><g data-mml-node="mn" transform="translate(533,363) scale(0.707)" data-latex="2"><path data-c="32" d="M237 666C186 666 143 648 106 612 69 576 50 534 50 483 50 449 75 424 106 424 136 424 161 450 161 480 161 513 137 536 105 536 102 536 100 536 98 535 117 584 161 627 224 627 306 627 352 556 352 470 352 403 318 331 250 255L62 43C49 28 50 29 50 0L421 0 450 180 417 180C409 129 402 100 396 91 391 86 361 84 306 84L139 84 236 179C304 243 390 312 419 365 439 400 449 435 449 470 449 588 357 666 237 666Z"></path></g></g></g></g></svg></mjx-container></th><th><mjx-container class="MathJax" jax="SVG" overflow="overflow"><svg style="vertical-align:0" xmlns="http://www.w3.org/2000/svg" width="2.119ex" height="1.887ex" role="img" focusable="false" viewBox="0 -833.9 936.6 833.9"><g stroke="currentColor" fill="currentColor" stroke-width="0" transform="scale(1,-1)"><g data-mml-node="math" data-latex="2^1"><g data-mml-node="msup" data-latex="2^1 "><g data-mml-node="mn" data-latex="2"><path data-c="32" d="M237 666C186 666 143 648 106 612 69 576 50 534 50 483 50 449 75 424 106 424 136 424 161 450 161 480 161 513 137 536 105 536 102 536 100 536 98 535 117 584 161 627 224 627 306 627 352 556 352 470 352 403 318 331 250 255L62 43C49 28 50 29 50 0L421 0 450 180 417 180C409 129 402 100 396 91 391 86 361 84 306 84L139 84 236 179C304 243 390 312 419 365 439 400 449 435 449 470 449 588 357 666 237 666Z"></path></g><g data-mml-node="mn" transform="translate(533,363) scale(0.707)" data-latex="1"><path data-c="31" d="M269 666C228 624 168 603 89 603L89 564C141 564 184 572 217 588L217 82C217 64 213 52 204 47 195 42 170 39 130 39L95 39 95 0C120 2 174 3 257 3 340 3 394 2 419 0L419 39 384 39C343 39 318 42 310 47 302 52 297 64 297 82L297 636C297 660 295 666 269 666Z"></path></g></g></g></g></svg></mjx-container></th><th><mjx-container class="MathJax" jax="SVG" overflow="overflow"><svg style="vertical-align:0" xmlns="http://www.w3.org/2000/svg" width="2.119ex" height="1.887ex" role="img" focusable="false" viewBox="0 -833.9 936.6 833.9"><g stroke="currentColor" fill="currentColor" stroke-width="0" transform="scale(1,-1)"><g data-mml-node="math" data-latex="2^0"><g data-mml-node="msup" data-latex="2^0 "><g data-mml-node="mn" data-latex="2"><path data-c="32" d="M237 666C186 666 143 648 106 612 69 576 50 534 50 483 50 449 75 424 106 424 136 424 161 450 161 480 161 513 137 536 105 536 102 536 100 536 98 535 117 584 161 627 224 627 306 627 352 556 352 470 352 403 318 331 250 255L62 43C49 28 50 29 50 0L421 0 450 180 417 180C409 129 402 100 396 91 391 86 361 84 306 84L139 84 236 179C304 243 390 312 419 365 439 400 449 435 449 470 449 588 357 666 237 666Z"></path></g><g data-mml-node="mn" transform="translate(533,363) scale(0.707)" data-latex="0"><path data-c="30" d="M249-22C390-22 460 92 460 320 460 473 428 575 365 625 330 652 291 666 250 666 109 666 39 551 39 320 39 136 88-22 249-22M361 524C368 489 371 425 371 332 371 240 367 172 360 128 347 48 310 8 249 8 226 8 203 17 182 34 155 57 139 104 132 176 129 201 128 253 128 332 128 419 131 480 136 513 145 568 163 603 191 618 213 630 232 636 249 636 314 636 350 583 361 524Z"></path></g></g></g></g></svg></mjx-container></th></tr></thead><tbody><tr><td>256</td><td>128</td><td>64</td><td>32</td><td>16</td><td>8</td><td>4</td><td>2</td><td>1</td></tr></tbody></table></div><div class="story post-story"><h2 id="IP地址计算"><a href="#IP地址计算" class="headerlink" title="IP地址计算"></a>IP 地址计算</h2><p><code>172.16.10.1/16</code> 这个 <code>B</code> 类地址的网络地址, 广播地址, 可用地址数</p><p>IP 地址: <code>172.16.10.1</code></p><p><code>10101100 00010000 00001010 00000001</code></p><p>网络掩码: <code>255.255.0.0</code></p><p><code>11111111 11111111 00000000 00000000</code></p><p>网络地址: <code>127.16.0.0</code></p><p><code>10101100 00010000 00000000 00000000</code></p><p>广播地址: <code>127.16.255.255</code></p><p><code>10101100 00010000 11111111 11111111</code></p><p>IP 地址数:<mjx-container class="MathJax" jax="SVG" overflow="overflow"><svg style="vertical-align:-.566ex" xmlns="http://www.w3.org/2000/svg" width="2.919ex" height="2.452ex" role="img" focusable="false" viewBox="0 -833.9 1290.1 1083.9"><g stroke="currentColor" fill="currentColor" stroke-width="0" transform="scale(1,-1)"><g data-mml-node="math" data-latex="2^{16}=65536"><g data-mml-node="msup" data-latex="2^{6}"><g data-mml-node="mn" data-latex="2"><path data-c="32" d="M237 666C186 666 143 648 106 612 69 576 50 534 50 483 50 449 75 424 106 424 136 424 161 450 161 480 161 513 137 536 105 536 102 536 100 536 98 535 117 584 161 627 224 627 306 627 352 556 352 470 352 403 318 331 250 255L62 43C49 28 50 29 50 0L421 0 450 180 417 180C409 129 402 100 396 91 391 86 361 84 306 84L139 84 236 179C304 243 390 312 419 365 439 400 449 435 449 470 449 588 357 666 237 666Z"></path></g><g data-mml-node="TeXAtom" transform="translate(533,363) scale(0.707)" data-latex="{6}" data-mjx-texclass="ORD"><g data-mml-node="mn" data-latex="6"><path data-c="31" d="M269 666C228 624 168 603 89 603L89 564C141 564 184 572 217 588L217 82C217 64 213 52 204 47 195 42 170 39 130 39L95 39 95 0C120 2 174 3 257 3 340 3 394 2 419 0L419 39 384 39C343 39 318 42 310 47 302 52 297 64 297 82L297 636C297 660 295 666 269 666Z"></path><path data-c="36" d="M383 504C416 504 432 521 432 555 432 627 378 666 304 666 221 666 155 627 106 548 63 480 42 403 42 316 42 189 65 100 112 47 152 1 198-22 251-22 312-22 362 1 401 47 438 91 457 144 457 205 457 266 439 318 403 361 365 407 316 431 257 431 205 431 165 402 138 346L138 352C138 465 166 561 226 605 252 624 279 633 306 633 342 633 368 623 385 602 351 602 334 583 334 553 334 525 355 504 383 504M344 340C355 317 361 272 361 206 361 141 356 98 345 76 325 35 294 14 251 14 222 14 200 24 184 44 171 60 162 74 158 85 146 116 140 163 140 227 140 255 144 282 151 308 164 355 201 399 256 399 295 399 325 379 344 340Z" transform="translate(500,0)"></path></g></g></g></g></g></svg><mjx-break size="4"></mjx-break><svg style="vertical-align:-.566ex" xmlns="http://www.w3.org/2000/svg" width="8.045ex" height="2.262ex" role="img" focusable="false" viewBox="0 -750 3555.8 1000"><g stroke="currentColor" fill="currentColor" stroke-width="0" transform="scale(1,-1)"><g data-mml-node="math" data-latex="2^{16}=65536"><g data-mml-node="mo" data-latex="="><path data-c="3D" d="M698 367 80 367C64 367 56 359 56 344 56 329 64 321 80 321L698 321C714 321 722 329 722 344 722 356 711 367 698 367M698 179 80 179C64 179 56 171 56 156 56 141 64 133 80 133L698 133C714 133 722 141 722 156 722 169 711 179 698 179Z"></path></g><g data-mml-node="mn" data-latex="5536" transform="translate(1055.8,0)"><path data-c="36" d="M383 504C416 504 432 521 432 555 432 627 378 666 304 666 221 666 155 627 106 548 63 480 42 403 42 316 42 189 65 100 112 47 152 1 198-22 251-22 312-22 362 1 401 47 438 91 457 144 457 205 457 266 439 318 403 361 365 407 316 431 257 431 205 431 165 402 138 346L138 352C138 465 166 561 226 605 252 624 279 633 306 633 342 633 368 623 385 602 351 602 334 583 334 553 334 525 355 504 383 504M344 340C355 317 361 272 361 206 361 141 356 98 345 76 325 35 294 14 251 14 222 14 200 24 184 44 171 60 162 74 158 85 146 116 140 163 140 227 140 255 144 282 151 308 164 355 201 399 256 399 295 399 325 379 344 340Z"></path><path data-c="35" d="M118 315C123 315 129 319 134 326 164 371 205 393 257 393 292 393 319 373 337 332 348 305 354 264 354 209 354 146 346 102 331 76 306 35 272 14 229 14 162 14 109 62 91 114 94 113 96 114 100 114 130 114 155 137 155 167 155 198 130 219 100 219 65 219 50 200 50 163 50 63 131-22 231-22 292-22 344 0 386 44 428 88 449 141 449 202 449 260 432 310 398 353 361 400 315 423 259 423 212 423 171 408 138 378L138 556C165 548 191 544 218 544 264 544 304 555 338 578 369 597 390 616 402 634 408 642 411 648 411 651 411 661 406 666 396 666 341 645 294 634 256 634 211 634 168 643 127 662 122 664 118 665 114 665 105 665 100 656 100 637L100 345C100 324 100 315 118 315Z" transform="translate(500,0)"></path><path data-c="35" d="M118 315C123 315 129 319 134 326 164 371 205 393 257 393 292 393 319 373 337 332 348 305 354 264 354 209 354 146 346 102 331 76 306 35 272 14 229 14 162 14 109 62 91 114 94 113 96 114 100 114 130 114 155 137 155 167 155 198 130 219 100 219 65 219 50 200 50 163 50 63 131-22 231-22 292-22 344 0 386 44 428 88 449 141 449 202 449 260 432 310 398 353 361 400 315 423 259 423 212 423 171 408 138 378L138 556C165 548 191 544 218 544 264 544 304 555 338 578 369 597 390 616 402 634 408 642 411 648 411 651 411 661 406 666 396 666 341 645 294 634 256 634 211 634 168 643 127 662 122 664 118 665 114 665 105 665 100 656 100 637L100 345C100 324 100 315 118 315Z" transform="translate(1000,0)"></path><path data-c="33" d="M303 353C369 378 431 441 431 526 431 569 410 604 369 631 333 654 292 666 246 666 201 666 162 654 127 631 88 605 68 571 68 528 68 495 90 472 122 472 154 472 176 495 176 527 176 560 157 578 119 580 145 615 186 633 242 633 302 633 332 598 332 527 332 485 324 450 309 421 282 373 245 364 183 364 171 362 165 357 165 348 165 333 172 333 192 333L235 333C310 333 348 280 348 173 348 88 317 14 241 14 176 14 128 36 99 80 134 79 160 105 160 139 160 173 135 198 101 198 62 198 42 178 42 137 42 88 64 49 108 18 147-9 193-22 244-22 301-22 350-3 393 34 436 71 457 117 457 173 457 267 383 332 303 353Z" transform="translate(1500,0)"></path><path data-c="36" d="M383 504C416 504 432 521 432 555 432 627 378 666 304 666 221 666 155 627 106 548 63 480 42 403 42 316 42 189 65 100 112 47 152 1 198-22 251-22 312-22 362 1 401 47 438 91 457 144 457 205 457 266 439 318 403 361 365 407 316 431 257 431 205 431 165 402 138 346L138 352C138 465 166 561 226 605 252 624 279 633 306 633 342 633 368 623 385 602 351 602 334 583 334 553 334 525 355 504 383 504M344 340C355 317 361 272 361 206 361 141 356 98 345 76 325 35 294 14 251 14 222 14 200 24 184 44 171 60 162 74 158 85 146 116 140 163 140 227 140 255 144 282 151 308 164 355 201 399 256 399 295 399 325 379 344 340Z" transform="translate(2000,0)"></path></g></g></g></svg></mjx-container></p><p>可用 IP 地址数:<mjx-container class="MathJax" jax="SVG" overflow="overflow"><svg style="vertical-align:-.566ex" xmlns="http://www.w3.org/2000/svg" width="2.919ex" height="2.452ex" role="img" focusable="false" viewBox="0 -833.9 1290.1 1083.9"><g stroke="currentColor" fill="currentColor" stroke-width="0" transform="scale(1,-1)"><g data-mml-node="math" data-latex="2^{16}-2=65534"><g data-mml-node="msup" data-latex="2^{6}"><g data-mml-node="mn" data-latex="2"><path data-c="32" d="M237 666C186 666 143 648 106 612 69 576 50 534 50 483 50 449 75 424 106 424 136 424 161 450 161 480 161 513 137 536 105 536 102 536 100 536 98 535 117 584 161 627 224 627 306 627 352 556 352 470 352 403 318 331 250 255L62 43C49 28 50 29 50 0L421 0 450 180 417 180C409 129 402 100 396 91 391 86 361 84 306 84L139 84 236 179C304 243 390 312 419 365 439 400 449 435 449 470 449 588 357 666 237 666Z"></path></g><g data-mml-node="TeXAtom" transform="translate(533,363) scale(0.707)" data-latex="{6}" data-mjx-texclass="ORD"><g data-mml-node="mn" data-latex="6"><path data-c="31" d="M269 666C228 624 168 603 89 603L89 564C141 564 184 572 217 588L217 82C217 64 213 52 204 47 195 42 170 39 130 39L95 39 95 0C120 2 174 3 257 3 340 3 394 2 419 0L419 39 384 39C343 39 318 42 310 47 302 52 297 64 297 82L297 636C297 660 295 666 269 666Z"></path><path data-c="36" d="M383 504C416 504 432 521 432 555 432 627 378 666 304 666 221 666 155 627 106 548 63 480 42 403 42 316 42 189 65 100 112 47 152 1 198-22 251-22 312-22 362 1 401 47 438 91 457 144 457 205 457 266 439 318 403 361 365 407 316 431 257 431 205 431 165 402 138 346L138 352C138 465 166 561 226 605 252 624 279 633 306 633 342 633 368 623 385 602 351 602 334 583 334 553 334 525 355 504 383 504M344 340C355 317 361 272 361 206 361 141 356 98 345 76 325 35 294 14 251 14 222 14 200 24 184 44 171 60 162 74 158 85 146 116 140 163 140 227 140 255 144 282 151 308 164 355 201 399 256 399 295 399 325 379 344 340Z" transform="translate(500,0)"></path></g></g></g></g></g></svg><mjx-break size="3"></mjx-break><svg style="vertical-align:-.566ex" xmlns="http://www.w3.org/2000/svg" width="3.394ex" height="2.262ex" role="img" focusable="false" viewBox="0 -750 1500.2 1000"><g stroke="currentColor" fill="currentColor" stroke-width="0" transform="scale(1,-1)"><g data-mml-node="math" data-latex="2^{16}-2=65534"><g data-mml-node="mo" data-latex="-"><path data-c="2212" d="M698 270 80 270C64 270 56 263 56 250 56 237 64 230 80 230L698 230C714 230 722 237 722 250 722 262 710 270 698 270Z"></path></g><g data-mml-node="mn" data-latex="2" transform="translate(1000.2,0)"><path data-c="32" d="M237 666C186 666 143 648 106 612 69 576 50 534 50 483 50 449 75 424 106 424 136 424 161 450 161 480 161 513 137 536 105 536 102 536 100 536 98 535 117 584 161 627 224 627 306 627 352 556 352 470 352 403 318 331 250 255L62 43C49 28 50 29 50 0L421 0 450 180 417 180C409 129 402 100 396 91 391 86 361 84 306 84L139 84 236 179C304 243 390 312 419 365 439 400 449 435 449 470 449 588 357 666 237 666Z"></path></g></g></g></svg><mjx-break size="4"></mjx-break><svg style="vertical-align:-.566ex" xmlns="http://www.w3.org/2000/svg" width="8.045ex" height="2.262ex" role="img" focusable="false" viewBox="0 -750 3555.8 1000"><g stroke="currentColor" fill="currentColor" stroke-width="0" transform="scale(1,-1)"><g data-mml-node="math" data-latex="2^{16}-2=65534"><g data-mml-node="mo" data-latex="="><path data-c="3D" d="M698 367 80 367C64 367 56 359 56 344 56 329 64 321 80 321L698 321C714 321 722 329 722 344 722 356 711 367 698 367M698 179 80 179C64 179 56 171 56 156 56 141 64 133 80 133L698 133C714 133 722 141 722 156 722 169 711 179 698 179Z"></path></g><g data-mml-node="mn" data-latex="5534" transform="translate(1055.8,0)"><path data-c="36" d="M383 504C416 504 432 521 432 555 432 627 378 666 304 666 221 666 155 627 106 548 63 480 42 403 42 316 42 189 65 100 112 47 152 1 198-22 251-22 312-22 362 1 401 47 438 91 457 144 457 205 457 266 439 318 403 361 365 407 316 431 257 431 205 431 165 402 138 346L138 352C138 465 166 561 226 605 252 624 279 633 306 633 342 633 368 623 385 602 351 602 334 583 334 553 334 525 355 504 383 504M344 340C355 317 361 272 361 206 361 141 356 98 345 76 325 35 294 14 251 14 222 14 200 24 184 44 171 60 162 74 158 85 146 116 140 163 140 227 140 255 144 282 151 308 164 355 201 399 256 399 295 399 325 379 344 340Z"></path><path data-c="35" d="M118 315C123 315 129 319 134 326 164 371 205 393 257 393 292 393 319 373 337 332 348 305 354 264 354 209 354 146 346 102 331 76 306 35 272 14 229 14 162 14 109 62 91 114 94 113 96 114 100 114 130 114 155 137 155 167 155 198 130 219 100 219 65 219 50 200 50 163 50 63 131-22 231-22 292-22 344 0 386 44 428 88 449 141 449 202 449 260 432 310 398 353 361 400 315 423 259 423 212 423 171 408 138 378L138 556C165 548 191 544 218 544 264 544 304 555 338 578 369 597 390 616 402 634 408 642 411 648 411 651 411 661 406 666 396 666 341 645 294 634 256 634 211 634 168 643 127 662 122 664 118 665 114 665 105 665 100 656 100 637L100 345C100 324 100 315 118 315Z" transform="translate(500,0)"></path><path data-c="35" d="M118 315C123 315 129 319 134 326 164 371 205 393 257 393 292 393 319 373 337 332 348 305 354 264 354 209 354 146 346 102 331 76 306 35 272 14 229 14 162 14 109 62 91 114 94 113 96 114 100 114 130 114 155 137 155 167 155 198 130 219 100 219 65 219 50 200 50 163 50 63 131-22 231-22 292-22 344 0 386 44 428 88 449 141 449 202 449 260 432 310 398 353 361 400 315 423 259 423 212 423 171 408 138 378L138 556C165 548 191 544 218 544 264 544 304 555 338 578 369 597 390 616 402 634 408 642 411 648 411 651 411 661 406 666 396 666 341 645 294 634 256 634 211 634 168 643 127 662 122 664 118 665 114 665 105 665 100 656 100 637L100 345C100 324 100 315 118 315Z" transform="translate(1000,0)"></path><path data-c="33" d="M303 353C369 378 431 441 431 526 431 569 410 604 369 631 333 654 292 666 246 666 201 666 162 654 127 631 88 605 68 571 68 528 68 495 90 472 122 472 154 472 176 495 176 527 176 560 157 578 119 580 145 615 186 633 242 633 302 633 332 598 332 527 332 485 324 450 309 421 282 373 245 364 183 364 171 362 165 357 165 348 165 333 172 333 192 333L235 333C310 333 348 280 348 173 348 88 317 14 241 14 176 14 128 36 99 80 134 79 160 105 160 139 160 173 135 198 101 198 62 198 42 178 42 137 42 88 64 49 108 18 147-9 193-22 244-22 301-22 350-3 393 34 436 71 457 117 457 173 457 267 383 332 303 353Z" transform="translate(1500,0)"></path><path data-c="34" d="M353 677C344 677 336 672 330 663L28 199 28 163 289 163 289 81C289 63 285 51 278 46 271 41 252 39 219 39L194 39 194 0C223 2 269 3 331 3 393 3 439 2 468 0L468 39 443 39C410 39 391 41 384 46 377 51 373 63 373 81L373 163 471 163 471 202 373 202 373 660C373 670 366 677 353 677M295 553 295 202 67 202Z" transform="translate(2000,0)"></path></g></g></g></svg></mjx-container></p><p>可用 IP 地址范围: <code>172.16.0.1-172.16.255.254</code></p><figure class="highlight plaintext"><table><tbody><tr><td class="code"><pre><span class="line">192.168.54.6/24</span><br><span class="line">网络地址: 192.168.54.0/24</span><br><span class="line">广播地址: 192.168.54.255/24</span><br><span class="line">IP地址数: 2^8=256</span><br><span class="line">可用IP地址数: 2^8-2=254</span><br><span class="line">可用IP地址范围: 192.168.54.1-192.168.54.254</span><br><span class="line"></span><br><span class="line">172.168.54.6 主类</span><br><span class="line">B /16</span><br><span class="line">网络地址: 172.168.0.0/16</span><br><span class="line">广播地址: 172.168.255.255/16</span><br><span class="line">IP地址数: 2^16=65536</span><br><span class="line">可用IP地址数: 2^16-2=65534</span><br><span class="line">可用IP地址范围: 172.168.0.1/16-172.168.255.254/16</span><br><span class="line"></span><br><span class="line">172.168.54.6 /22</span><br><span class="line">172.168.001101 10.6</span><br><span class="line">网络地址: 172.168.52.0/22</span><br><span class="line">广播地址: 172.168.55.255/22</span><br><span class="line">IP地址数: 2^10=1024</span><br><span class="line">可用IP地址数: 2^10-2=1022</span><br><span class="line">可用IP地址范围: 172.168.52.1/22-172.168.55.254/22</span><br></pre></td></tr></tbody></table></figure><p>如果公司有<mjx-container class="MathJax" jax="SVG" overflow="overflow"><svg style="vertical-align:-.05ex" xmlns="http://www.w3.org/2000/svg" width="2.262ex" height="1.557ex" role="img" focusable="false" viewBox="0 -666 1000 688"><g stroke="currentColor" fill="currentColor" stroke-width="0" transform="scale(1,-1)"><g data-mml-node="math" data-latex="56"><g data-mml-node="mn" data-latex="56"><path data-c="35" d="M118 315C123 315 129 319 134 326 164 371 205 393 257 393 292 393 319 373 337 332 348 305 354 264 354 209 354 146 346 102 331 76 306 35 272 14 229 14 162 14 109 62 91 114 94 113 96 114 100 114 130 114 155 137 155 167 155 198 130 219 100 219 65 219 50 200 50 163 50 63 131-22 231-22 292-22 344 0 386 44 428 88 449 141 449 202 449 260 432 310 398 353 361 400 315 423 259 423 212 423 171 408 138 378L138 556C165 548 191 544 218 544 264 544 304 555 338 578 369 597 390 616 402 634 408 642 411 648 411 651 411 661 406 666 396 666 341 645 294 634 256 634 211 634 168 643 127 662 122 664 118 665 114 665 105 665 100 656 100 637L100 345C100 324 100 315 118 315Z"></path><path data-c="36" d="M383 504C416 504 432 521 432 555 432 627 378 666 304 666 221 666 155 627 106 548 63 480 42 403 42 316 42 189 65 100 112 47 152 1 198-22 251-22 312-22 362 1 401 47 438 91 457 144 457 205 457 266 439 318 403 361 365 407 316 431 257 431 205 431 165 402 138 346L138 352C138 465 166 561 226 605 252 624 279 633 306 633 342 633 368 623 385 602 351 602 334 583 334 553 334 525 355 504 383 504M344 340C355 317 361 272 361 206 361 141 356 98 345 76 325 35 294 14 251 14 222 14 200 24 184 44 171 60 162 74 158 85 146 116 140 163 140 227 140 255 144 282 151 308 164 355 201 399 256 399 295 399 325 379 344 340Z" transform="translate(500,0)"></path></g></g></g></svg></mjx-container> 个人, 适合的掩码长度是 <code>/26</code></p><p><mjx-container class="MathJax" jax="SVG" overflow="overflow"><svg style="vertical-align:-.566ex" xmlns="http://www.w3.org/2000/svg" width="2.24ex" height="2.497ex" role="img" focusable="false" viewBox="0 -853.7 990.3 1103.7"><g stroke="currentColor" fill="currentColor" stroke-width="0" transform="scale(1,-1)"><g data-mml-node="math" data-latex="2^h-2\ge56"><g data-mml-node="msup" data-latex="2^h"><g data-mml-node="mn" data-latex="2"><path data-c="32" d="M237 666C186 666 143 648 106 612 69 576 50 534 50 483 50 449 75 424 106 424 136 424 161 450 161 480 161 513 137 536 105 536 102 536 100 536 98 535 117 584 161 627 224 627 306 627 352 556 352 470 352 403 318 331 250 255L62 43C49 28 50 29 50 0L421 0 450 180 417 180C409 129 402 100 396 91 391 86 361 84 306 84L139 84 236 179C304 243 390 312 419 365 439 400 449 435 449 470 449 588 357 666 237 666Z"></path></g><g data-mml-node="mi" transform="translate(533,363) scale(0.707)" data-latex="h"><path data-c="210E" d="M512 138C489 59 457 19 415 19 402 19 395 28 395 47 395 62 401 85 413 116 453 223 473 296 473 335 473 406 427 445 356 445 303 445 257 423 218 380L291 679C289 688 287 694 274 694 241 694 168 685 155 684 140 682 132 675 132 660 132 650 141 645 159 645 180 645 203 646 205 632L59 43C56 32 55 25 55 21 55 0 66-11 87-11 107-11 121-1 128 18L168 182C180 231 189 268 196 293 199 300 207 314 220 334 256 388 300 415 353 415 386 415 402 393 402 350 402 309 382 236 342 130 333 107 329 89 329 74 329 26 365-11 413-11 457-11 492 14 517 65 536 105 546 132 546 145 546 154 541 159 530 159 527 159 512 150 512 138Z"></path></g></g></g></g></svg><mjx-break size="3"></mjx-break><svg style="vertical-align:-.566ex" xmlns="http://www.w3.org/2000/svg" width="3.394ex" height="2.262ex" role="img" focusable="false" viewBox="0 -750 1500.2 1000"><g stroke="currentColor" fill="currentColor" stroke-width="0" transform="scale(1,-1)"><g data-mml-node="math" data-latex="2^h-2\ge56"><g data-mml-node="mo" data-latex="-"><path data-c="2212" d="M698 270 80 270C64 270 56 263 56 250 56 237 64 230 80 230L698 230C714 230 722 237 722 250 722 262 710 270 698 270Z"></path></g><g data-mml-node="mn" data-latex="2" transform="translate(1000.2,0)"><path data-c="32" d="M237 666C186 666 143 648 106 612 69 576 50 534 50 483 50 449 75 424 106 424 136 424 161 450 161 480 161 513 137 536 105 536 102 536 100 536 98 535 117 584 161 627 224 627 306 627 352 556 352 470 352 403 318 331 250 255L62 43C49 28 50 29 50 0L421 0 450 180 417 180C409 129 402 100 396 91 391 86 361 84 306 84L139 84 236 179C304 243 390 312 419 365 439 400 449 435 449 470 449 588 357 666 237 666Z"></path></g></g></g></svg><mjx-break size="4"></mjx-break><svg style="vertical-align:-.566ex" xmlns="http://www.w3.org/2000/svg" width="4.651ex" height="2.262ex" role="img" focusable="false" viewBox="0 -750 2055.8 1000"><g stroke="currentColor" fill="currentColor" stroke-width="0" transform="scale(1,-1)"><g data-mml-node="math" data-latex="2^h-2\ge56"><g data-mml-node="mo" data-latex="\ge"><path data-c="2265" d="M684 310C694 315 699 322 699 333 699 344 694 352 684 357L110 629C107 630 103 631 99 631 83 631 75 623 75 606 75 597 80 590 89 586L623 333 89 80C80 76 75 69 75 60 75 43 83 35 99 35 103 35 107 36 110 38M678-72 100-72C84-72 76-80 76-95 76-111 84-119 100-119L678-119C694-119 702-111 702-95 702-83 691-72 678-72Z"></path></g><g data-mml-node="mn" data-latex="6" transform="translate(1055.8,0)"><path data-c="35" d="M118 315C123 315 129 319 134 326 164 371 205 393 257 393 292 393 319 373 337 332 348 305 354 264 354 209 354 146 346 102 331 76 306 35 272 14 229 14 162 14 109 62 91 114 94 113 96 114 100 114 130 114 155 137 155 167 155 198 130 219 100 219 65 219 50 200 50 163 50 63 131-22 231-22 292-22 344 0 386 44 428 88 449 141 449 202 449 260 432 310 398 353 361 400 315 423 259 423 212 423 171 408 138 378L138 556C165 548 191 544 218 544 264 544 304 555 338 578 369 597 390 616 402 634 408 642 411 648 411 651 411 661 406 666 396 666 341 645 294 634 256 634 211 634 168 643 127 662 122 664 118 665 114 665 105 665 100 656 100 637L100 345C100 324 100 315 118 315Z"></path><path data-c="36" d="M383 504C416 504 432 521 432 555 432 627 378 666 304 666 221 666 155 627 106 548 63 480 42 403 42 316 42 189 65 100 112 47 152 1 198-22 251-22 312-22 362 1 401 47 438 91 457 144 457 205 457 266 439 318 403 361 365 407 316 431 257 431 205 431 165 402 138 346L138 352C138 465 166 561 226 605 252 624 279 633 306 633 342 633 368 623 385 602 351 602 334 583 334 553 334 525 355 504 383 504M344 340C355 317 361 272 361 206 361 141 356 98 345 76 325 35 294 14 251 14 222 14 200 24 184 44 171 60 162 74 158 85 146 116 140 163 140 227 140 255 144 282 151 308 164 355 201 399 256 399 295 399 325 379 344 340Z" transform="translate(500,0)"></path></g></g></g></svg></mjx-container></p><p><mjx-container class="MathJax" jax="SVG" overflow="overflow"><svg style="vertical-align:-.566ex" xmlns="http://www.w3.org/2000/svg" width="1.303ex" height="2.262ex" role="img" focusable="false" viewBox="0 -750 576 1000"><g stroke="currentColor" fill="currentColor" stroke-width="0" transform="scale(1,-1)"><g data-mml-node="math" data-latex="h\ge6"><g data-mml-node="mi" data-latex="h"><path data-c="210E" d="M512 138C489 59 457 19 415 19 402 19 395 28 395 47 395 62 401 85 413 116 453 223 473 296 473 335 473 406 427 445 356 445 303 445 257 423 218 380L291 679C289 688 287 694 274 694 241 694 168 685 155 684 140 682 132 675 132 660 132 650 141 645 159 645 180 645 203 646 205 632L59 43C56 32 55 25 55 21 55 0 66-11 87-11 107-11 121-1 128 18L168 182C180 231 189 268 196 293 199 300 207 314 220 334 256 388 300 415 353 415 386 415 402 393 402 350 402 309 382 236 342 130 333 107 329 89 329 74 329 26 365-11 413-11 457-11 492 14 517 65 536 105 546 132 546 145 546 154 541 159 530 159 527 159 512 150 512 138Z"></path></g></g></g></svg><mjx-break size="4"></mjx-break><svg style="vertical-align:-.566ex" xmlns="http://www.w3.org/2000/svg" width="3.52ex" height="2.262ex" role="img" focusable="false" viewBox="0 -750 1555.8 1000"><g stroke="currentColor" fill="currentColor" stroke-width="0" transform="scale(1,-1)"><g data-mml-node="math" data-latex="h\ge6"><g data-mml-node="mo" data-latex="\ge"><path data-c="2265" d="M684 310C694 315 699 322 699 333 699 344 694 352 684 357L110 629C107 630 103 631 99 631 83 631 75 623 75 606 75 597 80 590 89 586L623 333 89 80C80 76 75 69 75 60 75 43 83 35 99 35 103 35 107 36 110 38M678-72 100-72C84-72 76-80 76-95 76-111 84-119 100-119L678-119C694-119 702-111 702-95 702-83 691-72 678-72Z"></path></g><g data-mml-node="mn" data-latex="6" transform="translate(1055.8,0)"><path data-c="36" d="M383 504C416 504 432 521 432 555 432 627 378 666 304 666 221 666 155 627 106 548 63 480 42 403 42 316 42 189 65 100 112 47 152 1 198-22 251-22 312-22 362 1 401 47 438 91 457 144 457 205 457 266 439 318 403 361 365 407 316 431 257 431 205 431 165 402 138 346L138 352C138 465 166 561 226 605 252 624 279 633 306 633 342 633 368 623 385 602 351 602 334 583 334 553 334 525 355 504 383 504M344 340C355 317 361 272 361 206 361 141 356 98 345 76 325 35 294 14 251 14 222 14 200 24 184 44 171 60 162 74 158 85 146 116 140 163 140 227 140 255 144 282 151 308 164 355 201 399 256 399 295 399 325 379 344 340Z"></path></g></g></g></svg></mjx-container></p><p>11111111.11111111.11111111.11000000</p><p>255.255.255.192</p><figure class="highlight plaintext"><table><tbody><tr><td class="code"><pre><span class="line">10.1.56.6 /28</span><br><span class="line">10.1.56.0000 0110</span><br><span class="line">网络地址: 10.1.56.0/28</span><br><span class="line">广播地址: 10.1.56.15/28</span><br><span class="line">IP地址数: 2^4=16</span><br><span class="line">可用IP地址数: 2^4-2=14</span><br><span class="line">可用IP地址范围: 10.1.56.1/28-10.1.56.14/28</span><br><span class="line"></span><br><span class="line">192.172.168.169 /27</span><br><span class="line">192.172.168.101 01001</span><br><span class="line">网络地址: 192.172.168.160/27</span><br><span class="line">广播地址: 192.172.168.191/27</span><br><span class="line">IP地址数: 2^5=32</span><br><span class="line">可用IP地址数: 2^5-2=30</span><br><span class="line">可用IP地址范围: 192.172.168.161/27-192.172.168.190/27</span><br><span class="line"></span><br><span class="line">192.168.39.48 /19</span><br><span class="line">192.168.001 00111.48</span><br><span class="line">网络地址: 192.168.32.0/19</span><br><span class="line">广播地址: 192.168.63.255/19</span><br><span class="line">IP地址数: 2^13=8192</span><br><span class="line">可用IP地址数: 2^13-2=8190</span><br><span class="line">可用IP地址范围: 192.168.32.1/19-192.168.63.254/19</span><br><span class="line"></span><br><span class="line">192.168.56.9 /19</span><br><span class="line">192.168.001 11000.9</span><br><span class="line">网络地址: 192.168.32.0/19</span><br><span class="line">广播地址: 192.168.63.255/19</span><br><span class="line">IP地址数: 2^13=8192</span><br><span class="line">可用IP地址数: 2^13-2=8190</span><br><span class="line">可用IP地址范围: 192.168.32.1/19-192.168.63.254/19</span><br><span class="line"></span><br><span class="line">172.169.1.9 /6</span><br><span class="line">101011 00.169.1.9</span><br><span class="line">网络地址: 172.0.0.0/6</span><br><span class="line">广播地址: 175.255.255.255/6</span><br><span class="line">IP地址数: 2^26=67,108,864</span><br><span class="line">可用IP地址数: 2^26-2=67,108,862</span><br><span class="line">可用IP地址范围: 172.0.0.1/6-175.255.255.254/6</span><br></pre></td></tr></tbody></table></figure></div><div class="story post-story"><h2 id="划分子网"><a href="#划分子网" class="headerlink" title="划分子网"></a>划分子网</h2><p>向主机位借位形成子网.</p><p>可变长子网掩码 VLSM</p><p>[例]</p><p>有一个 C 类网络地址 192.168.1.0 / 24 ,使用可变长子网掩码给三个子网分别分配 IP 地址 10 台 8 台 5 台</p><p>方法 1:<br><mjx-container class="MathJax" jax="SVG" overflow="overflow"><svg style="vertical-align:-.566ex" xmlns="http://www.w3.org/2000/svg" width="2.279ex" height="2.262ex" role="img" focusable="false" viewBox="0 -750 1007.3 1000"><g stroke="currentColor" fill="currentColor" stroke-width="0" transform="scale(1,-1)"><g data-mml-node="math" data-latex="2^n\ge3"><g data-mml-node="msup" data-latex="2^n"><g data-mml-node="mn" data-latex="2"><path data-c="32" d="M237 666C186 666 143 648 106 612 69 576 50 534 50 483 50 449 75 424 106 424 136 424 161 450 161 480 161 513 137 536 105 536 102 536 100 536 98 535 117 584 161 627 224 627 306 627 352 556 352 470 352 403 318 331 250 255L62 43C49 28 50 29 50 0L421 0 450 180 417 180C409 129 402 100 396 91 391 86 361 84 306 84L139 84 236 179C304 243 390 312 419 365 439 400 449 435 449 470 449 588 357 666 237 666Z"></path></g><g data-mml-node="mi" transform="translate(533,363) scale(0.707)" data-latex="n"><path data-c="1D45B" d="M537 137C514 58 481 18 440 18 427 18 420 28 420 47 420 61 426 84 438 115 478 224 498 296 498 333 498 403 451 442 381 442 322 442 271 416 230 363 222 407 187 442 136 442 80 442 58 390 44 345 34 313 29 294 29 287 29 278 34 273 45 273 50 273 53 274 56 276 61 285 64 292 65 299 83 375 106 413 133 413 151 413 160 399 160 371 160 358 155 331 144 290L87 63C84 50 78 24 78 19 78-1 89-11 111-11 130-11 144-1 151 19 153 24 159 49 170 92L191 181 221 295C232 318 249 341 270 365 299 397 335 413 378 413 411 413 427 391 427 348 427 310 406 234 363 120 356 102 353 87 353 74 353 25 390-11 438-11 482-11 517 14 542 64 561 104 571 131 571 144 571 153 566 158 555 158 552 158 537 149 537 137Z"></path></g></g></g></g></svg><mjx-break size="4"></mjx-break><svg style="vertical-align:-.566ex" xmlns="http://www.w3.org/2000/svg" width="3.52ex" height="2.262ex" role="img" focusable="false" viewBox="0 -750 1555.8 1000"><g stroke="currentColor" fill="currentColor" stroke-width="0" transform="scale(1,-1)"><g data-mml-node="math" data-latex="2^n\ge3"><g data-mml-node="mo" data-latex="\ge"><path data-c="2265" d="M684 310C694 315 699 322 699 333 699 344 694 352 684 357L110 629C107 630 103 631 99 631 83 631 75 623 75 606 75 597 80 590 89 586L623 333 89 80C80 76 75 69 75 60 75 43 83 35 99 35 103 35 107 36 110 38M678-72 100-72C84-72 76-80 76-95 76-111 84-119 100-119L678-119C694-119 702-111 702-95 702-83 691-72 678-72Z"></path></g><g data-mml-node="mn" data-latex="3" transform="translate(1055.8,0)"><path data-c="33" d="M303 353C369 378 431 441 431 526 431 569 410 604 369 631 333 654 292 666 246 666 201 666 162 654 127 631 88 605 68 571 68 528 68 495 90 472 122 472 154 472 176 495 176 527 176 560 157 578 119 580 145 615 186 633 242 633 302 633 332 598 332 527 332 485 324 450 309 421 282 373 245 364 183 364 171 362 165 357 165 348 165 333 172 333 192 333L235 333C310 333 348 280 348 173 348 88 317 14 241 14 176 14 128 36 99 80 134 79 160 105 160 139 160 173 135 198 101 198 62 198 42 178 42 137 42 88 64 49 108 18 147-9 193-22 244-22 301-22 350-3 393 34 436 71 457 117 457 173 457 267 383 332 303 353Z"></path></g></g></g></svg></mjx-container></p><p><mjx-container class="MathJax" jax="SVG" overflow="overflow"><svg style="vertical-align:-.566ex" xmlns="http://www.w3.org/2000/svg" width="1.357ex" height="2.262ex" role="img" focusable="false" viewBox="0 -750 600 1000"><g stroke="currentColor" fill="currentColor" stroke-width="0" transform="scale(1,-1)"><g data-mml-node="math" data-latex="n\ge2"><g data-mml-node="mi" data-latex="n"><path data-c="1D45B" d="M537 137C514 58 481 18 440 18 427 18 420 28 420 47 420 61 426 84 438 115 478 224 498 296 498 333 498 403 451 442 381 442 322 442 271 416 230 363 222 407 187 442 136 442 80 442 58 390 44 345 34 313 29 294 29 287 29 278 34 273 45 273 50 273 53 274 56 276 61 285 64 292 65 299 83 375 106 413 133 413 151 413 160 399 160 371 160 358 155 331 144 290L87 63C84 50 78 24 78 19 78-1 89-11 111-11 130-11 144-1 151 19 153 24 159 49 170 92L191 181 221 295C232 318 249 341 270 365 299 397 335 413 378 413 411 413 427 391 427 348 427 310 406 234 363 120 356 102 353 87 353 74 353 25 390-11 438-11 482-11 517 14 542 64 561 104 571 131 571 144 571 153 566 158 555 158 552 158 537 149 537 137Z"></path></g></g></g></svg><mjx-break size="4"></mjx-break><svg style="vertical-align:-.566ex" xmlns="http://www.w3.org/2000/svg" width="3.52ex" height="2.262ex" role="img" focusable="false" viewBox="0 -750 1555.8 1000"><g stroke="currentColor" fill="currentColor" stroke-width="0" transform="scale(1,-1)"><g data-mml-node="math" data-latex="n\ge2"><g data-mml-node="mo" data-latex="\ge"><path data-c="2265" d="M684 310C694 315 699 322 699 333 699 344 694 352 684 357L110 629C107 630 103 631 99 631 83 631 75 623 75 606 75 597 80 590 89 586L623 333 89 80C80 76 75 69 75 60 75 43 83 35 99 35 103 35 107 36 110 38M678-72 100-72C84-72 76-80 76-95 76-111 84-119 100-119L678-119C694-119 702-111 702-95 702-83 691-72 678-72Z"></path></g><g data-mml-node="mn" data-latex="2" transform="translate(1055.8,0)"><path data-c="32" d="M237 666C186 666 143 648 106 612 69 576 50 534 50 483 50 449 75 424 106 424 136 424 161 450 161 480 161 513 137 536 105 536 102 536 100 536 98 535 117 584 161 627 224 627 306 627 352 556 352 470 352 403 318 331 250 255L62 43C49 28 50 29 50 0L421 0 450 180 417 180C409 129 402 100 396 91 391 86 361 84 306 84L139 84 236 179C304 243 390 312 419 365 439 400 449 435 449 470 449 588 357 666 237 666Z"></path></g></g></g></svg></mjx-container></p><p>4 个子网</p><p>00 000000 0/26<br>01 000000 64/26<br>10 000000 128/26<br>11 000000 192/26</p><p>方法 2:</p><p><mjx-container class="MathJax" jax="SVG" overflow="overflow"><svg style="vertical-align:-.566ex" xmlns="http://www.w3.org/2000/svg" width="2.24ex" height="2.497ex" role="img" focusable="false" viewBox="0 -853.7 990.3 1103.7"><g stroke="currentColor" fill="currentColor" stroke-width="0" transform="scale(1,-1)"><g data-mml-node="math" data-latex="2^h-2\ge10"><g data-mml-node="msup" data-latex="2^h"><g data-mml-node="mn" data-latex="2"><path data-c="32" d="M237 666C186 666 143 648 106 612 69 576 50 534 50 483 50 449 75 424 106 424 136 424 161 450 161 480 161 513 137 536 105 536 102 536 100 536 98 535 117 584 161 627 224 627 306 627 352 556 352 470 352 403 318 331 250 255L62 43C49 28 50 29 50 0L421 0 450 180 417 180C409 129 402 100 396 91 391 86 361 84 306 84L139 84 236 179C304 243 390 312 419 365 439 400 449 435 449 470 449 588 357 666 237 666Z"></path></g><g data-mml-node="mi" transform="translate(533,363) scale(0.707)" data-latex="h"><path data-c="210E" d="M512 138C489 59 457 19 415 19 402 19 395 28 395 47 395 62 401 85 413 116 453 223 473 296 473 335 473 406 427 445 356 445 303 445 257 423 218 380L291 679C289 688 287 694 274 694 241 694 168 685 155 684 140 682 132 675 132 660 132 650 141 645 159 645 180 645 203 646 205 632L59 43C56 32 55 25 55 21 55 0 66-11 87-11 107-11 121-1 128 18L168 182C180 231 189 268 196 293 199 300 207 314 220 334 256 388 300 415 353 415 386 415 402 393 402 350 402 309 382 236 342 130 333 107 329 89 329 74 329 26 365-11 413-11 457-11 492 14 517 65 536 105 546 132 546 145 546 154 541 159 530 159 527 159 512 150 512 138Z"></path></g></g></g></g></svg><mjx-break size="3"></mjx-break><svg style="vertical-align:-.566ex" xmlns="http://www.w3.org/2000/svg" width="3.394ex" height="2.262ex" role="img" focusable="false" viewBox="0 -750 1500.2 1000"><g stroke="currentColor" fill="currentColor" stroke-width="0" transform="scale(1,-1)"><g data-mml-node="math" data-latex="2^h-2\ge10"><g data-mml-node="mo" data-latex="-"><path data-c="2212" d="M698 270 80 270C64 270 56 263 56 250 56 237 64 230 80 230L698 230C714 230 722 237 722 250 722 262 710 270 698 270Z"></path></g><g data-mml-node="mn" data-latex="2" transform="translate(1000.2,0)"><path data-c="32" d="M237 666C186 666 143 648 106 612 69 576 50 534 50 483 50 449 75 424 106 424 136 424 161 450 161 480 161 513 137 536 105 536 102 536 100 536 98 535 117 584 161 627 224 627 306 627 352 556 352 470 352 403 318 331 250 255L62 43C49 28 50 29 50 0L421 0 450 180 417 180C409 129 402 100 396 91 391 86 361 84 306 84L139 84 236 179C304 243 390 312 419 365 439 400 449 435 449 470 449 588 357 666 237 666Z"></path></g></g></g></svg><mjx-break size="4"></mjx-break><svg style="vertical-align:-.566ex" xmlns="http://www.w3.org/2000/svg" width="4.651ex" height="2.262ex" role="img" focusable="false" viewBox="0 -750 2055.8 1000"><g stroke="currentColor" fill="currentColor" stroke-width="0" transform="scale(1,-1)"><g data-mml-node="math" data-latex="2^h-2\ge10"><g data-mml-node="mo" data-latex="\ge"><path data-c="2265" d="M684 310C694 315 699 322 699 333 699 344 694 352 684 357L110 629C107 630 103 631 99 631 83 631 75 623 75 606 75 597 80 590 89 586L623 333 89 80C80 76 75 69 75 60 75 43 83 35 99 35 103 35 107 36 110 38M678-72 100-72C84-72 76-80 76-95 76-111 84-119 100-119L678-119C694-119 702-111 702-95 702-83 691-72 678-72Z"></path></g><g data-mml-node="mn" data-latex="0" transform="translate(1055.8,0)"><path data-c="31" d="M269 666C228 624 168 603 89 603L89 564C141 564 184 572 217 588L217 82C217 64 213 52 204 47 195 42 170 39 130 39L95 39 95 0C120 2 174 3 257 3 340 3 394 2 419 0L419 39 384 39C343 39 318 42 310 47 302 52 297 64 297 82L297 636C297 660 295 666 269 666Z"></path><path data-c="30" d="M249-22C390-22 460 92 460 320 460 473 428 575 365 625 330 652 291 666 250 666 109 666 39 551 39 320 39 136 88-22 249-22M361 524C368 489 371 425 371 332 371 240 367 172 360 128 347 48 310 8 249 8 226 8 203 17 182 34 155 57 139 104 132 176 129 201 128 253 128 332 128 419 131 480 136 513 145 568 163 603 191 618 213 630 232 636 249 636 314 636 350 583 361 524Z" transform="translate(500,0)"></path></g></g></g></svg></mjx-container></p><p><mjx-container class="MathJax" jax="SVG" overflow="overflow"><svg style="vertical-align:-.566ex" xmlns="http://www.w3.org/2000/svg" width="1.303ex" height="2.262ex" role="img" focusable="false" viewBox="0 -750 576 1000"><g stroke="currentColor" fill="currentColor" stroke-width="0" transform="scale(1,-1)"><g data-mml-node="math" data-latex="h\ge4"><g data-mml-node="mi" data-latex="h"><path data-c="210E" d="M512 138C489 59 457 19 415 19 402 19 395 28 395 47 395 62 401 85 413 116 453 223 473 296 473 335 473 406 427 445 356 445 303 445 257 423 218 380L291 679C289 688 287 694 274 694 241 694 168 685 155 684 140 682 132 675 132 660 132 650 141 645 159 645 180 645 203 646 205 632L59 43C56 32 55 25 55 21 55 0 66-11 87-11 107-11 121-1 128 18L168 182C180 231 189 268 196 293 199 300 207 314 220 334 256 388 300 415 353 415 386 415 402 393 402 350 402 309 382 236 342 130 333 107 329 89 329 74 329 26 365-11 413-11 457-11 492 14 517 65 536 105 546 132 546 145 546 154 541 159 530 159 527 159 512 150 512 138Z"></path></g></g></g></svg><mjx-break size="4"></mjx-break><svg style="vertical-align:-.566ex" xmlns="http://www.w3.org/2000/svg" width="3.52ex" height="2.262ex" role="img" focusable="false" viewBox="0 -750 1555.8 1000"><g stroke="currentColor" fill="currentColor" stroke-width="0" transform="scale(1,-1)"><g data-mml-node="math" data-latex="h\ge4"><g data-mml-node="mo" data-latex="\ge"><path data-c="2265" d="M684 310C694 315 699 322 699 333 699 344 694 352 684 357L110 629C107 630 103 631 99 631 83 631 75 623 75 606 75 597 80 590 89 586L623 333 89 80C80 76 75 69 75 60 75 43 83 35 99 35 103 35 107 36 110 38M678-72 100-72C84-72 76-80 76-95 76-111 84-119 100-119L678-119C694-119 702-111 702-95 702-83 691-72 678-72Z"></path></g><g data-mml-node="mn" data-latex="4" transform="translate(1055.8,0)"><path data-c="34" d="M353 677C344 677 336 672 330 663L28 199 28 163 289 163 289 81C289 63 285 51 278 46 271 41 252 39 219 39L194 39 194 0C223 2 269 3 331 3 393 3 439 2 468 0L468 39 443 39C410 39 391 41 384 46 377 51 373 63 373 81L373 163 471 163 471 202 373 202 373 660C373 670 366 677 353 677M295 553 295 202 67 202Z"></path></g></g></g></svg></mjx-container></p><p>16 个子网</p><p>0000 0000</p><p>0001 0000</p><p>....</p><p>[例]</p><p>192.168.1.2 / 24 (主机位 8)<br>共有 25 个地址需求<br>求子网网络号, 掩码. 广播地址, 可划分子网数</p><figure class="highlight plaintext"><table><tbody><tr><td class="code"><pre><span class="line">2^h-2>=25</span><br><span class="line">h>=5 主机位 5</span><br><span class="line">n=3</span><br><span class="line">可划分2^3=8个子网</span><br><span class="line">掩码</span><br><span class="line">255.255.255.111 00000</span><br><span class="line">255.255.255.224</span><br><span class="line">/27</span><br><span class="line">子网网络号</span><br><span class="line">192.168.1.000 00000 192.168.1.0/27</span><br><span class="line">192.168.1.001 00000 192.168.1.32/27</span><br><span class="line">192.168.1.010 00000 192.168.1.64/27</span><br><span class="line">192.168.1.011 00000 192.168.1.96/27</span><br><span class="line">192.168.1.100 00000 192.168.1.128/27</span><br><span class="line">192.168.1.101 00000 192.168.1.160/27</span><br><span class="line">192.168.1.110 00000 192.168.1.192/27</span><br><span class="line">192.168.1.111 00000 192.168.1.224/27</span><br><span class="line">广播地址</span><br><span class="line">192.168.1.000 11111 /27</span><br><span class="line">192.168.1.001 11111 /27</span><br><span class="line">192.168.1.010 11111 /27</span><br><span class="line">192.168.1.011 11111 /27</span><br><span class="line">192.168.1.100 11111 /27</span><br><span class="line">192.168.1.101 11111 /27</span><br><span class="line">192.168.1.110 11111 /27</span><br><span class="line">192.168.1.111 11111 /27</span><br></pre></td></tr></tbody></table></figure><p>[例]</p><p>某公司 4 个部门, 每个部门最多 36 人<br>192.168.10.0 / 24 (主机位 8)<br>划分出合适的网络<br>掩码<br>网络号<br>子网数目</p><figure class="highlight plaintext"><table><tbody><tr><td class="code"><pre><span class="line">2^h-2>=36</span><br><span class="line">h>=6</span><br><span class="line">n=2</span><br><span class="line">子网数目 2^2=4</span><br><span class="line">掩码</span><br><span class="line">255.255.255.11 000000</span><br><span class="line">255.255.255.192</span><br><span class="line">网络号</span><br><span class="line">192.168.10.00 000000 192.168.10.0/26</span><br><span class="line">192.168.10.01 000000 192.168.10.64/26</span><br><span class="line">192.168.10.10 000000 192.168.10.128/26</span><br><span class="line">192.168.10.11 000000 192.168.10.192/26</span><br></pre></td></tr></tbody></table></figure></div><div class="story post-story"><h2 id="IP编址"><a href="#IP编址" class="headerlink" title="IP编址"></a>IP 编址</h2><p>一个网络内拥有的 IP 地址数量为<mjx-container class="MathJax" jax="SVG" overflow="overflow"><svg style="vertical-align:0" xmlns="http://www.w3.org/2000/svg" width="2.24ex" height="1.932ex" role="img" focusable="false" viewBox="0 -853.7 990.3 853.7"><g stroke="currentColor" fill="currentColor" stroke-width="0" transform="scale(1,-1)"><g data-mml-node="math" data-latex="2^h"><g data-mml-node="msup" data-latex="2^h"><g data-mml-node="mn" data-latex="2"><path data-c="32" d="M237 666C186 666 143 648 106 612 69 576 50 534 50 483 50 449 75 424 106 424 136 424 161 450 161 480 161 513 137 536 105 536 102 536 100 536 98 535 117 584 161 627 224 627 306 627 352 556 352 470 352 403 318 331 250 255L62 43C49 28 50 29 50 0L421 0 450 180 417 180C409 129 402 100 396 91 391 86 361 84 306 84L139 84 236 179C304 243 390 312 419 365 439 400 449 435 449 470 449 588 357 666 237 666Z"></path></g><g data-mml-node="mi" transform="translate(533,363) scale(0.707)" data-latex="h"><path data-c="210E" d="M512 138C489 59 457 19 415 19 402 19 395 28 395 47 395 62 401 85 413 116 453 223 473 296 473 335 473 406 427 445 356 445 303 445 257 423 218 380L291 679C289 688 287 694 274 694 241 694 168 685 155 684 140 682 132 675 132 660 132 650 141 645 159 645 180 645 203 646 205 632L59 43C56 32 55 25 55 21 55 0 66-11 87-11 107-11 121-1 128 18L168 182C180 231 189 268 196 293 199 300 207 314 220 334 256 388 300 415 353 415 386 415 402 393 402 350 402 309 382 236 342 130 333 107 329 89 329 74 329 26 365-11 413-11 457-11 492 14 517 65 536 105 546 132 546 145 546 154 541 159 530 159 527 159 512 150 512 138Z"></path></g></g></g></g></svg></mjx-container> (<mjx-container class="MathJax" jax="SVG" overflow="overflow"><svg style="vertical-align:-.025ex" xmlns="http://www.w3.org/2000/svg" width="1.303ex" height="1.595ex" role="img" focusable="false" viewBox="0 -694 576 705"><g stroke="currentColor" fill="currentColor" stroke-width="0" transform="scale(1,-1)"><g data-mml-node="math" data-latex="h"><g data-mml-node="mi" data-latex="h"><path data-c="210E" d="M512 138C489 59 457 19 415 19 402 19 395 28 395 47 395 62 401 85 413 116 453 223 473 296 473 335 473 406 427 445 356 445 303 445 257 423 218 380L291 679C289 688 287 694 274 694 241 694 168 685 155 684 140 682 132 675 132 660 132 650 141 645 159 645 180 645 203 646 205 632L59 43C56 32 55 25 55 21 55 0 66-11 87-11 107-11 121-1 128 18L168 182C180 231 189 268 196 293 199 300 207 314 220 334 256 388 300 415 353 415 386 415 402 393 402 350 402 309 382 236 342 130 333 107 329 89 329 74 329 26 365-11 413-11 457-11 492 14 517 65 536 105 546 132 546 145 546 154 541 159 530 159 527 159 512 150 512 138Z"></path></g></g></g></svg></mjx-container>代表主机位位数).</p><p>因为网络号和广播地址不可以配置在设备上, 所以实际可用主机地址数为<mjx-container class="MathJax" jax="SVG" overflow="overflow"><svg style="vertical-align:-.566ex" xmlns="http://www.w3.org/2000/svg" width="2.24ex" height="2.497ex" role="img" focusable="false" viewBox="0 -853.7 990.3 1103.7"><g stroke="currentColor" fill="currentColor" stroke-width="0" transform="scale(1,-1)"><g data-mml-node="math" data-latex="2^h-2"><g data-mml-node="msup" data-latex="2^h"><g data-mml-node="mn" data-latex="2"><path data-c="32" d="M237 666C186 666 143 648 106 612 69 576 50 534 50 483 50 449 75 424 106 424 136 424 161 450 161 480 161 513 137 536 105 536 102 536 100 536 98 535 117 584 161 627 224 627 306 627 352 556 352 470 352 403 318 331 250 255L62 43C49 28 50 29 50 0L421 0 450 180 417 180C409 129 402 100 396 91 391 86 361 84 306 84L139 84 236 179C304 243 390 312 419 365 439 400 449 435 449 470 449 588 357 666 237 666Z"></path></g><g data-mml-node="mi" transform="translate(533,363) scale(0.707)" data-latex="h"><path data-c="210E" d="M512 138C489 59 457 19 415 19 402 19 395 28 395 47 395 62 401 85 413 116 453 223 473 296 473 335 473 406 427 445 356 445 303 445 257 423 218 380L291 679C289 688 287 694 274 694 241 694 168 685 155 684 140 682 132 675 132 660 132 650 141 645 159 645 180 645 203 646 205 632L59 43C56 32 55 25 55 21 55 0 66-11 87-11 107-11 121-1 128 18L168 182C180 231 189 268 196 293 199 300 207 314 220 334 256 388 300 415 353 415 386 415 402 393 402 350 402 309 382 236 342 130 333 107 329 89 329 74 329 26 365-11 413-11 457-11 492 14 517 65 536 105 546 132 546 145 546 154 541 159 530 159 527 159 512 150 512 138Z"></path></g></g></g></g></svg><mjx-break size="3"></mjx-break><svg style="vertical-align:-.566ex" xmlns="http://www.w3.org/2000/svg" width="3.394ex" height="2.262ex" role="img" focusable="false" viewBox="0 -750 1500.2 1000"><g stroke="currentColor" fill="currentColor" stroke-width="0" transform="scale(1,-1)"><g data-mml-node="math" data-latex="2^h-2"><g data-mml-node="mo" data-latex="-"><path data-c="2212" d="M698 270 80 270C64 270 56 263 56 250 56 237 64 230 80 230L698 230C714 230 722 237 722 250 722 262 710 270 698 270Z"></path></g><g data-mml-node="mn" data-latex="2" transform="translate(1000.2,0)"><path data-c="32" d="M237 666C186 666 143 648 106 612 69 576 50 534 50 483 50 449 75 424 106 424 136 424 161 450 161 480 161 513 137 536 105 536 102 536 100 536 98 535 117 584 161 627 224 627 306 627 352 556 352 470 352 403 318 331 250 255L62 43C49 28 50 29 50 0L421 0 450 180 417 180C409 129 402 100 396 91 391 86 361 84 306 84L139 84 236 179C304 243 390 312 419 365 439 400 449 435 449 470 449 588 357 666 237 666Z"></path></g></g></g></svg></mjx-container>.</p><p>如果两个 IP 地址的网络位相同, 则这两个地址属于同一个网络, 可以不通过网关设备或路由器直接通信.</p><p>如果两个 IP 地址的网络位不同, 则需要借助网关设备和路由器进行通信.</p><p>使用默认掩码的就是有类地址.</p><p>无类地址就是经过子网划分的 IP 地址.</p><p><code>VLSM</code>: 可变长子网掩码.</p><p>子网掩码变长, 主机位变少,<mjx-container class="MathJax" jax="SVG" overflow="overflow"><svg style="vertical-align:0" xmlns="http://www.w3.org/2000/svg" width="2.24ex" height="1.932ex" role="img" focusable="false" viewBox="0 -853.7 990.3 853.7"><g stroke="currentColor" fill="currentColor" stroke-width="0" transform="scale(1,-1)"><g data-mml-node="math" data-latex="2^h"><g data-mml-node="msup" data-latex="2^h"><g data-mml-node="mn" data-latex="2"><path data-c="32" d="M237 666C186 666 143 648 106 612 69 576 50 534 50 483 50 449 75 424 106 424 136 424 161 450 161 480 161 513 137 536 105 536 102 536 100 536 98 535 117 584 161 627 224 627 306 627 352 556 352 470 352 403 318 331 250 255L62 43C49 28 50 29 50 0L421 0 450 180 417 180C409 129 402 100 396 91 391 86 361 84 306 84L139 84 236 179C304 243 390 312 419 365 439 400 449 435 449 470 449 588 357 666 237 666Z"></path></g><g data-mml-node="mi" transform="translate(533,363) scale(0.707)" data-latex="h"><path data-c="210E" d="M512 138C489 59 457 19 415 19 402 19 395 28 395 47 395 62 401 85 413 116 453 223 473 296 473 335 473 406 427 445 356 445 303 445 257 423 218 380L291 679C289 688 287 694 274 694 241 694 168 685 155 684 140 682 132 675 132 660 132 650 141 645 159 645 180 645 203 646 205 632L59 43C56 32 55 25 55 21 55 0 66-11 87-11 107-11 121-1 128 18L168 182C180 231 189 268 196 293 199 300 207 314 220 334 256 388 300 415 353 415 386 415 402 393 402 350 402 309 382 236 342 130 333 107 329 89 329 74 329 26 365-11 413-11 457-11 492 14 517 65 536 105 546 132 546 145 546 154 541 159 530 159 527 159 512 150 512 138Z"></path></g></g></g></g></svg></mjx-container> 就会变少, 主机数目减少, 避免地址浪费. 主机位长度缩减, 网络位就会增加.</p><p>一个子网位能分出两个子网<mjx-container class="MathJax" jax="SVG" overflow="overflow"><svg style="vertical-align:0" xmlns="http://www.w3.org/2000/svg" width="2.279ex" height="1.528ex" role="img" focusable="false" viewBox="0 -675.5 1007.3 675.5"><g stroke="currentColor" fill="currentColor" stroke-width="0" transform="scale(1,-1)"><g data-mml-node="math" data-latex="2^n"><g data-mml-node="msup" data-latex="2^n"><g data-mml-node="mn" data-latex="2"><path data-c="32" d="M237 666C186 666 143 648 106 612 69 576 50 534 50 483 50 449 75 424 106 424 136 424 161 450 161 480 161 513 137 536 105 536 102 536 100 536 98 535 117 584 161 627 224 627 306 627 352 556 352 470 352 403 318 331 250 255L62 43C49 28 50 29 50 0L421 0 450 180 417 180C409 129 402 100 396 91 391 86 361 84 306 84L139 84 236 179C304 243 390 312 419 365 439 400 449 435 449 470 449 588 357 666 237 666Z"></path></g><g data-mml-node="mi" transform="translate(533,363) scale(0.707)" data-latex="n"><path data-c="1D45B" d="M537 137C514 58 481 18 440 18 427 18 420 28 420 47 420 61 426 84 438 115 478 224 498 296 498 333 498 403 451 442 381 442 322 442 271 416 230 363 222 407 187 442 136 442 80 442 58 390 44 345 34 313 29 294 29 287 29 278 34 273 45 273 50 273 53 274 56 276 61 285 64 292 65 299 83 375 106 413 133 413 151 413 160 399 160 371 160 358 155 331 144 290L87 63C84 50 78 24 78 19 78-1 89-11 111-11 130-11 144-1 151 19 153 24 159 49 170 92L191 181 221 295C232 318 249 341 270 365 299 397 335 413 378 413 411 413 427 391 427 348 427 310 406 234 363 120 356 102 353 87 353 74 353 25 390-11 438-11 482-11 517 14 542 64 561 104 571 131 571 144 571 153 566 158 555 158 552 158 537 149 537 137Z"></path></g></g></g></g></svg></mjx-container> (<mjx-container class="MathJax" jax="SVG" overflow="overflow"><svg style="vertical-align:-.025ex" xmlns="http://www.w3.org/2000/svg" width="1.357ex" height="1.025ex" role="img" focusable="false" viewBox="0 -442 600 453"><g stroke="currentColor" fill="currentColor" stroke-width="0" transform="scale(1,-1)"><g data-mml-node="math" data-latex="n"><g data-mml-node="mi" data-latex="n"><path data-c="1D45B" d="M537 137C514 58 481 18 440 18 427 18 420 28 420 47 420 61 426 84 438 115 478 224 498 296 498 333 498 403 451 442 381 442 322 442 271 416 230 363 222 407 187 442 136 442 80 442 58 390 44 345 34 313 29 294 29 287 29 278 34 273 45 273 50 273 53 274 56 276 61 285 64 292 65 299 83 375 106 413 133 413 151 413 160 399 160 371 160 358 155 331 144 290L87 63C84 50 78 24 78 19 78-1 89-11 111-11 130-11 144-1 151 19 153 24 159 49 170 92L191 181 221 295C232 318 249 341 270 365 299 397 335 413 378 413 411 413 427 391 427 348 427 310 406 234 363 120 356 102 353 87 353 74 353 25 390-11 438-11 482-11 517 14 542 64 561 104 571 131 571 144 571 153 566 158 555 158 552 158 537 149 537 137Z"></path></g></g></g></svg></mjx-container> 是子网位位数).</p><p><code>CIDR</code>: 无类域间路由 (VLSM 逆运算)</p><p>子网掩码除了 VLSM 以外, 还可以变短进行网络信息的汇总, 这种操作方式就是 CIDR.</p><p>将不同网络的网络号中共同发生变化的位置当作主机位进行处理, 之后对外发布, 起到节省设备资源的作用.</p></div></div><div class="footer"></div><div class="article-meta" id="bottom"><div class="new-meta-box"></div></div><div class="prev-next"><a class="prev" href="/notes/datacom/5"><p class="title"><i class="fa-solid fa-chevron-left" aria-hidden="true"></i>交换网络基础</p><p class="content">本文解析交换网络核心技术,交换机作为二层全双工设备,通过MAC地址表实现数据帧转发,解决冲突问题。涵盖泛洪(广播/未知单播)、转发(已知单播)、丢弃(同端口发送)三种行为,MAC地址表学习(源MAC+接口映射)、老化(300s无更新删除)及刷新机制,附MAC地址表结构示例。</p></a><a class="next" href="/notes/datacom/7"><p class="title">ICMP协议<i class="fa-solid fa-chevron-right" aria-hidden="true"></i></p><p class="content">本文解析网络控制消息协议(ICMP),协议号1,网络层传递差错与控制消息。含Echo Request/Reply检测连通性,类型/代码字段标识网络不可达等状态,校验和保障完整性。ping基于ICMP测试连通,tracert追踪路径;重定向优化转发但存安全风险,常被管理员限制。</p></a></div><div class="recommended-article"><div class="recommended-article-header"><i class="fa-solid fa-bookmark fa-fw" aria-hidden="true"></i> <span>推荐阅读</span></div><div class="recommended-article-group"> <a class="recommended-article-item" href="/notes/datacom/29.html" title="IPv6" rel="bookmark"><img src="https://static.mhuig.top/npm/imbox@0.0.15/c/49.webp" class="lazyload" data-srcset="https://static.mhuig.top/npm/imbox@0.0.15/c/49.webp" srcset="data:image/gif;base64,R0lGODlhAQABAIAAAP///////yH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" alt="IPv6"> <span class="title">IPv6</span></a> <a class="recommended-article-item" href="/notes/datacom/8.html" title="ARP协议" rel="bookmark"><img src="https://static.mhuig.top/npm/imbox@0.0.15/c/103.webp" class="lazyload" data-srcset="https://static.mhuig.top/npm/imbox@0.0.15/c/103.webp" srcset="data:image/gif;base64,R0lGODlhAQABAIAAAP///////yH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" alt="ARP协议"> <span class="title">ARP协议</span></a> <a class="recommended-article-item" href="/notes/datacom/11.html" title="数据转发过程" rel="bookmark"><img src="https://static.mhuig.top/npm/imbox@0.0.15/c/82.webp" class="lazyload" data-srcset="https://static.mhuig.top/npm/imbox@0.0.15/c/82.webp" srcset="data:image/gif;base64,R0lGODlhAQABAIAAAP///////yH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" alt="数据转发过程"> <span class="title">数据转发过程</span></a> <a class="recommended-article-item" href="/notes/datacom/5.html" title="交换网络基础" rel="bookmark"><img src="https://static.mhuig.top/npm/imbox@0.0.15/c/72.webp" class="lazyload" data-srcset="https://static.mhuig.top/npm/imbox@0.0.15/c/72.webp" srcset="data:image/gif;base64,R0lGODlhAQABAIAAAP///////yH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" alt="交换网络基础"> <span class="title">交换网络基础</span></a> <a class="recommended-article-item" href="/notes/datacom/4.html" title="以太网帧结构" rel="bookmark"><img src="https://static.mhuig.top/npm/imbox@0.0.15/c/39.webp" class="lazyload" data-srcset="https://static.mhuig.top/npm/imbox@0.0.15/c/39.webp" srcset="data:image/gif;base64,R0lGODlhAQABAIAAAP///////yH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" alt="以太网帧结构"> <span class="title">以太网帧结构</span></a> <a class="recommended-article-item" href="/notes/datacom/20.html" title="NAT网络地址转换" rel="bookmark"><img src="https://static.mhuig.top/npm/imbox@0.0.15/c/63.webp" class="lazyload" data-srcset="https://static.mhuig.top/npm/imbox@0.0.15/c/63.webp" srcset="data:image/gif;base64,R0lGODlhAQABAIAAAP///////yH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" alt="NAT网络地址转换"> <span class="title">NAT网络地址转换</span></a></div></div></article><article class="post white-box shadow floatable blur" id="comments"><span hidden=""><meta itemprop="discussionUrl" content="/notes/datacom/6#comments"></span><p ct=""><i class="fa-duotone fa-comments"></i> 留言区</p><div id="layoutHelper-comments"></div></article></div><aside id="l_side" itemscope="" itemtype="http://schema.org/WPSideBar"><section class="widget text desktop mobile pjax"><header><a href="/notes/"><i class="fa-duotone fa-book fa-fw" aria-hidden="true"></i> <span class="name">Notes</span></a></header><div class="content"></div></section><section class="widget list group desktop mobile pjax"><header><i class="fa-duotone fa-chart-network fa-fw" aria-hidden="true"></i> <span class="name">数据通信网络</span></header><div class="content"><ul class="list entry navigation"><li><a class="flat-box" title="/notes/datacom/" href="/notes/datacom/" active-action="action-notesdatacom"><div class="name"> Welcome</div></a></li><li><a class="flat-box" title="/notes/datacom/1" href="/notes/datacom/1" active-action="action-notesdatacom1"><div class="name"> 网络通信</div></a></li><li><a class="flat-box" title="/notes/datacom/2" href="/notes/datacom/2" active-action="action-notesdatacom2"><div class="name"> 传输介质</div></a></li><li><a class="flat-box" title="/notes/datacom/3" href="/notes/datacom/3" active-action="action-notesdatacom3"><div class="name"> 网络参考模型</div></a></li><li><a class="flat-box" title="/notes/datacom/4" href="/notes/datacom/4" active-action="action-notesdatacom4"><div class="name"> 以太网帧结构</div></a></li><li><a class="flat-box" title="/notes/datacom/5" href="/notes/datacom/5" active-action="action-notesdatacom5"><div class="name"> 交换网络基础</div></a></li><li><a class="flat-box" title="/notes/datacom/6" href="/notes/datacom/6" active-action="action-notesdatacom6"><div class="name"> IP编址</div></a></li><li><a class="flat-box" title="/notes/datacom/7" href="/notes/datacom/7" active-action="action-notesdatacom7"><div class="name"> ICMP协议</div></a></li><li><a class="flat-box" title="/notes/datacom/8" href="/notes/datacom/8" active-action="action-notesdatacom8"><div class="name"> ARP协议</div></a></li><li><a class="flat-box" title="/notes/datacom/9" href="/notes/datacom/9" active-action="action-notesdatacom9"><div class="name"> 传输层协议</div></a></li><li><a class="flat-box" title="/notes/datacom/10" href="/notes/datacom/10" active-action="action-notesdatacom10"><div class="name"> DHCP</div></a></li><li><a class="flat-box" title="/notes/datacom/11" href="/notes/datacom/11" active-action="action-notesdatacom11"><div class="name"> 数据转发过程</div></a></li><li><a class="flat-box" title="/notes/datacom/12" href="/notes/datacom/12" active-action="action-notesdatacom12"><div class="name"> VLAN原理与配置</div></a></li><li><a class="flat-box" title="/notes/datacom/13" href="/notes/datacom/13" active-action="action-notesdatacom13"><div class="name"> IP路由基础</div></a></li><li><a class="flat-box" title="/notes/datacom/14" href="/notes/datacom/14" active-action="action-notesdatacom14"><div class="name"> 远程登录</div></a></li><li><a class="flat-box" title="/notes/datacom/15" href="/notes/datacom/15" active-action="action-notesdatacom15"><div class="name"> 实现VLAN间通信</div></a></li><li><a class="flat-box" title="/notes/datacom/16" href="/notes/datacom/16" active-action="action-notesdatacom16"><div class="name"> OSPF基础</div></a></li><li><a class="flat-box" title="/notes/datacom/17" href="/notes/datacom/17" active-action="action-notesdatacom17"><div class="name"> STP</div></a></li><li><a class="flat-box" title="/notes/datacom/18" href="/notes/datacom/18" active-action="action-notesdatacom18"><div class="name"> 以太网链路聚合</div></a></li><li><a class="flat-box" title="/notes/datacom/19" href="/notes/datacom/19" active-action="action-notesdatacom19"><div class="name"> ACL原理和配置</div></a></li><li><a class="flat-box" title="/notes/datacom/20" href="/notes/datacom/20" active-action="action-notesdatacom20"><div class="name"> NAT网络地址转换</div></a></li><li><a class="flat-box" title="/notes/datacom/21" href="/notes/datacom/21" active-action="action-notesdatacom21"><div class="name"> BFD协议原理与配置</div></a></li><li><a class="flat-box" title="/notes/datacom/22" href="/notes/datacom/22" active-action="action-notesdatacom22"><div class="name"> OSPF路由计算</div></a></li><li><a class="flat-box" title="/notes/datacom/23" href="/notes/datacom/23" active-action="action-notesdatacom23"><div class="name"> OSPF特殊区域</div></a></li><li><a class="flat-box" title="/notes/datacom/24" href="/notes/datacom/24" active-action="action-notesdatacom24"><div class="name"> BGP</div></a></li><li><a class="flat-box" title="/notes/datacom/25" href="/notes/datacom/25" active-action="action-notesdatacom25"><div class="name"> VRF 虚拟路由转发</div></a></li><li><a class="flat-box" title="/notes/datacom/26" href="/notes/datacom/26" active-action="action-notesdatacom26"><div class="name"> VRRP</div></a></li><li><a class="flat-box" title="/notes/datacom/27" href="/notes/datacom/27" active-action="action-notesdatacom27"><div class="name"> 防火墙</div></a></li><li><a class="flat-box" title="/notes/datacom/28" href="/notes/datacom/28" active-action="action-notesdatacom28"><div class="name"> WLAN</div></a></li><li><a class="flat-box" title="/notes/datacom/29" href="/notes/datacom/29" active-action="action-notesdatacom29"><div class="name"> IPv6</div></a></li></ul></div></section><div class="widget-sticky pjax"></div><div class="pjax"></div><div class="pjax"></div><div class="pjax"></div><div class="pjax"></div><div class="pjax"></div><div class="pjax"></div><div class="pjax"></div><div class="pjax"></div><div class="pjax"></div><div class="pjax"></div><div class="pjax"></div><div class="pjax"></div><div class="pjax"></div><div class="pjax"></div><div class="pjax"></div><div class="pjax"></div><div class="pjax"></div><div class="pjax"></div><div class="pjax"></div><div class="pjax"></div><div class="pjax"></div><div class="pjax"></div><div class="pjax"></div><div class="pjax"></div><div class="pjax"></div><div class="pjax"></div><div class="pjax"></div><div class="pjax"></div><div class="pjax"></div><div class="pjax"></div><div class="pjax"></div><div class="pjax"></div><div class="pjax"></div><div class="pjax"></div></aside><pjax><script>window.pdata={},pdata.ispage=!1,pdata.commentPath="",pdata.commentPlaceholder="",pdata.commentConfig={};var l_header=document.getElementById("l_header");l_header.classList.add("show");var cover_wrapper=document.querySelector("#l_cover .cover-wrapper"),scroll_down=document.getElementById("scroll-down");cover_wrapper.id="none",cover_wrapper.style.display="none",scroll_down.style.display="none"</script></pjax></div><footer class="footer clearfix" itemscope="" itemtype="http://schema.org/WPFooter"><br><br><div class="aplayer-container"><div class="aplayer-local"></div></div><br><div class="social-wrapper" itemprop="about" itemscope="" itemtype="http://schema.org/Thing"><a href="/atom.xml" class="social fa-duotone fa-rss flat-btn" target="_blank" rel="external nofollow noopener noreferrer" itemprop="url"></a><a href="https://mhuig.top/contact/" class="social fa-duotone fa-envelope flat-btn" target="_blank" rel="external nofollow noopener noreferrer" itemprop="url"></a><a href="https://github.com/MHuiG" class="social fa-brands fa-github flat-btn" target="_blank" rel="external nofollow noopener noreferrer" itemprop="url"></a><a href="https://t.me/MHuiG" class="social fa-brands fa-telegram flat-btn" target="_blank" rel="external nofollow noopener noreferrer" itemprop="url"></a></div><div><p>博客内容遵循 <a target="_blank" rel="external nofollow noopener noreferrer" href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh-hans">署名-非商业性使用-相同方式共享 4.0 国际 (CC BY-NC-SA 4.0) 协议</a></p></div><div class="copyright"><p><a href="https://icp.gov.moe" target="_blank" rel="external nofollow noopener noreferrer">萌ICP备</a> <a href="https://icp.gov.moe/?keyword=2020012138" target="_blank" rel="external nofollow noopener noreferrer">2020012138号</a><br><a target="_blank" rel="noopener" href="https://mhuig.top/">Copyright © Since 2018 MHuiG</a></p></div></footer><a id="s-top" class="fa-solid fa-arrow-up fa-fw" title="top"></a></div></div><div><script>volantis.dom.bodyAnchor=volantis.dom.$(document.getElementById("safearea")),volantis.dom.topBtn=volantis.dom.$(document.getElementById("s-top")),volantis.dom.wrapper=volantis.dom.$(document.getElementById("wrapper")),volantis.dom.coverAnchor=volantis.dom.$(document.querySelector("#l_cover .cover-wrapper")),volantis.dom.switcher=volantis.dom.$(document.querySelector("#l_header .switcher .s-search")),volantis.dom.header=volantis.dom.$(document.getElementById("l_header")),volantis.dom.search=volantis.dom.$(document.querySelector("#l_header .m_search")),volantis.dom.mPhoneList=volantis.dom.$(document.querySelectorAll("#l_header .m-phone .list-v"))</script><script>volantis.css("https://static.mhuig.top/npm/volantis-static@0.0.1660614606622/libs/@fortawesome/fontawesome-pro/css/all.min.css")</script><script src="/js/app.js"></script><script>const rootElement=document.documentElement,darkModeStorageKey="color-scheme",rootElementDarkModeAttributeName="color-scheme",setLS=(e,t)=>{localStorage.setItem(e,t)},removeLS=e=>{localStorage.removeItem(e)},getLS=e=>localStorage.getItem(e),getModeFromCSSMediaQuery=()=>window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",resetRootDarkModeAttributeAndLS=()=>{rootElement.removeAttribute("color-scheme"),removeLS("color-scheme")},validColorModeKeys={dark:!0,light:!0},applyCustomDarkModeSettings=e=>{const t=e||getLS("color-scheme");getCustomDarkMode(),t===getModeFromCSSMediaQuery()?resetRootDarkModeAttributeAndLS():validColorModeKeys[t]?rootElement.setAttribute("color-scheme",t):resetRootDarkModeAttributeAndLS()},invertDarkModeObj={dark:"light",light:"dark"},getCustomDarkMode=()=>{let e=getLS("color-scheme");if(validColorModeKeys[e])e=invertDarkModeObj[e];else{if(null!==e)return;e=invertDarkModeObj[getModeFromCSSMediaQuery()]}volantis.dark.mode="dark"==e?"light":"dark"},toggleCustomDarkMode=()=>{let e=getLS("color-scheme");if(validColorModeKeys[e])e=invertDarkModeObj[e];else{if(null!==e)return;e=invertDarkModeObj[getModeFromCSSMediaQuery()]}return setLS("color-scheme",e),e};function bindToggleButton(){document.querySelectorAll("#wrapper .toggle-mode-btn,#rightmenu-wrapper .toggle-mode-btn").forEach((function(e){volantis.dom.$(e).on("click",volantis.dark.toggle)}))}volantis.dark.toggle=()=>{const e=toggleCustomDarkMode();applyCustomDarkModeSettings(e),volantis.dark.method.toggle.start()},applyCustomDarkModeSettings(),document.addEventListener("DOMContentLoaded",(()=>{volantis.requestAnimationFrame(bindToggleButton)})),volantis.pjax.push(bindToggleButton);const darkModelListeners={dark:e=>{e.matches&&(volantis.dark.mode="dark"),volantis.dark.method.toggle.start()},light:e=>{e.matches&&(volantis.dark.mode="light"),volantis.dark.method.toggle.start()}};window.matchMedia("(prefers-color-scheme: dark)").addListener(darkModelListeners.dark),window.matchMedia("(prefers-color-scheme: light)").addListener(darkModelListeners.light)</script><script>function loadIssuesJS(){null!=document.getElementById("sites-api")&&"undefined"==typeof SitesJS&&volantis.js("/js/plugins/tags/sites.js");null!=document.getElementById("friends-api")&&"undefined"==typeof FriendsJS&&volantis.js("/js/plugins/tags/friends.js");null!=document.getElementById("contributors-api")&&"undefined"==typeof ContributorsJS&&volantis.js("/js/plugins/tags/contributors.js")}loadIssuesJS(),volantis.pjax.push((()=>{loadIssuesJS()}))</script><script defer="" src="https://cdn.bootcdn.net/ajax/libs/vanilla-lazyload/17.1.0/lazyload.min.js"></script><script>window.lazyLoadOptions={elements_selector:".lazyload",threshold:0},window.addEventListener("LazyLoad::Initialized",(function(n){window.lazyLoadInstance=n.detail.instance}),!1),document.addEventListener("DOMContentLoaded",(function(){lazyLoadInstance.update()})),document.addEventListener("pjax:complete",(function(){lazyLoadInstance.update()}))</script><script>window.FPConfig={delay:0,ignoreKeywords:["#"],maxRPS:6,hoverDelay:0}</script><script defer="" src="https://static.mhuig.top/npm/volantis-static@0.0.1660614606622/libs/flying-pages/flying-pages.min.js"></script><script>volantis.css("https://cdn.bootcdn.net/ajax/libs/aplayer/1.10.1/APlayer.min.css"),volantis.js("https://cdn.bootcdn.net/ajax/libs/aplayer/1.10.1/APlayer.min.js").then((()=>{function e(){document.querySelector(".aplayer-local-min")&&document.querySelectorAll(".aplayer-local-min").forEach((e=>{new APlayer(Object.assign({container:e,mini:!0,order:"list",volume:"0.7",autoplay:!1,loop:"all",theme:"#1BCDFC",listMaxHeight:"320px",listFolded:"true",preload:"auto",lrcType:3,audio:[{name:"虹之间",artist:"钢琴版伴奏",url:"https://blog.mhuig.top/music-Archive/BetweenTheRainbow.mp3",lrc:"https://blog.mhuig.top/music-Archive/BetweenTheRainbow.lrc",cover:"https://blog.mhuig.top/music-Archive/BetweenTheRainbow.jpg"},{name:"Avem",artist:"Alan Walker",url:"https://blog.mhuig.top/music-Archive/Avem.mp3",lrc:"https://blog.mhuig.top/music-Archive/Avem.lrc",cover:"https://blog.mhuig.top/music-Archive/Avem.jpg"},{name:"Fly",artist:"Marshmello / Leau Culver",url:"https://blog.mhuig.top/music-Archive/fly.mp3",lrc:"https://blog.mhuig.top/music-Archive/fly.lrc",cover:"https://blog.mhuig.top/music-Archive/fly.jpg"},{name:"Alone",artist:"Marshmello",url:"https://blog.mhuig.top/music-Archive/alone.mp3",lrc:"https://blog.mhuig.top/music-Archive/alone.lrc",cover:"https://blog.mhuig.top/music-Archive/alone.jpg"}]},JSON.parse(e.querySelector(".aplayer-local-min-conf").innerText)))}))}document.querySelectorAll(".aplayer-local").forEach((e=>{new APlayer({container:e,fixed:!1,order:"list",volume:"0.7",autoplay:!1,loop:"all",theme:"#1BCDFC",listMaxHeight:"320px",listFolded:"true",preload:"auto",lrcType:3,audio:[{name:"虹之间",artist:"钢琴版伴奏",url:"https://blog.mhuig.top/music-Archive/BetweenTheRainbow.mp3",lrc:"https://blog.mhuig.top/music-Archive/BetweenTheRainbow.lrc",cover:"https://blog.mhuig.top/music-Archive/BetweenTheRainbow.jpg"},{name:"Avem",artist:"Alan Walker",url:"https://blog.mhuig.top/music-Archive/Avem.mp3",lrc:"https://blog.mhuig.top/music-Archive/Avem.lrc",cover:"https://blog.mhuig.top/music-Archive/Avem.jpg"},{name:"Fly",artist:"Marshmello / Leau Culver",url:"https://blog.mhuig.top/music-Archive/fly.mp3",lrc:"https://blog.mhuig.top/music-Archive/fly.lrc",cover:"https://blog.mhuig.top/music-Archive/fly.jpg"},{name:"Alone",artist:"Marshmello",url:"https://blog.mhuig.top/music-Archive/alone.mp3",lrc:"https://blog.mhuig.top/music-Archive/alone.lrc",cover:"https://blog.mhuig.top/music-Archive/alone.jpg"}]})})),e(),volantis.pjax.push(e,"aplayerMin")}))</script><script>function check_giscus(){return"dark"===volantis.dark.mode?volantis.giscus.Theme="dark":volantis.giscus.Theme="light",document.getElementById("giscus_container")}function pjax_giscus(){const t=check_giscus();if(!t)return;let s=Object.assign({theme:{light:"light",dark:"dark"},repo:"MHuiG/talk","repo-id":"MDEwOlJlcG9zaXRvcnkyODQ4NDg1NTg=",category:"Giscus","category-id":"DIC_kwDOEPpxrs4B_X67",mapping:"pathname","reactions-enabled":"1","emit-metadata":"1",lang:"zh-CN","input-position":"top"},pdata.commentConfig);const e=document.createElement("script");e.setAttribute("src","https://giscus.app/client.js"),Object.keys(s).forEach((t=>{"theme"!=t&&e.setAttribute("data-"+t,s[t])})),e.setAttribute("data-theme",volantis.giscus.Theme),e.setAttribute("crossorigin","anonymous"),t.appendChild(e)}function dark_giscus(){if(!check_giscus())return;const t={setConfig:{theme:volantis.giscus.Theme}};document.querySelector("iframe.giscus-frame").contentWindow.postMessage({giscus:t},"https://giscus.app")}volantis.layoutHelper("comments",'<div id="giscus_container"></div>'),volantis.giscus={},pjax_giscus(),volantis.pjax.push(pjax_giscus),volantis.dark.push(dark_giscus)</script><script>async function loadSearchScript(){return volantis.js("/js/search/hexo.js")}function loadSearchService(){loadSearchScript(),document.querySelectorAll(".input.u-search-input").forEach((e=>{e.removeEventListener("focus",loadSearchService,!1)})),document.querySelectorAll(".u-search-form").forEach((e=>{e.addEventListener("submit",(e=>{e.preventDefault()}),!1)}))}function OpenSearch(e){"undefined"==typeof SearchService?loadSearchScript().then((()=>{SearchService.setQueryText(e),SearchService.search()})):(SearchService.setQueryText(e),SearchService.search())}if(window.location.search&&/^\?s=/g.test(window.location.search)){OpenSearch(decodeURI(window.location.search).replace(/\ /g,"-").replace(/^\?s=/g,""))}document.querySelectorAll(".input.u-search-input").forEach((e=>{e.addEventListener("focus",loadSearchService,!1)}))</script><script>function pjax_highlightjs_copyCode(){(document.querySelector(".highlight .code pre")||document.querySelector(".article pre code"))&&VolantisApp.utilCopyCode(".highlight .code pre, .article pre code")}volantis.requestAnimationFrame(pjax_highlightjs_copyCode),volantis.pjax.push(pjax_highlightjs_copyCode)</script><script>function load_swiper(){document.querySelectorAll(".swiper-container")[0]&&(volantis.css("https://cdn.bootcdn.net/ajax/libs/Swiper/8.3.2/swiper-bundle.min.css"),volantis.js("https://cdn.bootcdn.net/ajax/libs/Swiper/8.3.2/swiper-bundle.min.js").then((()=>{pjax_swiper()})))}function pjax_swiper(){volantis.swiper=new Swiper(".swiper-container",{slidesPerView:"auto",spaceBetween:8,centeredSlides:!0,loop:!0,pagination:{el:".swiper-pagination",clickable:!0},navigation:{nextEl:".swiper-button-next",prevEl:".swiper-button-prev"}})}load_swiper(),volantis.pjax.push((()=>{document.querySelectorAll(".swiper-container")[0]&&(void 0===volantis.swiper?load_swiper():pjax_swiper())}))</script><script>volantis.css("https://cdn.bootcdn.net/ajax/libs/pace/1.2.4/themes/blue/pace-theme-minimal.min.css"),volantis.js("https://cdn.bootcdn.net/ajax/libs/pace/1.2.4/pace.min.js").then((()=>{Pace.options.restartOnPushState=!1,volantis.pjax.send(Pace.restart,"Pace.restart"),volantis.scroll.push(volantis.debounce((()=>{Pace.stop(),Pace.trigger("start"),Pace.bar.update(100*volantis.scroll.progress()),document.body.className=document.body.className.replaceAll("pace-running ","")})),"阅读进度")}))</script><pjax></pjax><script>function listenSidebarTOC(){const t=document.querySelectorAll(".toc li");if(!t.length)return;const e=[];Array.from(t).forEach((t=>{const n=t.querySelector(".toc-link"),i=document.getElementById(n.getAttribute("href")?decodeURI(n.getAttribute("href")).replace("#",""):n.getAttribute("toc-action").split("toc-")[1]);return e.push(i),n.getAttribute("href")&&(n.setAttribute("toc-action","toc-"+decodeURI(n.getAttribute("href")).replace("#","")),n.removeAttribute("href")),i&&i.id&&n.addEventListener("click",(t=>{t.preventDefault(),volantis.scroll.to(i,{addTop:5,observer:!0}),history.pushState(null,document.title,"#"+i.id)})),i}));function n(t){if(t.classList.contains("active-current"))return;document.querySelectorAll(".toc .active").forEach((t=>{t.classList.remove("active","active-current")})),t.classList.add("active","active-current");let e=t.parentNode;for(;!e.matches(".toc");)e.matches("li")&&e.classList.add("active"),e=e.parentNode}volantis.activateNavIndex=0,n(t[volantis.activateNavIndex]),e[0]&&volantis.scroll.push(volantis.debounce((()=>{if(e[0].getBoundingClientRect().top>=0)volantis.activateNavIndex=0;else if(e[e.length-1].getBoundingClientRect().top<0)volantis.activateNavIndex=e.length-1;else for(let t=0;t<e.length;t++){const n=e[t],i=e[(t+1)%e.length];if(n.getBoundingClientRect().top<0&&i.getBoundingClientRect().top>=0){volantis.activateNavIndex=t;break}}n(t[volantis.activateNavIndex])})),"sidebar-toc")}document.addEventListener("DOMContentLoaded",(()=>{volantis.requestAnimationFrame(listenSidebarTOC)})),volantis.pjax.push(listenSidebarTOC,"listenSidebarTOC")</script><script>try{let e=(e,t,n=2)=>Math.abs(e-t)<=n,t=(t,n)=>!e(t.width,n.width)||!e(t.height,n.height),n=new WeakMap,i=(e,i=e.getClientBoundingRect())=>{let o=n.get(e);o&&!t(o,i)||(n.set(e,i),e.style["contain-intrinsic-size"]=`${i.width}px ${i.height}px`)},o=new IntersectionObserver(((e,t)=>{e.forEach((e=>{i(e.target,e.boundingClientRect)}))}),{rootMargin:"500px 0px 500px 0px"}),r=new ResizeObserver(((e,t)=>{e.forEach((e=>{i(e.target,e.contentRect)}))})),s=e=>{let t=document.querySelectorAll(e);t.length&&(t.forEach((e=>{o.observe(e),r.observe(e)})),requestAnimationFrame((()=>{requestAnimationFrame((()=>{t[0].style["content-visibility"]="auto"}))})))},a=()=>{"content-visibility"in document.documentElement.style&&s(".post-story")};a(),volantis.pjax.push(a)}catch(e){console.log(e)}</script><script>document.onreadystatechange=function(){if("complete"==document.readyState){const{saveData:e,effectiveType:t}=navigator.connection||navigator.mozConnection||navigator.webkitConnection||{};("none"==getComputedStyle(document.querySelector("#safearea"),null).display||e||/2g/.test(t))&&(document.querySelectorAll(".reveal").forEach((function(e){e.style.opacity="1"})),document.querySelector("#safearea").style.display="block")}}</script><script src="https://cdn.bootcdn.net/ajax/libs/pjax/0.2.8/pjax.min.js"></script><script>const performanceMonitor={slowThreshold:800,slowCount:0,maxSlowAllowed:1,requestStartTime:0,start(){this.requestStartTime=Date.now()},check(){Date.now()-this.requestStartTime>this.slowThreshold?this.slowCount++:this.slowCount=0},res(){return this.slowCount>=this.maxSlowAllowed}};var pjax;document.addEventListener("DOMContentLoaded",(function(){pjax=new Pjax({elements:'a[href]:not([href^="#"]):not([href="javascript:void(0)"]):not([pjax-fancybox]):not([onclick="return false;"]):not([onclick="return!1"]):not([target="_blank"]):not([target="view_window"]):not([href$=".xml"])',selectors:["head title","head meta[name=keywords]","head meta[name=description]","#l_main","#pjax-header-nav-list",".pjax","pjax","meta[name=robots]","link[rel=canonical]","meta[property='og:title']","meta[property='og:description']","meta[property='og:url']","meta[property='og:image']","script[type='application/ld+json']"],cacheBust:!1,timeout:900})})),document.addEventListener("pjax:send",(function(e){window.stop(),performanceMonitor.start();try{var t=window.location.pathname,o=e.triggerElement.href,n=[""];""!=n[0]&&n.forEach((e=>{-1==t.indexOf(e)&&-1==o.indexOf(e)||(window.location.href=o)})),performanceMonitor.res()&&(window.location.href=o)}catch(e){}volantis.pjax.method.send.start()})),document.addEventListener("pjax:complete",(function(){performanceMonitor.check(),document.querySelectorAll("script[data-pjax], .pjax-reload script").forEach((e=>{const t=e.text||e.textContent||e.innerHTML||"",o=document.createElement("script");Object.keys(e.attributes).forEach((t=>{o.setAttribute(e.attributes[t].nodeName,e.attributes[t].nodeValue)})),t&&o.appendChild(document.createTextNode(t)),e.parentNode.replaceChild(o,e)})),volantis.pjax.method.complete.start()})),document.addEventListener("pjax:error",(function(e){"pjax"===volantis.debug?(console.error(e),console.log("pjax error: \n"+JSON.stringify(e))):(volantis.pjax.method.error.start(),window.location.href=e.triggerElement.href)}))</script></div><pjax> <a style="display:none" target="_blank" rel="external nofollow noopener noreferrer" href="https://bot-trap.mhuig.top/">Are You A Robot?</a></pjax><script>(()=>{function t(){if("localhost:4000"!=window.location.host&&!/blog\.mhuig\.top/.test(window.location.host)){const t=document.createElement("meta");t.name="robots",t.content=atob("bm9pbmRleCwgbm9mb2xsb3csIG5vYXJjaGl2ZQ=="),document.head.appendChild(t)}}function o(){document.querySelector("figcaption")&&document.querySelectorAll("figcaption").forEach((t=>{volantis.dom.$(t).on("click",(function(){const t=!window.CodeBlockFullscreen;window.CodeBlockFullscreen=t;const o=document.getElementById("post")||document.getElementById("docs")||document.getElementById("page");if(!o)return;const e=this.parentElement,n=e.parentElement,l=document.documentElement,c=document.querySelectorAll(".highlight > table .gutter");o.classList.toggle("code-block-fullscreen",t),e.classList.toggle("code-block-fullscreen",t),n.classList.toggle("code-block-fullscreen",t),e.classList.toggle("code-block-fullscreen-overflow-auto",t),l.classList.toggle("code-block-fullscreen-html-scroll",t),c.forEach((o=>{o.classList.toggle("code-block-fullscreen-gutter",t)}))}))}))}t(),volantis.pjax.push(t),top.location!=self.location&&(top.location=self.location),"mhuig.github.io"==window.location.host||"localhost:4000"==window.location.host||/mhuig\.top$/.test(window.location.host)||/kix\.moe$/.test(window.location.host)||/mhuig/.test(window.location.host)||/ipfs/.test(window.location.host)||(window.location.href=atob("aHR0cHM6Ly9ibG9nLm1odWlnLnRvcC8=")),o(),volantis.pjax.push(o);const e=[{month:12,day:13},function(){const t=(new Date).getFullYear(),o=t%100,e=t>=2e3?4.81:5.59,n=Math.floor(o/4),l=Math.floor(.2422*o+e)-n;return{month:4,day:Math.max(4,l)}}(),{month:7,day:7},{month:9,day:18},{month:9,day:30}];function n(){document.documentElement.classList.remove("mourning-mode");if(!["/","/index.html","/index.htm","/index"].includes(window.location.pathname))return;const t=new Date,o=t.getMonth()+1,n=t.getDate();e.some((t=>t.month===o&&t.day===n))&&document.documentElement.classList.add("mourning-mode")}const l=document.createElement("style");l.textContent="\n html.mourning-mode {\n filter: grayscale(100%);\n -webkit-filter: grayscale(100%);\n transition: filter 0.5s ease;\n }\n ",document.head.appendChild(l),n(),document.addEventListener("pjax:complete",n)})()</script></body></html>