SlideShare a Scribd company logo
ChinaNetCloud
Running All the World's Internet Servers
Copyright 2011 ChinaNetcloud Training Program
ChinaNetCloud Training
Networking Layers
By ChinaNetCloud
Pioneers in OaaS – Operations-as-a-Service
October, 2013
www.ChinaNetCloud.com
ChinaNetCloud
Running All the World's Internet Servers
Copyright 2011 ChinaNetCloud 2
Introduction
●
Networking is core to what we do
●
Everyone familiar but few really know it
●
Especially how to troubleshoot
ChinaNetCloud
Running All the World's Internet Servers
Copyright 2011 ChinaNetCloud 3
Layers
●
Layer 1 – Physical wire, NIC
●
Layer 2 – Ethernet, MAC, VLAN, Switches
●
Layer 3 – IP, Routing
●
Layer 4 – TCP/UDP, Connections, Ports
●
Layer 7 – HTTP, ssh, Applications
ChinaNetCloud
Running All the World's Internet Servers
Copyright 2011 ChinaNetCloud 4
Layer 1 – Cable & NIC
●
Basic Ethernet
●
10Mbps, 100Mbps, 1000Mbps, 10G+
●
Speed is x 1000, not 1024 for Kbps, Mbps, Gbps
●
Cables
●
Category 5, 5e 6 – all okay
●
Throw away if connector, cable damaged
●
Patch Panels & Jacks
ChinaNetCloud
Running All the World's Internet Servers
Copyright 2011 ChinaNetCloud 5
Layer 1 – Cable & NIC
●
NIC Cards
●
Buffers – Ring buffers, sizes
●
IRQ – How the NIC talks to CPU
– Can overload a single CPU (advanced)
– IRQ Balance
●
Managed by ethtool
– Options vary by driver
●
Intel good, Broadcom bmx okay
●
Switch also physical layer device
●
Wireless is also physical layer system
ChinaNetCloud
Running All the World's Internet Servers
Copyright 2011 ChinaNetCloud 6
Layer 1 - Tools
●
Ethtool – Most useful
●
Careful of options
●
Options and value depend on NIC driver
●
Has good statistics (-s)
●
Controls IRQ binding, ring buffers
●
Switch – Use normal Cisco commands
ChinaNetCloud
Running All the World's Internet Servers
Copyright 2011 ChinaNetCloud 7
Layer 1 – Speed & Duplex
●
Speed – 10M, 100M, 1000M, 10G
●
Duplex – Talk in one or two directions
●
Half – Only talk one dir at one time
●
Full – Talk both ways, all the time (much better)
●
Auto – Normally auto selected
●
See problems, next slide
ChinaNetCloud
Running All the World's Internet Servers
Copyright 2011 ChinaNetCloud 8
Layer 1 - Problems
●
100M Auto Speed/Duplex not good
●
Can get wrong speed (10Mbps!) or duplex
●
If very slow, check this with ethtool
●
1Gbps system better, but still check
●
Bad cable (even with link light/status)
●
Can't always believe lights, change cable
●
Buffer overruns / IRQ Overload - Advanced
ChinaNetCloud
Running All the World's Internet Servers
Copyright 2011 ChinaNetCloud 9
Layer 2 – Switch, MAC, VLAN
●
MAC Address Oriented
●
All packets move via MAC, not IP
●
ARP relates IP address to MAC
●
Switch Level Networking
●
Connect ports by MAC
●
Plus broadcasts
Switches remember where each MAC is
●
Problem if you move servers/cables
ChinaNetCloud
Running All the World's Internet Servers
Copyright 2011 ChinaNetCloud 10
Layer 2 – Switch, MAC, VLAN
●
VLAN Level Networking
●
Separate L2 networks
●
Managed in and by switch
●
Switches connected by Trunks
●
Each trunk carries many VLANs
●
Most hosts are on a single VLAN
●
Xen servers sometimes on several
– Interface name will match VLAN #, like eth0.25
ChinaNetCloud
Running All the World's Internet Servers
Copyright 2011 ChinaNetCloud 11
Layer 2 – Switch, MAC, VLAN
●
Xen hosts also have internal switches
●
Called bridges (same as switch)
●
Xen eth0.. and all VM eth0.. all connect to bridge
●
Managed with brctl
– brctl show
ChinaNetCloud
Running All the World's Internet Servers
Copyright 2011 ChinaNetCloud 12
Layer 2 - Tools
●
arp – Shows what MACs a server/switch knows
●
Ifconfig – Show if interface up/down
●
Show MAC address
●
Switch – Cisco commands
ChinaNetCloud
Running All the World's Internet Servers
Copyright 2011 ChinaNetCloud 13
Layer 2 - Problems
●
NOT common
●
MAC Change on VM restart in Xen
●
Usually not an issue, but MAC changes
●
Switch lockout
●
Too many MACs per port – Security protection
●
Switch remembers old MAC
●
MAC move on HA failover
●
Not common. Mostly IP move issue.
ChinaNetCloud
Running All the World's Internet Servers
Copyright 2011 ChinaNetCloud 14
Layer 3 - IP
●
IP Address Oriented
●
IP, Mask, Aliases
●
Watch the mask
●
Especially on public Internet
●
Use arp to get MAC from IP
●
Broadcast, then remember MAC for a while
●
Gateway – Only one per server !
●
Even if dual-line, etc.
– Special Policy Routing for this, Advanced
ChinaNetCloud
Running All the World's Internet Servers
Copyright 2011 ChinaNetCloud 15
Layer 3 - Tools
●
Ip – A whole set of commands
●
ip addr – Show addresses
●
ip route
●
ping
●
Traceroute
●
Older tools
●
Ifconfig - older, may not show everything
●
Does show MAC
●
route – older, won't show policy routes
ChinaNetCloud
Running All the World's Internet Servers
Copyright 2011 ChinaNetCloud 16
Layer 3 - Problems
●
Duplicate IP
●
Bad gateway
●
Bad mask
●
Bad VLAN
ChinaNetCloud
Running All the World's Internet Servers
Copyright 2011 ChinaNetCloud 17
Layer 4 – TCP & UDP
●
Connection Oriented (TCP)
●
Uses Ports – On both sides
●
Flow Control & Retry (TCP)
●
Most common iptables entries at Layer 4
●
Important to understand
ChinaNetCloud
Running All the World's Internet Servers
Copyright 2011 ChinaNetCloud 18
Layer 4 – TCP Flow
●
Server listening on an IP & Port (or all IP, *:80)
●
Three way connection handshake / create
●
Client sends SYN to Server's IP & port
●
Server Send ACK
●
Client sends SYN/ACK
●
Connection is ESTABLISHED, or open
●
Data flows
●
With TCP Windows, ACK, and Retries
●
Either side will close (complex)
ChinaNetCloud
Running All the World's Internet Servers
Copyright 2011 ChinaNetCloud 19
Layer 4 – TCP States - netstat
●
Some very rare, short time, others common
●
SYN_SENT – We are trying to open new connection
●
Other side not reply yet.
●
If seen on PHP system, this is a big problem
●
SYN_RECV – We are queuing incoming requests
●
ESTAB - Normal
●
FIN_WAIT1 – Very unusual
●
FIN_WAIT2 – Very unusual
●
TIME_WAIT – Socket closed, waiting. Normal.
●
CLOSING, CLOSE_WAIT, LAST_ACK, CLOSED - Rare
ChinaNetCloud
Running All the World's Internet Servers
Copyright 2011 ChinaNetCloud 20
Layer 4 - Tools
●
netstat – Show states for TCP
●
tcpdump – Read data from network
ChinaNetCloud
Running All the World's Internet Servers
Copyright 2011 ChinaNetCloud 21
Layer 4 - Problems
●
Firewall blocks inbound
●
Outbound timeout
●
PHP to other sites, memcache
●
Syn cookies sent
●
Conntrack/Iptables queue full
ChinaNetCloud
Running All the World's Internet Servers
Copyright 2011 ChinaNetCloud 22
Layer 7 – HTTP & Application
●
App Layer Oriented
●
HTTP, SSH, etc. on TCP
●
Or custom protocol like VoIP, Video on UDP
●
Every protocol different
ChinaNetCloud
Running All the World's Internet Servers
Copyright 2011 ChinaNetCloud 23
Layer 7 - Tools
●
Tcdump – Read the data from network
●
WireShark – Analyze, display data, all layers
ChinaNetCloud
Running All the World's Internet Servers
Copyright 2011 ChinaNetCloud 24
Layer 7 - Problems
●
Specific to protocols
●
See protocol training
●
HTTP
●
FTP – Uses two connections
ChinaNetCloud
Running All the World's Internet Servers
Copyright 2015 ChinaNetCloud 25
About ChinaNetCloud
ChinaNetCloud
Running All the World's Internet Servers
ChinaNetCloud
Sales@ChinaNetCloud.com
Beijing Office:
Lee World Business
Building #305
57 Happiness Village Road,
Chaoyang District
Beijing, 100027 China
Silicon Valley Office:
California Avenue
Palo Alto, 94123 USA
Shanghai Headquarters:
X2 Space 1-601, 1238 Xietu
Lu
Shanghai, 200032 China
T: +86-21-6422-1946 F:
+86-21-6422-4911

