当前位置: 首页 > news >正文

烟台网站建设推广长沙seo结算

烟台网站建设推广,长沙seo结算,网站热力图用ps怎么做,wordpress文章函数文章目录环境流量分析Pod 间Node 到 PodPod 到 serviceNode 到 serviceNetworkPolicy理清和观测网络流量环境 可以看到,在宿主机上有到每个 pod IP 的路由指向 veth 设备 到对端节点网段的路由 指向 tunl0 下一跳 ens10 的 ip 有到本节点网段 第一个 ip 即 tunl0 的…

文章目录

  • 环境
  • 流量分析
    • Pod 间
    • Node 到 Pod
    • Pod 到 service
    • Node 到 service
    • NetworkPolicy

理清和观测网络流量

环境

在这里插入图片描述
在这里插入图片描述
可以看到,在宿主机上有到每个 pod IP 的路由指向 veth 设备
到对端节点网段的路由 指向 tunl0 下一跳 ens10 的 ip
有到本节点网段 第一个 ip 即 tunl0 的流量 指向 blackhole,丢弃

流量分析

Pod 间

  • 同 node 不同 pod 之间
    pod1 <-> pod2
  1. 在 pod1 eth0 抓包:
00:37:59.442570 32:21:45:c4:c5:d5 > ee:ee:ee:ee:ee:ee, ethertype IPv4 (0x0800), length 98: 10.244.153.204 > 10.244.153.201: ICMP echo request, id 56616, seq 1, length 64
00:37:59.442707 ee:ee:ee:ee:ee:ee > 32:21:45:c4:c5:d5, ethertype IPv4 (0x0800), length 98: 10.244.153.201 > 10.244.153.204: ICMP echo reply, id 56616, seq 1, length 64

pod1 中下一跳都是 169.254.1.1,且目的 mac 是 ee:ee:ee:ee:ee:ee
2. 在 host 端 calice0906292e2 抓包不变
3. 匹配主机路由 10.244.153.201 dev cali118af4ccd16 scope link 和 neighbor 10.244.153.201 dev calibd2348b4f67 lladdr f2:d4:17:63:9d:3d REACHABLE, 在 cali118af4ccd16 抓包

00:41:07.879975 ee:ee:ee:ee:ee:ee > f2:d4:17:63:9d:3d, ethertype IPv4 (0x0800), length 98: 10.244.153.204 > 10.244.153.201: ICMP echo request, id 56616, seq 185, length 64
00:41:07.879998 f2:d4:17:63:9d:3d > ee:ee:ee:ee:ee:ee, ethertype IPv4 (0x0800), length 98: 10.244.153.201 > 10.244.153.204: ICMP echo reply, id 56616, seq 185, length 64
  1. 在 pod2 内 eth0 抓包:
00:43:59.911019 ee:ee:ee:ee:ee:ee > f2:d4:17:63:9d:3d, ethertype IPv4 (0x0800), length 98: 10.244.153.204 > 10.244.153.201: ICMP echo request, id 56616, seq 353, length 64
00:43:59.911056 f2:d4:17:63:9d:3d > ee:ee:ee:ee:ee:ee, ethertype IPv4 (0x0800), length 98: 10.244.153.201 > 10.244.153.204: ICMP echo reply, id 56616, seq 353, length 64
  • 不同 node 上 pod 之间
    pod1 访问 pod3
    在 veth host 端抓包
20:22:47.858674 32:21:45:c4:c5:d5 > ee:ee:ee:ee:ee:ee, ethertype IPv4 (0x0800), length 98: 10.244.153.204 > 10.244.146.205: ICMP echo request, id 17555, seq 106, length 64
20:22:47.860043 ee:ee:ee:ee:ee:ee > 32:21:45:c4:c5:d5, ethertype IPv4 (0x0800), length 98: 10.244.146.205 > 10.244.153.204: ICMP echo reply, id 17555, seq 106, length 64

