self-taught

NAT

Network Address Translation
Parliamo di terzo livello
Classi di Indirizzi Privati:

ClasseNetwork NumberNetwork Mask# of networks# of hosts per network
A10.0.0.0255.0.0.012616.646.144
B172.16.0.0 172.31.0.0255.255.0.016.38365.024
C192.168.0.0 192.168.255.255255.255.255.02.097.151254
LOOPBACK (localhost)127.0.0.0127.0.0.7255.255.255.0--

Mac Addresses

Media Access Control Addresses
Segnalato da “ether” nell’ifconfig. Quando parliamo di Indirizzi Mac, parliamo di layer 2 (o switching). Gli indirizzi MAC hanno identificatori: le prime tre coppie dell’indirizzo possono essere inserite in un Mac Address Lookup, per vedere quale ditta ha fabbricato la scheda di rete.

Protocolli

Stiamo parlando del quarto livello.
Three-way Handshake: inviamo un pacchetto SYN, riceviamo indietro un pacchetto SYN ACK e a quel punto inviamo il pacchetto ACK.
TCP = transmission control protocol. Protocollo orientato alla connessione. Più affidabile, usato per siti web, ssh ecc. Funziona su una stretta a 3 mani.
FTP (21) file transfer protocol, mettere/togliere file da un server
SSH (22) encrypted remote work
Telnet (23) remote work
SMTP (25) mail
DNS (53) domain name system, passare da indirizzi IP a nomi
HTTP (80) / HTTPS (443) siti web
POP3 (110) mail
SMB (139 + 445) file shares / samba
IMAP (142) mail
UDP = user datagram protocol. Protocollo senza connessione.
DNS (53)
DHCP (67, 68) ti assegna un indirizzo ipv4, a meno che tu non ne richieda uno statico
TFTP (69) trivial FTP
SNMP (161) simple network manager protocol

Il Modello OSI

1 P physical layer
2 D switching layer, mac addresses
3 N network layer: ip addresses, routing
4 T transport layer: tcp/udp
5 S session layer: session management
6 P presentation layer, media: wmv, jpeg, mov
7 A application layer: https, smtp

Subnetting

Normalmente i network domestici sono a /24, quindi permette di avere 256 hosts (254) e la mask è 255.255.255.0
Subnetting cheat sheet:

Subnet x.0.0.0
CIDR/1/2/3/4/5/6/7/8
Hosts2.147.483.6481.073.741.824536.870.912268.435.456134.217.72867.108.86433.554.43216.777.216
Class ASubnet 255.x.0.0
CIDR/9/10/11/12/13/14/15/16
Hosts8.388.6084.194.3042.097.1521.048.576524.2880262.144131.07265.536
Class BSubnet 255.255.x.0
CIDR/17/18/19/20/21/22/23/24
Hosts32.76816.3848.1924.0962.0481.024512256
Class CSubnet 255.255.255.x
CIDR/25/26/27/28/29/30/31/32
Hosts1286432168421
Subnet mask (replace x)128192224240248252254255
ipaddressguide.com/cidr

Unix

ifconfig

[kwisatzhaderach@thufirhawat ~]$ ifconfig  
lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536  
       inet 127.0.0.1  netmask 255.0.0.0
       inet6 ::1  prefixlen 128  scopeid 0x10<host>
       loop  txqueuelen 1000  (Local Loopback)  
       RX packets 674  bytes 53576 (52.3 KiB)
       RX errors 0  dropped 0  overruns 0  frame 0  
       TX packets 674  bytes 53576 (52.3 KiB)  
       TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0  
  
wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500  
       inet 192.168.1.16  netmask 255.255.255.0  broadcast 192.168.1.255 //ipv4 address, ogni numero è in 4 byte, 2^32 combinazioni, già tutte comprate da ditte
       inet6 fe80::ce8a:eaf:a1dc:fb5e  prefixlen 64  scopeid 0x20<link> //ipv6 adress di solito è in esadecimale, 2^128 combinazioni
       ether c0:b8:83:7c:e7:af  txqueuelen 1000  (Ethernet) //MAC ADDress, c0:b8:83 indica Intel per esempio
       RX packets 92078  bytes 115333734 (109.9 MiB)  
       RX errors 0  dropped 0  overruns 0  frame 0  
       TX packets 13166  bytes 2217903 (2.1 MiB)  
       TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0