009A-TCP基础

TCP基础
帧-类型
ip-协议
传输层-端口(应用)
TCP不能分片,ip允许分片
TCP中的MSS(不包含ip头部和tcp头部)最大段尺寸 ,TCP能承载的最大数据

MTU

MTU(1500巨型帧),属于二层以上数据大小
只有IP允许分片,TCP不能分片,二层帧也不能分片

<Huawei>dis in g0/0/0
GigabitEthernet0/0/0 current state : UP
Line protocol current state : DOWN
Description:HUAWEI, AR Series, GigabitEthernet0/0/0 Interface
Route Port,The Maximum Transmit Unit is 1500          			    #MTU
Internet protocol processing : disabled
 ---- More ----

在这里插入图片描述

[R1-GigabitEthernet0/0/0]ping ?
  STRING<1-255>  IP address or hostname of a remote system
  -a             Select source IP address, the default is the IP address of the 
                 output interface
  -c             Specify the number of echo requests to be sent, the default is 
                 5
  -d             Specify the SO_DEBUG option on the socket being used
  -f             Set Don't Fragment flag in packet (IPv4-only)
  -s             Specify the number of data bytes to be sent, the default is    
                 56bytes
  ---- More ----                                          
[R1-GigabitEthernet0/0/0]ping -f -s 1500 202.100.1.2   #ping不允许分片,大小1500,-s指的是IP承载的数据大小(不包含IP的头部)
  PING 202.100.1.2: 1501  data bytes, press CTRL_C to break
    Request time out
    Request time out
    Request time out
    Request time out
    Request time out

  --- 202.100.1.2 ping statistics ---
    5 packet(s) transmitted
    0 packet(s) received
    100.00% packet loss

[R1-GigabitEthernet0/0/0]ping  -s 1500 202.100.1.2  #ping允许分片
  PING 202.100.1.2: 1500  data bytes, press CTRL_C to break
    Reply from 202.100.1.2: bytes=1500 Sequence=1 ttl=255 time=100 ms
    Reply from 202.100.1.2: bytes=1500 Sequence=2 ttl=255 time=30 ms
    Reply from 202.100.1.2: bytes=1500 Sequence=3 ttl=255 time=30 ms
    Reply from 202.100.1.2: bytes=1500 Sequence=4 ttl=255 time=30 ms
    Reply from 202.100.1.2: bytes=1500 Sequence=5 ttl=255 time=40 ms

  --- 202.100.1.2 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 30/46/100 ms

在AR1的g0/0/0口抓取ping -s 1500 202.100.1.2的报文

在这里插入图片描述在这里插入图片描述

ICMP消息封装格式,如下图

在这里插入图片描述

[R1-GigabitEthernet0/0/0]ping -f -s 1472 202.100.1.2
  PING 202.100.1.2: 1472  data bytes, press CTRL_C to break
    Reply from 202.100.1.2: bytes=1472 Sequence=1 ttl=255 time=20 ms
    Reply from 202.100.1.2: bytes=1472 Sequence=2 ttl=255 time=20 ms
    Reply from 202.100.1.2: bytes=1472 Sequence=3 ttl=255 time=10 ms
    Reply from 202.100.1.2: bytes=1472 Sequence=4 ttl=255 time=20 ms
    Reply from 202.100.1.2: bytes=1472 Sequence=5 ttl=255 time=20 ms

  --- 202.100.1.2 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 10/18/20 ms

在这里插入图片描述

MSS

在这里插入图片描述
head length=固定长度20+options的12=32

TCP

TCP头部

在这里插入图片描述

TCP的三次握手和4次挥手

在这里插入图片描述

  • TCP通过三次握手建立可靠连接
    小写的ack是acknowledge number
    三次建立过程解释,以打电话比喻,张三(a)想和李四(b)打电话
    1、a问b能听到?
    2、b回答我可以听到你说话,你能听到我说话吗?
    3、a回答我可以听到
    双方互相确认可以听到,于是可以通信了

在这里插入图片描述

  • 主机在关闭连接之前,要确认收到来自对方的ACK
    4次挥手
    1、a向b说,我要和你分手
    2、b回复说我知道了
    3、b经过一番考虑(b把自己未处理的事情处理后),向a说,我也要和你分手,请你确认
    4、a回复说,我确认,分手吧
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值