Networking
Network
- Networks is what transports traffic between hosts
- Logical grouping of hosts which require similar connectivity
- Networks can contain other networks
- These are sometimes called sub-networks or subnet
- Networks connect to other networks
Network Protocols
- A network protocol is a set of rules that allows for data transmissions across different technologies.
Protocols
- ARP - Address Resolution Protocol
- FTP - File Transfer Protocol
- SMTP - Simple Mail Transfer Protocol
- HTTP - Hyper Text Transfer Protocol
- TLS - Transport Layer Security
- SSL - Secure Sockets Layer
- HTTPS - HTTP Secured with TLS/SSL
- DNS - Domain Name System
- DHCP - Dynamic Host Configuration Protocol
Commands
ping
- uses ICMP protocol
- send 10 packets
ping <ip> -n 10
traceroute
- print the route packets take to network host
traceroute example.com
tracert
- Available on Windows
- shows hops
- Uses ICMP Time to Live (TTL)
- If stars are in output then, device used in particular hop is not configured to reply to ICMP and UDP traffic
- does not mean that the traffic was not passed successfully
tracert <ip>
# check google DNS
tracert 8.8.8.8
# google website
tracert www.google.com
route
- Manually manipulate the network routing tables
netsh
- Available on Windows
- Check the current Wifi standard
netsh wlan show interfaces
lsof
- LiSt Open Files
- Check the process on port
lsof -i:8080
sudo lsof -PiTCP -sTCP:LISTEN
nmap
- Network Mapper
- Network exploration tool and security / port scanner
nslookup
- Query Internet name servers interactively
# --- Interactive Mode ---
nslookup
## Check for google.com
> google.com
Server: 10.119.64.1
Address: 10.119.64.1#53
Non-authoritative answer:
Name: google.com
Address: 142.250.194.174
# --- Non-Interactive Mode ---
## Check for example.com
nslookup example.com
## Check for example.com on 8.8.8.8 DNS Server
nslookup example.com 8.8.8.8
netstat
- Show network status
- Displays the contents of various network-related data structures
arp
- Displays and modifies the Internet-to-Ethernet address translation tables (ARP Cache) used by the ARP protocol
# Show arp cache
arp -a