Basic Internet programming Formalities Hands-on tools for internet - - PowerPoint PPT Presentation

basic internet programming formalities hands on tools for
SMART_READER_LITE
LIVE PREVIEW

Basic Internet programming Formalities Hands-on tools for internet - - PowerPoint PPT Presentation

Welcome Basic Internet programming Formalities Hands-on tools for internet programming DD1335 (gruint10) Serafim Dahl serafim@nada.kth.se DD1335 (Lecture 1) Basic Internet Programming Spring 2010 1 / 23 Welcome What is this


slide-1
SLIDE 1

Welcome

Basic Internet programming – Formalities ’Hands-on’ tools for internet programming

DD1335 (gruint10) Serafim Dahl serafim@nada.kth.se

DD1335 (Lecture 1) Basic Internet Programming Spring 2010 1 / 23

slide-2
SLIDE 2

Welcome

What is this course about?

◮ Providing tools for hands-on internet programming

DD1335 (Lecture 1) Basic Internet Programming Spring 2010 2 / 23

slide-3
SLIDE 3

Welcome

What is this course about?

◮ Providing tools for hands-on internet programming ◮ There are only 9 lectures – do show up, please!

DD1335 (Lecture 1) Basic Internet Programming Spring 2010 2 / 23

slide-4
SLIDE 4

Welcome

Lectures are about

◮ Basics on the internet

◮ Protocols, addresses, hosts ◮ HTML, markup ◮ Internet connections, servers (Java) DD1335 (Lecture 1) Basic Internet Programming Spring 2010 3 / 23

slide-5
SLIDE 5

Welcome

Lectures are about

◮ Basics on the internet

◮ Protocols, addresses, hosts ◮ HTML, markup ◮ Internet connections, servers (Java)

◮ Server-Side Internet Programming

◮ CGI, Servlets (Java) ◮ Java Server Pages (JSP) and other scripting (ASP) ◮ 3-tier systems: JDBC (Java-SQL) DD1335 (Lecture 1) Basic Internet Programming Spring 2010 3 / 23

slide-6
SLIDE 6

Welcome

Lectures are about

◮ Basics on the internet

◮ Protocols, addresses, hosts ◮ HTML, markup ◮ Internet connections, servers (Java)

◮ Server-Side Internet Programming

◮ CGI, Servlets (Java) ◮ Java Server Pages (JSP) and other scripting (ASP) ◮ 3-tier systems: JDBC (Java-SQL)

◮ Client-Side Internet Programming

◮ Javascript ◮ CSS ◮ Applets (Java) and maybe some other technique(s) DD1335 (Lecture 1) Basic Internet Programming Spring 2010 3 / 23

slide-7
SLIDE 7

Welcome

Lectures are about

◮ Basics on the internet

◮ Protocols, addresses, hosts ◮ HTML, markup ◮ Internet connections, servers (Java)

◮ Server-Side Internet Programming

◮ CGI, Servlets (Java) ◮ Java Server Pages (JSP) and other scripting (ASP) ◮ 3-tier systems: JDBC (Java-SQL)

◮ Client-Side Internet Programming

◮ Javascript ◮ CSS ◮ Applets (Java) and maybe some other technique(s)

◮ Other Issues

◮ XML, Web Services, Semantic Web ◮ PHP and other scripting languages DD1335 (Lecture 1) Basic Internet Programming Spring 2010 3 / 23

slide-8
SLIDE 8

Welcome

Labs and Project

◮ Labs

DD1335 (Lecture 1) Basic Internet Programming Spring 2010 4 / 23

slide-9
SLIDE 9

Welcome

Labs and Project

◮ Labs

◮ Principles: wide, not deep. DD1335 (Lecture 1) Basic Internet Programming Spring 2010 4 / 23

slide-10
SLIDE 10

Welcome

Labs and Project

◮ Labs

◮ Principles: wide, not deep. ◮ A lot to do, but all easy, mostly with a template to start from DD1335 (Lecture 1) Basic Internet Programming Spring 2010 4 / 23

slide-11
SLIDE 11

Welcome

Labs and Project

◮ Labs

◮ Principles: wide, not deep. ◮ A lot to do, but all easy, mostly with a template to start from ◮ Net and programming basics (Lab1), Net connections (Lab 2) DD1335 (Lecture 1) Basic Internet Programming Spring 2010 4 / 23

slide-12
SLIDE 12

Welcome

Labs and Project

◮ Labs

◮ Principles: wide, not deep. ◮ A lot to do, but all easy, mostly with a template to start from ◮ Net and programming basics (Lab1), Net connections (Lab 2) ◮ Server side (Lab 3, Lab 4), DD1335 (Lecture 1) Basic Internet Programming Spring 2010 4 / 23

slide-13
SLIDE 13

Welcome

Labs and Project

◮ Labs

◮ Principles: wide, not deep. ◮ A lot to do, but all easy, mostly with a template to start from ◮ Net and programming basics (Lab1), Net connections (Lab 2) ◮ Server side (Lab 3, Lab 4), Client side (Lab 5) DD1335 (Lecture 1) Basic Internet Programming Spring 2010 4 / 23

slide-14
SLIDE 14

Welcome

Labs and Project

◮ Labs

◮ Principles: wide, not deep. ◮ A lot to do, but all easy, mostly with a template to start from ◮ Net and programming basics (Lab1), Net connections (Lab 2) ◮ Server side (Lab 3, Lab 4), Client side (Lab 5)

◮ Projects

DD1335 (Lecture 1) Basic Internet Programming Spring 2010 4 / 23

slide-15
SLIDE 15

Welcome

Labs and Project