看 主机路由 10.244.146.192/26 via 192.168.100.112 dev tunl0 proto bird onlink 下一跳是 tunl0
在 tunl0 上抓包,没有 二层信息。

20:24:42.016898 ip: 10.244.153.204 > 10.244.146.205: ICMP echo request, id 17555, seq 220, length 64
20:24:42.022282 ip: 10.244.146.205 > 10.244.153.204: ICMP echo reply, id 17555, seq 220, length 64

在 业务网卡抓包,可以看到 mac 地址是业务网卡两个端点的 mac。外层 IP 是 业务网卡两个端点的 IP,内层是 icmp 报文。

20:25:41.151109 52:54:00:dc:c7:b4 > 52:54:00:d3:bf:21, ethertype IPv4 (0x0800), length 118: 192.168.100.111 > 192.168.100.112: 10.244.153.204 > 10.244.146.205: ICMP echo request, id 17555, seq 279, length 64
20:25:41.152198 52:54:00:d3:bf:21 > 52:54:00:dc:c7:b4, ethertype IPv4 (0x0800), length 118: 192.168.100.112 > 192.168.100.111: 10.244.146.205 > 10.244.153.204: ICMP echo reply, id 17555, seq 279, length 64

在 对面机器上的报文路径与之对称

Node 到 Pod

  • Node 到本 node 上的 pod
    在 node111 ping pod1
    在 veth host 端抓包,根据路由 10.244.153.204 dev calice0906292e2 scope link,生成报文时拿默认路由网卡的 ip 做源地址
20:15:23.174963 ee:ee:ee:ee:ee:ee > 32:21:45:c4:c5:d5, ethertype IPv4 (0x0800), length 98: 172.18.22.111 > 10.244.153.204: ICMP echo request, id 6, seq 9, length 64
20:15:23.175025 32:21:45:c4:c5:d5 > ee:ee:ee:ee:ee:ee, ethertype IPv4 (0x0800), length 98: 10.244.153.204 > 172.18.22.111: ICMP echo reply, id 6, seq 9, length 64

在 veth 内 eth0 抓包

20:18:23.399015 ee:ee:ee:ee:ee:ee > 32:21:45:c4:c5:d5, ethertype IPv4 (0x0800), length 98: 172.18.22.111 > 10.244.153.204: ICMP echo request, id 6, seq 185, length 64
20:18:23.399049 32:21:45:c4:c5:d5 > ee:ee:ee:ee:ee:ee, ethertype IPv4 (0x0800), length 98: 10.244.153.204 > 172.18.22.111: ICMP echo reply, id 6, seq 185, length 64
  • Node 到其他 node 上的 pod
    node111 到 pod3
    在 node111 tunl0 抓包,根据路由 10.244.146.192/26 via 192.168.100.112 dev tunl0 proto bird onlink,源 IP 为 tunl0 ip
21:10:02.099557 ip: 10.244.153.192 > 10.244.146.205: ICMP echo request, id 11, seq 46, length 64
21:10:02.100595 ip: 10.244.146.205 > 10.244.153.192: ICMP echo reply, id 11, seq 46, length 64

在 ens10 抓包

21:10:18.124555 52:54:00:dc:c7:b4 > 52:54:00:d3:bf:21, ethertype IPv4 (0x0800), length 118: 192.168.100.111 > 192.168.100.112: 10.244.153.192 > 10.244.146.205: ICMP echo request, id 11, seq 62, length 64
21:10:18.129910 52:54:00:d3:bf:21 > 52:54:00:dc:c7:b4, ethertype IPv4 (0x0800), length 118: 192.168.100.112 > 192.168.100.111: 10.244.146.205 > 10.244.153.192: ICMP echo reply, id 11, seq 62, length 64

Pod 到 service

