Removing The Linux Routing Cache



Similar documents
ICS 351: Today's plan. IP addresses Network Address Translation Dynamic Host Configuration Protocol Small Office / Home Office configuration

co Characterizing and Tracing Packet Floods Using Cisco R

Overview. Firewall Security. Perimeter Security Devices. Routers

CSE331: Introduction to Networks and Security. Lecture 12 Fall 2006

This Lecture. The Internet and Sockets. The Start If everyone just sends a small packet of data, they can all use the line at the same.

Linux MDS Firewall Supplement

Course Overview: Learn the essential skills needed to set up, configure, support, and troubleshoot your TCP/IP-based network.

Chapter 3. TCP/IP Networks. 3.1 Internet Protocol version 4 (IPv4)

Virtualization: TCP/IP Performance Management in a Virtualized Environment Orlando Share Session 9308

CSE 127: Computer Security. Network Security. Kirill Levchenko

Improving DNS performance using Stateless TCP in FreeBSD 9

Smart Tips. Enabling WAN Load Balancing. Key Features. Network Diagram. Overview. Featured Products. WAN Failover. Enabling WAN Load Balancing Page 1

Netflow Overview. PacNOG 6 Nadi, Fiji

Tomás P. de Miguel DIT-UPM. dit UPM

Content Distribution Networks (CDN)

A D M I N I S T R A T O R V 1. 0

Network Management & Monitoring

Internet Firewall CSIS Packet Filtering. Internet Firewall. Examples. Spring 2011 CSIS net15 1. Routers can implement packet filtering

Iperf Tutorial. Jon Dugan Summer JointTechs 2010, Columbus, OH

Firewalls. Ahmad Almulhem March 10, 2012

OpenFlow with Intel Voravit Tanyingyong, Markus Hidell, Peter Sjödin

Chapter 7. Address Translation

Project 4: (E)DoS Attacks

Security Technology White Paper

Understanding TCP/IP. Introduction. What is an Architectural Model? APPENDIX

CMPT 471 Networking II

VXLAN: Scaling Data Center Capacity. White Paper

Appendix A: Configuring Firewalls for a VPN Server Running Windows Server 2003

Packet Sniffer Detection with AntiSniff

Firewalls 1 / 43. Firewalls

Network Security. Chapter 3. Cornelius Diekmann. Version: October 21, Lehrstuhl für Netzarchitekturen und Netzdienste Institut für Informatik

Chapter 9. IP Secure

CSCE 465 Computer & Network Security

Red Condor Syslog Server Configurations

Main functions of Linux Netfilter

Firewall Introduction Several Types of Firewall. Cisco PIX Firewall

The Lagopus SDN Software Switch. 3.1 SDN and OpenFlow. 3. Cloud Computing Technology

2. Are explicit proxy connections also affected by the ARM config?

Ethernet. Ethernet. Network Devices

OpenFlow and Software Defined Networking presented by Greg Ferro. OpenFlow Functions and Flow Tables

WHITE PAPER. FortiGate DoS Protection Block Malicious Traffic Before It Affects Critical Applications and Systems

BorderWare Firewall Server 7.1. Release Notes

Configuring Dual VPNs with Dual ISP Links Using ECMP Tech Note PAN-OS 7.0

Firewalls Overview and Best Practices. White Paper

20-CS X Network Security Spring, An Introduction To. Network Security. Week 1. January 7

Track 2 Workshop PacNOG 7 American Samoa. Firewalling and NAT

Federal Computer Incident Response Center (FedCIRC) Defense Tactics for Distributed Denial of Service Attacks

SSL Inspection Step-by-Step Guide. June 6, 2016

Bandwidth Management in MPLS Networks

OLD VULNERABILITIES IN NEW PROTOCOLS? HEADACHES ABOUT IPV6 FRAGMENTS

10 Key Things Your VoIP Firewall Should Do. When voice joins applications and data on your network

Cryptography and Network Security Prof. D. Mukhopadhyay Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

Radware s AppDirector and AppXcel An Application Delivery solution for applications developed over BEA s Weblogic

Software Datapath Acceleration for Stateless Packet Processing

IPv6 Hardening Guide for Windows Servers

A Brief Overview of VoIP Security. By John McCarron. Voice of Internet Protocol is the next generation telecommunications method.

CS 665: Computer System Security. Network Security. Usage environment. Sources of vulnerabilities. Information Assurance Module

SAN Conceptual and Design Basics

Linux Network Security

Building Nameserver Clusters with Free Software

Understanding and Configuring NAT Tech Note PAN-OS 4.1

IPV6 流 量 分 析 探 讨 北 京 大 学 计 算 中 心 周 昌 令

Architecture and Data Flow Overview. BlackBerry Enterprise Service Version: Quick Reference

IPv4 and IPv6 Integration. Formation IPv6 Workshop Location, Date

Network Defense Tools

Internet Protocols Fall Lectures 7-8 Andreas Terzis

IP Routing Configuring Static Routes

CheckPoint Software Technologies LTD. How to Configure Firewall-1 With Connect Control

Configuring SNMP and using the NetFlow MIB to Monitor NetFlow Data