More Related Content

PDF
SwOS (MikroTik Switch OS) Administration Guide
PPTX
Network performance lessons from the coal face - Networkshop44
PPTX
Data centre networking at London School of Economics and Political Science - ...
PDF
MikroTik BGP Security - MUM 2014 (rofiq fauzi)
PPTX
ChinaNetCloud Training - iptables Intro
PDF
Bandwidth Monitoring - pfSense Hangout March 2015
PDF
Intro to Multi-WAN - pfSense Hangout April 2014
PDF
Traffic Shaping Basics with PRIQ - pfSense Hangout February 2016
SwOS (MikroTik Switch OS) Administration Guide
Network performance lessons from the coal face - Networkshop44
Data centre networking at London School of Economics and Political Science - ...
MikroTik BGP Security - MUM 2014 (rofiq fauzi)
ChinaNetCloud Training - iptables Intro
Bandwidth Monitoring - pfSense Hangout March 2015
Intro to Multi-WAN - pfSense Hangout April 2014
Traffic Shaping Basics with PRIQ - pfSense Hangout February 2016

What's hot (20)

PDF
pfSense 2.4.4 Short Topic Miscellany - pfSense Hangout August 2018
ODP
What's new in Neutron Juno
PDF
MikroTik & RouterOS
PDF
Bonding Interface in MikroTik
PDF
Configuring Netgate Appliance Integrated Switches on pfSense 2.4.4 - pfSense ...
PDF
PPPoE With Mikrotik and Radius
PDF
Remote Access VPNs - pfSense Hangout September 2015
PDF
Running BGP with Mikrotik
PDF
IPv6 Basics - pfSense Hangout July 2015
PDF
BAIT2164 Tutorial 3
PDF
VXLAN and FRRouting
PDF
Mikro tik advanced training
PDF
Site-to-Site VPNs - pfSense Hangout November 2015
PPTX
Mikrotik® MPLS/VPN Lab Part 1
PDF
vPC_Final
PDF
Advanced OpenVPN Concepts - pfSense Hangout September 2014
PPTX
Linux 802.11 subsystem and brcmsmac WLAN driver
PDF
VPN Overview and IPsec Intro
ODP
Wireless openflow (english)
PDF
Backup and Restore with pfSense 2.4 - pfSense Hangout August 2017
pfSense 2.4.4 Short Topic Miscellany - pfSense Hangout August 2018
What's new in Neutron Juno
MikroTik & RouterOS
Bonding Interface in MikroTik
Configuring Netgate Appliance Integrated Switches on pfSense 2.4.4 - pfSense ...
PPPoE With Mikrotik and Radius
Remote Access VPNs - pfSense Hangout September 2015
Running BGP with Mikrotik
IPv6 Basics - pfSense Hangout July 2015
BAIT2164 Tutorial 3
VXLAN and FRRouting
Mikro tik advanced training
Site-to-Site VPNs - pfSense Hangout November 2015
Mikrotik® MPLS/VPN Lab Part 1
vPC_Final
Advanced OpenVPN Concepts - pfSense Hangout September 2014
Linux 802.11 subsystem and brcmsmac WLAN driver
VPN Overview and IPsec Intro
Wireless openflow (english)
Backup and Restore with pfSense 2.4 - pfSense Hangout August 2017
Ad

