blog
blog copied to clipboard
OSI 概念模型
网络为什么要分层
好处在于,每一层只要管好自己的事情就好了, 我们的HTTP协议升级,并不会影响到传输层.各个层相互独立
应用层
chrome浏览器 打开F12
,清清楚楚看到所有这一层网络具体干了什么
Request URL: https://github.com/pengliheng/pengliheng.github.io/issues/new/show_partial?&partial=issues%2Fsidebar%2Fmilestone_menu_content
Request Method: GET
Status Code: 200 OK
Remote Address: 127.0.0.1:8118
Referrer Policy: no-referrer-when-downgrade
Cache-Control: max-age=0, private, must-revalidate
Content-Encoding: gzip
Content-Security-Policy: default-src 'none'; base-uri 'self'; block-all-mixed-content; connect-src 'self' uploads.github.com www.githubstatus.com collector.githubapp.com api.github.com www.google-analytics.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com wss://live.github.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com; frame-ancestors 'none'; frame-src render.githubusercontent.com; img-src 'self' data: github.githubassets.com identicons.github.com collector.githubapp.com github-cloud.s3.amazonaws.com *.githubusercontent.com; manifest-src 'self'; media-src 'none'; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com
Content-Type: text/html; charset=utf-8
Date: Mon, 06 May 2019 15:00:30 GMT
ETag: W/"c5658b08713921e8e372409706d7446a"
Expect-CT: max-age=2592000, report-uri="https://api.github.com/_private/browser/errors"
Server: GitHub.com
Set-Cookie: user_session=cceLPIQelG8IVcOVJL9XX7v4wPdYnQZjj4kitGqvGMt1oder; path=/; expires=Mon, 20 May 2019 15:00:30 -0000; secure; HttpOnly
Set-Cookie: __Host-user_session_same_site=cceLPIQelG8IVcOVJL9XX7v4wPdYnQZjj4kitGqvGMt1oder; path=/; expires=Mon, 20 May 2019 15:00:30 -0000; secure; HttpOnly; SameSite=Strict
Set-Cookie: has_recent_activity=1; path=/; expires=Mon, 06 May 2019 16:00:30 -0000
Set-Cookie: _gh_sess=dDc2ZGRrc1ArSUZBV2FWbE54SGVRcEw0UE5xaDc3d1dYQzltM1lta0ZpdmdONW16M05va2ZKdC8xdzBsTmZtRUVoQkR4VTRIYmJnWXp4SGwrclpvenhPci9KZXBKbGJkbjgwQTk2emMvQ2pZTVA1RHdJUkZ2blVGWlg1ZDRtYjVpQUJhSHpiZkowUldXR0ViOG9yaENDQitoWVhsYldSL0NyMEVZNmozMDhCSzZ2Y2k4ek4xVUtoTU83Z2ljY2d1dlVaL0lPemFsdDVYbEFXWFZldEREZTF3NEtGVngrVThOYkE5MndQTkxuVFV0OERmSkM0b0FQTDIyVmZHdXZtazAwaXkwcGk1aXJ0TUlUWWtCQ21xdTBORzM5S0dPUmdXcGNOcHdDUC9QTHlGTjY5M1c0Qzg2QTdxeWV2cFRDSlZxRmJiL21kc2dMd1B2NW9zRnFGRkJYMmFucHJUd0xvOWxpVEhzK1JFTlFjPS0tRk9aelQ1OXU5UEo5UUQzS0tuVDVOZz09--a3b606d386fe898e3c2c7a31fee368898052381b; path=/; secure; HttpOnly
Status: 200 OK
Strict-Transport-Security: max-age=31536000; includeSubdomains; preload
Transfer-Encoding: chunked
Vary: X-PJAX
Vary: Accept-Encoding
X-Content-Type-Options: nosniff
X-Frame-Options: deny
X-GitHub-Request-Id: 87F0:7040:17786A3:25025DC:5CD04C0D
X-HTML-Safe: f1cd4837252705397947534fa21f542730a4c90c
X-Request-Id: a6792c00-d934-4bae-b57f-f68d1db0898e
X-XSS-Protection: 1; mode=block
Accept: */*
Accept-Encoding: gzip, deflate, br
Accept-Language: zh-CN,zh;q=0.9,en;q=0.8
Connection: keep-alive
Cookie: _ga=GA1.2.474672711.1554796404; tz=Asia%2FShanghai; _octo=GH1.1.1460778098.1554796406; _device_id=15df76960704f908b73077c8e9b1713d; user_session=cceLPIQelG8IVcOVJL9XX7v4wPdYnQZjj4kitGqvGMt1oder; __Host-user_session_same_site=cceLPIQelG8IVcOVJL9XX7v4wPdYnQZjj4kitGqvGMt1oder; logged_in=yes; dotcom_user=pengliheng; ignored_unsupported_browser_notice=false; has_recent_activity=1; _gat=1; _gh_sess=dWZkZ252MnJFYWF0MTJ4OXBscU80MmxhRExPcHZhYmUrSWtiSS9RNW9LUi90WWtOSlRjN0t5ejNLRG1pMytJalVLeFZJSXlSYUJyS2tML2FoQ2VqanBTSHNjVUJSdFVtcmpGY29lbFBoeE44bUZVanJ3SHFDVWljcEFWbnJOR1EzeHBCWkdvQ0dTeGQxaTBpanZFYjJwZnZFTTNXQlNiUEx4V1M0bHRwR09oRmRpeW1sRHhiRjBtc3E0SEt2a0lndXRIVlltNHBiTVdIMmRzS042M2hmUk44Tm9jY0ZKckdLSFVQbU9nMFlER0dRUllGeXczNGxsRnRTa0pSdTZUK2JZYkZTc0FPaWVLWE5LZk1oVVk1VTlpMUg1VFp5N2FDaFBPZk0yMGp2ZGxUNWlVS1pFT3FpS3VvSnJ6MEtHN2owOUNhOHAxeGlOenc4VWxMelZ5aGpGKytBVkEyVmpleHQwUkllaFBaUUZRPS0tK2tBejFKWVBGY2JzelptRG5yNlJzQT09--4329d4171e5cd5d905a7cc74091ae26353c9da9a
Host: github.com
Referer: https://github.com/pengliheng/pengliheng.github.io/issues/new
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.131 Safari/537.36
X-Requested-With: XMLHttpRequest
(empty)
partial: issues/sidebar/milestone_menu_content
表示层
其实就是基于0信任网络模型构建出来的, 最早的互联网是基于互相信任的模型构建, 因此在不断发展的过程中出现了很多漏洞... 总之表示层具体来说就是类似于https的ssl层加密解密.
会话层
sesstion咯, token咯, 每建立一次网络连接 就相当于建立了会话sesstion, token的cookie写入. 下次免登陆等等.
传输层
它是关于进程与进程之间的通讯,他同时决定了网络流向,向哪个进程委托请求.同时, 我想说,这就像是寄快递, 快递里面的物品是我们寄出, tcp就是快递员,帮我们在快递上面套一层tcp套接层
网络层
ip协议,将一个报文传递给另一个另一个主机
数据链路层
路由器, mac地址交换, 路由器的注册表, 路由器决定应该指向那一台路由作为下一个节点转接.
物理层
铜线,光纤.