Top Banner
Kevin Miller Carnegie Mellon University [email protected] Three Practical Ways to Improve Your Network
37

Kevin Miller Carnegie Mellon University [email protected] Three Practical Ways to Improve Your Network.

Dec 22, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Kevin Miller Carnegie Mellon University kcm@cmu.edu Three Practical Ways to Improve Your Network.

Kevin MillerCarnegie Mellon University

[email protected]

Three Practical Ways toImprove Your Network

Page 2: Kevin Miller Carnegie Mellon University kcm@cmu.edu Three Practical Ways to Improve Your Network.

2

Overview

• Eliminate users• Perfectly secure operating systems• Infinitely reliable hardware

Emphasis on the practical

Page 3: Kevin Miller Carnegie Mellon University kcm@cmu.edu Three Practical Ways to Improve Your Network.

3

Overview

• IP Anycast– Deployment Example

• Source Address Verification– Unicast Reverse Path Forwarding

• uRPF for Host Filtering– Fast filtering by IP source address

Page 4: Kevin Miller Carnegie Mellon University kcm@cmu.edu Three Practical Ways to Improve Your Network.

4

IP Anycast

• Current “Anycast” is “shared unicast”– Just a method of configuring routers,

hosts in slightly different way– Not multicast, don’t be worried

• Assign IP address to multiple hosts– Still need a unique management address

• Announce routes to anycast IPs from multiple locations

Page 5: Kevin Miller Carnegie Mellon University kcm@cmu.edu Three Practical Ways to Improve Your Network.

5

IP Anycast - Configuring

• Configure servers to respond on anycast addresses– Often, no additional work required

• Configure clients to use anycast address instead of unique address– Recursive DNS: anycast IP configured

as resolver– Other protocols: update DNS A record

Page 6: Kevin Miller Carnegie Mellon University kcm@cmu.edu Three Practical Ways to Improve Your Network.

6

Anycast in Action

A

F 128.2.32.37128.2.1.10(A)

Client 1

E

B D

128.2.64.2128.2.1.10(A)

128.2.10.50128.2.1.10(A)

Anycast address 128.2.1.10

configured on 3 servers

Page 7: Kevin Miller Carnegie Mellon University kcm@cmu.edu Three Practical Ways to Improve Your Network.

7

Anycast in Action

A

F 128.2.32.37128.2.1.10(A)

Client 1

E

B D

128.2.64.2128.2.1.10(A)

128.2.10.50128.2.1.10(A)

Routers D, E, F have route to 128.2.1.10

viaunique address of

server

Page 8: Kevin Miller Carnegie Mellon University kcm@cmu.edu Three Practical Ways to Improve Your Network.

8

Anycast in Action

A

F 128.2.32.37128.2.1.10(A)

Client 1

E

B D

128.2.64.2128.2.1.10(A)

128.2.10.50128.2.1.10(A)

Router A selects one best path (or equal

cost multi path to D, E, F)

Page 9: Kevin Miller Carnegie Mellon University kcm@cmu.edu Three Practical Ways to Improve Your Network.

9

Anycast in Action

A

F 128.2.32.37128.2.1.10(A)

Client 1

E

B D

128.2.64.2128.2.1.10(A)

128.2.10.50128.2.1.10(A)

Client sends a packet, dest address 128.2.1.10

Page 10: Kevin Miller Carnegie Mellon University kcm@cmu.edu Three Practical Ways to Improve Your Network.

10

Anycast in Action

A

F 128.2.32.37128.2.1.10(A)

Client 1

E

B D

128.2.64.2128.2.1.10(A)

128.2.10.50128.2.1.10(A)

Server responds; source address is

128.2.1.10

Page 11: Kevin Miller Carnegie Mellon University kcm@cmu.edu Three Practical Ways to Improve Your Network.

11

Anycast in Action

A

F 128.2.32.37128.2.1.10(A)

Client 1

E

B D

128.2.64.2128.2.1.10(A)

128.2.10.50128.2.1.10(A)

Subsequent packets can arrive at different

servers

Page 12: Kevin Miller Carnegie Mellon University kcm@cmu.edu Three Practical Ways to Improve Your Network.

12

Caching DNS

• Problems– Network appears slow on most OSs

when primary DNS server is unreachable

– Difficult to relocate caching DNS servers

• Anycast as the solution– Client transparency (easy to move)– Service reliability

Page 13: Kevin Miller Carnegie Mellon University kcm@cmu.edu Three Practical Ways to Improve Your Network.

13

DNS Clients are Forgetful

OS Resolvers that don’t remember a dead DNS server:

• Cisco IOS 12.1• FreeBSD 5.1• Linux 2.4.20• Mac OS X 10.2.6• OpenBSD 3.3• Solaris 8• Windows 2000 – SP3

Those that do:

• Windows XP

Page 14: Kevin Miller Carnegie Mellon University kcm@cmu.edu Three Practical Ways to Improve Your Network.

14

DNS Timeouts Can Be Long

00.5

11.5

22.5

33.5

44.5

5

Seco