Protecting and controlling Virtual LANs by Linux router-firewall

Firewalls and Intrusion Detection

ACHILLES CERTIFICATION. SIS Module SLS 1508

AppDirector Load balancing IBM Websphere and AppXcel

Optimizing TCP Forwarding

VLAN und MPLS, Firewall und NAT,

WAN Topologies MPLS. 2006, Cisco Systems, Inc. All rights reserved. Presentation_ID.scr Cisco Systems, Inc. All rights reserved.

ITL BULLETIN FOR JANUARY 2011

SIDN Server Measurements

N-CAP Users Guide Everything You Need to Know About Using the Internet! How Firewalls Work

How To. Instreamer to Exstreamer connection. Project Name: Document Type: Document Revision: Instreamer to Exstreamer connection. How To 1.

Bridgewalling - Using Netfilter in Bridge Mode

LAB THREE STATIC ROUTING

SIP Trunking Configuration with

Exam : EE : F5 BIG-IP V9 Local traffic Management. Title. Ver :

Scalable Linux Clusters with LVS

How To Set Up An Ip Firewall On Linux With Iptables (For Ubuntu) And Iptable (For Windows)

Quantifying the Performance Degradation of IPv6 for TCP in Windows and Linux Networking

Safeguards Against Denial of Service Attacks for IP Phones

Multihoming and Multi-path Routing. CS 7260 Nick Feamster January

Network layer" 1DT066! Distributed Information Systems!! Chapter 4" Network Layer!! goals: "

Linux MPS Firewall Supplement

RCL: Software Prototype

Border Gateway Protocol (BGP)

Enabling NetFlow on Virtual Switches ESX Server 3.5

- Hubs vs. Switches vs. Routers -

Implementing Reverse Proxy Using Squid. Prepared By Visolve Squid Team

Cisco Integrated Services Routers Performance Overview

Transcription:

Removing The Red Hat Inc. Columbia University, New York, 2012 Removing The

1 Linux Maintainership 2 3 4 5 Removing The

My Background Started working on the kernel 18+ years ago. First project: helping with ELF executable support Second project: Porting Linux to SPARC cpus Third project: Taking over Networking maintainence Can be overwhelming at times. Removing The

What exactly do you do? Like being an editor for a major publication Get to write my own articles from time to time Majority of time is spent reviewing work of others...... and putting out the occaisional fire. Merging, lots and lots of merging. Strong benefits from tools such as GIT and patchwork. Removing The

GIT Linux Maintainership Distributed version control system Originally written by Linus Torvalds Full disconnected operation (unlike CVS/SVN) Buildup of trust networks, who I pull from Side topic: bisection Contributors don t have to use GIT...... but for heavy contributors it helps a lot. GIT is used for many projects other than the Linux kernel GIT can be used on top of other source code control systems Removing The

Patchwork Linux Maintainership Web based patch tracking system Patchwork is subscribed to various developer mailing lists It recognizes software patch submissions and GIT pull requests Maintainers can manage as objects in various states Under Review, Changes Requested, Applied Allows maintainer as well as submitted to see a changes state Removing The

Computer Networking A collection of computers interconnected by communication channels Allows the sharing of resources or information A group of devices connected to each other Removing The

Protocols Linux Maintainership Prearranged method for successful communication Precisely defined message formats Signaling Authentication Error detection and correction Syntax, Semantics, Synchronization Removing The

Networking from an OS Perspective Drivers, Protocol Implementation, System Calls BSD Sockets De-facto interface for network programming Created in 4.2 BSD Unix socket() bind(), connect(), listen(), accept() send(), recv() (read(), write()) close() Drivers send and receive packets on the wire Most low level protocols implemented in the kernel Removing The

Internet Protocol Successor to the ARPANET A DARPA project funded by the US Defense Department Uses an addressing system of 32-bit IP Addresses Transport Protocols include TCP, UDP, and SCTP Removing The

IPV4 Routing Routers implement store and forward Move packets to their final destination Decisions are made using a routing table Route selection uses longest matching prefix Static Tables vs. Routing Protocols Removing The

Routing Example Two routes: 172.168.82.0/24 A 172.168.0.0/16 B Lookup for 172.168.82.6 would match A Lookup for 172.168.2.2 would match B The default route 0.0.0.0/0 Removing The

Hierarchy of Tables Cache is implemented as a hash table Cache is populated by lookup requests Information for cache entries comes from Forwarding Information Base or FIB FIB is populated by administrator or routing daemon Cache is therefore dynamic, whereas FIB is relatively static Cache lookup is simple and extremely low latency FIB lookups are more complicated and thus more expensive FIB tables implemented using trie data structure (LC-Trie) Removing The

Features Largely Unique to Linux Routing by source address ( routing realms or policy routing ) Routing by Type-of-Service ( TOS based routing ) Routing by firewall marking ( MARK based routing ). Front end is called routing rules Initial lookup finds a matching rule A rule leads to a routing table routing table holds routes by destination address Removing The

Source Address Validation We receive packet from address A on interface I If I were to route a packet to A...... would that route use interface I? Nearly useless on end-hosts. Very useful at points of egress, routers, and firewalls. Can add up to two route table lookups per route lookup. Removing The

