IP Basics

Unix System Administration

Layers

Complex problems can be solved using the common divide and conquer principle. In this case the internals of the Internet are divided into separate layers.

Makes it easier to understand

Developments in one layer need not require changes in another layer

Easy formation (and quick testing of conformation to) standards

Two main models of layers are used:

OSI (Open Systems Interconnection)

TCP/IP

OSI

Conceptual model composed of seven layers, developed by the International Organization for Standardization (ISO) in 1984.

Layer 7 – Application (servers and clients etc web browsers, httpd)

Layer 6 – Presentation (file formats e.g pdf, ASCII, jpeg etc)

Layer 5 – Session (conversation initialisation, termination, )

Layer 4 – Transport (inter host comm – error correction, QOS)

Layer 3 – Network (routing – path determination, IP[x] addresses etc)

Layer 2 – Data link (switching – media acces, MAC addresses etc)

Layer 1 – Physical (signalling – representation of binary digits)

Acronym: All People Seem To Need Data Processing

TCP/IP

Generally, TCP/IP (Transmission Control Protocol/Internet Protocol) is described using three to five functional layers. We have chosen the common DoD reference model, which is also known as the Internet reference model.

Process/Application Layer consists of applications and processes that use the network.

Host-to-host transport layer provides end-to-end data delivery services.

Internetwork layer defines the datagram and handles the routing of data.

Network access layer consists of routines for accessing physical networks.

TCP/IP diagram

OSI and TCP/IP

IP datagram structure

Numbering Rules

Private IP address ranges:

10/8 (10.0.0.0 – 10.255.255.255)

192.168/16 (192.168.0.0 – 192.168.255.255)

172.16/12 (172.16.0.0 – 172.31.255.255)

Public Address space available from AfriNIC

Choose a small block from whatever range you have, and subnet your networks (to avoid problems with broadcasts)

Forwarding

If a computer isn't on your subnet, packet's sent via a “gateway” connected to to networks.

defaultrouter option in /etc/rc.conf sets the default gateway for this system.

Ip forwarding on a FreeBSD box turned on with the gateway_enable option in /etc/rc.conf otherwise the box will not forward packets from one interface to another.

Client – Server Arch

Client makes requests, Server serves requests – e.g HTTP for transferring “websites”. This is the easiest way to provide services on demand and provides a means of sharing resources more effectively.

Example: Mimicking the browser with telnet (client) talking to a web server (server)

telnet www.google.com 80

GET / HTTP/1.0

Host: www.google.com

<blank line>

IP <-> Names

/etc/hosts used to contain a list of all domain names and their corresponding IP addresses. This isn't scalable, a new system was developed.

DNS is the system by which domain names are converted to IP addresses and vice versa.

Resolvers transverse the DNS heirachy which is much like a filesystem, starting at the root named servers and working downwards.

Name servers are the programs that keep databases of mappings between domain names (or zones) and addresses

Debugging

ping

traceroute

tcpdump

2005-04-17T11:05:44