Docsity

Computer Networks: ECS 152B Course Notes by Demet Aksoy, Spring 2004, Study notes of Operating Systems

Toggle sidebar
bg1
1
3/31/2004ECS152B Demet Aksoy
1
ECS 152B
Computer Networks
Spring 2004
Demet Aksoy
www.cs.ucdavis.edu/~aksoy/course/152b
ECS152B Demet Aksoy
2
Highlights
•prerequisites:
ECS150 and ECS152A
talk to me if you have not completed the prerequisites
•make sure to follow up the newsgroup messages
ucd.class.ecs152b
ucd.class.ecs152b.d
• grading
•Projects 30%
•Midterm 20%
•Homeworks 10%
•Final 40%
ECS152B Demet Aksoy
3
Highlights
•Book:
–Computer Networking: A Top-Down Approach Featuring the
Internet.
by Jim Kurose and Keith Ross, Addison-Wesley ISBN: 0-201-97699-
4, 2002.
•Office Hours:
–Tuesday/Thursday 1:30-2:10 (in class/office)
• TA: Mohit Gupta gupta@cs.ucdavis.edu
•Late policy, re-grading requests, etc. on the web page
ECS152B Demet Aksoy
4
Road Map
I. Introduction
•Computer Networks Overview
•Requirements of Networks
•OSI Layering Overview
II. Application Layer
•What’s a protocol
•HTTP
•FTP
•SMTP
•DNS
•Socket API
III. Transport Layer
•Responsibility of the transport layer
•UDP
•TCP
•Connection Establishment
•Sliding Window, Flow Control
•Congestion Control
•Connection Termination
pf3
pf4
pf5
pf8
pf9

Partial preview of the text

Download Computer Networks: ECS 152B Course Notes by Demet Aksoy, Spring 2004 and more Study notes Operating Systems in PDF only on Docsity!

3/31/2004ECS152B Demet Aksoy

ECS 152B

Computer Networks

Spring 2004

Demet Aksoy

www.cs.ucdavis.edu/~aksoy/course/152b

ECS152B Demet Aksoy

Highlights

  • prerequisites: ECS150 and ECS152A talk to me if you have not completed the prerequisites
  • make sure to follow up the newsgroup messages ucd.class.ecs152b ucd.class.ecs152b.d
  • grading
    • Projects 30%
    • Midterm 20%
    • Homeworks 10%
    • Final 40%

ECS152B Demet Aksoy

3

Highlights

  • Book:
    • Computer Networking: A Top-Down Approach Featuring theInternet.

4, 2002.^ by Jim Kurose and Keith Ross, Addison-Wesley ISBN: 0-201-97699-

  • Office Hours:
    • Tuesday/Thursday 1:30-2:10 (in class/office)
  • TA: Mohit Gupta [email protected]
  • Late policy, re-grading requests, etc. on the web page

ECS152B Demet Aksoy

Road Map^4

I. Introduction • Computer Networks Overview

  • • Requirements of NetworksOSI Layering Overview II. Application Layer • What’s a protocol
  • • HTTPFTP
  • • SMTPDNS
  • Socket API III. Transport Layer • Responsibility of the transport layer
  • • UDPTCP
  • • Connection EstablishmentSliding Window, Flow Control
  • • Congestion ControlConnection Termination

ECS152B Demet Aksoy

Road Map

IV. Network Layer • Overview of Network Layer

  • • RoutingOverview of IP
  • • Fragmentation and ReassemblyICMP
  • • IPv6IGMP V. Data Link Layer • Overview of Data Link Layer Services
  • • Multiple Access ProtocolEthernet
  • • ARP, RARPSLIP
  • • PPPATM

ECS152B Demet Aksoy

Computer Networks

Interconnected collection of autonomous computers attached to a host system:

Host A

Network Adapter

ComputerNetwork

Host B

Network Adapter

ECS152B Demet Aksoy

7 Protocols

  • A protocol defines:
    • the format and the order of the messages exchanged
    • the actions on receipt/transmission of a message

host

Network Adapter

host

Network Adapter

Computer Network

ECS152B Demet Aksoy

8 Protocols

  • Why use a protocol?
    • to provide a common language
      • There are so many protocols!
  • Rules:
    • must be unambiguous and followed exactly
      • e.g., TCP/IP, IP (Internet Protocol)

ECS152B Demet Aksoy

The Internet Protocol Stack

source destination original message

Transport Network Link

Application

ECS152B Demet Aksoy

The Internet Protocol Stack

source original message

Transport Network Link

Application

Protocol Data Units (PDU) message

frame

segment datagram

software

network interface card

software mixed

Implementation

ECS152B Demet Aksoy

15 Protocol Layers Summary

Network Link

Transport Network Link

Application Transport Network Link

Application

HostA router HostB

  • Simplifies implementation segmentation/reassembly, error control, flow control, multiplexing, connection setup in different layers
  • There also are some potential disadvantages may duplicate functionality may need info in a non-adjacent layer (e.g., timestamp)

