DNS & Nat & VPN
DNS & Nat & VPN
Architecture: Zone
From data
Name Server Process
disk file
Authoritative Data Master
Zone transfer server
(primary master and
slave zones)
Cache Data
(responses from
other name servers)
Agent
(looks up queries
on behalf of resolvers)
8
DNS Message Format
Header (12 bytes) Header (12 bytes)
Question section Question section
Number of
Number of Additional section
Answer Records
Question Records
(zeroed in query) 0 no error
1 format error
2 problem at name server
Number of Auth- Number of 3 domain reference problem
oritative Records Additional Records 4 query type not supported
(Zeroed in query) (zeroed in query)
5 administratively prohibited
6-15 reserved
0 = query,
1 = response QR OpCode AA TC RD RA 0 0 0 rCode
0 = standard, 1 = inverse, Authoritative Recursion Available flag
2 = server status request Answer flag Truncated flag Recursion Desired flag 9
Transport
IP UDP
DNS message
header header
IP TCP 2-byte
DNS msg. DNS message
header header length 10
There are a limited number of top-level domains
(TLDs), including:
• .edu, educational
• .com, commercial
• .gov, government
• .org, non profit
• .net, networking organizations
• http://www.google.co.uk/
• http://www.unam.edu.mx/
• http://www.ox.ac.uk/
• http://www.google.com.mx/
Global Distribution
• Data is maintained locally, but retrievable
globally
– No single computer has all DNS data
• DNS lookups can be performed by any device
• Remote DNS data is locally cachable to
improve performance
Loose Coherency
• Each version of a subset of the database (a zone) has
a serial number
– The serial number is incremented on each database change
• Changes to the master copy of the database are
propagated to replicas according to timing set by the
zone administrator
• Cached data expires according to timeout set by zone
administrator
Scalability
• No limit to the size of the database
• No limit to the number of queries
– Tens of thousands of queries handled easily every
second
• Queries distributed among masters, slaves,
and caches
Reliability
• Data is replicated
– Data from master is copied to multiple slaves
• Clients can query
– Master server
– Any of the copies at slave servers
• Clients will typically query local caches
• DNS protocols can use either UDP or TCP
– If UDP, DNS protocol handles retransmission, sequencing,
etc.
Dynamicity
• Database can be updated dynamically
– Add/delete/modify of any record
– Only master can be dynamically updated
dakota tornado
Internet Corporation for Assigned Names
and Numbers (ICANN)
• ICANN’s role: to oversee the management of Internet
resources including
– Addresses
• Delegating blocks of addresses to the regional registries
– Protocol identifiers and parameters
• Allocating port numbers, etc.
– Names
• Administration of the root zone file
• Oversee the operation of the root name servers
The Root Nameservers
• The root zone file lists the names and IP addresses of
the authoritative DNS servers for all top-level
domains (TLDs)
Registrants
Load Concerns
• DNS can handle the load
– DNS root servers get approximately 3000 queries
per second
• Empirical proofs (DDoS attacks) show root name
servers can handle 50,000 queries per second
– Limitation is network bandwidth, not the DNS protocol
– in-addr.arpa zone, which translates numbers to
names, gets about 2000 queries per second
Performance Concerns
• DNS is a very lightweight protocol
– Simple query – response
• Any performance limitations are the result of
network limitations
– Speed of light
– Network congestion
– Switching/forwarding latencies
Security Concerns
• Base DNS protocol (RFC 1034, 1035) is insecure
– DNS spoofing (cache poisoning) attacks are possible
• DNS Security Enhancements (DNSSEC, RFC 2565)
remedies this flaw
– But creates new ones
• DoS attacks
• Amplification attacks
• DNSSEC strongly discourages large flat zones
– Hierarchy (delegation) is good
Network Address Translation
• RFC-1631
• A short term solution to the problem of the
depletion of IP addresses
– Long term solution is IP v6 (or whatever is finally
agreed on)
– CIDR (Classless InterDomain Routing ) is a possible
short term solution
– NAT is another
• NAT is a way to conserve IP addresses
– Hide a number of hosts behind a single IP address
– Use:
• 10.0.0.0-10.255.255.255,
• 172.16.0.0-172.32.255.255 or
• 192.168.0.0-192.168.255.255 for local networks
Network Address Translation (NAT)
• NAT is a router function where IP addresses (and
possibly port numbers) of IP datagrams are replaced at
the boundary of a private network
30
Basic Operation of NAT
32
Pooling of IP Addresses
Private Internet
network
Private Public
Address Address
10.0.1.2
33
Supporting Migration between Network Service
Providers
• Scenario: In CIDR, the IP addresses in a corporate network are obtained
from the service provider. Changing the service provider requires changing
all IP addresses in the network.
• NAT solution:
– Assign private addresses to the hosts of the corporate network
– NAT device has static address translation entries which bind the
private address of a host to the public address.
– Migration to a new network service provider merely requires an
update of the NAT device. The migration is not noticeable to the hosts
on the network.
Note:
– The difference to the use of NAT with IP address pooling is that the
mapping of public and private IP addresses is static.
34
Supporting Migration between network service
Providers
35
IP Masquerading
• Also called: Network address and port
translation (NAPT), port address translation
(PAT).
• Scenario: Single public IP address is mapped to
multiple hosts in a private network.
• NAT solution:
– Assign private addresses to the hosts of the corporate
network
– NAT device modifies the port numbers for outgoing
traffic
36
IP Masquerading
37
Translation Modes
• Dynamic Translation (IP Masquerading)
– large number of internal users share a single external address
• Static Translation
– a block external addresses are translated to a same size block of
internal addresses
• Load Balancing Translation
– a single incoming IP address is distributed across a number of
internal servers
• Network Redundancy Translation
– multiple internet connections are attached to a NAT Firewall that
it chooses and uses based on bandwidth, congestion and
availability.
Dynamic Translation (IP Masquerading )
• Also called Network Address and Port Translation (NAPT)
• Individual hosts inside the Firewall are identified based on of each
connection flowing through the firewall.
– Since a connection doesn’t exist until an internal host requests a
connection through the firewall to an external host, and most Firewalls
only open ports only for the addressed host only that host can route back
into the internal network
• IP Source routing could route back in; but, most Firewalls block
incoming source routed packets
• NAT only prevents external hosts from making connections to internal
hosts.
• Some protocols won’t work; protocols that rely on separate
connections back into the local network
• Theoretical max of 216 connections, actual is much less
Static Translation
• Map a range of external address to the same size block of internal
addresses
– Firewall just does a simple translation of each address
• Port forwarding - map a specific port to come through the Firewall rather
than all ports; useful to expose a specific service on the internal network
to the public network
Load Balancing
• A firewall that will dynamically map a request to a pool of identical clone
machines
– often done for really busy web sites
– each clone must have a way to notify the Firewall of its current load so the
Fire wall can choose a target machine
– or the firewall just uses a dispatching algorithm like round robin
• Only works for stateless protocols (like HTTP)
Network Redundancy
• Can be used to provide automatic fail-over of servers or load balancing
• Firewall is connected to multiple ISP with a masquerade for each ISP and
chooses which ISP to use based on client load
– kind of like reverse load balancing
– a dead ISP will be treated as a fully loaded one and the client will be routed
through another ISP
Problems with NAT
• Can’t be used with:
– protocols that require a separate back-channel
– protocols that encrypt TCP headers
– embed TCP address info
– specifically use original IP for some security reason
NAT Summary
• NAT provides transparent and bi-directional
connectivity between networks having arbitrary
addressing schemes
44
NAT Limitations
• Applications with IP-address content
– Need AGL (Application Level Gateway)
45
Extra: Hacking through NAT
• Static Translation
– offers no protection of internal hosts
• Internal Host Seduction
– internals go to the hacker
• e-mail attachments – Trojan Horse virus’
• peer-to-peer connections
• hacker run porn and gambling sites
– solution = application level proxies
• State Table Timeout Problem
– hacker could hijack a stale connection before it is timed out
– very low probability but smart hacker could do it
• Source Routing through NAT
– if the hacker knows an internal address they can source route a packet to
that host
• solution is to not allow source routed packets through the firewall
VPN
VPN
VPN
VPN
VPN is a private connection between two systems or
networks over a shared or public network (typically
Internet).
VPN technology lets an organization securely extend its
network services over the Internet to remote users, branch
offices, and partner companies.
In other words, VPN turns the Internet into a simulated
private WAN.
VPN is very appealing since the Internet has a global
presence, and its use is now standard practice for most
users and organizations.
VPN
VPN
VPN