nds

DNS Query Timeout of Several Operating Systems

Cisco IOSFreeBSDLinuxMac OS XOpenBSDSolarisWindows 2000Windows XP

Page 15: Kevin Miller Carnegie Mellon University kcm@cmu.edu Three Practical Ways to Improve Your Network.

15

Compounding the Delay

Start Query Type Server Result0s www.usenix.org. AAAA ns1 Timeout

1s www.usenix.org. AAAA ns2 NXDOMAIN

1s www.usenix.org.a.example.com. AAAA ns1 Timeout

2s www.usenix.org.a.example.com. AAAA ns2 NXDOMAIN

2s www.usenix.org.b.example.com. AAAA ns1 Timeout

3s www.usenix.org.b.example.com. AAAA ns2 NXDOMAIN

3s www.usenix.org. A ns1 Timeout

4s www.usenix.org. A ns2 NOERROR

Page 16: Kevin Miller Carnegie Mellon University kcm@cmu.edu Three Practical Ways to Improve Your Network.

16

Caching DNS Deployment

• Decided to use anycast for caching DNS

• Select anycast IP addresses– 128.2.1.10, 128.2.1.11 (CMU:

128.2/16)

• Assign addresses to clients– DHCP, PPP, internal documentation,

smoke signals

Page 17: Kevin Miller Carnegie Mellon University kcm@cmu.edu Three Practical Ways to Improve Your Network.

17

Caching DNS Deployment

• Configure anycast addresses on servers• Restrict servers to respond only on anycast

addresses– Prevent dependencies upon unique addresses

• Ensure queries originate from unique address

options {listen-on { 128.2.1.10; 128.2.1.11; };query-source address 128.2.4.21;

};

BIND 9 Changes

Page 18: Kevin Miller Carnegie Mellon University kcm@cmu.edu Three Practical Ways to Improve Your Network.

18

Caching DNS Deployment

• Configure routing daemon on DNS servers– Join our OSPF routing cloud– Minimizes outage time when server is down

>show ip route 128.2.1.10Routing entry for 128.2.1.10/32Routing Descriptor Blocks: * 128.2.255.24, from 128.2.4.242, 1d13h ago 128.2.255.10, from 128.2.4.238, 1d13h ago 128.2.255.35, from 128.2.4.228, 1d13h ago

Typical Routing Table

Page 19: Kevin Miller Carnegie Mellon University kcm@cmu.edu Three Practical Ways to Improve Your Network.

19

Caching DNS Deployment

• Some clients directed locally, while others load balanced

• If server fails, reroute in < 10 seconds

AC

F 128.2.32.37128.2.1.10(A)

Client 1

E

B D

128.2.64.2128.2.1.10(A)

128.2.10.50128.2.1.10(A)

Client 3

Client 2

Page 20: Kevin Miller Carnegie Mellon University kcm@cmu.edu Three Practical Ways to Improve Your Network.

20

Other Potential Uses

• Authoritative DNS (RFC3258)– Root servers F, I, K– .ORG TLD

• Multicast RP (RFC3446)• 6to4 Tunneling Routers (RFC3068)• Syslog, RADIUS, Kerberos• Single packet request-response UDP

protocols are “easy”• Many services are using anycast;

changes network troubleshooting steps

Page 21: Kevin Miller Carnegie Mellon University kcm@cmu.edu Three Practical Ways to Improve Your Network.

21

Source Address Verification

• Validate the IP source address of packets entering a router– Drop packets with unexpected

addresses

• Improve network security– Popular DoS vector: spoofing source

addresses (Teardrop, Smurf among first)

– Harder to track back spoofed sources

Page 22: Kevin Miller Carnegie Mellon University kcm@cmu.edu Three Practical Ways to Improve Your Network.

22

Methods of SAV

• BCP38 recommends network operators deploy ingress filters restricting traffic– Acceptable solution, but difficult to

implement in the network core– Requires operator maintenance and

upkeep– Stale access lists become a problem

• Research into better ways– SAVE Protocol: Additional inter-router

communication of allowed ranges

Page 23: Kevin Miller Carnegie Mellon University kcm@cmu.edu Three Practical Ways to Improve Your Network.

23

Unicast Reverse Path Forwarding

• Unicast Reverse Path Forwarding– Uses unicast forwarding table as

policy source; filters adjust dynamically

– Easy to implement at the edge– ‘Loose’ mode acceptable in the core

• Accept packet from interface only if forwarding table entry for source IP address matches ingress interface

Page 24: Kevin Miller Carnegie Mellon University kcm@cmu.edu Three Practical Ways to Improve Your Network.

24

uRPF in Action

10.0.18.3

A10.0.1.8

10.0.1.5

10.12.0.3

10.0.18.1/ 24

10.0.1.1/ 24

No source address verification on router

A;invalid source

addresses

Page 25: Kevin Miller Carnegie Mellon University kcm@cmu.edu Three Practical Ways to Improve Your Network.

25

uRPF in Action

10.0.18.3

A10.0.1.8

10.0.1.5