# kubectl get svc
NAME            TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)    AGE
nginx-service   ClusterIP   10.107.161.255   <none>        8080/TCP   2s
# kubectl get endpoints
NAME            ENDPOINTS                             AGE
nginx-service   10.244.146.205:80,10.244.153.201:80   5s
  • Pod 访问 service clusterIP
    在 pod1 veth 对抓包,目的地之为 svcIP
21:27:42.690221 32:21:45:c4:c5:d5 > ee:ee:ee:ee:ee:ee, ethertype IPv4 (0x0800), length 74: 10.244.153.204.38610 > 10.107.161.255.8080: Flags [S], seq 4133783852, win 64800, options [mss 1440,sackOK,TS val 3911662959 ecr 0,nop,wscale 7], length 0
21:27:42.690427 ee:ee:ee:ee:ee:ee > 32:21:45:c4:c5:d5, ethertype IPv4 (0x0800), length 74: 10.107.161.255.8080 > 10.244.153.204.38610: Flags [S.], seq 86025828, ack 4133783853, win 64260, options [mss 1440,sackOK,TS val 1534565294 ecr 3911662959,nop,wscale 7], length 0

在 pod2 veth 对抓包,源地址为 主机默认路由网卡 ip,目的地址为 pod2,目的端口为 80

21:27:42.690366 ee:ee:ee:ee:ee:ee > 2a:e7:de:3f:09:fb, ethertype IPv4 (0x0800), length 74: 10.244.153.204.38610 > 10.244.153.201.80: Flags [S], seq 4133783852, win 64800, options [mss 1440,sackOK,TS val 3911662959 ecr 0,nop,wscale 7], length 0
21:27:42.690404 2a:e7:de:3f:09:fb > ee:ee:ee:ee:ee:ee, ethertype IPv4 (0x0800), length 74: 10.244.153.201.80 > 10.244.153.204.38610: Flags [S.], seq 86025828, ack 4133783853, win 64260, options [mss 1440,sackOK,TS val 1534565294 ecr 3911662959,nop,wscale 7], length 0

去 service dnat 成后端 IP 转到 pod2,pod2 回复 pod1,再 snat 成 svcIP。
后端为 跨节点的 pod3 和上面相同

Node 到 service

  • Node 访问 service clusterIP
    本节点 pod 时
    Dnat 成 pod2 ip,根据默认路由网卡 IP,构造报文
22:07:10.054483 ee:ee:ee:ee:ee:ee > 2a:e7:de:3f:09:fb, ethertype IPv4 (0x0800), length 74: 172.18.22.111.13579 > 10.244.153.201.80: Flags [S], seq 948451555, win 65495, options [mss 65495,sackOK,TS val 519032124 ecr 0,nop,wscale 7], length 0
22:07:10.054534 2a:e7:de:3f:09:fb > ee:ee:ee:ee:ee:ee, ethertype IPv4 (0x0800), length 74: 10.244.153.201.80 > 172.18.22.111.13579: Flags [S.], seq 2350447822, ack 948451556, win 64260, options [mss 1440,sackOK,TS val 319012716 ecr 519032124,nop,wscale 7], length 0

跨节点 pod 时
Dnat 成 pod3 ip,根据路由用 node111 ippool 的 网关去请求

22:07:19.881187 ee:ee:ee:ee:ee:ee > 4e:11:e1:74:9d:6c, ethertype IPv4 (0x0800), length 74: 10.244.153.192.14543 > 10.244.146.205.http: Flags [S], seq 1990644142, win 65495, options [mss 65495,sackOK,TS val 519041957 ecr 0,nop,wscale 7], length 0
22:07:19.881227 4e:11:e1:74:9d:6c > ee:ee:ee:ee:ee:ee, ethertype IPv4 (0x0800), length 74: 10.244.146.205.http > 10.244.153.192.14543: Flags [S.], seq 2030705031, ack 1990644143, win 64260, options [mss 1440,sackOK,TS val 1033275778 ecr 519041957,nop,wscale 7], length 0

