When can private IP adresses be used? Example
When global connectivity is not required
-> Only local communication enough…
=> local network
=> private network where only one or more gateways are (globally) visible
What IP address ranged are not globally routed and why?
private IP addresses
10.0.0.0/8
172.16.0.0/12
192.168.0.0/16
Do all IP addresses need to be globally unique?
NO
-> private IP address ranges only need to be unique locally
What does NAT stand for?
network address translation
What functionality of NAT did we use in the lab? What are alternative names for it?
map many local IP addresses to one single public IP address
=> IP Masquerading
=> Port Address Translation (PAT)
=> Network Address and Port Translation (NAPT)
Does NAT allow for incoming conectoins?
No -> impossible
Why are incoming connections in NAT impossible?
NAT only holds information about active connections that it translates…
=> cannot establish new connection from outside…
Do ICMP messages go through NAT?
no, even ones belonging to active connections
-> have to be filterd and relaed by the NAT router
What is a basic problem of NAT?
Breaks TCP/IP semantic
=> only translates IP header and not rest
=> i.e. ftp uses IP address in protocol -> is not translated in NAT…
Why is NAT often considered to be a solution to the IP address depletion?
NAT more efficient use of public address range
making more extensive use of IP addresses and their respective port numbers
NAT translates many local IP addresses to one global IP address that are only distinguishable by the use of other ports, or few global IP addresses
Why does NAT destroys a host’s end-to-end communnicaoitn capabilities?
NAT always used as proxy
local computer cannot be reached by other computer (without additional configuration)
Which IP header fields might be changed by NAT?
source IP
TTL
header checksum
destination IP
What kind of address translations can NAT64 perform?
IPv4 to IPv6
IPv6 to IPv4
What does ftp stand for?
file transfer protocol
What does dhcp stands for?
Dynamic host configuration protocol
What does dhcp allow?
computer to learn about their network config
subnet mask
defaukt gateway
IP address
DNS servers
lease duration
How can DHCP assign ip addresses?
dynamically
out of pool of pre-specified IP addresses
-> can be reassigned later (if not statically assigned)
What DHCP message types are there?
DHCPDISCOVER
DHCPOFFER
DHCPREQUEST
DHCPACK
DHCPNACK
DHCPDECLINE
DHCPRELEASE
DHCPINFORM
What is DHCP discover used for?
client broadcast to locate available servers
What is dhcp offer used for?
server to client response to dhcp discover
with offering of config parameters
what is dhcp request used for?
client to serverS either
(a) request offered parameters frome one server and implicity decline offers from all other servers
(b) confirm correctnes of previously allocated address after e.g. system reboot
(c) extend lease on particular network address
What is dhcp ack used for?
server to client
with config parameters including commited network address (that are acknowledged after the request)
What is dhcp nak used fro?
indicate cluents notion of network address is incorrect
=> e.g. client has moved to new subnet,, or clients lease is expired…
What is dhcp decline used for?
client to server
offered IP already in use
What is DHCP release used for?
relinquish network address and calcel remaining lease
What is dhcp inform used for?
ask only for local config paraeters
-> client already has externally configured network address…
What is the reply to an dhcp inform?
dhcp ack message
What are dhcp/bootp relay agents used for?
communicate dhcp messages between client and server in different subnets
used where presence of dedicated dhcp server on each physical network segment not viable/preferred
What fields are in dhcp messages?
op (opcode/message type)
htpye (hardware address type)
hlen (hardware address length , e.g. 6 for ethernet)
hops (usually set to 0 by client, used by dhcp relay agents)
xid (transaction id)
secs (filled by client, secods since began address acquisition)
flags (flags…)
ciaddr (client ip address (if bound, renew or rebinding) -> only when already has ip)
yiaddr (new IP address for client -> “your ip address))
siadr (ip address of dhcp server, returned in dhcp offer and dhcp ack)
giaddr (ip address of relay agent)
chaddr (client hardware address)
sname (server host name)
file (boot file name)
options
Who and how is xid chosen?
transaction id
random number chosen by client
used to associate messages and responses sent by server and clietn
Exaples for options in dhcp messages
broadcast address
domain name
domain name server
host name
Is it important what clietn id to use?
yes
-> client msut adhere to same client ip for all subsequent messsages after first use
A client's lease can be uniquely identified by the combination of the 'chaddr' or 'client ID' and the network address of the server.
wrong
What must the dhcp ack config paramerters conform to ?
same parameters as in the dhcp offer
How can a clients lease be uniquely identified?
combination of
chaddr
client ID
bound network address (of client)
What transport protocol does dhcp employ?
udp
Name a mandatory option in dhcp
53 (message type)
-> mandatory in every dhcp message…
How can a client request desired configuration parametrs (e.g. network address)?
including them in dhcp options
Is dhcp obsolete in IPv6?
Basic functinlaity covered by slaac (ip adderess assignment)
-> DHCPv6 can nevertheless be used for:
dns informaitno
ntp server
etc.
also offers stateful adress config
How can a server indicate that it is willing to perform statefull address autoconfig?
set managed-flag in router advertisement
When the managed flag is set, are clients forced to perform stateful address cnfig?
no -> only offer…
can still use slaac
what link scope multicast addresses are used in dhcpv6 for clients to communicate with on-link relay agents and servers?
ff02::1:2
What site scope multicast address is used by relay agent to communicate with server?
ff05::1:3
Who creates and possesses DUID? (dhcp unique identifier)
cliients as well as servers have unique DUID
What are two properties DUID should fulfill?
What mechanism is used to inform routers about available prefixes?
prefix delegation
What elements are present in prefix delegatoin from an IPS standpoint?
provider edge (router)
customer premise equipment (router)
-> PE managed by ISP and delegatin prefixes to CPE that can advertise them (SLAAC; DHCPv6,…)
Are hosts involved in prefix delegatoin?
no
What is the identity association for prefix delegation option and the IA_PD prefx option?
has to be cncluded in dhcpv6 messages
timers indicating when lifetime of requested prefixes should be refreshed
IA_DP contains requested prefixes and contains information such as validity timters for prefix
Does a router require information of the topology of the links it is delegating the prefixes to?
Do routers in a customers network need to report further delegations back?
Is the prefix delegation length restricted?
What roles do the delegating and receiving router play during delegation=
delegating: DHCP server
receiving: DHCP client
How many prefix celegations are trasmitted at once?
in bulk, not a single address…
What are IA_PDs equivalent to in regular dhcp stuff?
equivalent to the IA for address
Can the client hint what prefixes it wants to acquire in prefix delegatin?
-> include them in IA_PDs
What must be unique at a requesting router for IA_PD?
IAID for all specific IA_PDs of requesting router must be unique
Is an IA_PD associated with a specific interface?
What is a chain in nftables?
container for rules
basechain -> entry point for packets from networking stack
regular chain -> jump target (better rule organization)
What types of chains are in nftables?
filter
nat
route
What are hooks in nftable?
hooks call base chains located in hooks
-> define at which point in packet lifecycle the rules are called and thus packets processed via nftables
What types of hooks are available in nftabelsß
prerouting
input
forward
output
postrouting
What is the prerouting hook used for?
filtering packets before packet reaches routing system of os
=> every pacet that enters the system… (also used to change packet attributes affecting the routing process)
What is the postroutig hook in nftables?
filtering packets after the routing decisions of the os
=> every packet about to leave the system
What is PAT?
port address translation
maps port numbers to private ip addresses
=> allows for single public IP…
What might be a problem for PAT an ICMP, how is it solved?
ICMP has no port numbers…
use ICMP’s id to map incoming echo replies to specific IP address
=> outgoing ICMP echo request id gets translated by NAT to be unique… (in case it has to handle more than one…)
=> has thus also to recalculate ICMP header checksum
What has to be considered using ftp and NAT?
ftp has active or passive mode
-> active mode: ftp server establishes connection back to client… => works not in NAT as address and port is in payload (and thus not changed by NAT rotuer)
=> ftp server returns illegal port command (as PORT command contains privaet ip in payload…)
=> use passive mode
What is the difference in ftp passive and active mode?
passive mode: client establishes connection to server
active server establishes connection to client
How does passive mode in ftp work?
client sends PASV command
server respons with IP and prot client should connect to
client connects
How many messages are exchanged between client and dhcp server to get a lease? Which?
4
client sends DHCP discover (to find dhcp servers)
server responds with DHCP offer (to offer IP address)
client replies to offer with DHCP request (again broadcast and same addresses as in dhcp discover) (actively request offered things)
server acknowledges with DHCP ACK (IP still free to use and client now allowed to take ut)
Why are four messages exchanged in DHCP lease acquirements?
DHCP avoids assigning same IP to different hotst
-> if only discover and offer -> dhcp does not know what is taken…
-> if only discover, offer and request -> two clients could request the same…
Does PCs get the same IP by dhcp after rebooting?
potentially
-> might still have valid lease file.( not timed out…)
=> DCHP discover contains additional option (50) requested iP address that re-requests ip fro previous lease…)
What timers are present in elase files?
renew
rebind
expire
What is the funcion of the renew timer in the elase file?
usually 50% of lease time
when 0 -> client transits to renewal state
tries to renew lease by sending DHCP request
if succeees -> DHCP server answers with dhcp ack
What funciton does the rebind timer have in a lease file?
usually 75% of lease time
when 0 (e.g. dhcp server not acknowledging)
client transisitno to rebinding state
tries to renew lease by sendoing out DHCP requests
broadcast not unicast like in renew state to reach and DHCP server
What function does the expire timer have in lease files?
undo dhcp based configs
-> have to start dhcp process from the beginning…
What ports to client and server use in DHCP?
server UDP 67
client UDP 68
What is the reason for dhcps port choice?
dhcp bases on bootp (makes use of well known ports)
=> lecagy: BOOTP uses broadcast to assign IP to client
=> if client use arbitrary port (1025-60565)
=> might happen that other client coincidentially also listents to this port…
=> confusing it with unexpected message…
What is a IP_PD?
identity associatoin for prefix delegation
groutp together, identify and manage set of related IPv6 prefixes
between requesting and delegating router
=> uniquely identified by IAID (identity association id)
can be bound to client, multiple interface, or one interface
How do clients get IA_PDs?
in regular solicitations -> IA_PD included (with associated IAID)
dhcp server sends advertisement -> assigns prefix address to IA_PD from solicitation
contains additional data
T1, T2 timers
IA_PD data length
prefix lenght
valid lifetime
client then again requests the assigned prefix
and server then replies again containing the same information…
To whom are solicitations sent and how does dhcp servers know the client chose it?
solicitation -> all dhcp servers
request -> client includes the server identifier (wih unique server id DUID)
What are T1 and T2 timer in ia_pd ised?
t1: when 0 client expected to contact server that did assignment to extend lifetome of address assigned
t2: contacy any dhcp client to renew
What happens when a clien has a prefix delegation and sets its interface down and up again?
tries to rebind using lesae file
provides client identifier as wel as IA_ID including prefixes client associates with IA_PD
=> delegating router checks IP_PD in rebind message
wether prefxes in IA_PD are contained in binding entry corresponding to the requestin router..
if not: return prefix with lifetimes set to 0 else send with updated lifetimes…
What is stateless dhcp?
DHCP to share regular informatino (an no addresses)
=> dhcp server does not have to keep track whom it shared information with…
i.e. dns informatino, …
What is a DUID?
dhcp unique identifier
-> used to uniquely identify things in dhcp
can be:
link layer address plus time
vendor assigned unique ID
link layer address
universally unique identifier
What are some mitigation strategies for IPv4 address scarcity?
more efficient use of address space
e.g. use unrouted addresses, address trading
create more addresses
IPv6
address sharing
NAT (and dhcp)
What are downsides in IPv4 address trading?
costly
opaque, transactions nit public
What are drawbacks in IPv6 for address scarcity?
deployment…
-> requires end-to-end support
server side: content providers
network path: ISP and transit providers
client-side: content consumers
=> still in process…
What are properties of address sharing (private ipv4 address range)?
anyone can use these UP address ranges in their own network
addresses are not routed in the public Internet
Internet access through address translation → NAT
What private IP address ranges are there?
RFC 1918 reserves the following IPv4 address ranges
RFC 6598 reserves an additional range for ISP networks
100.64.0.0/10
RFC 4193 specifies Unique Local IPv6 addresses
fc00::/7
How does NAT basically work?
sits in-beetween private network and internet (router…)
-> outgoing packets: replace private IP with public one and change source port to a unique one to identify incoming packets
-> incoming packets: lookup the dst port and then map the dest IP to the private IP
How does NAT keep track of connections?
NAT table
-> hold global endpoint (IP and PORT that replaced the private iP and the port)
-> and local endpoint (Private IP and port used by the host in the private network )
=> in one row…
What is the state of deployment in NAT?
today the majority of end users are located behind NAT (+ other middleboxes)
no standardization of NAT → many different implementations
transparent to the public Internet
What are benefits of NAT?
effectively saves IP addresses: allows ∼65,000 simultaneous flows with a single public IP address
address independence: public/private IP addresses can be changed independently
topology hiding: devices inside local network are not explicitly addressable/visible from outside
What are problems of NAT?
connections can only be established from the local network
ports should not be used to address hosts
routers should not manipulate packets above layer 2 (end-to-end principle)
Which protocols does NAT affect?
server located in the local network
any service behind NAT, peer-to-peer applications
realm-specific IP address information in payload
e.g. SIP, FTP
bundled session applications
protocols using multiple connections, e.g. active FTP
unsupported protocols
e.g. SCTP, IPsec
How can the problem of NAT that only outgoing connections can be established be mitigated?
port forwarding
application layer gateway (ALG)
hole punching
What is port forwarding and how does it solve a problem of NAT?
create static entry in NAT table (manually or via protocol) that allows to reach a host specified by the entry…
=> requires support in NAT and end hosts
What is application layer gateway and how does it solve NAT?
nat analyzes and rewrites application layer protocols (e.g. FTP, where IP and Port are specified in the payload…)
requires support for every protocol in the NAT device
What is hole punching?
two clients behind NAT try to estbailsh connection
-> exists rendez-vous server (i.e. with static IP)
-> both clients establish connection with rendez-vous server
-> server transmits IP and port from session with client 2 to client 1 and vice versa
client 1 and client 2 send trash message to the received IP and port => respective NAT creates entries for established connection and lets incoming stuff through…
!!! Requires consistent translations so that port is reused…
What are relay servers in the scope of NAT?
similar to hole punching
-> establish connetion to relay server
=> communication happens over relay server
=> disadvantage: latency and bandwidht (potential bottleneck)
How to evaluate the transition fro IPv4 to IPv6?
ongoing
-> ISP still need to provide IPv4 functionality
extend lifetime of IPv4: Carrier grade NAT
or choose between large scale NAT vs aqusition of more Ipv4 addresses
What is large scale nat?
i.e. ISP in cellular networks assigns private IP to end devices and has NAT inbetwen them and internet
What is carrier grade nat?
type of large scale nat
-> where i.e. two lines of NAT
What are some Ipv6 transision techniques?
dual stack lite
464XLAT
What is dual stack lite?
combines global IPv6 and carrier grade NAT
-> ISP assigns private IPv4 and global IPv6 to customer premise equipemnt
What is 464XLAT?
customer has private IPv4
CLAT (translates IPv4 to IPv6) to communicate over ISP network
ISP has PLAT that then translates IPv6 to IP4 again to communicate with internet (NAT64 and DNS64)
IPv6 to IPv4 using PLAT
IPv6 to IPv6 direct
=> translation done with stateless IP/ICMP translation (SIIT)
Effects of wide spread NAT?
slows down adoption of IPv6
will be around until no one uses IPv4 anymore
Evaluation carrier grade nat?
limited control over NAT function (e.g. no port forwarding)
multiple customers share same pubblic IP address
hampers criminal prosecution based on IP address
customers can interfere wich each otehr
number of concurrent connectoins
logging each mapping is expensive
bulk port allocation
What is the motivation to use DHCP?
manual network config of hosts not scalable
What are the general concepts of DHCP?
automated configuration of network parameters e.g. IP addresses, subnets, gateway, DNS server, etc.
UDP-based client-server protocol
servers lease IP addresses to clients for a certain amount of time
stateful server, can make decisions based on client history
extensible through DHCP options
What protocol does DHCPv4 use?
UDP protocol on top of IPv4 (server port 67, client port 68)
uses IPv4 broadcast packets
What message types are in DHCPv4?
discover message: client announces its presence in the network (L2 broadcast)
offer message: server(s) make a lease offer to the client.
request message: client accepts an offer and requests the offered configuration (L2 broadcast)
implicitly denies offers of other servers
is also used to extend the lease of a currently used configuration
acknowledge message: server leases a configuration to the client
What protcol does DHCPv6 use?
UDP protocol on top of IPv6 (server port 547, client port 546)
protocol sequence similar to DHCPv4
uses IPv6 multicast packets
uses DHCP Unique Identifiers (DUIDs) to identify the client instead of MAC addresses
Differences DHCPv6 vs SLAAC?
DHCPv6 can complement SLAAC or completely replace it
DHCPv6 provides more configuration parameters than SLAAC (and can easily be extended) e.g. DNS server configuration: router advertisements require RDNSS extension (RFC6106), not supported by all clients
DHCPv6 allows fine-grained control over the allocated addresses and centralized address logging
What are recommendations in prefix delegation?
ISP assign /48 to customer, /64 in mobile entworks
What are security considerations in DHCP?
No Authentication of DHCP-Server
No Authentication of Clients
Last changed2 years ago