Nops Blog

Welcon,this is my personal blog


  • 首页

  • 归档

docker mtu介绍

发表于 2017-01-26 | 分类于 技术

本文所述内容是针对旧版本docker(doker 1.10版本以下不包括1.10版本)

docker mtu

By default, the Docker server creates and configures the host system’s docker0 interface as an Ethernet bridge inside the Linux kernel that can pass packets back and forth between other physical or virtual network interfaces so that they behave as a single Ethernet network.

==启动docker时==,docker服务器会在内核中创建一个docker0网卡接口作为网桥,通过此网桥,虚拟网卡和物理网卡之间可以互相传输数据包。

Docker configures docker0 with an IP address, netmask and IP allocation range. The host machine can both receive and send packets to containers connected to the bridge, and gives it an MTU – the maximum transmission unit or largest packet length that the interface will allow – of either 1,500 bytes or else a more specific value copied from the Docker host’s interface that supports its default route. These options are configurable at server startup:

具体的,docker会为docker0配置一个IP地址、子网掩码和ip地址池,物理机可以与连接到docker0的任何容器传输数据。同时设置docker0的mtu值为1500或者宿主机默认网卡的mtu值(==docker1.10以下版本==)。这些工作在docker启动时进行。

Once you have one or more containers up and running, you can confirm that Docker has properly connected them to the docker0 bridge by running the brctl command on the host machine and looking at the interfaces column of the output. Here is a host with two different containers connected:

一旦启动一个容器,docker便会将这个容器连接到docker0上。可通过sudo brctl show命令查看

1
2
3
4
$ sudo brctl show
bridge name bridge id STP enabled interfaces
docker0 8000.3a1d7362b4ee no veth65f9
vethdda6

阅读全文 »

TCP分片机制介绍

发表于 2016-12-20 | 分类于 技术

MTU,MSS概念

tcp帧

tcp协议规定的帧长度如下如所示
tcp协议帧结构
通常情况下各个帧长度如下:
以太网帧:1518bytes
网卡MTU:1500bytes
TCP最大段:1460bytes
数据在网络中传输时,长度大于MTU的包会被IP层分片传输,到达目的地后再中心组装成一个完整的包。但是ip分片存在着严重的性能问题:

  • 影响效率,消耗cpu和内存,server,router,and client都会进行分片
  • 一个ip分片丢失将导致整个TCP数据包重传(ip层提供不可靠服务,无法知晓哪个分片丢失)

因此TCP协议在TCP层,利用MSS避免数据分片问题。具体方法是:

通信双方进行三次握手传递SYN包时,将自己的最大MSS值(根据MTU值计算)写在header中,传递给对方。最终双方将选取一个最小的MSS值作为TCP层可发送的最大数据长度。这个过程叫做MSS协商

TCP的MSS只能保证通信的两端数据不会被分片,无法保证整个传输路径中数据不被分片,例如网络中的路由器。PMTUD就是为了解决这个问题的。

阅读全文 »

open-falcon架构介绍

发表于 2016-10-25 | 分类于 技术
本文主要对open-falcon的整体架构及各个主要组件进行详细的介绍。
阅读全文 »
123

Nops

世上本无事,佣人自扰之

23 日志
6 分类
33 标签
© 2018 Nops
由 Hexo 强力驱动
|
主题 — NexT.Muse v5.1.4