Middleboxes Reading: Section 8.4 COS 461: Computer Networks Spring 2009 (MW 1:30-2:50 in COS 105) Michael Freedman Teaching Assistants: Wyatt Lloyd and.

Slides:



Advertisements
Similar presentations
Fred P. Baker CCIE, CCIP(security), CCSA, MCSE+I, MCSE(2000)
Advertisements

CPSC Network Layer4-1 IP addresses: how to get one? Q: How does a host get IP address? r hard-coded by system admin in a file m Windows: control-panel->network->configuration-
CS 457 – Lecture 16 Global Internet - BGP Spring 2012.
CS 4700 / CS 5700 Network Fundamentals Lecture 13: Middleboxes and NAT (Duct tape for IPv4) Revised 3/9/2013.
Week 5: Internet Protocol Continue to discuss Ethernet and ARP –MTU –Ethernet and ARP packet format IP: Internet Protocol –Datagram format –IPv4 addressing.
Firewalls and Intrusion Detection Systems
IP Address 1. 2 Network layer r Network layer protocols in every host, router r Router examines IP address field in all IP datagrams passing through it.
K. Salah 1 Chapter 31 Security in the Internet. K. Salah 2 Figure 31.5 Position of TLS Transport Layer Security (TLS) was designed to provide security.
Middleboxes and Tunneling Reading: Sect 8.5, 9.4.1, 4.5 COS 461: Computer Networks Spring 2011 Mike Freedman
What we will cover… Home Networking: Network Address Translation (NAT) Mobile Routing.
Chapter 5 The Network Layer.
1 Network Address Translation (NAT) Relates to Lab 7. Module about private networks and NAT.
NAT: Network Address Translation local network (e.g., home network) /24 rest of Internet Datagrams.
IP Address 1. 2 Network layer r Network layer protocols in every host, router r Router examines IP address field in all IP datagrams passing through it.
UNDERLAYS and MIDDLEBOXES READING: SECTION 8. COS 461: Computer Networks Spring 2010 (MW 3:00-4:20 in COS 105) Mike Freedman
Network Security. Network security starts from authenticating any user. Once authenticated, firewall enforces access policies such as what services are.
FIREWALLS & NETWORK SECURITY with Intrusion Detection and VPNs, 2 nd ed. 6 Packet Filtering By Whitman, Mattord, & Austin© 2008 Course Technology.
TCP: Software for Reliable Communication. Spring 2002Computer Networks Applications Internet: a Collection of Disparate Networks Different goals: Speed,
12 – NAT, ICMP, IPv6 Network Layer4-1. Network Layer4-2 Chapter 4 Network Layer Computer Networking: A Top Down Approach Featuring the Internet, 3 rd.
1 Lecture 20: Firewalls motivation ingredients –packet filters –application gateways –bastion hosts and DMZ example firewall design using firewalls – virtual.
FIREWALL TECHNOLOGIES Tahani al jehani. Firewall benefits  A firewall functions as a choke point – all traffic in and out must pass through this single.
Middleboxes & Network Appliances EE122 TAs Past and Present.
Support Protocols and Technologies. Topics Filling in the gaps we need to make for IP forwarding work in practice – Getting IP addresses (DHCP) – Mapping.
Hafez Barghouthi. Model for Network Access Security (our concern) Patrick BoursAuthentication Course 2007/20082.
Network Layer4-1 NAT: Network Address Translation local network (e.g., home network) /24 rest of.
Mobile IP Traversal Of NAT Devices By, Vivek Nemarugommula.
Packet Filtering. 2 Objectives Describe packets and packet filtering Explain the approaches to packet filtering Recommend specific filtering rules.
8: Network Security8-1 Security in the layers. 8: Network Security8-2 Secure sockets layer (SSL) r Transport layer security to any TCP- based app using.
FIREWALL Mạng máy tính nâng cao-V1.
CS 5565 Network Architecture and Protocols
Middleboxes and Tunneling Mike Freedman COS 461: Computer Networks Lectures: MW 10-10:50am in Architecture N101
CS 3214 Computer Systems Godmar Back Lecture 24 Supplementary Material.
1 IP: putting it all together Part 2 G53ACC Chris Greenhalgh.
Chapter 6: Packet Filtering
© MMII JW RyderCS 428 Computer Networking1 Private Network Interconnection  VPN - Virtual Private Networks  NAT - Network Address Translation  Describe.
1 NAT Network Address Translation Motivation for NAT To solve the insufficient problem of IP addresses IPv6 –All software and hardware need to be updated.
Firewall and Internet Access Mechanism that control (1)Internet access, (2)Handle the problem of screening a particular network or an organization from.
Network Layer4-1 DHCP: Dynamic Host Configuration Protocol Goal: allow host to dynamically obtain its IP address from network server when it joins network.
Transport Layer 3-1 Chapter 4 Network Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012  CPSC.
CIS 3360: Internet: Network Layer Introduction Cliff Zou Spring 2012.
Network Layer4-1 Chapter 4: Network Layer r 4. 1 Introduction r 4.2 Virtual circuit and datagram networks r 4.3 What’s inside a router r 4.4 IP: Internet.
Packet Filtering Chapter 4. Learning Objectives Understand packets and packet filtering Understand approaches to packet filtering Set specific filtering.
1 Network Layer Lecture 15 Imran Ahmed University of Management & Technology.
Module 10: How Middleboxes Impact Performance
Security, NATs and Firewalls Ingate Systems. Basics of SIP Security.
Lectu re 1 Recap: “Operational” view of Internet r Internet: “network of networks” m Requires sending, receiving of messages r protocols control sending,
Transport Layer3-1 Chapter 4: Network Layer r 4. 1 Introduction r 4.2 Virtual circuit and datagram networks r 4.3 What’s inside a router r 4.4 IP: Internet.
CCNA 1 v3.0 Module 9 TCP/IP Protocol Suite and IP Addressing
Chapter 8 Network Security Thanks and enjoy! JFK/KWR All material copyright J.F Kurose and K.W. Ross, All Rights Reserved Computer Networking:
Middleboxes Reading: Section 8.4 COS 461: Computer Networks Spring 2006 (MW 1:30-2:50 in Friend 109) Jennifer Rexford Teaching Assistant: Mike Wawrzoniak.
CS 5565 Network Architecture and Protocols Godmar Back Lecture 14.
Data Communications and Computer Networks Chapter 4 CS 3830 Lecture 19 Omar Meqdadi Department of Computer Science and Software Engineering University.
TCP/IP Protocol Suite and IP Addressing Presented By : Dupien AMS.
Firewalls. Overview of Firewalls As the name implies, a firewall acts to provide secured access between two networks A firewall may be implemented as.
Polytechnic University Firewall and Trusted Systems Presented by, Lekshmi. V. S cos
Defining Network Infrastructure and Network Security Lesson 8.
Supplementary Material
Network Address Translation
Original slides prepared by Theo Benson
Supplementary Material
Middleboxes Jennifer Rexford COS 461: Computer Networks
Introduction to Networking
NET323 D: Network Protocols
* Essential Network Security Book Slides.
NET323 D: Network Protocols
DHCP and NAT.
CS4470 Computer Networking Protocols
Network Address Translation (NAT)
DHCP: Dynamic Host Configuration Protocol
Session 20 INST 346 Technologies, Infrastructure and Architecture
Presentation transcript:

