[P4] Basic L2 példa

Sandor Laki lakis at elte.hu
Tue Dec 1 11:55:46 CET 2015


Hali,

Fut a basic L2 példa. Dani tegnap esti commitja megjavította a tábla 
propagációt is.

Scenario egy gépen belül virtualizációval:

HOST-A-(empty namespace 10.0.0.3) [tapvm02]----------------[port 0] 
P4SWITCH [port 1]------------------- [tapvm03] BRIDGE 
[veth0]-----------------[veth1] HOST-A-(TESTER namespace 10.0.0.11)

HOST-A-n pingetve:
ping 10.0.0.11
PING 10.0.0.11 (10.0.0.11) 56(84) bytes of data.
64 bytes from 10.0.0.11: icmp_seq=1 ttl=64 time=2024 ms
64 bytes from 10.0.0.11: icmp_seq=2 ttl=64 time=1017 ms
64 bytes from 10.0.0.11: icmp_seq=3 ttl=64 time=9.99 ms
64 bytes from 10.0.0.11: icmp_seq=4 ttl=64 time=6.18 ms
^C
--- 10.0.0.11 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3016ms
rtt min/avg/max/mdev = 6.183/764.590/2024.645/836.110 ms, pipe 3

BRIDE-en tcpdumppal figyelve a forgalmat:
sudo tcpdump -i br1
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on br1, link-type EN10MB (Ethernet), capture size 65535 bytes
11:39:37.213751 ARP, Request who-has 10.0.0.11 tell 10.0.0.3, length 46
11:39:37.213787 ARP, Reply 10.0.0.11 is-at d2:69:0f:a8:39:9c (oui 
Unknown), length 28
11:39:37.216377 ARP, Request who-has 10.0.0.11 tell 10.0.0.3, length 46
11:39:37.216394 ARP, Reply 10.0.0.11 is-at d2:69:0f:a8:39:9c (oui 
Unknown), length 28
11:39:38.201112 ARP, Request who-has 10.0.0.11 tell 10.0.0.3, length 46
11:39:38.201134 ARP, Reply 10.0.0.11 is-at d2:69:0f:a8:39:9c (oui 
Unknown), length 28
11:39:38.219384 IP 10.0.0.3 > 10.0.0.11: ICMP echo request, id 916, seq 
1, length 64
11:39:38.219408 IP 10.0.0.11 > 10.0.0.3: ICMP echo reply, id 916, seq 1, 
length 64
11:39:38.219614 IP 10.0.0.3 > 10.0.0.11: ICMP echo request, id 916, seq 
2, length 64
11:39:38.219623 IP 10.0.0.11 > 10.0.0.3: ICMP echo reply, id 916, seq 2, 
length 64
11:39:38.219790 IP 10.0.0.3 > 10.0.0.11: ICMP echo request, id 916, seq 
3, length 64
11:39:38.219797 IP 10.0.0.11 > 10.0.0.3: ICMP echo reply, id 916, seq 3, 
length 64
11:39:39.219959 IP 10.0.0.3 > 10.0.0.11: ICMP echo request, id 916, seq 
4, length 64
11:39:39.219984 IP 10.0.0.11 > 10.0.0.3: ICMP echo reply, id 916, seq 4, 
length 64
11:39:43.224490 ARP, Request who-has 10.0.0.3 tell 10.0.0.11, length 28
11:39:43.230686 ARP, Reply 10.0.0.3 is-at 16:17:5d:1d:3e:7a (oui 
Unknown), length 46

És a p4 switch logját nézve a főbb lépések:
     :: ethernet srcaddr: 16:17:5D:1D:3E:7A
     :: ethernet dstaddr: D2:69:0F:A8:39:9C
   :::: TURNING TO TABLE smac
   :::: EXECUTING TABLE smac
lookup 0x24307f0
     :: EXECUTING ACTION mac_learn...
...
   :::: EXECUTING TABLE dmac
lookup 0x2430820
     :: EXECUTING ACTION bcast...
   :::: EGRESSING
---------------
     :: ethernet srcaddr: D2:69:0F:A8:39:9C
     :: ethernet dstaddr: 16:17:5D:1D:3E:7A
   :::: TURNING TO TABLE smac
   :::: EXECUTING TABLE smac
lookup 0x24307c0
     :: EXECUTING ACTION mac_learn...
   :::: ADD_TABLE_ENTRY
...
   :::: EXECUTING TABLE dmac
lookup 0x242e3a0
     :: EXECUTING ACTION forward...
   :::: EGRESSING
---------------
:: ethernet srcaddr: 16:17:5D:1D:3E:7A
     :: ethernet dstaddr: D2:69:0F:A8:39:9C
     :: header 0 (type=0, len=20) = 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00
     :: header 1 (type=1, len=14) = d2 69 0f a8 39 9c 16 17 5d 1d 3e 7a 
08 06
   :::: TURNING TO TABLE smac
   :::: EXECUTING TABLE smac
lookup 0x24307f0
     :: EXECUTING ACTION _nop...
   :::: EXECUTING TABLE dmac
lookup 0x242e3a0
     :: EXECUTING ACTION forward...
   :::: EGRESSING
-----------------
....

Üdv.
Sanyi

-- 
Sándor Laki, PhD
Assistant professor
Department of Information Systems
Eötvös Loránd University
Pázmány Péter stny. 1/C
H-1117, Budapest, Hungary
Room 2.506
Web: http://lakis.web.elte.hu
Phone: +36 1 372 2869 / 8477
Cell: +36 70 374 2646



More information about the P4 mailing list