◮ Labs

◮ Principles: wide, not deep. ◮ A lot to do, but all easy, mostly with a template to start from ◮ Net and programming basics (Lab1), Net connections (Lab 2) ◮ Server side (Lab 3, Lab 4), Client side (Lab 5)

◮ Projects

◮ You define your projects. DD1335 (Lecture 1) Basic Internet Programming Spring 2010 4 / 23

slide-16
SLIDE 16

Welcome

Labs and Project

◮ Labs

◮ Principles: wide, not deep. ◮ A lot to do, but all easy, mostly with a template to start from ◮ Net and programming basics (Lab1), Net connections (Lab 2) ◮ Server side (Lab 3, Lab 4), Client side (Lab 5)

◮ Projects

◮ You define your projects. ◮ You form the project groups. DD1335 (Lecture 1) Basic Internet Programming Spring 2010 4 / 23

slide-17
SLIDE 17

Welcome

Labs and Project

◮ Labs

◮ Principles: wide, not deep. ◮ A lot to do, but all easy, mostly with a template to start from ◮ Net and programming basics (Lab1), Net connections (Lab 2) ◮ Server side (Lab 3, Lab 4), Client side (Lab 5)

◮ Projects

◮ You define your projects. ◮ You form the project groups. ◮ Send me an email with a 5-line project idea and names of group members DD1335 (Lecture 1) Basic Internet Programming Spring 2010 4 / 23

slide-18
SLIDE 18

Welcome

Labs and Project

◮ Labs

◮ Principles: wide, not deep. ◮ A lot to do, but all easy, mostly with a template to start from ◮ Net and programming basics (Lab1), Net connections (Lab 2) ◮ Server side (Lab 3, Lab 4), Client side (Lab 5)

◮ Projects

◮ You define your projects. ◮ You form the project groups. ◮ Send me an email with a 5-line project idea and names of group members ◮ The project must be an interactive WWW system. Simple HTML pages are

not enough

DD1335 (Lecture 1) Basic Internet Programming Spring 2010 4 / 23

slide-19
SLIDE 19

Welcome

Labs and Project

◮ Labs

◮ Principles: wide, not deep. ◮ A lot to do, but all easy, mostly with a template to start from ◮ Net and programming basics (Lab1), Net connections (Lab 2) ◮ Server side (Lab 3, Lab 4), Client side (Lab 5)

◮ Projects

◮ You define your projects. ◮ You form the project groups. ◮ Send me an email with a 5-line project idea and names of group members ◮ The project must be an interactive WWW system. Simple HTML pages are

not enough

◮ Required: server-side programming (e.g. shopping baskets, booking

systems, resource allocation)

DD1335 (Lecture 1) Basic Internet Programming Spring 2010 4 / 23

slide-20
SLIDE 20

Welcome

Labs and Project

◮ Labs

◮ Principles: wide, not deep. ◮ A lot to do, but all easy, mostly with a template to start from ◮ Net and programming basics (Lab1), Net connections (Lab 2) ◮ Server side (Lab 3, Lab 4), Client side (Lab 5)

◮ Projects

◮ You define your projects. ◮ You form the project groups. ◮ Send me an email with a 5-line project idea and names of group members ◮ The project must be an interactive WWW system. Simple HTML pages are

not enough

◮ Required: server-side programming (e.g. shopping baskets, booking

systems, resource allocation)

◮ Required: JavaScript (e.g. client-side checking of user input, etc) DD1335 (Lecture 1) Basic Internet Programming Spring 2010 4 / 23

slide-21
SLIDE 21

Welcome

Labs and Project

◮ Labs

◮ Principles: wide, not deep. ◮ A lot to do, but all easy, mostly with a template to start from ◮ Net and programming basics (Lab1), Net connections (Lab 2) ◮ Server side (Lab 3, Lab 4), Client side (Lab 5)

◮ Projects

◮ You define your projects. ◮ You form the project groups. ◮ Send me an email with a 5-line project idea and names of group members ◮ The project must be an interactive WWW system. Simple HTML pages are

not enough

◮ Required: server-side programming (e.g. shopping baskets, booking

systems, resource allocation)

◮ Required: JavaScript (e.g. client-side checking of user input, etc) ◮ Not much technical complexity, but a high editorial quality (good layout,

including CSS), making the best of the Internet medium

DD1335 (Lecture 1) Basic Internet Programming Spring 2010 4 / 23

slide-22
SLIDE 22

Welcome

Labs and Project

◮ Labs

◮ Principles: wide, not deep. ◮ A lot to do, but all easy, mostly with a template to start from ◮ Net and programming basics (Lab1), Net connections (Lab 2) ◮ Server side (Lab 3, Lab 4), Client side (Lab 5)

◮ Projects

◮ You define your projects. ◮ You form the project groups. ◮ Send me an email with a 5-line project idea and names of group members ◮ The project must be an interactive WWW system. Simple HTML pages are

not enough

◮ Required: server-side programming (e.g. shopping baskets, booking

systems, resource allocation)

◮ Required: JavaScript (e.g. client-side checking of user input, etc) ◮ Not much technical complexity, but a high editorial quality (good layout,

including CSS), making the best of the Internet medium

◮ Make goups of 3 to 6 people DD1335 (Lecture 1) Basic Internet Programming Spring 2010 4 / 23

slide-23
SLIDE 23

Welcome

Administration

◮ Course codes: gruint10

DD1335 (Lecture 1) Basic Internet Programming Spring 2010 5 / 23

slide-24
SLIDE 24

Welcome

Administration

◮ Course codes: gruint10 ◮ Register on the course (for admin of course element results):

