Title: Internet Programming
1Internet Programming
2Internet Technology
- Networking Basics
- Internet Basics
- Internet Protocol
- TCP
- Applications
3Circuit Switching
4Internet design Smarts at the edges simple
core
5Packet Switching
6Packet Switching
7Key Ideas
8Simple
Stateless Core
9Unreliable
- Packets may be dropped
- (e.g., to handle congestion)
10Flexible
- Packets may take any route
11- Simple
- Unreliable
- Flexible
12Robust
- End to end principle
- en.wikipedia.org/wiki/End-to-end_principle
- End-to-End Arguments in System Design,
- Saltzer, J., Reed, D., and Clark, D.D.
13Simple Core
- all the core has to do is route packets
- simple using only local information
- each router has a routing table
- chooses the next hop by destination
- like sending a letter...
14Like sending a letter
Willem de Bruijn De Boelelaan 1081 1081 HV
Amsterdam Netherlands
My mailbox
Vrije Universiteit
Amsterdam Post Office
National Postal Center
15Smart Edges
- server provider of a service
- client consumer of a service
- a web client a.k.a. browser (e.g. IE, Firefox)
retrieving pages from a web server (e.g. Apache) - a mail client (e.g. Outlook) retrieving e-mail
from a mail server (e.g. Exchange)
16Internet Technology
- Networking Basics
- Internet Basics
- Internet Protocol
- TCP
- Applications
17Idea
"For each of these three terminals, I had three
different sets of user commands. So if I was
talking online with someone at S.D.C. and I
wanted to talk to someone I knew at Berkeley or
M.I.T. about this, I had to get up from the
S.D.C. terminal, go over and log into the other
terminal and get in touch with them. ... I
said, it's obvious what to do (But I don't want
to do it) If you have these three terminals,
there ought to be one terminal that goes anywhere
you want to go where you have interactive
computing. That idea is the ARPAnet." Robert
W. Taylor, co-writer "The Computer as a
Communications Device", in an interview with the
New York Times, 2
18History
Packet Switching Robust
19History
- 1984 NFSNet
- National USA University network with dial-up
- (other TCP/IP networks within the military)
20History
2005 an Internet snapshot
21Network of Networks
- Commercial Carriers
- Home router 2 computers
- Community Networks
- Community Wifi (e.g., mesh networks)
22Peering Internetworking
- Interconnection of 2 Autonomous Systems (ASs)
- Exchange routing information with BGP
- Transit (for pay)
- Peer (tit for tat)
- Incentive to peer directly with more networks
less transit - Public (AMS-IX) or Private
- Explicit contracts
23Multiple Levels
- Tier 1 A network that can reach every other
network on the Internet without purchasing IP
transit or paying settlements." (only 8) - Tier 3 non-multihomed end-user
24Wireless Community Networks
25Border Gateway Protocol (BGP)
- Periodic route table exchanges
- A.1 B.1 B.2 C.1 C.2 D.1
- B.1-gtA.1 connect B, C(B), D(B,C)
- B.1 -gt B.2 connect A
- Automatically updates local router's tables
- Multihome automatic failover, etc.
26(No Transcript)
27Organization
- Robust because decentralized?DNS Root Servers
- IANA numbers
- ICANN Root level TLDs
- Standards IETF (RFCs), W3C
28Internet Technology
- Networking Basics
- Internet Basics
- Internet Protocol
- TCP
- Applications
29Internet Protocol (v4)
- Basic end-to-end Connectivity
30(No Transcript)
31Internet addresses
- Internet Protocol (IP) Addresses
- Every node has a unique numeric address
- Form 32-bit binary number
- New standard, IPv6, has 128 bits (1998)
- Organizations are assigned groups of IP addresses
for their computers
32Clients and servers
nameserver
130.37.192.19 (client)
www.cs.vu.nl
www.cs.vu.nl 130.37.20.20
130.37.20.20 (server) (www.cs.vu.nl)
33Whats a protocol?
Hi
TCP connection request
Hi
34Network Technology
35Internetwork Technology TCP/IP
SMTP, HTTP, DNS UDP, TCP Internet Protocol (v4)
- Will discuss only what we need for now
36Packet Switching in Practice
37Packet Switching and Protocols
38An IP packet
DATA
39Missing
- Connections
- Reliability
- Packet Ordering
- Congestion Control
40Internet Technology
- Networking Basics
- Internet Basics
- Internet Protocol
- TCP
- Applications
41Transmission Control Protocol (TCP)
- Reliability
- Packet Ordering
- Connections
- Congestion Control
42Reliability
- Resend packets that are lost underway
43Reliability
- ACK packets
- Timeout
- Retransmit
44Ordered Data
- Packets may travel at different speed
- Reestablish order at arrival (buffer)
45Connections
- Ordered, reliable bytestream
-
- Reliable open and close
Three way handshake
46Internet Technology
- Networking Basics
- Internet Basics
- Internet Protocol
- TCP
- Applications
47Domain Name System (DNS)
- Lookup IP address
- 127.0.0.1
- By human readable name
- www.google.com.
- (note the last dot!)
48Domain Name System (DNS)
- Hierarchical
- Distributed System
- Hierarchical Names
49Domain Name System (DNS)
50Let us trace a connection
- DNS nslookup
- contacts the (distributed) Internet name service
- nslookup www.few.vu.nl
- IP traceroute allows us to find the path
- tracert www.few.vu.nl
51nslookup
- nslookup www.few.vu.nl
- Server 130.37.20.3
- Address 130.37.20.353
- Non-authoritative answer
- www.few.vu.nl canonical name
soling.few.vu.nl. - Name soling-public.few.vu.nl
- Address 130.37.20.20
52Application Protocols
- DNS!
- FTP File transfer
- NTP Time Synchronization
- Telnet Terminal access
- SSH Secure terminal access
- XMPP Messaging
- SMTP Email
- HTTP Web (Next lecture)
53Email
54Network
mail.receiver.org
Pull
smtp.few.vu.nl
Push
Push
55Simple Mail Transfer Protocol
- Store and Forward network
- Simple? Example ...
56S 220 smtp.example.com ESMTP Postfix C HELO
relay.example.org S 250 Hello relay.example.org,
I am glad to meet you C MAIL FROMltbob_at_example.or
ggt S 250 Ok C RCPT TOltalice_at_example.comgt S
250 Ok C RCPT TOlttheboss_at_example.comgt S 250
Ok C DATA S 354 End data with
ltCRgtltLFgt.ltCRgtltLFgt C From "Bob Example"
ltbob_at_example.orggt C To Alice Example
ltalice_at_example.comgt C Cc theboss_at_example.com C
Date Tue, 15 Jan 2008 160243 -0500 C Subject
Test message C C Hello Alice. C This is a test
message C . S 250 Ok queued as 12345 C
QUIT S 221 Bye The server closes the
connection
57Email (1/2)
- Received from mail.vu.nl (mail.vu.nl
130.37.129.161) - by tornado.few.vu.nl
- for ltw.de.bruijn_at_few.vu.nlgt
- Wed, 3 Dec 2008 1059 0100
- Received from DIENSTEX1.dienst.ad.vu.nl
(mail.dienst.vu.nl 130.37.136.125) - by mail.vu.nl (8.12.11.20060308/8.12.11)
- for ltw.de.bruijn_at_few.vu.nlgt
- Wed, 3 Dec 2008 105956 0100
58Email (2/2)
- MIME-Version 1.0
- Content-Type multipart/alternative
- boundary"----__NextPart_001_01C9552D.E50A028F"
- Subject Visum is binnen
- Date Wed, 3 Dec 2008 105956 0100
- From "Eek, D" ltD.Eek_at_dienst.vu.nlgt
- To "Willem de Bruijn" ltw.de.bruijn_at_few.vu.nlgt
- This is a multi-part message in MIME format.
- ------__NextPart_001_01C9552D.E50A028F
- Content-Type text/plain
- charset"us-ascii"
- Content-Transfer-Encoding quoted-printable
- Goedemorgen Willem,
- 20
- Wij hebben je paspoort met visum terug ontvangen
van het visumbureau.
59Reception
- POP3 Post Office Protocol
- Fetch data from a directory store at home
- Stateless
- Aside from optional 'read items' hash
- IMAP4 Internet Message Access Protocol
- remote folders' store on server
- Stateful
- Concurrent access
-
- Webmail
- Proprietary method on top of HTTP
- Frequently uses IMAP between webserver and
mailserver
60- Multipurpose Internet Mail Extensions
- Send more than 7bit ASCII text
- Binary (images), Non-latin script
- Identify encoding, e.g.,
- quoted-printable HEXHEX
- for instance, 20 means space
- Break up messages
- htmlimg
- text/html
- Also used elsewhere
- (such as webservers)
61Mime content encodings
- B7Hola, seF1or!
- is interpreted as
- Hola, señor!.
62Mime content-type
- text/plain
- text/html
- image/jpeg
- video/mpeg2
- ...
- application/octet-stream
63Mime special content-type
- message/rfc822
- multipart/alternative
- multipart/form-data
- ...
- many more. Official list at
- www.iana.org/assignments/media-types/
64SMTP Security
- From spoofing
- Man in the middle can sniff and change data
- Open Relay
- SPAM
65SMTP Security
- Counteraction difficult
- Network Effect
- Authentication
- PGP
- ensure contents integrity (sig/enc)
- DomainKeys Identified Mail (DKIM)
- Guard against spoofing, indirectly
- Sender/Server RSA SIG
- Public Key through sender domain DNS
- Used by Yahoo! and Google.
- Does not guard the envelop
66Fighting SPAM
- Your post advocates a
- ( ) technical ( ) legislative ( ) market-based (
) vigilante - approach to fighting spam. Your idea will not
work. Here is why it won't work. (One or more of
the following may apply to your particular idea,
and it may have other flaws which used to vary
from state to state before a bad federal law was
passed.) - ...
67- ( ) Spammers can easily use it to harvest email
addresses - ( ) Mailing lists and other legitimate email uses
would be affected - ( ) No one will be able to find the guy or
collect the money - ( ) It is defenseless against brute force attacks
- ( ) It will stop spam for two weeks and then
we'll be stuck with it - ( ) Users of email will not put up with it
- ( ) Microsoft will not put up with it
- ( ) The police will not put up with it
- ( ) Requires too much cooperation from spammers
- ( ) Requires immediate total cooperation from
everybody at once - ( ) Many email users cannot afford to lose
business or alienate potential employers - ( ) Spammers don't care about invalid addresses
in their lists - ( ) Anyone could anonymously destroy anyone
else's career or business - Specifically, your plan fails to account for
- ( ) Laws expressly prohibiting it
- ( ) Lack of centrally controlling authority for
email - ( ) Open relays in foreign countries
68Internet Technology Exam Material
- Networking Basics
- circuit vs. packet switching
- end-to-end argument
- client/server programming
- Internet Basics
- network of networks
- peering
- IP
- protocol stack
- TCP
- reliability, ordering, conn.
- DNS
- Email
- push vs. pull, mime, authentication
- basic smtp
69Internet Technology Practical
- Trace a Route with tracert.exe
- Lookup a domain name with nslookup.exe
- Send me an email manually using putty
- Don't forget come up with a website plan for
tomorrow!
70Flow Control
71Congestion Control
- Scale sliding window size
- Automatic, based on transport quality
- Additive Increase, Multiplicative Decrease
72Bandwidth Delay Product
- Maximal bandwidth of a TCP stream depends on
- physical bandwidth, but also
- congestion control protocol
- roundtrip time