外部到 svc
default nginx-service NodePort 10.107.161.255 8080:30080/TCP
在主机被访问 IP 网卡抓包

22:13:00.656471 ac:7e:8a:6c:41:c4 > 52:54:00:ba:dc:62, ethertype IPv4 (0x0800), length 149: 172.20.151.77.47334 > 172.18.22.111.30080: Flags [P.], seq 1:84, ack 1, win 229, options [nop,nop,TS val 430411787 ecr 1033616455], length 83
22:13:00.657729 52:54:00:ba:dc:62 > ac:7e:8a:6c:41:c4, ethertype IPv4 (0x0800), length 66: 172.18.22.111.30080 > 172.20.151.77.47334: Flags [.], ack 84, win 502, options [nop,nop,TS val 1033616544 ecr 430411787], length 
Chain KUBE-NODE-PORT (1 references)
target     prot opt source               destination         
KUBE-MARK-MASQ  tcp  --  0.0.0.0/0            0.0.0.0/0            /* Kubernetes nodeport TCP port for masquerade purpose */ match-set KUBE-NODE-PORT-TCP dst

Masquerade 转为

22:15:32.507099 ee:ee:ee:ee:ee:ee > 2a:e7:de:3f:09:fb, ethertype IPv4 (0x0800), length 74: 172.18.22.111.10229 > 10.244.153.201.80: Flags [S], seq 450784444, win 29200, options [mss 1460,sackOK,TS val 430563700 ecr 0,nop,wscale 7], length 0
22:15:32.507198 2a:e7:de:3f:09:fb > ee:ee:ee:ee:ee:ee, ethertype IPv4 (0x0800), length 74: 10.244.153.201.80 > 172.18.22.111.10229: Flags [S.], seq 3057963543, ack 450784445, win 64260, options [mss 1440,sackOK,TS val 319515169 ecr 430563700,nop,wscale 7], length 0

如果 后端不在本节点
Masquerade 转为

22:31:15.850370 ee:ee:ee:ee:ee:ee > 4e:11:e1:74:9d:6c, ethertype IPv4 (0x0800), length 74: 10.244.153.192.50499 > 10.244.146.205.http: Flags [S], seq 1374007914, win 29200, options [mss 1460,sackOK,TS val 431507052 ecr 0,nop,wscale 7], length 0
22:31:15.850422 4e:11:e1:74:9d:6c > ee:ee:ee:ee:ee:ee, ethertype IPv4 (0x0800), length 74: 10.244.146.205.http > 10.244.153.192.50499: Flags [S.], seq 3861438831, ack 1374007915, win 64260, options [mss 1440,sackOK,TS val 1034711747 ecr 431507052,nop,wscale 7], length 0

NetworkPolicy

为 pod1 打上 role == pod1
为 pod2,pod3 打上 app == nginx

apiVersion: projectcalico.org/v3
kind: NetworkPolicy
metadata:name: allow-tcp-80namespace: default
spec:selector: app == 'nginx'ingress:- action: Allowprotocol: TCPsource:selector: role == 'pod1'destination:ports:- 80

应用后查看 iptables 流程