Log in to some computer Start a web browser and connect to https://rapp.nada.kth.se/rapp and login Activate the course instance ”gruint10”

DD1335 (Lecture 1) Basic Internet Programming Spring 2010 5 / 23

slide-25
SLIDE 25

Welcome

Administration

◮ Course codes: gruint10 ◮ Register on the course (for admin of course element results):

Log in to some computer Start a web browser and connect to https://rapp.nada.kth.se/rapp and login Activate the course instance ”gruint10”

◮ To get info apart from that on the web

course join gruint10

DD1335 (Lecture 1) Basic Internet Programming Spring 2010 5 / 23

slide-26
SLIDE 26

Network basics

Introduction to the internet

Content

A little on:

◮ network concepts ◮ web concepts ◮ internet addresses ◮ sockets

DD1335 (Lecture 1) Basic Internet Programming Spring 2010 6 / 23

slide-27
SLIDE 27

Network basics

Introduction to the internet

Content

A little on:

◮ network concepts ◮ web concepts ◮ internet addresses ◮ sockets

References:

◮ Harold: Java Network Programming ◮ Hall: Core Web Programming ◮ Deitel, et al: Internet and the World Wide Web How to Program ◮ Ince: Developing Distributed and E-Commerce Applications

DD1335 (Lecture 1) Basic Internet Programming Spring 2010 6 / 23

slide-28
SLIDE 28

Network basics

Programming network applications

◮ Why network applications?

DD1335 (Lecture 1) Basic Internet Programming Spring 2010 7 / 23

slide-29
SLIDE 29

Network basics

Programming network applications

◮ Why network applications?

◮ Alongside the technical ”evolution”, communication between application and

also between parts of applications residing on different computer become more and more common

DD1335 (Lecture 1) Basic Internet Programming Spring 2010 7 / 23

slide-30
SLIDE 30

Network basics

Programming network applications

◮ Why network applications?

◮ Alongside the technical ”evolution”, communication between application and

also between parts of applications residing on different computer become more and more common

◮ Examples of asynchronously communicating applications:

web browsers, e-mail, news.

DD1335 (Lecture 1) Basic Internet Programming Spring 2010 7 / 23

slide-31
SLIDE 31

Network basics

Programming network applications

◮ Why network applications?

◮ Alongside the technical ”evolution”, communication between application and

also between parts of applications residing on different computer become more and more common

◮ Examples of asynchronously communicating applications:

web browsers, e-mail, news.

◮ Some other examples: Distributed databases, sound, radio, video and

internet telephony.

DD1335 (Lecture 1) Basic Internet Programming Spring 2010 7 / 23

slide-32
SLIDE 32

Network basics

Programming network applications

◮ Why network applications?

◮ Alongside the technical ”evolution”, communication between application and

also between parts of applications residing on different computer become more and more common

◮ Examples of asynchronously communicating applications:

web browsers, e-mail, news.

◮ Some other examples: Distributed databases, sound, radio, video and

internet telephony.

◮ Need for applications where the participants are aware of each others:

DD1335 (Lecture 1) Basic Internet Programming Spring 2010 7 / 23

slide-33
SLIDE 33

Network basics

Programming network applications

◮ Why network applications?

◮ Alongside the technical ”evolution”, communication between application and

also between parts of applications residing on different computer become more and more common

◮ Examples of asynchronously communicating applications:

web browsers, e-mail, news.

◮ Some other examples: Distributed databases, sound, radio, video and

internet telephony.

◮ Need for applications where the participants are aware of each others:

◮ Shared bulletin boards, whiteboards, shared word processors, control

systems (eg. robots) and (not the least) games (like runescape and world of warcraft).

DD1335 (Lecture 1) Basic Internet Programming Spring 2010 7 / 23

slide-34
SLIDE 34

Network basics

Programming network applications

◮ Why network applications?

◮ Alongside the technical ”evolution”, communication between application and

also between parts of applications residing on different computer become more and more common

◮ Examples of asynchronously communicating applications:

web browsers, e-mail, news.

◮ Some other examples: Distributed databases, sound, radio, video and

internet telephony.

◮ Need for applications where the participants are aware of each others:

◮ Shared bulletin boards, whiteboards, shared word processors, control

systems (eg. robots) and (not the least) games (like runescape and world of warcraft).

◮ There is support in the networks, where we will look closer on the

internet.

DD1335 (Lecture 1) Basic Internet Programming Spring 2010 7 / 23

slide-35
SLIDE 35

Network basics

Programming network applications

◮ Large amounts of internet sites

◮ Auctions, advertising, commerse, portals with collections of sites concerning

business, music, film, software, info, reports of various kinds books, search engines, education, . . .

DD1335 (Lecture 1) Basic Internet Programming Spring 2010 8 / 23

slide-36
SLIDE 36

Network basics

Programming network applications

◮ Large amounts of internet sites

◮ Auctions, advertising, commerse, portals with collections of sites concerning

business, music, film, software, info, reports of various kinds books, search engines, education, . . .

◮ Kinds of application programs

◮ E-mail ◮ News ◮ Web based databases ◮ Client-server, per-to-peer ◮ Telephone ◮ Video ◮ . . . DD1335 (Lecture 1) Basic Internet Programming Spring 2010 8 / 23

slide-37
SLIDE 37

Network basics

Networks

A network is in this respect a collection of interconnected computers and/or

  • ther kinds of equipment

DD1335 (Lecture 1) Basic Internet Programming Spring 2010 9 / 23

slide-38
SLIDE 38

Network basics

Networks

A network is in this respect a collection of interconnected computers and/or

  • ther kinds of equipment