Viewers also liked (9)

PDF
MPLS Presentation
PDF
What exactly is the "Internet of Things"?
PPT
THE INTERNET OF THINGS
PPT
Basic concepts of computer Networking
PPTX
Digital globalization: The new era of global flows
PPTX
Introduction to computer network
PPT
BASIC CONCEPTS OF COMPUTER NETWORKS
PPTX
Internet-of-things- (IOT) - a-seminar - ppt - by- mohan-kumar-g
PPT
Internet of Things and its applications
MPLS Presentation
What exactly is the "Internet of Things"?
THE INTERNET OF THINGS
Basic concepts of computer Networking
Digital globalization: The new era of global flows
Introduction to computer network
BASIC CONCEPTS OF COMPUTER NETWORKS
Internet-of-things- (IOT) - a-seminar - ppt - by- mohan-kumar-g
Internet of Things and its applications
Ad

Similar to Networking Layer Basics - ChinaNetCloud Training (20)

PPT
ChinaNetCloud - China Internet Infrastructure Summary
PPT
Dealing with Chinese Network Anatomy | NC SZ Architect Event Speech 2012
PPTX
ChinaNetCloud - Chinese Cloud Features
PPT
Building for the Cloud | NC CSDN Cloud Conference 2012
PDF
Steve mushero china netcloud sz arch event 20120805.1
ODP
ChinaNetCloud Training - HAProxy Intro
PPTX
ChinaNetCloud - Cloud Operations for Gaming - Tencent July 2014
PPTX
ChinaNetCloud - Company & Services Overview
DOCX
2015_01 - Networking Session - SPHMMC ICT workshop
PDF
Linux network tools (Maarten Blomme)
PDF
Running Internet Systems in China - The Details You Need to Succeed in Chines...
PPTX
OaaS - Operations as a Service
PDF
Making Internet Operations Easier
PPT
Linux networking
PDF
Running Internet Systems in China
PPTX
Why Work at ChinaNetCloud
PDF
Multi-Layer DDoS Mitigation Strategies
PDF
Layer one 2011-gh0stwood-d-dos-attacks
PDF
packet traveling (pre cloud)
PDF
Multi-WAN on pfSense 2.3 - pfSense Hangout March 2016
ChinaNetCloud - China Internet Infrastructure Summary
Dealing with Chinese Network Anatomy | NC SZ Architect Event Speech 2012
ChinaNetCloud - Chinese Cloud Features
Building for the Cloud | NC CSDN Cloud Conference 2012
Steve mushero china netcloud sz arch event 20120805.1
ChinaNetCloud Training - HAProxy Intro
ChinaNetCloud - Cloud Operations for Gaming - Tencent July 2014
ChinaNetCloud - Company & Services Overview
2015_01 - Networking Session - SPHMMC ICT workshop
Linux network tools (Maarten Blomme)
Running Internet Systems in China - The Details You Need to Succeed in Chines...
OaaS - Operations as a Service
Making Internet Operations Easier
Linux networking
Running Internet Systems in China
Why Work at ChinaNetCloud
Multi-Layer DDoS Mitigation Strategies
Layer one 2011-gh0stwood-d-dos-attacks
packet traveling (pre cloud)
Multi-WAN on pfSense 2.3 - pfSense Hangout March 2016

