ARP Table
mapping of IP to MAC.
MAC Address Table
mapping of SwitchPorts to MAC.
Routing Table
mapping of IP Networks to Interfaces.
populated from Directly Connected interfaces.
NAT
TERMS: Inside Global \ Inside Local \ Outside Local \ Outside Global
Inside vs Outside: physical location of the Host.
Local vs Global: perspective you are viewing Host from.
NAT (Network Address Translation)
only changes L3 header (IP addresses).
PAT (Port Address Translation)
modifies L3 (IP addresses) & L4 headers (Ports).
Static translation
admin defines PRE- & POST-translation attributes.
exp: translate [Link] to [Link].
Dynamic translation
translation device chooses POST-translation attributes.
exp: translate anything in [Link]/24 to [Link], [Link], or [Link].
Static NAT
bidirectional translation.
1:1 mapping between a PRIVATE IP to a PUBLIC IP.
makes internal resources externally accessible.
INBOUND packet: Destination is translated.
OUTBOUND packet: Source is translated.
does not conserve any addresses.
every internal host will have their own public address.
Static PAT
bidirectional translation.
1:1 mapping between a PRIVATE IP:Port to a PUBLIC IP:PORT.
makes internal resource ports externally accessible.
facilitates using Non-Standard Ports.
Port Forwarding / Hole Punching.
can conserve IP address space.
multiple internal hosts using the same public address, w/ different ports.
Dynamic PAT
unidirectional translation.
greatest potential for IPs conservation.
allows many hosts with Private IPs to share one Public IP.
(Many to One, One to Many)
translation device assigns unique source ports to each OUTBOUND connection
such that the response traffic can be translated successfully to the initiating
host.
each shared Public IP allows ~65,000 concurrent connections.
can use multiple Public IPs to allow more than ~65,000 connections.
Figure 1: Dynamic PAT Outbound
Figure 2: Dynamic PAT Inbound
src ports are re-randomised
assures each host has a unique IP:Port on the outside.
ensures router can un-translate packet back to original host.
Figure 3: Dynamic PAT initiated by Outside Host
traffic is dropped due to no translation entry exists.
[Link] is UNIdirectional – traffic must be initiated from Inside, unless we combine
[Link] to allow specific internal port to be accessed externally.
Dynamic NAT
bidirectional while connection is active.
ports are NOT translated.
multiple devices cannot share an IP.
Figure 4: Dynamic NAT
Use Cases:
1. protocols which require secondary, INBOUND connections to Client. File Transfer
Protocol (FTP).
2. Lazy “Static NAT”:
a) no. of hosts is EQUAL to no. of IPs in translation.
b) exact mapping of Private IPs to Public IPs is irrelevant.
Disadvantages:
non-Deterministic IP assignments (host’s IP keeps changing).
inconsistent connectivity (other host will claim the same IP after not being
used).
TCP (Transmission Control Protocol)
connection oriented (has START & END).
reliable:
confirmation of data delivery.
sender is aware of errors.
data is delivered in order @ Application Layer 5,6,7.
flow control:
adjusts transmission rate to safely use max available bandwidth w/o
exceeding it.
more overhead:
-> L4 -> L3 -> L2 (hop-to-hop) ...
includes srs port, dst port, seq num, ack num, flags, window, checksum,
urgent pointer, TCP options. (min. 20 bytes).
UDP (User Datagram Protocol)
not connection oriented (connection defined by TIMEOUT).
no confirmation of delivery:
fire & forget.
no error awareness @ L4.
no intrinsic data ordering (process those received first).
no flow control:
transmits as fast as it can.
less overhead:
only has: src port, dst port, length, checksum. altogether is only 8 bytes.
Ports
a logical connection that’s used by programs/services to exchange info.
specifically determines which program/service on a device that is going to be
used.
have unique number that identifies them.
always associated with an IP.
range from 0~65535, assigned by IANA (Internet Assigned Numbers Authority).
broken down to 3 categories:
0~1023 : System / Well-known ports.
80, 443 : HTTP, HTTPS
21 : FTP
25 : SMTP (Email)
1024~49151 : User / Registered ports.
- server-side ports registered by companies & developers for a particular
service.
1102 : Adobe Server
1433 : Microsoft SQL Server
1416 : Novell
1527 : Oracle
49152~65535 : Dynamic / Private ports.
- client-side ports that are free to use.
- computer assigns temporarily to itself during a session.
exp. viewing web pages.