Terminology:

◮ node, a machine that is connected to the network (computer, printer, bridge,

vending machine, . . . )

DD1335 (Lecture 1) Basic Internet Programming Spring 2010 9 / 23

slide-39
SLIDE 39

Network basics

Networks

A network is in this respect a collection of interconnected computers and/or

  • ther kinds of equipment

Terminology:

◮ node, a machine that is connected to the network (computer, printer, bridge,

vending machine, . . . )

◮ host, a fully autonomous computer connected to the network

DD1335 (Lecture 1) Basic Internet Programming Spring 2010 9 / 23

slide-40
SLIDE 40

Network basics

Networks

A network is in this respect a collection of interconnected computers and/or

  • ther kinds of equipment

Terminology:

◮ node, a machine that is connected to the network (computer, printer, bridge,

vending machine, . . . )

◮ host, a fully autonomous computer connected to the network ◮ address, each node has a unique address (a number of bytes)

DD1335 (Lecture 1) Basic Internet Programming Spring 2010 9 / 23

slide-41
SLIDE 41

Network basics

Networks

A network is in this respect a collection of interconnected computers and/or

  • ther kinds of equipment

Terminology:

◮ node, a machine that is connected to the network (computer, printer, bridge,

vending machine, . . . )

◮ host, a fully autonomous computer connected to the network ◮ address, each node has a unique address (a number of bytes) ◮ packet, modern networks are packet based, meaning that the information is

broken down to and sent as small chunks, each chunk of information handled separately.

DD1335 (Lecture 1) Basic Internet Programming Spring 2010 9 / 23

slide-42
SLIDE 42

Network basics

Networks

A network is in this respect a collection of interconnected computers and/or

  • ther kinds of equipment

Terminology:

◮ node, a machine that is connected to the network (computer, printer, bridge,

vending machine, . . . )

◮ host, a fully autonomous computer connected to the network ◮ address, each node has a unique address (a number of bytes) ◮ packet, modern networks are packet based, meaning that the information is

broken down to and sent as small chunks, each chunk of information handled separately.

◮ protocol, rules, specifying how to perform communication

DD1335 (Lecture 1) Basic Internet Programming Spring 2010 9 / 23

slide-43
SLIDE 43

Network basics

Internet

Internet is the most know and most wide spread network.

DD1335 (Lecture 1) Basic Internet Programming Spring 2010 10 / 23

slide-44
SLIDE 44

Network basics

Internet

Internet is the most know and most wide spread network.

◮ Designed to be robust (errors are unusual)

DD1335 (Lecture 1) Basic Internet Programming Spring 2010 10 / 23

slide-45
SLIDE 45

Network basics

Internet

Internet is the most know and most wide spread network.

◮ Designed to be robust (errors are unusual) ◮ First version 1969, ARPANET, designed by ARPA, a DoD unit.

DD1335 (Lecture 1) Basic Internet Programming Spring 2010 10 / 23

slide-46
SLIDE 46

Network basics

Internet

Internet is the most know and most wide spread network.

◮ Designed to be robust (errors are unusual) ◮ First version 1969, ARPANET, designed by ARPA, a DoD unit. ◮ 1983 there were 562 computers on the ARPANET

DD1335 (Lecture 1) Basic Internet Programming Spring 2010 10 / 23

slide-47
SLIDE 47

Network basics

Internet

Internet is the most know and most wide spread network.

◮ Designed to be robust (errors are unusual) ◮ First version 1969, ARPANET, designed by ARPA, a DoD unit. ◮ 1983 there were 562 computers on the ARPANET ◮ 1986 there were 5000 computers

DD1335 (Lecture 1) Basic Internet Programming Spring 2010 10 / 23

slide-48
SLIDE 48

Network basics

Internet

Internet is the most know and most wide spread network.

◮ Designed to be robust (errors are unusual) ◮ First version 1969, ARPANET, designed by ARPA, a DoD unit. ◮ 1983 there were 562 computers on the ARPANET ◮ 1986 there were 5000 computers ◮ 1987 – 28000, ◮ 1989 – 100000, ◮ 1990 – 300000, ◮ 2009 – 1.67 billion (a rough estimate on June 30)

DD1335 (Lecture 1) Basic Internet Programming Spring 2010 10 / 23

slide-49
SLIDE 49

Network basics

Layers

A network is built as a set of layers

DD1335 (Lecture 1) Basic Internet Programming Spring 2010 11 / 23

slide-50
SLIDE 50

Network basics

Layers

A network is built as a set of layers

Application (HTTP, FTP, Telnet) (HTTP, FTP, Telnet) Logical connection Application

DD1335 (Lecture 1) Basic Internet Programming Spring 2010 11 / 23

slide-51
SLIDE 51

Network basics

Layers

A network is built as a set of layers

Transport (TCP, UDP, ...) Application (HTTP, FTP, Telnet) (HTTP, FTP, Telnet) Transport (TCP, UDP, ...) Logical connection Application

DD1335 (Lecture 1) Basic Internet Programming Spring 2010 11 / 23

slide-52
SLIDE 52

Network basics

Layers

A network is built as a set of layers

(IP, ...) Transport (TCP, UDP, ...) Application (HTTP, FTP, Telnet) (HTTP, FTP, Telnet) Transport (TCP, UDP, ...) (IP, ...) Network Logical connection Application Network

DD1335 (Lecture 1) Basic Internet Programming Spring 2010 11 / 23

slide-53
SLIDE 53

Network basics

Layers

A network is built as a set of layers