Routing Cache Keying Hash table keyed on all possible route attributes: Destination Address, Source Address Type-of-Service Firewalling MARK Security Context Outgoing or Incoming Interface Entries therefore have a high level of granularity Removing The

Population of Routing Cache Created on demand by lookups Every packet sent causes a lookup Every packet received causes a lookup Anyone can send us packets Anyone can create a lookup Therefore, anyone can influence contents of our cache Removing The

Hash Function is Important Must distribute well. Must be non-deterministic for remote entities Implies some unknown component fed into hash. Routing cache uses Jenkins Hash...... with random number salting the input. By default random input recomputed every 10 minutes Removing The

Cache is Exploitable This is true regardless of hash quality. Attacker can simply cycle through all values of all keys Each new packet sent modifies the lookup key in some way Each new packet creates a new routing cache entry Triggers garbage collection when size limit is reached Cache is no longer a cache, since every lookup misses This is more expensive than having no cache at all. Removing The

Cache in Non-hostile Environment Even with well behaved traffic, cache is undesirable Google sees hit rates on the order of only 10 percent On simpler systems, cache is effective But still exposed to key cycling denial of service The cache has to be removed Removing The

Not Easy Linux Maintainership Multi-year project Issues: Performance retention No externally visible semantic changes Dependencies on Cache Finding the right mix of interfaces A lot of feeling around in the dark Removing The

Performance Testing Micro vs. Macro analysis Complete isolation of route lookup Top-level operation measurements Looking at route lookups in context Goal: less than 10 percent cost increase for real operations Removing The

Macro Analysis: udpflood Built upon a design by Eric Dumazet Basically: Loop sending N small UDP packets No external network connectivity necessary Uses special dummy network device As well as static ARP table entries All packets simply dropped when they hit device Allows pure software analysis of packet send cost Removing The

Micro Analysis: First Try route_bench Uses routing sockets, specifically GETROUTE requests. Basically: Loop looking up N routes Doesn t work well at all. Measures the wrong thing. Routing socket message overhead dominates test. So test isn t really measuring route lookups. Removing The

Micro Analysis: Second Try Specialized kernel module Calls route lookup function Takes CPU cycle counter before and after Module parameters configure the lookup parameters Loading the module runs the benchmark Even deeper analysis: perf Removing The

Micro Analysis: Perf Performance analysis tool (since Linux 2.6.31) Uses CPU performance monitor facilities Can monitor both user and kernel mode Can watch software events (page faults, context switches) Sampling records program counter at time of event Allows easy detection of hot spots during a test Removing The

Micro Analysis: Final Setup Run module load under perf record Analyze run using perf report Provides detailed cost analysis of all route lookup code paths Allowed quick fixing of lowest hanging fruit Profile counts with and without routing cache could be compared All base perf runs using CPU cycle counter as event Deeper analysis with cache miss and data access events Removing The

Route Identities Routing Cache entry was fully specified Contained saddr, daddr, TOS, etc. Lots of dependencies exist Remove such dependencies Replace with other methods of reconstituting values Removing The

Routing Metrics Path parameters TCP round trip times Path MTU Specific to exact path used Therefore must be maintained with strict keying Metrics cannot be shared amongst several destinations Removing The

TCP Metrics Cache Entries created by successful TCP connection establishment Not susceptible to exploitability like routing cache TCP connection creation requires work by sender Attacker has to use his own resources and reveal his identity Entries keyed only on destination address Removing The

Route Exceptions Created for Path-MTU and Redirects Result from responses to packets we send Cannot be triggered arbitrarily by attackers These two cases are rare Removing The

Neighbours Linux Maintainership Hold link-level nexthop information (for ARP, etc.) Routing cache pre-computed neighbours Remember: One route can refer to several nexthops Need to disconnect neighbours from route entries. Solution: Make neighbour lookups cheaper (faster hash, etc.) Compute neighbours at packet send time..... instead of using precomputed reference via route Most of work involved removing dependenies on old setup Removing The

Mitigating Factors: Part I Generic Receive Offload or simply GRO Accumulates RX packets for the same TCP connection Rules: Same connection ID No special flags Consequetive sequence numbers Passes large accumulated packet as one object into stack Decreases transactional overhead Process 1 packet instead of N packets Means perform 1 route lookup instead of N route lookups Removing The

Mitigating Factors: Part II TCP Pre-Demux Lookup TCP socket on receive, before route lookup Cache input route in TCP socket Use cached input route to avoid route lookup TCP hash table not susceptible to routing cache problems attacker must allocate his own resources Must complete 3-way handshake Must maintain lots of state Removing The

End Result Linux Maintainership Routing cache removed in kernel 3.6 10 percent goal achieved for udpflood Input route lookup for local TCP sockets actually faster Thanks to TCP pre-demux DoS attacks are completely eliminated Major improvements are still possible For example: Combine local and main tables Would half a major component of lookups Removing The

Thanks Linux Maintainership Jason Nieh Eric Dumazet Julian Anastasov Steffen Klassert Herbert Xu Tom Herbert Removing The