当前位置:网站首页>LCP plug-in creates peer-to-peer physical interface
LCP plug-in creates peer-to-peer physical interface
2022-07-25 05:20:00 【redwingz】
Create a physical interface as follows GigabitEthernet7/0/0 Peer to peer interface of e7.
vpp# show interface GigabitEthernet7/0/0
Name Idx State MTU (L3/IP4/IP6/MPLS) Counter Count
GigabitEthernet7/0/0 10 down 9000/0/0/0
vpp#
vpp# lcp create GigabitEthernet7/0/0 host-if e7
vpp#
vpp# show tap
Interface: tap10 (ifindex 17)
name "e7"
host-mtu-size "9000"
host-mac-addr: 00:60:e0:6f:5a:f0
Create physical interfaces GigabitEthernet8/0/0 Peer to peer interface of e8, And the interface status is set to UP,MTU Set to 1500( The default is 9000). Peer interface MAC Address and actual physical interface MAC The address is the same .
vpp# show interface GigabitEthernet8/0/0
Name Idx State MTU (L3/IP4/IP6/MPLS) Counter Count
GigabitEthernet8/0/0 11 down 9000/0/0/0
vpp#
vpp#
vpp# set interface state GigabitEthernet8/0/0 up
vpp# set interface mtu packet 1500 GigabitEthernet8/0/0
vpp#
vpp# lcp create GigabitEthernet8/0/0 host-if e8
vpp#
vpp# show tap
Interface: tap11 (ifindex 18)
name "e8"
host-mtu-size "1500"
host-mac-addr: 00:60:e0:6f:5a:f1
LCP Command to view interface pairs .
vpp# show lcp
lcp default netns '<unset>'
lcp lcp-auto-subint off
lcp lcp-sync off
itf-pair: [0] GigabitEthernet7/0/0 tap10 e7 18 type tap
itf-pair: [1] GigabitEthernet8/0/0 tap11 e8 19 type tap
sign out VPP Command line , stay Linux shell View the two created tap Interface ,e7 Of mtu by 9000, Status as down. Interface e8 Of mtu by 1500, Status as up. also , Interface e7 and e8 Of MAC Address and VPP The interface GigabitEthernet7/0/0 and GigabitEthernet8/0/0 Of MAC The address is the same .
$ ip link show type tun
18: e7: <BROADCAST,MULTICAST> mtu 9000 qdisc mq state DOWN mode DEFAULT group default qlen 1000
link/ether 00:60:e0:6f:5a:f0 brd ff:ff:ff:ff:ff:ff
19: e8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UNKNOWN mode DEFAULT group default qlen 1000
link/ether 00:60:e0:6f:5a:f1 brd ff:ff:ff:ff:ff:ff
Manage state synchronization
LCP Interface management status synchronization switch .
vpp# lcp lcp-sync on
vpp#
vpp# show lcp
lcp lcp-sync on
Here is VPP Lieutenant general GigabitEthernet7/0/0 The interface status is set to UP,linux Peer interface in e7 The status is also synchronized to UP.
vpp# set interface state GigabitEthernet7/0/0 up
vpp# quit
#
#
# ip link show type tun
18: e7: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 9000 qdisc mq state DOWN mode DEFAULT group default qlen 1000
link/ether 00:60:e0:6f:5a:f0 brd ff:ff:ff:ff:ff:ff
The interface link status is not limited by the above switches . Disconnect the physical interface GigabitEthernet8/0/0 The Internet cable ,VPP and linux Medium e8 The link state of the interface is DOWN.
# ip link show type tun
19: e8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UNKNOWN mode DEFAULT group default qlen 1000
link/ether 00:60:e0:6f:5a:f1 brd ff:ff:ff:ff:ff:ff
#
#
# vppctl
vpp#
vpp# show hardware-interfaces GigabitEthernet8/0/0
Name Idx Link Hardware
GigabitEthernet8/0/0 11 down GigabitEthernet8/0/0
vpp#
vpp# quit
#
# ip link show type tun
19: e8: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
link/ether 00:60:e0:6f:5a:f1 brd ff:ff:ff:ff:ff:ff
Set interface IP Address
VPP Physical interface and linux Medium peer interface e8 Set exactly the same IP Address .
vpp# set interface ip address GigabitEthernet8/0/0 10.0.1.1/24
vpp# quit
vpp#
#
# ip addr add dev e8 10.0.1.1/24
stay linux in ping External host 10.0.1.2.
# ping 10.0.1.2
PING 10.0.1.2 (10.0.1.2) 56(84) bytes of data.
64 bytes from 10.0.1.2: icmp_seq=1 ttl=64 time=0.290 ms
stay VPP in trace reply ICMP message , as follows :
vpp# trace add dpdk-input 100
vpp#
vpp# show trace
Packet 3
00:40:13:066975: dpdk-input
GigabitEthernet7/0/0 rx queue 0
buffer 0x82ca6: current data 0, length 98, buffer-pool 0, ref-count 1, trace handle 0x2000002
ext-hdr-valid
PKT MBUF: port 9, nb_segs 1, pkt_len 98
buf_len 2176, data_len 98, ol_flags 0x180, data_off 128, phys_addr 0x92cb2a00
packet_type 0x11 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.
Packet Types
RTE_PTYPE_L2_ETHER (0x0001) Ethernet packet
RTE_PTYPE_L3_IPV4 (0x0010) IPv4 packet without extension headers
IP4: 54:e1:ad:3f:11:f4 -> 00:60:e0:6f:5a:f0
ICMP: 10.0.1.2 -> 10.0.1.1
tos 0x00, ttl 128, length 84, checksum 0xd71b dscp CS0 ecn NON_ECN
fragment id 0x4d8b
ICMP echo_reply checksum 0xecf9 id 3
00:40:13:066978: ethernet-input
frame: flags 0x3, hw-if-index 10, sw-if-index 10
IP4: 54:e1:ad:3f:11:f4 -> 00:60:e0:6f:5a:f0
00:40:13:066980: ip4-input-no-checksum
ICMP: 10.0.1.2 -> 10.0.1.1
tos 0x00, ttl 128, length 84, checksum 0xd71b dscp CS0 ecn NON_ECN
fragment id 0x4d8b
ICMP echo_reply checksum 0xecf9 id 3
00:40:13:066980: ip4-lookup
fib 0 dpo-idx 7 flow hash: 0x00000000
ICMP: 10.0.1.2 -> 10.0.1.1
tos 0x00, ttl 128, length 84, checksum 0xd71b dscp CS0 ecn NON_ECN
fragment id 0x4d8b
ICMP echo_reply checksum 0xecf9 id 3
00:40:13:066984: ip4-receive
ICMP: 10.0.1.2 -> 10.0.1.1
tos 0x00, ttl 128, length 84, checksum 0xd71b dscp CS0 ecn NON_ECN
fragment id 0x4d8b
ICMP echo_reply checksum 0xecf9 id 3
00:40:13:066985: ip4-icmp-input
ICMP: 10.0.1.2 -> 10.0.1.1
tos 0x00, ttl 128, length 84, checksum 0xd71b dscp CS0 ecn NON_ECN
fragment id 0x4d8b
ICMP echo_reply checksum 0xecf9 id 3
00:40:13:066985: ip4-icmp-echo-reply
ICMP4 echo id 3 seq 1 (unknown)
00:40:13:066988: ip4-punt
ICMP: 10.0.1.2 -> 10.0.1.1
tos 0x00, ttl 128, length 84, checksum 0xd71b dscp CS0 ecn NON_ECN
fragment id 0x4d8b
ICMP echo_reply checksum 0xecf9 id 3
00:40:13:066988: ip4-punt-redirect
via redirect:0
00:40:13:066989: ip4-dvr-dpo
sw_if_index:17
00:40:13:066990: ip4-dvr-reinject
sw_if_index:17
00:40:13:066992: tap11-output
tap11
IP4: 54:e1:ad:3f:11:f4 -> 00:60:e0:6f:5a:f0
ICMP: 10.0.1.2 -> 10.0.1.1
tos 0x00, ttl 128, length 84, checksum 0xd71b dscp CS0 ecn NON_ECN
fragment id 0x4d8b
ICMP echo_reply checksum 0xecf9 id 3
00:40:13:066993: tap11-tx
buffer 0x82ca6: current data 0, length 98, buffer-pool 0, ref-count 1, trace handle 0x2000002
ext-hdr-valid
local dvr l2-hdr-offset 0 l3-hdr-offset 14
hdr-sz 0 l2-hdr-offset 0 l3-hdr-offset 14 l4-hdr-offset 0 l4-hdr-sz 0
IP4: 54:e1:ad:3f:11:f4 -> 00:60:e0:6f:5a:f0
ICMP: 10.0.1.2 -> 10.0.1.1
tos 0x00, ttl 128, length 84, checksum 0xd71b dscp CS0 ecn NON_ECN
fragment id 0x4d8b
ICMP echo_reply checksum 0xecf9 id 3
On receiving ICMP After replying to the message , Go through the following node node :
ip4-icmp-echo-reply -> ip4-punt -> ip4-punt-redirect -> ip4-dvr-dpo -> ip4-dvr-reinject ->tap11-output -> tap11-tx
adopt tap11-tx Send message to linux Peer interface in .
边栏推荐
- Vim查找替换及正则表达式的使用
- The second day of rhcsa summer vacation
- 服务器防护的七个建议
- Deep error
- deep报错
- 2022-07-24:以下go语言代码输出什么?A:[]int{};B:[]int(nil);C:panic;D:编译错误。 package main import ( “fmt“ ) f
- Implement is by yourself_ class
- Shenzhen on call test, subject 4 on call test, subject 3 theory, second theory on call test instructions
- Baklib: share some methods about building enterprise knowledge management (km)
- Panda3D keyboard moving scene
猜你喜欢
随机推荐
使用getifaddrs获取本机网口IP地址
学习记录[email protected]研发效能度量指标
epoll的实现原理
What content does the software test plan include and how to write it. Share test plan template
Powering 5g notebook market, Wentai technology joined the "Honghu plan"
2022-07-24:以下go语言代码输出什么?A:[]int{};B:[]int(nil);C:panic;D:编译错误。 package main import ( “fmt“ ) f
STL notes (VII): container deque
Sword finger offer II 014. anagrams in strings
nacos中哪边有这个列的sql脚本啊?
Bypass XSS filters in Web Applications
[the most comprehensive and detailed] how to design a database and table splitting scheme that can dynamically expand and shrink capacity?
[no title] 1
What should testers do if they encounter a bug that is difficult to reproduce?
Which side of Nacos has the SQL script of this column?
Preliminary understanding of Panda3D particle system
85 distributed project construction
deep报错
Win11 how to view the file explorer tab
ping命令
Ping command