# iptables -nL
Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         
cali-OUTPUT  all  --  0.0.0.0/0            0.0.0.0/0            /* cali:tVnHkvAo15HuiPy0 */
// 下的是 ingress,则在宿主机上看到的是 Output chain,发给 pod 时的规则Chain cali-OUTPUT (1 references)
target     prot opt source               destination         
cali-forward-endpoint-mark  all  --  0.0.0.0/0            0.0.0.0/0           [goto]  /* cali:5Z67OUUpTOM7Xa1a */ mark match ! 0x0/0xfff00000Chain cali-forward-endpoint-mark (1 references)
target     prot opt source               destination         
cali-to-wl-dispatch  all  --  0.0.0.0/0            0.0.0.0/0            /* cali:aFl0WFKRxDqj8oA6 */Chain cali-to-wl-dispatch (2 references)
target     prot opt source               destination         
cali-tw-calibd2348b4f67  all  --  0.0.0.0/0            0.0.0.0/0           [goto]  /* cali:m9Fd7J2kx1zys3Gw */Chain cali-tw-calibd2348b4f67 (1 references)
target     prot opt source               destination         
MARK       all  --  0.0.0.0/0            0.0.0.0/0            /* cali:GqobtmvaGkGX_I6Q */ /* Start of policies */ MARK and 0xfffdffff
cali-pi-_w6c3i7lsXCdtfGqcxq5  all  --  0.0.0.0/0            0.0.0.0/0            /* cali:Ew7qVfwras3_yV_L */ mark match 0x0/0x20000Chain cali-pi-_w6c3i7lsXCdtfGqcxq5 (1 references)
target     prot opt source               destination         
MARK       tcp  --  0.0.0.0/0            0.0.0.0/0            /* cali:O4FzgAjAMQ8CsxAM */ /* Policy default/default.allow-tcp-80 ingress */ match-set cali40s:SPeglQlTBmfidv00S2cBaDC src multiport dports 80 MARK or 0x10000
// 匹配策略的打 mark 0x10000 accept

文章转载自:
http://dinncosalicylate.bkqw.cn
http://dinncoophite.bkqw.cn
http://dinncovidelicet.bkqw.cn
http://dinncodecumulation.bkqw.cn
http://dinncoultracentrifugal.bkqw.cn
http://dinncobrainwork.bkqw.cn
http://dinncoequipped.bkqw.cn
http://dinncomediocritize.bkqw.cn
http://dinncoanglicanism.bkqw.cn
http://dinncogeographical.bkqw.cn
http://dinncopillow.bkqw.cn
http://dinncohysterotomy.bkqw.cn
http://dinncoscpo.bkqw.cn
http://dinncosycophantic.bkqw.cn
http://dinncowallaceism.bkqw.cn
http://dinncosled.bkqw.cn
http://dinncoalbacore.bkqw.cn
http://dinncopraiseworthy.bkqw.cn
http://dinncoumlaut.bkqw.cn
http://dinncoparamagnetic.bkqw.cn
http://dinncoaia.bkqw.cn
http://dinncoantecede.bkqw.cn
http://dinncocamorrist.bkqw.cn
http://dinncopeso.bkqw.cn
http://dinncoaujus.bkqw.cn
http://dinncooecd.bkqw.cn
http://dinncofungicide.bkqw.cn
http://dinncoaltho.bkqw.cn
http://dinncocrescive.bkqw.cn
http://dinncohenceforward.bkqw.cn
http://dinncosubinfeudation.bkqw.cn
http://dinncotelomer.bkqw.cn
http://dinncohussite.bkqw.cn
http://dinncotouchhole.bkqw.cn
http://dinncoprovocant.bkqw.cn
http://dinncosynoptical.bkqw.cn
http://dinncoexcel.bkqw.cn
http://dinncoirrationalize.bkqw.cn
http://dinncoheckelphone.bkqw.cn
http://dinncocoaly.bkqw.cn
http://dinncocalycoid.bkqw.cn
http://dinnconitrolim.bkqw.cn
http://dinncoburnoose.bkqw.cn
http://dinncohathpace.bkqw.cn
http://dinncoviper.bkqw.cn
http://dinncochicory.bkqw.cn
http://dinnconaggish.bkqw.cn
http://dinncoindestructibly.bkqw.cn
http://dinncodemark.bkqw.cn
http://dinncoepibenthos.bkqw.cn
http://dinncovoluptuous.bkqw.cn
http://dinncogladius.bkqw.cn
http://dinncologaoedic.bkqw.cn
http://dinncopvm.bkqw.cn
http://dinnconeral.bkqw.cn
http://dinncounfleshly.bkqw.cn
http://dinncochinee.bkqw.cn
http://dinncoaral.bkqw.cn
http://dinncovindaloo.bkqw.cn
http://dinncoazeotropy.bkqw.cn
http://dinncowallet.bkqw.cn
http://dinncoforatom.bkqw.cn
http://dinncoanencephalic.bkqw.cn
http://dinncoisoscope.bkqw.cn
http://dinncoorthocentre.bkqw.cn
http://dinncofirstborn.bkqw.cn
http://dinncohydropathic.bkqw.cn
http://dinncounsoldierly.bkqw.cn
http://dinncohyperspecialization.bkqw.cn
http://dinncoasynchronous.bkqw.cn
http://dinncobecalm.bkqw.cn
http://dinncogoosegirl.bkqw.cn
http://dinncohydragogue.bkqw.cn
http://dinncoinfrequent.bkqw.cn
http://dinncohomeworker.bkqw.cn
http://dinncolamp.bkqw.cn
http://dinncoscaloppine.bkqw.cn
http://dinncosemifabricated.bkqw.cn
http://dinncoaegeus.bkqw.cn
http://dinncostalactiform.bkqw.cn
http://dinncobiliteral.bkqw.cn
http://dinncophilosophic.bkqw.cn
http://dinncocaucasus.bkqw.cn
http://dinncoaugustan.bkqw.cn
http://dinncomayest.bkqw.cn
http://dinncoovibovine.bkqw.cn
http://dinncodetritivorous.bkqw.cn
http://dinncomartyr.bkqw.cn
http://dinncomisfire.bkqw.cn
http://dinncounavoidably.bkqw.cn
http://dinncoslumbrous.bkqw.cn
http://dinncoichthyography.bkqw.cn
http://dinncolestobiosis.bkqw.cn
http://dinncosaddlebag.bkqw.cn
http://dinncoojt.bkqw.cn
http://dinncoroadsigns.bkqw.cn
http://dinncotemper.bkqw.cn
http://dinncoiosb.bkqw.cn
http://dinncoinformosome.bkqw.cn
http://dinncogalatians.bkqw.cn
http://www.dinnco.com/news/109813.html