More from ChinaNetCloud (20)

PPTX
AWS ELB Tips & Best Practices
PPTX
OpsStack--Integrated Operation Platform
PPTX
ChinaNetCloud Online Lecture:Something About Tshark
PPTX
ChinaNetCloud Online Lecture: Fight Against External Attacks From Different L...
PPTX
Steve Mushero on Entrepreneurship - 创业 - 崔牛会
PPTX
Dev-Ops与Docker的最佳实践 QCon2016 北京站演讲
PPTX
云中漫步 颠覆创新_创业邦春季创新峰会主题演讲 Cloud Innovation in China
PDF
运维安全 抵抗黑客攻击_云络安全沙龙4月上海站主题分享
PPTX
AWS Summit OaaS Talk by ChinaNetCloud
PPTX
Internet Cloud Operations - ChinaNetcloud & AWS Event Beijing
PPTX
Big Data Security (ChinaNetCloud - Guiyang Conference)
PPTX
Internet System Security Overview
PPTX
Cloud Operations Challenges - Talk by ChinaNetCloud at Joint Cisco event
PPTX
Automatically Managing Internet Operations In The Cloud - 云计算平台的自动化运维
PPTX
ChinaNetCloud - Aliyun Joint Event on Cloud Operations
PDF
Clouds in China
PPTX
ChinaNetCloud - Public Clouds in China Overview
PPT
Linux Memory Basics for SysAdmins - ChinaNetCloud Training
PPTX
ChinaNetCloud Chase Future Event - Lessons Learned Running a Chinese Startup
PPTX
ChinaNetCloud Magento Operations - Magentocom Conference - Nov 2014
AWS ELB Tips & Best Practices
OpsStack--Integrated Operation Platform
ChinaNetCloud Online Lecture:Something About Tshark
ChinaNetCloud Online Lecture: Fight Against External Attacks From Different L...
Steve Mushero on Entrepreneurship - 创业 - 崔牛会
Dev-Ops与Docker的最佳实践 QCon2016 北京站演讲
云中漫步 颠覆创新_创业邦春季创新峰会主题演讲 Cloud Innovation in China
运维安全 抵抗黑客攻击_云络安全沙龙4月上海站主题分享
AWS Summit OaaS Talk by ChinaNetCloud
Internet Cloud Operations - ChinaNetcloud & AWS Event Beijing
Big Data Security (ChinaNetCloud - Guiyang Conference)
Internet System Security Overview
Cloud Operations Challenges - Talk by ChinaNetCloud at Joint Cisco event
Automatically Managing Internet Operations In The Cloud - 云计算平台的自动化运维
ChinaNetCloud - Aliyun Joint Event on Cloud Operations
Clouds in China
ChinaNetCloud - Public Clouds in China Overview
Linux Memory Basics for SysAdmins - ChinaNetCloud Training
ChinaNetCloud Chase Future Event - Lessons Learned Running a Chinese Startup
ChinaNetCloud Magento Operations - Magentocom Conference - Nov 2014

