ECE/CS 4984: Lecture 11


Published on

  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

ECE/CS 4984: Lecture 11

  1. 1. Lecture 10 Mobile Networks: Nomadic Services, DHCP, NAT, and VPNs Wireless Networks and Mobile Systems
  2. 2. Lecture Objectives <ul><li>Describe the role of nomadic services in mobile networking </li></ul><ul><li>Describe the objectives and operation of IP virtual private networks (VPNs) </li></ul><ul><li>Describe the objectives and operation of the Dynamic Host Configuration Protocol (DHCP) </li></ul><ul><li>Describe the objectives and operation of network address translation (NAT) </li></ul><ul><li>Describe firewall and packet filter functions, especially as related to NAT </li></ul><ul><li>Provide some high-level background in web services, especially for a wireless “hot spot” service </li></ul>
  3. 3. Agenda <ul><li>Nomadic services </li></ul><ul><li>Virtual private networks (VPNs) </li></ul><ul><li>Dynamic Host Configuration Protocol (DHCP) </li></ul><ul><li>Network address translation (NAT) </li></ul><ul><li>Firewalls and packet filtering </li></ul><ul><li>HTML and web programming </li></ul><ul><li>Brief comments on a wireless “hot spot” service </li></ul>
  4. 4. Nomadic Services <ul><li>Nomadic services support hosts that attach to different networks, but where host reconfiguration is acceptable </li></ul><ul><ul><li>Compare to mobile services where hosts can move to a different network without reconfiguring </li></ul></ul><ul><li>Functions </li></ul><ul><ul><li>Changing the host’s IP address to that of the current network to which it is attached  DHCP </li></ul></ul><ul><ul><li>Limited number of public Internet addresses available in the current network (or any network)  NAT </li></ul></ul><ul><ul><li>Lack of trust of the current network (or any network)  VPN </li></ul></ul><ul><li>A wireless “hot spot” usually combines DHCP, NAT, and firewall functions </li></ul>
  5. 5. Nomadic Services Functions Address via DHCP Secure Data, Private Address Secure Data, Public Address <ul><li>VPN endpoint </li></ul><ul><li>VPN endpoint </li></ul><ul><li>DHCP </li></ul><ul><li>NAT </li></ul>Public Network Private Network Private Network Nomadic Node
  6. 6. Agenda <ul><li>Nomadic services </li></ul><ul><li>Virtual private networks (VPNs) </li></ul><ul><li>Dynamic Host Configuration Protocol (DHCP) </li></ul><ul><li>Network address translation (NAT) </li></ul><ul><li>Firewalls and packet filtering </li></ul><ul><li>HTML and web programming </li></ul><ul><li>Brief comments on a wireless “hot spot” service </li></ul>
  7. 7. Virtual Private Networks (1) <ul><li>Virtual private networks (VPNs) </li></ul><ul><ul><li>Enable end-to-end security (authentication and, optionally, privacy) for a single (mobile) host connecting to a private network over untrusted (public) intermediate networks </li></ul></ul><ul><ul><li>Enable security for private network-to-network communication over untrusted intermediate networks </li></ul></ul><ul><ul><li>Support quality-of-service and other attributes of a service level agreement over a shared network for network-to-network connectivity </li></ul></ul>
  8. 8. Virtual Private Networks (2) <ul><li>Tunneling protocols </li></ul><ul><ul><li>Point-to-Point Tunneling Protocol (PPTP) </li></ul></ul><ul><ul><li>Layer 2 Tuneling Protocol (L2TP) </li></ul></ul><ul><ul><li>IP Security (IPSec) </li></ul></ul>VPN Client VPN Server General Host Public Network Private Network Secure Tunnel
  9. 9. Point-to-Point Tunneling Protocol <ul><li>PPTP is an extension of the Point-to-Point Protocol (PPP) to support tunneling </li></ul><ul><li>Can carry IP and non-IP packets </li></ul>Layer 2 Header IP Header PPP Packet GRE Header
  10. 10. Layer 2 Tunneling Protocol <ul><li>Resulted from the IETF’s merger of PPTP and the Layer 2 Forwarding Protocol (L2FP) </li></ul><ul><li>Can carry IP and non-IP packets over IP and other networks </li></ul>Packet Transport (UDP, FR, ATM, etc.) L2TP Data Channel (unreliable) L2TP Control Channel (unreliable) L2TP Data Messages (unreliable) PPP Frames L2TP Control Messages
  11. 11. IP Security <ul><li>IPSec has two main components </li></ul><ul><ul><li>Authentication Header (AH) </li></ul></ul><ul><ul><li>Encapsulating Security Payload (ESP) </li></ul></ul><ul><li>Two modes </li></ul><ul><ul><li>Transport mode </li></ul></ul><ul><ul><li>Tunnel mode </li></ul></ul>IP Header AH (or ESP) IP Payload Inner IP Header Original IP Datagram Tunnel Mode
  12. 12. VPN References K. Hamzeh, G. Pall, W. Verthein, J. Taarud, W. Little, G. Zorn, “Point-to-Point Tunneling Protocol,” RFC 2637, July 1999. W. Townsley, A. Valencia, A. Rubens, G. Pall, G. Zorn, B. Palter, “Layer Two Tunneling Protocol ‘L2TP’,” RFC 2661, Aug. 1999. S. Kent, R. Atkinson, “Security Architecture for the Internet Protocol,” RFC 2401, Nov. 1998. D. Fowler, Virtual Private Networks , Morgan-Kaufmann Publishers, 1999.
  13. 13. Agenda <ul><li>Nomadic services </li></ul><ul><li>Virtual private networks (VPNs) </li></ul><ul><li>Dynamic Host Configuration Protocol (DHCP) </li></ul><ul><li>Network address translation (NAT) </li></ul><ul><li>Firewalls and packet filtering </li></ul><ul><li>HTML and web programming </li></ul><ul><li>Brief comments on a wireless “hot spot” service </li></ul>
  14. 14. DHCP <ul><li>DHCP provides all necessary configuration information to allow a stationary node to become a viable Internet host </li></ul><ul><li>Applications </li></ul><ul><ul><li>To simplify system administration in traditional networks </li></ul></ul><ul><ul><li>To improve utilization of IP address space </li></ul></ul><ul><ul><li>To allow mobile hosts to obtain collocated care-of addresses on foreign networks </li></ul></ul>R. Droms, “Dynamic Host Configuration Protocol,” RFC 2131, March 1997. C. E. Perkins, Mobile IP: Design Principles and Practices, Addison-Wesley, Reading, MA, 1998 (Chapter 9).
  15. 15. DHCP: Client-Server Model (1) <ul><li>DHCP adheres to a client-server model </li></ul><ul><ul><li>Client requests service </li></ul></ul><ul><ul><li>Server provides response </li></ul></ul><ul><li>Request and reply must be sent without the benefit of the client being an Internet host </li></ul>DHCP Server DHCP Client 1 DHCP Client 2 request reply
  16. 16. DHCP: Client-Server Model (2) <ul><li>Client broadcasts request to network </li></ul><ul><ul><li>Broadcast received by server or relay </li></ul></ul><ul><ul><li>If a relay is used, it forwards request with other information to the server </li></ul></ul><ul><li>Server responds with configuration information </li></ul><ul><li>Client acknowledges receipt </li></ul><ul><li>Server reserves IP address (for some lease time) and notifies client that address is reserved </li></ul><ul><li>Client must renew the lease </li></ul>
  17. 17. DHCP Initialization (1) <ul><li>Client broadcasts a discover message (DHCPDISCOVER) </li></ul><ul><ul><li>Sent via UDP to port 67 </li></ul></ul><ul><ul><li>Received by one or more DHCP servers (or relays) </li></ul></ul><ul><li>Responding servers … </li></ul><ul><ul><li>Determine configuration </li></ul></ul><ul><ul><li>Send an offer message (DHCPOFFER) to the client </li></ul></ul><ul><li>Client selects a configuration that it wants </li></ul><ul><ul><li>Sends a request message (DHCPREQUEST) to the selected server </li></ul></ul><ul><ul><li>Sends the same request message to servers not selected so they can release reserved IP address </li></ul></ul>
  18. 18. DHCP Initialization (2) <ul><li>Selected server … </li></ul><ul><ul><li>Commits configuration </li></ul></ul><ul><ul><li>Replies with an acknowledge message (DHCPACK) to complete initialization </li></ul></ul>
  19. 19. DHCP Initialization (3) Server 1 (selected) Client Server 2 (not selected) DHCPDISCOVER DHCPDISCOVER DHCPOFFER DHCPOFFER DHCPREQUEST DHCPREQUEST DHCPACK
  20. 20. Lease and Renewals (1) <ul><li>Server grants use of the IP address for a limited time, the lease time </li></ul><ul><li>Client should renew the lease about after about two-thirds of the lease time has expired </li></ul><ul><li>Lease renewal … </li></ul><ul><ul><li>Client sends DHCPREQUEST message to the original selected server via unicast </li></ul></ul><ul><ul><li>Server responds with DHCPACK message </li></ul></ul><ul><ul><li>If no response from the server, client must start again with DHCP initialization </li></ul></ul>
  21. 21. Lease and Renewals (2) Server Client DHCPREQUEST DHCPACK
  22. 22. Graceful Shutdown <ul><li>Client can perform a graceful shutdown by sending a DHCP release message (DHCPRELEASE) to the server </li></ul><ul><ul><li>Allows server to release reserved IP address </li></ul></ul><ul><li>Often, clients just shutdown and IP address is released after the lease time expires </li></ul>Server Client DHCPRELEASE
  23. 23. DHCP Options <ul><li>DHCP servers can provide optional information beyond the assigned IP address </li></ul><ul><ul><li>Default router </li></ul></ul><ul><ul><li>Subnet mask </li></ul></ul><ul><ul><li>Network Time Protocol (NTP) servers </li></ul></ul><ul><ul><li>Service Location Protocol (SLP) servers </li></ul></ul><ul><ul><li>Domain Name System (DNS) servers </li></ul></ul><ul><ul><li>Local domain name </li></ul></ul><ul><ul><li>Host name </li></ul></ul><ul><li>Request in discover or request message </li></ul><ul><li>Response in offer or acknowledge message </li></ul><ul><ul><li>Type, Length, Value (TLV) option </li></ul></ul>
  24. 24. Agenda <ul><li>Nomadic services </li></ul><ul><li>Virtual private networks (VPNs) </li></ul><ul><li>Dynamic Host Configuration Protocol (DHCP) </li></ul><ul><li>Network address translation (NAT) </li></ul><ul><li>Firewalls and packet filtering </li></ul><ul><li>HTML and web programming </li></ul><ul><li>Brief comments on a wireless “hot spot” service </li></ul>
  25. 25. Network Address Translation <ul><li>NAT “mangles” a packet’s addressing headers as it passes through a router to change either the source or destination address </li></ul><ul><li>Most common form of NAT: Network and port address translation </li></ul><ul><ul><li>A.k.a. IP Masquerading – Linux </li></ul></ul><ul><ul><li>A.k.a. Port Address Translation (PAT) – Cisco </li></ul></ul>
  26. 26. What is Masquerading? <ul><li>One-to-many translation </li></ul><ul><li>The process of routing Internet-bound traffic from a private network through a gateway router that modifies the traffic to look like its own </li></ul><ul><li>On the return, the router, demultiplexes the traffic back to the appropriate hosts by source/destination port/address pairs (remembered from transmission) </li></ul>
  27. 27. Example Configuration <ul><li>Trace a packet from Host1 to </li></ul><ul><ul><li>IP address: </li></ul></ul>Host1 Host2 Host3 Router eth1 – Internal Network – External Network .4 .3 .2 eth0 –
  28. 28. Packet Trace <ul><li>Packet sent to HTTP server at </li></ul>*Note: Masquerading changes the source port as well as source address for assured demultiplexing. Value depends on implementation. 80 65013* … routing 80 65013* Router:eth1 NAT 80 4356 Router:eth0 80 4356 Host1:eth0 Dest Prt Src Prt Dest IP Src IP Interface
  29. 29. Packet Trace (2) <ul><li>Returning packet </li></ul>4356 80 Host1:eth0 4356 80 Router:eth0 NAT 65013 80 Router:eth1 … routing 65013 80 Dest Prt Src Prt Dest IP Src IP Interface
  30. 30. Implementation of Masquerading <ul><li>Linux – built into kernel firewall </li></ul><ul><ul><li>Resident for years </li></ul></ul><ul><ul><li>ipfwadm, ipchains, iptables </li></ul></ul><ul><li>Windows – Internet Connection Sharing </li></ul><ul><ul><li>Partially with Microsoft Windows 98SE and Windows ME (only share certain interfaces) </li></ul></ul><ul><ul><li>Full implementation in Microsoft Windows 2000 and Windows XP (share any interface) </li></ul></ul>
  31. 31. Agenda <ul><li>Nomadic services </li></ul><ul><li>Virtual private networks (VPNs) </li></ul><ul><li>Dynamic Host Configuration Protocol (DHCP) </li></ul><ul><li>Network address translation (NAT) </li></ul><ul><li>Firewalls and packet filtering </li></ul><ul><li>HTML and web programming </li></ul><ul><li>Brief comments on a wireless “hot spot” service </li></ul>
  32. 32. Firewalls <ul><li>Routers with “attitude” </li></ul><ul><li>Process packets based on rules </li></ul><ul><li>Rules based on any packet characteristics or attributes </li></ul><ul><ul><li>Source and destination addresses and ports (e.g., source port 1234 from host </li></ul></ul><ul><ul><li>Protocol flags (e.g., TCP SYN, TCP ACK) </li></ul></ul><ul><ul><li>Protocol types (e.g., ICMP, UDP) </li></ul></ul><ul><ul><li>Connection status (e.g., new or established) </li></ul></ul>
  33. 33. Firewall Services Data Link Physical Transport Network Presentation Session Application Application-specific proxy, Application-specific filter Gateway, User Filter Port map, Port filter, Address map, Address filter Address map, Address filter, Protocol filter Address filter, Protocol filter
  34. 34. Types of Firewalls (1) <ul><li>Two types </li></ul><ul><ul><li>Stateful </li></ul></ul><ul><ul><li>Stateless </li></ul></ul><ul><li>Stateless </li></ul><ul><ul><li>Simple, less secure than stateful </li></ul></ul><ul><ul><li>Makes decisions based on individual packet information </li></ul></ul><ul><ul><li>Does not maintain any connection status </li></ul></ul><ul><ul><li>Example: </li></ul></ul><ul><ul><ul><li>Allow all traffic inbound with destination port 80 </li></ul></ul></ul><ul><ul><ul><li>Deny all traffic from on the external interface </li></ul></ul></ul>
  35. 35. Types of Firewalls (2) <ul><li>Stateful </li></ul><ul><ul><li>All the attributes of a stateless firewall plus … </li></ul></ul><ul><ul><li>Connection status (context for decisions) </li></ul></ul><ul><ul><ul><li>Watches traffic for SYN, ACK, and FIN packets </li></ul></ul></ul><ul><ul><ul><li>Knows connection status (established, initiating) </li></ul></ul></ul><ul><ul><li>More complex, better security </li></ul></ul><ul><ul><li>Example: </li></ul></ul><ul><ul><ul><li>Deny all ICMP Echo Reply packets not associated with an Echo Request </li></ul></ul></ul><ul><ul><ul><li>Deny all TCP sessions not initiated from the inside network </li></ul></ul></ul>
  36. 36. Firewall Implementations <ul><li>Implementations </li></ul><ul><ul><li>Hardware and software </li></ul></ul><ul><li>Hardware (network devices) </li></ul><ul><ul><li>Cisco PIX, Sonicwall, Watchguard Firebox </li></ul></ul><ul><li>Software (applications) </li></ul><ul><ul><li>Windows – ZoneAlarm, Norton Personal Firewall, BlackICE </li></ul></ul><ul><ul><li>Unix and variants – ipfw, ipchains, iptables, ipf </li></ul></ul>
  37. 37. iptables (1) <ul><li>Linux firewall (and more) </li></ul><ul><li>Present with the 2.4 series kernel </li></ul><ul><li>Part of the netfilter project </li></ul><ul><ul><li> </li></ul></ul><ul><li>Consists of two parts </li></ul><ul><ul><li>Firewall code in the kernel </li></ul></ul><ul><ul><li>User space “iptables” executable to manipulate kernel code </li></ul></ul>Oskar Andreasson , Iptables Tutorial 1.1.19,
  38. 38. iptables (2) <ul><li>Three parts </li></ul><ul><ul><li>Rules </li></ul></ul><ul><ul><li>Chains </li></ul></ul><ul><ul><li>Tables </li></ul></ul>
  39. 39. iptables (3) <ul><li>Rule </li></ul><ul><ul><li>Lowest-level (most basic) entity in firewalling </li></ul></ul><ul><ul><li>A single tuple of what to do (action) and packets to which to apply the action (filter) </li></ul></ul><ul><ul><li>Filter – identifies packets to which the rule applies </li></ul></ul><ul><ul><ul><li>Addresses, ports, status </li></ul></ul></ul><ul><ul><li>Action – what to do with the packet (stream) </li></ul></ul><ul><ul><ul><li>Accept, reject (drop, but reply with ICMP error message), drop, redirect, masquerade, go to another chain, and more </li></ul></ul></ul>
  40. 40. iptables (4) <ul><li>Chains </li></ul><ul><ul><li>An ordered list of rules </li></ul></ul><ul><ul><li>Traversed in order </li></ul></ul><ul><ul><li>The first matching rule in the chain is selected </li></ul></ul><ul><ul><li>Important predefined chains in FILTER table </li></ul></ul><ul><ul><ul><li>INPUT – all incoming packets go here </li></ul></ul></ul><ul><ul><ul><li>FORWARD – packets to be routed </li></ul></ul></ul><ul><ul><ul><li>OUTPUT – all outgoing packets go here </li></ul></ul></ul>
  41. 41. iptables (5) <ul><li>Tables </li></ul><ul><ul><li>Separate different types of operations </li></ul></ul><ul><ul><li>Three built-in tables </li></ul></ul><ul><ul><ul><li>FILTER – general filtering </li></ul></ul></ul><ul><ul><ul><li>NAT – dealing with network address translation </li></ul></ul></ul><ul><ul><ul><li>MANGLE – other packet changes </li></ul></ul></ul><ul><ul><li>Each contain multiple chains </li></ul></ul>
  42. 42. iptables (6) <ul><li>Incoming packet traversal </li></ul>Example: Setting DSCP Example: Redirecting Example: Typical Firewall Functions Example: Typical Firewall Functions
  43. 43. iptables (7) <ul><li>Outgoing packet traversal </li></ul>Example: IP Masquerading Example: Typical Firewall Functions
  44. 44. iptables (8) <ul><li>Rule placement </li></ul><ul><ul><li>Rule type specifies table </li></ul></ul><ul><ul><ul><li>Address translation and IP masquerading map to the NAT table </li></ul></ul></ul><ul><ul><ul><li>Simple packet filtering maps to the filter table </li></ul></ul></ul><ul><ul><li>Rule stage specifies chain </li></ul></ul><ul><ul><ul><li>Prerouting versus postrouting </li></ul></ul></ul><ul><ul><ul><li>Traffic from local application versus forwarded traffic </li></ul></ul></ul>
  45. 45. Firewall Comments <ul><li>“ Good” firewall rules are difficult to write </li></ul><ul><ul><li>Must consider all possible traffic </li></ul></ul><ul><ul><li>Only allow what should pass </li></ul></ul><ul><li>Stateful firewalls are more secure (and more complex) than stateless firewalls </li></ul><ul><li>Stepping forward </li></ul><ul><ul><li>Intrusion Detection System (IDS) – “smarter” stateful firewall </li></ul></ul>
  46. 46. Agenda <ul><li>Nomadic services </li></ul><ul><li>Virtual private networks (VPNs) </li></ul><ul><li>Dynamic Host Configuration Protocol (DHCP) </li></ul><ul><li>Network address translation (NAT) </li></ul><ul><li>Firewalls and packet filtering </li></ul><ul><li>HTML and web programming </li></ul><ul><li>Brief comments on a wireless “hot spot” service </li></ul>
  47. 47. Web-Based Authentication <ul><li>Consider a wireless LAN “hot spot” service </li></ul><ul><li>This will require consideration and use of… </li></ul><ul><ul><li>DHCP </li></ul></ul><ul><ul><li>Firewalling </li></ul></ul><ul><ul><li>Authentication </li></ul></ul><ul><ul><li>IP masquerading (NAT) </li></ul></ul><ul><li>Authentication is commonly done using a web-based scheme − here is one approach… </li></ul><ul><ul><li>The first attempt to access any web page is redirected to an authentication page for the service </li></ul></ul><ul><ul><li>A script or program must perform authentication and updates the configuration to allow access, if appropriate </li></ul></ul>
  48. 48. HTML <ul><li>HyperText Markup Language (HTML) </li></ul><ul><ul><li>Web page “language” (content) </li></ul></ul><ul><ul><li>Currently in version 4.01 </li></ul></ul><ul><ul><li>Maintained by the World Wide Web Consortium (W3C) </li></ul></ul><ul><ul><ul><li> </li></ul></ul></ul><ul><ul><li>Uses “tags”: < begin_tag>text</end_tag > </li></ul></ul><ul><ul><li>Formatting language </li></ul></ul><ul><ul><ul><li>Take data and add formatting, pictures, input, and/or links </li></ul></ul></ul>
  49. 49. HTML (2) <ul><li>Many extensions and add-ons </li></ul><ul><ul><li>Responsible for rich web content </li></ul></ul><ul><li>Tags interpreted by web browser; no server processing involved </li></ul><ul><li>May be edited by hand or with a WYSWYG editor </li></ul><ul><ul><li>By hand: notepad, emacs, vi </li></ul></ul><ul><ul><li>WYSWYG: MS Frontpage, Dreamweaver </li></ul></ul>
  50. 50. Web Programming <ul><li>Common Gateway Interface (CGI) </li></ul><ul><ul><li>A way for web servers to interact with standard programs to generate dynamic web content </li></ul></ul><ul><ul><li>Input typically HTML form data </li></ul></ul><ul><ul><li>Output dynamic content (web pages) </li></ul></ul><ul><ul><li>Can be written using C++, Perl, Fortran, or PHP </li></ul></ul><ul><ul><li>Can do many functions with the appropriate library </li></ul></ul>(1) URL, param (5) HTML, text, … (2) CGI (4) HTML, text, … Web Browser HTTP Server Gateway Program (3) Process
  51. 51. Web Programming (2) <ul><li>Model </li></ul><ul><ul><li>Client request </li></ul></ul><ul><ul><li>Server reference </li></ul></ul><ul><ul><li>Server processing (CGI, SSI, PHP) </li></ul></ul><ul><ul><li>Request sent to client </li></ul></ul><ul><ul><li>Browser processing (JavaScript, HTML, CSS) </li></ul></ul>
  52. 52. No Experience? <ul><li>PHP suggested for those with no experience with web programming </li></ul><ul><li>PHP code is embedded in HTML code </li></ul><ul><ul><li>No compilation </li></ul></ul><ul><ul><li>Quick editing </li></ul></ul><ul><li>Familiar syntax </li></ul><ul><ul><li>Borrows syntax “look and feel” from Java, Perl, and C++ </li></ul></ul>
  53. 53. Agenda <ul><li>Nomadic services </li></ul><ul><li>Virtual private networks (VPNs) </li></ul><ul><li>Dynamic Host Configuration Protocol (DHCP) </li></ul><ul><li>Network address translation (NAT) </li></ul><ul><li>Firewalls and packet filtering </li></ul><ul><li>HTML and web programming </li></ul><ul><li>Brief comments on a wireless “hot spot” service </li></ul>
  54. 54. A Test Network Configuration <ul><li>DHCP server </li></ul><ul><li>Firewall </li></ul><ul><li>IP masquerading </li></ul><ul><li>Web-based authentication </li></ul>Private Network “ Public” Internet Private Public
  55. 55. Summary <ul><li>Nomadic services enable Internet access </li></ul><ul><ul><li>Security, addressing, filtering </li></ul></ul><ul><li>VPNs provide authentication and privacy for nomadic users and protect private networks </li></ul><ul><li>DHCP allows nomadic users to obtain an IP address and other configuration information </li></ul><ul><li>NAT conserves addresses in private networks, allowing support for nomadic hosts </li></ul><ul><li>Firewalls and packet filtering provide security and enable access control </li></ul><ul><li>HTML and web programming can be used to authenticate nomadic users for a hot spot service </li></ul>