Title: i206: Lecture 21: Networking, WWW, and Internet Protocols
1i206 Lecture 21Networking, WWW, and Internet
Protocols
2Network
Confidentiality Integrity Authentication
Distributed Systems
Security
Cryptography
Network
Standards Protocols
Inter-process Communication
Methodologies/ Tools
Principles
TCP/IP, RSA,
OperatingSystem
Application
Design
Formal models
Process
I/O
Finite automata regex
Context switch Process vs. Thread Locks and
deadlocks
Program
Algorithms
Analysis
Memory hierarchy
Memory
ALUs, Registers, Program Counter, Instruction
Register
Big-O
Compiler/ Interpreter
Assembly Instructions
Data Structures
Register, Cache Main Memory, Secondary Storage
Searching, sorting, Encryption, etc.
Machine Instructions
CPU
Op-code, operands Instruction set arch
Data storage
Stacks, queues, maps, trees, graphs,
Circuits
Lossless v. lossy Info entropy Huffman code
Decimal, Hexadecimal, Binary
Adders, decoders, Memory latches, ALUs, etc.
Gates
Data compression
Number Systems
Data
AND, OR, NOT, XOR, NAND, NOR, etc.
Boolean Logic
Numbers, text, audio, video, image,
Truth table Venn Diagram DeMorgans Law
Data Representation
Binary Numbers
Bits Bytes
3Topics
- Network abstractions
- Network architecture
- How the WWW works, end to end
- Illustrated with the example of a web search
engine
4Network as Communication Channel
Source Coulouris, Dollimore and Kindberg
5Network Cloud
Network
client server
6Network Routers Links
Source Coulouris, Dollimore and Kindberg
7Network More Details
Internet Service Providers
Customer Premises
Internet backbones
Telephone Network
Point of Presence
Backbone Provider 1
Router
Router
Tandem Switch
ISP
Local Exchange Carrier (LEC)
Exchange Point
DNS
Router
Local Egress Switch
Server
Local Ingress Switch
Content Provider
Packet Network
Local Loop
Headend
Backbone Provider 2
Cable ISP
Remote ISP
Analog Modem
xDSL Modem
Router
router
Cable Modem
Firewall
Client
Corporate LAN
Wireless ISP
Mobile Client
8Network Utilities
- Run from Terminal in unix/mac
- Ping round trip time on an IP network from the
originating host to the destination computer - Traceroute displaying the route (path) and
measuring transit delays of packets across an IP
network - ends a sequence of Internet Control Message
Protocol(ICMP) echo request packets addressed to
a destination host. - ping www.ischool.berkeley.edu
- PING www.ischool.berkeley.edu (128.32.78.21) 56
data bytes - 64 bytes from 128.32.78.21 icmp_seq0 ttl61
time0.846 ms - 64 bytes from 128.32.78.21 icmp_seq1 ttl61
time0.915 ms
9TraceRoute
- traceroute www.ischool.berkeley.edu
- traceroute to www.ischool.berkeley.edu
(128.32.78.21), 64 hops max, 52 byte packets - 1 g2-11.inr-270-doecev.berkeley.edu
(128.32.226.1) 0.681 ms 0.362 ms 0.495 ms - 2 g3-3.inr-202-reccev.berkeley.edu
(128.32.255.34) 0.437 ms 0.540 ms 0.476 ms - 3 t5-5.inr-211-srb.berkeley.edu
(128.32.255.127) 0.626 ms 0.648 ms 1.163 ms - 4 www (128.32.78.21) 0.930 ms 1.220 ms 1.085
ms - traceroute www.google.com
- traceroute Warning www.google.com has multiple
addresses using 74.125.224.83 - traceroute to www.l.google.com (74.125.224.83),
64 hops max, 52 byte packets - 1 g2-11.inr-270-doecev.berkeley.edu
(128.32.226.1) 0.673 ms 0.431 ms 0.427 ms - 2 g3-3.inr-201-sut.berkeley.edu (128.32.255.32)
0.482 ms 0.505 ms 0.510 ms - 3 xe-0-1-0.inr-001-sut.berkeley.edu
(128.32.0.64) 0.597 ms 0.450 ms 0.355 ms - 4 dc-svl-agg1--ucb-10ge.cenic.net
(137.164.50.18) 10.662 ms 7.790 ms 6.443 ms - 5 dc-svl-core1--svl-agg1-10ge.cenic.net
(137.164.47.121) 3.623 ms 3.477 ms 3.133 ms - 6 dc-svl-px1--svl-core1-10ge-2.cenic.net
(137.164.46.13) 4.791 ms 3.045 ms 2.955 ms - 7 137.164.131.61 (137.164.131.61) 3.582 ms
3.415 ms 3.637 ms - 8 137.164.130.94 (137.164.130.94) 8.095 ms
58.649 ms 7.700 ms
10Network Types
Range
Bandwidth (Mbps)
Latency (ms)
LAN
1-2 kms
10-1000
1-10
WAN
worldwide
0.010-600
100-500
MAN
2-50 kms
1-150
10
Wireless LAN
0.15-1.5 km
2-11
5-20
Wireless WAN
worldwide
0.010-2
100-500
Internet
worldwide
0.010-2
100-500
Source Coulouris, Dollimore and Kindberg
- An internet a set of interconnected networks
- The Internet the global internetwork based upon
the Internet Protocol (IP)
11Network Building Blocks
- Transmission media
- Copper (coax, twisted pair), optical fiber, free
space (wireless) - Signals
- Electrical currents, light, RF (radio-frequency),
microwave - Hardware devices
- End hosts, network interfaces
- Routers, switches, hubs, bridges, repeaters
- Software components
- Communication protocol stack
12Network Architecture
13Network Architecture
- Networking can be quite complex and requires a
high degree of cooperation between the involved
parties. - Cooperation is achieved by forcing parties to
adhere to a set of rules and conventions
(protocol). - The complexity of the communication task is
reduced by using multiple protocol layers - Each layer is implemented independently.
- Each layer is responsible for a specific subtask.
- Layers are grouped in a hierarchy.
- A structured set of protocols is called a network
architecture, protocol architecture, or protocol
suite.
14TCP/IP Model
end-to-end
Appl
Appl
end-to-end
Trans port
Trans port
point-to-point
Net work
Net work
Net work
Net work
point-to-point
Link
Link
Link
Link
Host A
Host B
Router 1
Router 2
15TCP/IP Model
server
client
(ping)
end-to-end
Appl
Appl
end-to-end
Trans port
Trans port
point-to-point
Net work
Net work
Net work
Net work
point-to-point
Link
Link
Link
Link
Host A
Host B
Router 1
Router 2
16Message Flow
Appl
Appl
Trans port
Trans port
Net work
Net work
Net work
Net work
Link
Link
Link
Link
Host A
Host B
Router 1
Router 2
17Encapsulation
Data
Appl
Appl
Data
Trans port
Trans port
Net work
Net work
Net work
Net work
Data
Data
Link
Link
Link
Link
Host A
Host B
Router 1
Router 2
18Encapsulation Example Sending HTTP message
using TCP/IP over Ethernet
HTTP message
port
HTTP message
TCP header
TCP segment
TCP
IP header
IP datagram/packet
Ethernet header
IP
Ethernet frame
Adapted from Coulouris, Dollimore and Kindberg
19ISO layer model
- Application (layer 7) specific to application
need - Presentation (layer 6) conversion of data
representation - Session (layer 5) access mgt, synchronization
- Transport (layer 4) end-to-end delivery,
congestion and flow control - Network (layer 3) addressing, routing
- Data Link (layer 2) framing, error detection
- Physical (layer 1) bits (0/1), voltages,
frequencies, wires, pins,
20Layered Protocol Architecture
21The IP Hourglass
HTTP, FTP, SSH, SMTP,
Application Layer
Your python program, ...
Transport Layer
TCP, UDP
A single protocol
Network Layer
IP
Ethernet,
Data Link Layer
WiFi, SONET
coax, twisted pair, fiber,
Physical Layer
wireless, pigeons, ...
22Ensuring Reliability
- Layering
- Hourglass many different applications and
underlying network technologies, but Internet
Protocol establishes universal addressing scheme - Envelope/Encapsulation layer-specific
functionalities isolation between layers - Reliable communication over unreliable network
- IP provides best-effort packet delivery service
- TCP supports retransmission of lost packets
23Internet vs. WWW
- Internet and Web are not synonymous
- Internet is a global communication network
connecting millions of computers. - World Wide Web (WWW) is one component of the
Internet, along with e-mail, chat, etc. - Now well talk about both.
24How Does the WWW Work?
- Lets say Oski received email with the address
for the i206 web page, or saw it on a flyer. - He goes to a networked computer, and launches a
web browser. - He then types the address, known as a URL, into
the address bar of the browser. - What happens next?
(URL stands for Uniform Resource Locator)
25How Does the WWW Work?
- Say Marti has written some web pages for her
class on her PC.
- She copied the pages to a directory on a computer
on her local network at the ischool. The
computers name is herald.
- This computer is connected to the Internet and
runs a program called Apache. This allows herald
to act as a web server.
26How Does the WWW Work?
- How does the computer at Oskis desk figure out
where the i206 web pages are? - In order for him to use the WWW, Oskis computer
must be connected to another machine acting as a
web server (via his ISP). - This machine is in turn connected to other
computers, some of which are routers.
- Routers figure out how to move information from
one part of the network to another. - There are many different possible routes.
27How Does the WWW Work?
- How do Oskis server and the routers know how to
find the right server? - First, the url has to be translated into a number
known as an IP address. - Oskis server connects to a Domain Names Server
(DNS) that knows how to do the translation.
28Domain Name Syntax
- Domain names are read right to left, from general
to more specific locations - For example, www.xyz.com can be interpreted as
follows - com commercial site top-level domain
- xyz registered company domain name
- www host name (it is a convention to name web
server hosts www which stands for world wide
web)
29Typical Domain Name
www.xyz.com
Server (host) name
Registered company domain name
Domain category (top-level domain)
Domain names are part of URLs, used in web pages.
30Top-Level Domains
- com, biz, cc commercial or company sites
- edu educational institutions, typically
universities - org organizations originally meant for clubs,
associations and nonprofit groups - mil U.S. military
- gov U.S. civilian government
- net network sites, including ISPs
- int international organizations (rarely used)
- Many other top level domains are available
31Converting Domain Names
- Domain names are for humans to read.
- The Internet actually uses numbers called IP
addresses to describe network addresses. - The Domain Name System (DNS) resolves IP
addresses into easily recognizable names - For example
- 12.42.192.73 www.xyz.com
- A domain name and its IP address refer to the
same Web server.
32Internet Addresses
- The internet is a network on which each computer
must have a unique address. - The Internet uses IP addresses for example,
heralds IP address is 128.32.226.90 - Internet Protocol version 4 (IPv4) supports
32-bit dotted quad IP address format - Four sets of numbers, each set ranging from 0 to
255 - UC Berkeleys LAN addresses range from
128.32.0.0 to 128.32.255.255 - Other addresses in the iSchool LAN include
128.32.226.49 - Using this setup, there are approximately 4
billion possible unique IP addresses - Router software knows how to use the IP addresses
to find the target computer.
33How the Internet Works
- Network Protocols
- Protocol an agreed-upon format for transmitting
data between two devices - Like a secret handshake
- The Internet protocol is TCP/IP
- The WWW protocol is HTTP
- Network Packets
- Typically a message is broken up into smaller
pieces and re-assembled at the receiving end. - These pieces of information, surrounded by
address information are called packets
34IP Packet Format (v4)
Field length in bits
Bit 0
Bit 31
Total Length in bytes (16)
Version (4)
Hdr Len (4)
TOS (8)
Identification (16 bits)
Flags (3)
Fragment Offset (13)
Time to Live (8)
Header Checksum (16)
Protocol (8)
Source IP Address (32)
Destination IP Address (32)
Options (if any)
Data (variable length)
Data
35How Does the WWW Work?
- What happens now that the request for information
from Oskis browser has been received by the web
server herald at www.ischool.berkeley.edu? - The web server processes the url to figure out
which page on the server is requested. - It then sends all the information from that page
back to the requesting address.
36Reading a URL
- http//courses.ischool.berkeley.edu/i206/s12/index
.html - http// HyperText Transfer Protocol
- courses service name (often is www)
- .ischool host name
- .berkeley primary domain name
- .edu/ top level domain
- i206/ directory name
- s12/ directory name
- index.html file name of web page
37Web Pages and HTML
- So what do we see at http//courses.ischool.berkel
ey.edu/i206/s12/index.html ?
38Web Pages and HTML
- What does HTML look like?
39HTML
- HyperText Markup Language
- Uses lttagsgt which mark up the text and tell the
browser how to display the content. - A backslash tag means the end of the command but
is sometimes optional - Examples
- This is ltbgt boldface text lt/bgt.
- ltpgt indicates a paragraph break
- lth1gt This is a large heading lt/h1gt
- lth3gt This is a smaller heading lt/h3gt
40HTML Hyperlinks
- Hyperlink is the most important
- lta hrefhttp//www.berkeley.edu/map/maps/BC23.html
gt 100 Genetics Plant Biology Bldg lt/agt - The green part is called anchor text
- Its the text you see on the link
- The pink part is the url that the link will take
you to if you click on it. The http// at the
front indicates the http (Web) protocol. - The lta href gt lt/agt is the command that
indicates the enclosed information is a
hyperlink, and the that text between the tags is
the anchor text. - A hyperlink can be clicked on by a person OR
followed by a computer program.
41HTTP
- HTTP is the protocol used by the WWW
- When a user clicks on a hyperlink in their web
browser, this sends an HTTP command to the Web
server named in the URL - This command usually is to GET the contents of
the web page and return them to the users
browser. - It is a very simple protocol
- It relies on the TCP/IP functionality
42HTTP Request Example
This information is received by the web server
at www.ischool.berkeley.edu
GET i141/s07/index.html HTTP/1.1ltCRLFgt
Request line
Host courses.ischool.berkeley.edu ltCRLFgt
Request header
ltCRLFgt
Blank line
Because HTTP is built on TCP/IP, the web
server knows which IP address to send the
contents of the web page back to.
43How Does the WWW Work?
- When Oski typed in the url for the i206 home
page, this was turned into an HTTP request and
routed to the web server in Berkeley. - The web server then decomposed the url and
figured out which web page in its directories was
being asked for. - The server then sends the HTML contents of the
page back to Oskis IP address.
- Oskis browser receives these HTML contents and
renders the page in graphical form. - If he clicks on a hyperlink in that page, a
similar sequence of events occurs.