Intro to Network
.. 2 4 ( ) ( ).
?!? ~! This is ~ ( )
/,,,????
TCP/IP Application Layer Transfer Layer Internet Layer Data Link Layer Physical Layer OSI 7
TCP/IP Application Layer Transfer Layer 3 4 Network Layer Layer! ( CS341... ) Data Link Layer Physical Layer
Application Layer Transfer Layer Internet Layer Application HTTP FTP / SMTP, IMAP, POP DNS Shell SSH Data Link Layer Physical Layer
Application Layer Transfer Layer TCP/UDP TCP initialization UDP / Internet Layer TCP UDP 16, 0~65535 Data Link Layer Physical Layer
Application Layer Transfer Layer IPv4, IPv6 IP(+ ) Internet Layer Data Link Layer Physical Layer
Application Layer Transfer Layer Ethernet MAC Internet Layer Data Link Layer Physical Layer
Application Layer Transfer Layer Internet Layer Data Link Layer Physical Layer
Application Layer Application Layer Transfer Layer Transfer Layer Network Layer Network Layer Data Link Layer Data Link Layer Physical Layer Physical Layer
.... HUB. 3...
IP, hierarchy ( ) IPv4: IP 32 42 IPv6: IP 128 2 128 IPv6 IPv6 2% MAC, hierarchy ( )
IPv4 A class: 0~127 123.x.x.x 2 24 (MIT, ) B class: 128~191 143.248.x.x 2 16 (KAIST) C class: 192~223 204.123.45.x 2 8 D class: 224~239 E class: 240~255 Multicast CIDR (Classless Inter-Domain Routing)
(Router) (port) Forwarding table 3 Network Layer IP
(Switch) MAC, forwarding L2, L3, L4 ex. L2 Data Link Layer ex. L3 Internet Layer
223.1.1.1 223.1.2.1 223.1.1.2 223.1.1.4 223.1.2.9 ~ 223.1.1.3 223.1.3.27 223.1.2.2 223.1.3.1 223.1.3.2
IP 143.248.35.11 = 01001111 11110100 00100011 00001011 255.255.255.0 = 11111111 11111111 111111111 00000000 143.248.35.x IP! Q. 255.255.252.0?
Public IP vs. Private IP IP, ICANN IPv4 2 32 = 42 Private IP IP, (ex. 10.x.x.x, 192.168.x.x) A 10.0.0.1 B 10.0.0.1 (Public IP CDN IP ) IP 10.x.x.x 192.168.x.x!?
NAT IP Public IP (+port) Private IP (+port) Public IP 143.248.0.7:2000 143.248.0.7:2001 Private IP 10.0.0.5:5000 10.0.0.6:5000.,. IP.
google.com DHCP, DNS, ARP, TCP, HTTP
5 Layers 5!? - IP - IP, MAC IP - DNS IP - IP MAC
DHCP: IP IP! DHCP! DHCP: IP Protocol OS DHCP Broadcast Broadcast? (dst IP 255.255.255.255)
DHCP: IP DHCP UDP! UDP dst port 67 src port 68 (DHCP ) IP dst IP: 255.255.255.255 (Broadcast) src IP: 0.0.0.0 ( ) dst MAC : FF:FF:FF:FF:FF:FF (Broadcast) src MAC : NIC MAC
DHCP: IP DHCP DHCP ACK. IP, DNS IP, IP,, UDP, IP, MAC., src MAC DHCP ( ), dst MAC.
DNS: google.com IP? : IP, DNS IP, IP, www.google.com domain name! IP DNS: IP DNS IP DHCP, IP Request!
ARP: IP? DNS,, IP IP! IP DNS.... dst MAC MAC..
ARP: IP? ARP: IP MAC protocol broadcast IP ~. ARP dst MAC FF:FF:FF:FF:FF:FF IP. (link layer) ARP IP ARP.! MAC ARP, ARP MAC src MAC ARP.!
! ARP ARP link layer protocol LAN. arp -a : ARP arp -d [IP] : ARP entry arp -s [IP] [MAC] : ARP entry arp table /proc/net/arp
DNS: google.com IP? (RIP, OSPF ) DNS IP, DNS www.google.com. DNS DNS DB google IP DNS.
TCP Handshake: Google IP HTTP! IP subnet! ->! IP, MAC. HTTP GET TCP. TCP 3 way handshaking.
TCP Handshake: Google SYN - SYNACK - ACK, TCP!!
HTTP Request:! GET www.google.com Request! Response-> index.html component component (TCP persistent connection -> )
HTTPS & TLS Handshaking:! HTTP encryption.!. TLS (Transport Layer Security): transport HTTPS TLS (SSL) HTTP! *DNS DNSSEC
Try It Yourself!
network.., /etc/resolv.conf /etc/network/interfaces.
..
IPv4. - (M) : DHCP( IP ) / ( IP). - : IP. - DNS : DNS. (,).
- ifconfig ifconfig : CLI. ifconfig ifconfig eth0 [IP] netmask [subnet] broadcast [IP] route add default gw [IP] dev eth0 DNS vi /etc/resolv.conf nameserver 211.42.201.138 ifconfig eth0 down ifconfig eth0 up ping www.google.com
- ifconfig
- ifconfig
Try It Yourself! VPN
VPN VPN /
VPN IP. IP.
VPN ID pptpd password.
VPN. VPN.
VPN.
VPN PPTP.
VPN 1723. PMTU.