0% found this document useful (0 votes)
9 views65 pages

Week 1 2 Networks and The Internet

The document provides an overview of networks and the Internet, covering key concepts such as network types (LAN, WAN, GAN), protocols (TCP/IP, HTTP), and the architecture of networked applications. It explains the roles of clients and servers in network applications, the importance of protocol layering, and the functions of various transport protocols. Additionally, it discusses the challenges of delay and data loss in networks, as well as the requirements for different applications.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views65 pages

Week 1 2 Networks and The Internet

The document provides an overview of networks and the Internet, covering key concepts such as network types (LAN, WAN, GAN), protocols (TCP/IP, HTTP), and the architecture of networked applications. It explains the roles of clients and servers in network applications, the importance of protocol layering, and the functions of various transport protocols. Additionally, it discusses the challenges of delay and data loss in networks, as well as the requirements for different applications.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 65

NETWORKS AND THE INTERNET

WEEK 1
WEEK 1: NETWORKS AND THE
INTERNET

 (Web Services ?)
 Networks Review
 XML
 TCP/IP Overview  SOAP
 The Internet and the  Application Layer
web, Protocols Layer  -Client -server Application
 -Sockets and Ports
 -Internet Protocol Stack
 Persistent Connections
 -Protocol Layering and
Data What are YOUR experiences ?
• -Delay and Loss in Special Interests ? YOUR
Networks wishes ?
PART I

• A network is a collection of hardware devices


and software protocols that connect
computing devices.
• The Internet is a worldwide meta network that
interconnects millions of computing devices.
• Network applications provide services, such
as email, to users.
NETWORKS
• Local Area Network (LAN) - that spans a
single building or campus
• Metropolitan Area Network (MAN) - that
spans a single city
• Wide Area Network (WAN) - that spans sites
in multiple cities, countries, or continents
• Global Area Network (GAN) - that spans the
whole world, the Internet itself
Can you go beyond all these? What
would you call it?
SOME BASIC TERMS
Note:
• A (computer) network can be a series of
points or nodes interconnected by
communication paths
• Networks can interconnect with other
networks (internetworks) and contain
subnetworks (or subnets)
SOME BASIC TERMS (CONT’D)
• Protocol
• Formal description of a set of rules, conventions, and
procedures that govern how devices on a network
exchange information
• internet
• An internetwork, with a small “i”
• TCP/IP was the first set of protocols developed for use
in an internet
• It has since evolved into the de facto standard for
internetworking
THE INTERNET

• An internetwork with a big “I”