Network Link router

ECS152B Demet Aksoy

16 Client-Server Model

client server

client = host that initiates the session (e.g., asks for a Web page; browser) server = host that gives the requested service same host can be both a client and a server for one application (e-mail)

A typical network has two components: client and server

ECS152B Demet Aksoy

Application Layer

Application-layer protocols:

  • are only one “piece” of a network application (e.g., email, file transfer, the Web)
  • define messages exchanged, syntax, semantics, and actions taken
  • user services are provided by lower layer protocols

applicationtransport data linknetwork physical

applicationtransport networkdata link physical

applicationtransport data linknetwork physical

ECS152B Demet Aksoy

Application Layer Protocols

  • example application layer protocols
    • HTTP (Hypertext Transfer Protocol)
    • FTP (File Transfer Protocol)
    • SMTP (Simple Mail Transfer Protocol)
    • DNS (Domain Name System)

ECS152B Demet Aksoy

19 World Wide Web: the HTTP protocol

http: hypertext transfer protocol

  • WWW’s application layer protocol
    • client: requests, receives, “displays” WWW objects (object =HTML file, JPEG or GIF image, audio clip etc.) browser
    • server: in response to requests sends objects; Web server

(browser)^ client

serverWeb

(browser)client

http request

http request

http response

http response

Uses TCP, reliable transport layer protocol: handshaking etc., on port 80 ECS152B Demet Aksoy

20 HTTP example Suppose user enters URL www.cs.ucdavis.edu/instruction/default.html 1a. http client initiates TCP connection to http server (process) at www.cs.ucdavis.edu. Port 80 is default for http server.

  1. http client sends http request message (containing URL) into TCP connection socket

1b. http server at host www.cs.ucdavis.edu waiting for TCP connection at port 80. “accepts” connection, notifies client

  1. http server receives request message, forms response message containing requested object (instruction/default.html), sends message into socket

time

  1. http client receives response message containing html file, displays html.

  2. http server closes TCP connection.

host name path name

ECS152B Demet Aksoy

HTTP response message: general format version status code phrase

ECS152B Demet Aksoy

try it out! http (client side)

1. Telnet to UCD WWW server:

Open TCP connection to port 80(default http server port) at www.cs.ucdavis Anything typed in sent to port 80 at www.cs.ucdavis

telnet www.cs.ucdavis.edu 80

2. Type in a GET http request:

GET /index.html HTTP/1.0Host: www.cs.ucdavis.edu hit carriage return twice

3. Look at response message sent by http server in

response to your minimal, but complete request

ECS152B Demet Aksoy

27 HTTP

  • HTTP 1.0 [RFC 1945]

default: server closes

connection after each

object: non-persistent

  • HTTP 1.1 [RFC 2068]

default: server keeps the

connection open for

successive request:

persistent

two versions:

ECS152B Demet Aksoy

28 Authentication and Cookies

Authentication: to control access to server documents

“ authorization: typically name and password “

  • client must present authorization in each request
    • send Authorization: header line in every request
      • if correct server accepts access
      • else, server refuses access

HTTP is stateless; ask for the same object twice, server sends it twice!

server

client (^) 401 Authorization Req WWW-Authenticate:

( send withAuthorization: each message )

ECS152B Demet Aksoy

Authentication, Cookies

Cookies: [RFC 2109]

server

client Set-cookie: # Cookie: #

Saves to a file (e.g., .netscape/cookies) ( send with each message )

ECS152B Demet Aksoy

Conditional GET

  • Goal: don’t send object if client has up-to-date stored (cached) version
  • client: specify date of cached copy in http request If-modified-since:
  • server: response contains no object if cached copy up-to-date: HTTP/1.0 304 Not Modified

client server

If-modified-since:^ http request msg http response HTTP/1. 304 Not Modified

object not modified

If-modified-since:^ http request msg HTTP/1.1 200 OK^ http response …

object modified

ECS152B Demet Aksoy

31 Conditional Get

  • ask to receive only if current object stale

HTTP/1.1 200 OKDate: Thu, 6 April 2000 12:00:15 GMT Server: Apache/1.3.0Last-Modified: Sat, 1 (Unix) Apr 2000 06:23:19 GMT Content-Length:Content-Type: text/html 6821 GET /instruction/default.html HTTP/1.1data^ data^ data^ data data ... User-agent:Accept: text/html, image/gif Mozilla/4. If-modified-since: Sat, 1 April 2000 06:23:19HTTP/1.1 304 Not Modified Date:Server: Apache/1.3.0 Thu, 8 Apr (^2000) (Unix)12:00:15 GMT (empty entity body)

GET... /instruction/default.html HTTP/1.

ECS152B Demet Aksoy

32 Web Caches (Proxy Server)

  • user sets browser: WWW accesses via web cache
  • client sends all http requests to web cache - if object not at webcache, web cache requests object from origin server, thenreturns http response to client

Goal: satisfy client request without involving origin server

client

Proxy server

client

http request http response http request http response

originserver