The presentation addresses the most typical issues during network software development and testing, explains the causes and suggests solutions:
- overlapping IP networks
- invalid netmasks
- incomplete routing configuration
- incorrect local MAC addresses
- unidirectional packet generator and unicast flood
- disabled ethernet auto negotiation
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Why my network does not work? Networking Quiz 2017
1. Andriy Berestovskyy
2017
( ц ) А н д р
і й Б е р е с
т о в с ь к и
й
networking hour
TCP
UDP
NAT
IPsec
IPv4
IPv6
internet
protocolsAH
ESP
authentication
authorization
accounting
encapsulation
security
BGP
OSPF
ICMP
ACLSNAT
tunnel
PPPoE
GRE
ARP
discovery
NDP
OSI
broadcast
multicast
IGMP
PIM
MAC
DHCP
DNS
fragmentation
semihalf
berestovskyy
Why my network does not work?
Networking Quiz 2017
2. LAB
Quiz 1. Network Device Test
2
Lab Switch
Packet
Generator
DUT
LAN
Direct Link
How?
3. LAB
Network Device Test: Quiz!
3
Lab Switch
LAN
Direct Link
# ifconfig eth0 10.0.0.2/24
# ping 10.0.0.1
# ifconfig eth1 10.0.0.1/24
# ping 10.0.0.2
What’s
wrong?
21. Network System Test: Cause 2
Host 1 Routing Table:
dhclient eth0 => 10.2/16 dev eth0
=> default via 10.2.0.254
ifconfig eth1 172.16.12.1/24 => 172.16.12/24 dev eth1
How to reach 172.16.23/24?
How to reach 172.16.34/24?
21
How?
25. Network System Test: Cause 3
Host 2 Routing Table:
ifconfig eth0 127.16.23.2/24 => 172.16.23/16 dev eth0
ifconfig eth1 172.16.12.2/24 => 172.16.12/24 dev eth1
How to reach 10.2/16?
How to reach 172.16.34/24?
25
How?
26. LAB
System Test: Cause 3 Analysis
26
LAN
172.16.12/24 172.16.23/24 172.16.34/24
# ifconfig eth1
172.16.12.1/24
… eth1
172.16.12.2/24
… eth0
172.16.23.2/24
# ifconfig eth1
172.16.34.4/24
Host 1 Host 2 Host 3 Host 4
… eth0
172.16.23.3/24
… eth1
172.16.34.3/24
No route to
172.16.34/24
ping 172.16.34.4
Solutions?
27. System Test: Cause 3 Solution
Fix All Routing Tables!
27
172.16.12/24 172.16.23/24 172.16.34/24
172.16.23/24 via 172.16.12.2
172.16.34/24 via 172.16.12.2
Host 1 Host 2 Host 3 Host 4
172.16.12/24 via 172.16.34.3
172.16.23/24 via 172.16.34.3
172.16.12/24 via 172.16.23.2
default via 172.16.34.4
172.16.34/24 via 172.16.23.3
default via 172.16.12.1
4
1
1
4
Think both
directions!
28. Quiz 3. Local MAC Address
Why local MAC?
● Virtual Machine
● TUN/TAP
● NIC Virtual Function
28
More?
29. Local MAC Address: How?
29
1. ifconfig DEV hw ether MAC
2. ip link set dev DEV address MAC
3. /etc/network/interfaces (Ubuntu):
auto DEV
iface DEV inet dhcp
hwaddress ether MAC More?
32. 1. Receive frame, check Ethernet FCS
2. Add/update source MAC in MAC table
3. If multicast bit is set:
a. forward to all ports, but the source
4. If destination is in MAC table:
a. forward to the specific port
5. Else, forward to all ports
Recap: Per-VLAN Switch Logic
32
Any issues?
34. Local MAC Address: Root Cause
34
0 0
1: multicast
0201
0 0 0 0 0 1
Local MAC03 04 05 06
First octets
35. Local MAC Address: Analysis
35
Lab
Switch
Packet
Generator
DUT
# ifconfig eth0 172.16.0.1/24
# dpdkgen 172.16.0.2@01:02:03:04:05:06
# ifconfig eth1 hw ether 01:02:03:04:05:06
# ifconfig eth1 172.16.0.2/24
LAN
M
G
M
GForwards to
all ports
Solutions?
M
G
36. Local MAC Address: Solutions
1. Immediate solution: disconnect traffic generator
2. Use local MAC starting with 02:
02:03:04:05:06:07
3. Connect DUT directly to packet generator
4. Use VLANs:
switch(config)# interface gigabitethernet 0/5 - 7
switch(config-if)# switchport access vlan VLAN
36
More?
Source: CCNP SWITCH, page 97
37. Local MAC Address: Admin Solution
37
Lab
Switch
Packet
Generator
DUT
LAN
M
G
lab-switch# configure terminal
lab-switch(config)# interface gigabitethernet 0/5
lab-switch(config-if)# description --- Packet Generator
lab-switch(config-if)# storm-control multicast level 1
Storm
control
Source: CCNP SWITCH, page 421
Storm
control
40. Recap: Per-VLAN Switch Logic
40
Host A
Host B
Host C
Host D
D
A
PortMAC
1
2
3
4
MAC Table
Learn!
41. 1A
Recap: Switch Logic
41
Host A
Host B
Host C
Host D
D
A
1
PortMAC
1
2
3
4
MAC Table
2
1. Check Ethernet FCS
2. Add A to MAC table
3. No D in MAC table:
○ what to do?
42. 1A
Recap: Switch Logic
42
Host A
Host B
Host C
Host D
D
A
1
PortMAC
1
2
3
4
MAC Table
2
D
A
D
A
3
3
“Unknown unicast”
D
A
3
1. Check Ethernet FCS
2. Add A to MAC table
3. No D in MAC table:
○ send to all ports
Problems?
43. 1A
Recap: Switch Logic
43
Host A
Host B
Host C
Host D
4
Port
D
MAC
1
2
3
4
MAC Table
2
A
D
1
1. Check Ethernet FCS
2. Add D to MAC table
3. A in MAC table:
○ send to port 1
A
D
3
Never
happens :(
44. 1. Receive frame, check Ethernet FCS
2. Add/update source MAC in MAC table
3. If multicast bit is set:
a. forward to all ports, but the source
4. If destination is in MAC table:
a. forward to the specific port
5. Else, forward to all ports
Recap: Per-VLAN Switch Logic
44
45. Root cause — unicast flood
due to unidirectional traffic
(packet generator —> device under test)
45
Unicast
flood?
46. Unicast flood — unintentional behavior of a switch
treating a unicast packet as a broadcast packet.
— Wikipedia
46
54. Autonegotiation — when two devices choose
common speed, duplex, and flow control
Note: if autonegotiation is disabled, the device that is capable of autonegotiation can
determine speed, but cannot determine duplex, so half duplex is always assumed
— Wikipedia
54Source: https://en.wikipedia.org/wiki/Autonegotiation
55. Root cause — duplex mismatch, i.e. two devices
operate in different duplex modes
— Wikipedia
55
56. Autonegotiation: Analysis
56
# ethtool -s eth0 autoneg off speed 1000
Host
LAN
Autonegotiation
is off
Autonegotiation
is on
Solutions?Implicit
full duplex
Fallbacks to half
duplex
60. Recap: CSMA/CD
Carrier-Sense Multiple Access with Collision Detection
media access control method:
1. IF medium is not idle THEN goto 1
2. Start transmission + monitor for a collision
3. IF collision occurred THEN wait, goto 1
60
:(
61. Networking Debug Tools: tcpdump
Usage:
# tcpdump -envvi eth0
-e print ethernet header
-n numeric format
-v verbose
-v even more verbose (checksums)
or use WireShark
61
62. Networking Debug Tools: netstat
Usage:
# watch -n 1 “netstat -s | grep -vw 0”
-n update interval
-s display statistics
-v invert match
-w match whole words
62
63. Networking Debug Tools: counters
1. NIC counters:
# ip -s -s link
-s output more statistics
2. Switch counters:
switch> show interface ethernet 1
switch> show interface ethernet 1 status
63