• 周二. 5月 7th, 2024

5G编程聚合网

5G时代下一个聚合的编程学习网

热门标签

TCPIP | 以太网和IP协议

admin

11月 28, 2021

链路层协议

  1. 802.3

  2. 以太网协议(常用)(RFC894)

    目的地址(6bytes)+源地址(6bytes)+类型(2bytes)+【数据(46-1500bytes)】+CRC(4bytes)

    类型:

    0800 -> IP数据报

    0806 -> ARP请求应答

    8035 -> RARP请求应答

MTU(最大传输单元)

IP

# windows
netstat -an
netstat -r 查看路由表
# linux
ifconfig eth0 1.2.3.4 netmask 255.255.255.0

ip头部

最大长度60bytes

基本的头部长度是20bytes,可以加40bytes的选项。

4bit 版本号	4bit 首部长度
8bit 服务类型(基本没用,看路由器)
16bit 总长度(字节数)
16bit 标识(用于分辨这是哪个数据包,因为可能存在分片)
3bit 标志(第一个位df是如果包大小大于MTU就直接丢弃,然后说明原因;第二个位mf是还有more包,用于分片)	13bit 片偏移(用于组装包)
8bit 生存时间(TTL,每过一个路由--)
8bit协议 用于内容是什么协议(ICMP、TCP、UDP等等)
16bit 首部校验和
32bit 源ip	32bit 目的ip
[最大40bytes的选项]

协议(8bit):

  1. icmp – 1
  2. tcp – 6
  3. udp – 17

特殊的ip地址

  1. 0.0.0.0 可以为源,不能为目的(例:DHCP(udp))
  2. 127.xx.xx.xx 环回地址
  3. 255.255.255.255 受限的广播
  4. 一些奇怪的广播,主机号都是255

本文来自博客园,作者:Mz1,转载请注明原文链接:https://www.cnblogs.com/Mz1-rc/p/15089773.html

《TCPIP | 以太网和IP协议》有一个想法
  1. How to track the location of the other person’s phone without their knowledge? You will be able to track and monitor text messages, phone calls, location history and much more. Free Remote Tracking and Recording of Husband’s Phone Cell Phone Spy. Best Apps to Download for Free to Spy on Another Phone. https://www.xtmove.com/

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注