(IP, ...) Transport (TCP, UDP, ...) Application (HTTP, FTP, Telnet) (HTTP, FTP, Telnet) Transport (TCP, UDP, ...) (IP, ...) Physical layer Network Logical connection Application Network (Ethernet, FDDI, LocalTalk, drivers, ...)

DD1335 (Lecture 1) Basic Internet Programming Spring 2010 11 / 23

slide-54
SLIDE 54

Network basics

Layers

A network is built as a set of layers

(IP, ...) Transport (TCP, UDP, ...) Application (HTTP, FTP, Telnet) (HTTP, FTP, Telnet) Transport (TCP, UDP, ...) (IP, ...) Physical layer Network Logical connection Application Network (Ethernet, FDDI, LocalTalk, drivers, ...)

◮ Application programmers work mainly in the upper layer

DD1335 (Lecture 1) Basic Internet Programming Spring 2010 11 / 23

slide-55
SLIDE 55

Network basics

Layers

A network is built as a set of layers

(IP, ...) Transport (TCP, UDP, ...) Application (HTTP, FTP, Telnet) (HTTP, FTP, Telnet) Transport (TCP, UDP, ...) (IP, ...) Physical layer Network Logical connection Application Network (Ethernet, FDDI, LocalTalk, drivers, ...)

◮ Application programmers work mainly in the upper layer ◮ Eventually in the transport layer (in distributed applications)

DD1335 (Lecture 1) Basic Internet Programming Spring 2010 11 / 23

slide-56
SLIDE 56

Network basics

Layers

A network is built as a set of layers

(IP, ...) Transport (TCP, UDP, ...) Application (HTTP, FTP, Telnet) (HTTP, FTP, Telnet) Transport (TCP, UDP, ...) (IP, ...) Physical layer Network Logical connection Application Network (Ethernet, FDDI, LocalTalk, drivers, ...)

◮ Application programmers work mainly in the upper layer ◮ Eventually in the transport layer (in distributed applications) ◮ Other layers are normally of no concern

DD1335 (Lecture 1) Basic Internet Programming Spring 2010 11 / 23

slide-57
SLIDE 57

Network basics

IP , TCP , UDP

◮ IP, Internet Protocol

the network layer protocol (the reason for the name ”Internet”)

DD1335 (Lecture 1) Basic Internet Programming Spring 2010 12 / 23

slide-58
SLIDE 58

Network basics

IP , TCP , UDP

◮ IP, Internet Protocol

the network layer protocol (the reason for the name ”Internet”)

◮ TCP, Transport Control Protocol

a connection based protocol which insures a correct data exchange between two nodes

DD1335 (Lecture 1) Basic Internet Programming Spring 2010 12 / 23

slide-59
SLIDE 59

Network basics

IP , TCP , UDP

◮ IP, Internet Protocol

the network layer protocol (the reason for the name ”Internet”)

◮ TCP, Transport Control Protocol

a connection based protocol which insures a correct data exchange between two nodes

◮ UDP, User Datagram Protocol

a protocol which allows the transmission of independant packets from one node to antoher with no guarantee concerning delivery or order of delivery

DD1335 (Lecture 1) Basic Internet Programming Spring 2010 12 / 23

slide-60
SLIDE 60

Network basics

IP address, DNS

◮ IP address. Each machine is identified by a unique 4-byte number

DD1335 (Lecture 1) Basic Internet Programming Spring 2010 13 / 23

slide-61
SLIDE 61

Network basics

IP address, DNS

◮ IP address. Each machine is identified by a unique 4-byte number

◮ Many computers have a fixed number, others get a dynamically assigned

number at connection time

DD1335 (Lecture 1) Basic Internet Programming Spring 2010 13 / 23

slide-62
SLIDE 62

Network basics

IP address, DNS

◮ IP address. Each machine is identified by a unique 4-byte number

◮ Many computers have a fixed number, others get a dynamically assigned

number at connection time

◮ 1995 the use of the internet ”exploded” and as there are not enough 4-byte

numbers (you get a ”lousy” 232 = 4294967296 addresses)

DD1335 (Lecture 1) Basic Internet Programming Spring 2010 13 / 23

slide-63
SLIDE 63

Network basics

IP address, DNS

◮ IP address. Each machine is identified by a unique 4-byte number

◮ Many computers have a fixed number, others get a dynamically assigned

number at connection time

◮ 1995 the use of the internet ”exploded” and as there are not enough 4-byte

numbers (you get a ”lousy” 232 = 4294967296 addresses), IPv6 was created giving 2128 = 340282366920938463463374607431768211456 adresses. Ought to be enough for some time . . .

◮ DNS, Domain Name Server

◮ IP-addresses are hard to remember and thus DNS was created to allow

symbolic (textuel) names that are looked up and translated to IP-addresses

◮ Eg.: www.nada.kth.se is translated to 130.237.225.40 DD1335 (Lecture 1) Basic Internet Programming Spring 2010 13 / 23

slide-64
SLIDE 64

Network basics

Ports

◮ Every computer with an IP-address has 65536 logical ports for

communication over the internet.

◮ Some are reserved