Middleboxes Reading: Section 8.4 COS 461: Computer Networks Spring 2009 (MW 1:30-2:50 in COS 105) Michael Freedman Teaching Assistants: Wyatt Lloyd and Jeff Terrace 1

First order business Log into your account on labpc- 01.cs.princeton.edu Type: chmod –R 700 If you don’t have a computer today, do this by tonight. (We’ll be checking tomorrow.) 2

Goals of Today’s Class Network-layer principles – Globally unique identifiers and simple packet forwarding – Middleboxes as a way to violate these principles Network Address Translation (NAT) – Multiple machines behind a single public address – Private addresses behind the NAT box Firewalls – Discarding unwanted packets LAN appliances – Improving performance and security – Using a middlebox at sending and receiving sites 3

Network-Layer Principles Globally unique identifiers – Each node has a unique, fixed IP address – … reachable from everyone and everywhere Simple packet forwarding – Network nodes simply forward packets – … rather than modifying or filtering them 4 source destination IP network

Internet Reality Host mobility – Changes in IP addresses as hosts move IP address depletion – Dynamic assignment of IP addresses – Private addresses ( /8, /16, …) Security concerns – Discarding suspicious or unwanted packets – Detecting suspicious traffic Performance concerns – Controlling how link bandwidth is allocated – Storing popular content near the clients 5

