Skip to content

Commit 8b06aee

Browse files
committed
初始化
1 parent ec70334 commit 8b06aee

File tree

15 files changed

+236
-5
lines changed

15 files changed

+236
-5
lines changed

Diff for: .gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@ Thumbs.db
33
db.json
44
*.log
55
node_modules/
6+
public/
67
.deploy*/
78
_multiconfig.yml

Diff for: _config.yml

+28-2
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ subtitle: ''
88
description: ''
99
keywords:
1010
author: John Doe
11-
language: en
11+
language: zh-CN
1212
timezone: ''
1313

1414
# URL
1515
## Set your site url here. For example, if you use GitHub Page, set url as 'https://username.github.io/project'
16-
url: http://example.com
16+
url: https://errocks.github.io
1717
permalink: :year/:month/:day/:title/
1818
permalink_defaults:
1919
pretty_urls:
@@ -70,6 +70,30 @@ default_category: uncategorized
7070
category_map:
7171
tag_map:
7272

73+
category_generator:
74+
per_page: 10
75+
76+
tag_generator:
77+
per_page: 10
78+
order_by: -date
79+
# enable_index_page: true
80+
81+
# hexo-neat
82+
neat_enable: true
83+
neat_html:
84+
enable: true
85+
exclude:
86+
neat_css:
87+
enable: true
88+
exclude:
89+
- '*.min.css'
90+
neat_js:
91+
enable: true
92+
mangle: true
93+
output:
94+
compress:
95+
exclude:
96+
- '*.min.js'
7397
# Metadata elements
7498
## https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta
7599
meta_generator: true
@@ -105,4 +129,6 @@ deploy:
105129
type: git
106130
repository: [email protected]:errocks/errocks.github.io.git
107131
branch: master
132+
name: errocks
133+
108134

Diff for: package.json

+23-3
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,41 @@
66
"build": "hexo generate",
77
"clean": "hexo clean",
88
"deploy": "hexo deploy",
9-
"server": "hexo server"
9+
"server": "hexo server",
10+
"hexo": "npm run hexo:clean && npm run hexo:build && npm run server",
11+
"yuque:clean": "yuque-hexo clean",
12+
"yuque:sync": "yuque-hexo sync",
13+
"Yuque": "npm run yuque:clean && npm run yuque:sync"
1014
},
15+
"yuqueConfig": {
16+
"postPath": "source/_posts",
17+
"baseUrl": "https://www.yuque.com/api/v2",
18+
"login": "语雀个人路径",
19+
"repo": "知识库路径",
20+
"onlyPublished": true,
21+
"onlyPublic": true
22+
},
1123
"hexo": {
1224
"version": "6.2.0"
1325
},
1426
"dependencies": {
1527
"hexo": "^6.2.0",
28+
"hexo-deployer-git": "^3.0.0",
1629
"hexo-generator-archive": "^1.0.0",
30+
"hexo-generator-baidu-sitemap": "^0.1.9",
1731
"hexo-generator-category": "^1.0.0",
32+
"hexo-generator-category-enhance": "^0.1.6",
33+
"hexo-generator-feed": "^3.0.0",
1834
"hexo-generator-index": "^2.0.0",
35+
"hexo-generator-json-content": "^4.2.3",
36+
"hexo-generator-sitemap": "^3.0.1",
1937
"hexo-generator-tag": "^1.0.0",
38+
"hexo-neat": "^1.0.9",
2039
"hexo-renderer-ejs": "^2.0.0",
2140
"hexo-renderer-marked": "^5.0.0",
2241
"hexo-renderer-stylus": "^2.1.0",
2342
"hexo-server": "^3.0.0",
24-
"hexo-theme-landscape": "^0.0.3"
43+
"hexo-theme-landscape": "^0.0.3",
44+
"hexo-wordcount": "^6.0.1"
2545
}
26-
}
46+
}

Diff for: source/404/index.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
title: 404 Not Found:该页无法显示
3+
toc: false
4+
comments: false
5+
permalink: /404
6+
---
7+
<script type="text/javascript" src="//www.qq.com/404/search_children.js" charset="utf-8" homePageUrl="<%- config.url %>" homePageName="回到我的主页"></script>

Diff for: source/_data/gallery.yml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Gallery
2+
Name:
3+
full_link: http://example.com/full-image.png
4+
thumb_link: http://example.com/thumb-image.png
5+
descr: "这是一个描述"

Diff for: source/_data/links.yml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# links
2+
创造狮:
3+
link: http://chuangzaoshi.com/
4+
avatar: /images/favatar/chuangzaoshi-logo.png
5+
desc: 为创意工作者而设计
6+
腾讯设计导航:
7+
link: http://idesign.qq.com/
8+
avatar: /images/favatar/idesign-logo.png
9+
desc: 网罗全网高逼格的设计站点

