UNIX Internet
Last modified Monday, 24-Apr-2023 16:43:27 UTC.
- The Internet
- Packet Switched
- Data is transmitted in packets
- Packet = data + destination information (e.g. IP address)
- The packet is sent from one machine to the next until the
destination machine is reached
- Routers coordinate the network load and transmissions of
packets
- IP numbers
- Each machine has a 32 bit IP number, e.g., 137.219.47.69
- IP number has 4 octets, in two parts: network and machine
- 1st octet 1-127
- Class A network
- Network number in 1st octet, machine number in others
- 127 networks
- 16M machines
- 1st octet 128-191
- Class B network
- Network number in 1st and 2nd octet, machine number in
others
- ~16K networks
- 64K machines
- 1st octet 192-223
- Class C network
- Network number in 1st to 3rd octet, machine number in
last
- ~2M networks
- 255 machines
- 1st octet 224 onward
- Network Address Translation (NAT)
- A way to map multiple IP addresses inside a local network
to a single IP address outside the network (the public
internet).
- Logical
- Hierarchy of domains
- Names are resolved to IP numbers by DNS computers
- Routers and gateways forward packets to the required IP address
- Protocols
- Network level
- IP - Smallest data level. Unreliable and unordered
- RIP - For sharing routing data
- ARP - For resolving names to addresses
- Transport level
- UDP - On IP to make it reliable, with service multiplexing
via ports concept
- TCP - On IP to make it connection based, reliable, and
stream-oriented (ordered packets)
- Port numbers
- Identifies a process to which an internet message is to be
forwarded at a server.
- Well-known port numbers 0-1023 are reserved for known usages.
See /etc/services for known ports up to 1024, e.g., ...
- 21 = File Transfer Protocol (FTP)
- 22 = Secure Shell
- 25 = Simple Mail Transfer Protocol (SMTP)
- 53 = Domain Name System (DNS)
- 80 = HTTP
- 443 = HTTPS
- Registered port numbers 1024-49151 used by companies
- Dynamic port numbers 49152-65536 available for anyone to use
- Some useful commands
- ping machine to check if
machine is reachable
- nslookup to get information about a machine on the net.
- Provide a computer name.domain to get the IP address
- Provide an IP address to get the computer name.domain
- set debug to see lots of details
- So much more
- dig is a newer version of nslookup
- traceroute machine to print the route that
packets take to machine
- netstat symbolically displays the contents of various network
related data structures
- Plain netstat tells about all internet connections
- netstat -s gives a summary of network activity
- finger login or
finger login@machine shows details (well, mostly
turned off these days) for the login
- ssh machine command
securely runs command on
machine where you have an account. If the
command is omitted you get a login prompt.
- scp machine1:filename1
machine2:filename2 to copy files between
machines
Exercises
Exam Style Questions