Recently uploaded (20)

PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Encapsulation theory and applications.pdf
PPT
Teaching material agriculture food technology
PDF
Electronic commerce courselecture one. Pdf
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
cuic standard and advanced reporting.pdf
PDF
KodekX | Application Modernization Development
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Agricultural_Statistics_at_a_Glance_2022_0.pdf
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
Diabetes mellitus diagnosis method based random forest with bat algorithm
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
Encapsulation_ Review paper, used for researhc scholars
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Advanced methodologies resolving dimensionality complications for autism neur...
Encapsulation theory and applications.pdf
Teaching material agriculture food technology
Electronic commerce courselecture one. Pdf
Network Security Unit 5.pdf for BCA BBA.
cuic standard and advanced reporting.pdf
KodekX | Application Modernization Development
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...

Networking Layer Basics - ChinaNetCloud Training

  • 1. ChinaNetCloud Running All the World's Internet Servers Copyright 2011 ChinaNetcloud Training Program ChinaNetCloud Training Networking Layers By ChinaNetCloud Pioneers in OaaS – Operations-as-a-Service October, 2013 www.ChinaNetCloud.com
  • 2. ChinaNetCloud Running All the World's Internet Servers Copyright 2011 ChinaNetCloud 2 Introduction ● Networking is core to what we do ● Everyone familiar but few really know it ● Especially how to troubleshoot
  • 3. ChinaNetCloud Running All the World's Internet Servers Copyright 2011 ChinaNetCloud 3 Layers ● Layer 1 – Physical wire, NIC ● Layer 2 – Ethernet, MAC, VLAN, Switches ● Layer 3 – IP, Routing ● Layer 4 – TCP/UDP, Connections, Ports ● Layer 7 – HTTP, ssh, Applications
  • 4. ChinaNetCloud Running All the World's Internet Servers Copyright 2011 ChinaNetCloud 4 Layer 1 – Cable & NIC ● Basic Ethernet ● 10Mbps, 100Mbps, 1000Mbps, 10G+ ● Speed is x 1000, not 1024 for Kbps, Mbps, Gbps ● Cables ● Category 5, 5e 6 – all okay ● Throw away if connector, cable damaged ● Patch Panels & Jacks
  • 5. ChinaNetCloud Running All the World's Internet Servers Copyright 2011 ChinaNetCloud 5 Layer 1 – Cable & NIC ● NIC Cards ● Buffers – Ring buffers, sizes ● IRQ – How the NIC talks to CPU – Can overload a single CPU (advanced) – IRQ Balance ● Managed by ethtool – Options vary by driver ● Intel good, Broadcom bmx okay ● Switch also physical layer device ● Wireless is also physical layer system
  • 6. ChinaNetCloud Running All the World's Internet Servers Copyright 2011 ChinaNetCloud 6 Layer 1 - Tools ● Ethtool – Most useful ● Careful of options ● Options and value depend on NIC driver ● Has good statistics (-s) ● Controls IRQ binding, ring buffers ● Switch – Use normal Cisco commands
  • 7. ChinaNetCloud Running All the World's Internet Servers Copyright 2011 ChinaNetCloud 7 Layer 1 – Speed & Duplex ● Speed – 10M, 100M, 1000M, 10G ● Duplex – Talk in one or two directions ● Half – Only talk one dir at one time ● Full – Talk both ways, all the time (much better) ● Auto – Normally auto selected ● See problems, next slide
  • 8. ChinaNetCloud Running All the World's Internet Servers Copyright 2011 ChinaNetCloud 8 Layer 1 - Problems ● 100M Auto Speed/Duplex not good ● Can get wrong speed (10Mbps!) or duplex ● If very slow, check this with ethtool ● 1Gbps system better, but still check ● Bad cable (even with link light/status) ● Can't always believe lights, change cable ● Buffer overruns / IRQ Overload - Advanced
  • 9. ChinaNetCloud Running All the World's Internet Servers Copyright 2011 ChinaNetCloud 9 Layer 2 – Switch, MAC, VLAN ● MAC Address Oriented ● All packets move via MAC, not IP ● ARP relates IP address to MAC ● Switch Level Networking ● Connect ports by MAC ● Plus broadcasts Switches remember where each MAC is ● Problem if you move servers/cables
  • 10. ChinaNetCloud Running All the World's Internet Servers Copyright 2011 ChinaNetCloud 10 Layer 2 – Switch, MAC, VLAN ● VLAN Level Networking ● Separate L2 networks ● Managed in and by switch ● Switches connected by Trunks ● Each trunk carries many VLANs ● Most hosts are on a single VLAN ● Xen servers sometimes on several – Interface name will match VLAN #, like eth0.25
  • 11. ChinaNetCloud Running All the World's Internet Servers Copyright 2011 ChinaNetCloud 11 Layer 2 – Switch, MAC, VLAN ● Xen hosts also have internal switches ● Called bridges (same as switch) ● Xen eth0.. and all VM eth0.. all connect to bridge ● Managed with brctl – brctl show
  • 12. ChinaNetCloud Running All the World's Internet Servers Copyright 2011 ChinaNetCloud 12 Layer 2 - Tools ● arp – Shows what MACs a server/switch knows ● Ifconfig – Show if interface up/down ● Show MAC address ● Switch – Cisco commands
  • 13. ChinaNetCloud Running All the World's Internet Servers Copyright 2011 ChinaNetCloud 13 Layer 2 - Problems ● NOT common ● MAC Change on VM restart in Xen ● Usually not an issue, but MAC changes ● Switch lockout ● Too many MACs per port – Security protection ● Switch remembers old MAC ● MAC move on HA failover ● Not common. Mostly IP move issue.
  • 14. ChinaNetCloud Running All the World's Internet Servers Copyright 2011 ChinaNetCloud 14 Layer 3 - IP ● IP Address Oriented ● IP, Mask, Aliases ● Watch the mask ● Especially on public Internet ● Use arp to get MAC from IP ● Broadcast, then remember MAC for a while ● Gateway – Only one per server ! ● Even if dual-line, etc. – Special Policy Routing for this, Advanced
  • 15. ChinaNetCloud Running All the World's Internet Servers Copyright 2011 ChinaNetCloud 15 Layer 3 - Tools ● Ip – A whole set of commands ● ip addr – Show addresses ● ip route ● ping ● Traceroute ● Older tools ● Ifconfig - older, may not show everything ● Does show MAC ● route – older, won't show policy routes
  • 16. ChinaNetCloud Running All the World's Internet Servers Copyright 2011 ChinaNetCloud 16 Layer 3 - Problems ● Duplicate IP ● Bad gateway ● Bad mask ● Bad VLAN
  • 17. ChinaNetCloud Running All the World's Internet Servers Copyright 2011 ChinaNetCloud 17 Layer 4 – TCP & UDP ● Connection Oriented (TCP) ● Uses Ports – On both sides ● Flow Control & Retry (TCP) ● Most common iptables entries at Layer 4 ● Important to understand
  • 18. ChinaNetCloud Running All the World's Internet Servers Copyright 2011 ChinaNetCloud 18 Layer 4 – TCP Flow ● Server listening on an IP & Port (or all IP, *:80) ● Three way connection handshake / create ● Client sends SYN to Server's IP & port ● Server Send ACK ● Client sends SYN/ACK ● Connection is ESTABLISHED, or open ● Data flows ● With TCP Windows, ACK, and Retries ● Either side will close (complex)
  • 19. ChinaNetCloud Running All the World's Internet Servers Copyright 2011 ChinaNetCloud 19 Layer 4 – TCP States - netstat ● Some very rare, short time, others common ● SYN_SENT – We are trying to open new connection ● Other side not reply yet. ● If seen on PHP system, this is a big problem ● SYN_RECV – We are queuing incoming requests ● ESTAB - Normal ● FIN_WAIT1 – Very unusual ● FIN_WAIT2 – Very unusual ● TIME_WAIT – Socket closed, waiting. Normal. ● CLOSING, CLOSE_WAIT, LAST_ACK, CLOSED - Rare
  • 20. ChinaNetCloud Running All the World's Internet Servers Copyright 2011 ChinaNetCloud 20 Layer 4 - Tools ● netstat – Show states for TCP ● tcpdump – Read data from network
  • 21. ChinaNetCloud Running All the World's Internet Servers Copyright 2011 ChinaNetCloud 21 Layer 4 - Problems ● Firewall blocks inbound ● Outbound timeout ● PHP to other sites, memcache ● Syn cookies sent ● Conntrack/Iptables queue full
  • 22. ChinaNetCloud Running All the World's Internet Servers Copyright 2011 ChinaNetCloud 22 Layer 7 – HTTP & Application ● App Layer Oriented ● HTTP, SSH, etc. on TCP ● Or custom protocol like VoIP, Video on UDP ● Every protocol different
  • 23. ChinaNetCloud Running All the World's Internet Servers Copyright 2011 ChinaNetCloud 23 Layer 7 - Tools ● Tcdump – Read the data from network ● WireShark – Analyze, display data, all layers
  • 24. ChinaNetCloud Running All the World's Internet Servers Copyright 2011 ChinaNetCloud 24 Layer 7 - Problems ● Specific to protocols ● See protocol training ● HTTP ● FTP – Uses two connections
  • 25. ChinaNetCloud Running All the World's Internet Servers Copyright 2015 ChinaNetCloud 25 About ChinaNetCloud
  • 26. ChinaNetCloud Running All the World's Internet Servers ChinaNetCloud Sales@ChinaNetCloud.com Beijing Office: Lee World Business Building #305 57 Happiness Village Road, Chaoyang District Beijing, 100027 China Silicon Valley Office: California Avenue Palo Alto, 94123 USA Shanghai Headquarters: X2 Space 1-601, 1238 Xietu Lu Shanghai, 200032 China T: +86-21-6422-1946 F: +86-21-6422-4911