当前位置:网站首页>LCP plug-in creates peer-to-peer 802.1ad interface
LCP plug-in creates peer-to-peer 802.1ad interface
2022-07-25 05:21:00 【redwingz】
First , stay VPP Create physical interfaces in GigabitEthernet8/0/0 Of 802.1ad A subinterface ,VLAN ID Designated as 2345.
vpp# create sub GigabitEthernet8/0/0 2345 dot1ad 2345 exact-match
GigabitEthernet8/0/0.2345
take 802.1ad The sub interface is set to UP state ,MTU Set to 9000,802.1ad Sub interface IP Address set to 40.0.1.1.
vpp# set interface state GigabitEthernet8/0/0.2345 up
vpp# set interface mtu packet 9000 GigabitEthernet8/0/0.2345
vpp# set interface ip address GigabitEthernet8/0/0.2345 40.0.1.1/24
LCP peer interface
LCP establish 802.1ad Peer interface of sub interface . The premise is that the physical interface has been created GigabitEthernet8/0/0 Peer to peer interface of e8.
vpp# lcp create GigabitEthernet8/0/0.2345 host-if e8.2345
vpp#
vpp# show interface
Name Idx State MTU (L3/IP4/IP6/MPLS) Counter Count
GigabitEthernet8/0/0 11 up 1500/0/0/0 rx packets 1035
GigabitEthernet8/0/0.2345 19 up 9000/0/0/0
The above operation LCP A peer-to-peer interface is created in the kernel e8.2345, As shown below .
# ip -d link show type vlan
24: [email protected]: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000
link/ether 00:60:e0:6f:5a:f1 brd ff:ff:ff:ff:ff:ff promiscuity 0 minmtu 0 maxmtu 65535
vlan protocol 802.1ad id 2345 <REORDER_HDR> addrgenmode eui64 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
Set up linux Medium peer interface e8.2345 The address of , And VPP Interface GigabitEthernet8/0/0.2345 The address is the same .
# ip link set e8.2345 up mtu 9000
# ip addr add 40.0.1.1/24 dev e8.2345
Connectivity testing
Configure on the external host 802.1ad Interface , Configure interface IP Address 40.0.1.2.
# ip link add link ens33 name ens33.2345 type vlan id 2345 proto 802.1ad
# ip link set ens33.2345 up mtu 9000
# ip address add 40.0.1.2/30 dev ens33.2345
# ip link set ens33.2345 up
#
# ip -d link show type vlan
46: [email protected]: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000
link/ether 00:60:e0:68:9f:ee brd ff:ff:ff:ff:ff:ff promiscuity 0
vlan protocol 802.1ad id 2345 <REORDER_HDR> addrgenmode eui64 numtxqueues 1 numrxqueues 1
stay VPP host linux in ping Of the above external hosts 802.1ad Address of the interface 40.0.1.2.
# ping 40.0.1.2
PING 40.0.1.2 (40.0.1.2) 56(84) bytes of data.
64 bytes from 40.0.1.2: icmp_seq=1 ttl=64 time=0.280 ms
The following is the host 40.0.1.2 reply ICMP message .
vpp# trace add dpdk-input 100
vpp# show trace
------------------- Start of thread 1 vpp_wk_0 -------------------
Packet 1
06:31:10:942744: dpdk-input
GigabitEthernet8/0/0 rx queue 0
buffer 0x877c1: current data 0, length 102, buffer-pool 0, ref-count 1, trace handle 0x1000000
ext-hdr-valid
PKT MBUF: port 10, nb_segs 1, pkt_len 102
buf_len 2176, data_len 102, ol_flags 0x180, data_off 128, phys_addr 0x8efdf0c0
packet_type 0x0 l2_len 0 l3_len 0 outer_l2_len 0 outer_l3_len 0
rss 0x0 fdir.hi 0x0 fdir.lo 0x0
Packet Offload Flags
PKT_RX_IP_CKSUM_GOOD (0x0080) IP cksum of RX pkt. is valid
PKT_RX_IP_CKSUM_NONE (0x0090) no IP cksum of RX pkt.
PKT_RX_L4_CKSUM_GOOD (0x0100) L4 cksum of RX pkt. is valid
PKT_RX_L4_CKSUM_NONE (0x0108) no L4 cksum of RX pkt.
IP4: 00:60:e0:68:9f:ee -> 00:60:e0:6f:5a:f1 802.1ad vlan 2345
ICMP: 40.0.1.2 -> 40.0.1.1
tos 0x00, ttl 64, length 84, checksum 0x2e4f dscp CS0 ecn NON_ECN
fragment id 0xfa57
ICMP echo_request checksum 0x5819 id 4352
06:31:10:942748: ethernet-input
frame: flags 0x3, hw-if-index 11, sw-if-index 11
IP4: 00:60:e0:68:9f:ee -> 00:60:e0:6f:5a:f1 802.1ad vlan 2345
06:31:10:942749: ip4-input
ICMP: 40.0.1.2 -> 40.0.1.1
tos 0x00, ttl 64, length 84, checksum 0x2e4f dscp CS0 ecn NON_ECN
fragment id 0xfa57
ICMP echo_request checksum 0x5819 id 4352
06:31:10:942750: ip4-lookup
fib 0 dpo-idx 9 flow hash: 0x00000000
ICMP: 40.0.1.2 -> 40.0.1.1
tos 0x00, ttl 64, length 84, checksum 0x2e4f dscp CS0 ecn NON_ECN
fragment id 0xfa57
ICMP echo_request checksum 0x5819 id 4352
06:31:10:942751: ip4-receive
ICMP: 40.0.1.2 -> 40.0.1.1
tos 0x00, ttl 64, length 84, checksum 0x2e4f dscp CS0 ecn NON_ECN
fragment id 0xfa57
ICMP echo_request checksum 0x5819 id 4352
06:31:10:942751: ip4-icmp-input
ICMP: 40.0.1.2 -> 40.0.1.1
tos 0x00, ttl 64, length 84, checksum 0x2e4f dscp CS0 ecn NON_ECN
fragment id 0xfa57
ICMP echo_request checksum 0x5819 id 4352
06:31:10:942751: ip4-icmp-echo-request
ICMP: 40.0.1.2 -> 40.0.1.1
tos 0x00, ttl 64, length 84, checksum 0x2e4f dscp CS0 ecn NON_ECN
fragment id 0xfa57
ICMP echo_request checksum 0x5819 id 4352
06:31:10:942752: ip4-load-balance
fib 0 dpo-idx 15 flow hash: 0x00000000
ICMP: 40.0.1.1 -> 40.0.1.2
tos 0x00, ttl 64, length 84, checksum 0x0cda dscp CS0 ecn NON_ECN
fragment id 0x1bcd
ICMP echo_reply checksum 0x6019 id 4352
06:31:10:942752: ip4-rewrite
tx_sw_if_index 19 dpo-idx 15 : ipv4 via 40.0.1.2 GigabitEthernet8/0/0.2345: mtu:9000 next:6 flags:[] 0060e0689fee0060e06f5af188a809290800 flow hash: 0x00000000
00000000: 0060e0689fee0060e06f5af188a809290800450000541bcd000040010cda2800
00000020: 01012800010200006019110020004aae664900000000b9ee04000000
06:31:10:942753: GigabitEthernet8/0/0-output
GigabitEthernet8/0/0.2345
IP4: 00:60:e0:6f:5a:f1 -> 00:60:e0:68:9f:ee 802.1ad vlan 2345
ICMP: 40.0.1.1 -> 40.0.1.2
tos 0x00, ttl 64, length 84, checksum 0x0cda dscp CS0 ecn NON_ECN
fragment id 0x1bcd
ICMP echo_reply checksum 0x6019 id 4352
06:31:10:942753: GigabitEthernet8/0/0-tx
GigabitEthernet8/0/0 tx queue 1
buffer 0x877c1: current data 0, length 102, buffer-pool 0, ref-count 1, trace handle 0x1000000
ext-hdr-valid
vlan-1-deep local l2-hdr-offset 0 l3-hdr-offset 18
PKT MBUF: port 10, nb_segs 1, pkt_len 102
buf_len 2176, data_len 102, ol_flags 0x180, data_off 128, phys_addr 0x8efdf0c0
packet_type 0x0 l2_len 0 l3_len 0 outer_l2_len 0 outer_l3_len 0
rss 0x0 fdir.hi 0x0 fdir.lo 0x0
Packet Offload Flags
PKT_RX_IP_CKSUM_GOOD (0x0080) IP cksum of RX pkt. is valid
PKT_RX_IP_CKSUM_NONE (0x0090) no IP cksum of RX pkt.
PKT_RX_L4_CKSUM_GOOD (0x0100) L4 cksum of RX pkt. is valid
PKT_RX_L4_CKSUM_NONE (0x0108) no L4 cksum of RX pkt.
IP4: 00:60:e0:6f:5a:f1 -> 00:60:e0:68:9f:ee 802.1ad vlan 2345
ICMP: 40.0.1.1 -> 40.0.1.2
tos 0x00, ttl 64, length 84, checksum 0x0cda dscp CS0 ecn NON_ECN
fragment id 0x1bcd
ICMP echo_reply checksum 0x6019 id 4352
Grab the message from the external host , as follows , The Ethernet type is 802.1ad type 0x88a8,vlan id The value is 2345.
# tcpdump -i ens33 -env
tcpdump: listening on ens33, link-type EN10MB (Ethernet), capture size 262144 bytes
09:55:47.921391 00:60:e0:68:9f:ee > 00:60:e0:6f:5a:f1,
ethertype 802.1Q-QinQ (0x88a8), length 102: vlan 2345, p 0,
ethertype IPv4, (tos 0x0, ttl 64, id 1147, offset 0, flags [none], proto ICMP (1), length 84)
40.0.1.2 > 40.0.1.1: ICMP echo request, id 4608, seq 0, length 64
09:55:47.921461 00:60:e0:6f:5a:f1 > 00:60:e0:68:9f:ee,
ethertype 802.1Q (0x8100), length 102: vlan 2345, p 0,
ethertype IPv4, (tos 0x0, ttl 64, id 50901, offset 0, flags [none], proto ICMP (1), length 84)
40.0.1.1 > 40.0.1.2: ICMP echo reply, id 4608, seq 0, length 64
To configure 802.1.ad QinQ Interface
Here is VPP Middle configuration QinQ Interface , Internal agreements 802.1q,VLAN id by 1000, external ID by 2345, Configure interface IP Address 50.0.1.1.
vpp# create sub GigabitEthernet8/0/0 1237 dot1ad 2345 inner-dot1q 1000 exact-match
GigabitEthernet8/0/0.1237
vpp#
vpp# set interface state GigabitEthernet8/0/0.1237 up
vpp# set interface mtu packet 9000 GigabitEthernet8/0/0.1237
vpp# set interface ip address GigabitEthernet8/0/0.1237 50.0.1.1/24
LCP Create a peer interface e8.1237.
vpp# lcp create GigabitEthernet8/0/0.1237 host-if e8.1237
vpp#
vpp# show lcp
lcp lcp-auto-subint off
lcp lcp-sync on
itf-pair: [0] GigabitEthernet7/0/0 tap10 e7 18 type tap
itf-pair: [1] GigabitEthernet8/0/0 tap11 e8 19 type tap
itf-pair: [2] GigabitEthernet8/0/0.2345 tap11.2345 e8.2345 24 type tap
itf-pair: [3] GigabitEthernet8/0/0.1237 tap11.1237 e8.1237 25 type tap
take Linux peer interface e8.1237 Address set to 50.0.1.1.
# ip address add 50.0.1.1/24 dev e8.1237
#
# ip -d address show type vlan
24: [email protected]: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 00:60:e0:6f:5a:f1 brd ff:ff:ff:ff:ff:ff promiscuity 0 minmtu 0 maxmtu 65535
vlan protocol 802.1ad id 2345 <REORDER_HDR> numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
inet 40.0.1.1/30 scope global e8.2345
25: [email protected]: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 00:60:e0:6f:5a:f1 brd ff:ff:ff:ff:ff:ff promiscuity 0 minmtu 0 maxmtu 65535
vlan protocol 802.1Q id 1000 <REORDER_HDR> numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
inet 50.0.1.1/24 scope global e8.1237
External host QinQ To configure
external Ubuntu Host configuration . Create inner layer 802.1Q A subinterface , To configure IP Address 50.0.1.2.
# ip link add link ens33.2345 name ens33.2347 type vlan id 1000 proto 802.1q
#
# ip address add 50.0.1.2/24 dev ens33.2347
# ip link set ens33.2347 up
#
# ip address show type vlan
46: [email protected]: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 00:60:e0:68:9f:ee brd ff:ff:ff:ff:ff:ff
inet 40.0.1.2/30 scope global ens33.2345
47: [email protected]: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 00:60:e0:68:9f:ee brd ff:ff:ff:ff:ff:ff
inet 50.0.1.2/24 scope global ens33.2347
QinQ Connectivity testing
The outer layer of the message QinQ type 0x88a8,vlan id by 2345; Message inner layer 802.1Q type 0x8100,vlan id by 1000. The message captured in the external host is as follows :
# tcpdump -i ens33 -env
tcpdump: listening on ens33, link-type EN10MB (Ethernet), capture size 262144 bytes
10:36:56.991886 00:60:e0:68:9f:ee > 00:60:e0:6f:5a:f1,
ethertype 802.1Q-QinQ (0x88a8), length 106: vlan 2345, p 0, ethertype 802.1Q, vlan 1000, p 0,
ethertype IPv4, (tos 0x0, ttl 64, id 17581, offset 0, flags [none], proto ICMP (1), length 84)
50.0.1.2 > 50.0.1.1: ICMP echo request, id 5632, seq 0, length 64
10:36:56.991968 00:60:e0:6f:5a:f1 > 00:60:e0:68:9f:ee,
ethertype 802.1Q (0x8100), length 106: vlan 2345, p 0, ethertype 802.1Q, vlan 1000, p 0,
ethertype IPv4, (tos 0x0, ttl 64, id 61447, offset 0, flags [none], proto ICMP (1), length 84)
50.0.1.1 > 50.0.1.2: ICMP echo reply, id 5632, seq 0, length 64
The following is the external host 50.0.1.2 reply ICMP message .
vpp# trace add dpdk-input 100
vpp#
vpp#
vpp# show trace
------------------- Start of thread 1 vpp_wk_0 -------------------
Packet 1
07:19:50:500241: dpdk-input
GigabitEthernet8/0/0 rx queue 0
buffer 0x87aa6: current data 0, length 106, buffer-pool 0, ref-count 1, trace handle 0x1000000
ext-hdr-valid
PKT MBUF: port 10, nb_segs 1, pkt_len 106
buf_len 2176, data_len 106, ol_flags 0x180, data_off 128, phys_addr 0x8efeaa00
packet_type 0x0 l2_len 0 l3_len 0 outer_l2_len 0 outer_l3_len 0
rss 0x0 fdir.hi 0x0 fdir.lo 0x0
Packet Offload Flags
PKT_RX_IP_CKSUM_GOOD (0x0080) IP cksum of RX pkt. is valid
PKT_RX_IP_CKSUM_NONE (0x0090) no IP cksum of RX pkt.
PKT_RX_L4_CKSUM_GOOD (0x0100) L4 cksum of RX pkt. is valid
PKT_RX_L4_CKSUM_NONE (0x0108) no L4 cksum of RX pkt.
IP4: 00:60:e0:68:9f:ee -> 00:60:e0:6f:5a:f1 802.1ad vlan 2345 802.1ad vlan 1000
ICMP: 50.0.1.2 -> 50.0.1.1
tos 0x00, ttl 64, length 84, checksum 0x9eff dscp CS0 ecn NON_ECN
fragment id 0x75a7
ICMP echo_request checksum 0xa766 id 5888
07:19:50:500247: ethernet-input
frame: flags 0x3, hw-if-index 11, sw-if-index 11
IP4: 00:60:e0:68:9f:ee -> 00:60:e0:6f:5a:f1 802.1ad vlan 2345 802.1ad vlan 1000
07:19:50:500252: ip4-input
ICMP: 50.0.1.2 -> 50.0.1.1
tos 0x00, ttl 64, length 84, checksum 0x9eff dscp CS0 ecn NON_ECN
fragment id 0x75a7
ICMP echo_request checksum 0xa766 id 5888
07:19:50:500253: ip4-lookup
fib 0 dpo-idx 8 flow hash: 0x00000000
ICMP: 50.0.1.2 -> 50.0.1.1
tos 0x00, ttl 64, length 84, checksum 0x9eff dscp CS0 ecn NON_ECN
fragment id 0x75a7
ICMP echo_request checksum 0xa766 id 5888
07:19:50:500255: ip4-receive
ICMP: 50.0.1.2 -> 50.0.1.1
tos 0x00, ttl 64, length 84, checksum 0x9eff dscp CS0 ecn NON_ECN
fragment id 0x75a7
ICMP echo_request checksum 0xa766 id 5888
07:19:50:500256: ip4-icmp-input
ICMP: 50.0.1.2 -> 50.0.1.1
tos 0x00, ttl 64, length 84, checksum 0x9eff dscp CS0 ecn NON_ECN
fragment id 0x75a7
ICMP echo_request checksum 0xa766 id 5888
07:19:50:500256: ip4-icmp-echo-request
ICMP: 50.0.1.2 -> 50.0.1.1
tos 0x00, ttl 64, length 84, checksum 0x9eff dscp CS0 ecn NON_ECN
fragment id 0x75a7
ICMP echo_request checksum 0xa766 id 5888
07:19:50:500257: ip4-load-balance
fib 0 dpo-idx 14 flow hash: 0x00000000
ICMP: 50.0.1.1 -> 50.0.1.2
tos 0x00, ttl 64, length 84, checksum 0x1523 dscp CS0 ecn NON_ECN
fragment id 0xff83
ICMP echo_reply checksum 0xaf66 id 5888
07:19:50:500258: ip4-rewrite
tx_sw_if_index 21 dpo-idx 14 : ipv4 via 50.0.1.2 GigabitEthernet8/0/0.1237: mtu:9000 next:6 flags:[] 0060e0689fee0060e06f5af188a80929810003e80800 flow hash: 0x00000000
00000000: 0060e0689fee0060e06f5af188a80929810003e8080045000054ff8300004001
00000020: 152332000101320001020000af6617000000b1b96649000000001496
07:19:50:500260: GigabitEthernet8/0/0-output
GigabitEthernet8/0/0.1237
IP4: 00:60:e0:6f:5a:f1 -> 00:60:e0:68:9f:ee 802.1ad vlan 2345 802.1ad vlan 1000
ICMP: 50.0.1.1 -> 50.0.1.2
tos 0x00, ttl 64, length 84, checksum 0x1523 dscp CS0 ecn NON_ECN
fragment id 0xff83
ICMP echo_reply checksum 0xaf66 id 5888
07:19:50:500261: GigabitEthernet8/0/0-tx
GigabitEthernet8/0/0 tx queue 1
buffer 0x87aa6: current data 0, length 106, buffer-pool 0, ref-count 1, trace handle 0x1000000
ext-hdr-valid
vlan-2-deep local l2-hdr-offset 0 l3-hdr-offset 22
PKT MBUF: port 10, nb_segs 1, pkt_len 106
buf_len 2176, data_len 106, ol_flags 0x180, data_off 128, phys_addr 0x8efeaa00
packet_type 0x0 l2_len 0 l3_len 0 outer_l2_len 0 outer_l3_len 0
rss 0x0 fdir.hi 0x0 fdir.lo 0x0
Packet Offload Flags
PKT_RX_IP_CKSUM_GOOD (0x0080) IP cksum of RX pkt. is valid
PKT_RX_IP_CKSUM_NONE (0x0090) no IP cksum of RX pkt.
PKT_RX_L4_CKSUM_GOOD (0x0100) L4 cksum of RX pkt. is valid
PKT_RX_L4_CKSUM_NONE (0x0108) no L4 cksum of RX pkt.
IP4: 00:60:e0:6f:5a:f1 -> 00:60:e0:68:9f:ee 802.1ad vlan 2345 802.1ad vlan 1000
ICMP: 50.0.1.1 -> 50.0.1.2
tos 0x00, ttl 64, length 84, checksum 0x1523 dscp CS0 ecn NON_ECN
fragment id 0xff83
ICMP echo_reply checksum 0xaf66 id 5888
边栏推荐
- Browser cache HTTP cache CDN cache localstorage / sessionstorage / cookies
- STM32 Development Notes 118: using CMSIS DSP Library in stm32cube IDE
- deep报错
- JWT(json web token)
- The second day of rhcsa summer vacation
- Which website is suitable for physical server
- LeetCode第302场周赛
- China trifluoroethanol industry research and investment forecast report (2022 Edition)
- 基于云原生的私有化 PaaS 平台交付实践
- STM32 Development Notes 121: Kalman filter I understand
猜你喜欢
[email protected]研发效能度量指标"/>学习记录[email protected]研发效能度量指标

HMS core discovery Episode 16 live broadcast preview | play AI's new "sound" state with tiger pier

ThreadLocal

The third question of force deduction -- the longest substring without repeated characters

An article takes you to understand the sentinel mode of redis

What about reinstalling win11 system?

深圳随到随考,科目四随到随考,科三理论第二理论随到随考说明

LeetCode 15:三数之和

1310_一个printf的实现分析

Implement is by yourself_ convertible
随机推荐
微服务 - 远程调用(Feign组件)
学习记录[email protected]研发效能度量指标
deep报错
Project management tool - Introduction and practice of Alibaba cloud projex
Preliminary understanding of Panda3D particle system
一篇文章带你读懂Redis的哨兵模式
LeetCode 15:三数之和
panda3d 键盘移动场景
Redis集群搭建(Windows)
使用getifaddrs获取本机网口IP地址
Pikachu vulnerability platform exercise
Performance Optimization: how to solve the slow loading speed of the first screen of spa single page application?
VPP不能加载UP状态接口
Why does the official not recommend using UUID as MySQL primary key
微服务 - 配置中心 - Nacos
Project management tools - project developer tools
An article takes you to understand the sentinel mode of redis
background
Redis的三个必知必会的问题
STL notes (IV): String