Professional Documents
Culture Documents
System
http://people.freebsd.org/~nik/dist-sys.ppt
Looking at
How the Internet works
TELNET
FTP
SMTP
SNMP
DNS
6
Presentation
RFC 854
RFC 959
RFC 821
RFC 1098
RFC 1034
5 Session
4 Transport
3 Network
TCP
UDP
RFC 793
RFC 768
ARP
RARP
ICMP
BOOTP
RFC 826
RFC 903
RFC 792
RFC 951
IP
RFC 791
2 Link
802.2
802.3
1 Physical
802.5
Other
Medium
Access
Protocols
6. Cheese
5. Guacamole
4. Tomato
3. Lettuce
2. Seasoned rice
1. Refried beans
A Networking Analogy
Two office blocks, each contains a number of
different companies
Each company has one or more phone numbers
(so there are several phone numbers for the office
block)
Each phone number has a few hundred
extensions
To call anyone, you need their company phone
number, and their extension
4 numbers identify any call -- source phone
number, source extension, destination phone
In an IP network
You have a host (an office building)
Each host has one or more network interfaces (companies
within the building)
Each interface has one or more IP addresses attached to it
(phone numbers)
In an IP network
You have a host (an office building)
Each host has one or more network interfaces
(companies within the building)
Each interface has one or more IP addresses attached to
it (phone numbers)
Packet switching
Internet is a packet switched network
IP Address: A definition
32 bit number
So there are 232 = 4,294,967,296 of them
Netmask: 255.255.255.0
00001010 00001010 00000001 00000001
10
10
1
1
AND
11111111 11111111 11111111 00000000
255
255
255
0
=
00001010 00001010 00000001 00000000
10
10
1
0
So this is the .1 host in the 10.10.1.0 network
10.10.2.1/16
.0 network
Network address is .0
Broadcast address is .127
.128 network
Network address is .128
Broadcast address is .255
Host addresses are .129 through to .254 (126
addresses)
Routing
Hosts on the same network can contact each
other directly
E.g., 10.10.1.1/24 wants to talk to 10.10.1.2/24.
It puts a packet on the wire with a destination
address of 10.10.1.2, and 10.10.1.2 receives it
Its like magic, you dont need to know how this bit
works, it just does
Routing (cont.)
Hosts on two different networks cant talk directly,
they need a router to route the packets between
them
A router is a device with at least 2 network
interfaces present on 2 or more different networks
Hosts send packets for other networks to the
router
Router looks at the destination address
information in the packet, and works out where to
send it
Routing (cont.)
Each Internet host has to maintain a routing
table
The routing table details how packets get
from a to b
The routing table only contains information
about the networks the host is directly
connected to
Routing (cont.)
10.10.1.1/24
10.10.1.2/24
80.194.99.103/24
10.10.2.1/24
Internet
10.10.2.2/24
Routing (cont.)
Heres the routing table for the workstations on the
10.10.1/24 network
Destination
Gateway
10.10.1/24
Local interface
Default
10.10.1.1
Routing (cont.)
Heres the routing table for the workstations on the
10.10.2/24 network
Destination
Gateway
10.10.2/24
Local interface
Default
10.10.2.1
Routing (cont.)
Heres the routing table for the router
Destination
Gateway
10.10.1.0/24
Interface 1
10.10.2.0/24
Default
Interface 2
Interface 3
Routing (cont.)
This is very scalable
No host needs to know the complete route to
the destination, or the Internets topology
They just need to know the IP address of the
nearest router
The nearest router hands it off to the next
nearest router, and so on
Internet summary
Hosts have interfaces
Open
10.10.1.2 me.example.com
10.10.1.3 another.example.com
...
me.example.com (FQDN) is
.
.com
.com.example
.com.example.me
DNS Hierarchy
Root Nameservers
.uk
.co.uk
GTLD Nameservers
.ac.uk
.net
brunel.ac.uk
ic.ac.uk
www.brunel.ac.uk
doc.ic.ac.uk
src.doc.ic.ac.uk
.org
freebsd.org
www.freebsd.org
.com
slashdot.org
freefall.freebsd.org
citigroup.com
...
DNS in action
What happens?
SOA Record
Every zone has one SOA record
; Serial number
; Refresh after 2hrs 13min
; Retry after 2hrs
; Expire after 1wk
; Minimum TTL of 6hrs
IN NS sirius.brunel.ac.uk.
IN NS ns3.ja.net.
IN MX 5 nemesis.brunel.ac.uk.
IN MX 4 eros.brunel.ac.uk.
s70n133
s249n88
s249n90
IN
IN
IN
A
A
A
134.83.70.133
134.83.249.88
134.83.249.90
IP Characteristics of DNS
DNS servers listen on port 53
07050 605081
Im in it as myself.
Nail it to the counter Lord
Fergason and damn the
cheesmongers!
Header
Contains 1-n name: value fields
From:, To:, CC:, BCC:, Subject:, Date:, Received:, XFoo:, X-Bar:, etc
Body
Unstructured text of the actual message
SMTP Highlights
Protocol is entirely plain text
Easy to debug
Easy to test by hand
Easy to script
Protocol is unambiguous
All information is contained in the status codes. The
explanatory text is useful but ignored by
implementations
Acronyms
MTA = Mail Transfer Agent
The software that routes message from host to host
(Sendmail, Postfix, Qmail, Exchange (cough))
Mail Routing
I tap in simon.taylor@brunel.ac.uk into my
MUA. What happens?
MUA hands message off to local MTA
Local MTA uses the DNS to look up MX
records for brunel.ac.uk
MX record?
MX Records
Are entries in the DNS
A weight / preference
Host
eros.brunel.ac.uk
nemesis.brunel.ac.uk
Weight
Host
50
mail1.citigroup.com
50
mail2.citigroup.com
50
mail3.citigroup.com
50
mail4.citigroup.com
50
mail5.ssmb.com
Anti-virus
Archiving
Address re-writing
Exchange Servers
IP Characteristics of SMTP
SMTP servers listen on port 25
Extending SMTP
Turns out that, as originally specified, SMTP
doesnt do some useful things
So ESMTP was invented
But how do you do this without breaking all
the existing implementations?
Hmm
EHLO in action
220 issaspam-ny01.ssmb.com ESMTP Go ahead
EHLO ngo.dnsalias.org
250-issaspam-ny01.ssmb.com Hello
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-8BITMIME
250-SIZE 26214400
250-DSN
250-DELIVERBY
250 HELP
MAIL FROM: nik@freebsd.org
250 . . .
EHLO failing
220 smtp.example.com
EHLO ngo.dnsalias.org
502 Error: command not implemented
HELO ngo.dnsalias.org
250 OK
MAIL FROM: nik@freebsd.org
250 . . .
Heterogenous
Nothing in SMTP ties it to a particular platform
Nobodys perfect
Thanks
Questions?
Bonus Slides
Regular hours
Bureacracy is ever-present
addr.sin_port = 80;
// Create socket
// Create socket
// All done
User
me.example.com
dns.example.com
Root
Nameserver
.org
Nameserver
ns.freebsd.org
Nameserver