Reference:
En | Ch | En | Ch |
---|---|---|---|
LAN | 局域网 | WAN | 广域网 |
Router | 路由器 | Switch | 交换机 |
Protocol | 协议 | Packet | 报文 |
ISP | 因特网服务提供商 | TCP | 传输控制协议 |
UDP | 用户数据报协议 | Bandwidth | 带宽 |
Infrastructure | 基础设施 | Ethernet | 以太网 |
Multiplexing | 多路复用 | Encapsulation | 封装 |
Stack | 栈 | FDM | 频分复用 |
TDM | 时分复用 | Congestion | 拥挤,阻塞 |
Intranet | 内网 | Extranet | 外网 |
计算机网络概念:
一般地说,将分散的多个计算机、终端和外部设备用通信线路
互联
起来,彼此间实现互相通信,并且计算机的硬件、软件和数据资源都可以共同使用,实现资源共享
的整个系统就叫做计算机网络
。计算机网络就是互连(互联互通)的、自治(无主从关系)的(autonomous)计算机集合。
计算机网络由以下成分组成:
End system
:主机,PC、客户端、服务器、工作站等;Intermediate System
:让终端系统构成通信的系统,包括路由器、交换机等;Network interface card,NIC
,Modem;Medium
:同轴电缆Coaxial cable
、双绞线Twisted pair
、光纤、无线等。计算机网络的分类:
拓扑分类:
规模scale
分类:
LAN
:在一个比较小的地理区域内,一组计算机实现的通信线路和无线连接;WAN
:由地理上比较分散的电信网络构成,是LAN
的对外拓展;Internet
:由许多局域网无限形成的一个世界范围的计算机网络。范围分类:
Intranet
:一般是企业的私有网络,它可以由许多互连的局域网构成,也可以在广域网中使用租赁线路;Extranet
:外网指私有网络通过互联网技术和公共通信系统来安全地共享资源和信息从而形成的网络;外网可以看做是公司内网的一部分,扩展到公司以外的用户;它也被描述为一种“精神状态”,互联网被认为是与其他公司做生意以及向客户销售产品的一种方式。什么是互联网Internet
?
组成细节角度Nuts and bolts view
:
Internet
是Network of networks
,是由大量的局域网形成的国际网络,具有松散分层的特点。
全球最大的互联网络Internet
ISP网络互联的“网络之网络”
hosts
=端系统end system
;Routers
和交换机Swithes
A packet passes through many networks
ISP
协议:控制、发送和接收报文,e.g. TCP、IP、HTTP等;
Internet是网络的网络:松散分层
网络标准Internet Standards
:
Request for comments,RFC
:改进标准;Internet Engineering Task Force,IETF
:公布标准。服务角度:
为网络应用提供通信服务的通信基础设施communication infrastructure
:让互联网实现分布式的应用,例如:Web、E-Mail等;
为网络应用提供应用编程接口(API)
供给应用程序的通信服务:
Connectionless
、不可靠unreliable
的服务;Connection-oriented
、可靠reliable
的服务。 什么是协议Protocol
?
所有的网络通信都需要受到协议的控制。协议的定义及作用如下:
网络协议是为进行网络中的数据交换而建立的规则、标准或约定,协议
Protocol
定义了在网络实体间发送和接收的消息的格式、顺序,以及当这个消息被发送和接收时所需要采取的行为。协议规范了网络中所有信息发送和接收过程。
协议的三要素?
语法(Syntax)
语义(Semantics)
时序(Timing)
事件顺序
速度匹配
略
网络的体系结构主要分为网络边缘Network edge
、网络核心Network core
、接入网络access networks
以及物理媒体physical media
四个部分。
网络边缘主要包括主机和一些在主机上运行的应用,网络核心主要包含一些路由器(转发设备),以及由这些路由器的网络(网状网络),而接入网络和物理媒体则构成了通信的线路。
网络边缘最主要的就是终端系统End systems
,也就是主机hosts
以及主机上运行的网络应用(浏览器、E-Mail等)。
在终端系统上提供服务主要采用以下模型:
客户端/服务器模型client/server model
:由客户端主机请求和接收来自长期启动的服务器always-on server
的服务,例如Web应用、文件传输FTP应用等。
对等模型peer-peer model
:尽可能少或者不使用专用服务器,通信的双方都具有双重的身份,(既可以是客户端,也可以是服务器),通信在对等实体之间直接进行,例如Skype、KaZaA、QQ等
网络边缘提供的服务主要包含以下两种:
面向连接服务connection-oriented service
:
handshaking
:在进行数据传输之前所需要进行的准备过程,其主要内容为在通信的主机间建立状态set up state
;Transmission Control Protocol,TCP
:典型的面向连接互联网服务。
loss
,则进行确认acknowledgements
和重传retransmissions
。接收端对接收的内容进行确认,而发送端则在接收端确认以后对丢失的数据进行重传;flow control
:发送端不会淹没overwhelm
接收端;congestion control
:发送端会在网络拥塞时降低发送速度。无连接服务connectionless service
:
best effort delivery
,而不关心是否成功;User Datagram Protocol,UDF
:
interconnected
的路由器的有机组合mesh
。Routing
+转发Forwarding
。网络核心解决的基本问题:如何实现数据从源主机通过网络核心送达目的主机?
在网络核心,数据的转发主要有两种方式:
电路交换circuit-switching
:每次通信都需要建立专门的电路;
对于每一个通信提供端到端的资源预留(带宽、交换机处理能力)
必须是面向连接的
通话/通信的全部时间内,通话的两个用户始终占用端到端的固定传输带宽
使用电路交换来传输计算机数据时,线路的传输效率往往很低
网络资源划分为"片"
复用Multiplexing
如何划分?
Question:
线路带宽为
1.536Mbps
,以规模为24slots/sec
的TDM
进行划分,建立连接需要500msec
。则多久可以传输完大小为640Kb
的文件?解:划分为24片则每片带宽 b w i = 1.536 M b p s 24 = 1536 K b p s 24 = 64 K b p s bw_i=\frac{1.536Mbps}{24}=\frac{1536Kbps}{24}=64Kbps bwi=241.536Mbps=241536Kbps=64Kbps。则传输时间 T t r a n = 640 K b b w i = 10 s T_{tran}=\frac{640Kb}{bw_i}=10s Ttran=bwi640Kb=10s。所以总耗时 T = T t r a n + T c o n n e c t = 10 s + 0.5 s = 10.5 s T=T_{tran}+T_{connect}=10s+0.5s=10.5s T=Ttran+Tconnect=10s+0.5s=10.5s。
将上提转换为以规模为
24channels/frequencies
的FDM
进行划分,则需要多长时间?解:每片带宽 b w i = 64 K b p s bw_i=64Kbps bwi=64Kbps,则传输时间仍然为 T t r a n = 10 s T_{tran}=10s Ttran=10s,所以总耗时也是 T = 10.5 s T=10.5s T=10.5s。
分组交换packet-switching
:所有数据在传输的过程中被划分为离散的“数据块”,而不关心每个数据块的传输过程。
共享网络资源
使用链路全部带宽
按需使用
资源竞争:
Congestion
:packets queue,wait for link usestore and forward
:节点在转发之前接收完整分组
Question:
假设有以下线路:
RRRsendRouter1Router2recieve需要转发的报文总大小为
L=7.5Mb
,划分为每个大小为l=1.5Kb
的分组,每段线路传输速率为R=1.5Mbps
,则计算传输的总延迟为多少?解:当最后一个包到达
Router1
时,还有一个包在Router2
,所以总延迟为:
D e l a y a l l = L R + 2 l R = 5 + 0.002 = 5.002 s Delay_{all}=\frac{L}{R}+\frac{2l}{R}=5+0.002=5.002s Delayall=RL+R2l=5+0.002=5.002s
分组交换:统计复用
分组交换VS电路交换
Q:如何将网络边缘接入核心网(边缘路由器)
residential access nets
institutional access networks
mobile access networks
需要关心的是:
bandwidth(bps)
Internet Server Producer
接入网络
住宅(家庭)接入:点对点接入
机构(公司接入):LAN
通过局域网连接终端与边缘路由器;
以太网:共享或专用链路连接终端与路由器;
无线接入网络Wireless access networks
通过共享的无线接入网络连接端系统与路由器
base station
或接入点access point
无线局域网LANs
:802.11b/g(WiFi)——11Mbps、54Mbps传输速率
广域无线接入
物理媒体
物理线路
Physical link
:what lies between transmitter & receiver \传输Bit
引导性媒体:电缆、光纤
非引导性媒体:无线电
1.双绞线Twisted Pair,TP
3类双绞线:传统电话线
5类双绞线:100Mbps Ethernet(交叉点密度大)
目前,在局域网中常用到的双绞线是非屏蔽双绞线UTP
,分为:3、4、5、超5、6、7类:
T568A与T568B
2.同轴电缆
3.光纤
4.无线电
Recall that a packet starts in a host (the source), passes through a series of routers, and ends its journey in another host (the destination). As a packet travels from one node (host or router) to the subsequent (随后的) node (host or router) along this path, the packet suffers from several types of delays at each node along the path.The most important of these delays are the nodal processing delay (节点传播时延), queuing delay, transmission delay, and propagation delay; together, these delays accumulate to give a total nodal delay.
Types of Delay
As part of its end-to-end route between source and destination, a packet is sent from the upstream node through router A to router B. Our goal is to characterize the nodal delay at router A. Note that router A has an outbound link leading to router B. This link is preceded by a queue (also known as a buffer). When the packet arrives at router A from the upstream node, router A examines the packet’s header to determine the appropriate outbound link for the packet and then directs the packet to this link. A packet can be transmitted on a link only if there is no other packet currently being transmitted on the link and if there are no other packets preceding it in the queue; if the link is currently busy or if there are other packets already queued for the link, the newly arriving packet will then join the queue.
Nodel Processing Delay
Queuing Delay
Transmission delay (传输时延)
Propagation Delay (传播时延)
The difference between transmission delay and propagation delay
Nodel Delay:
Question:
两个主机
A
、B
相距L=10000km
,由一条带宽R=1Mbps
的链路连接,该链路传播速度v=2.5x10e8mps
,那么:
- 传播时延
Tp
是多少?- 在这段时间内,主机
A
向链路发送了多少个bit
?- 每个
bit
间距d
是多少?解:
ATTENTION:带宽取决于链路物理特性,不更换链路就不会改变;
ATTENTION:参数 L R V \frac{LR}{V} VLR称为时延带宽积,描述了链路能够容纳的数据量,可以反映链路的利用率
T p = L V = 0.04 s n u m = T p × R = 41943 d = L n u m = 238 m Tp=\frac{L}{V}=0.04s\\ num = Tp\times R=41943\\ d=\frac{L}{num}=238m Tp=VL=0.04snum=Tp×R=41943d=numL=238m
return packets
;(关注粗体即可)
From our discussion thus far, it is apparent that the Internet is an extremely complicated system. We have seen that there are many pieces to the Internet: numerous applications and protocols, various types of end systems, packet switches, and various types of link-level media.
Horizontal layering of airline functionality
Protocal Layering
To provide structure to the design of network protocols, network designers organize protocols—and the network hardware and software that implement the protocols—in layers, each protocol belongs to one of the layers.
We are again interested in the services that a layer offers to the layer above—the so-called service model of a layer. Just as in the case of our airline example, each layer provides its service by (1) performing certain actions within that layer and by (2) using the services of the layer directly below it.
For example, the services provided by layer n+1 may include reliable delivery of messages from one edge of the network to the other. This might be implemented by using an unreliable edge-to-edge message delivery service of layer n, and adding layer n functionality to detect and retransmit lost messages.
原语:请求原语(发送端请求服务)、指示原语、响应原语、确认原语
Advantages:
Drawbacks:
one layer may duplicate lower-layer functionality;(errors checking)
functionality at one layer may need information, that is present only in another layer;(violates the goal of separation of layers)
典型的协议分层
ISO:OSI/RM (Open System Interconnective Reference Model, 开放系统互联参考模型)——理论上的模型
Seven-layer ISO OSI Reference Model | Layers’ Name (Chinese) |
---|---|
Application | 应用层 |
Presentation | 表示层 |
Session | 会话层 |
Transport | 传输层 |
Network | 网络层 |
Link | 传输链路层 |
Physical | 物理层 |
TCP/IP——工业驱动、The Heart of Internet
Five-layer ISO OSI Reference Model | Layers‘ Name (Chinese) |
---|---|
Application | 应用层 |
Transport | 传输层 |
Network | 网络层 |
Link | 传输链路层 |
Physical | 物理层 |
Protocal stack: The protocols of the various layers
Layer | Protocal stack |
---|---|
Application | FTP, SMTP, HTTP, POP3 |
Transport | TCP, UTP |
Network | IP, routing protocols, ICMP, IGMP, RIP |
Link | PPP, Etherner |
Physical(bits “on the wire”) | / |
PDUs in TCP/IP (协议数据单元)
TCP/IP protocol Suite(协议族)
实体、协议、服务和服务访问点
Routers and link-layer switches organize their networking hardware and software into layers, but routers and link-layer switches do not implement all of the layers in the protocol stack; they typically implement only the bottom layers.
Note that hosts implement all five layers; this is consistent with the view that the Internet architecture puts much of its complexity at the edges of the network
At the sending host, an application-layer message (M in Figure) is passed to the transport layer. In the simplest case, the transport layer takes the message and appends additional information (so-called transport-layer header information, H t H_t Ht in Figure) that will be used by the receiver-side transport layer. The application-layer message and the transport-layer header information together constitute the transport-layer segment. The transport-layer segment thus encapsulates the application-layer message. The added information might include information allowing the receiver-side transport layer to deliver the message up to the appropriate application, and error-detection bits that allow the receiver to determine whether bits in the message have been changed in route. The transport layer then passes the segment to the network layer, which adds network-layer header information ( H n H_n Hn in Figure) such as source and destination end system addresses, creating a network-layer datagram. The datagram is then passed to the link layer, which (of course!) will add its own link-layer header information and create a link-layer frame. Thus, we see that at each layer, a packet has two types of fields: header fields and a payload field. The payload is typically a packet from the layer above.