◮ ports number 0-1023 are reserved (for what and by whome may be seen in

the file /etc/services (on UNIX/Linux)

◮ eg. the following: ◮ port 7 for echo ◮ port 20-21 for ftp ◮ port 23 for telnet ◮ port 25 for smtp (send e-mail) ◮ port 80 for http (web server) ◮ port 110 for POP3 (read e-mail) DD1335 (Lecture 1) Basic Internet Programming Spring 2010 14 / 23

slide-65
SLIDE 65

Network basics

Intranet

There are other networks with the same structure. Local networks are usually called intranet. They may link to the internet with special ”bridges”. Sometimes the bridge uses filtering devices to restrict the data traffic between the networks.

51 52 53 54

192.168.0.199

192.168.0.2 192.168.0.1

212.223.44.65

wireless connection point switch bridge intranet internet DD1335 (Lecture 1) Basic Internet Programming Spring 2010 15 / 23

slide-66
SLIDE 66

Network basics

The client-server model

◮ Today, the client-server model is the prevailing when constructing

distributed, cooperating application programs.

DD1335 (Lecture 1) Basic Internet Programming Spring 2010 16 / 23

slide-67
SLIDE 67

Network basics

The client-server model

◮ Today, the client-server model is the prevailing when constructing

distributed, cooperating application programs.

◮ a client asks a server for a service (as eg. information about the time) DD1335 (Lecture 1) Basic Internet Programming Spring 2010 16 / 23

slide-68
SLIDE 68

Network basics

The client-server model

◮ Today, the client-server model is the prevailing when constructing

distributed, cooperating application programs.

◮ a client asks a server for a service (as eg. information about the time) ◮ a server accomplishes the corresponding task and delivers the service (like

sending time info, sending a file from its local file system, eg. a web page)

DD1335 (Lecture 1) Basic Internet Programming Spring 2010 16 / 23

slide-69
SLIDE 69

Network basics

The client-server model

◮ Today, the client-server model is the prevailing when constructing

distributed, cooperating application programs.

◮ a client asks a server for a service (as eg. information about the time) ◮ a server accomplishes the corresponding task and delivers the service (like

sending time info, sending a file from its local file system, eg. a web page)

◮ both following a protocol that enables asking for and providing services over

the network

DD1335 (Lecture 1) Basic Internet Programming Spring 2010 16 / 23

slide-70
SLIDE 70

Network basics

The client-server model . . .

◮ Not all kinds of application programs fit into the client-server model.

Some act simultaneously as both client and server and, if both ”ends” of a communication do, that communication is called”peer-to-peer”.

DD1335 (Lecture 1) Basic Internet Programming Spring 2010 17 / 23

slide-71
SLIDE 71

Network basics

The client-server model . . .

◮ Not all kinds of application programs fit into the client-server model.

Some act simultaneously as both client and server and, if both ”ends” of a communication do, that communication is called”peer-to-peer”. Eg:

◮ a shared editor ◮ a game (runescape, world of warcraft, . . . ) ◮ a telephone connection DD1335 (Lecture 1) Basic Internet Programming Spring 2010 17 / 23

slide-72
SLIDE 72

Network basics

RFC (Request for comments)

◮ Some internet standards have been developed publicly already from the

prototype stage

DD1335 (Lecture 1) Basic Internet Programming Spring 2010 18 / 23

slide-73
SLIDE 73

Network basics

RFC (Request for comments)

◮ Some internet standards have been developed publicly already from the

prototype stage

◮ Their protcols are publicly accessible on the internet

DD1335 (Lecture 1) Basic Internet Programming Spring 2010 18 / 23

slide-74
SLIDE 74

Network basics

RFC (Request for comments)

◮ Some internet standards have been developed publicly already from the

prototype stage

◮ Their protcols are publicly accessible on the internet ◮ These protocols fit into the following categories:

DD1335 (Lecture 1) Basic Internet Programming Spring 2010 18 / 23

slide-75
SLIDE 75

Network basics

RFC (Request for comments)

◮ Some internet standards have been developed publicly already from the

prototype stage

◮ Their protcols are publicly accessible on the internet ◮ These protocols fit into the following categories:

◮ Mandatory – each host must implement them, eg. IP DD1335 (Lecture 1) Basic Internet Programming Spring 2010 18 / 23

slide-76
SLIDE 76

Network basics

RFC (Request for comments)

◮ Some internet standards have been developed publicly already from the

prototype stage

◮ Their protcols are publicly accessible on the internet ◮ These protocols fit into the following categories:

◮ Mandatory – each host must implement them, eg. IP ◮ Recommended – that ought to be implemented, eg. TCP

, SMTP , UDP , TelNet, . . .

DD1335 (Lecture 1) Basic Internet Programming Spring 2010 18 / 23

slide-77
SLIDE 77

Network basics

RFC (Request for comments)

◮ Some internet standards have been developed publicly already from the

prototype stage

◮ Their protcols are publicly accessible on the internet ◮ These protocols fit into the following categories:

◮ Mandatory – each host must implement them, eg. IP ◮ Recommended – that ought to be implemented, eg. TCP

, SMTP , UDP , TelNet, . . .

◮ Optional, like MIME DD1335 (Lecture 1) Basic Internet Programming Spring 2010 18 / 23

slide-78
SLIDE 78

Network basics

RFC (Request for comments)

◮ Some internet standards have been developed publicly already from the

prototype stage

◮ Their protcols are publicly accessible on the internet ◮ These protocols fit into the following categories:

◮ Mandatory – each host must implement them, eg. IP ◮ Recommended – that ought to be implemented, eg. TCP

, SMTP , UDP , TelNet, . . .

◮ Optional, like MIME ◮ Restricted, that are neccessary only in special cases DD1335 (Lecture 1) Basic Internet Programming Spring 2010 18 / 23

slide-79
SLIDE 79

Network basics

RFC (Request for comments)

◮ Some internet standards have been developed publicly already from the

prototype stage

◮ Their protcols are publicly accessible on the internet ◮ These protocols fit into the following categories:

◮ Mandatory – each host must implement them, eg. IP ◮ Recommended – that ought to be implemented, eg. TCP

, SMTP , UDP , TelNet, . . .

◮ Optional, like MIME ◮ Restricted, that are neccessary only in special cases ◮ Not recommended, that should not be implemented DD1335 (Lecture 1) Basic Internet Programming Spring 2010 18 / 23

slide-80
SLIDE 80

Network basics

RFC (Request for comments)

◮ Some internet standards have been developed publicly already from the

prototype stage

◮ Their protcols are publicly accessible on the internet ◮ These protocols fit into the following categories:

◮ Mandatory – each host must implement them, eg. IP ◮ Recommended – that ought to be implemented, eg. TCP

, SMTP , UDP , TelNet, . . .

◮ Optional, like MIME ◮ Restricted, that are neccessary only in special cases ◮ Not recommended, that should not be implemented ◮ Historical (obsolete, deprecated) DD1335 (Lecture 1) Basic Internet Programming Spring 2010 18 / 23

slide-81
SLIDE 81

Network basics

RFC (Request for comments)

◮ Some internet standards have been developed publicly already from the

prototype stage

◮ Their protcols are publicly accessible on the internet ◮ These protocols fit into the following categories:

◮ Mandatory – each host must implement them, eg. IP ◮ Recommended – that ought to be implemented, eg. TCP

, SMTP , UDP , TelNet, . . .

◮ Optional, like MIME ◮ Restricted, that are neccessary only in special cases ◮ Not recommended, that should not be implemented ◮ Historical (obsolete, deprecated) ◮ Informative, that may have been constructed outside the RFC but still are

useful without delivering an established protocol

DD1335 (Lecture 1) Basic Internet Programming Spring 2010 18 / 23

slide-82
SLIDE 82

Network basics

HTTP , HTML, XHTML, MIME

DD1335 (Lecture 1) Basic Internet Programming Spring 2010 19 / 23

slide-83
SLIDE 83

Network basics

HTTP , HTML, XHTML, MIME

◮ HTTP

, HyperText Transfer Protocol,

◮ a standard protocol for the communication between a web server and a web

client (web browser)

DD1335 (Lecture 1) Basic Internet Programming Spring 2010 19 / 23

slide-84
SLIDE 84

Network basics

HTTP , HTML, XHTML, MIME

◮ HTTP

, HyperText Transfer Protocol,

◮ a standard protocol for the communication between a web server and a web

client (web browser)

◮ HTML, HyperText Markup Language

◮ the first generation standard language for the contruction of web pages, a

subset to SGML with extra error tolerance

DD1335 (Lecture 1) Basic Internet Programming Spring 2010 19 / 23

slide-85
SLIDE 85

Network basics

HTTP , HTML, XHTML, MIME

◮ HTTP

, HyperText Transfer Protocol,

◮ a standard protocol for the communication between a web server and a web

client (web browser)

◮ HTML, HyperText Markup Language

◮ the first generation standard language for the contruction of web pages, a

subset to SGML with extra error tolerance

◮ XHTML, eXtensible HTML,

second generation language for the contruction of web pages, HTML as a strict subset to XML

DD1335 (Lecture 1) Basic Internet Programming Spring 2010 19 / 23

slide-86
SLIDE 86

Network basics

HTTP , HTML, XHTML, MIME

◮ HTTP

, HyperText Transfer Protocol,

◮ a standard protocol for the communication between a web server and a web

client (web browser)

◮ HTML, HyperText Markup Language

◮ the first generation standard language for the contruction of web pages, a

subset to SGML with extra error tolerance

◮ XHTML, eXtensible HTML,

second generation language for the contruction of web pages, HTML as a strict subset to XML

◮ MIME, Multipurpose Internet Mail Extension

◮ an open standard that determines how multimedia objects are to be

transmitted by e-mail

DD1335 (Lecture 1) Basic Internet Programming Spring 2010 19 / 23

slide-87
SLIDE 87

Network basics

URL, URI, URN

◮ URI, Uniform Resource Identifier

DD1335 (Lecture 1) Basic Internet Programming Spring 2010 20 / 23

slide-88
SLIDE 88

Network basics

URL, URI, URN

◮ URI, Uniform Resource Identifier

◮ define how to uniquely identify a resource on the internet ◮ is divided into the subgroups URL and URN DD1335 (Lecture 1) Basic Internet Programming Spring 2010 20 / 23

slide-89
SLIDE 89

Network basics

URL, URI, URN

◮ URI, Uniform Resource Identifier

◮ define how to uniquely identify a resource on the internet ◮ is divided into the subgroups URL and URN

◮ URL, Uniform Resource Locator

DD1335 (Lecture 1) Basic Internet Programming Spring 2010 20 / 23

slide-90
SLIDE 90

Network basics

URL, URI, URN

◮ URI, Uniform Resource Identifier

◮ define how to uniquely identify a resource on the internet ◮ is divided into the subgroups URL and URN

◮ URL, Uniform Resource Locator

◮ a reference for an address on the internet DD1335 (Lecture 1) Basic Internet Programming Spring 2010 20 / 23

slide-91
SLIDE 91

Network basics

URL, URI, URN

◮ URI, Uniform Resource Identifier

◮ define how to uniquely identify a resource on the internet ◮ is divided into the subgroups URL and URN

◮ URL, Uniform Resource Locator

◮ a reference for an address on the internet ◮ looks like: protocol://host[:port]/path/file[#section] DD1335 (Lecture 1) Basic Internet Programming Spring 2010 20 / 23

slide-92
SLIDE 92

Network basics

URL, URI, URN

◮ URI, Uniform Resource Identifier

◮ define how to uniquely identify a resource on the internet ◮ is divided into the subgroups URL and URN

◮ URL, Uniform Resource Locator

◮ a reference for an address on the internet ◮ looks like: protocol://host[:port]/path/file[#section] ◮ eg:

http://www.csc.kth.se:8080/dd1335/gruint09/labs/#lab2

DD1335 (Lecture 1) Basic Internet Programming Spring 2010 20 / 23

slide-93
SLIDE 93

Network basics

URL, URI, URN

◮ URI, Uniform Resource Identifier

◮ define how to uniquely identify a resource on the internet ◮ is divided into the subgroups URL and URN

◮ URL, Uniform Resource Locator

◮ a reference for an address on the internet ◮ looks like: protocol://host[:port]/path/file[#section] ◮ eg:

http://www.csc.kth.se:8080/dd1335/gruint09/labs/#lab2

◮ URN, Universal Resource Name

DD1335 (Lecture 1) Basic Internet Programming Spring 2010 20 / 23

slide-94
SLIDE 94

Network basics

URL, URI, URN

◮ URI, Uniform Resource Identifier

◮ define how to uniquely identify a resource on the internet ◮ is divided into the subgroups URL and URN

◮ URL, Uniform Resource Locator

◮ a reference for an address on the internet ◮ looks like: protocol://host[:port]/path/file[#section] ◮ eg:

http://www.csc.kth.se:8080/dd1335/gruint09/labs/#lab2

◮ URN, Universal Resource Name

◮ a ”pointer” to a resource without specifying its exact position, eg. the search

for a certain kind of documents may deliver the set of URLs (the positions of all the documents)

DD1335 (Lecture 1) Basic Internet Programming Spring 2010 20 / 23

slide-95
SLIDE 95

Network basics

SGML & HTML

◮ SGML, Standard Generalized Markup Language

DD1335 (Lecture 1) Basic Internet Programming Spring 2010 21 / 23

slide-96
SLIDE 96

Network basics

SGML & HTML

◮ SGML, Standard Generalized Markup Language

◮ Was created in the 1970s ◮ Describes the sematics of a text rather than its presentation DD1335 (Lecture 1) Basic Internet Programming Spring 2010 21 / 23

slide-97
SLIDE 97

Network basics

SGML & HTML

◮ SGML, Standard Generalized Markup Language

◮ Was created in the 1970s ◮ Describes the sematics of a text rather than its presentation

◮ HTML, HyperText Markup Language

DD1335 (Lecture 1) Basic Internet Programming Spring 2010 21 / 23

slide-98
SLIDE 98

Network basics

SGML & HTML

◮ SGML, Standard Generalized Markup Language

◮ Was created in the 1970s ◮ Describes the sematics of a text rather than its presentation

◮ HTML, HyperText Markup Language

◮ Was created from SGML early in the 1990s ◮ Describes how to present a text rather than its semantics ◮ Is ”lingua franca” for presentation of hypertext on the web DD1335 (Lecture 1) Basic Internet Programming Spring 2010 21 / 23

slide-99
SLIDE 99

Network basics

HTTP

◮ HTTP

, HyperText Transport Protocol

◮ a standard describing how a web client and a web server should exchange

data

DD1335 (Lecture 1) Basic Internet Programming Spring 2010 22 / 23

slide-100
SLIDE 100

Network basics

HTTP

◮ HTTP

, HyperText Transport Protocol

◮ a standard describing how a web client and a web server should exchange

data

◮ uses MIME to decode data DD1335 (Lecture 1) Basic Internet Programming Spring 2010 22 / 23

slide-101
SLIDE 101

Network basics

HTTP

◮ HTTP

, HyperText Transport Protocol

◮ a standard describing how a web client and a web server should exchange

data

◮ uses MIME to decode data ◮ uses TCP/IP for the transmission of data DD1335 (Lecture 1) Basic Internet Programming Spring 2010 22 / 23

slide-102
SLIDE 102

Network basics

HTTP

◮ HTTP

, HyperText Transport Protocol

◮ a standard describing how a web client and a web server should exchange

data

◮ uses MIME to decode data ◮ uses TCP/IP for the transmission of data ◮ The client sends a message once the communication has been established

  • eg. GET /index.html HTTP/1.1

DD1335 (Lecture 1) Basic Internet Programming Spring 2010 22 / 23

slide-103
SLIDE 103

Network basics

HTTP

◮ HTTP

, HyperText Transport Protocol

◮ a standard describing how a web client and a web server should exchange

data

◮ uses MIME to decode data ◮ uses TCP/IP for the transmission of data ◮ The client sends a message once the communication has been established

  • eg. GET /index.html HTTP/1.1

◮ the web server responds by sending the file index.html to the client DD1335 (Lecture 1) Basic Internet Programming Spring 2010 22 / 23

slide-104
SLIDE 104

Network basics

MIME

◮ MIME, Multipurpose Internet Mail Extension

◮ an open standard for how to send multimedia objects by e-mail ◮ denotes the type of data that is transmitted, DD1335 (Lecture 1) Basic Internet Programming Spring 2010 23 / 23

slide-105
SLIDE 105

Network basics

MIME

◮ MIME, Multipurpose Internet Mail Extension

◮ an open standard for how to send multimedia objects by e-mail ◮ denotes the type of data that is transmitted, eg. ◮ text/plain, text/html ◮ news ◮ application/postscript, application/pdf ◮ zip ◮ image/gif, image/jpeg, image/tiff, image/x-bitmap ◮ audio/basic, audio/mpeg ◮ video/mpeg, video/quicktime, video/x-msvideo DD1335 (Lecture 1) Basic Internet Programming Spring 2010 23 / 23