Title: Computer Networks CSC 457
1Computer NetworksCSC 457
2NETWORKS INTERNET
3Router
Router
Router
4Internet
- World-wide connected network of computers,
Personal, Digital Assistants PDAs - TVs, automobiles, toasters,
- These end systems are connected by communication
links made of coaxial cables, copper wire, fiber
optics and radio spectrum. - The link transmission rate is called the
bandwidth. - End systems are connected to switching devices
called routers. - Routing is done by chunks of information called
packets. - Messages divided in packets share paths. This is
called packet switching.
5Whats the Internet?
- protocols control sending, receiving of messages
- e.g., TCP, IP, HTTP, FTP, PPP
- Internet network of networks
- loosely hierarchical
- public Internet versus private intranet
- Internet standards
- RFC Request for comments
- IETF Internet Engineering Task Force
router
workstation
server
mobile
local ISP
regional ISP
company network
6(No Transcript)
7Internet Services
- End systems use Internet Service Providers ISPs
to access the internet. - This can be done through
- 56 Kbps dial-up modem
- Cable modem or DSL (dedicated service line)
- LAN (local area network) access
- Wireless access
- The lower-tiered ISPs are connected through
upper-tiered ISPs, such as UUNet, Sprint, - Private networks called intranets, are used
within companies using firewalls.
8Whats a protocol?
- a human protocol a computer network
protocol
Called handshaking procedure
9Protocols
- To send and receive information, rules called
protocols are followed. The 2 most important are
TCP (Transfer Control Protocol) and IP (Internet
Protocol). - End systems are called hosts. They can be clients
(requesting services) or servers (giving
services). - There is a connection-oriented reliable service
and a connectionless unreliable service.
10SERVICES
Chapter 1.2
11Connection-oriented service Transfer Control
Protocol
- The connection is established first before
sending data. This is done by a handshaking
procedure. - A connection establishes buffers and state
variables in the end systems, nothing in the
switches (routers). - It guarantees reliable data transfer (all data
delivered without error in proper order). - It guarantees flow control not too fast
overwhelming or too slow. - It guarantees congestion-control (congestion can
overflow buffers lose data) by decreasing
traffic during congestion. - The internet connection-oriented service is TCP
used by Telnet, SMTP, FTP, HTTP.
12Network edge connection-oriented service
- Goal data transfer between end systems
- handshaking setup data transfer ahead of time
- Hello, hello back in human protocol
- set up state in two communicating hosts
- TCP - Transmission Control Protocol
- Internets connection-oriented service
- TCP service RFC 793
- reliable, in-order byte-stream data transfer
- loss acknowledgements and retransmissions
- flow control
- sender wont overwhelm receiver
- congestion control
- senders slow down sending rate when network
congested
13Connectionless serviceand User Datagram Protocol
- No handshaking.
- Data arrives sooner but with no guarantee.
- No flow control or congestion control.
- The internet connectionless service is UDP
- UDP is used for multimedia applications such as
internet phone and video conferencing.
14Network edge connectionless service
- Goal data transfer between end systems
- same as before!
- UDP - User Datagram Protocol RFC 768
Internets connectionless service - unreliable data transfer
- no flow control
- no congestion control
- Apps using TCP
- HTTP (Web), FTP (file transfer), Telnet (remote
login), SMTP (email) - Apps using UDP
- streaming media, teleconferencing, DNS, Internet
telephony
15PACKET vs CIRCUITSWITCHED NETWORKS
Chapter 1.3
16Circuit Switching
- In circuit-switching, the resources are reserved
for the duration of the communication. - There is a dedicated end-to-end connection. For
links with n circuits, the connection gets 1/n of
links bandwidth. - A circuit is implemented with frequency-division
multiplexing (FDM) or time-division multiplexing
(TDM). - An example is the telephone network.
- Transmission is at a guaranteed rate.
- Call set-up required
17Circuit Switching FDM and TDM
18Network Core Circuit Switching
- Network resources (e.g., bandwidth) divided into
pieces - pieces allocated to calls
- resource piece idle if not used by owning call
(no sharing) - Dividing link bandwidth into equal pieces by
- frequency division
- time division
19Packet Switching-Internet transmission
- In packet-switching, resources are not reserved.
- Applications exchange messages that can contain a
control function or data. - The origin of the message breaks it up into
packets - reduces delay by 3, or does pure
message-switching. - The packets pipeline the message transmission
(parallelizes). It uses statistical-multiplexing. - Each packet switch (router), uses
store-and-forward transmission (switch must
receive entire packet before forwarding). For L
bits at R bps, the delay at switch is L/R. - Each router maintains an output queue creating
queuing delays. - If the queue is full, there might be a packet
loss. - A mixed mode, with reservation for the
connection, but no transmission rate guarantee,
is seen in Asynchronous Transfer Mode ATM.
20Packet Switching Statistical Multiplexing
10 Mbs Ethernet
C
A
statistical multiplexing
1.5 Mbs
B
queue of packets waiting for output link
- Sequence of A B packets does not have fixed
pattern ? statistical multiplexing. - In TDM each host gets same slot in revolving TDM
frame.
21Packet-switching store-and-forward
- packet of L bits on to link of R bps takes L/R
seconds to transmit (push out) - Entire packet must arrive at router before it
can be transmitted on next link store and
forward - delay 3L/R
- Example
- L 7.5 Mbits
- R 1.5 Mbps
- delay 15 sec
22Packet Switching Message Segmenting
- Break up the message into 5000 packets
- Each packet 1,500 bits
- 1 msec to transmit packet on one link
- pipelining each link works in parallel
- Delay reduced from 15 sec to 5.002 sec
23Packet switching versus circuit switching
- Packet switching allows more users to use
network!
- Users share1 Mbit link
- Each user generates
- 100 kbps when active
- active 10 of time
- circuit-switching
- At most 10 users
- packet switching
- with 35 users, probability of 10 active users lt
.0004
N users
1 Mbps link
24Packet switching withVirtual circuit networks
- The routing switches can use destination
addresses datagrams (as in internet), or
virtual circuit (VC) numbers for each link ( as
in frame relay, Asynchronous Transfer Mode). - A VC network must replace the VC number on each
link using a VC-number translation table. - It must maintain state information.
- Overly complex
25Packet switching with Datagram networks
- Each packet has a header with the packets
destination - Each switch has a table that maps forwarding
addresses - Switch examines addresses table indices to find
appropriate outbound link - Switches do not maintain connection state
information
26Network Taxonomy
Telecommunication networks
- Datagram network is not either
connection-oriented or connectionless. - Internet provides both connection-oriented (TCP)
and connectionless services (UDP) to apps.
27How do loss and delay occur?
- Packets are queued in router buffers
- packet arrival rate to link exceeds output link
capacity - packets queue, wait for turn
A
B
28Four sources of packet delay
- 1. nodal processing
- check bit errors
- determine output link
- 2. queuing
- time waiting at output link for transmission
- depends on congestion level of router
29Delay in packet-switched networks
- 4. Propagation delay
- d length of physical link
- s propagation speed in medium (2x108 m/sec)
- propagation delay d/s
- 3. Transmission delay
- Rlink bandwidth (bps)
- Lpacket length (bits)
- time to send bits into link L/R
30Nodal delay
- dproc processing delay
- typically a few microsecs or less
- dqueue queuing delay
- depends on congestion
- dtrans transmission delay
- L/R, significant for low-speed links
- dprop propagation delay
- a few microsecs to hundreds of msecs
31Queueing delay (revisited)
- Rlink bandwidth (bps)
- Lpacket length (bits)
- aaverage packet arrival rate
traffic intensity La/R
- La/R 0 average queueing delay small
- La/R -gt 1 delays become large
- La/R gt 1 more work arriving than can be
serviced, average delay infinite!
32Packet loss
- Queue preceding link in buffer has finite
capacity - When packet arrives to full queue, packet is
dropped (lost) - Lost packet may be retransmitted by previous
node, by source end system, or not retransmitted
at all
33Residential networks
Modem, DSL, HFC
Chapter 1.4
34Residential access point to point access
- Dialup via modem
- up to 56Kbps direct access to router (often less)
- Cant surf and phone at same time cant be
always on
- ADSL asymmetric digital subscriber line
- up to 1 Mbps upstream (typically lt 256 kbps)
- up to 8 Mbps downstream (typically lt 1 Mbps)
- FDM 50 kHz - 1 MHz for downstream
- 4 kHz - 50 kHz for upstream
- 0 kHz - 4 kHz for ordinary
telephone
35Home networks
- Typical home network components
- DSL or cable modem
- router/firewall
- Ethernet
- wireless access point
wireless laptops
to/from cable headend
cable modem
router/ firewall
wireless access point
Ethernet (switched)
36Physical Media coax, fiber
- Fiber optic cable
- glass fiber carrying light pulses of one bit
- high-speed operation
- point-to-point transmission (e.g., 5 Gps)
- low error rate repeaters spaced far apart
immune to electromagnetic noise
- Coaxial cable
- two concentric copper conductors
- bidirectional
- baseband
- single channel on cable
- legacy Ethernet
- broadband
- multiple channel on cable
- HFC
37Hybrid Fiber Coax residential access cable modems
Diagram http//www.cabledatacomnews.com/cmic/diag
ram.html
38Cable Network Architecture Overview
cable headend
home
cable distribution network (simplified)
39Cable Network Architecture Overview
FDM
cable headend
home
cable distribution network
40PROTOCOL LAYERS
Chapter 1.7
41Protocol of air travel
ticket (purchase) baggage (check) gates
(load) runway takeoff airplane routing
ticket (complain) baggage (claim) gates
(unload) runway landing airplane routing
airplane routing
42Internet protocol stack
- application supporting network applications
- FTP, SMTP, STTP
- transport host-host data transfer
- TCP, UDP
- network routing of datagrams from source to
destination - IP, routing protocols
- link data transfer between neighboring network
elements - PPP, Ethernet
- physical bits on the wire
43Protocol layering and data
- Each layer takes data from above
- adds header information to create new data unit
- passes new data unit to layer below
Messages are called layer N protocol data units -
n-PDUs
44Layer functions
- Error control
- Flow control
- Segmentation reassembly
- Multiplexing
- Connection setup
45APPLICATION LAYER
46Process program in execution
- Web applications protocols are
- HTTP Hyper Text Transfer Protocol (RFC 2616)
- SMTP Simple Mail Transfer Protocol (RFC 2821)
- Host, destination, process ID
- Host destination have IP addresses on internet
- The process has a port number
- The transparent interface between layers
- Sockets are the doors between the application
transport layers - Sockets are also called Application Programming
Interfaces, API
User agents are interface between user network
(browsers)
47Client-server paradigm
Typical network app has two pieces client and
server
- Client
- initiates contact with server (speaks first)
- typically requests service from server,
- Web client implemented in browser e-mail in mail
reader
- Server
- provides requested service to client
- e.g., Web server sends requested Web page, mail
server delivers e-mail
48Transport service applications need
- Data loss
- some apps (e.g., audio) can tolerate some loss
- other apps (e.g., file transfer, telnet) require
100 reliable data transfer
- Bandwidth
- some apps (e.g., multimedia) require a minimum
amount of bandwidth to be effective - other apps (elastic apps) make use of whatever
bandwidth they get
- Timing
- some apps (e.g., Internet telephony, interactive
games) require low delay to be effective
49Transport service requirements of common apps
Time Sensitive no no no yes, 100s msec yes,
few secs yes, 100s msec yes and no
Application file transfer e-mail Web
documents real-time audio/video stored
audio/video interactive games instant messaging
Bandwidth elastic elastic elastic audio
5kbps-1Mbps video10kbps-5Mbps same as above few
kbps up elastic
Data loss no loss no loss no loss loss-tolerant
loss-tolerant loss-tolerant no loss
50Internet transport protocols services
- TCP service
- connection-oriented setup required between
client and server processes - reliable transport between sending and receiving
process - flow control sender wont overwhelm receiver
- congestion control throttle sender when network
overloaded (multimedia?) - does not provide timing, minimum bandwidth
guarantees
- UDP service
- Unreliable data transfer between sending and
receiving process - May not arrive in order
- Does not provide connection setup, reliability,
flow control, congestion control, timing, or
bandwidth guarantee - Q why bother? Why is there a UDP?
51Internet Applications and their Application
Transport Protocols
Application layer protocol SMTP RFC
2821 Telnet RFC 854 HTTP RFC 2616 FTP RFC
959 proprietary (e.g. RealNetworks) proprietary (
e.g., Dialpad)
Underlying transport protocol TCP TCP TCP TCP TCP
or UDP typically UDP
Application e-mail remote terminal access Web
file transfer streaming multimedia Internet
telephony
52Processes communicating across network
- process sends/receives messages to/from its
socket - socket analogous to door
- sending process shoves message out door
- sending process assumes transport infrastructure
on other side of door which brings message to
socket at receiving process
- process sends/receives messages to/from its
socket - socket analogous to door
- sending process shoves message out door
- sending process assumes transport infrastructure
on other side of door which brings message to
socket at receiving process
controlled by app developer
Internet
controlled by OS
- API (1) choice of transport protocol
- (2) ability to fix a few parameters
-
- API (1) choice of transport protocol
- (2) ability to fix a few parameters
-
532.2 HTTP overview
HTTP hypertext transfer protocol
- Webs application layer protocol
- client/server model
- client browser that requests, receives,
displays Web objects - server Web server sends objects in response to
requests - HTTP 1.0 RFC 1945
- HTTP 1.1 RFC 2068
HTTP request
PC running Explorer
HTTP response
HTTP request
Server running Apache Web server
HTTP response
Mac running Navigator
54HTTP overview (continued)
- Uses TCP
- client initiates TCP connection (creates socket)
to server, port 80 - server accepts TCP connection from client
- HTTP messages (application-layer protocol
messages) exchanged between browser (HTTP client)
and Web server (HTTP server) - TCP connection closed
- HTTP is stateless
- server maintains no information about past client
requests
55HTTP connections
- Non-persistent HTTP
- Server closes connection after each object
transmission - Response time is 2 RTTs plus transmission
- HTTP/1.0 uses non-persistent HTTP
- Persistent HTTP
- Server leaves TCP connection open with timeout.
- Multiple objects can be sent over single TCP
connection - HTTP/1.1 uses persistent pipelined connections in
default mode
56Nonpersistent HTTP
URL enteredwww.someSchool.edu/someDepartment/hom
e.html
1a. HTTP client initiates connection to server
(process) at www.someSchool.edu on port 80
1b. HTTP server at host www.someSchool.edu
waiting for connection at port 80. accepts
connection, notifying client
2a. Client sends request with URL into TCP
connection socket indicates it wants object
someDepartment/home.html
2b. Server receives request, forms response
message containing requested object, and sends it
into its socket
4. Client receives response containing html file,
displays it. Parsing html file, it finds 10
referenced jpeg objects
3. HTTP server closes TCP connection.
time
5. Steps 1-5 repeated for each of 10 jpeg objects
or other
57Response time modeling
- Definition of RTT time to send a packet from
client to server and back. - Response time
- 1 RTT to initiate TCP connection
- 1 RTT for request and first few bytes of HTTP
response to return - file transmission time
- total 2RTT transmit time
3-way handshake
58Persistent HTTP
- Persistent without pipelining
- client issues new request only when previous
response has been received - one RTT for each referenced object
- Persistent with pipelining
- default in HTTP/1.1
- client sends requests as soon as it encounters a
referenced object - as little as one RTT for all the referenced
objects
- Nonpersistent HTTP issues
- requires 2 RTTs per object
- OS must work and allocate host resources for each
TCP connection - browsers often open parallel TCP connections to
fetch referenced objects - Persistent HTTP
- server leaves connection open after sending
response - subsequent HTTP messages between same
client/server are sent over connection
59HTTP request message
- HTTP request message
- ASCII (human-readable format)
request line (GET/ POST, HEAD commands)
GET /somedir/page.html HTTP/1.1 Host
www.someschool.edu User-agent
Mozilla/4.0 Connection close Accept-languageEn
(extra carriage return, line feed)
header lines
Carriage return, line feed indicates end of
message
60HTTP request message general format
61Uploading form input
- Post method
- Web page often includes form input
- Input is uploaded to server in entity body
- URL method
- Uses GET method
- Input is uploaded in URL field of request line
www.somesite.com/animalsearch?monkeysbanana
62Method types
- HTTP/1.0
- GET reqd object in URL
- POST usually for forms
- HEAD
- asks server to leave requested object out of
response - Often used for debugging
- HTTP/1.1
- GET, POST, HEAD
- PUT
- uploads file in entity body to path specified in
URL field - DELETE
- deletes file specified in the URL field
63HTTP response message
status line (protocol status code status phrase)
HTTP/1.1 200 OK Connection close Date Thu, 06
Aug 1998 120015 GMT Server Apache/1.3.0
(Unix) Last-Modified Mon, 22 Jun 1998 ...
Content-Length 6821 Content-Type text/html
data data data data data ...
header lines
data, e.g., requested HTML file
64HTTP response status codes
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
65Trying out HTTP (client side)
- 1. Telnet to your favorite Web server
Opens TCP connection to port 80 (default HTTP
server port) at www.eurecom.fr. Anything typed in
sent to port 80 at www.eurecom.fr
telnet www.eurecom.fr 80
2. Type in a GET HTTP request
By typing this in (hit carriage return twice),
you send this minimal (but complete) GET request
to HTTP server
GET /ross/index.html HTTP/1.0
3. Look at response message sent by HTTP server!
66User-server interaction authorization (user
password used)
- Authorization control access to server content
- authorization credentials typically name,
password - stateless client must present authorization in
each request - authorization header line in each request
- if no authorization header, server refuses
access, sends - WWW authenticate
- header line in response
server
client
usual http request msg
401 authorization req. WWW authenticate
67Cookies keeping state
- Four components
- 1) cookie header line in the HTTP response
message - 2) cookie header line in HTTP request message
- 3) cookie file kept on users host and managed by
users browser - 4) back-end database at Web site
- Example
- Susan always accesses Internet from same PC
- She visits a specific e-commerce site for first
time - When initial HTTP requests arrives at site, site
creates a unique ID and creates an entry in
backend database for ID
68Cookies keeping state (cont.)
server creates ID 1678 for user
entry in backend database
access
access
one week later
69Cookies (continued)
aside
- Cookies and privacy
- cookies permit sites to learn a lot about you
- you may supply name and e-mail to sites
- search engines use redirection cookies to
learn yet more - advertising companies obtain info across sites
- What cookies can bring
- authorization
- shopping carts
- recommendations
- user session state (Web e-mail)
70Conditional GET client-side caching
server
client
- Goal dont send object if client has up-to-date
cached version - client specify date of cached copy in HTTP
request - If-modified-since ltdategt
- server response contains no object if cached
copy is up-to-date - HTTP/1.0 304 Not Modified
HTTP request msg If-modified-since ltdategt
object not modified
HTTP request msg If-modified-since ltdategt
object modified
HTTP response HTTP/1.0 200 OK ltdatagt