###### tags: `資安 ethical hacker ZTM`
# network
## public and private IP
all IP4 divied in two type
### 1.WAN address
global public external
WAN is connect internet to outside
so global network can find it
### 2.LAN address
private local internal
LAN is connect private network
like business or home network

so private address kind like server,
it can be organiz like a team,
then public address like a unique identify,
let internet can linked it in and out,
distribute different private address

but private address cant direct connection
private address
## DNS
DNS like a transform protocol
you can link WWW.EXAMPLE.COM to 196.x.x.x
so DNS like a big WAN server distribution domain(WWW)
to WAN (public address)
## DHCP
useful by dynamic divided private network(ip) to devices, like a private network IP manager
then devices can use network service like DNS NDP and communication protocol based on UDP TCP
## Router
router is a physical devices and virutal application
computer can connect to internet(public address)
than router will send packet efficiency(network packet class have learned)
then to another public address,like ip to ip packet manager
## VM
https://www.virtualbox.org/manual/ch06.html
### VM-NAT
NAT look like VM type Router,
it will let VM to be another host
but is use on VM,
VM access to internet like router to internet(by WAN)
but VM cant to connect other VM
in default not support to access private network
only for WAN
(need another mode)
### NAT with-bridge mode like upgrade
so it have device driver to get network adopt data,
call net filter driver
then it can intercept physical network data
then inject into physical network,
depend it like software create a interface
then VM can use it to access host and other VM
(so kind like a hacker driver?
it can get network data deal with and send it back
but it for VM get data and interactive to physical network
so can use it link host and other VM
when VM use it
it can imagine **like other PC network cable link my host or VM**
but really work like software create another interface
this interface can diret get network data and interactive network)
so VM can use it to interactive other VM or host,
## TCP and UDP
TCP (three way handshake) (already leaened)
send packet -> response -> connect
UDP One-way transmission
## ARP
TCP need to know ip address and mac address relation
i think mac is on network interface card
ip is from ISP(public address)
TCP need interactive so need to know each other mac address
ARP will deal with IP and MAC relation
that can know ip address link which MAC address