Upload
brice-lee
View
253
Download
0
Embed Size (px)
Citation preview
1: Introduction 1
Computer Network
张 辉
Textbook 计算机网络(第四版) Adrew S. Tanenbaum 清华大学出版社 Computer Networking: A Top-Down Approach Featuring the Internet by Kurose and Ross (高等教育出版社)
1: Introduction 2
教学内容
计算机网络是计算机技术与通信技术的交叉学科。本课程以计算机网络体系结构为总纲,系统、分层次地讲述计算机网络的基本概念和工作原理,包括物理层、数据链路层、网络层、传输层和应用层的功能、接口和主要协议,重点介绍 Internet 核心协议族 TCP/IP 。
1: Introduction 3
教学目标了解有关计算机网络的基本概念,掌
握计算机网络的基本工作原理和主要技术,学会计算机网络应用原理及其方法。
以计算机网络体系结构的分层模型为基 础 , 重 点 掌 握 Internet 。 采 用 的TCP/IP 协议族的工作原理,为今后各种计算机网络及其相关应用、学习和研究打下基础。
1: Introduction 4
What Will We Cover? 网络简介 网络体系结构 网络物理层(传输媒介、接口、信号) 数据链路层(网络检错、同步、 HDLC 、 PPP ) 局域网技术( Ethernet 、 Token Ring 、 Token
bus 、 ATM) 网络层( IP 编址、 subnetting 、 VLSM 、 CIDR 、
IPv6 ) 路由原理( RIP 、 OSPF 、 BGP )、广域网 传输层( TCP 、 UDP ) 流量控制、拥塞控制及网络性能 应用层( SMTP 、 ftp 、 Web 、 DNS 等) 网络安全及网络管理 网络新技术 (MPLS 、 Multicasting 、 Grid 、 NGI 等 )
1: Introduction 5
Part I: Introductiongoal: overview, “feel” of
networking more depth, detail
later in course approach:
descriptive use Internet as
example
Overview: what’s the Internet what’s a protocol? network edge network core access net, physical media performance: loss, delay protocol layers, service
models backbones, NAPs, ISPs Network history
1: Introduction 6
计算机网络与其它网络的关系
1: Introduction 7
计算机网络的构成
计算机网络运行在通信传输子网之上,由用户资源子网和通信传输子网组成业务网。
1: Introduction 8
What’s the Internet: “nuts and bolts” view
millions of connected computing devices: hosts, end-systems pc’s workstations, servers PDA’s phones
running network apps communication links
fiber, copper, radio, satellite
routers: forward packets of data thru network
local ISP
companynetwork
regional ISP
router workstation
servermobile
1: Introduction 9
What’s the Internet: “nuts and bolts” view protocols: control sending,
receiving of msgs 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
local ISP
companynetwork
regional ISP
router workstation
servermobile
1: Introduction 10
What’s the Internet: a service view
communication infrastructure enables distributed applications: WWW, email, games, e-
commerce, database., voting,
more?
communication services provided: connectionless connection-oriented
cyberspace [Gibson]:“a consensual hallucination
experienced daily by billions of operators, in every nation, ...."
1: Introduction 11
What’s a protocol?human protocols: “what’s the time?” “I have a question” introductions
… specific msgs sent… specific actions
taken when msgs received, or other events
network protocols: machines rather than
humans all communication
activity in Internet governed by protocols
protocols define format, order of msgs sent and
received among network entities, and actions taken on msg transmission, receipt
1: Introduction 12
What’s a protocol?a human protocol and a computer network protocol:
Q: Other human protocol?
Hi
Hi
Got thetime?
2:00
TCP connection req.
TCP connectionreply.Get http://www.buaa..edu.cn/index.htm
<file>time
1: Introduction 13
协议 protocol 协议:计算机网络同等层次中,通信双方进
行信息交换时必须遵守的规则。
协议的组成:1. 语法( syntax) :以二进制形式表示的命
令和相应的结构2. 语义( semantics) :由发出的命令请求,
完成的动作和回送的响应组成的集合3. 定时关系( timing) :有关事件顺序的说
明
1: Introduction 14
Who is Who on the Internet ? Internet Architecture Board (IAB): The IAB is responsible
for defining the overall architecture of the Internet, providing guidance and broad direction to the IETF.
Internet Engineering Task Force (IETF): The IETF is the protocol engineering and development arm of the Internet. Subdivided into many working groups, which specify Request For Comments or RFCs.
IRTF (Internet Research Task Force): The Internet Research Task Force is a composed of a number of focused, long-term and small Research Groups.
The Internet Engineering Steering Group (IESG): The IESG is responsible for technical management of IETF activities and the Internet standards process. Standards. Composed of the Area Directors of the IETF working groups.
1: Introduction 15
Internet Standardization Process
All standards of the Internet are published as RFC (Request for Comments). But not all RFCs are Internet Standards !
available: http://www.ietf.org A typical (but not only) way of standardization
is: Internet Drafts Proposed Standard Draft Standard (requires 2 working
implementation) Internet Standard (declared by IAB)
David Clark, MIT, 1992: "We reject: kings, presidents, and voting. We believe in: rough consensus and running code.”
1: Introduction 16
A closer look at network structure: network edge:
applications and hosts network core:
routers network of networks
access networks, physical media: communication links
1: Introduction 17
The network edge: end systems (hosts):
run application programs e.g., WWW, email at “edge of network”
client/server model client host requests,
receives service from server e.g., WWW client (browser)/
server; email client/server
peer-peer model: host interaction symmetric e.g.: teleconferencing
1: Introduction 18
Network edge: connection-oriented service
Goal: data transfer between end sys.
handshaking: setup (prepare for) data transfer ahead of time Hello, hello back
human protocol set up “state” in two
communicating hosts
TCP - Transmission Control Protocol Internet’s connection-
oriented service
TCP service [RFC 793] reliable, in-order byte-
stream data transfer loss: acknowledgements
and retransmissions
flow control: sender won’t overwhelm
receiver
congestion control: senders “slow down
sending rate” when network congested
1: Introduction 19
Network edge: connectionless service
Goal: data transfer between end systems same as before!
UDP - User Datagram Protocol [RFC 768]: Internet’s connectionless service unreliable data
transfer no flow control no congestion
control
App’s using TCP: HTTP (WWW), FTP
(file transfer), Telnet (remote login), SMTP (email)
App’s using UDP: streaming media,
teleconferencing, Internet telephony
1: Introduction 20
The Network Core
mesh of interconnected routers
the fundamental question: how is data transferred through net? circuit switching:
dedicated circuit per call: telephone net
packet-switching: data sent thru net in discrete “chunks”
1: Introduction 21
network core
Communication networks
Broadcast networksEnd nodes share a common channel
(TV, radio…)
Switched networks end nodes send to one (or more) end nodes
Packet switchingData sent in discrete portions
(the Internet)
Circuit switchingDedicated circuit per call
(telephone, ISDN)
(physical)
Datagram networksEach packet switched
independently
Virtual circuit networksPre-established path
(logical)
1: Introduction 22
Network Core: Circuit SwitchingEnd-end resources
reserved for “call” link bandwidth, switch
capacity dedicated resources:
no sharing circuit-like
(guaranteed) performance
call setup required pieces allocated to calls resource piece idle if
not used by owning call (no sharing)
1: Introduction 23
Circuit Switching: FDM and TDM
FDM
frequency
time
TDM
frequency
time
4 users
Example:
1: Introduction 24
Circuit Switching
Three phases1. circuit establishment2. data transfer3. circuit termination
If circuit not available: “Busy signal”
Examples Telephone networks ISDN (Integrated Services Digital
Networks)
1: Introduction 25
Circuit Switching Telephone Network
Source“Caller”
Central Office“C.O.”
Destination“Callee”
Central Office“C.O.”
TrunkExchange
Each phone call is allocated 64kb/s. So, a 2.5Gb/s trunk line can carry about 39,000
calls.
1: Introduction 26
Circuit Switching
A node (switch) in a circuit switching network
incoming links outgoing linksNode
1: Introduction 27
Numerical example How long does it take to send a file of
80k bytes from host A to host B over a circuit-switched network? All links are 1.536 Mbps Each link uses TDM with 24 slots 500 msec to establish end-to-end circuit
Work it out!
Rate 1.536 Mbps /24 = 64,000 bps
Total time 500ms+ 80*8kb/64kbps=10500 ms
1: Introduction 28
Symbols
Mbpsmegabits per second 106 bits per second
MBpsmegabytes per second
Gbps, Kbps,bandwidth
the total information flow over a given time
1: Introduction 29
分组 packet
邮政系统 信件-收信人地址-发信人地址
数据报 (DataGram)
自带寻址信息 能独立地从数据源“行走”到目的终点的数据包 (packet)
1: Introduction 30
Network Core: Packet Switching
each end-end data stream divided into packets
user A, B packets share network resources
each packet uses full link bandwidth
resources used as needed,
resource contention:
资源可能供不应求 拥塞 : 分组排队 , 等
待链路资源 在路由器上存储转
发 : 分组一次移动一跳通过链路传输等待下一条链路
Bandwidth division into “pieces”Dedicated allocationResource reservation
1: Introduction 31
Packet Switching
A
R1
R2
R4
R3
B
Source Destination
It’s the method used by the Internet. Each packet is individually routed packet-by-packet,
using the router’s local routing table. The routers maintain no per-flow state. Different packets may take different paths. Several packets may arrive for the same output link at
the same time, therefore a packet switch has buffers.
1: Introduction 32
Network Core: Packet Switching
Packet-switching versus circuit switching: human restaurant analogy
other human analogies?
A
B
C10 MbsEthernet
1.5 Mbs
45 Mbs
D E
statistical multiplexing
queue of packetswaiting for output
link
1: Introduction 33
Data are sent as formatted bit-sequences, so-called packets.
Packets have the following structure:
• Header and Trailer carry control information (e.g., destination address, check sum)
Each packet is passed through the network from node to node along some path (Routing)
At each node the entire packet is received, stored briefly, and then forwarded to the next node (Store-and-Forward Networks)
Header Data Trailer
Packet Structure and switching
1: Introduction 34
Packet Switching
A node in a packet switching network
incoming links outgoing linksNode
Memory
1: Introduction 35
分组交换 vs. 电路交换
1 Mb/s 链路 每个用户 :
100Kb/s 当“激活” 激活时间为 10%
电路交换 : 10 用户
分组交换 : 对 35 个用户来说 , 概
率 : > 10 个用户同时激活小于 .0017
分组交换使得更多用户可“同时”使用网络 !
N users
1 Mbps link
n
ip p
i
n i i
0 1 0
1( )
1: Introduction 36
分组交换 vs. 电路交换
在突发性数据传输过程中表现优异资源共享无须事先建立连接
过度拥塞 : 导致分组延迟和丢失需要协议来保障可靠的数据传输 , 拥塞控制
Q: 如何在分组交换网中提供电路交换的性能 ?为音频 /视频( audio/video )应用提供带宽
保障仍然是一个需要解决的问题
分组交换是不是 “ winner”?
1: Introduction 37
Packet-switched networks: routing Goal: move packets among routers from source
to destination we’ll study several path selection algorithms
datagram network: destination address determines next hop routes may change during session analogy: driving, asking directions
virtual circuit network: each packet carries tag (virtual circuit ID), tag
determines next hop fixed path determined at call setup time, remains fixed
thru call routers maintain per-call state
1: Introduction 39
Virtual circuit network
A
BC
D
E
1
2
3
3
2
1
13
2
12
3
11
22
33
2
3
1
SVC 1
SVC 2
Note: Packet headers don’t need to contain the full destination
address of the packet - only contain virtual circuit identifier (VCI)
1: Introduction 40
Why does the Internet use packet switching?
1. Efficient use of expensive links: The links are assumed to be expensive and scarce. Packet switching allows many, bursty flows to share
the same link efficiently. “Circuit switching is rarely used for data
networks, ... because of very inefficient use of the links” - Gallager
2. Resilience to failure of links & routers: ”For high reliability, ... [the Internet] was to be a
datagram subnet, so if some lines and [routers] were destroyed, messages could be ... rerouted” - Tanenbaum
Source: Networking 101
1: Introduction 41
Access networks and physical media
Q: How to connection end systems to edge router?
residential access nets institutional access
networks (school, company)
mobile access networks
Keep in mind: bandwidth (bits per
second) of access network?
shared or dedicated?
1: Introduction 42
Residential access: point to point access
Dialup via modem up to 56Kbps direct access
to router (conceptually) ISDN: intergrated services
digital network: 128Kbps all-digital connect to router
ADSL: asymmetric digital subscriber line up to 1 Mbps home-to-
router up to 8 Mbps router-to-
home
1: Introduction 43
Residential access: cable modems
Diagram: http://www.cabledatacomnews.com/cmic/diagram.html
1: Introduction 44
Cable Network Architecture
home
cable headend
cable distributionnetwork (simplified)
Typically 500 to 5,000 homes
HFC: hybrid fiber coaxasymmetric: up to 10Mbps upstream, 1 Mbps downstream
1: Introduction 45
Institutional access: local area networks
company/univ local area network (LAN) connects end system to edge router
Ethernet: shared or dedicated
cable connects end system and router
10 Mbs, 100Mbps, Gigabit Ethernet
deployment: institutions, home LANs soon
1: Introduction 46
Wireless access networks
shared wireless access network connects end system to router
wireless LANs: radio spectrum replaces
wire e.g., Lucent Wavelan 10
Mbps
wider-area wireless access CDPD: wireless access
to ISP router via cellular network
basestation
mobilehosts
router
1: Introduction 47
Home network components ADSL or cable modem router/firewall/NAT (Network Address Translation)
NAT enables a LAN to use one set of IP addresses for internal traffic and a second set of addresses for external traffic. It makes all necessary IP address translations.
Ethernet wireless access point
wirelessaccess point
wirelesslaptops
router/firewall
cablemodem
to/fromcable
headend
Ethernet
1: Introduction 48
Physical Media
physical link: transmitted data bit propagates across link
guided media: signals propagate in
solid media: copper, fiber
unguided media: signals propagate
freely e.g., radio
Twisted Pair (TP) two insulated copper
wires Category 3: traditional
phone wires, 10 Mbps ethernet
Category 5 TP: 100Mbps ethernet
1: Introduction 49
Physical Media: coax, fiber
Coaxial cable: wire (signal carrier)
within a wire (shield) baseband: single
channel on cable broadband: multiple
channel on cable
bidirectional common use in
10Mbs Ethernet
Fiber optic cable: glass fiber carrying
light pulses high-speed operation:
100Mbps Ethernet high-speed point-to-
point transmission (e.g., 5 Gps)
low error rate
1: Introduction 50
Physical media: radio
signal carried in electromagnetic spectrum
no physical “wire” bidirectional propagation
environment effects: reflection obstruction by objects interference
Radio link types: microwave
e.g. up to 45 Mbps channels
LAN (e.g., waveLAN) 2Mbps, 11Mbps
wide-area (e.g., cellular) e.g. CDPD, 10’s Kbps
satellite up to 50Mbps channel (or multiple
smaller channels) 270 Msec end-end delay geosynchronous versus LEOS
1: Introduction 51
Delay in packet-switched networkspackets experience delay
on end-to-end path four sources of delay at
each hop
nodal processing: check bit errors determine output link
queueing time waiting at output
link for transmission depends on congestion
level of router
A
B
propagation
transmission
nodalprocessing queueing
1: Introduction 52
Delay in packet-switched networksTransmission delay: R=link bandwidth
(bps) L=packet length (bits) time to send bits into
link = L/R
Propagation delay: d = length of physical
link s = propagation speed in
medium (~2x108 m/sec) propagation delay = d/s
A
B
propagation
transmission
nodalprocessing queueing
Note: s and R are very different quantitites!
1: Introduction 53
Packet Switching
Host A
Host B
R1
R2
R3
A
R1
R2
R4
R3
B
TRANSP1
TRANSP2
TRANSP3
TRANSP4
PROP1
PROP2
PROP3
PROP4
Source Destination
“ Store-and-Forward” at each Router
( )i ii
TRANSP PROP Minimum end to end latency
1: Introduction 54
Packet SwitchingWhy not send the entire message in one packet?
Breaking message into packets allows parallel transmission across all links, reducing end to end latency. It also prevents a link from being “hogged” for a long time by one message.
Host A
Host B
R1
R2
R3
M/R
min/ ii
M R PROP Latency
Host A
Host B
R1
R2
R3
( / )i ii
PROP M R Latency
M/R
+n*m/R
N 为经过 R 的数量
1: Introduction 55
传播延迟忽略不计的情况
1: Introduction 56
Queueing delay
R=link bandwidth (bps) L=packet length (bits) a=average packet
arrival rate
traffic intensity = La/R
La/R ~ 0: average queueing delay small La/R -> 1: delays become large La/R > 1: more “work” arriving than can
be serviced, average delay infinite!
1: Introduction 57
Little’s Theorem
: average customer arrival rate N: average number of customers in system T: average delay per customer in system
Little’s Theorem: System in steady-state
N T
N
T
1: Introduction 58
Queueing Theory
假设 :顾客总数无限,以保证到达速率不受影响;队列大小无限,保证无分组被丢弃;服务规则假设为 FIFO;分组以泊松到达;
u
N
u
T1
1: Introduction 59
习题一
顾客以 5 人 /分钟的速度到达一个 snack
bar ,他们平均需等待 5 分钟才可以拿到食物。顾客在店里用餐的概率为 0.5 ,而顾客带走食物不在店里用餐的概率也为0.5 。顾客平均用餐时间为 20 分钟,问该snack bar 中的顾客平均数目是多少?
1: Introduction 60
习题二已知: LAN 输出给路由器平均速度为 5 分组 /秒;平均分组长度为 144字节;从路由器到广域网的线路带宽为 9600bps, 求:1 、每个分组在路由器重的平均滞留时间?2 、路由器中平均有多少个分组?
u
N
LAN Router
WAN线路
= 1.5 分组
Ts=(144*8)/9600=0.12秒 =5 分组 /秒;
1: Introduction 61
Network Architecture
What is layering?
Why layering?
ISO/OSI layering and Internet layering
How to determine the layers: the end-
to-end arguments
Summary
1: Introduction 62
Protocol “Layers”Networks are
complex! many “pieces”:
hosts routers links of various
media applications protocols hardware,
software
Question: Is there any hope of
organizing structure of network?
Or at least our discussion of networks?
1: Introduction 63
Organization of air travel
a series of steps
ticket (purchase)
baggage (check)
gates (load)
runway takeoff
airplane routing
ticket (complain)
baggage (claim)
gates (unload)
runway landing
airplane routing
airplane routing
1: Introduction 64
Organization of air travel: a different view
Layers: each layer implements a service via its own internal-layer actions relying on services provided by layer below
ticket (purchase)
baggage (check)
gates (load)
runway takeoff
airplane routing
ticket (complain)
baggage (claim)
gates (unload)
runway landing
airplane routing
airplane routing