全部博文(842)
分类: LINUX
2012-03-19 12:16:48
数据包结构/操作分析
以下是sk_buff类型的定义
include/linux/skbuff.h网络层头部结构iphdr
include/linux/ip.h
|
传输层头部结构tcphdr
include/linux/tcp.h
|
传输层头部结构udphdr
include/linux/udp.h
|
icmphdr
include/linux/icmp.h
|
链路层帧格式
前导码 8 bytes | 目的mac地址 6 bytes | 源mac地址 6 bytes | 帧类型 2 bytes | 帧数据 46~1500 bytes | crc校验 4 bytes |
网络层数据包格式
4 bits | 4 bits | 8 bits | 3 bits | 13 bits |
Version | IHL | Type of Service | Total Length | |
Identification | Flags | Fragmentation Offset | ||
Time To Live | Protocol | Header Checksum | ||
Source Address | ||||
Destination Address | ||||
Options | Padding | |||
Data |
传输层数据报文格式
4 bits | 6 bits | 6 bits | 16 bits |
Source Port | Destination Port | ||
Sequence Number | |||
Acknowledge Number | |||
Data Offset | Reserved | Code | Window |
Ckecksum | Urgent Pointer | ||
Options | Padding | ||
Data |