Computer Networking Group Computer Architecture Dept. Techni

advertisement
Grau en enginyeria informàtica - Xarxes de Computadors (XC-grau)
Computer Networks - Xarxes de Computadors
Teacher: Llorenç Cerdà
Slides: http://studies.ac.upc.edu/FIB/grau/XC
Outline
Course Syllabus
Unit 1: Introduction
Unit 2. IP Networks
Unit 3. TCP
Unit 4. LANs
Unit 5. Network applications
Llorenç Cerdà-Alabern
1
Grau en enginyeria informàtica - Xarxes de Computadors (XC-grau)
Course Syllabus
Course Organization
2+1h lectures/week: theoretical + problems
Print the problems manual (available in the racó).
Try to do the problems beforehand.
Find textbooks and related links at the web page.
Laboratory sessions of 2h on selected weeks + 2 non classroom labs
Buy laboratory manual in Repography.
Study and prepare sessions before hand.
Minicontrol held at the end of each session.
Required submitting a report at the beginning of the session.
Otherwise, the minicontrol cannot be done.
web page: http://studies.ac.upc.edu/FIB/grau/XC
Llorenç Cerdà-Alabern
2
Grau en enginyeria informàtica - Xarxes de Computadors (XC-grau)
Course Syllabus
Evaluation:
NF = 0.25 * NL + 0.75 * NT
Where:
NF = Final grade.
NL = Laboratory: 25% average of lab sessions, and 75% a final lab. exam.
NT = Theory grade.
NT can be obtained:
Continuous evaluation: NC = 0.4 * C1 + 0.3 * C2 + 0.3 * C3. If NC≥5 then
NT=NC.
C1: Units 1,2 (introduction+IP),
C2: Unit 3 (TCP),
C3: Units 4,5 (LANs+Apps)
Final Exam (EF). NT=max(NC, EF).
If with NC it is NF≥5, you must send an email to the coordinator if
you want to do the EF (to increase grade).
Llorenç Cerdà-Alabern
3
Grau en enginyeria informàtica - Xarxes de Computadors (XC-grau)
Course Syllabus
Incentive to study:
The final grade (NF) will be increased 1 point to students who meet the following
conditions:
Deliver on time the tracking problems (exercicis de seguiment) that will be
proposed during the course.
Obtain a grade ≥ 5 at least 1 of the Controls.
Have a theory grade (NT) and lab (NL) greater than or equal to 5: NT,NL ≥ 5.
Autonomous learning (transversal competence):
Two non classroom labs (home labs) will be proposed in the Racó.
Evaluated with a specific final lab exam.
Llorenç Cerdà-Alabern
4
Grau en enginyeria informàtica - Xarxes de Computadors (XC-grau)
Computer Networks - Xarxes de Computadors
Outline
Course Syllabus
Unit 1: Introduction
Unit 2. IP Networks
Unit 3. TCP
Unit 4. LANs
Unit 5. Network applications
Llorenç Cerdà-Alabern
5
Grau en enginyeria informàtica - Xarxes de Computadors (XC-grau)
Unit 1: Introduction
Outline
Brief history of Computer Networks and Internet
Introduction to the Internet
Standardization Organizations and OSI Reference Model
Client-Server Paradigm
Llorenç Cerdà-Alabern
6
Grau en enginyeria informàtica - Xarxes de Computadors (XC-grau)
Unit 1: Introduction
Brief history of Computer Networks
1830: Telegraph
1866: First transatlantic telegraph
cable
1875: Alexander Graham Bell
invented the telephone
1951: First commercial computer
1960: Concept of Packet
Switching.
1960s: ARPANET project,
origins of the Internet.
1972: First International and
commercial Packet Switching
Network, X.25.
1990s: The Internet is opened to
the general public.
Pavel Shilling Telegraph, 1832.
Major Telegraph Lines, 1891.
UNIVAC: First commercial
computer, 1951
Source: wikipedia
Llorenç Cerdà-Alabern
New York Telephone
Cabling, 1888
Telephone Central Office in
London, 1926
Today's Networking
Equipment.
7
Grau en enginyeria informàtica - Xarxes de Computadors (XC-grau)
Unit 1: Introduction
Brief History of the Internet
1966: Defense Advanced Research
Projects Agency (DARPA). ARPANET
project.
ARPANET connected Universities,
research labs and military centers. Military
portion separated in 1983.
1970s: End-to-end reliability was moved
to hosts, developing TCP/IP. TCP/IP was
ported to UNIX Berkeley distribution,
BSD.
1990s: The Internet is opened to
commerce and the general public by the
Internet Service Providers, ISP.
Llorenç Cerdà-Alabern
http://www.geant2.net
http://www.rediris.es
8
Grau en enginyeria informàtica - Xarxes de Computadors (XC-grau)
Unit 1: Introduction
Outline
Brief history of Computer Networks and Internet
Introduction to the Internet
Standardization Organizations and OSI Reference Model
Client-Server Paradigm
Llorenç Cerdà-Alabern
9
Grau en enginyeria informàtica - Xarxes de Computadors (XC-grau)
Unit 1: Introduction
Organization of the Internet and Terminology
Host
Access Network
LAN
WAN
Telephone company,
telco, or carrier.
Router
Line Bitrate
Bits per second, bps.
router
56 kbps
Domestic
users and
SOHOs
(Small office/
home office)
Carrier operators
64 kbps
WANs
ISDN NIC
ADSL
Public switched
telephone
network, PSTN
4 Mbps
...
4 Mbps
ISP
router
ISP
router
X.25
ISP
Frame Relay
ATM
leased lines: E1 (2 Mbps), E3 (34 Mbps) ...
...
ADSL
router
34 Mbps
router
Corporate
Networks
100 Mbps
LAN
LAN
Llorenç Cerdà-Alabern
10
router
ISP
Grau en enginyeria informàtica - Xarxes de Computadors (XC-grau)
Unit 1: Introduction
Bitrate
tb is the transmission time of 1 bit.
modem
vt=1/tb is the line bitrate in bits per second (bps)
vt=1/tb
typical bitrate prefixes:
s(t)
k, kilo: 103
1
0
0
1
0
M, Mega: 106
V
G, Giga: 109
0
12
t
T, Tera: 10
-V
P, Peta: 1015
NRZ signal
Examples:
Public Switched Telephone Network (PSTN) modem: 56 kbps
ADSL: 4 Mbps
LAN Ethernet: 10 Mbps, 100 Mbps, 1Gbps, 10 Gbps.
Carrier lines E3: 34 Mbps, OC-192: 9,9 Gpbs, ...
1
bits
t
b
Llorenç Cerdà-Alabern
1
11
Grau en enginyeria informàtica - Xarxes de Computadors (XC-grau)
Unit 1: Introduction
Types of Switching
Circuit switching, e.g. PSTN (Public Switched Telephone Network)
Packet switching:
Virtual Circuit, e.g. X.25, ATM.
Datagram: Internet.
message to send (e.g. web page)
header:
source addr.
packets (datagrams)
destination addr.
...
...
server
modem
PSTN
client
ISP
...
Internet
ISP
LAN
Datagram packet switching
Llorenç Cerdà-Alabern
12
Grau en enginyeria informàtica - Xarxes de Computadors (XC-grau)
Unit 1: Introduction
Outline
Brief history of Computer Networks and Internet
Introduction to the Internet
Standardization Organizations and OSI Reference
Model
Client-Server Paradigm
Llorenç Cerdà-Alabern
13
Grau en enginyeria informàtica - Xarxes de Computadors (XC-grau)
Unit 1: Introduction
Standardization Bodies
International Telecommunication Union, ITU: WAN standards.
http://www.itu.org/.
International Organization for Standardization, ISO: Industrial
standards. http://www.iso.org/.
Institute of Electrical and Electronics Engineers, IEEE: LAN standards.
http://www.ieee.org/.
European Telecommunications Standards Institute, ETSI: Mobile phone
standards (GSM). http://www.etsi.org/.
Electronic Industries Alliance, EIA: Cabling standards.
http://www.eia.org/.
Internet Engineering Task Force, IETF: Internet standards.
http://www.ietf.org. Standardization proposals are done through Request
For Comments, RFCs. They are mirrored around the world, e.g.
http://www.rfc-editor.org
World Wide Web Consortium (W3C). http://www.w3.org
Llorenç Cerdà-Alabern
14
Grau en enginyeria informàtica - Xarxes de Computadors (XC-grau)
Unit 1: Introduction
ISO Open Systems Interconnection (OSI) Reference Model
Layers or Levels: Physical or Layer 1 (L1), ...
Peer layers communicate using a protocol.
Protocols from different layers are independent.
Layer i offers services (e.g. send a datagram to a given address) to layer
i+1: Service Access Points (SAP).
Peer layers exchange Protocol Data Unit (PDU), which consists of a
header and payload.
Brief description of Layers:
7 application
6 presentation
5 session
4 transport
3 network
2 data link
1 physical
Terminal node
3 network
2 data link
1 physical
Intermediate node
7 application
6 presentation
5 session
4 transport
3 network
2 data link
1 physical
Terminal node
7. Application: Processes using network
services (web, email...)
6. Presentation: Encoding of text, numbers...
5. Session: “Login” type service.
4. Transport: End to end data transfer.
3. Network: Routing.
2. Data link: Structured transport of bits.
1. Physical: Electric and mechanical.
*Internet jargon: Layer 8: the user.
Llorenç Cerdà-Alabern
15
Grau en enginyeria informàtica - Xarxes de Computadors (XC-grau)
Unit 1: Introduction
TCP/IP Architecture
No RFC specifies the TCP/IP model.
Networking literature usually identifies the layer model:
application
application
4 transport (TCP/UDP)
3 network (IP)
physical network
interface
host
4 transport (TCP/UDP)
3 network (IP)
3 network (IP)
physical network
interface
physical network
interface
router
physical network
host
physical network
Physical network (Internet jargon): Any network that
transport datagrams (not the OSI physical layer!)
Llorenç Cerdà-Alabern
16
Grau en enginyeria informàtica - Xarxes de Computadors (XC-grau)
Unit 1: Introduction
Encapsulation
Each layer adds/remove the PDU header.
Layer:
PDU name:
application
TCP
header
transport
physical
TCP segment
IP
header
network
data link
message
message (e.g. web page)
IP datagram
Ethernet
header
CRC
...
ethernet frame
bits or characters
Llorenç Cerdà-Alabern
17
Grau en enginyeria informàtica - Xarxes de Computadors (XC-grau)
Unit 1: Introduction
TCP/IP Implementation
TCP/IP networking code is part of the Operating System kernel.
Socket interface: Is the Unix networking interface for the processes. It
was first implemented in Berkeley Software Distribution, BSD.
The socket system call creates a socket descriptor used to store all
information associated with a network connection, similarly as an inode
descriptor for a file.
process
system calls: socket(),
connect(), read(), write()...
socket layer
4 transport (TCP/UDP)
Operating
System
3 network (IP)
Socket Descriptor within the Kernel Data Structure
file{}
proc{}
filedesc{}
p_fd
fd_ofiles
NIC
interface layer
NIC: Network
Interface Card
*file{}[]
descriptor
table
process
table
Llorenç Cerdà-Alabern
inode{}
open file
f_data
file{}
socket{}
f_data
so_type
so_proto
18
socket
Grau en enginyeria informàtica - Xarxes de Computadors (XC-grau)
Unit 1: Introduction
Outline
Brief history of Computer Networks and Internet
Introduction to the Internet
Standardization Organizations and OSI Reference Model
Client-Server Paradigm
Llorenç Cerdà-Alabern
19
Grau en enginyeria informàtica - Xarxes de Computadors (XC-grau)
Unit 1: Introduction
Client Server Paradigm: Processes, messages, sockets
segments and IP datagrams
User
space
User
space
Process
message to send
(e.g. request a web page)
Transport
layer
Socket interface
Segments encapsulated
into IP datagrams
...
Process
message to send
(e.g. a web page)
Socket Interface:
TCP/IP API: socket(),
bind(), listen(),
accept(), connect(),
read(), write()...
Operating
System
Transport
layer
Socket interface
Segments encapsulated
into IP datagrams
...
Operating
System
client
ISP
...
Internet
server
ISP
Llorenç Cerdà-Alabern
20
Grau en enginyeria informàtica - Xarxes de Computadors (XC-grau)
Unit 1: Introduction
Client Server Paradigm: The Internet Transport Layer
Two protocols are used at the TCP/IP transport layer: User Datagram
Protocol (UDP) and Transmission Control Protocol (TCP).
UDP offers a datagram service (non reliable). It is connectionless.
TCP offers a reliable service (correct segments are acknowledged, ack,
lost segments are retransmitted). It is connection oriented (covered in
detail in Unit 3).
TCP connection:
Connection establishment
Client
Exchange of data
Termination
Three way handshaking
ack
t
ack
ack
...
ack
t
Server
Llorenç Cerdà-Alabern
21
Grau en enginyeria informàtica - Xarxes de Computadors (XC-grau)
Unit 1: Introduction
Client Server Paradigm
How connection is established among processes?
The client always initiates the connection towards a known IP address, in
the IP header, and a well known port (< 1024), in the TCP/UDP header.
Well known ports are standardized by IANA in RFC-1700 (Assigned
Numbers). In a unix machine can be found in /etc/services.
The server is a daemon waiting for client requests.
Processes
Socket interface
Ephemeral port
(≥1024)
client
port x1
...
...
...
...
TCP/UDP
Host A
Operating
System
TCP/UDP
Host B
server
port y1
Operating
System
Socket interface
Well known port
<1024
dst port = y1
src port = x1
dst port = x1
src port = y1
TCP/UDP header
Llorenç Cerdà-Alabern
22
Grau en enginyeria informàtica - Xarxes de Computadors (XC-grau)
Unit 1: Introduction
Client Server Paradigm – UNIX /etc/services File
Enables server and client programs to convert service names to well known
ports.
linux> cat /etc/services
# Network services, Internet style
# Note that it is presently the policy of IANA to assign a single well­known
# port number for both TCP and UDP; hence, most entries here have two entries
# even if the protocol doesn't support UDP operations.
# This list could be found on:
# http://www.iana.org/assignments/port­numbers
# ************************************************************************
# WELL KNOWN PORT NUMBERS
# The Well Known Ports are assigned by the IANA and on most systems can
# only be used by system (or root) processes or by programs executed by
# privileged users.
#
# Keyword Decimal Description # ­­­­­­­ ­­­­­­­ ­­­­­­­­­­­ echo 7/tcp Echo
echo 7/udp Echo
discard 9/tcp # Discard
discard 9/udp # Discard
daytime 13/tcp # Daytime (RFC 867)
daytime 13/udp # Daytime (RFC 867)
chargen 19/tcp # Character Generator
chargen 19/udp # Character Generator
ftp­data 20/tcp # File Transfer [Default Data]
ftp­data 20/udp # File Transfer [Default Data]
ftp 21/tcp # File Transfer [Control]
ssh 22/tcp # SSH Remote Login Protocol
ssh 22/udp # SSH Remote Login Protocol
telnet 23/tcp # Telnet
telnet 23/udp # Telnet
...
Llorenç Cerdà-Alabern
23
Grau en enginyeria informàtica - Xarxes de Computadors (XC-grau)
Unit 1: Introduction
Client Server Paradigm – Network applications
Remote commands
telnet
ssh
Exchange of documents
ftp, sftp
peer-to-peer
Web based applications
Email
Network management
Real time
Voice over IP
Video streaming
...
Llorenç Cerdà-Alabern
24
Download