Middleboxes Middleboxes are intermediaries – Interposed in-between the communicating hosts – Often without knowledge of one or both parties Examples – Network address translators – Firewalls – Traffic shapers – Intrusion detection systems – Transparent Web proxy caches – Application accelerators 6

Two Views of Middleboxes An abomination – Violation of layering – Cause confusion in reasoning about the network – Responsible for many subtle bugs A practical necessity – Solving real and pressing problems – Needs that are not likely to go away Would they arise in any edge-empowered network, even if redesigned from scratch? 7

Network Address Translation 8

History of NATs IP address space depletion – Clear in early 90s that 2 32 addresses not enough – Work began on a successor to IPv4 In the meantime… – Share addresses among numerous devices – … without requiring changes to existing hosts Meant to provide temporary relief – Intended as a short-term remedy – Now, NAT are very widely deployed – … much moreso than IPv6 9

Active Component in the Data Path 10 NAT inside outside

IP Header Translators Local network addresses not globally unique – E.g., private IP addresses (in /8) NAT box rewrites the IP addresses – Make the “inside” look like a single IP address – … and change header checksums accordingly Outbound traffic: from inside to outside – Rewrite the source IP address Inbound traffic: from outside to inside – Rewrite the destination IP address 11

Using a Single Source Address 12 NAT inside outside

What if Both Hosts Contact Same Site? Suppose hosts contact the same destination – E.g., both hosts open a socket with local port 3345 to destination on port 80 NAT gives packets same source address – All packets have source address Problems – Can destination differentiate between senders? – Can return traffic get back to the correct hosts? 13

