IP Basics: Unix/IP Preparation Course June 29, 2010 Pago Pago, American Samoa
IP Basics: Unix/IP Preparation Course June 29, 2010 Pago Pago, American Samoa
nsrc@pacnog 2010
Pago Pago, American
Samoa
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
nsrc@pacnog 2010
Pago Pago, American
Samoa
OSI Model
nsrc@pacnog 2010
Pago Pago, American
Samoa
OSI
Conceptual model composed of seven layers,
developed by the International Organization for
Standardization (ISO) in 1984.
nsrc@pacnog 2010
Pago Pago, American
Samoa
TCP/IP model – the “hourglass”
Video
Browser MUA PING Player
IP
802.11
Ethernet PPP
WiFi
IPv4 IPv6
802.11
Ethernet PPP
WiFi
nsrc@pacnog 2010
Pago Pago, American
Samoa
TCP/IP Protocol Suite
nsrc@pacnog 2010
Pago Pago, American
Samoa
Encapsulation & Decapsulation
Lower layers add headers (and sometimes
trailers) to upper layers packets
Application Data
nsrc@pacnog 2010
Pago Pago, American
Samoa
Frame, Datagram, Segment, Packet
nsrc@pacnog 2010
Pago Pago, American
Samoa
Summary
nsrc@pacnog 2010
Pago Pago, American
Samoa
So what is an IPv4 address anyway?
85 1B A2 7D
nsrc@pacnog 2010
Pago Pago, American
Samoa
More to the structure
nsrc@pacnog 2010
Pago Pago, American
Samoa
Sample Netmasks
nsrc@pacnog 2010
Pago Pago, American
Samoa
Allocating IP addresses
nsrc@pacnog 2010
Pago Pago, American
Samoa
Special IP Addresses
All 0’s in host part: Represents Network
e.g. 193.0.0.0/24
e.g. 138.37.128.0/17
e.g. 192.168.2.128/25 (WHY ?)
nsrc@pacnog 2010
Pago Pago, American
Samoa
Numbering Rules
nsrc@pacnog 2010
Pago Pago, American
Samoa
Network related settings
Files
/etc/rc.conf
/etc/netstart
/etc/hosts
/etc/resolv.conf
Commands
nsrc@pacnog 2010
Pago Pago, American
Samoa
The route table
All hosts (including routers) have a route table
that specifies which networks it is connected
to, and how to forward packets to a gateway
router that can talk to other networks.
FreeBSD routing table from “netstat –anr”
Routing tables
Internet:
Destination Gateway Flags Refs Use Netif Expire
default 196.200.218.254 UGS 4 1068 bge0
127.0.0.1 link#3 UH 0 12 lo0
196.200.218.0/24 link#1 U 0 0 bge0
196.200.218.253 link#1 UHS 0 0 lo0
Internet6:
Destination Gateway Flags Netif Expire
::1 ::1 UH lo0
fe80::%lo0/64 link#3 U lo0
fe80::1%lo0 link#3 UHS lo0
ff01:3::/32 fe80::1%lo0 U lo0
ff02::%lo0/32 fe80::1%lo0 U lo0
nsrc@pacnog 2010
Pago Pago, American
Samoa
What do route table entries mean?
Destination Gateway Flags Refs Use Netif Expire
default 196.200.218.254 UGS 4 1068 bge0
127.0.0.1 link#3 UH 0 12 lo0
196.200.218.0/24 link#1 U 0 0 bge0
196.200.218.253 link#1 UHS 0 0 lo0
nsrc@pacnog 2010
Pago Pago, American
Samoa
Reaching the local network
nsrc@pacnog 2010
Pago Pago, American
Samoa
More complex routing
nsrc@pacnog 2010
Pago Pago, American
Samoa
Forwarding packets
Important
nsrc@pacnog 2010
Pago Pago, American
Samoa