背景
项目中需要测试网卡进出口数据的延时情况,要求ns级别
设备
Cisco Nexus 3548-X 交换机
设备信息
https://www.cisco.com/c/zh_cn/support/switches/nexus-3548-x-switch/model.html
测试原理
使用erspan远程镜像功能,在交换机设置一个erspan-source 镜像,通过erspan协议version3 中的硬件时间戳来计算ns级时间戳
配置
配置一个erspan-sourse的镜像
monitor session 1 type erspan-source
erspan-id 100
vrf default
destination ip 100.1.1.8 //镜像目的地址
header-type 3 //erspan version 3 只有ver3 才有硬件时间戳
source interface Ethernet1/1 both
source interface Ethernet1/2 both
no shut
monitor erspan origin ip-address 100.1.1.1 global
monitor erspan granularity ns //设置时间戳的时间粒度
将1/1和1/2的数据转发到100.1.1.8(1/4),对端可以连接交换机,或连接pc,使用tcpdump抓包
在100.1.18 机器上抓包
tcpdump -i em2 -w outfile.pcap
使用wireshark查看抓包内容