Port-Translating NAT Map outgoing packets – Replace source address with NAT address – Replace source port number with a new port number – Remote hosts respond using (NAT address, new port #) Maintain a translation table – Store map of (src addr, port #) to (NAT addr, new port #) Map incoming packets – Consult the translation table – Map the destination address and port number – Local host receives the incoming packet 14

Network Address Translation Example S: , 3345 D: , : host sends datagram to , 80 NAT translation table WAN side addr LAN side addr , , 3345 …… S: , 80 D: , S: , 5001 D: , : NAT router changes datagram source addr from , 3345 to , 5001, updates table S: , 80 D: , : Reply arrives dest. address: , : NAT router changes datagram dest addr from , 5001 to , 3345

Maintaining the Mapping Table Create an entry upon seeing a packet – Packet with new (source addr, source port) pair Eventually, need to delete the map entry – But when to remove the binding? If no packets arrive within a time window – … then delete the mapping to free up the port #s – At risk of disrupting a temporarily idle connection Yet another example of “soft state” – I.e., removing state if not refreshed for a while 16

Where is NAT Implemented? Home router (e.g., Linksys box) – Integrates router, DHCP server, NAT, etc. – Use single IP address from the service provider – … and have a bunch of hosts hiding behind it Campus or corporate network – NAT at the connection to the Internet – Share a collection of public IP addresses – Avoid complexity of renumbering end hosts and local routers when changing service providers 17

Practical Objections Against NAT Port #s are meant to identify sockets – Yet, NAT uses them to identify end hosts – Makes it hard to run a server behind a NAT 18 NAT Requests to on port 80 Which host should get the request???

Running Servers Behind NATs Running servers is still possible – Admittedly with a bit more difficulty By explicit configuration of the NAT box – E.g., internal service at – … mapped to More challenging for P2P applications – Especially if both peers are behind NAT boxes Though solutions are possible here as well – Existing work-arounds (e.g., in Skype) – Ongoing work on “NAT traversal” techniques 19

Principled Objections Against NAT Routers are not supposed to look at port #s – Network layer should care only about IP header – … and not be looking at the port numbers at all NAT violates the end-to-end argument – Network nodes should not modify the packets IPv6 is a cleaner solution – Better to migrate than to limp along with a hack 20 That’s what you get when you design a network that puts power in the hands of end users!

Firewalls 21

Firewalls 22 Isolates organization’s internal net from larger Internet, allowing some packets to pass, blocking others. administered network public Internet firewall

Internet Attacks: Denial of Service Denial-of-service attacks – Outsider overwhelms the host with unsolicited traffic – … with the goal of preventing any useful work Example: attacks by botnets – Bad guys take over a large collection of hosts – … and program these hosts to send traffic to your host – Leading to excessive traffic Motivations for denial-of-service attacks – Malice (e.g., just to be mean) – Revenge (e.g., for some past perceived injustice) – Greed (e.g., blackmailing) 23

Internet Attacks: Break-Ins Breaking in to a host – Outsider exploits a vulnerability in the end host – … with the goal of changing the behavior of the host Example – Bad guys know a Web server has a buffer-overflow bug – … and, say, send an HTTP request with a long URL – Allowing them to run their own code Motivations for break-ins – Take over the machine to launch other attacks – Steal information stored on the machine – Modify/replace the content the site normally returns 24

Packet Filtering Internal network connected to Internet via firewall Firewall filters packet-by-packet, based on: – Source IP address, destination IP address – TCP/UDP source and destination port numbers – ICMP message type – TCP SYN and ACK bits 25 Should arriving packet be allowed in? Departing packet let out?

Packet Filtering Examples Block all packets with IP protocol field = 17 and with either source or dest port = 23. – All incoming and outgoing UDP flows blocked – All Telnet connections are blocked Block inbound TCP packets with SYN but no ACK – Prevents external clients from making TCP connections with internal clients – But allows internal clients to connect to outside Block all packets with TCP port of Counterstrike 26

Speaking of which… 27

Firewall Configuration Firewall applies a set of rules to each packet – To decide whether to permit or deny the packet Each rule is a test on the packet – Comparing IP and TCP/UDP header fields – … and deciding whether to permit or deny Order matters – Once the packet matches a rule, the decision is done 28

Firewall Configuration Example Alice runs a network in /16 – Wants to let Bob’s school access certain hosts Bob is on /16 Alice’s special hosts on /24 – Alice doesn’t trust Trudy, inside Bob’s network Trudy is on /24 – Alice doesn’t want any other traffic from Internet Rules – #1: Don’t let Trudy’s machines in Deny (src = /24, dst = /16) – #2: Let rest of Bob’s network in to special dsts Permit (src= /16, dst = /24) – #3: Block the rest of the world Deny (src = /0, dst = /0) 29

A Variation: Traffic Management Permit vs. deny is too binary a decision – Maybe better to classify the traffic based on rules – … and then handle the classes of traffic differently Traffic shaping (rate limiting) – Limit the amount of bandwidth for certain traffic – E.g., rate limit on Web or P2P traffic Separate queues – Use rules to group related packets – And then do round-robin scheduling across groups – E.g., separate queue for each internal IP address 30

Firewall Implementation Challenges Per-packet handling – Must inspect every packet – Challenging on very high-speed links Complex filtering rules – May have large # of rules – May have very complicated rules Location of firewalls – Complex firewalls near the edge, at low speed – Simpler firewalls in the core, at higher speed 31

Clever Users Subvert Firewalls Example: filtering dorm access to a server – Firewall rule based on IP addresses of dorms – … and the server IP address and port number – Problem: users may log in to another machine E.g., connect from the dorms to another host … and then onward to the blocked server Example: filtering P2P based on port #s – Firewall rule based on TCP/UDP port numbers E.g., allow only port 80 (e.g., Web) traffic – Problem: software using non-traditional ports E.g., write P2P client to use port 80 instead 32

LAN Appliances aka WAN Accelerators aka Application Accelerators 33

At Connection Point to the Internet Improve performance between edge networks – E.g., multiple sites of the same company – Through buffering, compression, caching, … Incrementally deployable – No changes to the end hosts or the rest of the Internet – Inspects the packets as they go by, and takes action 34 Appliance Internet

Example: Improve TCP Throughput Appliance with a lot of local memory Sends ACK packets quickly to the sender Overwrites receive window with a large value Or, even run a new and improved version of TCP 35 Appliance Internet ACK

Example: Compression Compress the packet Send the compressed packet Uncompress at the other end Maybe compress across successive packets 36 Appliance Internet

Example: Caching Cache copies of the outgoing packets Check for sequences of bytes that match past data Just send a pointer to the past data And have the receiving appliance reconstruct 37 Appliance Internet

Example: Encryption Two sites share keys for encrypting traffic Sending appliance encrypts the data Receiving appliance decrypts the data Protects the sites from snoopers on the Internet 38 Appliance Internet

Conclusions Middleboxes address important problems – Getting by with fewer IP addresses – Blocking unwanted traffic – Making fair use of network resources – Improving end-to-end performance Middleboxes cause problems of their own – No longer globally unique IP addresses – No longer can assume network simply delivers packets Next class – Repeaters/hubs and bridges/switches – Reading: Section