IP协议和TCP格式

4月 27, 2023 |

IP协议

	0                            15                              31
	-----------------------------------------------------------------
	|Version|HLength|   TOS         |       total length            |
	-----------------------------------------------------------------
	|       identification          |F|DF|MF| fragment offset       |
	-----------------------------------------------------------------
	|      TTL      | protocol      |       header checksum         |
	-----------------------------------------------------------------
	|                     source ip                                 |
	-----------------------------------------------------------------
	|                      destination ip                           |
	-----------------------------------------------------------------
	|                   options                    |  padding       |
	-----------------------------------------------------------------
  1. DF 不能分片,
  2. 分片的时候,前面的分组MF=1, 最后一个分组的MF=0
  3. identification 表示源报文,
  4. 分片时每个分组的相对便宜,一个单位8个字节

TCP协议

	0                            15                              31
	-----------------------------------------------------------------
	|          source port          |       destination port        |
	-----------------------------------------------------------------
	|                        sequence number                        |
	-----------------------------------------------------------------
	|                     acknowledgment number                     |
	-----------------------------------------------------------------
	|  HL   | rsvd  |C|E|U|A|P|R|S|F|        window size            |
	-----------------------------------------------------------------
	|         TCP checksum          |       urgent pointer          |
	-----------------------------------------------------------------

Posted in: 面试加油站

Comments are closed.