10.12.0.3

10.0.18.1/ 24

10.0.1.1/ 24

Strict Mode uRPF

Enabled

“A” Routing TableDestination Next Hop10.0.1.0/24 Int. 110.0.18.0/24 Int. 2

10.0.18.3 from wrong interface

Page 26: Kevin Miller Carnegie Mellon University kcm@cmu.edu Three Practical Ways to Improve Your Network.

26

uRPF in Action

10.0.18.3

A10.0.1.8

10.0.1.5

10.12.0.3

10.0.18.1/ 24

10.0.1.1/ 24

Loose Mode uRPF Enabled

10.0.18.3 passing, since it exists in the

routing table

Page 27: Kevin Miller Carnegie Mellon University kcm@cmu.edu Three Practical Ways to Improve Your Network.

27

uRPF in Action

10.0.18.3

A10.0.1.8

10.0.1.5

10.12.0.3

10.0.18.1/ 24

10.0.1.1/ 24

Loose Mode uRPF Enabled

10.12.0.3 still not in routing table; dropped

Page 28: Kevin Miller Carnegie Mellon University kcm@cmu.edu Three Practical Ways to Improve Your Network.

28

Host Filtering

• Problem:– Want to be able to block traffic from

certain source addresses quickly• Access restrictions (worm-infected hosts)• Inbound or outbound traffic flooding

– Implemented using scripts that talk to routers; hope the router is talking ‘correctly’• Requires passwords; tedious to maintain• Doesn’t take too long, but we can do better…

Page 29: Kevin Miller Carnegie Mellon University kcm@cmu.edu Three Practical Ways to Improve Your Network.

29

Host Filtering

• Note: – uRPF strict mode drops packets with

source interface other than next-hop interface of FIB entry for source IP

– FIB lookups are done using longest prefix matching

– uRPF strict mode should be in use on every edge interface!

Page 30: Kevin Miller Carnegie Mellon University kcm@cmu.edu Three Practical Ways to Improve Your Network.

30

Host Filtering with uRPF

• To filter traffic from an IP, create a FIB entry with /32 prefix for IP (“host route”) – with next-hop of anything other than normal ingress interface

• FIB entries can be easily created by propagating host route into IGP

Page 31: Kevin Miller Carnegie Mellon University kcm@cmu.edu Three Practical Ways to Improve Your Network.

31

Active Filtering

10.0.1.20

A10.0.1.8

10.0.1.5

Sinkhole

Infected host spewing traffic

“A” Routing TableDestination Next Hop10.0.1.0/24 Int. 1

Strict Mode uRPF

Page 32: Kevin Miller Carnegie Mellon University kcm@cmu.edu Three Practical Ways to Improve Your Network.

32

Active Filtering

10.0.1.20

A10.0.1.8

10.0.1.5

Sinkhole

10.0.1.8/ 32 Here!

Sinkhole announces host route for infected host

Page 33: Kevin Miller Carnegie Mellon University kcm@cmu.edu Three Practical Ways to Improve Your Network.

33

Active Filtering

10.0.1.20

A10.0.1.8

10.0.1.5

Sinkhole

10.0.1.8/ 32 Here!

Traffic to 10.0.1.8 discarded at sinkhole

router

“A” Routing TableDestination Next Hop10.0.1.0/24 Int. 1

10.0.1.8/32 Sinkhole

Page 34: Kevin Miller Carnegie Mellon University kcm@cmu.edu Three Practical Ways to Improve Your Network.

34

Active Filtering

10.0.1.20

A10.0.1.8

10.0.1.5

Sinkhole

10.0.1.8/ 32 Here!

Because of uRPF, traffic from host is discarded (next hop interface towards

sinkhole)

“A” Routing TableDestination Next Hop10.0.1.0/24 Int. 1

10.0.1.8/32 Sinkhole

Page 35: Kevin Miller Carnegie Mellon University kcm@cmu.edu Three Practical Ways to Improve Your Network.

35

Active Filtering

10.0.1.20

A10.0.1.8

10.0.1.5

Sinkhole

Host fixed; administrator configures sinkhole to drop

route

“A” Routing TableDestination Next Hop10.0.1.1/24 Int. 1

Page 36: Kevin Miller Carnegie Mellon University kcm@cmu.edu Three Practical Ways to Improve Your Network.

36

Three Practical Ideas

Using IP anycast for caching DNS can improve the reliability of recursive DNS service and ease server management tasks.

Anycast Caching DNS

Unicast Reverse Path Forwarding provides an easy, self-maintainingmechanism for source address verification. Enabling uRPF on edgeinterfaces should become standard operating procedure.

Source Address Verification

uRPF can be effectively leveraged to quickly apply source addressfilters. Fast filtering in this manner reduces the response time tonetwork exploits.

uRPF for Host Filtering

Page 37: Kevin Miller Carnegie Mellon University kcm@cmu.edu Three Practical Ways to Improve Your Network.

37

Questions?

• Presentation resources:http://www.net.cmu.edu/pres/lisa03

• Kevin Miller: [email protected]