Diff for: source/_posts/hello-world.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
---
22
title: Hello World
3+
categories:
4+
- 文章分类
5+
tags:
6+
- hello
37
---
48
Welcome to [Hexo](https://hexo.io/)! This is your very first post. Check [documentation](https://hexo.io/docs/) for more info. If you get any problems when using Hexo, you can find the answer in [troubleshooting](https://hexo.io/docs/troubleshooting.html) or you can ask me on [GitHub](https://github.com/hexojs/hexo/issues).
59

Diff for: source/_posts/hello-world2.md

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
title: Hello World2323
3+
categories:
4+
- 文章分类
5+
tags:
6+
- hello
7+
---
8+
Welcome to [Hexo](https://hexo.io/)! This is your very first post. Check [documentation](https://hexo.io/docs/) for more info. If you get any problems when using Hexo, you can find the answer in [troubleshooting](https://hexo.io/docs/troubleshooting.html) or you can ask me on [GitHub](https://github.com/hexojs/hexo/issues).
9+
10+
## Quick Start
11+
12+
### Create a new post
13+
14+
``` bash
15+
$ hexo new "My New Post"
16+
```
17+
18+
More info: [Writing](https://hexo.io/docs/writing.html)
19+
20+
### Run server
21+
22+
``` bash
23+
$ hexo server
24+
```
25+
26+
More info: [Server](https://hexo.io/docs/server.html)
27+
28+
### Generate static files
29+
30+
``` bash
31+
$ hexo generate
32+
```
33+
34+
More info: [Generating](https://hexo.io/docs/generating.html)
35+
36+
### Deploy to remote sites
37+
38+
``` bash
39+
$ hexo deploy
40+
```
41+
42+
More info: [Deployment](https://hexo.io/docs/one-command-deployment.html)
43+
### Deploy to remote sites1

Diff for: source/_posts/网络问题总结.md

+80
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
---
2+
title: 网络问题总结
3+
categories:
4+
- 文章分类
5+
tags:
6+
- hello
7+
---
8+
9+
## 运输层
10+
运输层主要是UDP、TCP相关的问题。
11+
12+
- 为什么需要三次握手
13+
> tcp连接的双方要确保各自的收发消息的能力都是正常的。 客户端第一次发送握手消息到服务端, 服务端接收到握手消息后把ack和自己的syn一同发送给客户端,这是第二次握手, 当客户端接收到服务端发送来的第二次握手消息后,客户端可以确认“服务端的收发能力OK,客户端的收发能力OK”,但是服务端只能确认“客户端的发送OK,服务端的接收OK”, 所以还需要第三次握手,客户端收到服务端的第二次握手消息后,发起第三次握手消息,服务端收到客户端发送的第三次握手消息后,就能够确定“服务端的发送OK,客户端的接收OK”, 至此,客户端和服务端都能够确认自己和对方的收发能力OK,,tcp连接建立完成。
14+
15+
16+
- 什么是TIME_WAIT
17+
> ![image.png](https://cdn.nlark.com/yuque/0/2022/png/545431/1652530678440-1dda5193-fb5d-4c13-bd2f-4b7340437395.png#clientId=u7140745c-d3a4-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=368&id=ud5fb29e1&margin=%5Bobject%20Object%5D&name=image.png&originHeight=736&originWidth=1088&originalType=binary&ratio=1&rotation=0&showTitle=false&size=187259&status=done&style=none&taskId=uaf3f6bdf-6aab-4484-93f3-2186a7eda89&title=&width=544)
18+
> 主动发起关闭放, 收到对方的FIN-n的时候就会进入TIME_WAIT, 等待2MSL 时间(60秒) 就会关闭连接
19+
20+
- 为什么要有TIME_WAIT?
21+
> 为了网络传输的可靠性->容错性
22+
> 如果主机 1 没有维护 TIME_WAIT 状态,而直接进入 CLOSED 状态,它就失去了当前状态的上下文,只能回复一个 RST 操作,从而导致被动关闭方出现错误。
23+
> 可能还有数据没发完
24+
> 第二个理由和连接“化身”和报文迷走有关系,为了让旧连接的重复分节在网络中自然消失。我们知道,在网络中,经常会发生报文经过一段时间才能到达目的地的情况,产生的原因是多种多样的,如路由器重启,链路突然出现故障等。如果迷走报文到达时,发现 TCP 连接四元组(源 IP,源端口,目的 IP,目的端口)所代表的连接不复存在,那么很简单,这个报文自然丢弃。我们考虑这样一个场景,在原连接中断后,又重新创建了一个原连接的“化身”,说是化身其实是因为这个连接和原先的连接四元组完全相同,如果迷失报文经过一段时间也到达,那么这个报文会被误认为是连接“化身”的一个 TCP 分节,这样就会对 TCP 通信产生影响。
25+
26+
- 出现大量TIME_WAIT的原因
27+
> 同时大量关闭连接
28+
> 大量TIME_WAIT可能导致以下的问题
29+
> 1. 是内存占用
30+
> 1. 端口资源占用
31+
32+
- TCP协议如何提高传输效率
33+
> 1. 发送窗口
34+
> 1. 糊涂窗口问题
35+
>
36+
需要在自己的缓冲区大到一个合理的值之后,再向发送端发送窗口更新通知。这个合理的值,由对应的 RFC 规范定义
37+
> 3. 在发送端进行优化。这个优化的算法叫做** Nagle 算法**,Nagle 算法的本质其实就是限制大批量的小数据包同时发送,为此,它提出,在任何一个时刻,未被确认的小数据包不能超过一个。这里的小数据包,指的是长度小于最大报文段长度 MSS 的 TCP 分组。这样,发送端就可以把接下来连续的几个小数据包存储起来,等待接收到前一个小数据包的 ACK 分组之后,再将数据一次性发送出去。
38+
> 3. 在接收端进行优化,这个优化的算法叫做**延时 ACK**。延时 ACK 在收到数据后并不马上回复,而是累计需要发送的 ACK 报文,等到有数据需要发送给对端时,将累计的 ACK捎带一并发送出去。当然,延时 ACK 机制,不能无限地延时下去,否则发送端误认为数据包没有发送成功,引起重传,反而会占用额外的网络带宽
39+
> 3.
40+
41+
42+
- 为什么断连要四次?
43+
> 不一定四次, 有可能第二第三次会合并, 要确认双方的可靠传输, 可靠传输 , 其中包括不影响原有的业务, 客户端, 服务端都需要一来一回的确认收发没问题, 才关闭
44+
45+
-
46+
47+
- TCP协议切片
48+
- 流量控制机制
49+
> 发送窗口反应了作为单 TCP 连接、点对点之间的流量控制模型,它是需要和接收端一起共同协调来调整大小的;而拥塞窗口则是反应了作为多个 TCP 连接共享带宽的拥塞控制模型,它是发送端独立地根据网络状况来动态调整的
50+
> 在任何一个时刻,TCP 发送缓冲区的数据是否能真正发送出去,至少取决于两个因素,一个是当前的发送窗口大小,另一个是拥塞窗口大小,而 TCP 协议中总是取两者中最小值作为判断依据
51+
52+
53+
- 滑动窗口为0时怎么办?
54+
> 如果在PT超时之前没有接收到B window更新,则定时器触发,动作为
55+
> 1)发送一个byte 合法数据(滑动窗口内)或非法数据(滑动窗口外)
56+
> 2)刷新定时器
57+
> 3)记录超时次数
58+
> 如果超时次数到达极限,则事件触发,动作为
59+
> 1)reset 或关闭TCP连接
60+
> 2)通知应用层出错原因
61+
62+
63+
- TCP首部结构
64+
- TCP怎么保证可靠性?(控制包大小、包序号、校验和、接收端丢弃重复数据、流量控制、拥塞控制、ARQ协议、超时重传)
65+
- seq为何要各自保存?ack的计算方法?
66+
- 第三次握手失败了怎么办?
67+
- UDP和TCP的区别
68+
- 如何改造UDP,确保数据有序?
69+
- 什么是多路复用?
70+
-
71+
72+
73+
极客时间
74+
75+
- 一段数据流从客户端到服务端, 总共拷贝了多少次?
76+
77+
如果是mmp, 0拷贝, 应该是1次? 内核到发送缓冲区, 包括服务端就2次
78+
79+
- socket的缓冲区能否搞的很大? 增加程序的吞吐量
80+

Diff for: source/about/index.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
title: 关于
3+
description: 个人简介
4+
layout: about
5+
comments: false
6+
sidebar: custom
7+
---
8+
个人详细介绍

Diff for: source/books/index.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
title: 书单
3+
layout: books
4+
comments: false
5+
sidebar: none
6+
---

Diff for: source/categories/index.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
title: 分类
3+
layout: categories
4+
comments: false
5+
---

Diff for: source/links/index.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
title: 友情链接
3+
layout: links
4+
comments: true
5+
sidebar: none
6+
---

Diff for: source/repository/index.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
title: Repositories
3+
layout: repository
4+
comments: false
5+
sidebar: none
6+
---

Diff for: source/tags/index.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
title: 标签
3+
layout: tags
4+
comments: false
5+
---

0 commit comments

Comments
 (0)