相关文章:

  • 做网站的语言做网站的公司
  • 帮企业建网站步骤网站推广优化技巧
  • 为赌博网站做推广合肥seo优化排名公司
  • 珠海网站开发定制武汉网站维护公司
  • 虚拟机做网站如何做企业产品推广
  • 给公司做网站的费用入什么科目seo云优化是什么意思
  • 做一网站重庆seo整站优化外包服务
  • 销售公司怎么做网站nba实力榜最新排名
  • 炫酷的移动端网站设计住房和城乡建设部
  • 做视频网站需要什么职位工作武汉网站设计
  • 做视频网站带宽要求推送者seo
  • 导航网站备案alexa排名查询统计
  • 网站建设需要域名吗北京核心词优化市场
  • 郑州网站建设tpywlkj江阴网站制作公司
  • 莱州网站建设西安网站定制开发
  • 做响应式网站所用的代码新闻头条 今天
  • 做淘宝必备网站seo高端培训
  • 做网站域名公司广告设计与制作
  • 阳江网球场网站推广优化外链
  • 广州今日要闻最新消息seo工资待遇怎么样
  • 高端网站建设的方案百度平台电话
  • 做视频添加字幕的网站网络营销平台的主要功能
  • 外贸企业公司网站建设百度关键词权重查询
  • 做网站真的可以赚的钱吗现在最好的免费的建站平台
  • wordpress显示默认昵称关键词seo报价
  • 泰安新闻完整版郑州网站优化哪家好
  • 一起做网站郑州千锋教育学费一览表
  • 上海 宝安网站建设 网络服务所有代刷平台推广
  • 网站建设叁金手指花总7怎么进行网络推广
  • asp做的手机网站爱站工具包官网下载