• The Internet is a global network of connected computer
networks
• The Internet is a global network of networks enabling
computers of all kinds to directly and transparently
communicate and share services throughout much of the
world.
• The Internet, sometimes called simply “the Net”, is a
worldwide system of computer networks – a network of
networks in which users at any one computer can, if they have
permission, get information from any other computer(see [1]
THE INTERNET
The Main Elements
• Hosts (end systems)
• LANs/PPP
• ISPs
• Standards
• IETF
• RFC
• Intranets are private.
BUILDING A NETWORK I

• Single machine
Local ISP
• connect to ISP
• PPP
• Small organizations Home Machines

• connect machines
by LAN Small
Organization

• connect LAN to ISP


BUILDING A NETWORK II

• Large Company
• many machines
• different networks
• internal routing
• Intranet

• Connect to ISP
• high capacity link
• Internet
THE ISP’S NETWORK

NAP R

NAP R
R NAP
CONNECTING ISPS
NETWORK CONNECTIONS

R NAP

NAP R

NAP R
R NAP
PROTOCOL OVERVIEW

 Definesacceptable
behaviour:
 Agreed data format
– Handshake
– Message
– Response

 A protocol defines the format and the order of messages exchanged


between two or more communicating entities, as well as the actions
taken on the transmission and/or receipt of a message or other
event.
applications PROTOCOL LAYERS

transport protocol
technology
THE TCP/IP LAYERS

mail, file transfer, web


Application Application

tcp, udp
Transport Transport

ip ip
Internet Internet Internet

Media access Media access Media access

Note: udp … User Datagram Protocol


OSI BY ISO

• Open Systems Interconnection Reference Model


by the International Organization of Standards
• A model for protocol developers and for
understanding today’s protocols
• Model meaning that nobody is running the “OSI
protocol”
• Note that the World Wide Web (based on the
HTTP protocol) is just one of many high-level
applications of the Internet
OSI
NETWORK AND TRANSPORT
PROTOCOLS
Another way of
presenting OSI:
• A network-layer protocol
(e.g., IP) routes packets
from network to network
• A transport-layer protocol
(e.g., TCP) routes
messages from program
to program
QUESTIONS & FEEDBACK FOR THIS
LECTURE

• Don’t be shy !
• Ask questions ! Get answers (hopefully )
• Notes can still be improved, you may want
to help !
FURTHER INFORMATION

• See Literature (next slide)


• Research Online Materials (use Search-Engine for
research, keywords: XML, SOAP, TCP/IP, …)
LITERATURE (EXCERPT)

• William Stallings: Data and Computer


Communications
• William J, Beyda: Data Communications –
From Basics to Broadband
• Craig Hunt: TCP/IP Network Administration
(O’Reilly)
• Monson-Haefel: Java Messaging Service
• Aaron Skonnard:
Essential XML Quick Reference
• David A. Chappel: Java Web Services (O’Reilly)
• Kurose: Computer Networking: A Top-Down
Approach Featuring the Internet
SOURCES

• For the preparation of this week notes sources of


resources include – :
• Univ. Auckland
• Univ. California – San Diego (UCSD)
• Univ. Hongkong
PROTOCOL LAYERS: WHY?

• To deliver the email


• Application messages
• Connection to remote host/socket
• Reliability of delivery of messages
• Routing of connection/messages
• Detection of errors in frames
• Functions assigned to appropriate layer
LAYERS = ABSTRACTION

Networks are complex with many “pieces”:


• hosts
• routers
• links of various media
• applications
• protocols
• hardware, software
WHY LAYERING?
Dealing with complex systems:
• explicit structure allows identification,
relationship of complex system’s pieces
• modularity eases maintenance, updating
of system
• change of implementation of a layer is
transparent to rest of system
• e.g., change in gate procedure doesn’t
affect rest of system
Is layering considered harmful?
EXAMPLE REFERENCE MODEL

layer 5 protocol (email)


layer 5 layer 5
interface
layer 4 protocol (transport)
layer 4 layer 4
layer 3 protocol (internet)
layer 3 layer 3
layer 2 protocol (network)
layer 2 layer 2
layer 1 protocol (physical)
layer 1 layer 1

physical medium
INTERNET PROTOCOL STACK
• application: supporting net apps
• ftp, smtp, http
application
• transport: end host- end host
• tcp, udp transport
• network: source to destination
network
• ip, routing protocols

• link: neighboring network elements link


• ppp, ethernet
physical
• physical: bits “on the wire”
THE TCP/IP LAYERS

mail, file transfer, web


Application Application

tcp, udp
Transport Transport

ip ip
Internet Internet
Internet

Media access Media access Media access

Physical Media
LAYERS: LOGICAL COMMUNICATION

application application
transport transport
Each Layer
network network
• distributed data link
data link
• “entities” physical
physical
implement
application network
layer functions
transport data link
at each node
network physical
• entities perform application
data link transport
actions,
exchange physical network
messages data link
with peers physical
LAYERS: LOGICAL COMMUNICATION

data
application application
transport transport
E.g. transport network
network data
• take data from data link
data link
app physical
physical
• add addressing,
application network
reliability check
transport data link
info to form
physical data
“datagram” network application
data link ack
• send datagram transport
to peer physical network
• wait for peer to ack receipt data link
• analogy: post office physical
LAYERS: PHYSICAL COMMUNICATION

data
application application
transport transport
network network
data link data link
physical physical

application network
transport data link
network physical data
application
data link transport
physical network
data link
physical
PROTOCOL LAYERING AND DATA

Each layer takes data from above


• adds header information to create new data unit
• passes new data unit to layer below

source destination
M application application M message
Ht M transport transport Ht M segment
Hn Ht M network network Hn Ht M datagram
Hl Hn Ht M link link Hl Hn Ht M frame
physical physical
LAYERS IN ACTION

Application M M

Transport Ht M
Ht M

Internet Hi Ht M Hi Ht M

Media access Hm H i H t M Hm H i H t M
DELAY AND LOSS IN
NETWORKS

processing
queueing
transmission propagation

dnode = dproc + dqueue + dtrans + dprop


QUEUING DELAY

• Varies from packet to packet Packets may


be lost!
• Depends on traffic
• Consider a router: 11.00 Average Qdelay
10.00

A = arrival rate (pkts/sec) 9.00

8.00
R = transmission rate 7.00

(bits/sec) 6.00

5.00
L = average packet size (bits) 4.00

3.00

2.00
AL/R
R/L = max rate of packet 1.00
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9

transmission
AL/R = traffic intensity
PART II

• Architecture of networked applications


• Implementation
• API
• Performance requirements
• HTTP Protocol
APPLICATION LAYER: PART II

Our goals:
• specific protocols:
• conceptual aspects of
• http (today)
network application
• smtp
protocols
• pop
• client-server
paradigm • dns

• service models • programming


network
• learn by examining
applications
standard protocols
• socket API
SOME DEFINITIONS
• A process is a • A user agent is an
program running on a interface between the
host. user and the network
• Within one host, two application.
processes • Web:browser
communicate with • E-mail: mail reader
interprocess • streaming
communication. audio/video: media
• Processes running in player
different hosts
communicate with an
A CLIENT-SERVER APPLICATION
application
Client: transport
• initiates contact network
(“speaks first”)
data link
• typically requests
service from server, physical
• for Web, client is implemented
in browser; for e-mail,
in mail reader
Server: application
• provides requested transport
service to client network
• e.g., Web server sends data link
requested Web page, mail
server delivers e-mail physical
A NETWORK APPLICATION

User Agent Service


Client Server
messages
Protocol Protocol

User Agent
Client2 • Protocol interface
Protocol
• Protocol messages
ADDRESSING AND NAMING

• Identifying objects is a core problem.


http://www.mcs.vuw.ac.nz:80

Domain name protocol port

IP address protocol port

globally host
unique specific
SOCKETS AND PORTS
 Sockets provide an API for application

Protocol

• Port is external connection point (address)


of a socket
• Different transport protocols
• different socket spaces (tcp & udp have same
port numbers, but different implementations).
• Well known ports (e.g. 80 for http).
ALTERNATIVE ARCHITECTURES

• Messaging Sender Receiver

• Request-response

Client Server
• Do-operation

• Streaming Client Server

Sender Receiver
TRANSPORT REQUIREMENTS OF COMMON APPS
Data loss Bandwidth
 some apps (e.g.,
• some apps (e.g., audio)
multimedia) require
can tolerate some loss minimum amount of
• other apps (e.g., file bandwidth to be
“effective”
transfer, telnet) require  other apps (“elastic apps”)
100% reliable data make use of whatever
Timing
transfer bandwidth they get
• some apps (e.g., Internet
telephony, interactive
games) require low delay
to be “effective”
TRANSPORT REQUIREMENTS OF COMMON
APPS

Application Data loss Bandwidth Time Sensitive

file transfer no loss elastic no


e-mail no loss elastic no
Web documents loss-tolerant elastic no
real-time audio/video loss-tolerant audio: 5Kb-1Mb yes, 100’s msec
video:10Kb-5Mb
stored audio/video loss-tolerant same as above yes, few secs
interactive games loss-tolerant few Kbps up yes, 100’s msec
financial apps no loss elastic yes and no
TCP SERVICES

• connection-oriented: setup required between client, server


• reliable transport: between sending and receiving process
• flow control: sender won’t overwhelm receiver
• congestion control: throttle sender when network
overloaded
• does not provide: timing, minimum bandwidth guarantees
UDP SERVICES

• Best effort data transfer between sending and


receiving process
• Does not provide: connection setup, reliability, flow
control, congestion control, timing, or bandwidth
guarantees

Q: Why bother? Why is there a UDP?


INTERNET APPLICATIONS:
THEIR PROTOCOLS AND TRANSPORT PROTOCOLS

Application Underlying
Application layer protocol transport protocol

e-mail smtp [RFC 821] TCP


remote terminal access telnet [RFC 854] TCP
Web http [RFC 2068] TCP
file transfer ftp [RFC 959] TCP
streaming multimedia proprietary TCP or UDP
(e.g. RealNetworks)
remote file server NFS TCP or UDP
Internet telephony proprietary typically UDP
(e.g., Vocaltec)
THE WEB: THE HTTP
PROTOCOL
http: hypertext transfer htt
pr
eq
ues
protocol PC running htt
pr t
Explorer esp
ons
• Web’s application layer e
protocol
t
ues
• client-server model: req e Server
ttp o ns
h p running
• client: browser that res
p Apache Web
htt
requests, receives, server

“renders” Web objects


Mac running
• server: Web server Navigator
sends objects in
response to requests
THE HTTP PROTOCOL: MORE
http: http is “stateless”
• client initiates TCP • server maintains no
connection (creates socket) information about
to server, port 80 past client requests
aside
• server accepts TCP Protocols that maintain “state” are
connection from client complex!
 past history (state) must be
• http messages (application- maintained
layer protocol messages)  if server/client crashes, their views

exchanged between of “state” may be inconsistent, must


be reconciled
browser (http client) and
Web server (http server)
• TCP connection closed
HTTP EXAMPLE
Suppose user enters URL www.someSchool.edu/someDepartment/home.index
(contains text,
references to 10
jpeg images)

1a. http client initiates TCP 1b. http server at host


connection to http server www.someSchool.edu
(process) at waiting for TCP connection at
www.someSchool.edu. Port 80 is port 80. “accepts” connection,
default for http server. notifying client

2. http client sends http request


message (containing URL) into 3. http server receives request
message, forms response
message containing requested
TCP connection socket object, sends message into
socket
time
HTTP EXAMPLE (CONT.)

4. http server closes TCP


connection.
5. http client receives
response message
containing html file,
displays html. Parsing
html file, finds 10
6. referenced jpegforobjects
Steps 1-5 repeated each of
10 jpeg objects
time
PERSISTENT CONNECTIONS

Non-persistent Persistent
• http/1.0: server parses request, • default for htp/1.1
responds, closes TCP • on same TCP connection:
connection server, parses request,
• 2 RTTs to fetch object
responds, parses new
request,..
• TCP connection
• client sends requests for
• object request/transfer all referenced objects as
• each transfer suffers from
soon as it receives base
HTML.
TCP’s initially slow sending rate
• fewer RTTs, less slow start.
• many browsers open multiple
parallel connections
PART III

• HTTP
• UDP connections
• TCP connections
• Java Examples
HTTP

The `WEB’ is consists of a set of


hyperlinked Hypertext documents.
The hypertext transfer protocol
(HTTP) is an application level
protocol to that supports ‘web’
documents over the Internet.
The Internet is not the web, and the
web is not the Internet.
Assignment:
Distinguish between
HTTP/0.9, HTTP/1.0, HTTP/1.1 and HTTP/2
stating the strengths and weaknesses
CLIENT: REQUEST

• http request message:


• ASCII (human-readable format)
request line
(GET, POST,
HEAD commands) GET /somedir/page.html HTTP/1.0
User-agent: Mozilla/4.0
Accept: text/html, image/gif,image/jpeg
header If-Modified-Since: Mon, 22 Jun 1998 ...
lines
...
(extra carriage return, line feed)
Carriage return,
line feed
indicates end
of message
SERVER: RESPONSE

status line
(protocol
status code HTTP/1.0 200 OK
status phrase) Date: Thu, 06 Jul 2002 12:00:15 GMT
Server: Apache/1.3.0 (Unix)
header Last-Modified: Mon, 22 Jun 1998 …...
lines Content-Length: 6821
Content-Type: text/html

blah blah blah blah...


data, e.g.,
requested
html file
HTTP RESPONSE STATUS CODES

In first line in server->client response message.


A few sample codes:

200 OK
• request succeeded, requested object later in this message
301 Moved Permanently
• requested object moved, new location specified later in this
message (Location:)
400 Bad Request
• request message not understood by server
404 Not Found
• requested document not found on this server
505 HTTP Version Not Supported
WHY WEB CACHING?
origin
servers
public
Assume: cache is “close” to
Internet
client (e.g., in same network)
• faster response time: cache
“closer” to client 1.5 Mbps
• decrease traffic to distant access link

servers (and cost $$$) institutional


network
• Link out of local network is 10 Mbps LAN

often a bottleneck.
• Cache slower on a miss.
institutional
cache
WEB CACHES (PROXY SERVER)

Goal: satisfy client request without involving origin server

• user sets browser: Web origin


accesses via web cache server
• client sends all http
Proxy
requests to web cache htt
pr est
equ server u
h e req se
• object in web cache: tt
client p r st http
on
esp esp
ons r
web cache returns object e htt
p
t
ues
• else web cache requests req e
ttp o ns
object from origin h p
res
p
server, then returns htt

object to client after client


origin
storing it itself server
CONDITIONAL GET: CLIENT-SIDE CACHING

client server

• Goal: don’t send object if http request msg


If-modified-since:
client has up-to-date cached
<date>
object
version not
http response modified
• client: specify date of cached
copy in http request HTTP/1.0
304 Not Modified
If-modified-since:
<date>
http request msg
• server: response contains no If-modified-since:
<date> object
object if cached copy is up-to-
modified
date:
http response
HTTP/1.0 304 Not HTTP/1.1 200 OK
Modified <data>
TRYING OUT HTTP (CLIENT SIDE)

1. Telnet to your favorite Web server:


telnet www.mcs.vuw.ac.nz 80 Opens TCP connection to port 80
(default http server port)
Anything typed in sent
to port 80 at www.mcs.vuw.ac.nz

2. Type in a GET http request:


GET /~kris/index.html HTTP/1.0 By typing this in (hit carriage
return twice), you send
this minimal (but complete)
GET request to http server

3. Look at response message sent by http server!


THE END!

You might also like