Você está na página 1de 24

Internet Programming

AIM and Objectives


To explain Internet Programming concepts and related programming
and scripting languages.
To describe basic Internet Protocols.
Explain JAVA and HTML tools for Internet programming.
Describe scripting languages Java Script.
Explain dynamic HTML programming.
Explain Server Side Programming tools.
Basic Network and Web Concepts
Internet standards TCP and UDP protocols URLs MIME CGI
Introduction to SGML.
What is a Network?
Definition: A network is a collection of computers and other devices
that can send data to and receive data from each other, more or less
in real time.
How is it connected?
How the data flows?
Medium of propagation Wires, Wireless
What is a Node, Host?
How is a node identified?
What is a Network?
How are addresses assigned?
What are Ethernet addresses?
Why are they unique?
Who assigns Internet addresses?
Internet Service Provider (ISP)?
Internet Registrars?
Internet Corporation for Assigned Names and Numbers (ICANN)
What is a Network?
How to remember addresses for the format 192.168.0.1?
Can the addresses be named?
Domain Name & address association.
Protocol: A protocol is a precise set of rules defining how computers
communicate: the format of addresses, how data is split into
packets., so on. E.g. TCP, HTTP, FTP
Network Layers
Internet Layer
Internet layer protocol defines how bits and bytes of data are
organized into the larger groups called packets, and the addressing
scheme by which different machines find each other or otherwise
called as Internet Protocol (IP).
Each network layer protocol is independent of the lower layers.
Data is sent across the internet layer in packets called datagrams.
Each IP datagram contains a header between 20 and 60 bytes long
and a payload that contains up to 65,515 (64K) bytes of data. (In
implementation, most IP datagrams range from a few dozen bytes to
a little more than eight kilobytes.)
Header of each IP datagram
Transport Layer
Ensures all data received by requesting for re-transmit to sender.
Guarantees all the packets has arrived to the receiver.
Ensures the stream of packets is in correct receive order since each
datagrams follow individual route.
Additional headers are required for 2 protocols:
TCP allows retransmission of lost/corrupted data, delivery of bytes
in order sent.
UDP detects corrupted packets, doesnt ensure correct order.
Application Layer
Delivers data to the user. E.g. HTTP protocol in this layer knows how
to display data in the web browser image/text.
Lower layers responsible to transmit data to one host to another.
Gamut of protocols:
HTTP, FTP, TFTP
NFS
NNTP
SMTP, POP, IMAP
IP, TCP and UDP Summary
TCP layered on top of IP guarantees retransmission of corrupt or
lost data, ensures the correct order of data to match with the
receiving end to that of sender.
Disadvantage of TCP overhead of ensuring packet arrival correctly.
E.g.?
Is UDP acceptable? Where?
What is ICMP?
IP Addresses and Domain Names
IPv4 address 4 byte number written in quad format e.g.
194.168.23.39, 4 billion possible addresses.
IPv6 eight blocks of four hexadecimal digits separated by colons,
such as FEDC:AB98:7764:3210:FEDC:BA95:7654:3210
Domain Name System (DNS) The domain name system (DNS) is
the way that Internet domain names are located and translated into
Internet Protocol addresses.
Ports used in combination with protocol and is a logical abstraction.
Some standard ports are 80 for HTTP, 21 for FTP, 23 for telnet, 25 for
smtp, 110 for POP3
Programming Exercise 4
th
June 2014
Create a web page and perform the following:
1) Asks for your name and greets you at the title of the page.
2) Depending on the time of the day, greets you specifically:
3) For the above (2) display a corresponding image to reflect the time
of the day.
4) Use information from the college website to fill text, images.
5) Ask for an integer input in the range 1 25 and print that many Fibonacci
numbers.
Internet and Address classes
Largest IP network and amorphous group of computers across the
globe communicating via IP protocol.
IP addresses are assigned by ISPs by regional registry.
To setup a network, a block of addresses are provided by ISP.
Different blocks of addresses: Class A, B, C.
Class C block
Class B block
Class A block
Internet and CIDR addressing
Limitations of the number of addresses, solution is CIDR (Classless
Inter-Domain Routing)
Solution uses the mechanism of prefix bits /nn. E.g. /24 is Class C
address.
E.g. 2 ) /19 has 13 bits for individual network, means 32 separate Class
C network.
E.g. 3) /28 means 4 bits for identifying local nodes 16 nodes.
All IPv4 addresses that begin with 10., 172.16. through 172.31., and
192.168. are not assigned.
Recap
IPv4 Addresses format, Class C, Class B, Class A addresses
CIDR naming and addressing, Problem?
HTTP protocol with Fiddler tool (Request & Response headers and
response codes).
Simple HTML page, Tags and the DOM (Document Object Model).
Jumpstart on Javascript (details to be followed).
Client-Server architecture how client communicates with server.
Content HTML and Protocol HTTP.
Network Address Translation (NAT)
NAT too devices way to conserve of IP address space and security.
How different is it from CIDR? (which uses /nn)
E.g. /28 is sufficient for my house.
How does NAT work?
1) IP address provided by ISP
2) Addresses assigned to my machines in a non-routable block.
How does the router of ISP use NAT?
Side-effects?
Firewall
Just another machine (hardware + software) put into the network in
between the internet and local network.
One of the tasks of Firewall is NAT.
Inspects each packet that passes into the network interface that pass
into and out of the local network and governed by certain rules that
could be specified/configured in them.
E.g. 1) incoming telnet may not be allowed.
E.g. 2) Particular site may be blocked.
Operates at the level of transport or internet layer.
Proxy servers
Similar to firewall, used as go-between.
Operates at application layer.
Security advantage: Blocks external host from local address.
External host only sees the proxy server and makes it difficult to hack
into the local network.
Aware of HTTP, FTP protocols, but limited to few protocols.
Could be used for local caching and speed up the transfer of a file.
Could be used to monitor web request from individual machines.
Client Server Model
Modern day applications are designed client-server.
Are there any other model? Peer-to-Peer.
Web Concepts
HTTP is designed as REST based protocol.
HTML is a descriptive language used to transfer data across web.
Example of HTML page
URI, URL, URN
Uniform Resource Identifiers 2 types
URL Uniform Address Locator (URLs)
URN Uniform Resource Names (URNs)
Web Concepts
URL Scheme:
protocol://username@hostname:port/path/filename?query#fragme
nt
E.g.
ftp://username:password@examsection.christuniversity.in:007/CSE/I
nternetProgrammingImportantQuestions.docx
URN Scheme: urn:namespace:resource_name
E.g. urn:CSE_InternetProgramming:ImportantQuestions
MIME Media types
MIME Multipurpose Internet Mail Extensions
MIME is open standard used to send multipart, multimedia data
through Internet where data could be binary, multi ASCII and non-
ASCII
Content-types
E.g. HTML is text/html
Text/plain, image/gif, application/xml
Server Side Programming

Você também pode gostar